Good time of day to you!
I have a strange situation -- tests sometimes run in-container and sometimes outside container, what seems to be randomly. The app has an initializer; when the test is run in-container, the initializer runs, then the test, everything succeeds, and junit shows green bar. Also, stack trace (if I induce an exception to get a stack trace) shows the expected container code and the servlet code being run:
However, that only happens about 60% of the time. The other time the test seems to be run *outside* the container, the initializer fails miserably (because it can't access JNDI and therefore the DB where it needs its configuration from) and junit shows red bar; the stack trace shows the test is NOT run inside the container.
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
Yet, the @Deployment stuff runs, I see the application being deployed to and the initializer running in my container logs, then the application being undeployed. But the test does not run in those cases. The whole thing feels like there is a race condition somewhere.
I'm attaching the test case, the stack trace from a "failed" (outside-container) run, and an induced stack trace from a successful in-container run, plus my arq.xml.
Websphere AS 8 (with custom WAS8 remote container adopted from remote_8 code that was posted about 6 months ago); All the Final.1.0.0 stuff, but no Maven; IBM RSA 8 (based on Eclipse); and junit 4.
Can anyone answer? Or should I provide more information? Thanks in advance!