« October 2008 | Main | December 2008 »

November 10, 2008

JUnit Testing issues

One thing I'm working on right now is setting up JUnit tests for code which was designed to run inside a J2EE container. (Technically, -my- code couldn't care less - my code is written as modular POJOs whenever possible/reasonable. But the overall integrated app it's going to be used in a J2EE container, most likely WebLogic 10.3.)

I'm tracking some links for helpful hints using JUnit...

JUnit Testing JNDI Datasources: Thinking outside of the Container -
http://www.ericholsinger.com/programming/java/junit-testing-jndi-datasources-thinking-outside-of-the-container/

JavaRanch FAQ : Libraries and Frameworks -
http://faq.javaranch.com/java/CodeBarnLibrariesAndFrameworks

Testing a data source-based application using JUnit and IBM Rational Application Designer - http://www.ibm.com/developerworks/rational/library/08/0219_jadhav/

Injecting JNDI datasources for JUnit Tests outside of a container - Randy's Stuph - http://blogs.sun.com/randystuph/entry/injecting_jndi_datasources_for_junit

All that said, the database still has to be accessable, there needs to be a 'tests' user so that the real data in the system doesn't conflict with the tests, and vice versa... It's not a bad thing, it's just a pain in the rear... As so many of the things I seem to be tasked with are... :-)


Notes to self:

1) Create DB Tablespace for test user
2) Create DB temp Tablespace for test user
[Are these necessary, or will registering the schemas locally be sufficient?]
3) Create DB test user
4) Create JNDI DB Datasource auth with test user.
5) Load schema into DB directory resource (I'm using Oracle XML DB)

... to be edited if there are any other 'master steps' that can't be put into the JUnit tests ...

Posted by aland at 3:43 PM | Comments (0) | TrackBack