You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@jspwiki.apache.org by me...@apache.org on 2013/01/01 14:25:11 UTC

svn commit: r1427398 - in /incubator/jspwiki/trunk: ChangeLog build.xml src/org/apache/wiki/Release.java tests/org/apache/wiki/web/TestContainer.java

Author: metskem
Date: Tue Jan  1 13:25:11 2013
New Revision: 1427398

URL: http://svn.apache.org/viewvc?rev=1427398&view=rev
Log:
201-01-01  Harry Metske <me...@apache.org>

       * 2.9.1-svn-10
       
       * webtests now also use HsqlDbUtils (just like the normal tests), also removed redundant
         hsqldb ant tasks from build.xml

Modified:
    incubator/jspwiki/trunk/ChangeLog
    incubator/jspwiki/trunk/build.xml
    incubator/jspwiki/trunk/src/org/apache/wiki/Release.java
    incubator/jspwiki/trunk/tests/org/apache/wiki/web/TestContainer.java

Modified: incubator/jspwiki/trunk/ChangeLog
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/ChangeLog?rev=1427398&r1=1427397&r2=1427398&view=diff
==============================================================================
--- incubator/jspwiki/trunk/ChangeLog (original)
+++ incubator/jspwiki/trunk/ChangeLog Tue Jan  1 13:25:11 2013
@@ -1,8 +1,15 @@
+201-01-01  Harry Metske <me...@apache.org>
+
+       * 2.9.1-svn-10
+       
+       * webtests now also use HsqlDbUtils (just like the normal tests), also removed redundant
+         hsqldb ant tasks from build.xml
+
 2012-12-30  Harry Metske <me...@apache.org>
 
        * 2.9.1-svn-9
