incubator-connectors-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kwri...@apache.org
Subject svn commit: r1131177 - in /incubator/lcf/trunk: ./ connectors/activedirectory/ connectors/documentum/ connectors/filenet/ connectors/filesystem/ connectors/filesystem/tests/src/main/java/org/apache/manifoldcf/crawler/connectors/filesystem/tests/ connec...
Date Fri, 03 Jun 2011 20:06:42 GMT
Author: kwright
Date: Fri Jun  3 20:06:41 2011
New Revision: 1131177

URL: http://svn.apache.org/viewvc?rev=1131177&view=rev
Log:
Some of the changes needed for CONNECTORS-204.

Added:
    incubator/lcf/trunk/connectors/filesystem/tests/src/main/java/org/apache/manifoldcf/crawler/connectors/filesystem/tests/SanityHSQLDB.java   (with props)
    incubator/lcf/trunk/connectors/filesystem/tests/src/main/java/org/apache/manifoldcf/crawler/connectors/filesystem/tests/TestBaseHSQLDB.java   (with props)
    incubator/lcf/trunk/framework/tests/src/main/java/org/apache/manifoldcf/agents/tests/SanityHSQLDB.java   (with props)
    incubator/lcf/trunk/framework/tests/src/main/java/org/apache/manifoldcf/agents/tests/TestBaseHSQLDB.java   (with props)
    incubator/lcf/trunk/framework/tests/src/main/java/org/apache/manifoldcf/core/tests/TestBaseHSQLDB.java   (with props)
    incubator/lcf/trunk/framework/tests/src/main/java/org/apache/manifoldcf/crawler/tests/SanityHSQLDB.java   (with props)
    incubator/lcf/trunk/framework/tests/src/main/java/org/apache/manifoldcf/crawler/tests/TestBaseHSQLDB.java   (with props)
    incubator/lcf/trunk/framework/tests/src/main/java/org/apache/manifoldcf/crawler/tests/TestConnectorBaseHSQLDB.java   (with props)
Modified:
    incubator/lcf/trunk/build.xml
    incubator/lcf/trunk/connectors/activedirectory/build.xml
    incubator/lcf/trunk/connectors/documentum/build.xml
    incubator/lcf/trunk/connectors/filenet/build.xml
    incubator/lcf/trunk/connectors/filesystem/build.xml
    incubator/lcf/trunk/connectors/gts/build.xml
    incubator/lcf/trunk/connectors/jcifs/build.xml
    incubator/lcf/trunk/connectors/jdbc/build.xml
    incubator/lcf/trunk/connectors/livelink/build.xml
    incubator/lcf/trunk/connectors/memex/build.xml
    incubator/lcf/trunk/connectors/meridio/build.xml
    incubator/lcf/trunk/connectors/nullauthority/build.xml
    incubator/lcf/trunk/connectors/nulloutput/build.xml
    incubator/lcf/trunk/connectors/rss/build.xml
    incubator/lcf/trunk/connectors/sharepoint/build.xml
    incubator/lcf/trunk/connectors/solr/build.xml
    incubator/lcf/trunk/connectors/webcrawler/build.xml
    incubator/lcf/trunk/framework/build.xml

Modified: incubator/lcf/trunk/build.xml
URL: http://svn.apache.org/viewvc/incubator/lcf/trunk/build.xml?rev=1131177&r1=1131176&r2=1131177&view=diff
==============================================================================
--- incubator/lcf/trunk/build.xml (original)
+++ incubator/lcf/trunk/build.xml Fri Jun  3 20:06:41 2011
@@ -25,6 +25,8 @@
         <delete dir="build"/>
         <delete dir="dist"/>
         <delete dir="test-output"/>
+        <delete dir="test-postgresql-output"/>
+        <delete dir="test-HSQLDB-output"/>
         <ant dir="site" target="clean"/>
         <ant dir="framework" target="clean"/>
         <delete dir="framework/lib"/>
@@ -137,6 +139,10 @@
         <ant dir="framework" target="run-tests-postgresql"/>
     </target>
 
+    <target name="run-tests-HSQLDB-framework" depends="setup-framework">
+        <ant dir="framework" target="run-tests-HSQLDB"/>
+    </target>
+
     <target name="setup-activedirectory-connector" depends="build-framework">
         <mkdir dir="connectors/activedirectory/lib"/>
         <copy todir="connectors/activedirectory/lib">
@@ -174,6 +180,10 @@
         <ant dir="connectors/activedirectory" target="run-tests-postgresql"/>
     </target>
 
+    <target name="run-tests-HSQLDB-activedirectory-connector" depends="setup-activedirectory-connector,setup-activedirectory-connector-tests">
+        <ant dir="connectors/activedirectory" target="run-tests-HSQLDB"/>
+    </target>
+
     <target name="setup-documentum-connector" depends="build-framework">
         <mkdir dir="connectors/documentum/lib"/>
         <copy todir="connectors/documentum/lib">
@@ -211,6 +221,10 @@
         <ant dir="connectors/documentum" target="run-tests-postgresql"/>
     </target>
 
+    <target name="run-tests-HSQLDB-documentum-connector" depends="setup-documentum-connector,setup-documentum-connector-tests">
+        <ant dir="connectors/documentum" target="run-tests-HSQLDB"/>
+    </target>
+
     <target name="setup-filenet-connector" depends="build-framework">
         <mkdir dir="connectors/filenet/lib"/>
         <copy todir="connectors/filenet/lib">
@@ -245,7 +259,11 @@
     </target>
 
     <target name="run-tests-postgresql-filenet-connector" depends="setup-filenet-connector,setup-filenet-connector-tests">
-        <ant dir="connectors/filenet" target="run-tests"/>
+        <ant dir="connectors/filenet" target="run-tests-postgresql"/>
+    </target>
+
+    <target name="run-tests-HSQLDB-filenet-connector" depends="setup-filenet-connector,setup-filenet-connector-tests">
+        <ant dir="connectors/filenet" target="run-tests-HSQLDB"/>
     </target>
 
     <target name="setup-filesystem-connector" depends="build-framework">
@@ -285,6 +303,10 @@
         <ant dir="connectors/filesystem" target="run-tests-postgresql"/>
     </target>
 
+    <target name="run-tests-HSQLDB-filesystem-connector" depends="setup-filesystem-connector,setup-filesystem-connector-tests">
+        <ant dir="connectors/filesystem" target="run-tests-HSQLDB"/>
+    </target>
+
     <target name="setup-gts-connector" depends="build-framework">
         <mkdir dir="connectors/gts/lib"/>
         <copy todir="connectors/gts/lib">
@@ -325,6 +347,10 @@
         <ant dir="connectors/gts" target="run-tests-postgresql"/>
     </target>
 
+    <target name="run-tests-HSQLDB-gts-connector" depends="setup-gts-connector,setup-gts-connector-tests">
+        <ant dir="connectors/gts" target="run-tests-HSQLDB"/>
+    </target>
+
     <target name="setup-jcifs-connector" depends="build-framework">
         <mkdir dir="connectors/jcifs/lib"/>
         <copy todir="connectors/jcifs/lib">
@@ -360,6 +386,10 @@
         <ant dir="connectors/jcifs" target="run-tests-postgresql"/>
     </target>
 
+    <target name="run-tests-HSQLDB-jcifs-connector" depends="setup-jcifs-connector,setup-jcifs-connector-tests">
+        <ant dir="connectors/jcifs" target="run-tests-HSQLDB"/>
+    </target>
+
     <target name="setup-jdbc-connector" depends="build-framework">
         <mkdir dir="connectors/jdbc/lib"/>
         <copy todir="connectors/jdbc/lib">
@@ -397,6 +427,10 @@
         <ant dir="connectors/jdbc" target="run-tests-postgresql"/>
     </target>
 
