1 2 Previous Next 26 Replies Latest reply on May 6, 2005 12:25 PM by tom.elrod Go to original post
      • 15. Re: Can we start writing jms test clients to check complianc
        ovidiu.feodorov

        The existent JMS facade unit tests (org.jboss.test.jms) test so far only colocated configurations. It would be nice if you could create similar tests that use two VMs. See http://jira.jboss.org/jira/browse/JBMESSAGING-45

        • 16. Re: Can we start writing jms test clients to check complianc

          sure, give me sometime to clear jgroup concepts.

          • 17. Re: Can we start writing jms test clients to check complianc
            ovidiu.feodorov

            I didn't exactly think about JGroups here (maybe I should have).

            I would have started with something really simple, just two VMs, Runtime.exec() or something.

            • 18. Re: Can we start writing jms test clients to check complianc

              It will be a combination of the two

              1. exec will spawn the processes
              2. jgroups will choreagraph the events between these processes and the results

              this mechanism i am planning to use for the performance tests also.
              (remoting does the similar things!) and they have the infrastructure in place.

              Only glitch is all the classes like DistributedTestCase,MultipleTestCase are in org.jboss.remoting :

              Should i keep using them or should i make a replica for jms/or somebody at jboss abstracts them to a common module, where multiple modules can use them?


              • 19. Re: Can we start writing jms test clients to check complianc
                ovidiu.feodorov

                Sounds good.

                We shouldn't use classes out of org.jboss.remoting.test. This would introduce a dangerous dependency. We should nicely ask Tom Elrod for copyright and physically copy the classes we need in our own project. I am sure you will come with a lot of new ideas and modify them in the future.

                If you'll be able to abstract a commod distributed testing framework, that's nice and useful, but it's not something we want to do right now. Create a JIRA tasks for exactly this thing, so we won't forget, and move on. Probably Ryan already has plans to do something similar.

                • 20. Re: Can we start writing jms test clients to check complianc

                  Ovidiu,
                  Spent last week on analysis of jgroups and the distributed testing framework developed by Tom.

                  i developed the test clients with producer/consumers in separate VMs and notifications through jgroups.
                  With 3 VMs its very slow and its not so predictable(may be i am doing somethign wrong).I was wondering what will happen when its more that 3 VMs?

                  so i am thinking of using RMI for the synchronization instead.
                  Will update on that in a day or two.

                  • 21. Re: Can we start writing jms test clients to check complianc
                    ovidiu.feodorov

                    It shouldn't be slow. Something it's wrong. JGroups scales well (when used correctly) and the breaking point is certainly NOT 3 members. I wouldn't go the RMI path, I would try to figure out what's wrong with your approach. Remeber that we eventually want to evolve this in a distributed test framework. If you send me the code and explain what you are trying to do, I could take a look ...

                    • 22. Re: Can we start writing jms test clients to check complianc

                      The distributed test case framework for JMS using jgroups has been implemented(Based on remoting DTF source base)

                      Scenario covered
                      1.One producer
                      2.One synchronous consumer

                      Its based on the distributed test framework developed by Tom for remoting org/jboss/dtf/**
                      I copied it into jboss-head/jms/tests directory.

                      Result

                      Testsuite: org.jboss.test.messaging.jms.dist.DistributedProducerSynchConsumerTestCase
                      Tests run: 1, Failures: 1, Errors: 0, Time elapsed: 35.441 sec
                      ------------- Standard Output ---------------

                      -------------------------------------------------------
                      GMS: address is localhost:1821
                      -------------------------------------------------------
                      ------------- ---------------- ---------------

                      Testcase: testInvokers took 30.113 sec
                      FAILED
                      expected: but was:<ID:3j001-4n2l02-e7k0983a-1-e7k09gkq-3>
                      junit.framework.ComparisonFailure: expected: but was:<ID:3j001-4n2l02-e7k0983a-1-e7k09gkq-3>
                      at org.jboss.test.messaging.jms.dist.DistributedProducerSynchConsumerTestCase.testInvokers(DistributedProducerSynchConsumerTestCase.java:125)
                      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
                      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                      at org.jboss.dtf.DistributedTestCase.run(DistributedTestCase.java:509)

                      The Test Fails, producer is setting the msg id to null,
                      (similar scenario in a local call passes)
                      With last weeks' CVS co this was passing, when i did the update yesterday the test started failing.

                      Issues faced

                      1.Had to change the {}/jboss-head/jms/src/resources/jgroups-core.jar with the one from thirdparty module
                      Problem with RPCDispatcher of jgroups-core, not able to make remote calls to methods of super class if they are not overridden in the sub class.

                      2.Added following property to jgroups props in org.jboss.dtf.DistributedTestCase to make jgroups work on my m/c
                      bind_addr=127.0.0.1;
                      please remove this if tests give an error.
                      Design

                      The test case has the following java files

                      org.jboss.test.messaging.jms.dist.DistributedProducerSynchConsumerTestCase
                       org.jboss.test.messaging.jms.dist.ProducerClientTest
                       org.jboss.test.messaging.jms.dist.SynchConsumerClientTest
                      

                      DistributedProducerSynchConsumerTestCase is the main TestCase (extends org.jboss.dtf.DistributedTestCase).
                      It configures the Topics/Queues using ServerManagement utility.
                      It launches Producers and Consumers in their own VMs (each producer and consumer extend org.jboss.dtf.DistributedTestCase.)
                      during setUp.

                      All the VMs wait for each other to come up and then the actual execution of the test cases happen.(each VM must know what are the total number of parties coming up)

                      In this test case producer and consumers update DistributedProducerSynchConsumerTestCase for the messageID sent and received , the assert call happens in DistributedProducerSynchConsumerTestCase.

                      New Features added to org.jboss.dtf.DistributedTestCase
                      Call back method :
                      public void sendMessage(String type,String message)
                       {
                       MethodCall call = new MethodCall("receiveMessage",
                       new Object[]{type,message}, new Class[]{String.class,String.class});
                       disp.callRemoteMethods(null, call, GroupRequest.GET_NONE, 0);
                       log.debug("sent Message :" + call);
                       }
                      
                       public void receiveMessage(String type,String message)
                       {
                       log.debug("Received Msg:" + type + "::" + message);
                       }
                      

                      for sending receiving the messageIDs between VMs.

                      Logging initializer :
                      public Logger setLogging(String level, String fileName, Class classObj)
                       {
                       ...
                       }
                      

                      Each VM has its own log file named named after fully qualified class name and an ID given as a command line agreement.


                      Changes to build.xml in jboss-head/jms/tests

                      Added the following lines in
                      <path id="library.classpath">
                      
                       <!--<pathelement path="${module.root}/../src/resources/jgroups-core.jar"/>-->
                       <pathelement path="${module.root}/../src/resources/jgroups.jar"/>
                       <pathelement path="${module.root}/../../j2ee/output/lib/jboss-j2ee.jar"/>
                      
                      Added new component
                       <path id="jms.classes">
                       <pathelement path="./../output/etc"/>
                       <pathelement path="./../output/classes"/>
                       <pathelement path="${module.root}/../../aspects/output/lib/jboss-aspect-library.jar"/>
                       <pathelement path="${module.root}/../../common/output/lib/jboss-common.jar"/>
                       <pathelement path="${module.root}/../../remoting/output/lib/jboss-remoting.jar"/>
                       <pathelement path="${module.root}/../../j2se/output/lib/jboss-j2se.jar"/>
                       <pathelement path="${module.root}/../../naming/output/lib/jnp-client.jar"/>
                       <pathelement path="${module.root}/../../thirdparty/javassist/lib/javassist.jar"/>
                       <pathelement path="${module.root}/../../thirdparty/oswego-concurrent/lib/concurrent.jar"/>
                       <pathelement path="${module.root}/../../thirdparty/apache-commons/lib/commons-httpclient.jar"/>
                       <pathelement path="${module.root}/../../thirdparty/trove/lib/trove.jar"/>
                       </path>
                      
                       <path id="dependentmodule.classpath">
                       <path refid="jboss.common.classpath"/>
                       <path refid="jboss.jms.classpath"/>
                       <path refid="jboss.j2ee.classpath"/>
                       <path refid="jboss.j2se.classpath"/>
                       <path refid="jms.classes"/>
                       <path refid="jboss.remoting.classpath"/>
                       <path refid="jboss.aop.classpath"/>
                       </path>
                      
                      <target name="tests-jar"
                       depends="compile-test-classes"
                       description="Creates the jar file with all the tests">
                      
                       <mkdir dir="${build.tests.lib}"/>
                      
                       <!-- Build the tests jar -->
                       <jar jarfile="${build.tests.lib}/${build.tests.archive}">
                       <fileset dir="${build.tests.classes}">
                       <include name="org/jboss/test/messaging/**"/>
                       <include name="org/jboss/dtf/**"/>
                       <include name="org/jboss/dummy/**"/>
                       </fileset>
                       </jar>
                       </target>
                      

                      Changes made to org.jboss.jms.ServerManagement
                      Added the following methods
                       public synchronized static void startRemoteServer(Hashtable ht) throws Exception
                      
                       public synchronized static void stopRemoteServer() throws Exception
                      
                       public static InitialContext getRemoteInitialContext() throws Exception
                      


                      Ovidiu,Earlier tests i had written were based on my design in this forum.
                      Now those utility classes are doing what ServerManagement does.

                      ServerManagement has to be abstracted into an interface so that our test cases run with any jms impl.







                      • 23. Re: Can we start writing jms test clients to check complianc

                        Don't know if is what you are looking for, but I added ability for remote, multi process testing based off of JUnit framework in the jboss-benchmark project. I will be using this to replace the distributed test framework under jboss remoting for the remoting tests.

                        Can find more info on it at http://www.jboss.org/wiki/Wiki.jsp?page=JBoss_Benchmark_jrunit.

                        I just added it last week and have not started migrating the remoting tests to use it yet, so can't say how stable it is at this point. Feel free to use it or improve on it as needed. Don't know when Clebert will be doing an official release of jboss-benchmark, so don't know when official binary for this will be available.

                        • 24. Re: Can we start writing jms test clients to check complianc
                          ovidiu.feodorov

                          Raj,

                          Have you tried Tom's new stuff? If it can do what you need, I think we should rather use that one than carrying on with the dtf ...

                          Let me know what you think.

                          • 25. Re: Can we start writing jms test clients to check complianc
                            clebert.suconic

                            The plan for releasing this is end of June, but that doesn't means you can't start using it already.

                            The only thing is... I'm in the middle of a refactoring, and I should be done with the refactoring on monday.

                            I guess Tom will validate everything and I guess this should be ready to a first usage by the end of next week.

                            A good thing if you guys could start using it even before a final release, is that this would help us to make sure we are in the right direction with this.


                            Clebert

                            • 26. Re: Can we start writing jms test clients to check complianc

                              Another important task for the benchmark/jrunit project is getting a binary output from the build that we can use.

                              IMO, the best solution would be to use the new jboss build and create a jrunit component that gets built by cruise control so can use the SNAPSHOT version from the build repository within the remoting build.

                              Clebert, if want to discuss this, let's move over to the benchmark forum.

                              1 2 Previous Next