-       
-       * repaired broken webtests, we now have one (documented) failing webtest (RenameProfile 
+
+       * repaired broken webtests, we now have one (documented) failing webtest (RenameProfile
           for container managed auth).
           Required fixes:
           - TestContainer now binds the jdbc/UserDatabase jdbc/GroupDatabase in Jetty's namespace
@@ -737,7 +744,7 @@
 
         * 2.8.2-svn-12
         
-        * JSPWIKI-466 - FileSystemProviderTest rücksichtslos empties java.io.tmpdir
+        * JSPWIKI-466 - FileSystemProviderTest r�cksichtslos empties java.io.tmpdir
         
 2008-02-12  Janne Jalkanen <ja...@apache.org>
 

Modified: incubator/jspwiki/trunk/build.xml
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/build.xml?rev=1427398&r1=1427397&r2=1427398&view=diff
==============================================================================
--- incubator/jspwiki/trunk/build.xml (original)
+++ incubator/jspwiki/trunk/build.xml Tue Jan  1 13:25:11 2013
@@ -906,7 +906,7 @@
        - 'admin' with password 'myP@5sw0rd' and roles of 'Authenticated', 'Admin'
        These are the same as the test users in tests/org.apache.wiki.auth.Users.
   -->
-  <target name="webtests" depends="jar,tests-init,jartests,tests-db-init,db-setup,war">
+  <target name="webtests" depends="jar,tests-init,jartests,war">
     <mkdir dir="${webtests.temp}" />
     <mkdir dir="${webtests.build}" />
   
@@ -1517,22 +1517,11 @@ To automate the JAR signing processs, yo
 
     <!-- Set a flag that says all of our pre-conditions are met! -->
     <property name="db.props.exist" value="true" />
-    <echo message="All pre-conditions met for HSQLDB setup"/>
 
     <!-- Dump all of the JDBC properties where our test scripts can find them -->
     <echoproperties prefix="jdbc." destfile="${tests.src}/etc/db/jdbc.properties" />
   </target>
 
-  <target name="db-setup" depends="db-properties,hsql-init" if="db.props.exist">
-    <echo message="Setting up the database tables." />
-    <exec-sql file="${userdb.setup}" />
-  </target>
-
-  <target name="db-teardown" depends="db-properties,hsql-init" if="db.props.exist">
-    <echo message="Tearing down the database tables." />
-    <exec-sql file="${userdb.teardown}" />
-  </target>
-
   <!-- Some convenience macrodefs -->
   <macrodef name="check-property">
     <attribute name="prop"/>
@@ -1550,60 +1539,6 @@ To automate the JAR signing processs, yo
     </sequential>
   </macrodef>
 
-  <macrodef name="exec-sql">
-    <attribute name="file" />
-    <sequential>
-      <sql driver="${jdbc.driver.class}"
-        classpath="${jdbc.driver.jar}" url="${jdbc.driver.url}"
-        userid="${jdbc.admin.id}" password="${jdbc.admin.password}"
-        src="@{file}" onerror="continue" autocommit="true" />
-    </sequential>
-  </macrodef>
-
-  <!-- ============================================================== -->
-
-  <!-- Hypersonic embedded database startup/shutdown (for testing JDBC) -->
-
-  <!-- Special "init" target for Hypersonic -->
-  <target name="hsql-init" depends="hsql-check-start,hsql-start" />
-
-  <target name="hsql-check-start" depends="db-properties">
-    <echo message="Checking to see if Hypersonic JDBC server is running already." />
-    <property file="tests/etc/db/hsql/server.properties" prefix="hsql" />
-    <fail unless="hsql.server.port">Failed to load Hypersonic JDBC properties from tests/etc/db/hsql/server.properties</fail>
-    <condition property="hsql.up">
-      <socket server="localhost" port="${hsql.server.port}" />
-    </condition>
-  </target>
-
-  <target name="hsql-start" depends="hsql-check-start" unless="hsql.up"
-    description="Starts the Hypersonic database for testing.">
-    <echo message="Starting up Hypersonic JDBC server on localhost." />
-    <delete file="tests/etc/db/hsql/jspwiki.lck"/>
-    <java fork="yes" spawn="yes" classname="org.hsqldb.Server"
-      dir="tests/etc/db/hsql">
-      <classpath>
-        <pathelement location="${jdbc.driver.jar}" />
-      </classpath>
-    </java>
-    <sleep seconds="3" />
-  </target>
-
-  <target name="hsql-stop" depends="hsql-check-start" if="hsql.up"
-    description="Shuts down the Hypersonic database, if it's up.">
-    <echo message="Shutting down Hypersonic JDBC server on localhost." />
-    <sql driver="${jdbc.driver.class}"
-      classpath="${jdbc.driver.jar}" url="${jdbc.driver.url}"
-      onerror="continue" autocommit="true"
-      userid="${jdbc.admin.id}" password="${jdbc.admin.password}">
-      SHUTDOWN
-    </sql>
-    <!-- The lock file should be deleted automatically, but just in case... -->
-    <delete file="tests/etc/db/hsql/jspwiki.lck" />
-    <echo message="Done." />
-  </target>
-
-  
   <!-- ============================================================== -->
   <target name="i18n-create-template" description="Creates a given directory structure with all the needed files to make an i18n jar">
 	<input message="i18n template code to generate (ie: es_ES):" addproperty="i18n.template" />

Modified: incubator/jspwiki/trunk/src/org/apache/wiki/Release.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/src/org/apache/wiki/Release.java?rev=1427398&r1=1427397&r2=1427398&view=diff
==============================================================================
--- incubator/jspwiki/trunk/src/org/apache/wiki/Release.java (original)
+++ incubator/jspwiki/trunk/src/org/apache/wiki/Release.java Tue Jan  1 13:25:11 2013
@@ -75,7 +75,7 @@ public final class Release
      *  <p>
      *  If the build identifier is empty, it is not added.
      */
-    public static final String     BUILD         = "9";
+    public static final String     BUILD         = "10";
     
     /**
      *  This is the generic version string you should use

Modified: incubator/jspwiki/trunk/tests/org/apache/wiki/web/TestContainer.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/tests/org/apache/wiki/web/TestContainer.java?rev=1427398&r1=1427397&r2=1427398&view=diff
==============================================================================
--- incubator/jspwiki/trunk/tests/org/apache/wiki/web/TestContainer.java (original)
+++ incubator/jspwiki/trunk/tests/org/apache/wiki/web/TestContainer.java Tue Jan  1 13:25:11 2013
@@ -32,6 +32,7 @@ import javax.servlet.http.HttpServletReq
 import javax.servlet.http.HttpServletResponse;
 
 import org.apache.log4j.Logger;
+import org.apache.wiki.HsqlDbUtils;
 import org.apache.wiki.auth.Users;
 import org.eclipse.jetty.jndi.InitialContextFactory;
 import org.eclipse.jetty.jndi.NamingContext;
@@ -70,6 +71,8 @@ public class TestContainer
     public static final String INITIAL_CONTEXT_FACTORY_JETTY = "org.eclipse.jetty.jndi.InitialContextFactory";
     public static final String JNDI_ENV_ROOT = "java:comp/env";
 
+    private static HsqlDbUtils m_hu   = new HsqlDbUtils();
+
     private static final Logger log = Logger.getLogger( TestContainer.class );
 
     private static Context initCtx ;
@@ -107,7 +110,10 @@ public class TestContainer
         }
 
         handlerCollection.addHandler( new DefaultHandler() );
-        
+
+        // setup the hsqldb database engine
+        m_hu.setUp();
+
         // Create the connection pool
         jdbcDataSource cpds = new jdbcDataSource();
         cpds.setDatabase( "jdbc:hsqldb:hsql://localhost/jspwiki" );
@@ -250,7 +256,7 @@ public class TestContainer
     /**
      * Configures a test web application
      * 
-     * @param m_context the name of the web m_context; must start with "/"
+     * @param context the name of the web m_context; must start with "/"
      * @param path the file path for the WAR file, or expanded WAR directory
      * @throws IOException
      */