11 Replies Latest reply on May 13, 2008 6:17 AM by Kevin Conner

    JBossESB Unit Test Result

    Zaiwen Gong Newbie

      Hello,

      1. I downloaded jbossesb-server-4.2.1GA. Under \jbossesb-server-4.2.1GA\docs\tests, there is TESTS-TestSuites.txt. The link inside this file is not working.
      http://jboss.sourceforge.net/junit-results/32/2007-07-13.23-36

      2. If I would like to run those unit test myself, what should I? I try to download the source jbossesb-4.2.1GA-src.zip. If I run "ant test" from the qa folder, will that run all the 4096 unit test as specified in TESTS-TestSuites.txt file?

      3. Do those unit tests include the sample applications (quickstarts and trailblazer)? I mean, if I run those unit test, do I still need to run sample applications?

      4. Last question: I want to know if those unit tests (or sample application, or JBoss ESB server) are instrumented with Emma code coverage?

      Too many questions :)...Bow to thank you!

        • 1. Re: JBossESB Unit Test Result
          Kevin Conner Master

           

          "Zaiwen" wrote:
          1. I downloaded jbossesb-server-4.2.1GA. Under \jbossesb-server-4.2.1GA\docs\tests, there is TESTS-TestSuites.txt. The link inside this file is not working.
          http://jboss.sourceforge.net/junit-results/32/2007-07-13.23-36

          This appears to have been inherited from the AS 4.2.1 GA codebase and is not related to the ESB. Apologies for this, we will get it removed from the 4.3 release.

          "Zaiwen" wrote:
          2. If I would like to run those unit test myself, what should I? I try to download the source jbossesb-4.2.1GA-src.zip. If I run "ant test" from the qa folder, will that run all the 4096 unit test as specified in TESTS-TestSuites.txt file?


          The easiest way is to run
          ant -f integration-build.xml

          from the top level. This will run all tests, product and qa, using the standalone server.

          "Zaiwen" wrote:
          3. Do those unit tests include the sample applications (quickstarts and trailblazer)? I mean, if I run those unit test, do I still need to run sample applications?

          The 4.2.1 release includes a small number of the quickstarts within the qa testsuite. These have been extended in the current trunk and will be included in the upcoming 4.3 release.

          "Zaiwen" wrote:
          4. Last question: I want to know if those unit tests (or sample application, or JBoss ESB server) are instrumented with Emma code coverage?

          The unit and integration tests under product should all be instrumented with emma.


          • 2. Re: JBossESB Unit Test Result
            Zaiwen Gong Newbie

            Thanks a lot for all you quick reply. I am now more clear, but still some questions :)

            1. I ran "ant -f intergration-build.xml", but it failed. Same error if I ran "ant dist" and "ant test" from product folder:

            [java] BUILD FAILED
            [java] D:\jbossesb-4.2.1GA-src\product\build.xml:161: The following error occurred while executing this line:
            [java] D:\jbossesb-4.2.1GA-src\product\rosetta\build.xml:104: The following error occurred while executing this line:
            [java] D:\jbossesb-4.2.1GA-src\product\rosetta\tests\build.xml:166: The following error occurred while executing this line:
            [java] D:\jbossesb-4.2.1GA-src\product\rosetta\tests\build.xml:190: Test org.jboss.soa.esb.listeners.ScheduledListenerUnitTest failed

            2. Can you explain more about qa test? I understand it includes some sample applications, but does qa test perform any unit test? If yes, is this unit test same as that in product folder? If no, what exactly does qa test do besides the sample applications?

            3. The unit test and sample applications are emma instrumented. Good and bad. Will it cause any performance degrade? Any way to un-instrument it if I don't want to have it?

            Thanks again and have a good weekend!

            • 3. Re: JBossESB Unit Test Result
              Kevin Conner Master

               

              "Zaiwen" wrote:
              1. I ran "ant -f intergration-build.xml", but it failed. Same error if I ran "ant dist" and "ant test" from product folder:

              What was the reason for the failure? Which test failed?

              "Zaiwen" wrote:
              2. Can you explain more about qa test? I understand it includes some sample applications, but does qa test perform any unit test? If yes, is this unit test same as that in product folder? If no, what exactly does qa test do besides the sample applications?

              The tests under product do not require an ESB to run, their only requirements at present are for a JMS server and a FTP server. The tests under qa require an ESB server and consist of test artifacts that get deployed into the server.

              "Zaiwen" wrote:
              3. The unit test and sample applications are emma instrumented. Good and bad. Will it cause any performance degrade? Any way to un-instrument it if I don't want to have it?

              The tests are not performance tests, they only test functionality.



              • 4. Re: JBossESB Unit Test Result
                Zaiwen Gong Newbie

                Hi,

                1. The test fails is
                [java] D:\jbossesb-4.2.1GA-src\product\rosetta\tests\build.xml:190: Test org.jboss.soa.esb.listeners.ScheduledListenerUnitTest failed

                and I don't know why it fails (that's why I am asking :)
                This "ant -f intergration-build.xml" test doesn't require anything from me, right? I just unzip the source code downloaded and ran it. Do I need to modify any configuration for it to run?

                • 5. Re: JBossESB Unit Test Result
                  Kevin Conner Master

                  ScheduledListenerUnitTest is a source file containing more than one test, which one of those tests has failed?

                  You may have more information preceding this line but, if not, please look for the test report (TEST-org.jboss.soa.esb.listeners.ScheduledListenerUnitTest.xml)

                  • 6. Re: JBossESB Unit Test Result
                    Zaiwen Gong Newbie

                    Here is the detail. It seems the test case that fails is called "unknown". From TEST-org.jboss.soa.esb.listeners.ScheduledListenerUnitTest.xml:


                    org.junit.ComparisonFailure: null expected:<...ref="1-sec-trigger">[<action action="action" class="org.jboss.soa.esb.mock.MockAction"/>]
                    </simple-schedule-l...> but was:<...ref="1-sec-trigger">[<action action="action" class="org.jboss.soa.esb.mock.MockAction"/>]
                    </simple-schedule-l...>
                    at org.junit.Assert.assertEquals(Assert.java:92)
                    at org.junit.Assert.assertEquals(Assert.java:104)
                    at org.jboss.soa.esb.listeners.ScheduledListenerUnitTest.test(ScheduledListenerUnitTest.java:50)
                    at org.junit.internal.runners.TestMethodRunner.executeMethodBody(TestMethodRunner.java:99)
                    at org.junit.internal.runners.TestMethodRunner.runUnprotected(TestMethodRunner.java:81)
                    at org.junit.internal.runners.BeforeAndAfterRunner.runProtected(BeforeAndAfterRunner.java:34)
                    at org.junit.internal.runners.TestMethodRunner.runMethod(TestMethodRunner.java:75)
                    at org.junit.internal.runners.TestMethodRunner.run(TestMethodRunner.java:45)
                    at org.junit.internal.runners.TestClassMethodsRunner.invokeTestMethod(TestClassMethodsRunner.java:71)
                    at org.junit.internal.runners.TestClassMethodsRunner.run(TestClassMethodsRunner.java:35)
                    at org.junit.internal.runners.TestClassRunner$1.runUnprotected(TestClassRunner.java:42)
                    at org.junit.internal.runners.BeforeAndAfterRunner.runProtected(BeforeAndAfterRunner.java:34)
                    at org.junit.internal.runners.TestClassRunner.run(TestClassRunner.java:52)
                    at junit.framework.JUnit4TestAdapter.run(JUnit4TestAdapter.java:32)



                    Thanks!!!

                    • 7. Re: JBossESB Unit Test Result
                      Kevin Conner Master

                      This may be an issue with different character sets. What is your default charset?

                      • 8. Re: JBossESB Unit Test Result
                        Zaiwen Gong Newbie

                        Thank you for the reply, Kevein.

                        Under control panel -> regional and language opions, it sayd "English (Uninted States)". Is this what you mean by charset?

                        • 9. Re: JBossESB Unit Test Result
                          Kevin Conner Master

                          What is the result of the following code?

                          java.nio.charset.Charset.defaultCharset()


                          I could not see any difference in the expected/actual results from your trace which is why I am suspicious of the charset.

                          • 10. Re: JBossESB Unit Test Result
                            Zaiwen Gong Newbie

                            Windows-1252.

                            I know, they look the same to me too....clueless...

                            • 11. Re: JBossESB Unit Test Result
                              Kevin Conner Master

                              Could you run a quick test for me?

                              Could you change the following line

                              String actualListenerConfig = configUtil.getListenerConfig("simple-schedule-listener").toXml();

                              to
                              String actualListenerConfig = configUtil.getListenerConfig("simple-schedule-listener").toXml("UTF-8");

                              and try the test again?

                              Does this fix the issue?

                              Thanks,
                              Kev