+    <target name="run-tests-HSQLDB-jdbc-connector" depends="setup-jdbc-connector,setup-jdbc-connector-tests">
+        <ant dir="connectors/jdbc" target="run-tests-HSQLDB"/>
+    </target>
+
     <target name="setup-livelink-connector" depends="build-framework">
         <mkdir dir="connectors/livelink/lib"/>
         <copy todir="connectors/livelink/lib">
@@ -434,6 +468,10 @@
         <ant dir="connectors/livelink" target="run-tests-postgresql"/>
     </target>
 
+    <target name="run-tests-HSQLDB-livelink-connector" depends="setup-livelink-connector,setup-livelink-connector-tests">
+        <ant dir="connectors/livelink" target="run-tests-HSQLDB"/>
+    </target>
+
     <target name="setup-solr-connector" depends="build-framework">
         <mkdir dir="connectors/solr/lib"/>
         <copy todir="connectors/solr/lib">
@@ -471,6 +509,10 @@
         <ant dir="connectors/solr" target="run-tests-postgresql"/>
     </target>
 
+    <target name="run-tests-HSQLDB-solr-connector" depends="setup-solr-connector,setup-solr-connector-tests">
+        <ant dir="connectors/solr" target="run-tests-HSQLDB"/>
+    </target>
+
     <target name="setup-memex-connector" depends="build-framework">
         <mkdir dir="connectors/memex/lib"/>
         <copy todir="connectors/memex/lib">
@@ -508,6 +550,10 @@
         <ant dir="connectors/memex" target="run-tests-postgresql"/>
     </target>
 
+    <target name="run-tests-HSQLDB-memex-connector" depends="setup-memex-connector,setup-memex-connector-tests">
+        <ant dir="connectors/memex" target="run-tests-HSQLDB"/>
+    </target>
+
     <target name="setup-meridio-connector" depends="build-framework">
         <mkdir dir="connectors/meridio/lib"/>
         <copy todir="connectors/meridio/lib">
@@ -555,6 +601,10 @@
         <ant dir="connectors/meridio" target="run-tests-postgresql"/>
     </target>
 
+    <target name="run-tests-HSQLDB-meridio-connector" depends="setup-meridio-connector,setup-meridio-connector-tests">
+        <ant dir="connectors/meridio" target="run-tests-HSQLDB"/>
+    </target>
+
     <target name="setup-nullauthority-connector" depends="build-framework">
         <mkdir dir="connectors/nullauthority/lib"/>
         <copy todir="connectors/nulloutput/lib">
@@ -592,6 +642,10 @@
         <ant dir="connectors/nullauthority" target="run-tests-postgresql"/>
     </target>
 
+    <target name="run-tests-HSQLDB-nullauthority-connector" depends="setup-nullauthority-connector,setup-nullauthority-connector-tests">
+        <ant dir="connectors/nullauthority" target="run-tests-HSQLDB"/>
+    </target>
+
     <target name="setup-nulloutput-connector" depends="build-framework">
         <mkdir dir="connectors/nulloutput/lib"/>
         <copy todir="connectors/nulloutput/lib">
@@ -629,6 +683,10 @@
         <ant dir="connectors/nulloutput" target="run-tests-postgresql"/>
     </target>
 
+    <target name="run-tests-HSQLDB-nulloutput-connector" depends="setup-nulloutput-connector,setup-nulloutput-connector-tests">
+        <ant dir="connectors/nulloutput" target="run-tests-HSQLDB"/>
+    </target>
+
     <target name="setup-rss-connector" depends="build-framework">
         <mkdir dir="connectors/rss/lib"/>
         <copy todir="connectors/rss/lib">
@@ -666,6 +724,10 @@
         <ant dir="connectors/rss" target="run-tests-postgresql"/>
     </target>
 
+    <target name="run-tests-HSQLDB-rss-connector" depends="setup-rss-connector,setup-rss-connector-tests">
+        <ant dir="connectors/rss" target="run-tests-HSQLDB"/>
+    </target>
+
     <target name="setup-sharepoint-connector" depends="build-framework">
         <mkdir dir="connectors/sharepoint/lib"/>
         <copy todir="connectors/sharepoint/lib">
@@ -711,6 +773,10 @@
         <ant dir="connectors/sharepoint" target="run-tests-postgresql"/>
     </target>
 
+    <target name="run-tests-HSQLDB-sharepoint-connector" depends="setup-sharepoint-connector,setup-sharepoint-connector-tests">
+        <ant dir="connectors/sharepoint" target="run-tests-HSQLDB"/>
+    </target>
+
     <target name="setup-webcrawler-connector" depends="build-framework">
         <mkdir dir="connectors/webcrawler/lib"/>
         <copy todir="connectors/webcrawler/lib">
@@ -748,6 +814,10 @@
         <ant dir="connectors/webcrawler" target="run-tests-postgresql"/>
     </target>
 
+    <target name="run-tests-HSQLDB-webcrawler-connector" depends="setup-webcrawler-connector,setup-webcrawler-connector-tests">
+        <ant dir="connectors/webcrawler" target="run-tests-HSQLDB"/>
+    </target>
+
     <target name="deliver-site-doc" depends="build-site">
           <mkdir dir="dist/doc"/>
           <copy todir="dist/doc">

Modified: incubator/lcf/trunk/connectors/activedirectory/build.xml
URL: http://svn.apache.org/viewvc/incubator/lcf/trunk/connectors/activedirectory/build.xml?rev=1131177&r1=1131176&r2=1131177&view=diff
==============================================================================
--- incubator/lcf/trunk/connectors/activedirectory/build.xml (original)
+++ incubator/lcf/trunk/connectors/activedirectory/build.xml Fri Jun  3 20:06:41 2011
@@ -57,6 +57,7 @@
     </target>
     <target name="run-tests"/>
     <target name="run-tests-postgresql"/>
-    <target name="all" depends="build,doc,build-tests,run-tests,run-tests-postgresql"/>
+    <target name="run-tests-HSQLDB"/>
+    <target name="all" depends="build,doc,build-tests,run-tests,run-tests-postgresql,run-tests-HSQLDB"/>
     
 </project>

Modified: incubator/lcf/trunk/connectors/documentum/build.xml
URL: http://svn.apache.org/viewvc/incubator/lcf/trunk/connectors/documentum/build.xml?rev=1131177&r1=1131176&r2=1131177&view=diff
==============================================================================
--- incubator/lcf/trunk/connectors/documentum/build.xml (original)
+++ incubator/lcf/trunk/connectors/documentum/build.xml Fri Jun  3 20:06:41 2011
@@ -223,6 +223,7 @@
     </target>
     <target name="run-tests"/>
     <target name="run-tests-postgresql"/>
-    <target name="all" depends="build,doc,build-tests,run-tests,run-tests-postgresql"/>
+    <target name="run-tests-HSQLDB"/>
+    <target name="all" depends="build,doc,build-tests,run-tests,run-tests-postgresql,run-tests-HSQLDB"/>
 
 </project>

Modified: incubator/lcf/trunk/connectors/filenet/build.xml
URL: http://svn.apache.org/viewvc/incubator/lcf/trunk/connectors/filenet/build.xml?rev=1131177&r1=1131176&r2=1131177&view=diff
==============================================================================
--- incubator/lcf/trunk/connectors/filenet/build.xml (original)
+++ incubator/lcf/trunk/connectors/filenet/build.xml Fri Jun  3 20:06:41 2011
@@ -218,6 +218,7 @@
     </target>
     <target name="run-tests"/>
     <target name="run-tests-postgresql"/>
-    <target name="all" depends="build,doc,build-tests,run-tests,run-tests-postgresql"/>
+    <target name="run-tests-HSQLDB"/>
+    <target name="all" depends="build,doc,build-tests,run-tests,run-tests-postgresql,run-tests-HSQLDB"/>
     
 </project>

