]
Shane Bryzak closed JBSEAM-3638.
--------------------------------
Resolution: Done
Assignee: Shane Bryzak
Fixed in SVN.
SeamTest causing NPE when run in multi-module Maven project on Linux
--------------------------------------------------------------------
Key: JBSEAM-3638
URL:
https://jira.jboss.org/jira/browse/JBSEAM-3638
Project: Seam
Issue Type: Patch
Components: Test Harness
Affects Versions: 2.1.0.GA
Environment: Linux, Java 1.5.0_13, Maven 2.0.8, Surefire 2.4.3
Reporter: Petr Nejedly
Assignee: Shane Bryzak
Fix For: 2.1.1.CR1
Hi,
we have a multi-module Maven setup and running tests in test and integration-test phases.
We're using Embedded EJB container for the integration tests. Since migrating to Seam
2.1.0.GA, SeamTest based tests are failing during startSeam(), more precisely
createServletContext(). It's trying to instantiate MockServletContext, causing NPE on
line:
webappRoot = new File(getClass().getResource("/").toURI());
This is only happening, however, when run on Linux machine from the parent pom file
(works on Windows every time and on Linux when run from a sub-project). Basically the NPE
is caused by getResource("/") returning null. Seems to be working when replaced
by:
webappRoot = new File(getClass().getResource("/.").toURI());
I'm a bit stuck here, since this code is in the default constructor of the
MockServletContext class so overwriting it will not help.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: