-
1. Re: Testing persistence example
tdtappe Mar 14, 2012 12:14 PM (in response to tdtappe)BTW, running the test from within Eclipse I do get the exception:
java.lang.IllegalArgumentException: ArquillianServletRunner not found. Could not determine ContextRoot from ProtocolMetadata, please contact DeployableContainer developer.
-
2. Re: Testing persistence example
aslak Mar 14, 2012 12:17 PM (in response to tdtappe)got the NullPointerException stack trace?
-
3. Re: Testing persistence example
tdtappe Mar 15, 2012 4:06 AM (in response to aslak)Oh, stupid me... I should have given some info about the NPE. Here we go...
The NPE occurs because of injected fields being null (UserTransaction utx, EntityManager em):
java.lang.NullPointerException
at org.arquillian.example.GamePersistenceTest.clearDatabase(GamePersistenceTest.java:56)
at org.arquillian.example.GamePersistenceTest.preparePersistenceTest(GamePersistenceTest.java:50)
...
-
4. Re: Testing persistence example
aslak Mar 15, 2012 10:34 AM (in response to tdtappe)I just updated the Arquillian-Showcase to fix a bug in the source related to the same / similar example with GlassFish
If you try the jpa example there:
git clone git://github.com/arquillian/arquillian-showcase.git
cd arquillian-showcase
mvn clean install -Parq-glassfish-embedded -f jpa/pom.xml
If you figure out what you got wrong in your setup by following the guide, compared to the showcase.. Please let me know so we can fix the guide..
https://github.com/arquillian/arquillian-showcase/commit/750910f12d00fdf1347eec63b0ea734cfe6b69d6
-
5. Re: Testing persistence example
tdtappe Mar 15, 2012 1:30 PM (in response to aslak)On first attempt I run into
[ERROR] Failed to execute goal on project arquillian-showcase-jpa: Could not resolve dependencies for project org.jboss.arquillian.showcase:arquillian-showcase-jpa:jar:1.0.0-SNAPSHOT:
Failure to find org.jboss.arquillian.showcase:container-bom-glassfish-embedded-3.1:pom:1.0.0-SNAPSHOT in http://nightcrawler.transdata.net:55555/archiva/repository/snapshots/
was cached in the local repository, resolution will not be reattempted until the update interval of snapshots has elapsed or updates are forced -> [Help1]
Which repository contains the missing dependency?
-
6. Re: Testing persistence example
aslak Mar 15, 2012 1:35 PM (in response to tdtappe)Oh yea, sorry.. they are in the same project.. do:
mvn clean install -f container-boms/pom.xml
-
7. Re: Testing persistence example
tdtappe Mar 15, 2012 2:05 PM (in response to aslak)Ok, had to install parent first because of:
[ERROR] Failed to execute goal on project arquillian-showcase-jpa: Could not resolve dependencies for project org.jboss.arquillian.showcase:arquillian-showcase-jpa:jar:1.0.0-SNAPSHOT:
Failed to collect dependencies for [org.hibernate:hibernate-jpamodelgen:
jar:1.1.1.Final (provided),
junit:junit:jar:4.8.1 (test),
org.jboss.arquillian.junit:arquillian-junit-container:jar:1.0.0.CR7 (compile),
org.jboss.arquillian.protocol:arquillian-protocol-servlet:jar:1.0.0.CR7 (compile),
org.jboss.arquillian.showcase:container-bom-glassfish-embedded-3.1:pom:1.0.0-SNAPSHOT (test)]:
Failed to read artifact descriptor for org.jboss.arquillian.showcase:
container-bom-glassfish-embedded-3.1:pom:1.0.0-SNAPSHOT:
Could not find artifact org.jboss.arquillian.showcase:arquillian-showcase-parent:pom:1.0.0-SNAPSHOT in snapshots (http://nightcrawler.transdata.net:55555/archiva/repository/snapshots/) -> [Help 1]
After that I could install container-boms and finally successfully run the jpa tests!
Now I will have a closer look at what's different between my jpa tests and yours.
Thanks a lot so far, Aslak - I will report back...
--Heiko