Modified: incubator/lcf/trunk/connectors/filesystem/build.xml
URL: http://svn.apache.org/viewvc/incubator/lcf/trunk/connectors/filesystem/build.xml?rev=1131177&r1=1131176&r2=1131177&view=diff
==============================================================================
--- incubator/lcf/trunk/connectors/filesystem/build.xml (original)
+++ incubator/lcf/trunk/connectors/filesystem/build.xml Fri Jun  3 20:06:41 2011
@@ -21,6 +21,8 @@
         <delete dir="build"/>
         <delete dir="dist"/>
         <delete dir="test-output"/>
+        <delete dir="test-output-postgresql"/>
+        <delete dir="test-output-HSQLDB"/>
     </target>
     
     <target name="doc">
@@ -99,8 +101,23 @@
         </junit>
     </target>
 
+    <target name="run-tests-HSQLDB" depends="compile-tests">
+        <mkdir dir="test-output-HSQLDB"/>
+        <junit fork="true" maxmemory="128m" dir="test-output-HSQLDB" showoutput="true" haltonfailure="true">
+            <classpath>
+                <fileset dir="lib">
+                    <include name="*.jar"/>
+                </fileset>
+                <pathelement location="build/connector/classes"/>
+                <pathelement location="build/tests/classes"/>
+            </classpath>
+            <test name="org.apache.manifoldcf.crawler.connectors.filesystem.tests.SanityHSQLDB" todir="test-output-HSQLDB"/>
+            <!-- MHL -->
+        </junit>
+    </target>
+
     <target name="build" depends="lib"/>
     <target name="build-tests" depends="jar-tests"/>
-    <target name="all" depends="build,doc,build-tests,run-tests,run-tests-postgresql"/>
+    <target name="all" depends="build,doc,build-tests,run-tests,run-tests-postgresql,run-tests-HSQLDB"/>
     
 </project>

Added: incubator/lcf/trunk/connectors/filesystem/tests/src/main/java/org/apache/manifoldcf/crawler/connectors/filesystem/tests/SanityHSQLDB.java
URL: http://svn.apache.org/viewvc/incubator/lcf/trunk/connectors/filesystem/tests/src/main/java/org/apache/manifoldcf/crawler/connectors/filesystem/tests/SanityHSQLDB.java?rev=1131177&view=auto
==============================================================================
--- incubator/lcf/trunk/connectors/filesystem/tests/src/main/java/org/apache/manifoldcf/crawler/connectors/filesystem/tests/SanityHSQLDB.java (added)
+++ incubator/lcf/trunk/connectors/filesystem/tests/src/main/java/org/apache/manifoldcf/crawler/connectors/filesystem/tests/SanityHSQLDB.java Fri Jun  3 20:06:41 2011
@@ -0,0 +1,42 @@
+/* $Id$ */
+
+/**
+* Licensed to the Apache Software Foundation (ASF) under one or more
+* contributor license agreements. See the NOTICE file distributed with
+* this work for additional information regarding copyright ownership.
+* The ASF licenses this file to You under the Apache License, Version 2.0
+* (the "License"); you may not use this file except in compliance with
+* the License. You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+package org.apache.manifoldcf.crawler.connectors.filesystem.tests;
+
+import org.apache.manifoldcf.core.interfaces.*;
+import org.apache.manifoldcf.agents.interfaces.*;
+import org.apache.manifoldcf.crawler.interfaces.*;
+import org.apache.manifoldcf.crawler.system.ManifoldCF;
+
+import java.io.*;
+import java.util.*;
+import org.junit.*;
+
+/** This is a very basic sanity check */
+public class SanityHSQLDB extends TestBaseHSQLDB
+{
+  
+  @Test
+  public void sanityCheck()
+    throws Exception
+  {
+    // If we get this far, it must mean that the setup was successful, which is all that I'm shooting for in this test.
+  }
+  
+
+}

Propchange: incubator/lcf/trunk/connectors/filesystem/tests/src/main/java/org/apache/manifoldcf/crawler/connectors/filesystem/tests/SanityHSQLDB.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/lcf/trunk/connectors/filesystem/tests/src/main/java/org/apache/manifoldcf/crawler/connectors/filesystem/tests/SanityHSQLDB.java
------------------------------------------------------------------------------
    svn:keywords = Id

Added: incubator/lcf/trunk/connectors/filesystem/tests/src/main/java/org/apache/manifoldcf/crawler/connectors/filesystem/tests/TestBaseHSQLDB.java
URL: http://svn.apache.org/viewvc/incubator/lcf/trunk/connectors/filesystem/tests/src/main/java/org/apache/manifoldcf/crawler/connectors/filesystem/tests/TestBaseHSQLDB.java?rev=1131177&view=auto
==============================================================================
--- incubator/lcf/trunk/connectors/filesystem/tests/src/main/java/org/apache/manifoldcf/crawler/connectors/filesystem/tests/TestBaseHSQLDB.java (added)
+++ incubator/lcf/trunk/connectors/filesystem/tests/src/main/java/org/apache/manifoldcf/crawler/connectors/filesystem/tests/TestBaseHSQLDB.java Fri Jun  3 20:06:41 2011
@@ -0,0 +1,44 @@
+/* $Id$ */
+
+/**
+* Licensed to the Apache Software Foundation (ASF) under one or more
+* contributor license agreements. See the NOTICE file distributed with
+* this work for additional information regarding copyright ownership.
+* The ASF licenses this file to You under the Apache License, Version 2.0
+* (the "License"); you may not use this file except in compliance with
+* the License. You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+package org.apache.manifoldcf.crawler.connectors.filesystem.tests;
+
+import org.apache.manifoldcf.core.interfaces.*;
+import org.apache.manifoldcf.agents.interfaces.*;
+import org.apache.manifoldcf.crawler.interfaces.*;
+import org.apache.manifoldcf.crawler.system.ManifoldCF;
+
+import java.io.*;
+import java.util.*;
+import org.junit.*;
+
+/** This is a testing base class that is responsible for setting up/tearing down the agents framework. */
+public class TestBaseHSQLDB extends org.apache.manifoldcf.crawler.tests.TestConnectorBaseHSQLDB
+{
+  
+  protected String[] getConnectorNames()
+  {
+    return new String[]{"File Connector"};
+  }
+  
+  protected String[] getConnectorClasses()
+  {
+    return new String[]{"org.apache.manifoldcf.crawler.connectors.filesystem.FileConnector"};
+  }
+
+}

Propchange: incubator/lcf/trunk/connectors/filesystem/tests/src/main/java/org/apache/manifoldcf/crawler/connectors/filesystem/tests/TestBaseHSQLDB.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/lcf/trunk/connectors/filesystem/tests/src/main/java/org/apache/manifoldcf/crawler/connectors/filesystem/tests/TestBaseHSQLDB.java
------------------------------------------------------------------------------
    svn:keywords = Id

Modified: incubator/lcf/trunk/connectors/gts/build.xml
URL: http://svn.apache.org/viewvc/incubator/lcf/trunk/connectors/gts/build.xml?rev=1131177&r1=1131176&r2=1131177&view=diff
==============================================================================
--- incubator/lcf/trunk/connectors/gts/build.xml (original)
+++ incubator/lcf/trunk/connectors/gts/build.xml Fri Jun  3 20:06:41 2011
@@ -62,6 +62,7 @@
     </target>
     <target name="run-tests"/>
     <target name="run-tests-postgresql"/>
-    <target name="all" depends="build,doc,build-tests,run-tests,run-tests-postgresql"/>
+    <target name="run-tests-HSQLDB"/>
+    <target name="all" depends="build,doc,build-tests,run-tests,run-tests-postgresql,run-tests-HSQLDB"/>
     
 </project>

Modified: incubator/lcf/trunk/connectors/jcifs/build.xml
URL: http://svn.apache.org/viewvc/incubator/lcf/trunk/connectors/jcifs/build.xml?rev=1131177&r1=1131176&r2=1131177&view=diff
==============================================================================
--- incubator/lcf/trunk/connectors/jcifs/build.xml (original)
+++ incubator/lcf/trunk/connectors/jcifs/build.xml Fri Jun  3 20:06:41 2011
@@ -73,6 +73,7 @@
     </target>
     <target name="run-tests"/>
     <target name="run-tests-postgresql"/>
