incubator-connectors-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kwri...@apache.org
Subject svn commit: r1049836 - in /incubator/lcf/branches/release-0.1-branch: ./ connectors/filesystem/ framework/ tests/filesystem/org/apache/manifoldcf/filesystem_tests/
Date Thu, 16 Dec 2010 09:20:43 GMT
Author: kwright
Date: Thu Dec 16 09:20:42 2010
New Revision: 1049836

URL: http://svn.apache.org/viewvc?rev=1049836&view=rev
Log:
Tests for CONNECTORS-128.

Added:
    incubator/lcf/branches/release-0.1-branch/tests/filesystem/org/apache/manifoldcf/filesystem_tests/Expiration.java
      - copied unchanged from r1049834, incubator/lcf/trunk/tests/filesystem/org/apache/manifoldcf/filesystem_tests/Expiration.java
    incubator/lcf/branches/release-0.1-branch/tests/filesystem/org/apache/manifoldcf/filesystem_tests/Hopcount.java
      - copied unchanged from r1049834, incubator/lcf/trunk/tests/filesystem/org/apache/manifoldcf/filesystem_tests/Hopcount.java
Modified:
    incubator/lcf/branches/release-0.1-branch/   (props changed)
    incubator/lcf/branches/release-0.1-branch/build.xml
    incubator/lcf/branches/release-0.1-branch/connectors/filesystem/build.xml
    incubator/lcf/branches/release-0.1-branch/framework/build.xml
    incubator/lcf/branches/release-0.1-branch/tests/filesystem/org/apache/manifoldcf/filesystem_tests/APISanity.java
    incubator/lcf/branches/release-0.1-branch/tests/filesystem/org/apache/manifoldcf/filesystem_tests/Sanity.java

Propchange: incubator/lcf/branches/release-0.1-branch/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Thu Dec 16 09:20:42 2010
@@ -1 +1 @@
-/incubator/lcf/trunk:1039159,1041674,1041679,1041763,1041885,1041968,1042383,1042836-1042837,1042896,1042898,1043728,1044276,1044287,1044294,1044641
+/incubator/lcf/trunk:1039159,1041674,1041679,1041763,1041885,1041968,1042383,1042836-1042837,1042896,1042898,1043728,1044276,1044287,1044294,1044641,1049834

Modified: incubator/lcf/branches/release-0.1-branch/build.xml
URL: http://svn.apache.org/viewvc/incubator/lcf/branches/release-0.1-branch/build.xml?rev=1049836&r1=1049835&r2=1049836&view=diff
==============================================================================
--- incubator/lcf/branches/release-0.1-branch/build.xml (original)
+++ incubator/lcf/branches/release-0.1-branch/build.xml Thu Dec 16 09:20:42 2010
@@ -1424,7 +1424,7 @@
 
     <target name="run-filesystem-tests" depends="compile-filesystem-tests,calculate-filesystem-tests-condition"
if="filesystem-tests.include">
         <mkdir dir="test-output/filesystem"/>
-        <junit fork="true" maxmemory="128m" dir="test-output/filesystem" showoutput="true">
+        <junit fork="true" maxmemory="128m" dir="test-output/filesystem" showoutput="true"
haltonfailure="true">
             <classpath>
                 <fileset dir="framework/lib">
                     <include name="*.jar"/>
@@ -1451,13 +1451,15 @@
             </classpath>
             <test name="org.apache.manifoldcf.filesystem_tests.Sanity" todir="test-output/filesystem"/>
             <test name="org.apache.manifoldcf.filesystem_tests.APISanity" todir="test-output/filesystem"/>
+            <test name="org.apache.manifoldcf.filesystem_tests.Hopcount" todir="test-output/filesystem"/>
+            <test name="org.apache.manifoldcf.filesystem_tests.Expiration" todir="test-output/filesystem"/>
             <!-- MHL -->
         </junit>
     </target>
 
     <target name="run-sharepoint-tests" depends="compile-sharepoint-tests,calculate-sharepoint-tests-condition"
