Re: [SOLVED] Re: jpa provider

From: Gilberto C Andrade (gilbertoc..ecad.to.gov.br)
Date: Tue Dec 18 2007 - 08:32:24 EST

  • Next message: Adam Yocum: "Re: Help with ROP and Cayenne 3.0M2 on Glassfish"

    > Ok, switching Surefire to 2.2 and the unit test to JUnit 3 actually
    > resulted in a successful run. So I went back to that old thread and
    > actually read it :-)
    >
    > http://objectstyle.org/cayenne/lists/cayenne-devel/2007/03/0065.html
    >
    > and it turns out that we need this for the surefire plugin:
    >
    > <useSystemClassLoader>true</useSystemClassLoader>
    >

    Fine, the enhancer now works, but ...

    > -------------------------------------------------------
    > T E S T S
    > -------------------------------------------------------
    > Running com.gilbertoca.gfi.service.PessoaServiceTest
    > [INFO] Provider - Extra PersistenceUnitInfo properties: null
    > [DEBUG] Configuration - added domain: gfi-corePU
    > [INFO] InstrumentingUnit - *** Adding transformer: org.apache.cayenne.jpa.instrument.UnitClassTransforme..f3ce5c
    > [INFO] UnitClassTransformer - Will transform managed class: com/gilbertoca/gfi/model/inventario/Item
    > [INFO] Enhancer - enhancing class com/gilbertoca/gfi/model/inventario/Item
    > [INFO] UnitClassTransformer - Will transform managed class: com/gilbertoca/gfi/model/inventario/UnidadeMedida
    > [INFO] Enhancer - enhancing class com/gilbertoca/gfi/model/inventario/UnidadeMedida
    > [INFO] UnitClassTransformer - Will transform managed class: com/gilbertoca/gfi/model/inventario/Produto
    > [INFO] Enhancer - enhancing class com/gilbertoca/gfi/model/inventario/Produto
    > Tests run: 2, Failures: 0, Errors: 2, Skipped: 0, Time elapsed: 1.048 sec <<< FAILURE!
    > Running com.gilbertoca.gfi.service.InventarioServiceTest
    > [INFO] Provider - Extra PersistenceUnitInfo properties: null
    > [DEBUG] DataRowStore - DataRowStore property cayenne.DataRowStore.snapshot.expiration = 7200
    > [DEBUG] DataRowStore - DataRowStore property cayenne.DataRowStore.snapshot.size = 10000
    > [DEBUG] DataRowStore - DataRowStore property cayenne.DataRowStore.remote.notify = false
    > [DEBUG] DataRowStore - DataRowStore property cayenne.DataRowStore.EventBridge.factory = org.apache.cayenne.event.JavaGroupsBridgeFactory
    > [INFO] QueryLogger - --- transaction started.
    > [INFO] Provider - Extra PersistenceUnitInfo properties: null
    > [INFO] QueryLogger - --- transaction started.
    > [INFO] Provider - Extra PersistenceUnitInfo properties: null
    > [INFO] QueryLogger - --- transaction started.
    > [INFO] Provider - Extra PersistenceUnitInfo properties: null
    > [INFO] QueryLogger - --- transaction started.
    > Tests run: 8, Failures: 0, Errors: 8, Skipped: 0, Time elapsed: 0.167 sec <<< FAILURE!
    >
    > Results :
    >
    > Tests in error:
    > hello(com.gilbertoca.gfi.service.PessoaServiceTest)
    > hello(com.gilbertoca.gfi.service.PessoaServiceTest)
    > persistRemoveUnidadeMedidaTest(com.gilbertoca.gfi.service.InventarioServiceTest)
    > persistRemoveUnidadeMedidaTest(com.gilbertoca.gfi.service.InventarioServiceTest)
    > persistRemoveCategoriaTest(com.gilbertoca.gfi.service.InventarioServiceTest)
    > persistRemoveCategoriaTest(com.gilbertoca.gfi.service.InventarioServiceTest)
    > persistRemoveProdutoTest(com.gilbertoca.gfi.service.InventarioServiceTest)
    > persistRemoveProdutoTest(com.gilbertoca.gfi.service.InventarioServiceTest)
    > persistRemoveItemTest(com.gilbertoca.gfi.service.InventarioServiceTest)
    > persistRemoveItemTest(com.gilbertoca.gfi.service.InventarioServiceTest)
    >
    > Tests run: 10, Failures: 0, Errors: 10, Skipped: 0
    >
    > [INFO] ------------------------------------------------------------------------
    > [ERROR] BUILD FAILURE
    > [INFO] ------------------------------------------------------------------------
    > [INFO] There are test failures.
    > [INFO] ------------------------------------------------------------------------

    and the error:

    > 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: 1.048 sec <<< FAILURE!
    > hello(com.gilbertoca.gfi.service.PessoaServiceTest) Time elapsed: 0.971 sec <<< ERROR!
    > java.lang.IllegalArgumentException: Null id Produto.cd_produto
    > at org.apache.cayenne.jpa.bridge.DataMapConverter$JpaJoinColumnVisitor.onStartNode(DataMapConverter.java:454)
    > at org.apache.cayenne.util.TraversalUtil.traverse(TraversalUtil.java:92)
    > at org.apache.cayenne.util.TraversalUtil.traverse(TraversalUtil.java:113)
    > at org.apache.cayenne.util.TraversalUtil.traverse(TraversalUtil.java:113)
    > at org.apache.cayenne.util.TraversalUtil.traverse(TraversalUtil.java:118)
    > at org.apache.cayenne.util.TraversalUtil.traverse(TraversalUtil.java:113)
    > at org.apache.cayenne.util.TraversalUtil.traverse(TraversalUtil.java:80)
    > at org.apache.cayenne.jpa.bridge.DataMapConverter.toDataMap(DataMapConverter.java:95)
    > at org.apache.cayenne.jpa.Provider.createContainerEntityManagerFactory(Provider.java:248)
    > 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)
    >
    > hello(com.gilbertoca.gfi.service.PessoaServiceTest) Time elapsed: 0.975 sec <<< ERROR!
    > java.lang.NullPointerException
    > at com.gilbertoca.gfi.service.PessoaServiceTest.tearDown(PessoaServiceTest.java:38)
    > 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.runAfters(MethodRoadie.java:138)
    > at org.junit.internal.runners.MethodRoadie.runBeforesThenTestThenAfters(MethodRoadie.java:92)
    > 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)

    Gilberto



    This archive was generated by hypermail 2.0.0 : Tue Dec 18 2007 - 08:29:16 EST