3 Replies Latest reply on Jan 15, 2006 7:23 PM by anil.saldhana

    Refactor test targets from the testsuite build script

    anil.saldhana

      I am wondering if the test targets from the build.xml in the testsuite can be refactored into a seperate xml file under the imports directory or is it worthwhile to have a seperate xml file containing the test targets for individual projects - tests-security-targets.xml, tests-jmx-targets.xml so that the main build.xml can remain lean. (All in the imports directory)

      The main build.xml already contains 3K lines.

        • 1. Re: Refactor test targets from the testsuite build script

          I think this would make sense at least for some tests such as clustering, which have quite a bit of girth. Too much of this would make it even harder for developers to learn the testsuite.

          Once the new build system is decided (maven2 or jbossbuild), we should split up the code and targets across many submodules in the testsuite. This would allow a developer to build and run the tests for a given subsystem, groups of such, or the whole testsuite.

          Also, I think it would be more understandable, since each module could be understood on its own (source, targets, servers, artifacts).

          • 2. Re: Refactor test targets from the testsuite build script
            starksm64

            The module specific tests should be in the module, but there are still are large number of integration tests that need to be broken out just in terms of the maintainence of the test-jars.xml. Why not just break up the test-jars.xml sections for each of these targets into seperate ant file that are imported into test-jars.xml, so:

             <target name="jars" description="Builds all jar files."
             depends="compile,
             _jars-aop,
             _jars-bank,
             _jars-bank-new,
             _jars-bankiiop,
             _jars-bench,
             _jars-bmp,
             _jars-cache,
             _jars-classloader,
             _jars-client,
             _jars-cluster,
             _jars-cmp2,
             _jars-cts,
             _jars-dbtest,
             _jars-deadlock,
             _jars-deployers,
             _jars-deployment,
             _jars-ejbconf,
             _jars-entity,
             _jars-entityexc,
             _jars-excepiiop,
             _jars-exception,
             _jars-foedeployer,
             _jars-hello,
             _jars-helloiiop,
             _jars-hellojrmpiiop,
             _jars-hibernate,
             _jars-httpsessionreplication,
             _jars-idgen,
             _jars-iiop,
             _jars-invokers,
             _jars-isolation,
             _jars-jbossmq,
             _jars-jbossmx,
             _jars-jbossnet,
             _jars-jca,
             _jars-jcaprops,
             _jars-jmsra,
             _jars-jmx,
             _jars-jrmp,
             _jars-jsr77,
             _jars-jsf,
             _jars-kernel,
             _jars-load,
             _jars-lock,
             _jars-marathon,
             _jars-mdb,
             _jars-media,
             _jars-messagedriven,
             _jars-naming,
             _jars-perf,
             _jars-pooled,
             _jars-proxycompiler,
             _jars-readahead,
             _jars-retry,
             _jars-security,
             _jars-session,
             _jars-testbean,
             _jars-testbeancluster,
             _jars-threading,
             _jars-timer,
             _jars-tm,
             _jars-txiiop,
             _jars-txpropiiop,
             _jars-txtimer,
             _jars-util,
             _jars-web,
             _jars-webservice,
             _jars-xa,
             _jars-xslt,
             _jars-byvalue
             ">
             </target>
            
            


            becomes:
             <import file="imports/aop.xml" />
             <target name="jars" description="Builds all jar files."
             depends="compile,
             _jars-aop,
             _jars-bank,
             _jars-bank-new,
             _jars-bankiiop,
            ...
            


            and imports/aop.xml is:
            <project name="aop tests">
            
             <!-- aop test -->
             <target name="_jars-aop">
             <mkdir dir="${build.lib}"/>
             <taskdef name="aopc" classname="org.jboss.aop.ant.AopC"
             classpathref="jboss.aop.classpath"/>
             <path id="aop.task.classpath">
             <path refid="javassist.classpath"/>
             <path refid="qdox.classpath"/>
             <path refid="trove.classpath"/>
             <path refid="jboss.aop.classpath"/>
             <path refid="jboss.common.classpath"/>
             </path>
             <taskdef name="annotationc" classname="org.jboss.aop.ant.AnnotationC"
             classpathref="jboss.aop.classpath"/>
             <annotationc compilerclasspathref="aop.task.classpath" bytecode="true">
             <classpath refid="thirdparty.classpath"/>
             <classpath path="${build.classes}"/>
             <src path="${source.java}"/>
             <include name="org/jboss/test/aop/bean/AnnotatedSecuredPOJO.java"/>
             <include name="org/jboss/test/aop/bean/AnnotatedTxPOJO.java"/>
             <include name="org/jboss/test/aop/bean/AnnotatedTxLockedPOJO.java"/>
             </annotationc>
             <!-- build aopest.jar -->
             <jar destfile="${build.lib}/aoptest.jar"
             >
             <fileset dir="${build.classes}">
             <patternset refid="common.test.client.classes"/>
             <include name="org/jboss/test/aop/test/**"/>
             <include name="org/somepackage/**"/>
             </fileset>
             <fileset dir="${build.resources}/aop">
             <include name="*.*"/>
             </fileset>
             </jar>
            
             <!-- build simpleejb.jar -->
             <jar destfile="${build.lib}/simpleejb.jar">
             <fileset dir="${build.classes}">
             <include name="org/jboss/test/aop/simpleejb/"/>
             </fileset>
             <metainf dir="${build.resources}/aop/simpleejb/META-INF/"/>
             </jar>
            
            
             <jar destfile="${build.lib}/aop-call-logging.aop">
             <fileset dir="${build.classes}">
             <include
             name="org/jboss/test/aop/test/CallLoggingUnitTestCase.class"/>
             </fileset>
             <metainf dir="${build.resources}/aop/calllogging/META-INF/"/>
             </jar>
            
             <jar destfile="${build.lib}/aop-invocationlog.aop">
             <fileset dir="${build.classes}">
             <include
             name="org/jboss/test/aop/test/InvocationLogUnitTestCase.class"/>
             <include name="org/jboss/test/aop/bean/POJO.class"/>
             <include name="org/jboss/test/aop/bean/SomeException.class"/>
             </fileset>
             <fileset dir="${build.resources}/aop/invocationlog">
             <include name="META-INF/jboss-aop.xml"/>
             </fileset>
             </jar>
             <jar destfile="${build.lib}/aop-invocationlog.sar">
             <fileset dir="${build.lib}">
             <include name="aop-invocationlog.aop"/>
             </fileset>
             <fileset dir="${build.resources}/aop/invocationlog">
             <include name="META-INF/jboss-service.xml"/>
             </fileset>
             </jar>
            
             <jar destfile="${build.lib}/aoptest.aop"
             >
             <fileset dir="${build.classes}">
             <include name="org/jboss/test/aop/bean/Implements*.class"/>
             <include name="org/jboss/test/aop/bean/CFlowedPOJO.class"/>
             <include
             name="org/jboss/test/aop/bean/InstanceOfInterceptor.class"/>
             <include name="org/jboss/test/aop/bean/InterceptorCounter.class"/>
             <include name="org/jboss/test/aop/bean/SomeInterface.class"/>
             <include name="org/jboss/test/aop/bean/EmptyInterface.class"/>
             <include name="org/jboss/test/aop/bean/Aspect.class"/>
             <include name="org/jboss/test/aop/bean/Person.class"/>
             <include name="org/jboss/test/aop/bean/Address.class"/>
             <include name="org/jboss/test/aop/bean/NoInterceptorsPOJO*.class"/>
             <include name="org/jboss/test/aop/bean/NonadvisedPOJO.class"/>
             <include name="org/jboss/test/aop/bean/SecuredPOJO.class"/>
             <include name="org/jboss/test/aop/bean/AnnotatedSecuredPOJO.class"/>
             <include name="org/jboss/test/aop/bean/SomeException.class"/>
             <include name="org/jboss/test/aop/bean/POJO*.class"/>
             <include name="org/jboss/test/aop/bean/Call*.class"/>
             <include name="org/jboss/test/aop/bean/SomeIntroduction.class"/>
             <include name="org/jboss/test/aop/bean/SubclassIntroduction.class"/>
             <include name="org/jboss/test/aop/bean/AnotherIntroduction.class"/>
             <include name="org/jboss/test/aop/bean/Introduction.class"/>
             <include name="org/jboss/test/aop/bean/Introduction2.class"/>
             <include name="org/jboss/test/aop/bean/InterfaceMixin.class"/>
             <include name="org/jboss/test/aop/bean/AnnotatedTxPOJO.class"/>
             <include name="org/jboss/test/aop/bean/TxPOJO.class"/>
             <include name="org/jboss/test/aop/bean/TxLockedPOJO.class"/>
             <include
             name="org/jboss/test/aop/bean/AnnotatedTxLockedPOJO.class"/>
             <include name="org/jboss/test/aop/bean/VersionedPOJO.class"/>
             <include name="org/jboss/test/aop/bean/SimpleInterceptor.class"/>
             <include
             name="org/jboss/test/aop/bean/SimpleInterceptorFactory.class"/>
             <include
             name="org/jboss/test/aop/bean/SimpleBeanInterceptor.class"/>
             <include
             name="org/jboss/test/aop/bean/SimpleBeanCallerInterceptor.class"/>
             <include
             name="org/jboss/test/aop/bean/SimpleBeanInterceptorFactory.class"/>
             <include name="org/jboss/test/aop/bean/Temperature*.class"/>
             <include name="org/jboss/test/aop/bean/Observable*.class"/>
             <include name="org/jboss/test/aop/bean/LogUtil*.class"/>
             </fileset>
             <fileset dir="${build.resources}/aop">
             <include name="META-INF/jboss-aop.xml"/>
             </fileset>
             </jar>
            
             <jar destfile="${build.lib}/aoptest.sar">
             <fileset dir="${build.lib}">
             <include name="aoptest.aop"/>
             </fileset>
             <fileset dir="${build.classes}">
             <include name="org/jboss/test/aop/bean/AOPTester.class"/>
             <include name="org/jboss/test/aop/bean/AOPTesterMBean.class"/>
             <include name="org/jboss/test/aop/bean/RemotingTester.class"/>
             <include name="org/jboss/test/aop/bean/RemotingTesterMBean.class"/>
             <include name="org/jboss/test/aop/bean/SecurityTester.class"/>
             <include name="org/jboss/test/aop/bean/SecurityTesterMBean.class"/>
             <include name="org/jboss/test/aop/bean/TxTester.class"/>
             <include name="org/jboss/test/aop/bean/TxTesterMBean.class"/>
             <include name="org/jboss/test/aop/bean/TxLockTester*.class"/>
             <include name="org/jboss/test/aop/bean/TxLockTesterMBean.class"/>
             <include
             name="org/jboss/test/aop/bean/VersionedObjectTester.class"/>
             <include
             name="org/jboss/test/aop/bean/VersionedObjectTesterMBean.class"/>
             <include name="org/jboss/test/aop/bean/CacheTester.class"/>
             <include name="org/jboss/test/aop/bean/CacheTesterMBean.class"/>
             <include name="org/jboss/test/aop/bean/BeforeInterceptor.class"/>
             <include name="org/jboss/test/aop/bean/AfterInterceptor.class"/>
             <include name="org/jboss/test/aop/bean/LogUtil.class"/>
             <include name="org/jboss/test/aop/bean/Temperature.class"/>
             <include name="org/jboss/test/aop/bean/ObservableTester.class"/>
             <include
             name="org/jboss/test/aop/bean/ObservableTesterMBean.class"/>
             </fileset>
             <fileset dir="${build.resources}/aop">
             <include name="users.properties"/>
             <include name="roles.properties"/>
             </fileset>
             <fileset dir="${build.resources}/aop">
             <include name="META-INF/jboss-service.xml"/>
             </fileset>
             </jar>
            
             <jar destfile="${build.lib}/simpleejb.sar">
             <fileset dir="${build.lib}">
             <include name="aoptest.aop"/>
             </fileset>
             <fileset dir="${build.lib}">
             <include name="simpleejb.jar"/>
             </fileset>
             <fileset dir="${build.classes}">
             <include name="org/jboss/test/aop/bean/SimpleBeanTester.class"/>
             <include
             name="org/jboss/test/aop/bean/SimpleBeanTesterMBean.class"/>
             </fileset>
             <fileset dir="${build.resources}/aop">
             <include name="users.properties"/>
             <include name="roles.properties"/>
             </fileset>
             <fileset dir="${build.resources}/aop/simpleejb">
             <include name="META-INF/jboss-service.xml"/>
             </fileset>
             </jar>
            
             <!-- ok, we have created the loadtime jars, let us now precompile the classes for standalone test -->
            
             <!--
             <aopc compilerclasspathref="aop.task.classpath">
             <classpath refid="thirdparty.classpath"/>
             <classpath path="${build.classes}"/>
             <src path="${build.classes}"/>
             <include name="org/jboss/test/aop/bean/**"/>
             <aoppath path="${build.resources}/aop/META-INF/jboss-aop.xml"/>
             </aopc>
             -->
            
             </target>
            
            </project>
            



            • 3. Re: Refactor test targets from the testsuite build script
              anil.saldhana