-    <target name="all" depends="build,doc,build-tests,run-tests,run-tests-postgresql"/>
+    <target name="run-tests-HSQLDB"/>
+    <target name="all" depends="build,doc,build-tests,run-tests,run-tests-HSQLDB"/>
     
 </project>

Modified: incubator/lcf/trunk/connectors/jdbc/build.xml
URL: http://svn.apache.org/viewvc/incubator/lcf/trunk/connectors/jdbc/build.xml?rev=1131177&r1=1131176&r2=1131177&view=diff
==============================================================================
--- incubator/lcf/trunk/connectors/jdbc/build.xml (original)
+++ incubator/lcf/trunk/connectors/jdbc/build.xml Fri Jun  3 20:06:41 2011
@@ -60,6 +60,7 @@
     </target>
     <target name="run-tests"/>
     <target name="run-tests-postgresql"/>
-    <target name="all" depends="build,doc,build-tests,run-tests,run-tests-postgresql"/>
+    <target name="run-tests-HSQLDB"/>
+    <target name="all" depends="build,doc,build-tests,run-tests,run-tests-postgresql,run-tests-HSQLDB"/>
     
 </project>

Modified: incubator/lcf/trunk/connectors/livelink/build.xml
URL: http://svn.apache.org/viewvc/incubator/lcf/trunk/connectors/livelink/build.xml?rev=1131177&r1=1131176&r2=1131177&view=diff
==============================================================================
--- incubator/lcf/trunk/connectors/livelink/build.xml (original)
+++ incubator/lcf/trunk/connectors/livelink/build.xml Fri Jun  3 20:06:41 2011
@@ -73,6 +73,7 @@
     </target>
     <target name="run-tests"/>
     <target name="run-tests-postgresql"/>
-    <target name="all" depends="build,doc,build-tests,run-tests,run-tests-postgresql"/>
+    <target name="run-tests-HSQLDB"/>
+    <target name="all" depends="build,doc,build-tests,run-tests,run-tests-postgresql,run-tests-HSQLDB"/>
     
 </project>

Modified: incubator/lcf/trunk/connectors/memex/build.xml
URL: http://svn.apache.org/viewvc/incubator/lcf/trunk/connectors/memex/build.xml?rev=1131177&r1=1131176&r2=1131177&view=diff
==============================================================================
--- incubator/lcf/trunk/connectors/memex/build.xml (original)
+++ incubator/lcf/trunk/connectors/memex/build.xml Fri Jun  3 20:06:41 2011
@@ -73,6 +73,7 @@
     </target>
     <target name="run-tests"/>
     <target name="run-tests-postgresql"/>
-    <target name="all" depends="build,doc,build-tests,run-tests,run-tests-postgresql"/>
+    <target name="run-tests-HSQLDB"/>
+    <target name="all" depends="build,doc,build-tests,run-tests,run-tests-postgresql,run-tests-HSQLDB"/>
     
 </project>

Modified: incubator/lcf/trunk/connectors/meridio/build.xml
URL: http://svn.apache.org/viewvc/incubator/lcf/trunk/connectors/meridio/build.xml?rev=1131177&r1=1131176&r2=1131177&view=diff
==============================================================================
--- incubator/lcf/trunk/connectors/meridio/build.xml (original)
+++ incubator/lcf/trunk/connectors/meridio/build.xml Fri Jun  3 20:06:41 2011
@@ -201,6 +201,7 @@
     </target>
     <target name="run-tests"/>
     <target name="run-tests-postgresql"/>
-    <target name="all" depends="build,doc,build-tests,run-tests,run-tests-postgresql"/>
+    <target name="run-tests-HSQLDB"/>
+    <target name="all" depends="build,doc,build-tests,run-tests,run-tests-postgresql,run-tests-HSQLDB"/>
     
 </project>

Modified: incubator/lcf/trunk/connectors/nullauthority/build.xml
URL: http://svn.apache.org/viewvc/incubator/lcf/trunk/connectors/nullauthority/build.xml?rev=1131177&r1=1131176&r2=1131177&view=diff
==============================================================================
--- incubator/lcf/trunk/connectors/nullauthority/build.xml (original)
+++ incubator/lcf/trunk/connectors/nullauthority/build.xml Fri Jun  3 20:06:41 2011
@@ -57,6 +57,7 @@
     </target>
     <target name="run-tests"/>
     <target name="run-tests-postgresql"/>
-    <target name="all" depends="build,doc,build-tests,run-tests,run-tests-postgresql"/>
+    <target name="run-tests-HSQLDB"/>
+    <target name="all" depends="build,doc,build-tests,run-tests,run-tests-postgresql,run-tests-HSQLDB"/>
     
 </project>

Modified: incubator/lcf/trunk/connectors/nulloutput/build.xml
URL: http://svn.apache.org/viewvc/incubator/lcf/trunk/connectors/nulloutput/build.xml?rev=1131177&r1=1131176&r2=1131177&view=diff
==============================================================================
--- incubator/lcf/trunk/connectors/nulloutput/build.xml (original)
+++ incubator/lcf/trunk/connectors/nulloutput/build.xml Fri Jun  3 20:06:41 2011
@@ -57,6 +57,7 @@
     </target>
     <target name="run-tests"/>
     <target name="run-tests-postgresql"/>
-    <target name="all" depends="build,doc,build-tests,run-tests,run-tests-postgresql"/>
+    <target name="run-tests-HSQLDB"/>
+    <target name="all" depends="build,doc,build-tests,run-tests,run-tests-postgresql,run-tests-HSQLDB"/>
     
 </project>

Modified: incubator/lcf/trunk/connectors/rss/build.xml
URL: http://svn.apache.org/viewvc/incubator/lcf/trunk/connectors/rss/build.xml?rev=1131177&r1=1131176&r2=1131177&view=diff
==============================================================================
--- incubator/lcf/trunk/connectors/rss/build.xml (original)
+++ incubator/lcf/trunk/connectors/rss/build.xml Fri Jun  3 20:06:41 2011
@@ -57,6 +57,7 @@
     </target>
     <target name="run-tests"/>
     <target name="run-tests-postgresql"/>
-    <target name="all" depends="build,doc,build-tests,run-tests,run-tests-postgresql"/>
+    <target name="run-tests-HSQLDB"/>
+    <target name="all" depends="build,doc,build-tests,run-tests,run-tests-postgresql,run-tests-HSQLDB"/>
     
 </project>

Modified: incubator/lcf/trunk/connectors/sharepoint/build.xml
URL: http://svn.apache.org/viewvc/incubator/lcf/trunk/connectors/sharepoint/build.xml?rev=1131177&r1=1131176&r2=1131177&view=diff
==============================================================================
--- incubator/lcf/trunk/connectors/sharepoint/build.xml (original)
+++ incubator/lcf/trunk/connectors/sharepoint/build.xml Fri Jun  3 20:06:41 2011
@@ -159,6 +159,7 @@
     </target>
     <target name="run-tests"/>
     <target name="run-tests-postgresql"/>
-    <target name="all" depends="build,doc,build-tests,run-tests,run-tests-postgresql"/>
+    <target name="run-tests-HSQLDB"/>
+    <target name="all" depends="build,doc,build-tests,run-tests,run-tests-postgresql,run-tests-HSQLDB"/>
     
 </project>

Modified: incubator/lcf/trunk/connectors/solr/build.xml
URL: http://svn.apache.org/viewvc/incubator/lcf/trunk/connectors/solr/build.xml?rev=1131177&r1=1131176&r2=1131177&view=diff
==============================================================================
--- incubator/lcf/trunk/connectors/solr/build.xml (original)
+++ incubator/lcf/trunk/connectors/solr/build.xml Fri Jun  3 20:06:41 2011
@@ -57,6 +57,7 @@
     </target>
     <target name="run-tests"/>
     <target name="run-tests-postgresql"/>
