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 2010/06/09 20:11:09 UTC

svn commit: r953105 - in /incubator/lcf/trunk/modules: connectors/gts/connector/org/apache/lcf/agents/output/gts/ connectors/solr/connector/org/apache/lcf/agents/output/solr/ framework/agents/org/apache/lcf/agents/ framework/agents/org/apache/lcf/agent...

Author: kwright
Date: Wed Jun  9 18:11:09 2010
New Revision: 953105

URL: http://svn.apache.org/viewvc?rev=953105&view=rev
Log:
Fix the tests so that agents can be started/stopped multiple times.  Also, unrelated fix moving some LCF parameters into the connectors that actually used them.

Removed:
    incubator/lcf/trunk/modules/framework/agents/org/apache/lcf/agents/SetupAgentConnection.java
Modified:
    incubator/lcf/trunk/modules/connectors/gts/connector/org/apache/lcf/agents/output/gts/GTSConnector.java
    incubator/lcf/trunk/modules/connectors/gts/connector/org/apache/lcf/agents/output/gts/HttpPoster.java
    incubator/lcf/trunk/modules/connectors/solr/connector/org/apache/lcf/agents/output/solr/HttpPoster.java
    incubator/lcf/trunk/modules/framework/agents/org/apache/lcf/agents/system/LCF.java
    incubator/lcf/trunk/modules/tests/org/apache/lcf/tests/Sanity.java

Modified: incubator/lcf/trunk/modules/connectors/gts/connector/org/apache/lcf/agents/output/gts/GTSConnector.java
URL: http://svn.apache.org/viewvc/incubator/lcf/trunk/modules/connectors/gts/connector/org/apache/lcf/agents/output/gts/GTSConnector.java?rev=953105&r1=953104&r2=953105&view=diff
==============================================================================
--- incubator/lcf/trunk/modules/connectors/gts/connector/org/apache/lcf/agents/output/gts/GTSConnector.java (original)
+++ incubator/lcf/trunk/modules/connectors/gts/connector/org/apache/lcf/agents/output/gts/GTSConnector.java Wed Jun  9 18:11:09 2010
@@ -203,7 +203,7 @@ public class GTSConnector extends org.ap
   /** Detect if a mime type is indexable or not.  This method is used by participating repository connectors to pre-filter the number of
   * unusable documents that will be passed to this output connector.
   *@param mimeType is the mime type of the document.
-  *@param true if the mime type is indexable by this connector.
+  *@return true if the mime type is indexable by this connector.
   */
   public boolean checkMimeTypeIndexable(String mimeType)
     throws LCFException, ServiceInterruption

Modified: incubator/lcf/trunk/modules/connectors/gts/connector/org/apache/lcf/agents/output/gts/HttpPoster.java
URL: http://svn.apache.org/viewvc/incubator/lcf/trunk/modules/connectors/gts/connector/org/apache/lcf/agents/output/gts/HttpPoster.java?rev=953105&r1=953104&r2=953105&view=diff
==============================================================================
--- incubator/lcf/trunk/modules/connectors/gts/connector/org/apache/lcf/agents/output/gts/HttpPoster.java (original)
+++ incubator/lcf/trunk/modules/connectors/gts/connector/org/apache/lcf/agents/output/gts/HttpPoster.java Wed Jun  9 18:11:09 2010
@@ -39,6 +39,17 @@ public class HttpPoster
 {
   public static final String _rcsid = "@(#)$Id$";
 
+  /** Ingestion buffer size property. */
+  public static String ingestBufferSizeProperty = "org.apache.lcf.ingest.buffersize";
+  public static String ingestCredentialsRealm = "org.apache.lcf.ingest.credentialrealm";
+  public static String ingestResponseRetryCount = "org.apache.lcf.ingest.responseretrycount";
+  public static String ingestResponseRetryInterval = "org.apache.lcf.ingest.retryinterval";
+  public static String ingestRescheduleInterval = "org.apache.lcf.ingest.rescheduleinterval";
+  public static String ingestURIProperty = "org.apache.lcf.ingest.uri";
+  public static String ingestUserProperty = "org.apache.lcf.ingest.user";
+  public static String ingestPasswordProperty = "org.apache.lcf.ingest.password";
+  public static String ingestMaxConnectionsProperty = "org.apache.lcf.ingest.maxconnections";
+
   // Chunk size for base64-encoded headers
   protected final static int HEADER_CHUNK = 4096;
 
@@ -125,16 +136,16 @@ public class HttpPoster
         port = 80;
     }
 
