From: Gautam J. <ga...@us...> - 2009-01-13 23:00:47
|
Update of /cvsroot/jaffa/JaffaBuild/build In directory fdv4jf1.ch3.sourceforge.com:/tmp/cvs-serv20922/build Modified Files: build-tests.xml Log Message: Enhanced the UnitTest framework to support dynamic AOP - Modified the 'test-execute' target in JaffaBuild/build/build-tests.xml to pass the java agent to the JVM, which is used to apply AOP dynamically. - Moved the custom 'test-junit-jar-config' logic from JaffaRules/build/build.xml to the 'test-junit-module' target in JaffaBuild/build/build-tests.xml. This is used to generate AOP pointcuts from the available metadata. - Modified the 'test.junit.aoppath' property in JaffaRules/build/sandbox.ant.properties to be a more manageable comma-separated list of top-level AOP folders - A more explicit 'test.junit.fullaoppath' property is generated during the build process, and is passed to the java agent - Modified the 'test-junit' target in JaffaRules/build/build.xml to execute UnitTests with both dynamic and preapplied AOP Index: build-tests.xml =================================================================== RCS file: /cvsroot/jaffa/JaffaBuild/build/build-tests.xml,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** build-tests.xml 12 Mar 2008 21:47:25 -0000 1.22 --- build-tests.xml 13 Jan 2009 23:00:42 -0000 1.23 *************** *** 91,98 **** <attribute name="reportdir"/> <attribute name="printsummary" default="true"/> ! <attribute name="fork" default="${test.junit.fork}"/> <attribute name="showoutput" default="true"/> <attribute name="type"/> ! <attribute name="aoppath" default="${test.junit.aoppath}"/> <attribute name="debug" default="false"/> <attribute name="debugport" default="8787"/> --- 91,99 ---- <attribute name="reportdir"/> <attribute name="printsummary" default="true"/> ! <attribute name="fork" default="true"/> <attribute name="showoutput" default="true"/> <attribute name="type"/> ! <attribute name="javaagent" default=''/> ! <attribute name="aoppath" default=''/> <attribute name="debug" default="false"/> <attribute name="debugport" default="8787"/> *************** *** 101,104 **** --- 102,121 ---- <element name="testfiles"/> <sequential> + <!-- Determine the jvm arguments to be passed for JBossAOP --> + <var name='test-execute.javaagent.arg' value=''/> + <var name='test-execute.aoppath.arg' value=''/> + <if> + <not><equals arg1='@{javaagent}' arg2=''/></not> + <then> + <var name='test-execute.javaagent.arg' value='-javaagent:@{javaagent}'/> + </then> + </if> + <if> + <not><equals arg1='@{aoppath}' arg2=''/></not> + <then> + <var name='test-execute.aoppath.arg' value='-Djboss.aop.path=@{aoppath}'/> + </then> + </if> + <!-- Determine the jvm arguments to be passed for supporting debugging --> <var name='test-execute.debug.arg1' value=''/> *************** *** 128,132 **** <junit printsummary="@{printsummary}" fork="@{fork}" showoutput="@{showoutput}" timeout="1800000" maxmemory="${test.junit.maxMemory}"> <jvmarg value="-Demma.coverage.out.file=${dist.emma}/coverage.ec"/> ! <jvmarg value="-Djboss.aop.path=@{aoppath}"/> <jvmarg value="${test-execute.debug.arg1}"/> <jvmarg value="${test-execute.debug.arg2}"/> --- 145,150 ---- <junit printsummary="@{printsummary}" fork="@{fork}" showoutput="@{showoutput}" timeout="1800000" maxmemory="${test.junit.maxMemory}"> <jvmarg value="-Demma.coverage.out.file=${dist.emma}/coverage.ec"/> ! <jvmarg value="${test-execute.javaagent.arg}"/> ! <jvmarg value="${test-execute.aoppath.arg}"/> <jvmarg value="${test-execute.debug.arg1}"/> <jvmarg value="${test-execute.debug.arg2}"/> *************** *** 172,176 **** <antcall target="test-junit-jar-config"/> ! <test-execute reportdir="${dist.test.junit.reports}" type="unittests" debug="${test.junit.debug}"> <testfiles> <!-- --- 190,242 ---- <antcall target="test-junit-jar-config"/> ! <!-- Generate AOP pointcuts based on metadata , only if test.junit.aoppath is passed --> ! <if> ! <and> ! <isset property='test.junit.aoppath'/> ! <not><equals arg1='${test.junit.aoppath}' arg2=''/></not> ! </and> ! <then> ! <!-- Load the JaffaRules Ant Tasks --> ! <path id='project.unittest.class.path'> ! <path refid='project.class.path'/> ! <pathelement location="${dist.jar}/${appname}.jar"/> ! <pathelement location='${dist.jar}/${appname}-unittests.jar'/> ! </path> ! <taskdef resource='org/jaffa/rules/jbossaop/tools/ant/taskdef.properties' classpathref='project.unittest.class.path'/> ! ! <!-- Generate jaffa-rules-generated-aop.xml from the metadata --> ! <!-- NOTE: The <aopgenerator> task is failing with the error 'ClassNotFoundException: org.jaffa.rules.jbossaop.RealmLoader. It needs to be forked in a separate VM. For now we'll use the <java> task with fork='true' --> ! <!-- <aopgenerator sourceNames='${test.junit.aoppath}' generatedFileName='${dist.test.junit}/aop/jaffa-rules-generated-aop.xml'/> --> ! <java classname="org.jaffa.rules.jbossaop.tools.AopGenerator" fork='true'> ! <arg value="${test.junit.aoppath}"/> ! <arg value="${dist.test.junit}/aop/jaffa-rules-generated-aop.xml"/> ! <classpath refid="project.unittest.class.path"/> ! </java> ! ! <!-- JBossAOP requires the explicit declaration of each folder containing AOP files. The following will generate that explicit path and assign it to test.junit.fullaoppath --> ! <aoppathgenerator sourceNames='${test.junit.aoppath}' property='test.junit.fullaoppath'/> ! ! <!-- Determine the location of the AOP agent --> ! <if> ! <and> ! <equals arg1='${module.name}' arg2='JaffaRules'/> ! <available file='${basedir}/lib/rules/jboss-aop-jdk50.jar'/> ! </and> ! <then> ! <var name='test.junit.javaagent' value='${basedir}/lib/rules/jboss-aop-jdk50.jar'/> ! </then> ! <else> ! <var name='test.junit.javaagent' value='${lib.dependent}/${module.JaffaRules.name}/${module.JaffaRules.version}/jboss-aop-jdk50.jar'/> ! </else> ! </if> ! </then> ! <else> ! <var name='test.junit.fullaoppath' value=''/> ! <var name='test.junit.javaagent' value=''/> ! </else> ! </if> ! ! <test-execute reportdir="${dist.test.junit.reports}" type="unittests" debug="${test.junit.debug}" ! fork="${test.junit.fork}" javaagent="${test.junit.javaagent}" aoppath="${test.junit.fullaoppath}"> <testfiles> <!-- |