You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@roller.apache.org by sn...@apache.org on 2006/05/23 20:57:28 UTC

svn commit: r408981 - in /incubator/roller/branches/roller_3.0: build.xml custom/custom-ant.xmlf

Author: snoopdave
Date: Tue May 23 11:57:27 2006
New Revision: 408981

URL: http://svn.apache.org/viewvc?rev=408981&view=rev
Log:
Couple more tweaks to start/init/stop code for testdb, should work perfectly with unit-tests now from command-line or via debug single class in Netbeans

Modified:
    incubator/roller/branches/roller_3.0/build.xml
    incubator/roller/branches/roller_3.0/custom/custom-ant.xmlf

Modified: incubator/roller/branches/roller_3.0/build.xml
URL: http://svn.apache.org/viewvc/incubator/roller/branches/roller_3.0/build.xml?rev=408981&r1=408980&r2=408981&view=diff
==============================================================================
--- incubator/roller/branches/roller_3.0/build.xml (original)
+++ incubator/roller/branches/roller_3.0/build.xml Tue May 23 11:57:27 2006
@@ -900,13 +900,8 @@
     <mkdir dir="${build.reports}/business/xml"/>
     <mkdir dir="${build.reports}/business/html"/>
 
-    <startdb database="${build.tests}/testdb" port="3219" />
-    
-    <sql driver="org.hsqldb.jdbcDriver"
-        url="jdbc:hsqldb:hsql://localhost:3219"
-        userid="sa" password=""
-        src="${ro.build}/roller/WEB-INF/dbscripts/hsqldb/createdb.sql"
-        classpath="${ro.tools}/buildtime/hsqldb.jar" />
+    <antcall target="start-db" /> 
+    <antcall target="init-db" /> 
 	
     &custom-pre-dbtest;
 
@@ -946,14 +941,8 @@
     </junitreport>
 	
     &custom-post-dbtest;
-
-    <sql driver="org.hsqldb.jdbcDriver"
-        url="jdbc:hsqldb:hsql://localhost:3219"
-        userid="sa" password=""
-        src="${ro.build}/roller/WEB-INF/dbscripts/droptables.sql"
-        classpath="${ro.tools}/buildtime/hsqldb.jar" />
-
-    <stopdb port="3219"/>
+    
+    <antcall target="stop-db" /> 
 
     <echo>Suggested: Run "ant consistency-check".</echo>
 </target>
@@ -965,13 +954,8 @@
     <mkdir dir="${build.reports}/presentation/xml"/>
     <mkdir dir="${build.reports}/presentation/html"/>
     
-    <startdb database="${build.tests}/testdb" port="3219" />
-    
-    <sql driver="org.hsqldb.jdbcDriver"
-        url="jdbc:hsqldb:hsql://localhost:3219"
-        userid="sa" password=""
-        src="./build/roller/WEB-INF/dbscripts/hsqldb/createdb.sql"
-        classpath="${ro.tools}/buildtime/hsqldb.jar" />
+    <antcall target="start-db" /> 
+    <antcall target="init-db" /> 
 
     <junit fork="true" dir="${build.tests}" showOutput="true">
         <batchtest toDir="${build.reports}/presentation/xml">
@@ -1002,13 +986,8 @@
     <report format="noframes" toDir="${build.reports}/presentation/html"/>
     </junitreport>
     
-    <sql driver="org.hsqldb.jdbcDriver"
-         url="jdbc:hsqldb:hsql://localhost:3219"
-         userid="sa" password=""
-         src="./build/roller/WEB-INF/dbscripts/droptables.sql"
-         classpath="${ro.tools}/buildtime/hsqldb.jar" />
-
-    <stopdb port="3219" />
+    <antcall target="stop-db" /> 
+    
 </target>
 
 <!-- ===================================== -->
@@ -1191,26 +1170,32 @@
 </target>
 
 <target name="start-db" description="Starts built-in database">  
-    <java classname="org.hsqldb.Server"  fork="yes" spawn="true" classpath="./tools/buildtime/hsqldb.jar">
+    <startdb database="${build.tests}/testdb" port="3219" />
+    <!-- 
+    Not sure we need that custom 'startdb' task if this plain old Ant works:
+    <java classname="org.hsqldb.Server"  
+        fork="yes" spawn="true" classpath="./tools/buildtime/hsqldb.jar">
         <arg value="-database"/>
         <arg value="${build.tests}/testdb"/>
         <arg value="-port"/>
         <arg value="3219"/>
     </java>
+    -->
 </target>
         
-<target name="stop-db" description="Drop tables and stops the built-in database">
-    <sql driver="org.hsqldb.jdbcDriver"
-         url="jdbc:hsqldb:hsql://localhost:3219"
-         userid="sa" password=""
-         src="./build/roller/WEB-INF/dbscripts/droptables.sql"
-         classpath="${ro.tools}/buildtime/hsqldb.jar" />
-    <sql driver="org.hsqldb.jdbcDriver"
+<target name="stop-db" description="Drop tables and stops the built-in database">   
+    <stopdb port="3219"/>
+    <!--
+    This below code does the same thing as 'stopdb' but the 'sql' task throws 
+    an exception when HSQLDB disconnects and that causes a build failure, so 
+    for now I'm keeping the custom 'startdb' and 'stopdb' Ant tasks.
+    <sql driver="org.hsqldb.jdbcDriver" onerror="continue" 
          url="jdbc:hsqldb:hsql://localhost:3219"
          userid="sa" password=""
          classpath="${ro.tools}/buildtime/hsqldb.jar" >
          SHUTDOWN
     </sql>  
+    -->
 </target>
 
 <!-- ********************************************************************* -->

Modified: incubator/roller/branches/roller_3.0/custom/custom-ant.xmlf
URL: http://svn.apache.org/viewvc/incubator/roller/branches/roller_3.0/custom/custom-ant.xmlf?rev=408981&r1=408980&r2=408981&view=diff
==============================================================================
--- incubator/roller/branches/roller_3.0/custom/custom-ant.xmlf (original)
+++ incubator/roller/branches/roller_3.0/custom/custom-ant.xmlf Tue May 23 11:57:27 2006
@@ -31,7 +31,8 @@
    description="Test/debug a Single File">
    <fail unless="classname">Must set property 'classname'</fail>
    <antcall target="start-db" />
-   <antcall target="init-db" />   <nbjpdastart name="junit.textui.TestRunner" addressproperty="jpda.address" transport="dt_socket">
+   <antcall target="init-db" />   
+   <nbjpdastart name="junit.textui.TestRunner" addressproperty="jpda.address" transport="dt_socket">
       <classpath>
         <path refid="junit.path"/>
       </classpath>