-    String x = LCF.getProperty(LCF.ingestBufferSizeProperty);
+    String x = LCF.getProperty(ingestBufferSizeProperty);
     if (x != null && x.length() > 0)
       buffersize = new Integer(x).intValue();
-    x = LCF.getProperty(LCF.ingestResponseRetryCount);
+    x = LCF.getProperty(ingestResponseRetryCount);
     if (x != null && x.length() > 0)
       responseRetries = new Integer(x).intValue();
-    x = LCF.getProperty(LCF.ingestResponseRetryInterval);
+    x = LCF.getProperty(ingestResponseRetryInterval);
     if (x != null && x.length() > 0)
       responseRetryWait = new Long(x).longValue();
-    x = LCF.getProperty(LCF.ingestRescheduleInterval);
+    x = LCF.getProperty(ingestRescheduleInterval);
     if (x != null && x.length() > 0)
       interruptionRetryTime = new Long(x).longValue();
   }

Modified: incubator/lcf/trunk/modules/connectors/solr/connector/org/apache/lcf/agents/output/solr/HttpPoster.java
URL: http://svn.apache.org/viewvc/incubator/lcf/trunk/modules/connectors/solr/connector/org/apache/lcf/agents/output/solr/HttpPoster.java?rev=953105&r1=953104&r2=953105&view=diff
==============================================================================
--- incubator/lcf/trunk/modules/connectors/solr/connector/org/apache/lcf/agents/output/solr/HttpPoster.java (original)
+++ incubator/lcf/trunk/modules/connectors/solr/connector/org/apache/lcf/agents/output/solr/HttpPoster.java Wed Jun  9 18:11:09 2010
@@ -41,6 +41,17 @@ public class HttpPoster
 {
   public static final String _rcsid = "@(#)$Id$";
 
+  /** Ingestion buffer size property. */
+  public static String ingestBufferSizeProperty = "org.apache.lcf.ingest.buffersize";
+  public static String ingestCredentialsRealm = "org.apache.lcf.ingest.credentialrealm";
+  public static String ingestResponseRetryCount = "org.apache.lcf.ingest.responseretrycount";
+  public static String ingestResponseRetryInterval = "org.apache.lcf.ingest.retryinterval";
+  public static String ingestRescheduleInterval = "org.apache.lcf.ingest.rescheduleinterval";
+  public static String ingestURIProperty = "org.apache.lcf.ingest.uri";
+  public static String ingestUserProperty = "org.apache.lcf.ingest.user";
+  public static String ingestPasswordProperty = "org.apache.lcf.ingest.password";
+  public static String ingestMaxConnectionsProperty = "org.apache.lcf.ingest.maxconnections";
+
   // Chunk size for base64-encoded headers
   protected final static int HEADER_CHUNK = 4096;
 
@@ -145,16 +156,16 @@ public class HttpPoster
     postRemoveAction = webappName + removePath;
     postStatusAction = webappName + statusPath;
 
-    String x = LCF.getProperty(LCF.ingestBufferSizeProperty);
+    String x = LCF.getProperty(ingestBufferSizeProperty);
     if (x != null && x.length() > 0)
       buffersize = new Integer(x).intValue();
-    x = LCF.getProperty(LCF.ingestResponseRetryCount);
+    x = LCF.getProperty(ingestResponseRetryCount);
     if (x != null && x.length() > 0)
       responseRetries = new Integer(x).intValue();
-    x = LCF.getProperty(LCF.ingestResponseRetryInterval);
+    x = LCF.getProperty(ingestResponseRetryInterval);
     if (x != null && x.length() > 0)
       responseRetryWait = new Long(x).longValue();
-    x = LCF.getProperty(LCF.ingestRescheduleInterval);
+    x = LCF.getProperty(ingestRescheduleInterval);
     if (x != null && x.length() > 0)
       interruptionRetryTime = new Long(x).longValue();
   }

