8 Replies Latest reply on Mar 26, 2010 4:46 AM by wolfc

    Fixing the EJB3 testsuite...

    clebert.suconic

      I've tried fixing the testsuite myself.. but the build is somewhat... well... broken now... So, I will just provide you guys a quick howto, and you guys can do it.

       

      I've tried to upgrade the jboss-test dependency as required to fix it.. and it kept pulling the older version it used to. I guess there is something getting it indirectly.

       

       

      Basically, there is a package now on JBossTest that will decide how to make the deployment of destinations. If you look at the latest jboss-test project, you will see JBossJMSTestCase and the org.jboss.test.jms.JMSTestAdmin.

       

       

      The attached patch here is fixing one of the tests. Take a look it should be easy to understand.

       

      also.. there's another issue.. as you need to adjust the classpath as the tests didn't get the newest hornetq libraries.

        • 1. Re: Fixing the EJB3 testsuite...
          jaikiran

          Clebert Suconic wrote:

           

          also.. there's another issue.. as you need to adjust the classpath as the tests didn't get the newest hornetq libraries.

          The EJB3 testsuide adds all the jars that are in JBOSS_HOME/client folder to its classpath. So as long as the JBOSS_HOME/client folder has the right set of hornetq jars, it should work.

          • 2. Re: Fixing the EJB3 testsuite...
            clebert.suconic

            Ok.. I will fix the client code.

             

            But I won't be able to fix the EJB3 testsuite. that's why I provided you guys the patch and a howto. (I couldn't figure out how to fix the dependencies)

            • 3. Re: Fixing the EJB3 testsuite...
              wolfc

              I've applied the patch with a minor modification. Rev 102770 can serve as a template to fix the other tests.

              Commits should go under: EJBTHREE-2057

               

              Note that I get:

              javax.jms.JMSException: Failed to initialise session factory
                  at org.hornetq.core.client.impl.ClientSessionFactoryImpl.createSessionInternal(ClientSessionFactoryImpl.java:1043)
                  at org.hornetq.core.client.impl.ClientSessionFactoryImpl.createSession(ClientSessionFactoryImpl.java:790)
                  at org.hornetq.jms.client.HornetQConnection.authorize(HornetQConnection.java:572)
                  at org.hornetq.jms.client.HornetQConnectionFactory.createConnectionInternal(HornetQConnectionFactory.java:602)
                  at org.hornetq.jms.client.HornetQConnectionFactory.createConnection(HornetQConnectionFactory.java:116)
                  at org.hornetq.jms.client.HornetQConnectionFactory.createConnection(HornetQConnectionFactory.java:111)
                  at org.jboss.ejb3.mdb.ProducerManagerImpl.connect(ProducerManagerImpl.java:221)
                  at org.jboss.ejb3.test.interceptors2.unit.InterceptorsTestCase.testMixedConsumer(InterceptorsTestCase.java:610)
                  at junit.extensions.TestDecorator.basicRun(TestDecorator.java:24)
                  at junit.extensions.TestSetup$1.protect(TestSetup.java:23)
                  at junit.extensions.TestSetup.run(TestSetup.java:27)
                  at junit.extensions.TestDecorator.basicRun(TestDecorator.java:24)
                  at junit.extensions.TestSetup$1.protect(TestSetup.java:23)
                  at junit.extensions.TestSetup.run(TestSetup.java:27)
              Caused by: HornetQException[errorCode=0 message=Failed to initialise session factory]
              Caused by: java.lang.IllegalArgumentException: Error instantiating connector factory "org.hornetq.integration.transports.netty.NettyConnectorFactory"
                  at org.hornetq.core.client.impl.FailoverManagerImpl.instantiateConnectorFactory(FailoverManagerImpl.java:1016)
                  at org.hornetq.core.client.impl.FailoverManagerImpl.<init>(FailoverManagerImpl.java:228)
                  at org.hornetq.core.client.impl.ClientSessionFactoryImpl.initialise(ClientSessionFactoryImpl.java:237)
                  at org.hornetq.core.client.impl.ClientSessionFactoryImpl.createSessionInternal(ClientSessionFactoryImpl.java:1039)
              Caused by: java.lang.ClassNotFoundException: org.hornetq.integration.transports.netty.NettyConnectorFactory
                  at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
                  at java.security.AccessController.doPrivileged(Native Method)
                  at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
                  at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
                  at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
                  at java.lang.ClassLoader.loadClass(ClassLoader.java:252)
                  at org.hornetq.core.client.impl.FailoverManagerImpl.instantiateConnectorFactory(FailoverManagerImpl.java:1011)
              
              

              I guess the client side classes of HornetQ are not yet available in $JBOSS_HOME/client (and jbossall-client.jar Class-Path).

              • 4. Re: Fixing the EJB3 testsuite...
                clebert.suconic

                Carlo wrote: "I guess the client side classes of HornetQ are not yet available in $JBOSS_HOME/client (and jbossall-client.jar Class-Path)."

                 

                 

                I will tweak that by the end of the week.. of if anyone knows how to fix it easily... any help is appreciated.

                • 5. Re: Fixing the EJB3 testsuite...
                  jaikiran

                  Haven't looked at any changes around that recently, but my understanding is - if you add you hornetq jar (the one containing the missing classes) to the JBOSS_HOME/client folder (through AS_TRUNK/build/build.xml) then the rest of the build process automagically adds your jar to the ClassPath attribute of jbossall-client.jar. In short, the ClassPath attribute of jbossall-client.jar is autogenerated.

                  • 6. Re: Fixing the EJB3 testsuite...
                    wolfc

                    To fire up the tests I had to copy hornetq-transports.jar into $JBOSS_HOME/client.

                    • 7. Re: Fixing the EJB3 testsuite...
                      jaikiran
                      • 8. Re: Fixing the EJB3 testsuite...
                        wolfc

                        The LegacyJMSTestAdmin creates a faulty XML:

                        <?xml version="1.0" encoding="UTF-8"?>
                        <server>
                          <mbean code="org.jboss.mq.server.jmx.Queue" name="jboss.mq.destination:service=Queue,name=testQueue">
                            <depends optional-attribute-name="DestinationManager">jboss.mq:service=DestinationManager</depends>
                            <depends optional-attribute-name="SecurityManager">jboss.mq:service=SecurityManager</depends>
                            <attribute name="SecurityConf">
                               <security>
                               <role name="guest" read=true write=true create=false/>
                               <role name="publisher" read=true write=true create=false/>
                               <role name="noacc" read=false write=false create=false/>
                           </security>
                        </attribute>
                           </mbean>
                        </server>
                        

                        Resulting in:

                        Open quote is expected for attribute "read" associated with an  element type  "role".