-    <target name="all" depends="build,doc,build-tests,run-tests,run-tests-postgresql"/>
+    <target name="run-tests-HSQLDB"/>
+    <target name="all" depends="build,doc,build-tests,run-tests,run-tests-postgresql,run-tests-HSQLDB"/>
     
 </project>

Modified: incubator/lcf/trunk/connectors/webcrawler/build.xml
URL: http://svn.apache.org/viewvc/incubator/lcf/trunk/connectors/webcrawler/build.xml?rev=1131177&r1=1131176&r2=1131177&view=diff
==============================================================================
--- incubator/lcf/trunk/connectors/webcrawler/build.xml (original)
+++ incubator/lcf/trunk/connectors/webcrawler/build.xml Fri Jun  3 20:06:41 2011
@@ -57,6 +57,7 @@
     </target>
     <target name="run-tests"/>
     <target name="run-tests-postgresql"/>
-    <target name="all" depends="build,doc,build-tests,run-tests,run-tests-postgresql"/>
+    <target name="run-tests-HSQLDB"/>
+    <target name="all" depends="build,doc,build-tests,run-tests,run-tests-postgresql,run-tests-HSQLDB"/>
     
 </project>

Modified: incubator/lcf/trunk/framework/build.xml
URL: http://svn.apache.org/viewvc/incubator/lcf/trunk/framework/build.xml?rev=1131177&r1=1131176&r2=1131177&view=diff
==============================================================================
--- incubator/lcf/trunk/framework/build.xml (original)
+++ incubator/lcf/trunk/framework/build.xml Fri Jun  3 20:06:41 2011
@@ -21,6 +21,8 @@
         <delete dir="build"/>
         <delete dir="dist"/>
         <delete dir="test-output"/>
+        <delete dir="test-output-postgresql"/>
+        <delete dir="test-output-HSQLDB"/>
     </target>
     
     <target name="doc">
@@ -487,6 +489,27 @@
         </junit>
     </target>
 
+    <target name="run-tests-HSQLDB" depends="compile-tests">
+        <mkdir dir="test-output-HSQLDB"/>
+        <junit fork="true" maxmemory="128m" dir="test-output-HSQLDB" showoutput="true" haltonfailure="true">
+            <classpath>
+                <fileset dir="lib">
+                    <include name="*.jar"/>
+                </fileset>
+                <pathelement location="build/core/classes"/>
+                <pathelement location="build/ui-core/classes"/>
+                <pathelement location="build/agents/classes"/>
+                <pathelement location="build/pull-agent/classes"/>
+                <pathelement location="build/authority-servlet/classes"/>
+                <pathelement location="build/api-servlet/classes"/>
+                <pathelement location="build/tests/classes"/>
+            </classpath>
+            <test name="org.apache.manifoldcf.agents.tests.SanityHSQLDB" todir="test-output-HSQLDB"/>
+            <test name="org.apache.manifoldcf.crawler.tests.SanityHSQLDB" todir="test-output-HSQLDB"/>
+            <!-- MHL -->
+        </junit>
+    </target>
+
     <target name="build" depends="processes,war-authority-service,war-crawler-ui,war-api-service,example"/>
     
     <target name="all" depends="build,doc,build-tests,run-tests,run-tests-postgresql"/>

Added: incubator/lcf/trunk/framework/tests/src/main/java/org/apache/manifoldcf/agents/tests/SanityHSQLDB.java
URL: http://svn.apache.org/viewvc/incubator/lcf/trunk/framework/tests/src/main/java/org/apache/manifoldcf/agents/tests/SanityHSQLDB.java?rev=1131177&view=auto
==============================================================================
--- incubator/lcf/trunk/framework/tests/src/main/java/org/apache/manifoldcf/agents/tests/SanityHSQLDB.java (added)
+++ incubator/lcf/trunk/framework/tests/src/main/java/org/apache/manifoldcf/agents/tests/SanityHSQLDB.java Fri Jun  3 20:06:41 2011
@@ -0,0 +1,41 @@
+/* $Id$ */
+
+/**
+* Licensed to the Apache Software Foundation (ASF) under one or more
+* contributor license agreements. See the NOTICE file distributed with
+* this work for additional information regarding copyright ownership.
+* The ASF licenses this file to You under the Apache License, Version 2.0
+* (the "License"); you may not use this file except in compliance with
+* the License. You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+package org.apache.manifoldcf.agents.tests;
+
+import org.apache.manifoldcf.core.interfaces.*;
+import org.apache.manifoldcf.agents.interfaces.*;
+import org.apache.manifoldcf.agents.system.ManifoldCF;
+
+import java.io.*;
+import java.util.*;
+import org.junit.*;
+
+/** This is a very basic sanity check */
+public class SanityHSQLDB extends TestBaseHSQLDB
+{
+  
+  @Test
+  public void sanityCheck()
+    throws Exception
+  {
+    // If we get this far, it must mean that the setup was successful, which is all that I'm shooting for in this test.
+  }
+  
+
+}

Propchange: incubator/lcf/trunk/framework/tests/src/main/java/org/apache/manifoldcf/agents/tests/SanityHSQLDB.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/lcf/trunk/framework/tests/src/main/java/org/apache/manifoldcf/agents/tests/SanityHSQLDB.java
------------------------------------------------------------------------------
    svn:keywords = Id

Added: incubator/lcf/trunk/framework/tests/src/main/java/org/apache/manifoldcf/agents/tests/TestBaseHSQLDB.java
URL: http://svn.apache.org/viewvc/incubator/lcf/trunk/framework/tests/src/main/java/org/apache/manifoldcf/agents/tests/TestBaseHSQLDB.java?rev=1131177&view=auto
==============================================================================
--- incubator/lcf/trunk/framework/tests/src/main/java/org/apache/manifoldcf/agents/tests/TestBaseHSQLDB.java (added)
+++ incubator/lcf/trunk/framework/tests/src/main/java/org/apache/manifoldcf/agents/tests/TestBaseHSQLDB.java Fri Jun  3 20:06:41 2011
@@ -0,0 +1,117 @@
+/* $Id$ */
+
+/**
+* Licensed to the Apache Software Foundation (ASF) under one or more
+* contributor license agreements. See the NOTICE file distributed with
+* this work for additional information regarding copyright ownership.
+* The ASF licenses this file to You under the Apache License, Version 2.0
+* (the "License"); you may not use this file except in compliance with
+* the License. You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+package org.apache.manifoldcf.agents.tests;
+
+import org.apache.manifoldcf.core.interfaces.*;
+import org.apache.manifoldcf.agents.interfaces.*;
+import org.apache.manifoldcf.agents.system.ManifoldCF;
+
+import java.io.*;
+import java.util.*;
+import org.junit.*;
+
+/** This is a testing base class that is responsible for setting up/tearing down the agents framework. */
+public class TestBaseHSQLDB extends org.apache.manifoldcf.core.tests.TestBaseHSQLDB
+{
+  
+  @Before
+  public void setUp()
+    throws Exception
+  {
+    try
+    {
+      localCleanUp();
+    }
+    catch (Exception e)
+    {
+      System.out.println("Warning: Preclean failed: "+e.getMessage());
+    }
+    try
+    {
+      localSetUp();
+    }
+    catch (Exception e)
+    {
+      e.printStackTrace();
+      throw e;
+    }
+  }
+
+  protected void localSetUp()
+    throws Exception
+  {
+    super.localSetUp();
+    
+    // Install the agents tables
+    initialize();
+    ManifoldCF.initializeEnvironment();
+    IThreadContext tc = ThreadContextFactory.make();
+    ManifoldCF.installTables(tc);
+  }
+  
+  @After
+  public void cleanUp()
+    throws Exception
+  {
+    try
+    {
+      localCleanUp();
+    }
+    catch (Exception e)
+    {
+      e.printStackTrace();
+      throw e;
+    }
+  }
+
+  protected void localCleanUp()
+    throws Exception
+  {
+    initialize();
+    if (isInitialized())
+    {
+      // Test the uninstall
+      ManifoldCF.initializeEnvironment();
+      IThreadContext tc = ThreadContextFactory.make();
+      
+      Exception currentException = null;
+      try
+      {
+        ManifoldCF.deinstallTables(tc);
+      }
+      catch (Exception e)
+      {
+        if (currentException != null)
+          currentException = e;
+      }
+      try
+      {
+        super.localCleanUp();
+      }
+      catch (Exception e)
+      {
+        if (currentException != null)
+          currentException = e;
+      }
+      if (currentException != null)
+        throw currentException;
+    }
+  }
+  
+}

