-
1. Re: Selenium Test passes, but shouldn't! Why?
aslak Nov 26, 2012 11:38 AM (in response to pogopaule)1 of 1 people found this helpfulThis is probably due to GlassFish Embedded leaking classes / resources from Application ClassLoader.
You define a web.xml that points to classes available on classpath, not the WebDeployment ClassLoader, but coming in from the Application ClassLoader.
If you want full isolation you currently need to use the glassfish-managed container instead. That forks GlassFish in a new jvm.
http://arquillian.org/modules/glassfish-managed-3.1-container-adapter/
-
2. Re: Selenium Test passes, but shouldn't! Why?
pogopaule Nov 27, 2012 4:14 AM (in response to aslak)Thank you Aslak for your quick reply!
I need to run an emedded version of glassfish. The remote and the managed adapter are not really what I want.
Is this leaking of classes you describe a problem of Glassfish or Wicket or both? What about other containers and other frameworks like JSF?
Is there a way to prevent this leaking in glassfish-embedded?
Cheers,
Fabian
-
3. Re: Selenium Test passes, but shouldn't! Why?
vineet.reynolds Nov 27, 2012 4:43 AM (in response to pogopaule)1 of 1 people found this helpfulThe embedded GlassFish container (and most/all other embedded containers) will have this problem. If you're using Surefire and running the tests in a forked VM, the system classloader is responsible for loading both the embedded container and the application classes. The web-app classloader for the deployed app defers to the system classloader and will therefore see classes that may be omitted in the ShrinkWrap archive, but happen to be a part of the Surefire classpath. The same is true even of the testrunner used by the IDE - the classloader will load classes off target/classes or bin/classes (or whatever) and omitting some of the classes from a ShrinkWrap archive would not matter eventually.
The only way to prevent this is to use a managed or remote container since it's system classloader would not be polluted. That way, the deployed archive would be the codesource for the classes that are looked up by the web-app classloader. Loading of other classes would be deferred to the parent classloader(s).