1 2 Previous Next 23 Replies Latest reply on Oct 21, 2008 4:15 AM by istudens Go to original post
      • 15. Re: Testing Bootstrap Dependencies
        istudens

        There is a short look at my current implementation.

        I have not followed Adrian's advice yet, because I don't know how to implement his idea. I can't even start JBoss server with empty deploy/ directory. Therefore I don't have any clue, how to at first start the AS with empty deploy directory and then deploy an ear and after that all services from all/deploy.

        I have not even followed Brian's advice, because after trying methods from org.jboss.test.deployers.AbstractDeploymentTest I have found out that they test a structure of deployment only and hence they pass even if the deployment of the tested SAR fails.

        Now my test creates a different profile for each tested module. The snippet of build.xml:

        <!-- JBAS-5349 -->
         <target name="bootstrap-dependency-tests" description="Tests bootstrap deployment dependency in new JBossMC.">
         <!-- EJB3 Session Bean -->
         <create-bootstrapdependency-config baseconf="all" conf="bootstrapdependencyJBAS5349-EJB3Session">
         <module-patternset>
         <include name="bootstrapdependency-ejb3-sessionbean.jar"/>
         </module-patternset>
         </create-bootstrapdependency-config>
         <server:start name="bootstrapdependencyJBAS5349-EJB3Session"/>
         <run-junit junit.patternset="bootstrap-dependency.includes"
         junit.configuration="EJB3Session" />
         <server:stop name="bootstrapdependencyJBAS5349-EJB3Session"/>
         <!-- EJB3 Entity Bean -->
         <create-bootstrapdependency-config baseconf="all" conf="bootstrapdependencyJBAS5349-EJB3Entity">
         <module-patternset>
         <include name="bootstrapdependency-ejb3-entitybean.jar"/>
         </module-patternset>
         </create-bootstrapdependency-config>
         <server:start name="bootstrapdependencyJBAS5349-EJB3Entity"/>
         <run-junit junit.patternset="bootstrap-dependency.includes"
         junit.configuration="EJB3Entity" />
         <server:stop name="bootstrapdependencyJBAS5349-EJB3Entity"/>
         ...


        The macro 'create-bootstrapdependency-config' is defined in the imports/server-config.xml:
        <macrodef name="create-bootstrapdependency-config"
         description="Create a configuration based on 'all' profile">
         <attribute name="conf" />
         <attribute name="baseconf" />
         <element name="module-patternset" />
         <sequential>
         <server:config>
         <server name="@{conf}" host="${node0}">
         <jvmarg value="-Xms128m" />
         <jvmarg value="-Xmx512m" />
         <jvmarg value="-XX:MaxPermSize=512m" />
         <jvmarg value="-XX:+HeapDumpOnOutOfMemoryError" />
         <sysproperty key="java.net.preferIPv4Stack" value="true" />
         <sysproperty key="java.endorsed.dirs" value="${jboss.dist}/lib/endorsed" />
         <sysproperty key="jgroups.udp.ip_ttl" value="${jbosstest.udp.ip_ttl}" />
         </server>
         </server:config>
         <delete dir="${jboss.dist}/server/@{conf}" />
         <create-config baseconf="@{baseconf}" newconf="@{conf}" newconf-src="bootstrap-dependency">
         <patternset>
         <include name="conf/**" />
         <include name="deployers/**" />
         <include name="deploy/**" />
         <include name="lib/**" />
         </patternset>
         </create-config>
         <copy todir="${jboss.dist}/server/@{conf}/deploy/Aaabootstrapdependency-jbas5349.sar"
         filtering="false">
         <fileset dir="${build.lib}">
         <patternset>
         <module-patternset />
         </patternset>
         </fileset>
         </copy>
         </sequential>
         </macrodef>


        I have probably discovered a bug in the 'run-junit' macro in the file import/server-config.xml. There is an argument 'junit.configuration' which sets a 'report.ext' property. This argument should differentiate the outputs of repeatedly runing test. I am not sure if anyone has ever used this, because it does not work. The 'run-junit' macro uses the 'report.ext' property to remember an extension of test name, but in ant any property cannot be changed after it was once set. It means that if you run this macro twice with different junit.configuration arguments, you will get the same report.ext property value and it will be the value of the first one. So I have rewritten this macro to use a property ${report.ext.@{junit.configuration}} instead of ${report.ext} and simplified the syntax of condition to:
        <!-- Set the report extension based on the -->
         <condition property="report.ext.@{junit.configuration}" value=".xml" else="-@{junit.configuration}.xml">
         <equals arg1="" arg2="@{junit.configuration}" />
         </condition>


        I hope that checking of a status of the SAR's MBean is reliable manner method how to test the result of deployment. I consider it to be the best way how to do it.. the best one I know :)

        Should I commit the new test to the https://svn.jboss.org/repos/jbossas/trunk/testsuite/? Should I report the issue of run-junit's bug?

        • 16. Re: Testing Bootstrap Dependencies
          brian.stansberry

          IMHO getting the tests in is a critical issue, as the problems they reveal will take time to fix and there isn't that much time before GA. So I vote for adding the tests if they work, and a subtask on the JIRA to try to find another approach that addresses the points Adrian raised.

          Re: run-junit, the current usage seems to work, see for example https://hudson.jboss.org/hudson/job/JBoss-AS-5.0.x-TestSuite-sun15/948/testReport/org.jboss.test.bank.test/ where the same test was executed multiple times.

          • 17. Re: Testing Bootstrap Dependencies
            istudens

            It works only if it is called from different targets. But if it is okay I will split the tests into separate targets.

            My last question: should I commit the tests into https://svn.jboss.org/repos/jbossas/trunk/testsuite/ or should I commit them into another place?

            • 18. Re: Testing Bootstrap Dependencies
              brian.stansberry

              Yes, put them in https://svn.jboss.org/repos/jbossas/trunk/testsuite/.

              It works only if it is called from different targets. But if it is okay I will split the tests into separate targets.


              I see. OK, separate targets is OK. Note that you can wrap those targets in a container target to avoid having so many details exposed to the target that runs the overall testsuite; see the tests-clustering target in https://svn.jboss.org/repos/jbossas/trunk/testsuite/imports/config/tests-clustering.xml, which calls other targets that add different suffixes to different tests.

              See also https://svn.jboss.org/repos/jbossas/trunk/testsuite/imports/config/configs.xml which is imported into testsuite/build.xml and itself imports other ant files that run a grouped set of tests. This approach is used to add more targets without making testsuite/build.xml huge. I suggest you use this approach; i.e. add a testsuite/imports/tests-bootstrap-dependencies.xml and add it to testsuite/imports/configs.xml.

              • 19. Re: Testing Bootstrap Dependencies
                istudens

                Finally, I got full access to the svn. So I've committed the tests and reported a new issue about ejb3 session beans (https://jira.jboss.org/jira/browse/JBAS-6028).

                • 20. Re: Testing Bootstrap Dependencies
                  shelly.mcgowan

                  With the introduction of this new test logic, there are 93 new test failures seen in the AS 5 testsuite. The 93 failures are related to the deployment of two test jars, cmp2-jbas979.jar and cmp2-simple.jar. The deployment fails because the classes
                  org.jboss.test.deployers.jbas5349.ejb2.DummyStatefulBean and org.jboss.test.deployers.jbas5349.ejb2.SimpleEntityBean
                  cannot be loaded.

                  
                  2008-10-03 15:30:43,835 DEBUG [org.jboss.deployment.MappedReferenceMetaDataResolverDeployer]
                  (RMI TCP Connection(4)-127.0.0.1) Processing unit=cmp2-simple.jar, structure: cmp2-simple.jar
                  
                  +EjbEndpoint:ejbName=SimpleEntityEJB,ejbClass=org.jboss.test.deployers.jbas5349.ejb2.SimpleEntityBean
                  


                  2008-10-03 15:30:43,891 DEBUG [org.jboss.wsf.container.jboss50.deployer.WebServiceDeployerEJB]
                  (RMI TCP Connection(4)-127.0.0.1) Error during deploy: vfszip:/NotBackedUp/smcgowan/TRUNK/trunk/testsuite/output/lib/cmp2-simple.jar
                  java.lang.RuntimeException:
                   Failed to load component class org.jboss.test.deployers.jbas5349.ejb2.SimpleEntityBean.
                   Loader:BaseClassLoader@ff5996{vfszip:/NotBackedUp/smcgowan/TRUNK/trunk/testsuite/output/lib/cmp2-simple.jar}
                   at org.jboss.wsf.container.jboss50.deployer.WebServiceDeployerEJB$WebServiceDeclarationAdapter.getComponentClass(WebServiceDeployerEJB.java:182)
                   at org.jboss.wsf.container.jboss50.deployer.WebServiceDeployerEJB$WebServiceDeclarationAdapter.getAnnotation(WebServiceDeployerEJB.java:166)
                   at org.jboss.wsf.container.jboss50.deployer.JAXWSDeployerHookEJB3.isWebServiceBean(JAXWSDeployerHookEJB3.java:123)
                   at org.jboss.wsf.container.jboss50.deployer.JAXWSDeployerHookEJB3.isWebServiceDeployment(JAXWSDeployerHookEJB3.java:110)
                   at org.jboss.wsf.container.jboss50.deployer.AbstractDeployerHookEJB.deploy(AbstractDeployerHookEJB.java:39)
                   at org.jboss.wsf.container.jboss50.deployer.AbstractWebServiceDeployer.internalDeploy(AbstractWebServiceDeployer.java:60)
                   at org.jboss.wsf.container.jboss50.deployer.WebServiceDeployerEJB.internalDeploy(WebServiceDeployerEJB.java:119)
                   at org.jboss.deployers.spi.deployer.helpers.AbstractRealDeployer.deploy(AbstractRealDeployer.java:50)
                   at org.jboss.deployers.plugins.deployers.DeployerWrapper.deploy(DeployerWrapper.java:169)
                   at org.jboss.deployers.plugins.deployers.DeployersImpl.doDeploy(DeployersImpl.java:1285)
                   at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1003)
                   at org.jboss.deployers.plugins.deployers.DeployersImpl.install(DeployersImpl.java:944)
                   at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:348)
                   at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:1598)
                   at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:934)
                   at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1062)
                   at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:984)
                   at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:822)
                   at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:553)
                   at org.jboss.deployers.plugins.deployers.DeployersImpl.process(DeployersImpl.java:627)
                   at org.jboss.deployers.plugins.main.MainDeployerImpl.process(MainDeployerImpl.java:541)
                   at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:812)
                   at org.jboss.deployment.MainDeployer.redeploy(MainDeployer.java:587)
                  
                  


                  Ivo, did you see this in your local test run?


                  • 21. Re: Testing Bootstrap Dependencies
                    istudens

                    No, I didn't.
                    I will check it.

                    • 22. Re: Testing Bootstrap Dependencies
                      istudens

                      I'm sorry, it was my fault.
                      I don't know why, but some files were linked together on my pc.
                      The affected files are reverted back in the svn now.

                      • 23. Re: Testing Bootstrap Dependencies
                        istudens

                        I moved tests from package org.jboss.test.deployers on org.jboss.test.bootstrapdependencies to not interfere with next testing:
                        'build test -Dtest=deployers' + running 'run -c profileservice'

                        1 2 Previous Next