Propchange: incubator/lcf/trunk/framework/tests/src/main/java/org/apache/manifoldcf/agents/tests/TestBaseHSQLDB.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/lcf/trunk/framework/tests/src/main/java/org/apache/manifoldcf/agents/tests/TestBaseHSQLDB.java
------------------------------------------------------------------------------
    svn:keywords = Id

Added: incubator/lcf/trunk/framework/tests/src/main/java/org/apache/manifoldcf/core/tests/TestBaseHSQLDB.java
URL: http://svn.apache.org/viewvc/incubator/lcf/trunk/framework/tests/src/main/java/org/apache/manifoldcf/core/tests/TestBaseHSQLDB.java?rev=1131177&view=auto
==============================================================================
--- incubator/lcf/trunk/framework/tests/src/main/java/org/apache/manifoldcf/core/tests/TestBaseHSQLDB.java (added)
+++ incubator/lcf/trunk/framework/tests/src/main/java/org/apache/manifoldcf/core/tests/TestBaseHSQLDB.java Fri Jun  3 20:06:41 2011
@@ -0,0 +1,165 @@
+/* $Id$ */
+
+/**
+* Licensed to the Apache Software Foundation (ASF) under one or more
+* contributor license agreements. See the NOTICE file distributed with
+* this work for additional information regarding copyright ownership.
+* The ASF licenses this file to You under the Apache License, Version 2.0
+* (the "License"); you may not use this file except in compliance with
+* the License. You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+package org.apache.manifoldcf.core.tests;
+
+import org.apache.manifoldcf.core.interfaces.*;
+import org.apache.manifoldcf.core.system.ManifoldCF;
+
+import java.io.*;
+import java.util.*;
+import org.junit.*;
+
+/** This is a testing base class that is responsible for setting up/tearing down the core Derby database. */
+public class TestBaseHSQLDB
+{
+  protected File currentPath = null;
+  protected File configFile = null;
+  protected File loggingFile = null;
+  protected File logOutputFile = null;
+
+  protected void initialize()
+    throws Exception
+  {
+    if (currentPath == null)
+    {
+      currentPath = new File(".").getCanonicalFile();
+
+      // First, write a properties file and a logging file, in the current directory.
+      configFile = new File("properties.xml").getCanonicalFile();
+      loggingFile = new File("logging.ini").getCanonicalFile();
+      logOutputFile = new File("manifoldcf.log").getCanonicalFile();
+
+      // Set a system property that will point us to the proper place to find the properties file
+      System.setProperty("org.apache.manifoldcf.configfile",configFile.getCanonicalFile().getAbsolutePath());
+    }
+  }
+  
+  protected boolean isInitialized()
+  {
+    return configFile.exists();
+  }
+  
+  @Before
+  public void setUp()
+    throws Exception
+  {
+    try
+    {
+      localCleanUp();
+    }
+    catch (Exception e)
+    {
+      System.out.println("Warning: Preclean error: "+e.getMessage());
+    }
+    try
+    {
+      localSetUp();
+    }
+    catch (Exception e)
+    {
+      e.printStackTrace();
+      throw e;
+    }
+  }
+
+
+  protected void localSetUp()
+    throws Exception
+  {
+    initialize();
+    String currentPathString = currentPath.getAbsolutePath();
+    writeFile(loggingFile,
+      "log4j.appender.MAIN.File="+logOutputFile.getAbsolutePath().replaceAll("\\\\","/")+"\n" +
+      "log4j.rootLogger=WARN, MAIN\n" +
+      "log4j.appender.MAIN=org.apache.log4j.RollingFileAppender\n" +
+      "log4j.appender.MAIN.layout=org.apache.log4j.PatternLayout\n");
+
+    writeFile(configFile,
+      "<?xml version=\"1.0\" encoding=\"UTF-8\" ?>\n" +
+      "<configuration>\n"+
+      "  <property name=\"org.apache.manifoldcf.databaseimplementationclass\" value=\"org.apache.manifoldcf.core.database.DBInterfaceHSQLDB\"/>\n" +
+      "  <property name=\"org.apache.manifoldcf.hsqldbdatabasepath\" value=\""+currentPathString.replaceAll("\\\\","/")+"\"/>\n" +
+      "  <property name=\"org.apache.manifoldcf.logconfigfile\" value=\""+loggingFile.getAbsolutePath().replaceAll("\\\\","/")+"\"/>\n" +
+      "</configuration>\n");
+
+    ManifoldCF.initializeEnvironment();
+    IThreadContext tc = ThreadContextFactory.make();
+    
+    // Create the database
+    ManifoldCF.createSystemDatabase(tc,"","");
+
+  }
+  
+  @After
+  public void cleanUp()
+    throws Exception
+  {
+    try
+    {
+      localCleanUp();
+    }
+    catch (Exception e)
+    {
+      e.printStackTrace();
+      throw e;
+    }
+  }
+
+  protected void localCleanUp()
+    throws Exception
+  {
+    initialize();
+    if (isInitialized())
+    {
+      ManifoldCF.initializeEnvironment();
+      IThreadContext tc = ThreadContextFactory.make();
+      
+      // Remove the database
+      ManifoldCF.dropSystemDatabase(tc,"","");
+      
+      // Get rid of the property and logging files.
+      logOutputFile.delete();
+      configFile.delete();
+      loggingFile.delete();
+    }
+  }
+
+  protected static void writeFile(File f, String fileContents)
+    throws IOException
+  {
+    OutputStream os = new FileOutputStream(f);
+    try
+    {
+      Writer w = new OutputStreamWriter(os,"utf-8");
+      try
+      {
+        w.write(fileContents);
+      }
+      finally
+      {
+        w.close();
+      }
+    }
+    finally
+    {
+      os.close();
+    }
+  }
+  
+}

Propchange: incubator/lcf/trunk/framework/tests/src/main/java/org/apache/manifoldcf/core/tests/TestBaseHSQLDB.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/lcf/trunk/framework/tests/src/main/java/org/apache/manifoldcf/core/tests/TestBaseHSQLDB.java
------------------------------------------------------------------------------
    svn:keywords = Id

Added: incubator/lcf/trunk/framework/tests/src/main/java/org/apache/manifoldcf/crawler/tests/SanityHSQLDB.java
URL: http://svn.apache.org/viewvc/incubator/lcf/trunk/framework/tests/src/main/java/org/apache/manifoldcf/crawler/tests/SanityHSQLDB.java?rev=1131177&view=auto
==============================================================================
--- incubator/lcf/trunk/framework/tests/src/main/java/org/apache/manifoldcf/crawler/tests/SanityHSQLDB.java (added)
+++ incubator/lcf/trunk/framework/tests/src/main/java/org/apache/manifoldcf/crawler/tests/SanityHSQLDB.java Fri Jun  3 20:06:41 2011
@@ -0,0 +1,41 @@
+/* $Id$ */
+
+/**
+* Licensed to the Apache Software Foundation (ASF) under one or more
+* contributor license agreements. See the NOTICE file distributed with
+* this work for additional information regarding copyright ownership.
+* The ASF licenses this file to You under the Apache License, Version 2.0
+* (the "License"); you may not use this file except in compliance with
+* the License. You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+package org.apache.manifoldcf.crawler.tests;
+
+import org.apache.manifoldcf.core.interfaces.*;
+import org.apache.manifoldcf.agents.interfaces.*;
+import org.apache.manifoldcf.agents.system.ManifoldCF;
+
+import java.io.*;
+import java.util.*;
+import org.junit.*;
+
+/** This is a very basic sanity check */
+public class SanityHSQLDB extends TestBaseHSQLDB
+{
+  
+  @Test
+  public void sanityCheck()
+    throws Exception
+  {
+    // If we get this far, it must mean that the setup was successful, which is all that I'm shooting for in this test.
+  }
+  
+
+}