if="sharepoint-tests.include">
         <mkdir dir="test-output/sharepoint"/>
-        <junit fork="true" maxmemory="128m" dir="test-output/sharepoint" showoutput="true">
+        <junit fork="true" maxmemory="128m" dir="test-output/sharepoint" showoutput="true"
haltonfailure="true">
             <classpath>
                 <fileset dir="framework/lib">
                     <include name="*.jar"/>
@@ -1573,5 +1575,21 @@ all     - Do it all (requires Apache For
 All targets requiring Apache Forrest also require Sun JDK 1.5.
       </echo>
     </target>
-    
+
+    <target name="-taskdef">
+      <typedef resource="org/apache/rat/anttasks/antlib.xml" uri="antlib:rat.anttasks">
+        <classpath>
+          <fileset dir="." includes="rat*.jar"/>
+        </classpath>
+      </typedef>
+    </target>
+    <target name="rat-sources" depends="-taskdef"
+      description="runs the tasks over src/java excluding the license directory">
+      <rat:report xmlns:rat="antlib:org.apache.rat.anttasks">
+        <fileset dir="connectors/"/>
+        <fileset dir="framework/"/>
+        <fileset dir="site/src/"/>
+      </rat:report>
+    </target>
+
 </project>

Modified: incubator/lcf/branches/release-0.1-branch/connectors/filesystem/build.xml
URL: http://svn.apache.org/viewvc/incubator/lcf/branches/release-0.1-branch/connectors/filesystem/build.xml?rev=1049836&r1=1049835&r2=1049836&view=diff
==============================================================================
--- incubator/lcf/branches/release-0.1-branch/connectors/filesystem/build.xml (original)
+++ incubator/lcf/branches/release-0.1-branch/connectors/filesystem/build.xml Thu Dec 16 09:20:42
2010
@@ -71,7 +71,7 @@
 
     <target name="run-tests" depends="compile-tests">
         <mkdir dir="test-output"/>
-        <junit fork="true" maxmemory="128m" dir="test-output" showoutput="true">
+        <junit fork="true" maxmemory="128m" dir="test-output" showoutput="true" haltonfailure="true">
             <classpath>
                 <fileset dir="lib">
                     <include name="*.jar"/>

Modified: incubator/lcf/branches/release-0.1-branch/framework/build.xml
URL: http://svn.apache.org/viewvc/incubator/lcf/branches/release-0.1-branch/framework/build.xml?rev=1049836&r1=1049835&r2=1049836&view=diff
==============================================================================
--- incubator/lcf/branches/release-0.1-branch/framework/build.xml (original)
+++ incubator/lcf/branches/release-0.1-branch/framework/build.xml Thu Dec 16 09:20:42 2010
@@ -447,7 +447,7 @@
 
     <target name="run-tests" depends="compile-tests">
         <mkdir dir="test-output"/>
-        <junit fork="true" maxmemory="128m" dir="test-output" showoutput="true">
+        <junit fork="true" maxmemory="128m" dir="test-output" showoutput="true" haltonfailure="true">
             <classpath>
                 <fileset dir="lib">
                     <include name="*.jar"/>

Modified: incubator/lcf/branches/release-0.1-branch/tests/filesystem/org/apache/manifoldcf/filesystem_tests/APISanity.java
URL: http://svn.apache.org/viewvc/incubator/lcf/branches/release-0.1-branch/tests/filesystem/org/apache/manifoldcf/filesystem_tests/APISanity.java?rev=1049836&r1=1049835&r2=1049836&view=diff
==============================================================================
--- incubator/lcf/branches/release-0.1-branch/tests/filesystem/org/apache/manifoldcf/filesystem_tests/APISanity.java
(original)
+++ incubator/lcf/branches/release-0.1-branch/tests/filesystem/org/apache/manifoldcf/filesystem_tests/APISanity.java
Thu Dec 16 09:20:42 2010
@@ -222,7 +222,7 @@ public class APISanity extends TestBase
       
       // Now, start the job, and wait until it completes.
       startJob(jobIDString);
-      waitJobInactive(jobIDString);
+      waitJobInactive(jobIDString, 120000L);
 
       // Check to be sure we actually processed the right number of documents.
       // The test data area has 3 documents and one directory, and we have to count the root
directory too.
@@ -236,7 +236,7 @@ public class APISanity extends TestBase
 
       // Now, start the job, and wait until it completes.
       startJob(jobIDString);
-      waitJobInactive(jobIDString);
+      waitJobInactive(jobIDString, 120000L);
 
       // The test data area has 4 documents and one directory, and we have to count the root
directory too.
       count = getJobDocumentsProcessed(jobIDString);
@@ -248,7 +248,7 @@ public class APISanity extends TestBase
       
       // Now, start the job, and wait until it completes.
       startJob(jobIDString);
-      waitJobInactive(jobIDString);
+      waitJobInactive(jobIDString, 120000L);
 
       // The test data area has 4 documents and one directory, and we have to count the root
directory too.
       count = getJobDocumentsProcessed(jobIDString);
@@ -262,7 +262,7 @@ public class APISanity extends TestBase
       
       // Now, start the job, and wait until it completes.
       startJob(jobIDString);
-      waitJobInactive(jobIDString);
+      waitJobInactive(jobIDString, 120000L);
 
       // Check to be sure we actually processed the right number of documents.
       // The test data area has 3 documents and one directory, and we have to count the root
directory too.
@@ -273,7 +273,7 @@ public class APISanity extends TestBase
       // Now, delete the job.
       deleteJob(jobIDString);
 
-      waitJobDeleted(jobIDString);
+      waitJobDeleted(jobIDString, 120000L);
       
       // Cleanup is automatic by the base class, so we can feel free to leave jobs and connections
lying around.
     }
