czwartek, 8 października 2009

Java 7 Coin proposals

I've just found out that Coin project has released final list of Java 7 proposals! You can find them on Joseph Darcy's blog. Among others, list includes few very interesting (from Java dev point of view) things:
Unfortunately, both closures and improved exception handling were dropped from Java 7. Well, maybe next time... Still, enhancements coming with Java 7 seems to be great and - what's important - concentrated on relieving the typical pain of a Java programmer. Keep it that way!

piątek, 2 października 2009

Testing with... Oracle XE

This is rather "infrastructure" than "testing" post.
Sometimes it happens that developer needs to tie his business logic with fixed database provider, just to obtain required functionality. In my case it was Oracle >= 10g and functionality was regular expression support (REGEX_LIKE, REGEXP_INSTR, REGEXP_SUBSTR, REGEX_REPLACE functions). Hence testing code has to refrain from using quick, agile DB backends (as HSQL) and setup something more heavyweight.
Those who happened to install/configure full-blown Oracle know how hard can this be. Fortunately Oracle came up with solution by releasing Oracle XE database. In Linux with dpkg installation is as easy as:

  • get DEB package
  • run dpkg -i package
  • /etc/init.d/oracle-xe configure

And that's it! We have fully-functional Oracle DB in our own host :) Web UI, typically available under let user log in as SYS and manage database just as using sqlplus.
There is however one caveat - when connecting via JDBC, user will very probably get stranfge exceptions with error code ORA-12519, meaning "TNS:no appropriate service handler found". Typical SQL exception is:

oracle xe Io exception:
Connection refused

This is caused by a bug in how Oracle XE handles monitoring processes, Fix is pretty straightforward:

  • stop db: /etc/init.d/oracle-xe stop
  • start it again: /etc/init.d/oracle-xe start

Voila! Enjoy your integration testing with brand-new Oracle Express Edition.