Propchange: incubator/lcf/trunk/framework/tests/src/main/java/org/apache/manifoldcf/crawler/tests/SanityHSQLDB.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/lcf/trunk/framework/tests/src/main/java/org/apache/manifoldcf/crawler/tests/SanityHSQLDB.java
------------------------------------------------------------------------------
    svn:keywords = Id

Added: incubator/lcf/trunk/framework/tests/src/main/java/org/apache/manifoldcf/crawler/tests/TestBaseHSQLDB.java
URL: http://svn.apache.org/viewvc/incubator/lcf/trunk/framework/tests/src/main/java/org/apache/manifoldcf/crawler/tests/TestBaseHSQLDB.java?rev=1131177&view=auto
==============================================================================
--- incubator/lcf/trunk/framework/tests/src/main/java/org/apache/manifoldcf/crawler/tests/TestBaseHSQLDB.java (added)
+++ incubator/lcf/trunk/framework/tests/src/main/java/org/apache/manifoldcf/crawler/tests/TestBaseHSQLDB.java Fri Jun  3 20:06:41 2011
@@ -0,0 +1,120 @@
+/* $Id$ */
+
+/**
+* Licensed to the Apache Software Foundation (ASF) under one or more
+* contributor license agreements. See the NOTICE file distributed with
+* this work for additional information regarding copyright ownership.
+* The ASF licenses this file to You under the Apache License, Version 2.0
+* (the "License"); you may not use this file except in compliance with
+* the License. You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+package org.apache.manifoldcf.crawler.tests;
+
+import org.apache.manifoldcf.core.interfaces.*;
+import org.apache.manifoldcf.agents.interfaces.*;
+import org.apache.manifoldcf.crawler.interfaces.*;
+import org.apache.manifoldcf.crawler.system.ManifoldCF;
+
+import java.io.*;
+import java.util.*;
+import org.junit.*;
+
+/** This is a testing base class that is responsible for setting up/tearing down the agents framework. */
+public class TestBaseHSQLDB extends org.apache.manifoldcf.agents.tests.TestBaseHSQLDB
+{
+  
+  @Before
+  public void setUp()
+    throws Exception
+  {
+    try
+    {
+      localCleanUp();
+    }
+    catch (Exception e)
+    {
+      System.out.println("Warning: Preclean failed: "+e.getMessage());
+    }
+    try
+    {
+      localSetUp();
+    }
+    catch (Exception e)
+    {
+      e.printStackTrace();
+      throw e;
+    }
+  }
+
+  protected void localSetUp()
+    throws Exception
+  {
+    super.localSetUp();
+    
+    // Install the agents tables
+    initialize();
+    ManifoldCF.initializeEnvironment();
+    IThreadContext tc = ThreadContextFactory.make();
+    IAgentManager mgr = AgentManagerFactory.make(tc);
+    mgr.registerAgent("org.apache.manifoldcf.crawler.system.CrawlerAgent");
+  }
+  
+  @After
+  public void cleanUp()
+    throws Exception
+  {
+    try
+    {
+      localCleanUp();
+    }
+    catch (Exception e)
+    {
+      e.printStackTrace();
+      throw e;
+    }
+  }
+
+  protected void localCleanUp()
+    throws Exception
+  {
+    initialize();
+    if (isInitialized())
+    {
+      // Test the uninstall
+      ManifoldCF.initializeEnvironment();
+      IThreadContext tc = ThreadContextFactory.make();
+      
+      Exception currentException = null;
+      try
+      {
+        IAgentManager mgr = AgentManagerFactory.make(tc);
+        mgr.unregisterAgent("org.apache.manifoldcf.crawler.system.CrawlerAgent");
+      }
+      catch (Exception e)
+      {
+        if (currentException != null)
+          currentException = e;
+      }
+      try
+      {
+        super.localCleanUp();
+      }
+      catch (Exception e)
+      {
+        if (currentException != null)
+          currentException = e;
+      }
+      if (currentException != null)
+        throw currentException;
+    }
+  }
+
+}

Propchange: incubator/lcf/trunk/framework/tests/src/main/java/org/apache/manifoldcf/crawler/tests/TestBaseHSQLDB.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/lcf/trunk/framework/tests/src/main/java/org/apache/manifoldcf/crawler/tests/TestBaseHSQLDB.java
------------------------------------------------------------------------------
    svn:keywords = Id