@@ -365,10 +365,11 @@ public class APISanity extends TestBase
     return new Long(documentsProcessed).longValue();
   }
 
-  protected void waitJobInactive(String jobIDString)
+  protected void waitJobInactive(String jobIDString, long maxTime)
     throws Exception
   {
-    while (true)
+    long startTime = System.currentTimeMillis();
+    while (System.currentTimeMillis() < startTime + maxTime)
     {
       String status = getJobStatus(jobIDString);
       if (status == null)
@@ -376,24 +377,27 @@ public class APISanity extends TestBase
       if (status.equals("not yet run"))
         throw new Exception("Job was never started.");
       if (status.equals("done"))
-        break;
+        return;
       if (status.equals("error"))
         throw new Exception("Job reports error.");
-      ManifoldCF.sleep(10000L);
+      ManifoldCF.sleep(1000L);
       continue;
     }
+    throw new ManifoldCFException("ManifoldCF did not terminate in the allotted time of "+new
Long(maxTime).toString()+" milliseconds");
   }
   
-  protected void waitJobDeleted(String jobIDString)
+  protected void waitJobDeleted(String jobIDString, long maxTime)
     throws Exception
   {
-    while (true)
+    long startTime = System.currentTimeMillis();
+    while (System.currentTimeMillis() < startTime + maxTime)
     {
       String status = getJobStatus(jobIDString);
       if (status == null)
-        break;
-      ManifoldCF.sleep(10000L);
+        return;
+      ManifoldCF.sleep(1000L);
     }
+    throw new ManifoldCFException("ManifoldCF did not delete in the allotted time of "+new
Long(maxTime).toString()+" milliseconds");
   }
     
 

Modified: incubator/lcf/branches/release-0.1-branch/tests/filesystem/org/apache/manifoldcf/filesystem_tests/Sanity.java
URL: http://svn.apache.org/viewvc/incubator/lcf/branches/release-0.1-branch/tests/filesystem/org/apache/manifoldcf/filesystem_tests/Sanity.java?rev=1049836&r1=1049835&r2=1049836&view=diff
==============================================================================
--- incubator/lcf/branches/release-0.1-branch/tests/filesystem/org/apache/manifoldcf/filesystem_tests/Sanity.java
(original)
+++ incubator/lcf/branches/release-0.1-branch/tests/filesystem/org/apache/manifoldcf/filesystem_tests/Sanity.java
Thu Dec 16 09:20:42 2010
@@ -139,7 +139,7 @@ public class Sanity extends TestBase
       
       // Now, start the job, and wait until it completes.
       jobManager.manualStart(job.getID());