Modified: incubator/lcf/trunk/modules/framework/agents/org/apache/lcf/agents/system/LCF.java
URL: http://svn.apache.org/viewvc/incubator/lcf/trunk/modules/framework/agents/org/apache/lcf/agents/system/LCF.java?rev=953105&r1=953104&r2=953105&view=diff
==============================================================================
--- incubator/lcf/trunk/modules/framework/agents/org/apache/lcf/agents/system/LCF.java (original)
+++ incubator/lcf/trunk/modules/framework/agents/org/apache/lcf/agents/system/LCF.java Wed Jun  9 18:11:09 2010
@@ -29,16 +29,6 @@ public class LCF extends org.apache.lcf.
 
   protected static boolean initialized = false;
 
-  /** Ingestion buffer size property. */
-  public static String ingestBufferSizeProperty = "org.apache.lcf.ingest.buffersize";
-  public static String ingestCredentialsRealm = "org.apache.lcf.ingest.credentialrealm";
-  public static String ingestResponseRetryCount = "org.apache.lcf.ingest.responseretrycount";
-  public static String ingestResponseRetryInterval = "org.apache.lcf.ingest.retryinterval";
-  public static String ingestRescheduleInterval = "org.apache.lcf.ingest.rescheduleinterval";
-  public static String ingestURIProperty = "org.apache.lcf.ingest.uri";
-  public static String ingestUserProperty = "org.apache.lcf.ingest.user";
-  public static String ingestPasswordProperty = "org.apache.lcf.ingest.password";
-  public static String ingestMaxConnectionsProperty = "org.apache.lcf.ingest.maxconnections";
 
   /** This is the place we keep track of the agents we've started. */
   protected static HashMap runningHash = new HashMap();
@@ -97,7 +87,6 @@ public class LCF extends org.apache.lcf.
     mgr.deinstall();
   }
 
-
   /** Start all not-running agents.
   *@param threadContext is the thread context.
   */
@@ -151,7 +140,6 @@ public class LCF extends org.apache.lcf.
   {
     synchronized (runningHash)
     {
-      stopAgentsRun = true;
       HashMap iterHash = (HashMap)runningHash.clone();
       Iterator iter = iterHash.keySet().iterator();
       while (iter.hasNext())
@@ -194,6 +182,11 @@ public class LCF extends org.apache.lcf.
     public void doCleanup()
       throws LCFException
     {
+      // Shutting down in this way must prevent startup from taking place.
+      synchronized (runningHash)
+      {
+        stopAgentsRun = true;
+      }
       IThreadContext tc = ThreadContextFactory.make();
       stopAgents(tc);
     }

Modified: incubator/lcf/trunk/modules/tests/org/apache/lcf/tests/Sanity.java
URL: http://svn.apache.org/viewvc/incubator/lcf/trunk/modules/tests/org/apache/lcf/tests/Sanity.java?rev=953105&r1=953104&r2=953105&view=diff
==============================================================================
--- incubator/lcf/trunk/modules/tests/org/apache/lcf/tests/Sanity.java (original)
+++ incubator/lcf/trunk/modules/tests/org/apache/lcf/tests/Sanity.java Wed Jun  9 18:11:09 2010
@@ -28,28 +28,9 @@ import java.util.*;
 import org.junit.*;
 
 /** This is a very basic sanity check */
-public class Sanity extends org.apache.lcf.crawler.tests.TestConnectorBase
+public class Sanity extends TestBase
 {
   
-  protected String[] getConnectorNames()
-  {
-    return new String[]{"File Connector"};
-  }
-  
-  protected String[] getConnectorClasses()
-  {
-    return new String[]{"org.apache.lcf.crawler.connectors.filesystem.FileConnector"};
-  }
-  
-  protected String[] getOutputNames()
-  {
-    return new String[]{"Null Output"};
-  }
-  
-  protected String[] getOutputClasses()
-  {
-    return new String[]{"org.apache.lcf.agents.output.nullconnector.NullConnector"};
-  }
   
   @Test
   public void sanityCheck()