Permalink
Browse files

Adding resource to make reporting on tests easier.

  • Loading branch information...
1 parent 768a08c commit d217b1761bd4f7d55f9981fa3f0c00f966e32697 @tpryan committed Feb 25, 2010
View
@@ -1 +1,2 @@
/settings.properties
+
View
@@ -68,22 +68,18 @@
</target>
- <target name="test" depends="test.apptacular,test.rebuild.apps" />
+ <target name="test" depends="test.apptacular,test.rebuild.apps,test.build.report" />
<target name="test.apptacular">
<echo message="Running Apptacular Tests"/>
- <taskdef name="mxunittask" classname="org.mxunit.ant.MXUnitAntTask" classpath="${mxunit.jar}" />
-
- <mxunittask server="${server}" defaultrunner="${runner.app.cfc}" haltonerror="true" haltonfailure="true" verbose="true">
- <directory path="${test.app.dir}" recurse="true" componentPath="${cfc.app.path}" />
+ <mxunittask server="${server}" defaultrunner="${runner.app.cfc}" haltonerror="true" haltonfailure="true" verbose="true" outputdir="${mxlog.dir}/apptacular">
+ <directory path="${test.app.dir}" recurse="true" componentPath="${cfc.app.path}" packageName="apptacular" />
</mxunittask>
</target>
<target name="rebuild.apps">
- <echo message="Rebuilding all Aplications"/>
-
- <taskdef name="mxunittask" classname="org.mxunit.ant.MXUnitAntTask" classpath="${mxunit.jar}" />
+ <echo message="Rebuilding all Applications"/>
<mxunittask server="${server}" haltonerror="true" haltonfailure="true" verbose="true">
<testcase name="apptacular.handlers.test.apps.testAdventureWorks" runner="${runner.app.cfc}" />
@@ -96,15 +92,6 @@
</mxunittask>
</target>
- <target name="rebuild.blogdemo">
- <echo message="Rebuilding all Aplications"/>
-
- <taskdef name="mxunittask" classname="org.mxunit.ant.MXUnitAntTask" classpath="${mxunit.jar}" />
-
- <mxunittask server="${server}" haltonerror="true" haltonfailure="true" verbose="true">
- <testcase name="apptacular.handlers.test.apps.testBlogDemo" runner="${runner.app.cfc}" />
- </mxunittask>
- </target>
<target name="test.rebuild.apps" depends="test.rebuild.adventureworks, test.rebuild.blogdemo, test.rebuild.blogdemomssql, test.rebuild.cfartgallery, test.rebuild.facebook, test.rebuild.sakilademo" />
@@ -113,22 +100,27 @@
<echo message="*************************************************************"/>
<echo message="AdventureWorks Tests"/>
<echo message="*************************************************************"/>
- <echo message="Rebuilding AdventureWorks Aplication - CFSCRIPT"/>
+ <echo message="Rebuilding AdventureWorks Application - CFSCRIPT"/>
<mxunittask server="${server}" haltonerror="true" haltonfailure="true" verbose="true">
<testcase name="apptacular.handlers.test.apps.testAdventureWorks" runner="${runner.app.cfc}" />
</mxunittask>
<echo message="Running AdventureWorks Tests - CFSCRIPT"/>
<ant antfile="${webroot}/AdventureWorks/test/build.xml" inheritAll="false"/>
- <echo message="Rebuilding AdventureWorks Aplication - CFML"/>
+ <echo message="Recovering Test Results - CFSCRIPT"/>
+ <copy todir="${mxlog.dir}/cfscript/AdventureWorks/" preservelastmodified="true" file="${webroot}/AdventureWorks/test/mxunitdirectorytestsuite_1.xml" />
+
+ <echo message="Rebuilding AdventureWorks Application - CFML"/>
<mxunittask server="${server}" haltonerror="true" haltonfailure="true" verbose="true">
<testcase name="apptacular.handlers.test.apps.testAdventureWorksCFML" runner="${runner.app.cfc}" />
</mxunittask>
<echo message="Running AdventureWorks Tests - CFML"/>
<ant antfile="${webroot}/AdventureWorks/test/build.xml" inheritAll="false"/>
+ <echo message="Recovering Test Results - CFML"/>
+ <copy todir="${mxlog.dir}/cfml/AdventureWorks/" preservelastmodified="true" file="${webroot}/AdventureWorks/test/mxunitdirectorytestsuite_1.xml" />
</target>
@@ -137,22 +129,28 @@
<echo message="*************************************************************"/>
<echo message="BlogDemo Tests"/>
<echo message="*************************************************************"/>
- <echo message="Rebuilding BlogDemo Aplication - CFSCRIPT"/>
+ <echo message="Rebuilding BlogDemo Application - CFSCRIPT"/>
<mxunittask server="${server}" haltonerror="true" haltonfailure="true" verbose="true">
<testcase name="apptacular.handlers.test.apps.testBlogDemo" runner="${runner.app.cfc}" />
</mxunittask>
<echo message="Running BlogDemo Tests - CFSCRIPT"/>
<ant antfile="${webroot}/BlogDemo/test/build.xml" inheritAll="false"/>
- <echo message="Rebuilding BlogDemo Aplication - CFML"/>
+ <echo message="Recovering Test Results - CFSCRIPT"/>
+ <copy todir="${mxlog.dir}/cfscript/blogdemo/" preservelastmodified="true" file="${webroot}/blogdemo/test/mxunitdirectorytestsuite_1.xml" />
+
+ <echo message="Rebuilding BlogDemo Application - CFML"/>
<mxunittask server="${server}" haltonerror="true" haltonfailure="true" verbose="true">
<testcase name="apptacular.handlers.test.apps.testBlogDemoCFML" runner="${runner.app.cfc}" />
</mxunittask>
<echo message="Running BlogDemo Tests - CFML"/>
<ant antfile="${webroot}/BlogDemo/test/build.xml" inheritAll="false"/>
+ <echo message="Recovering Test Results - CFML"/>
+ <copy todir="${mxlog.dir}/CFML/blogdemo/" preservelastmodified="true" file="${webroot}/blogdemo/test/mxunitdirectorytestsuite_1.xml" />
+
</target>
@@ -161,22 +159,28 @@
<echo message="*************************************************************"/>
<echo message="BlogDemoSQL Tests"/>
<echo message="*************************************************************"/>
- <echo message="Rebuilding BlogDemoSQL Aplication - CFSCRIPT"/>
+ <echo message="Rebuilding BlogDemoSQL Application - CFSCRIPT"/>
<mxunittask server="${server}" haltonerror="true" haltonfailure="true" verbose="true">
<testcase name="apptacular.handlers.test.apps.testBlogDemoMSSQL" runner="${runner.app.cfc}" />
</mxunittask>
<echo message="Running BlogDemoSQL Tests - CFSCRIPT"/>
<ant antfile="${webroot}/BlogDemoMSSQL/test/build.xml" inheritAll="false"/>
- <echo message="Rebuilding BlogDemoSQL Aplication - CFML"/>
+ <echo message="Recovering Test Results - CFSCRIPT"/>
+ <copy todir="${mxlog.dir}/cfscript/blogdemomssql/" preservelastmodified="true" file="${webroot}/blogdemomssql/test/mxunitdirectorytestsuite_1.xml" />
+
+ <echo message="Rebuilding BlogDemoSQL Application - CFML"/>
<mxunittask server="${server}" haltonerror="true" haltonfailure="true" verbose="true">
<testcase name="apptacular.handlers.test.apps.testBlogDemoMSSQLCFML" runner="${runner.app.cfc}" />
</mxunittask>
<echo message="Running BlogDemoSQL Tests - CFML"/>
<ant antfile="${webroot}/BlogDemoMSSQL/test/build.xml" inheritAll="false"/>
+ <echo message="Recovering Test Results - CFML"/>
+ <copy todir="${mxlog.dir}/CFML/BlogDemoMSSQL/" preservelastmodified="true" file="${webroot}/BlogDemoMSSQL/test/mxunitdirectorytestsuite_1.xml" />
+
</target>
@@ -185,22 +189,28 @@
<echo message="*************************************************************"/>
<echo message="CFArtgallery Tests"/>
<echo message="*************************************************************"/>
- <echo message="Rebuilding CFArtgallery Aplication - CFSCRIPT"/>
+ <echo message="Rebuilding CFArtgallery Application - CFSCRIPT"/>
<mxunittask server="${server}" haltonerror="true" haltonfailure="true" verbose="true">
<testcase name="apptacular.handlers.test.apps.testcfartgallery" runner="${runner.app.cfc}" />
</mxunittask>
<echo message="Running CFArtgallery Tests - CFSCRIPT"/>
<ant antfile="${webroot}/CFArtgallery/test/build.xml" inheritAll="false"/>
- <echo message="Rebuilding CFArtgallery Aplication - CFML"/>
+ <echo message="Recovering Test Results - CFSCRIPT"/>
+ <copy todir="${mxlog.dir}/cfscript/CFArtgallery/" preservelastmodified="true" file="${webroot}/CFArtgallery/test/mxunitdirectorytestsuite_1.xml" />
+
+ <echo message="Rebuilding CFArtgallery Application - CFML"/>
<mxunittask server="${server}" haltonerror="true" haltonfailure="true" verbose="true">
<testcase name="apptacular.handlers.test.apps.testcfartgalleryCFML" runner="${runner.app.cfc}" />
</mxunittask>
<echo message="Running CFArtgallery Tests - CFML"/>
<ant antfile="${webroot}/CFArtgallery/test/build.xml" inheritAll="false"/>
+ <echo message="Recovering Test Results - CFML"/>
+ <copy todir="${mxlog.dir}/CFML/CFArtgallery/" preservelastmodified="true" file="${webroot}/CFArtgallery/test/mxunitdirectorytestsuite_1.xml" />
+
</target>
@@ -209,47 +219,73 @@
<echo message="*************************************************************"/>
<echo message="Facebook Tests"/>
<echo message="*************************************************************"/>
- <echo message="Rebuilding Facebook Aplication - CFSCRIPT"/>
+ <echo message="Rebuilding Facebook Application - CFSCRIPT"/>
<mxunittask server="${server}" haltonerror="true" haltonfailure="true" verbose="true">
<testcase name="apptacular.handlers.test.apps.testFacebook" runner="${runner.app.cfc}" />
</mxunittask>
<echo message="Running Facebook Tests - CFSCRIPT"/>
<ant antfile="${webroot}/Facebook/test/build.xml" inheritAll="false"/>
- <echo message="Rebuilding Facebook Aplication - CFML"/>
+ <echo message="Recovering Test Results - CFSCRIPT"/>
+ <copy todir="${mxlog.dir}/cfscript/Facebook/" preservelastmodified="true" file="${webroot}/Facebook/test/mxunitdirectorytestsuite_1.xml" />
+
+
+
+ <echo message="Rebuilding Facebook Application - CFML"/>
<mxunittask server="${server}" haltonerror="true" haltonfailure="true" verbose="true">
<testcase name="apptacular.handlers.test.apps.testFacebookCFML" runner="${runner.app.cfc}" />
</mxunittask>
<echo message="Running Facebook Tests - CFML"/>
<ant antfile="${webroot}/Facebook/test/build.xml" inheritAll="false"/>
+
+ <echo message="Recovering Test Results - CFML"/>
+ <copy todir="${mxlog.dir}/CFML/Facebook/" preservelastmodified="true" file="${webroot}/Facebook/test/mxunitdirectorytestsuite_1.xml" />
+
+
</target>
<target name="test.rebuild.sakilademo">
<echo message="*************************************************************"/>
<echo message="SakilaDemo Tests"/>
<echo message="*************************************************************"/>
- <echo message="Rebuilding SakilaDemo Aplication - CFSCRIPT"/>
+ <echo message="Rebuilding SakilaDemo Application - CFSCRIPT"/>
<mxunittask server="${server}" haltonerror="true" haltonfailure="true" verbose="true">
<testcase name="apptacular.handlers.test.apps.testSakilaDemo" runner="${runner.app.cfc}" />
</mxunittask>
<echo message="Running SakilaDemo Tests - CFSCRIPT"/>
<ant antfile="${webroot}/SakilaDemo/test/build.xml" inheritAll="false"/>
- <echo message="Rebuilding SakilaDemo Aplication - CFML"/>
+ <echo message="Recovering Test Results - CFSCRIPT"/>
+ <copy todir="${mxlog.dir}/cfscript/SakilaDemo/" preservelastmodified="true" file="${webroot}/SakilaDemo/test/mxunitdirectorytestsuite_1.xml" />
+
+
+ <echo message="Rebuilding SakilaDemo Application - CFML"/>
<mxunittask server="${server}" haltonerror="true" haltonfailure="true" verbose="true">
<testcase name="apptacular.handlers.test.apps.testSakilaDemo" runner="${runner.app.cfc}" />
</mxunittask>
<echo message="Running SakilaDemo Tests - CFML"/>
<ant antfile="${webroot}/SakilaDemo/test/build.xml" inheritAll="false"/>
+ <echo message="Recovering Test Results - CFML"/>
+ <copy todir="${mxlog.dir}/CFML/SakilaDemo/" preservelastmodified="true" file="${webroot}/SakilaDemo/test/mxunitdirectorytestsuite_1.xml" />
</target>
+ <target name="test.build.report">
+ <junitreport todir="${mxlog.dir}/report">
+ <fileset dir="${mxlog.dir}">
+ <include name="cfml/**/*.xml"/>
+ <include name="cfscript/**/*.xml"/>
+ </fileset>
+ <report format="frames" todir="${mxlog.dir}/report" />
+ </junitreport>
+ </target>
+
<target name="test.apps">
<echo message="*************************************************************"/>
@@ -320,13 +320,15 @@ component extends="codeGenerator"
public apptacular.handlers.cfc.code.build function createAntRunner(){
var runner = New apptacular.handlers.cfc.code.build();
+ var packagename = "#datasource.getName()#_#config.getCFCFormat()#";
+
runner.setProjectName(variables.datasource.getName());
runner.setProjectDefault("test");
runner.setFileLocation(variables.config.getTestFilePath());
runner.addProperty("mxunit.jar", variables.config.getMXUnitFilePath() & "/ant/lib/mxunit-ant-java5.jar");
//This is a hack to make sure that CF doesn't even run any debugging while ANT tests are running.
- runner.addProperty("test.dir", variables.config.getTestFilePath() & "&amp;_cf_nodebug=true");
+ runner.addProperty("test.dir", variables.config.getTestFilePath() );
runner.addProperty("runner.cfc", variables.config.getTestRelativePath() & "/HttpAntRunner.cfc");
runner.addProperty("server", cgi.server_name);
runner.addProperty("cfc.path", variables.config.getTestCFCPath());
@@ -336,8 +338,8 @@ component extends="codeGenerator"
runner.appendBody('');
runner.appendBody(' <taskdef name="mxunittask" classname="org.mxunit.ant.MXUnitAntTask" classpath="${mxunit.jar}" />');
runner.appendBody(' ');
- runner.appendBody(' <mxunittask server="${server}" defaultrunner="${runner.cfc}" haltonerror="true" haltonfailure="true" verbose="true">');
- runner.appendBody(' <directory path="${test.dir}" recurse="true" componentPath="${cfc.path}" />');
+ runner.appendBody(' <mxunittask server="${server}" defaultrunner="${runner.cfc}" haltonerror="true" haltonfailure="true" verbose="true" outputdir="${test.dir}">');
+ runner.appendBody(' <directory path="${test.dir}" recurse="true" componentPath="${cfc.path}" packageName="#packagename#" />');
runner.appendBody(' </mxunittask>');
runner.appendBody('');
runner.appendBody(' </target>');
@@ -0,0 +1,2 @@
+/testresults.properties
+/mxunitdirectorytestsuite_1.xml
@@ -0,0 +1,2 @@
+/testresults.properties
+/mxunitdirectorytestsuite_1.xml
@@ -0,0 +1,2 @@
+/testresults.properties
+/mxunitdirectorytestsuite_1.xml
@@ -0,0 +1,2 @@
+/testresults.properties
+/mxunitdirectorytestsuite_1.xml
@@ -0,0 +1,2 @@
+/testresults.properties
+/mxunitdirectorytestsuite_1.xml
@@ -0,0 +1,2 @@
+/testresults.properties
+/mxunitdirectorytestsuite_1.xml
@@ -0,0 +1,2 @@
+/testresults.properties
+/mxunitdirectorytestsuite_1.xml
@@ -0,0 +1,2 @@
+/testresults.properties
+/mxunitdirectorytestsuite_1.xml
@@ -0,0 +1,2 @@
+/testresults.properties
+/mxunitdirectorytestsuite_1.xml
@@ -0,0 +1,2 @@
+/testresults.properties
+/mxunitdirectorytestsuite_1.xml
@@ -0,0 +1,2 @@
+/testresults.properties
+/mxunitdirectorytestsuite_1.xml
@@ -0,0 +1,2 @@
+/testresults.properties
+/mxunitdirectorytestsuite_1.xml
@@ -0,0 +1,2 @@
+/testresults.properties
+/mxunitdirectorytestsuite_1.xml
@@ -0,0 +1,26 @@
+/0_apptacular_adeventure_works_CFML.html
+/0_apptacular_blog_CFML.html
+/1_apptacular_blog_CFML.html
+/1_apptacular_blog_cfscript.html
+/10_apptacular_facebook_cfscript.html
+/11_apptacular_sakila_cfscript.html
+/2_apptacular_blog_mssql_CFML.html
+/3_cfartgallery_CFML.html
+/4_apptacular_facebook_CFML.html
+/5_apptacular_sakila_cfscript.html
+/6_apptacular_adeventure_works_cfscript.html
+/7_apptacular_blog_cfscript.html
+/8_apptacular_blog_mssql_cfscript.html
+/9_cfartgallery_cfscript.html
+/all-tests.html
+/allclasses-frame.html
+/alltests-errors.html
+/alltests-fails.html
+/index.html
+/overview-frame.html
+/overview-summary.html
+/package-frame.html
+/package-summary.html
+/stylesheet.css
+/TESTS-TestSuites.xml
+/.tmp*
@@ -0,0 +1,5 @@
+/0_testresults.html
+/1_testresults.html
+/2_testresults.html
+/package-frame.html
+/package-summary.html

0 comments on commit d217b17

Please sign in to comment.