-      waitJobInactive(jobManager,job.getID());
+      waitJobInactive(jobManager,job.getID(),120000L);
 
       // Check to be sure we actually processed the right number of documents.
       JobStatus status = jobManager.getStatus(job.getID());
@@ -152,7 +152,7 @@ public class Sanity extends TestBase
 
       // Now, start the job, and wait until it completes.
       jobManager.manualStart(job.getID());
-      waitJobInactive(jobManager,job.getID());
+      waitJobInactive(jobManager,job.getID(),120000L);
 
       status = jobManager.getStatus(job.getID());
       // The test data area has 4 documents and one directory, and we have to count the root
directory too.
@@ -164,7 +164,7 @@ public class Sanity extends TestBase
       
       // Now, start the job, and wait until it completes.
       jobManager.manualStart(job.getID());
-      waitJobInactive(jobManager,job.getID());
+      waitJobInactive(jobManager,job.getID(),120000L);
 
       status = jobManager.getStatus(job.getID());
       // The test data area has 4 documents and one directory, and we have to count the root
directory too.
@@ -178,7 +178,7 @@ public class Sanity extends TestBase
       
       // Now, start the job, and wait until it completes.
       jobManager.manualStart(job.getID());
-      waitJobInactive(jobManager,job.getID());
+      waitJobInactive(jobManager,job.getID(),120000L);
 
       // Check to be sure we actually processed the right number of documents.
       status = jobManager.getStatus(job.getID());
@@ -188,7 +188,7 @@ public class Sanity extends TestBase
 
       // Now, delete the job.
       jobManager.deleteJob(job.getID());
-      waitJobDeleted(jobManager,job.getID());
+      waitJobDeleted(jobManager,job.getID(),120000L);
       
       // Cleanup is automatic by the base class, so we can feel free to leave jobs and connections
lying around.
     }
@@ -199,10 +199,11 @@ public class Sanity extends TestBase
     }
   }
   
-  protected void waitJobInactive(IJobManager jobManager, Long jobID)
+  protected void waitJobInactive(IJobManager jobManager, Long jobID, long maxTime)
     throws ManifoldCFException, InterruptedException
   {
-    while (true)
+    long startTime = System.currentTimeMillis();
+    while (System.currentTimeMillis() < startTime + maxTime)
     {
       JobStatus status = jobManager.getStatus(jobID);
       if (status == null)
@@ -217,23 +218,26 @@ public class Sanity extends TestBase
         case JobStatus.JOBSTATUS_ERROR:
           throw new ManifoldCFException("Job reports error status: "+status.getErrorText());
         default:
-          ManifoldCF.sleep(10000L);
+          ManifoldCF.sleep(1000L);
           continue;
       }
-      break;
+      return;
     }
+    throw new ManifoldCFException("ManifoldCF did not terminate in the allotted time of "+new
Long(maxTime).toString()+" milliseconds");
   }
   
-  protected void waitJobDeleted(IJobManager jobManager, Long jobID)
+  protected void waitJobDeleted(IJobManager jobManager, Long jobID, long maxTime)
     throws ManifoldCFException, InterruptedException
   {
-    while (true)
+    long startTime = System.currentTimeMillis();
+    while (System.currentTimeMillis() < startTime + maxTime)
     {
       JobStatus status = jobManager.getStatus(jobID);
       if (status == null)
-        break;
-      ManifoldCF.sleep(10000L);
+        return;
+      ManifoldCF.sleep(1000L);
     }
+    throw new ManifoldCFException("ManifoldCF did not delete in the allotted time of "+new
Long(maxTime).toString()+" milliseconds");
   }
     
 



Mime
View raw message