You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@manifoldcf.apache.org by kw...@apache.org on 2014/07/17 08:32:23 UTC

svn commit: r1611258 - in /manifoldcf/branches/CONNECTORS-998/connectors/filesystem/connector/src/test/java/org/apache/manifoldcf/crawler/connectors/filesystem/tests: APISanityDerbyIT.java APISanityTester.java

Author: kwright
Date: Thu Jul 17 06:32:22 2014
New Revision: 1611258

URL: http://svn.apache.org/r1611258
Log:
Add db diagnostics for bad test

Modified:
    manifoldcf/branches/CONNECTORS-998/connectors/filesystem/connector/src/test/java/org/apache/manifoldcf/crawler/connectors/filesystem/tests/APISanityDerbyIT.java
    manifoldcf/branches/CONNECTORS-998/connectors/filesystem/connector/src/test/java/org/apache/manifoldcf/crawler/connectors/filesystem/tests/APISanityTester.java

Modified: manifoldcf/branches/CONNECTORS-998/connectors/filesystem/connector/src/test/java/org/apache/manifoldcf/crawler/connectors/filesystem/tests/APISanityDerbyIT.java
URL: http://svn.apache.org/viewvc/manifoldcf/branches/CONNECTORS-998/connectors/filesystem/connector/src/test/java/org/apache/manifoldcf/crawler/connectors/filesystem/tests/APISanityDerbyIT.java?rev=1611258&r1=1611257&r2=1611258&view=diff
==============================================================================
--- manifoldcf/branches/CONNECTORS-998/connectors/filesystem/connector/src/test/java/org/apache/manifoldcf/crawler/connectors/filesystem/tests/APISanityDerbyIT.java (original)
+++ manifoldcf/branches/CONNECTORS-998/connectors/filesystem/connector/src/test/java/org/apache/manifoldcf/crawler/connectors/filesystem/tests/APISanityDerbyIT.java Thu Jul 17 06:32:22 2014
@@ -31,7 +31,16 @@ public class APISanityDerbyIT extends Ba
   {
     tester = new APISanityTester(mcfInstance);
   }
-  
+
+  protected void writeProperties(StringBuilder output)
+    throws Exception
+  {
+    super.writeProperties(output);
+    output.append(
+      "  <property name=\"org.apache.manifoldcf.db\" value=\"DEBUG\"/>\n"
+    );
+  }
+
   @Before
   public void setupTester()
     throws Exception

Modified: manifoldcf/branches/CONNECTORS-998/connectors/filesystem/connector/src/test/java/org/apache/manifoldcf/crawler/connectors/filesystem/tests/APISanityTester.java
URL: http://svn.apache.org/viewvc/manifoldcf/branches/CONNECTORS-998/connectors/filesystem/connector/src/test/java/org/apache/manifoldcf/crawler/connectors/filesystem/tests/APISanityTester.java?rev=1611258&r1=1611257&r2=1611258&view=diff
==============================================================================
--- manifoldcf/branches/CONNECTORS-998/connectors/filesystem/connector/src/test/java/org/apache/manifoldcf/crawler/connectors/filesystem/tests/APISanityTester.java (original)
+++ manifoldcf/branches/CONNECTORS-998/connectors/filesystem/connector/src/test/java/org/apache/manifoldcf/crawler/connectors/filesystem/tests/APISanityTester.java Thu Jul 17 06:32:22 2014
@@ -22,6 +22,7 @@ import org.apache.manifoldcf.core.interf
 import org.apache.manifoldcf.agents.interfaces.*;
 import org.apache.manifoldcf.crawler.interfaces.*;
 import org.apache.manifoldcf.crawler.system.ManifoldCF;
+import org.apache.manifoldcf.crawler.system.Logging;
 
 import java.io.*;
 import java.util.*;
@@ -54,6 +55,8 @@ public class APISanityTester
   public void executeTest()
     throws Exception
   {
+    Logging.db.debug("STARTING BAD TEST");
+    
     // Hey, we were able to install the file system connector etc.
     // Now, create a local test job and run it.
     int i;
@@ -234,12 +237,23 @@ public class APISanityTester
     if (count != 6)
       throw new ManifoldCFException("Wrong number of documents processed after add - expected 6, saw "+new Long(count).toString());
 
+    Logging.db.debug("STARTING FAILING PART OF BAD TEST");
+
     // Change a file, and recrawl
     FileHelper.changeFile(new File("testdata/test1.txt"),"Modified contents");
       
     // Now, start the job, and wait until it completes.
     instance.startJobAPI(jobIDString);
-    instance.waitJobInactiveAPI(jobIDString, 120000L);
+    try
+    {
+      instance.waitJobInactiveAPI(jobIDString, 240000L);
+    }
+    catch (Exception e)
+    {
+      Logging.db.debug("TEST FAILED");
+      Thread.sleep(100000L);
+      throw e;
+    }
 
     // The test data area has 4 documents and one directory, and we have to count the root directory too.
     count = instance.getJobDocumentsProcessedAPI(jobIDString);