Andrus Adamchik wrote:
> Are you seeing this line in the logs prior to the unit tests?
> 
>  *** CayenneAgent starting...
> 
Yes! Here:
> gilbert..i-des05:~/dev/netbeans-config/workspace/gfi/core> mvn test -Pcayenne
> [INFO] Scanning for projects...
> [INFO] ------------------------------------------------------------------------
> [INFO] Building Finan�as e Invent�rio - Core
> [INFO]    task-segment: [test]
> [INFO] ------------------------------------------------------------------------
> [INFO] [resources:resources]
> [INFO] Using encoding: 'ISO-8859-15' to copy filtered resources.
> [INFO] [compiler:compile]
> [INFO] Compiling 1 source file to /home/gilberto/dev/netbeans-config/workspace/gfi/core/target/classes
> [INFO] [resources:testResources]
> [INFO] Using encoding: 'ISO-8859-15' to copy filtered resources.
> [INFO] [compiler:testCompile]
> [INFO] Nothing to compile - all classes are up to date
> [INFO] [surefire:test]
> [INFO] Surefire report directory: /home/gilberto/dev/netbeans-config/workspace/gfi/core/target/surefire-reports
> *** CayenneAgent starting...
> 
> -------------------------------------------------------
>  T E S T S
> -------------------------------------------------------
> Running com.gilbertoca.gfi.service.PessoaServiceTest
> Dec 11, 2007 2:02:10 PM org.apache.cayenne.jpa.Provider createEntityManagerFactory
> INFO: Extra PersistenceUnitInfo properties: null
> Dec 11, 2007 2:02:10 PM org.apache.cayenne.jpa.instrument.InstrumentingUnit addTransformer
> INFO: *** Adding transformer: org.apache.cayenne.jpa.instrument.UnitClassTransforme..a3a1e
> Tests run: 2, Failures: 0, Errors: 2, Skipped: 0, Time elapsed: 0.537 sec <<< FAILURE!
> Running com.gilbertoca.gfi.AppTest
> Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.011 sec
> 
> Results :
> 
> Tests in error:
>   hello(com.gilbertoca.gfi.service.PessoaServiceTest)
>   hello(com.gilbertoca.gfi.service.PessoaServiceTest)
> 
> Tests run: 3, Failures: 0, Errors: 2, Skipped: 0
> 
> [INFO] ------------------------------------------------------------------------
> [ERROR] BUILD FAILURE
> [INFO] ------------------------------------------------------------------------
> [INFO] There are test failures.
> [INFO] ------------------------------------------------------------------------
> [INFO] For more information, run Maven with the -e switch
> [INFO] ------------------------------------------------------------------------
> [INFO] Total time: 4 seconds
> [INFO] Finished at: Tue Dec 11 14:02:10 BRT 2007
> [INFO] Final Memory: 6M/14M
> [INFO] ------------------------------------------------------------------------
and this one:
> gilbert..i-des05:~/dev/netbeans-config/workspace/gfi/core> ll target/surefire-reports/
> com.gilbertoca.gfi.AppTest.txt
> com.gilbertoca.gfi.service.PessoaServiceTest.txt
> TEST-com.gilbertoca.gfi.AppTest.xml
> TEST-com.gilbertoca.gfi.service.PessoaServiceTest.xml
> gilbert..i-des05:~/dev/netbeans-config/workspace/gfi/core> cat target/surefire-reports/com.gilbertoca.gfi.service.PessoaServiceTest.txt
> -------------------------------------------------------------------------------
> Test set: com.gilbertoca.gfi.service.PessoaServiceTest
> -------------------------------------------------------------------------------
> Tests run: 2, Failures: 0, Errors: 2, Skipped: 0, Time elapsed: 0.536 sec <<< FAILURE!
> hello(com.gilbertoca.gfi.service.PessoaServiceTest)  Time elapsed: 0.478 sec  <<< ERROR!
> java.lang.IllegalStateException: Attempt to add a transformer failed - instrumentation is not initialized.
>         at org.apache.cayenne.jpa.instrument.InstrumentingUnit.addTransformer(InstrumentingUnit.java:69)
>         at org.apache.cayenne.jpa.Provider.createContainerEntityManagerFactory(Provider.java:243)
>         at org.apache.cayenne.jpa.Provider.createEntityManagerFactory(Provider.java:194)
>         at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:83)
>         at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:60)
>         at com.gilbertoca.gfi.service.PessoaServiceTest.setUp(PessoaServiceTest.java:32)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>         at java.lang.reflect.Method.invoke(Method.java:585)
>         at org.junit.internal.runners.MethodRoadie.runBefores(MethodRoadie.java:122)
>         at org.junit.internal.runners.MethodRoadie.runBeforesThenTestThenAfters(MethodRoadie.java:86)
>         at org.junit.internal.runners.MethodRoadie.runTest(MethodRoadie.java:77)
>         at org.junit.internal.runners.MethodRoadie.run(MethodRoadie.java:42)
>         at org.junit.internal.runners.JUnit4ClassRunner.invokeTestMethod(JUnit4ClassRunner.java:88)
>         at org.junit.internal.runners.JUnit4ClassRunner.runMethods(JUnit4ClassRunner.java:51)
>         at org.junit.internal.runners.JUnit4ClassRunner$1.run(JUnit4ClassRunner.java:44)
>         at org.junit.internal.runners.ClassRoadie.runUnprotected(ClassRoadie.java:27)
>         at org.junit.internal.runners.ClassRoadie.runProtected(ClassRoadie.java:37)
>         at org.junit.internal.runners.JUnit4ClassRunner.run(JUnit4ClassRunner.java:42)
>         at org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:62)
>         at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.executeTestSet(AbstractDirectoryTestSuite.java:138)
>         at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.execute(AbstractDirectoryTestSuite.java:125)
>         at org.apache.maven.surefire.Surefire.run(Surefire.java:132)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>         at java.lang.reflect.Method.invoke(Method.java:585)
>         at org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(SurefireBooter.java:290)
>         at org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:818)
Other thing, I've setup toplink and openjpa, the test works!
Gilberto
This archive was generated by hypermail 2.0.0 : Tue Dec 11 2007 - 12:04:18 EST