You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@roller.apache.org by ag...@apache.org on 2007/01/26 20:42:36 UTC

svn commit: r500315 - in /incubator/roller/trunk: ant.properties build.xml

Author: agilliland
Date: Fri Jan 26 11:42:36 2007
New Revision: 500315

URL: http://svn.apache.org/viewvc?view=rev&rev=500315
Log:
make it even a little bit easier to do automated testing against any type of db.  everything is controllable from the ant.properties file and and the only annoying part left is that you have to duplicate some properties into the testdata/roller-custom.properties file.


Modified:
    incubator/roller/trunk/ant.properties
    incubator/roller/trunk/build.xml

Modified: incubator/roller/trunk/ant.properties
URL: http://svn.apache.org/viewvc/incubator/roller/trunk/ant.properties?view=diff&rev=500315&r1=500314&r2=500315
==============================================================================
--- incubator/roller/trunk/ant.properties (original)
+++ incubator/roller/trunk/ant.properties Fri Jan 26 11:42:36 2007
@@ -11,12 +11,34 @@
 build.deprecation=false
 junit.haltonerror=false
 
+# automated testing contorls
+
+# customizable pre and post testing ant tasks.  ordering is ...
+#    startTask, initTask, unit tests run, stopTask
+test.db.startTask=start-db
+test.db.initTask=init-db
+test.db.stopTask=stop-db
+
+# define what db to use for testing.  default is derby.
+# NOTE: you must also apply these settings in testdata/roller-custom.properties
 test.db.name=derby
 test.db.cpath=./tools/buildtime/derbyclient.jar
 test.db.driver=org.apache.derby.jdbc.ClientDriver
 test.db.url=jdbc:derby://localhost:3219/roller;create=true
 test.db.username=app
 test.db.password=app
+
+# example settings for running tests against a mysql database
+# NOTE: you must also apply these settings in testdata/roller-custom.properties
+#test.db.startTask=nothing
+#test.db.initTask=init-db
+#test.db.stopTask=nothing
+#test.db.name=mysql
+#test.db.cpath=/export/home/java/mysql-connector-java-3.0.14-production/mysql-connector-java-3.0.14-production-bin.jar
+#test.db.driver=com.mysql.jdbc.Driver
+#test.db.url=jdbc:mysql://localhost/test_roller
+#test.db.username=roller
+#test.db.password=roller
 
 
 # ----------------------------------------------------------------------------

Modified: incubator/roller/trunk/build.xml
URL: http://svn.apache.org/viewvc/incubator/roller/trunk/build.xml?view=diff&rev=500315&r1=500314&r2=500315
==============================================================================
--- incubator/roller/trunk/build.xml (original)
+++ incubator/roller/trunk/build.xml Fri Jan 26 11:42:36 2007
@@ -909,14 +909,18 @@
     <mkdir dir="${build.reports}/business/xml"/>
     <mkdir dir="${build.reports}/business/html"/>
 
-    <antcall target="start-db" /> 
-    <antcall target="init-db" /> 
+    <!-- allow for startup and initialization of test db -->
+    <antcall target="${test.db.startTask}" />
+    <antcall target="${test.db.initTask}" />
 	
     &custom-pre-dbtest;
-
+    
     <junit fork="true" dir="${build.tests}" printsummary="on" showOutput="true">
         <classpath>
             <path refid="tests.run.path"/>
+            
+            <!-- plus the classpath for jars needed to talk to the test db -->
+            <pathelement path="${test.db.cpath}" />
         </classpath>
         
         <!-- needed to satisfy ref in log4j.properties -->
@@ -951,9 +955,9 @@
 	
     &custom-post-dbtest;
     
-    <antcall target="stop-db" /> 
-
-    <echo>Suggested: Run "ant consistency-check".</echo>
+    <!-- allow for shutdown of test db -->
+    <antcall target="${test.db.stopTask}" />
+    
 </target>
 
 <!-- ===================================== -->
@@ -963,12 +967,16 @@
     <mkdir dir="${build.reports}/presentation/xml"/>
     <mkdir dir="${build.reports}/presentation/html"/>
     
-    <antcall target="start-db" /> 
-    <antcall target="init-db" /> 
+    <!-- allow for startup and initialization of test db -->
+    <antcall target="${test.db.startTask}" />
+    <antcall target="${test.db.initTask}" />
 
     <junit fork="true" dir="${build.tests}" printsummary="on" showOutput="false">
         <classpath>
             <path refid="tests.run.path"/>
+            
+            <!-- plus the classpath for jars needed to talk to the test db -->
+            <pathelement path="${test.db.cpath}" />
         </classpath>
         
         <!-- needed to satisfy ref in log4j.properties -->
@@ -994,7 +1002,8 @@
     <report format="noframes" toDir="${build.reports}/presentation/html"/>
     </junitreport>
     
-    <antcall target="stop-db" /> 
+    <!-- allow for shutdown of test db -->
+    <antcall target="${test.db.stopTask}" />
     
 </target>
 
@@ -1212,5 +1221,10 @@
         </fileset>        
     </jar>
 </target>
+
+    <target name="nothing">
+        <!-- this task does nothing and is here so that 
+             dynamic task definitions have a no-op choice -->
+    </target>
 
 </project>