Hi Achim,
Am 07.11.2011 10:47, schrieb Achim Nierbeck:
The test cases are rather complex where I need to add certain bundles to the
test-container through the start-up method for example:
https://github.com/ops4j/org.ops4j.pax.web/blob/master/itest/src/test/java/org/ops4j/pax/web/itest/WarFormAuthIntegrationTest.java
https://github.com/ops4j/org.ops4j.pax.web/blob/master/itest/src/test/java/org/ops4j/pax/web/itest/WarJSFIntegrationTest.java
These are some examples I just could remember which didn't seem to work
with native container.
I tried running your Pax Web tests in the Pax Exam Native Container,
simply by editing the container dependency in itest/pom.xml, and I made
some progress after some minor changes.
Some issues:
1) pax-logging-api 1.6.2 is provisioned by Pax Exam by default. Your
ITestBase also provisions pax-logging-api with version 1.6.3. One of the
two bundles does not resolve due to package uses conflicts. I deleted
pax-logging-api from ITestBase.
2) WarFormAuthIntegrationTest is trying to start a fragment bundle. I
changed the corresponding line to
mavenBundle().groupId("org.ops4j.pax.web.samples").artifactId("jetty-auth-config-fragment").version(getProjectVersion()).noStart()
3) I have no clue how to activate a console or shell in Felix (does
anyone know?), so I tried Equinox, by replacing the Felix dependency in
the POM and by adding
frameworkProperty("osgi.console").value("6666"),
to ITestBase
After that, the WarFormAuthIntegrationTest passes.
4) Switching back to Felix, the test fails. It seems the web app does
not get published.
The following log messages from the successful Equinox run do NOT appear
when running under Felix:
org.ops4j.pax.web.pax-web-extender-war[org.ops4j.pax.web.extender.war.internal.WebXmlObserver]
: Parsed web app [WebApp{displayName=Pax Web Extender WAR
Sample,contextName=null,m_httpContext=null}]
org.ops4j.pax.web.pax-web-extender-war[org.ops4j.pax.web.extender.war.internal.WebEventDispatcher]
: Sending web event WebEvent [replay=false, type=1,
bundle=mvn_org.ops4j.pax.web.samples_war-formauth_2.0.0
5) Same problem with WarJSFIntegrationTest, this time also when running
under Equinox. The web app does not get published and the HTTP clients
receive a 404.
That's all I can say at the moment, I don't know enough about Pax Web to
find out why the apps do not get published.
A possible cause for the different behaviour of the Native Container vs
the Pax Runner Container might be classloader issues - some classes from
the application class loader might be leaking into the bundle class
loaders, and if any class in Pax Web or Jetty tries to access the System
classloader directly, there's no way that Pax Exam can avoid that, but
this is bound to cause trouble...
6) While writing this, I remembered some Felix-specific issues discussed
in http://team.ops4j.org/browse/PAXEXAM-274. After adding the same
configuration option,
frameworkProperty( "felix.bootdelegation.implicit" ).value( "false" ),
WarFormAuthIntegrationTest now also works under Felix. No difference for
WarJSFIntegrationTest, though...
Hope that helps,
Harald
_______________________________________________
general mailing list
general@lists.ops4j.org
http://lists.ops4j.org/mailman/listinfo/general