1 2 Previous Next 21 Replies Latest reply on Apr 5, 2006 8:00 PM by elkner

    Refactored ejb3 module unit tests in 4.0 branch

    starksm64

      The ejb3 tests would not work when the server was build with jdk1.4 even if the aspects, ejb3, and ejb3x modules were build with jdk5. The reason being that unless the overall build used jdk5 the dist structure did not contain the ejb3 artifacts. Since this is not how the installer/release is done I have added a setup-ejb3-dist target in the ejb3/build-test.xml ant file that takes the current jboss.dist and creates a duplicate dist structure with the ejb3 artifacts added:

       <target name="setup-ejb3-dist" unless="ejb3.dist.exists"
       description="Create an ejb3.dist from jboss.dist">
       <copy todir="${ejb3.dist}">
       <fileset dir="${jboss.dist}">
       <include name="bin/**" />
       <include name="client/**" />
       <include name="lib/**" />
       </fileset>
       </copy>
       <!-- Augment the client jars with the jdk5 client jars -->
       <copy todir="${ejb3.dist}/client"
       file="${project.root}/aspects/output/lib/jboss-aspect-jdk50-client.jar" />
       <copy todir="${ejb3.dist}/client"
       file="${project.root}/ejb3/output/lib/jboss-ejb3-client.jar" />
       <copy todir="${ejb3.dist}/client"
       file="${project.root}/ejb3/output/lib/hibernate-client.jar" />
       <copy todir="${ejb3.dist}/client"
       file="${project.root}/ejb3/output/lib/jboss-annotations-ejb3.jar" />
       <copy todir="${ejb3.dist}/client"
       file="${project.root}/ejb3x/output/lib/jboss-ejb3x.jar" />
       <copy todir="${ejb3.dist}/client">
       <fileset dir="${hibernate.entitymanager.lib}">
       <include name="ejb3-persistence.jar"/>
       </fileset>
       <fileset dir="${hibernate.annotations.lib}">
       <include name="hibernate-annotations.jar"/>
       </fileset>
       </copy>
       <!-- Copy default and all configs -->
       <copy todir="${ejb3.dist}/server/default">
       <fileset dir="${jboss.dist}/server/default">
       <include name="conf/**" />
       <include name="deploy/**" />
       <include name="lib/**" />
       </fileset>
       </copy>
       <copy todir="${ejb3.dist}/server/all">
       <fileset dir="${jboss.dist}/server/all">
       <include name="conf/**" />
       <include name="deploy/**" />
       <include name="deploy-hasingleton/**" />
       <include name="farm/**" />
       <include name="lib/**" />
       </fileset>
       </copy>
       <!-- Copy the ejb3 deployer services -->
       <delete includeEmptyDirs="true">
       <fileset dir="${ejb3.dist}/server/default/deploy">
       <include name="jboss-aop.deployer/**" />
       <include name="jbossws14.sar/**" />
       </fileset>
       </delete>
       <copy todir="${ejb3.dist}/server/default/deploy" filtering="no">
       <fileset dir="${module.output}/lib">
       <include name="ejb3.deployer/**"/>
       <include name="ejb3-interceptors-aop.xml"/>
       </fileset>
       </copy>
       <copy todir="${ejb3.dist}/server/default/deploy"
       file="${project.root}/aspects/output/lib/jboss-aop-jdk50.deployer" />
       <copy todir="${ejb3.dist}/server/default/deploy"
       file="${jboss.jbossws.lib}/jbossws.sar" />
      
       <delete includeEmptyDirs="true">
       <fileset dir="${ejb3.dist}/server/all/deploy">
       <include name="jboss-aop.deployer/**" />
       <include name="jbossws14.sar/**" />
       </fileset>
       </delete>
       <copy todir="${ejb3.dist}/server/all/deploy" filtering="no">
       <fileset dir="${module.output}/lib">
       <include name="ejb3.deployer/**"/>
       <include name="ejb3-interceptors-aop.xml"/>
       <include name="ejb3-entity-cache-service.xml"/>
       <include name="ejb3-clustered-sfsbcache-service.xml"/>
       </fileset>
       </copy>
       <copy todir="${ejb3.dist}/server/all/deploy"
       file="${project.root}/aspects/output/lib/jboss-aop-jdk50.deployer" />
       <copy todir="${ejb3.dist}/server/all/deploy"
       file="${jboss.jbossws.lib}/jbossws.sar" />
       </target>
      
      


      The current jboss-4.0.x/build/buid-distr.xml targets for ejb3 related artifacts should just be removed since there will never be a jboss-4.0.x dist that bundles ejb3 by default.


        • 1. Re: Refactored ejb3 module unit tests in 4.0 branch
          elkner

           

          "scott.stark@jboss.org" wrote:
          ejb3 related artifacts should just be removed since there will never be a jboss-4.0.x dist that bundles ejb3 by default.


          Well, I do and many others probably do it as well. Would be nice, if one has at least a property to tell, that the dist should be done as before (aka all in one). How about something like that:

          <target name="check4all" if="jboss.all">
           <property name="ejb3.dist.exists" value="true"/>
          </target>
          <!-- scott's new stuff -->
          <target name="setup-ejb3-dist" unless="ejb3.dist.exists" .../>
          <!-- old stuff from jboss-4.0.x/build/buid-distr.xml -->
          <target name="setup-jboss-all-dist" if="jboss.all" .../>
          


          • 2. Re: Refactored ejb3 module unit tests in 4.0 branch
            starksm64

            The dist is never done with jdk5 and ejb3 bundled in the 4.0 branch so I don't want any confusion as to what goes where. If you want to work with ejb3 bundled by default use the jboss5/head branch.

            • 3. Re: Refactored ejb3 module unit tests in 4.0 branch
              brian.stansberry

              To get the EJB3 clustered tests to work I'm going to need to add a macrodef to create node0 and node1 configs that include the ejb3 artifacts. The tests are failing because they're using the node0/node1 configs created for the clustering tests in the standard testsuite; those configs didn't have any of the ejb3 stuff.

              I'll use your new ejb3.dist as the starting point for creating the new node0/node1.

              • 4. Re: Refactored ejb3 module unit tests in 4.0 branch
                starksm64

                Thanks. This is that status I'm seeing with that update. There appear to be non-remote exceptions that are not in the client jars as well as the org/jboss/annotation/ejb/Producer

                JBoss daily test results
                
                SUMMARY
                
                Number of tests run: 254
                
                --------------------------------------------
                
                Successful tests: 227
                
                Errors: 26
                
                Failures: 1
                
                --------------------------------------------
                
                
                
                [time of test: 2006-03-30.07-22 GMT]
                [java.version: 1.5.0_05]
                [java.vendor: Sun Microsystems Inc.]
                [java.vm.version: 1.5.0_05-b05]
                [java.vm.name: Java HotSpot(TM) Client VM]
                [java.vm.info: mixed mode]
                [os.name: Windows XP]
                [os.arch: x86]
                [os.version: 5.1]
                
                Useful resources:
                
                - http://jboss.sourceforge.net/junit-results/32/2006-03-30.07-22 for
                the junit report of this test.
                
                
                NOTE: If there are any errors shown above - this mail is only highlighting
                them - it is NOT indicating that they are being looked at by anyone.
                
                It is assumed that whoever makes change(s) to jboss that
                break the test will be fixing the test or jboss, as appropriate!
                
                --------------------------------------------
                
                
                
                DETAILS OF ERRORS
                
                
                
                Suite: org.jboss.ejb3.test.asynchronous.unit.AsynchronousTestCase
                Test: testAsynchSecurity
                Type: error
                Exception: java.lang.reflect.UndeclaredThrowableException
                Message:
                ---------------------------------
                
                
                
                Suite: org.jboss.ejb3.test.bank.unit.BankDeploymentDescriptorTestCase
                Test: testStatelessTeller
                Type: error
                Exception: java.lang.NoClassDefFoundError
                Message: javax/ejb/EJBAccessException
                ---------------------------------
                
                
                
                Suite: org.jboss.ejb3.test.bank.unit.BankDeploymentDescriptorTestCase
                Test: testStatefulBank
                Type: error
                Exception: java.lang.NoClassDefFoundError
                Message: javax/ejb/EJBAccessException
                ---------------------------------
                
                
                
                Suite: org.jboss.ejb3.test.bank.unit.BankDeploymentDescriptorTestCase
                Test: testRemove
                Type: error
                Exception: java.lang.ClassNotFoundException
                Message: javax.ejb.EJBNoSuchObjectException
                ---------------------------------
                
                
                
                Suite: org.jboss.ejb3.test.bank.unit.BankDeploymentDescriptorTestCase
                Test: testTeller
                Type: error
                Exception: java.lang.NoClassDefFoundError
                Message: javax/ejb/EJBAccessException
                ---------------------------------
                
                
                
                Suite: org.jboss.ejb3.test.clusteredentity.unit.EntityUnitTestCase
                Test: testAll
                Type: error
                Exception: javax.naming.NameNotFoundException
                Message: EntityTestBean not bound
                ---------------------------------
                
                
                
                Suite: org.jboss.ejb3.test.clusteredentity.unit.EntityUnitTestCase
                Test: testServerFound
                Type: error
                Exception: org.jboss.deployment.IncompleteDeploymentException
                Message:
                ---------------------------------
                
                
                
                Suite: org.jboss.ejb3.test.consumer.unit.ConsumerUnitTestCase
                Test: testQueue
                Type: error
                Exception: java.lang.NoClassDefFoundError
                Message: Lorg/jboss/annotation/ejb/Producer;
                ---------------------------------
                
                
                
                Suite: org.jboss.ejb3.test.consumer.unit.ConsumerUnitTestCase
                Test: testDeploymentDescriptorQueue
                Type: error
                Exception: java.lang.NoClassDefFoundError
                Message: Lorg/jboss/annotation/ejb/Producer;
                ---------------------------------
                
                
                
                Suite: org.jboss.ejb3.test.consumer.unit.ConsumerUnitTestCase
                Test: testDeploymentDescriptorQueueXA
                Type: failure
                Exception: junit.framework.ComparisonFailure
                Message: expected:<...1> but was:<...2>
                ---------------------------------
                
                
                
                Suite: org.jboss.ejb3.test.dd.unit.EjbJarXmlTestCase
                Test: testUnmarshalDDXsd
                Type: error
                Exception: org.jboss.xb.binding.JBossXBException
                Message: Failed to parse source: Failed to invoke method public void org.jboss.ejb3.dd.EjbJarDDObjectFactory.setValue(org.jboss.ejb3.dd.SessionEnterpriseBean,org.jboss.xb.binding.UnmarshallingContext,java.lang.String,java.lang.String,java.lang.String), factory=org.jboss.ejb3.dd.EjbJarDDObjectFactory@1362012
                ---------------------------------
                
                
                
                Suite: org.jboss.ejb3.test.dd.unit.EjbJarXmlTestCase
                Test: testUnmarshalMdb
                Type: error
                Exception: org.jboss.xb.binding.JBossXBException
                Message: Failed to parse source: Failed to invoke method public void org.jboss.ejb3.dd.EjbJarDDObjectFactory.setValue(org.jboss.ejb3.dd.MessageDrivenBean,org.jboss.xb.binding.UnmarshallingContext,java.lang.String,java.lang.String,java.lang.String), factory=org.jboss.ejb3.dd.EjbJarDDObjectFactory@187814
                ---------------------------------
                
                
                
                Suite: org.jboss.ejb3.test.dd.web.unit.WebIntegrationUnitTestCase
                Test: testEJBServlet
                Type: error
                Exception: java.net.ConnectException
                Message: Connection refused: connect
                ---------------------------------
                
                
                
                Suite: org.jboss.ejb3.test.entityexception.unit.EntityExceptionTestCase
                Test: testEMFindExceptions
                Type: error
                Exception: javax.ejb.EJBException
                Message: org.hibernate.ObjectNotFoundException: No row with the given identifier exists: [org.jboss.ejb3.test.entityexception.Person#2]
                ---------------------------------
                
                
                
                Suite: org.jboss.ejb3.test.entityexception.unit.EntityExceptionTestCase
                Test: testEMCreateQueryExceptions
                Type: error
                Exception: java.lang.NoClassDefFoundError
                Message: antlr/RecognitionException
                ---------------------------------
                
                
                
                Suite: org.jboss.ejb3.test.entityexception.unit.EntityExceptionTestCase
                Test: testQuerySingleResultExceptions
                Type: error
                Exception: javax.ejb.EJBException
                Message: javax.persistence.NoResultException: No entity found for query
                ---------------------------------
                
                
                
                Suite: org.jboss.ejb3.test.entityexception.unit.EntityExceptionTestCase
                Test: testQuerySetHintAndParameter
                Type: error
                Exception: javax.ejb.EJBException
                Message: javax.persistence.PersistenceException: org.hibernate.HibernateException: could not locate named parameter [nosuchparam]
                ---------------------------------
                
                
                
                Suite: .
                Test: RemoteUnitTestCase
                Type: error
                Exception: java.lang.NoClassDefFoundError
                Message: javax/ejb/EJBAccessException
                ---------------------------------
                
                
                
                Suite: org.jboss.ejb3.test.interceptors2.unit.InterceptorsTestCase
                Test: testMixedConsumer
                Type: error
                Exception: java.lang.NoClassDefFoundError
                Message: Lorg/jboss/annotation/ejb/Producer;
                ---------------------------------
                
                
                
                Suite: org.jboss.ejb3.test.interceptors2.unit.InterceptorsTestCase
                Test: testDefaultOnlyConsumer
                Type: error
                Exception: java.lang.NoClassDefFoundError
                Message: Lorg/jboss/annotation/ejb/Producer;
                ---------------------------------
                
                
                
                Suite: org.jboss.ejb3.test.reference21_30.unit.ReferenceTestCase
                Test: testStatefulRemove
                Type: error
                Exception: java.lang.reflect.UndeclaredThrowableException
                Message:
                ---------------------------------
                
                
                
                Suite: org.jboss.ejb3.test.regression.ejbthree290.unit.Ejb290UnitTestCase
                Test: testMerge
                Type: error
                Exception: javax.ejb.EJBException
                Message: java.lang.RuntimeException: expected IllegalArgumentException
                ---------------------------------
                
                
                
                Suite: org.jboss.ejb3.test.regression.ejbthree440.unit.FailingTestCase
                Test: testSerializationError
                Type: error
                Exception: java.lang.reflect.UndeclaredThrowableException
                Message:
                ---------------------------------
                
                
                
                Suite: org.jboss.ejb3.test.security.unit.ServletUnitTestCase
                Test: testEJBServlet
                Type: error
                Exception: java.net.ConnectException
                Message: Connection refused: connect
                ---------------------------------
                
                
                
                Suite: org.jboss.ejb3.test.ssl.unit.SSLUnitTestCase
                Test: testSSLBindings
                Type: error
                Exception: javax.naming.NamingException
                Message: Could not dereference object
                ---------------------------------
                
                
                
                Suite: .
                Test: RemoteUnitTestCase
                Type: error
                Exception: java.lang.NoClassDefFoundError
                Message: javax/ejb/EJBNoSuchObjectException
                ---------------------------------
                
                
                
                Suite: org.jboss.ejb3.test.stateless.unit.StatelessTestCase
                Test: testRunAs
                Type: error
                Exception: java.lang.NoClassDefFoundError
                Message: javax/ejb/EJBAccessException
                ---------------------------------
                



                • 5. Re: Refactored ejb3 module unit tests in 4.0 branch
                  dimitris

                  So are we supposed to build jboss-4.0.x with jdk5?

                  With the removal of ejb3x/ejb3.0 target from build-distr.xml building with jdk5 breaks in the ejb3x module.

                   ==
                   == Finished with 'most' in module 'ejb3x'.
                   ======================================================================
                  
                  
                  _module-ejb3x-most:
                  
                  BUILD FAILED
                  X:\cvs\jboss-public\jboss-4.0\build\build.xml:596: The following error occurred
                  while executing this line:
                  Target `_module-ejb3x-most' does not exist in this project.
                  


                  • 6. Re: Refactored ejb3 module unit tests in 4.0 branch
                    kabirkhan

                    I've added jboss-ejb3x.jar to the client classpath which fixes some of these (javax/ejb/EJBAccessException etc.) , and will include the @Producer in the client jar

                    • 7. Re: Refactored ejb3 module unit tests in 4.0 branch
                      starksm64

                       

                      "dimitris@jboss.org" wrote:
                      So are we supposed to build jboss-4.0.x with jdk5?

                      With the removal of ejb3x/ejb3.0 target from build-distr.xml building with jdk5 breaks in the ejb3x module.

                       ==
                       == Finished with 'most' in module 'ejb3x'.
                       ======================================================================
                      
                      
                      _module-ejb3x-most:
                      
                      BUILD FAILED
                      X:\cvs\jboss-public\jboss-4.0\build\build.xml:596: The following error occurred
                      while executing this line:
                      Target `_module-ejb3x-most' does not exist in this project.
                      


                      No, we continue to build the dist with j2se1.4, but jdk5 should work. Can you look at this build issue.



                      • 8. Re: Refactored ejb3 module unit tests in 4.0 branch
                        elkner

                         

                        "scott.stark@jboss.org" wrote:
                        If you want to work with ejb3 bundled by default use the jboss5/head branch.


                        Hmm, would love to work with jboss5. But unfortunately it is still alpha and probably no GA ready til June 2006. Since people are a little bit picky wrt. beta/alpha ... :(

                        • 9. Re: Refactored ejb3 module unit tests in 4.0 branch
                          dimitris

                          Ok.

                          • 10. Re: Refactored ejb3 module unit tests in 4.0 branch
                            starksm64

                             

                            "elkner" wrote:
                            Hmm, would love to work with jboss5. But unfortunately it is still alpha and probably no GA ready til June 2006. Since people are a little bit picky wrt. beta/alpha ... :(


                            Then work with the ejb3.dist generated by the ejb3 module. That is the way ejb3 will be tested, and its the proceedure needs to be the documented approach for bundling an ejb3 release with jboss-4.0.x, as well as how the installer will produce the ejb3/ejb3-clustered configuration groups. The previous dumping of ejb3/java5 artifacts into the j2ee1.4 dist by default just cannot happen.


                            • 11. Re: Refactored ejb3 module unit tests in 4.0 branch
                              dimitris

                              I think we probably need to move the setup-ejb3-dist target to the main build/build.xml. So we can do something like:

                              a) build everything with jdk1.4 => normal 1.4 distro
                              b) switch to jdk5 and run a target that rebuild 'aspects', builds ejb3&ejb3x, creates the additional ejb3 configuration.

                              • 12. Re: Refactored ejb3 module unit tests in 4.0 branch
                                starksm64

                                Ok. So there needs to be a j2se1.4 pass, and a java5 pass that simply does nothing if java5 is not available.

                                • 13. Re: Refactored ejb3 module unit tests in 4.0 branch
                                  brian.stansberry

                                   

                                  "scott.stark@jboss.org" wrote:
                                  Thanks. This is that status I'm seeing with that update. There appear to be non-remote exceptions that are not in the client jars as well as the org/jboss/annotation/ejb/Producer

                                  . . .
                                  
                                  Suite: org.jboss.ejb3.test.clusteredentity.unit.EntityUnitTestCase
                                  Test: testAll
                                  Type: error
                                  Exception: javax.naming.NameNotFoundException
                                  Message: EntityTestBean not bound
                                  ---------------------------------
                                  
                                  
                                  
                                  Suite: org.jboss.ejb3.test.clusteredentity.unit.EntityUnitTestCase
                                  Test: testServerFound
                                  Type: error
                                  Exception: org.jboss.deployment.IncompleteDeploymentException
                                  Message:
                                  ---------------------------------
                                  



                                  Just wondering if when you ran your tests you'd picked up a change I'd made at 9:28 PST to /ejb3/src/resources/test/clusteredentity/META-INF/persistence.xml? With that the clustered tests passed on my machine. If you had that change, then there is still an issue with the test.

                                  • 14. Re: Refactored ejb3 module unit tests in 4.0 branch
                                    starksm64

                                     

                                    "bstansberry@jboss.com" wrote:

                                    Just wondering if when you ran your tests you'd picked up a change I'd made at 9:28 PST to /ejb3/src/resources/test/clusteredentity/META-INF/persistence.xml? With that the clustered tests passed on my machine. If you had that change, then there is still an issue with the test.

                                    No I did not.

                                    1 2 Previous Next