We are using JUnit4 on IBM's Rational Software Architect version 7.0.0.2 using Eclipse version 3.2 ( I believe ).
It looks like the @BeforeClass annotation method does not get executed using Eclipse. I'm not sure whats going on. I tried it with and without this method:
public static junit.framework.Test suite() { return new JUnit4TestAdapter(PolicyBOPTest.class); }
Have any of you encountered this and found a solution ? Any info would be appreciated. Thanks
My guess would be that the problem is due to your class extending from TestCase (indirectly through CactusStrutsTestCase).
For example, try running this class with and without "extends TestCase":
Chris Voge
Ranch Hand
Joined: Jul 25, 2005
Posts: 34
posted
0
That seemed to do the trick. However, now I'm getting a different error.
javax.naming.ConfigurationException: Name space accessor for the java: name space has not been set. Possible cause is that the user is specifying a java: URL name in a JNDI Context method call but is not running in a J2EE client or server environment.
I've seen executing the launchClient.bat file might be able to resolve this, but I'm not real familiar with it. Any other ideas ?
Thanks, Chris
Lasse Koskela
author
Sheriff
Joined: Jan 23, 2002
Posts: 11962
5
posted
0
This sounds like it might be server-specific. Which application server are you running against?
Could you figure out what kind of a JNDI URL your test is trying to connect with and post that to the respective product's forum.
Chris, This is happening because you are no longer extending CactusTestCase. You could try instantiating a CactusTestCase and calling its setUp/tearDown methods from within @Before and @After. Or you could write a JUnit 3.8 style test and keep the superclass.