Added: incubator/lcf/trunk/framework/tests/src/main/java/org/apache/manifoldcf/crawler/tests/TestConnectorBaseHSQLDB.java
URL: http://svn.apache.org/viewvc/incubator/lcf/trunk/framework/tests/src/main/java/org/apache/manifoldcf/crawler/tests/TestConnectorBaseHSQLDB.java?rev=1131177&view=auto
==============================================================================
--- incubator/lcf/trunk/framework/tests/src/main/java/org/apache/manifoldcf/crawler/tests/TestConnectorBaseHSQLDB.java (added)
+++ incubator/lcf/trunk/framework/tests/src/main/java/org/apache/manifoldcf/crawler/tests/TestConnectorBaseHSQLDB.java Fri Jun  3 20:06:41 2011
@@ -0,0 +1,330 @@
+/* $Id$ */
+
+/**
+* Licensed to the Apache Software Foundation (ASF) under one or more
+* contributor license agreements. See the NOTICE file distributed with
+* this work for additional information regarding copyright ownership.
+* The ASF licenses this file to You under the Apache License, Version 2.0
+* (the "License"); you may not use this file except in compliance with
+* the License. You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+package org.apache.manifoldcf.crawler.tests;
+
+import org.apache.manifoldcf.core.interfaces.*;
+import org.apache.manifoldcf.agents.interfaces.*;
+import org.apache.manifoldcf.crawler.interfaces.*;
+import org.apache.manifoldcf.authorities.interfaces.*;
+import org.apache.manifoldcf.core.system.ManifoldCF;
+
+import java.io.*;
+import java.util.*;
+import org.junit.*;
+
+/** This is a testing base class that is responsible for setting up/tearing down the agents framework. */
+public class TestConnectorBaseHSQLDB extends org.apache.manifoldcf.crawler.tests.TestBaseHSQLDB
+{
+  
+  protected String[] getConnectorClasses()
+  {
+    return new String[0];
+  }
+  
+  protected String[] getConnectorNames()
+  {
+    return new String[0];
+  }
+  
+  protected String[] getAuthorityClasses()
+  {
+    return new String[0];
+  }
+  
+  protected String[] getAuthorityNames()
+  {
+    return new String[0];
+  }
+  
+  protected String[] getOutputClasses()
+  {
+    return new String[0];
+  }
+  
+  protected String[] getOutputNames()
+  {
+    return new String[0];
+  }
+  
+  @Before
+  public void setUp()
+    throws Exception
+  {
+    try
+    {
+      localCleanUp();
+    }
+    catch (Exception e)
+    {
+      System.out.println("Warning: Preclean failed: "+e.getMessage());
+    }
+    try
+    {
+      localSetUp();
+    }
+    catch (Exception e)
+    {
+      e.printStackTrace();
+      throw e;
+    }
+  }
+
+  protected void localSetUp()
+    throws Exception
+  {
+    
+    super.localSetUp();
+    
+    // Register the connector we're testing
+    initialize();
+    ManifoldCF.initializeEnvironment();
+    IThreadContext tc = ThreadContextFactory.make();
+
+    IDBInterface database = DBInterfaceFactory.make(tc,
+      ManifoldCF.getMasterDatabaseName(),
+      ManifoldCF.getMasterDatabaseUsername(),
+      ManifoldCF.getMasterDatabasePassword());
+    
+    IConnectorManager mgr = ConnectorManagerFactory.make(tc);
+    IAuthorityConnectorManager authMgr = AuthorityConnectorManagerFactory.make(tc);
+    IJobManager jobManager = JobManagerFactory.make(tc);
+    IRepositoryConnectionManager connManager = RepositoryConnectionManagerFactory.make(tc);
+    IOutputConnectorManager outputMgr = OutputConnectorManagerFactory.make(tc);
+    IOutputConnectionManager outputConnManager = OutputConnectionManagerFactory.make(tc);
+
+    // Deregistration should be done in a transaction
+    database.beginTransaction();
+    try
+    {
+      int i;
+      
+      String[] connectorClasses = getConnectorClasses();
+      String[] connectorNames = getConnectorNames();
+
+      i = 0;
+      while (i < connectorClasses.length)
+      {
+        // First, register connector
+        mgr.registerConnector(connectorNames[i],connectorClasses[i]);
+        // Then, signal to all jobs that might depend on this connector that they can switch state
+        // Find the connection names that come with this class
+        String[] connectionNames = connManager.findConnectionsForConnector(connectorClasses[i]);
+        // For each connection name, modify the jobs to note that the connector is now installed
+        jobManager.noteConnectorRegistration(connectionNames);
+        i++;
+      }
+      
+      String[] authorityClasses = getAuthorityClasses();
+      String[] authorityNames = getAuthorityNames();
+      
+      i = 0;
+      while (i < authorityClasses.length)
+      {
+        authMgr.registerConnector(authorityNames[i],authorityClasses[i]);
+        i++;
+      }
+      
+      String[] outputClasses = getOutputClasses();
+      String[] outputNames = getOutputNames();
+      
+      i = 0;
+      while (i < outputClasses.length)
+      {
+        // First, register connector
+        outputMgr.registerConnector(outputNames[i],outputClasses[i]);
+        // Then, signal to all jobs that might depend on this connector that they can switch state
+        // Find the connection names that come with this class
+        String[] connectionNames = outputConnManager.findConnectionsForConnector(outputClasses[i]);
+        // For all connection names, notify all agents of the registration
+        AgentManagerFactory.noteOutputConnectorRegistration(tc,connectionNames);
+        i++;
+      }
+      
+    }
+    catch (ManifoldCFException e)
+    {
+      database.signalRollback();
+      throw e;
+    }
+    catch (Error e)
+    {
+      database.signalRollback();
+      throw e;
+    }
+    finally
+    {
+      database.endTransaction();
+    }
+  }
+  
+  @After
+  public void cleanUp()
+    throws Exception
+  {
+    try
+    {
+      localCleanUp();
+    }
+    catch (Exception e)
+    {
+      e.printStackTrace();
+      throw e;
+    }
+  }
+
+  protected void localCleanUp()
+    throws Exception
+  {
+    initialize();
+    if (isInitialized())
+    {
+      // Test the uninstall
+      ManifoldCF.initializeEnvironment();
+      IThreadContext tc = ThreadContextFactory.make();
+      
+      Exception currentException = null;
+      // First, tear down all jobs, connections, authority connections, and output connections.
+      try
+      {
+        IRepositoryConnectionManager connMgr = RepositoryConnectionManagerFactory.make(tc);
+        IAuthorityConnectionManager authConnMgr = AuthorityConnectionManagerFactory.make(tc);
+        IOutputConnectionManager outputMgr = OutputConnectionManagerFactory.make(tc);
+        
+        // Now, get a list of the repository connections
+        IRepositoryConnection[] connections = connMgr.getAllConnections();
+        int i = 0;
+        while (i < connections.length)
+        {
+          connMgr.delete(connections[i++].getName());
+        }
+
+        // Get a list of authority connections
+        IAuthorityConnection[] authorities = authConnMgr.getAllConnections();
+        i = 0;
+        while (i < authorities.length)
+        {
+          authConnMgr.delete(authorities[i++].getName());
+        }
+        
+        // Finally, get rid of output connections
+        IOutputConnection[] outputs = outputMgr.getAllConnections();
+        i = 0;
+        while (i < outputs.length)
+        {
+          outputMgr.delete(outputs[i++].getName());
+        }
+
+      }
+      catch (Exception e)
+      {
+        currentException = e;
+      }
+      try
+      {
+        IDBInterface database = DBInterfaceFactory.make(tc,
+          ManifoldCF.getMasterDatabaseName(),
+          ManifoldCF.getMasterDatabaseUsername(),
+          ManifoldCF.getMasterDatabasePassword());
+        
+        IConnectorManager mgr = ConnectorManagerFactory.make(tc);
+        IAuthorityConnectorManager authMgr = AuthorityConnectorManagerFactory.make(tc);
+        IOutputConnectorManager outputMgr = OutputConnectorManagerFactory.make(tc);
+        IOutputConnectionManager outputConnManager = OutputConnectionManagerFactory.make(tc);
+        IJobManager jobManager = JobManagerFactory.make(tc);
+        IRepositoryConnectionManager connManager = RepositoryConnectionManagerFactory.make(tc);
+        
+        // Deregistration should be done in a transaction
+        database.beginTransaction();
+        try
+        {
+          int i;
+          
+          String[] connectorClasses = getConnectorClasses();
+
+          i = 0;
+          while (i < connectorClasses.length)
+          {
+            // Find the connection names that come with this class
+            String[] connectionNames = connManager.findConnectionsForConnector(connectorClasses[i]);
+            // For each connection name, modify the jobs to note that the connector is no longer installed
+            jobManager.noteConnectorDeregistration(connectionNames);
+            // Now that all jobs have been placed into an appropriate state, actually do the deregistration itself.
+            mgr.unregisterConnector(connectorClasses[i]);
+            i++;
+          }
+          
+          String[] authorityClasses = getAuthorityClasses();
+          
+          i = 0;
+          while (i < authorityClasses.length)
+          {
+            authMgr.unregisterConnector(authorityClasses[i]);
+            i++;
+          }
+          
+          String[] outputClasses = getOutputClasses();
+          
+          i = 0;
+          while (i < outputClasses.length)
+          {
+            // Find the connection names that come with this class
+            String[] connectionNames = outputConnManager.findConnectionsForConnector(outputClasses[i]);
+            // For all connection names, notify all agents of the deregistration
+            AgentManagerFactory.noteOutputConnectorDeregistration(tc,connectionNames);
+            // Now that all jobs have been placed into an appropriate state, actually do the deregistration itself.
+            outputMgr.unregisterConnector(outputClasses[i]);
+            i++;
+          }
+          
+        }
+        catch (ManifoldCFException e)
+        {
+          database.signalRollback();
+          throw e;
+        }
+        catch (Error e)
+        {
+          database.signalRollback();
+          throw e;
+        }
+        finally
+        {
+          database.endTransaction();
+        }
+      }
+      catch (Exception e)
+      {
+        if (currentException != null)
+          currentException = e;
+      }
+      try
+      {
+        super.localCleanUp();
+      }
+      catch (Exception e)
+      {
+        if (currentException != null)
+          currentException = e;
+      }
+      if (currentException != null)
+        throw currentException;
+    }
+  }
+
+}

Propchange: incubator/lcf/trunk/framework/tests/src/main/java/org/apache/manifoldcf/crawler/tests/TestConnectorBaseHSQLDB.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/lcf/trunk/framework/tests/src/main/java/org/apache/manifoldcf/crawler/tests/TestConnectorBaseHSQLDB.java
------------------------------------------------------------------------------
    svn:keywords = Id



Mime
View raw message