Author: kwright
Date: Fri Dec 14 09:58:53 2012
New Revision: 1421775

URL: http://svn.apache.org/viewvc?rev=1421775&view=rev
Log:
Fix for CONNECTORS-453.  Add test and testing infrastructure for combined war.

Added:
    
manifoldcf/trunk/tests/rss/src/test/java/org/apache/manifoldcf/rss_tests/RSSSimpleCrawlCombinedHSQLDBIT.java
      - copied, changed from r1421624, 
manifoldcf/trunk/tests/rss/src/test/java/org/apache/manifoldcf/rss_tests/RSSSimpleCrawlHSQLDBIT.java
Modified:
    manifoldcf/trunk/CHANGES.txt
    
manifoldcf/trunk/framework/core/src/test/java/org/apache/manifoldcf/core/tests/Base.java
    
manifoldcf/trunk/framework/pull-agent/src/test/java/org/apache/manifoldcf/crawler/tests/BaseITDerby.java
    
manifoldcf/trunk/framework/pull-agent/src/test/java/org/apache/manifoldcf/crawler/tests/BaseITHSQLDB.java
    
manifoldcf/trunk/framework/pull-agent/src/test/java/org/apache/manifoldcf/crawler/tests/BaseITMySQL.java
    
manifoldcf/trunk/framework/pull-agent/src/test/java/org/apache/manifoldcf/crawler/tests/BaseITPostgresql.java
    
manifoldcf/trunk/framework/pull-agent/src/test/java/org/apache/manifoldcf/crawler/tests/ConnectorBaseDerby.java
    
manifoldcf/trunk/framework/pull-agent/src/test/java/org/apache/manifoldcf/crawler/tests/ConnectorBaseHSQLDB.java
    
manifoldcf/trunk/framework/pull-agent/src/test/java/org/apache/manifoldcf/crawler/tests/ConnectorBaseHSQLDBext.java
    
manifoldcf/trunk/framework/pull-agent/src/test/java/org/apache/manifoldcf/crawler/tests/ConnectorBaseMySQL.java
    
manifoldcf/trunk/framework/pull-agent/src/test/java/org/apache/manifoldcf/crawler/tests/ConnectorBasePostgresql.java
    
manifoldcf/trunk/framework/pull-agent/src/test/java/org/apache/manifoldcf/crawler/tests/ManifoldCFInstance.java
    
manifoldcf/trunk/tests/rss/src/test/java/org/apache/manifoldcf/rss_tests/BaseHSQLDB.java
    manifoldcf/trunk/tests/test-build.xml

Modified: manifoldcf/trunk/CHANGES.txt
URL: 
http://svn.apache.org/viewvc/manifoldcf/trunk/CHANGES.txt?rev=1421775&r1=1421774&r2=1421775&view=diff
==============================================================================
--- manifoldcf/trunk/CHANGES.txt (original)
+++ manifoldcf/trunk/CHANGES.txt Fri Dec 14 09:58:53 2012
@@ -3,6 +3,9 @@ $Id$
 
 ======================= 1.1-dev =====================
 
+CONNECTORS-543: Add testing infrastructure for combined war.
+(Karl Wright)
+
 CONNECTORS-587: Manual startup did not properly set lastchecktime.
 (Maciej Li¿ewski, Karl Wright)
 

Modified: 
manifoldcf/trunk/framework/core/src/test/java/org/apache/manifoldcf/core/tests/Base.java
URL: 
http://svn.apache.org/viewvc/manifoldcf/trunk/framework/core/src/test/java/org/apache/manifoldcf/core/tests/Base.java?rev=1421775&r1=1421774&r2=1421775&view=diff
==============================================================================
--- 
manifoldcf/trunk/framework/core/src/test/java/org/apache/manifoldcf/core/tests/Base.java
 (original)
+++ 
manifoldcf/trunk/framework/core/src/test/java/org/apache/manifoldcf/core/tests/Base.java
 Fri Dec 14 09:58:53 2012
@@ -33,6 +33,7 @@ public class Base
   protected File configFile = null;
   protected File loggingFile = null;
   protected File logOutputFile = null;
+  protected File connectorFile = null;
 
   protected void initialize()
     throws Exception
@@ -45,6 +46,7 @@ public class Base
       configFile = new File("properties.xml").getCanonicalFile();
       loggingFile = new File("logging.ini").getCanonicalFile();
       logOutputFile = new File("manifoldcf.log").getCanonicalFile();
+      connectorFile = new File("connectors.xml").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());
@@ -119,10 +121,35 @@ public class Base
     throws Exception
   {
     output.append(
-      "  <property name=\"org.apache.manifoldcf.logconfigfile\" 
value=\""+loggingFile.getAbsolutePath().replaceAll("\\\\","/")+"\"/>\n"
+      "  <property name=\"org.apache.manifoldcf.logconfigfile\" 
value=\""+loggingFile.getAbsolutePath().replaceAll("\\\\","/")+"\"/>\n"+
+      "  <property name=\"org.apache.manifoldcf.connectorsconfigurationfile\" 
value=\""+connectorFile.getAbsolutePath().replaceAll("\\\\","/")+"\"/>\n"
     );
   }
   
+  /** Method to write the connectors.xml contents.
+  * Override to replace everything.
+  */
+  protected void writeConnectorsXML(StringBuilder output)
+    throws Exception
+  {
+    output.append(
+      "<?xml version=\"1.0\" encoding=\"UTF-8\" ?>\n" +
+      "<connectors>\n"
+    );
+    writeConnectors(output);
+    output.append(
+      "</connectors>\n"
+    );
+  }
+  
+  /** Method to add connectors to connectors.xml contents.
+  * Override this method to add connector clauses to the connectors file.
+  */
+  protected void writeConnectors(StringBuilder output)
+    throws Exception
+  {
+  }
+  
   /** Method to get database superuser name.
   */
   protected String getDatabaseSuperuserName()
@@ -152,6 +179,10 @@ public class Base
     writePropertiesXML(propertiesXMLContents);
     writeFile(configFile,propertiesXMLContents.toString());
 
+    StringBuilder connectorsXMLContents = new StringBuilder();
+    writeConnectorsXML(connectorsXMLContents);
+    writeFile(connectorFile,connectorsXMLContents.toString());
+
     ManifoldCF.initializeEnvironment();
   }
   
@@ -189,6 +220,7 @@ public class Base
       logOutputFile.delete();
       configFile.delete();
       loggingFile.delete();
+      connectorFile.delete();
       
       ManifoldCF.cleanUpEnvironment();
       // Just in case we're not synchronized...

Modified: 
manifoldcf/trunk/framework/pull-agent/src/test/java/org/apache/manifoldcf/crawler/tests/BaseITDerby.java
URL: 
http://svn.apache.org/viewvc/manifoldcf/trunk/framework/pull-agent/src/test/java/org/apache/manifoldcf/crawler/tests/BaseITDerby.java?rev=1421775&r1=1421774&r2=1421775&view=diff
==============================================================================
--- 
manifoldcf/trunk/framework/pull-agent/src/test/java/org/apache/manifoldcf/crawler/tests/BaseITDerby.java
 (original)
+++ 
manifoldcf/trunk/framework/pull-agent/src/test/java/org/apache/manifoldcf/crawler/tests/BaseITDerby.java
 Fri Dec 14 09:58:53 2012
@@ -30,8 +30,19 @@ import org.junit.*;
 /** Tests that run the "agents daemon" should be derived from this */
 public class BaseITDerby extends ConnectorBaseDerby
 {
-  protected ManifoldCFInstance mcfInstance = new ManifoldCFInstance();
+  protected final ManifoldCFInstance mcfInstance;
   
+  public BaseITDerby()
+  {
+    super();
+    mcfInstance = new ManifoldCFInstance();
+  }
+  
+  public BaseITDerby(boolean singleWar)
+  {
+    super();
+    mcfInstance = new ManifoldCFInstance(singleWar);
+  }
   // Basic job support
   
   protected void waitJobInactiveNative(IJobManager jobManager, Long jobID, 
long maxTime)

Modified: 
manifoldcf/trunk/framework/pull-agent/src/test/java/org/apache/manifoldcf/crawler/tests/BaseITHSQLDB.java
URL: 
http://svn.apache.org/viewvc/manifoldcf/trunk/framework/pull-agent/src/test/java/org/apache/manifoldcf/crawler/tests/BaseITHSQLDB.java?rev=1421775&r1=1421774&r2=1421775&view=diff
==============================================================================
--- 
manifoldcf/trunk/framework/pull-agent/src/test/java/org/apache/manifoldcf/crawler/tests/BaseITHSQLDB.java
 (original)
+++ 
manifoldcf/trunk/framework/pull-agent/src/test/java/org/apache/manifoldcf/crawler/tests/BaseITHSQLDB.java
 Fri Dec 14 09:58:53 2012
@@ -30,7 +30,19 @@ import org.junit.*;
 /** Tests that run the "agents daemon" should be derived from this */
 public class BaseITHSQLDB extends ConnectorBaseHSQLDB
 {
-  protected ManifoldCFInstance mcfInstance = new ManifoldCFInstance();
+  protected final ManifoldCFInstance mcfInstance;
+  
+  public BaseITHSQLDB()
+  {
+    super();
+    mcfInstance = new ManifoldCFInstance();
+  }
+  
+  public BaseITHSQLDB(boolean singleWar)
+  {
+    super();
+    mcfInstance = new ManifoldCFInstance(singleWar);
+  }
   
   // Basic job support
   

Modified: 
manifoldcf/trunk/framework/pull-agent/src/test/java/org/apache/manifoldcf/crawler/tests/BaseITMySQL.java
URL: 
http://svn.apache.org/viewvc/manifoldcf/trunk/framework/pull-agent/src/test/java/org/apache/manifoldcf/crawler/tests/BaseITMySQL.java?rev=1421775&r1=1421774&r2=1421775&view=diff
==============================================================================
--- 
manifoldcf/trunk/framework/pull-agent/src/test/java/org/apache/manifoldcf/crawler/tests/BaseITMySQL.java
 (original)
+++ 
manifoldcf/trunk/framework/pull-agent/src/test/java/org/apache/manifoldcf/crawler/tests/BaseITMySQL.java
 Fri Dec 14 09:58:53 2012
@@ -30,8 +30,20 @@ import org.junit.*;
 /** Tests that run the "agents daemon" should be derived from this */
 public class BaseITMySQL extends ConnectorBaseMySQL
 {
-  protected ManifoldCFInstance mcfInstance = new ManifoldCFInstance();
+  protected final ManifoldCFInstance mcfInstance;
   
+  public BaseITMySQL()
+  {
+    super();
+    mcfInstance = new ManifoldCFInstance();
+  }
+  
+  public BaseITMySQL(boolean singleWar)
+  {
+    super();
+    mcfInstance = new ManifoldCFInstance(singleWar);
+  }
+
   // Basic job support
   
   protected void waitJobInactiveNative(IJobManager jobManager, Long jobID, 
long maxTime)

Modified: 
manifoldcf/trunk/framework/pull-agent/src/test/java/org/apache/manifoldcf/crawler/tests/BaseITPostgresql.java
URL: 
http://svn.apache.org/viewvc/manifoldcf/trunk/framework/pull-agent/src/test/java/org/apache/manifoldcf/crawler/tests/BaseITPostgresql.java?rev=1421775&r1=1421774&r2=1421775&view=diff
==============================================================================
--- 
manifoldcf/trunk/framework/pull-agent/src/test/java/org/apache/manifoldcf/crawler/tests/BaseITPostgresql.java
 (original)
+++ 
manifoldcf/trunk/framework/pull-agent/src/test/java/org/apache/manifoldcf/crawler/tests/BaseITPostgresql.java
 Fri Dec 14 09:58:53 2012
@@ -30,7 +30,19 @@ import org.junit.*;
 /** Tests that run the "agents daemon" should be derived from this */
 public class BaseITPostgresql extends ConnectorBasePostgresql
 {
-  protected ManifoldCFInstance mcfInstance = new ManifoldCFInstance();
+  protected final ManifoldCFInstance mcfInstance;
+  
+  public BaseITPostgresql()
+  {
+    super();
+    mcfInstance = new ManifoldCFInstance();
+  }
+  
+  public BaseITPostgresql(boolean singleWar)
+  {
+    super();
+    mcfInstance = new ManifoldCFInstance(singleWar);
+  }
   
   // Basic job support
   

Modified: 
manifoldcf/trunk/framework/pull-agent/src/test/java/org/apache/manifoldcf/crawler/tests/ConnectorBaseDerby.java
URL: 
http://svn.apache.org/viewvc/manifoldcf/trunk/framework/pull-agent/src/test/java/org/apache/manifoldcf/crawler/tests/ConnectorBaseDerby.java?rev=1421775&r1=1421774&r2=1421775&view=diff
==============================================================================
--- 
manifoldcf/trunk/framework/pull-agent/src/test/java/org/apache/manifoldcf/crawler/tests/ConnectorBaseDerby.java
 (original)
+++ 
manifoldcf/trunk/framework/pull-agent/src/test/java/org/apache/manifoldcf/crawler/tests/ConnectorBaseDerby.java
 Fri Dec 14 09:58:53 2012
@@ -62,6 +62,33 @@ public class ConnectorBaseDerby extends 
     return new String[0];
   }
   
+  @Override
+  protected void writeConnectors(StringBuilder output)
+    throws Exception
+  {
+    String[] connectorClasses = getConnectorClasses();
+    String[] connectorNames = getConnectorNames();
+    for (int i = 0; i < connectorNames.length; i++)
+    {
+      output.append("    <repositoryconnector name=\""+connectorNames[i]+"\" 
class=\""+connectorClasses[i]+"\"/>\n");
+    }
+    
+    String[] outputClasses = getOutputClasses();
+    String[] outputNames = getOutputNames();
+    for (int i = 0; i < outputNames.length; i++)
+    {
+      output.append("    <outputconnector name=\""+outputNames[i]+"\" 
class=\""+outputClasses[i]+"\"/>\n");
+    }
+
+    String[] authorityClasses = getAuthorityClasses();
+    String[] authorityNames = getAuthorityNames();
+    for (int i = 0; i < authorityNames.length; i++)
+    {
+      output.append("    <authorityconnector name=\""+authorityNames[i]+"\" 
class=\""+authorityClasses[i]+"\"/>\n");
+    }
+
+  }
+
   @Before
   public void setUp()
     throws Exception

Modified: 
manifoldcf/trunk/framework/pull-agent/src/test/java/org/apache/manifoldcf/crawler/tests/ConnectorBaseHSQLDB.java
URL: 
http://svn.apache.org/viewvc/manifoldcf/trunk/framework/pull-agent/src/test/java/org/apache/manifoldcf/crawler/tests/ConnectorBaseHSQLDB.java?rev=1421775&r1=1421774&r2=1421775&view=diff
==============================================================================
--- 
manifoldcf/trunk/framework/pull-agent/src/test/java/org/apache/manifoldcf/crawler/tests/ConnectorBaseHSQLDB.java
 (original)
+++ 
manifoldcf/trunk/framework/pull-agent/src/test/java/org/apache/manifoldcf/crawler/tests/ConnectorBaseHSQLDB.java
 Fri Dec 14 09:58:53 2012
@@ -62,6 +62,33 @@ public class ConnectorBaseHSQLDB extends
     return new String[0];
   }
   
+  @Override
+  protected void writeConnectors(StringBuilder output)
+    throws Exception
+  {
+    String[] connectorClasses = getConnectorClasses();
+    String[] connectorNames = getConnectorNames();
+    for (int i = 0; i < connectorNames.length; i++)
+    {
+      output.append("    <repositoryconnector name=\""+connectorNames[i]+"\" 
class=\""+connectorClasses[i]+"\"/>\n");
+    }
+    
+    String[] outputClasses = getOutputClasses();
+    String[] outputNames = getOutputNames();
+    for (int i = 0; i < outputNames.length; i++)
+    {
+      output.append("    <outputconnector name=\""+outputNames[i]+"\" 
class=\""+outputClasses[i]+"\"/>\n");
+    }
+
+    String[] authorityClasses = getAuthorityClasses();
+    String[] authorityNames = getAuthorityNames();
+    for (int i = 0; i < authorityNames.length; i++)
+    {
+      output.append("    <authorityconnector name=\""+authorityNames[i]+"\" 
class=\""+authorityClasses[i]+"\"/>\n");
+    }
+
+  }
+
   @Before
   public void setUp()
     throws Exception

Modified: 
manifoldcf/trunk/framework/pull-agent/src/test/java/org/apache/manifoldcf/crawler/tests/ConnectorBaseHSQLDBext.java
URL: 
http://svn.apache.org/viewvc/manifoldcf/trunk/framework/pull-agent/src/test/java/org/apache/manifoldcf/crawler/tests/ConnectorBaseHSQLDBext.java?rev=1421775&r1=1421774&r2=1421775&view=diff
==============================================================================
--- 
manifoldcf/trunk/framework/pull-agent/src/test/java/org/apache/manifoldcf/crawler/tests/ConnectorBaseHSQLDBext.java
 (original)
+++ 
manifoldcf/trunk/framework/pull-agent/src/test/java/org/apache/manifoldcf/crawler/tests/ConnectorBaseHSQLDBext.java
 Fri Dec 14 09:58:53 2012
@@ -61,7 +61,34 @@ public class ConnectorBaseHSQLDBext exte
   {
     return new String[0];
   }
-  
+
+  @Override
+  protected void writeConnectors(StringBuilder output)
+    throws Exception
+  {
+    String[] connectorClasses = getConnectorClasses();
+    String[] connectorNames = getConnectorNames();
+    for (int i = 0; i < connectorNames.length; i++)
+    {
+      output.append("    <repositoryconnector name=\""+connectorNames[i]+"\" 
class=\""+connectorClasses[i]+"\"/>\n");
+    }
+    
+    String[] outputClasses = getOutputClasses();
+    String[] outputNames = getOutputNames();
+    for (int i = 0; i < outputNames.length; i++)
+    {
+      output.append("    <outputconnector name=\""+outputNames[i]+"\" 
class=\""+outputClasses[i]+"\"/>\n");
+    }
+
+    String[] authorityClasses = getAuthorityClasses();
+    String[] authorityNames = getAuthorityNames();
+    for (int i = 0; i < authorityNames.length; i++)
+    {
+      output.append("    <authorityconnector name=\""+authorityNames[i]+"\" 
class=\""+authorityClasses[i]+"\"/>\n");
+    }
+
+  }
+
   @Before
   public void setUp()
     throws Exception

Modified: 
manifoldcf/trunk/framework/pull-agent/src/test/java/org/apache/manifoldcf/crawler/tests/ConnectorBaseMySQL.java
URL: 
http://svn.apache.org/viewvc/manifoldcf/trunk/framework/pull-agent/src/test/java/org/apache/manifoldcf/crawler/tests/ConnectorBaseMySQL.java?rev=1421775&r1=1421774&r2=1421775&view=diff
==============================================================================
--- 
manifoldcf/trunk/framework/pull-agent/src/test/java/org/apache/manifoldcf/crawler/tests/ConnectorBaseMySQL.java
 (original)
+++ 
manifoldcf/trunk/framework/pull-agent/src/test/java/org/apache/manifoldcf/crawler/tests/ConnectorBaseMySQL.java
 Fri Dec 14 09:58:53 2012
@@ -61,7 +61,34 @@ public class ConnectorBaseMySQL extends 
   {
     return new String[0];
   }
-  
+
+  @Override
+  protected void writeConnectors(StringBuilder output)
+    throws Exception
+  {
+    String[] connectorClasses = getConnectorClasses();
+    String[] connectorNames = getConnectorNames();
+    for (int i = 0; i < connectorNames.length; i++)
+    {
+      output.append("    <repositoryconnector name=\""+connectorNames[i]+"\" 
class=\""+connectorClasses[i]+"\"/>\n");
+    }
+    
+    String[] outputClasses = getOutputClasses();
+    String[] outputNames = getOutputNames();
+    for (int i = 0; i < outputNames.length; i++)
+    {
+      output.append("    <outputconnector name=\""+outputNames[i]+"\" 
class=\""+outputClasses[i]+"\"/>\n");
+    }
+
+    String[] authorityClasses = getAuthorityClasses();
+    String[] authorityNames = getAuthorityNames();
+    for (int i = 0; i < authorityNames.length; i++)
+    {
+      output.append("    <authorityconnector name=\""+authorityNames[i]+"\" 
class=\""+authorityClasses[i]+"\"/>\n");
+    }
+
+  }
+
   @Before
   public void setUp()
     throws Exception

Modified: 
manifoldcf/trunk/framework/pull-agent/src/test/java/org/apache/manifoldcf/crawler/tests/ConnectorBasePostgresql.java
URL: 
http://svn.apache.org/viewvc/manifoldcf/trunk/framework/pull-agent/src/test/java/org/apache/manifoldcf/crawler/tests/ConnectorBasePostgresql.java?rev=1421775&r1=1421774&r2=1421775&view=diff
==============================================================================
--- 
manifoldcf/trunk/framework/pull-agent/src/test/java/org/apache/manifoldcf/crawler/tests/ConnectorBasePostgresql.java
 (original)
+++ 
manifoldcf/trunk/framework/pull-agent/src/test/java/org/apache/manifoldcf/crawler/tests/ConnectorBasePostgresql.java
 Fri Dec 14 09:58:53 2012
@@ -61,7 +61,34 @@ public class ConnectorBasePostgresql ext
   {
     return new String[0];
   }
-  
+
+  @Override
+  protected void writeConnectors(StringBuilder output)
+    throws Exception
+  {
+    String[] connectorClasses = getConnectorClasses();
+    String[] connectorNames = getConnectorNames();
+    for (int i = 0; i < connectorNames.length; i++)
+    {
+      output.append("    <repositoryconnector name=\""+connectorNames[i]+"\" 
class=\""+connectorClasses[i]+"\"/>\n");
+    }
+    
+    String[] outputClasses = getOutputClasses();
+    String[] outputNames = getOutputNames();
+    for (int i = 0; i < outputNames.length; i++)
+    {
+      output.append("    <outputconnector name=\""+outputNames[i]+"\" 
class=\""+outputClasses[i]+"\"/>\n");
+    }
+
+    String[] authorityClasses = getAuthorityClasses();
+    String[] authorityNames = getAuthorityNames();
+    for (int i = 0; i < authorityNames.length; i++)
+    {
+      output.append("    <authorityconnector name=\""+authorityNames[i]+"\" 
class=\""+authorityClasses[i]+"\"/>\n");
+    }
+
+  }
+
   @Before
   public void setUp()
     throws Exception

Modified: 
manifoldcf/trunk/framework/pull-agent/src/test/java/org/apache/manifoldcf/crawler/tests/ManifoldCFInstance.java
URL: 
http://svn.apache.org/viewvc/manifoldcf/trunk/framework/pull-agent/src/test/java/org/apache/manifoldcf/crawler/tests/ManifoldCFInstance.java?rev=1421775&r1=1421774&r2=1421775&view=diff
==============================================================================
--- 
manifoldcf/trunk/framework/pull-agent/src/test/java/org/apache/manifoldcf/crawler/tests/ManifoldCFInstance.java
 (original)
+++ 
manifoldcf/trunk/framework/pull-agent/src/test/java/org/apache/manifoldcf/crawler/tests/ManifoldCFInstance.java
 Fri Dec 14 09:58:53 2012
@@ -58,20 +58,32 @@ public class ManifoldCFInstance
 {
   public static final String agentShutdownSignal = "agent-process";
   
+  protected boolean singleWar = false;
+  protected int testPort = 8346;
+  
   protected DaemonThread daemonThread = null;
   protected Server server = null;
 
-  protected int testPort = 8346;
-  
   public ManifoldCFInstance()
   {
   }
   
+  public ManifoldCFInstance(boolean singleWar)
+  {
+    this(8346,singleWar);
+  }
+  
   public ManifoldCFInstance(int testPort)
   {
-    this.testPort = testPort;
+    this(testPort,false);
   }
 
+  public ManifoldCFInstance(int testPort, boolean singleWar)
+  {
+    this.testPort = testPort;
+    this.singleWar = singleWar;
+  }
+  
   // Basic job support
   
   public void waitJobInactiveNative(IJobManager jobManager, Long jobID, long 
maxTime)
@@ -268,7 +280,10 @@ public class ManifoldCFInstance
   */
   public String makeAPIURL(String command)
   {
-    return 
"http://localhost:"+Integer.toString(testPort)+"/mcf-api-service/json/"+command;
+    if (singleWar)
+      return 
"http://localhost:"+Integer.toString(testPort)+"/mcf/api/json/"+command;
+    else
+      return 
"http://localhost:"+Integer.toString(testPort)+"/mcf-api-service/json/"+command;
   }
 
   public static String convertToString(HttpResponse httpResponse)
@@ -485,43 +500,60 @@ public class ManifoldCFInstance
     // Start jetty
     server = new Server( testPort );    
     server.setStopAtShutdown( true );
-    
-    String crawlerWarPath = 
"../../framework/build/war-proprietary/mcf-crawler-ui.war";
-    String authorityserviceWarPath = 
"../../framework/build/war-proprietary/mcf-authority-service.war";
-    String apiWarPath = 
"../../framework/build/war-proprietary/mcf-api-service.war";
-
-    if (System.getProperty("crawlerWarPath") != null)
-       crawlerWarPath = System.getProperty("crawlerWarPath");
-    if (System.getProperty("authorityserviceWarPath") != null)
-       authorityserviceWarPath = System.getProperty("authorityserviceWarPath");
-    if (System.getProperty("apiWarPath") != null)
-       apiWarPath = System.getProperty("apiWarPath");
-
-    
     // Initialize the servlets
     ContextHandlerCollection contexts = new ContextHandlerCollection();
     server.setHandler(contexts);
-    WebAppContext lcfCrawlerUI = new 
WebAppContext(crawlerWarPath,"/mcf-crawler-ui");
-    // This will cause jetty to ignore all of the framework and jdbc jars in 
the war, which is what we want.
-    lcfCrawlerUI.setParentLoaderPriority(true);
-    contexts.addHandler(lcfCrawlerUI);
-    WebAppContext lcfAuthorityService = new 
WebAppContext(authorityserviceWarPath,"/mcf-authority-service");
-    // This will cause jetty to ignore all of the framework and jdbc jars in 
the war, which is what we want.
-    lcfAuthorityService.setParentLoaderPriority(true);
-    contexts.addHandler(lcfAuthorityService);
-    WebAppContext lcfApi = new WebAppContext(apiWarPath,"/mcf-api-service");
-    lcfApi.setParentLoaderPriority(true);
-    contexts.addHandler(lcfApi);
-    server.start();
 
-    // If all worked, then we can start the daemon.
-    // Clear the agents shutdown signal.
-    IThreadContext tc = ThreadContextFactory.make();
-    ILockManager lockManager = LockManagerFactory.make(tc);
-    lockManager.clearGlobalFlag(agentShutdownSignal);
+    if (singleWar)
+    {
+      // Start the single combined war
+      String combinedWarPath = 
"../../framework/build/war-proprietary/mcf-combined-service.war";
+      if (System.getProperty("combinedWarPath") != null)
+        combinedWarPath = System.getProperty("combinedWarPath");
+      
+      // Initialize the servlet
+      WebAppContext lcfCombined = new WebAppContext(combinedWarPath,"/mcf");
+      // This will cause jetty to ignore all of the framework and jdbc jars in 
the war, which is what we want.
+      lcfCombined.setParentLoaderPriority(true);
+      contexts.addHandler(lcfCombined);
+      server.start();
+    }
+    else
+    {
+      String crawlerWarPath = 
"../../framework/build/war-proprietary/mcf-crawler-ui.war";
+      String authorityserviceWarPath = 
"../../framework/build/war-proprietary/mcf-authority-service.war";
+      String apiWarPath = 
"../../framework/build/war-proprietary/mcf-api-service.war";
+
+      if (System.getProperty("crawlerWarPath") != null)
+          crawlerWarPath = System.getProperty("crawlerWarPath");
+      if (System.getProperty("authorityserviceWarPath") != null)
+          authorityserviceWarPath = 
System.getProperty("authorityserviceWarPath");
+      if (System.getProperty("apiWarPath") != null)
+          apiWarPath = System.getProperty("apiWarPath");
+
+      // Initialize the servlets
+      WebAppContext lcfCrawlerUI = new 
WebAppContext(crawlerWarPath,"/mcf-crawler-ui");
+      // This will cause jetty to ignore all of the framework and jdbc jars in 
the war, which is what we want.
+      lcfCrawlerUI.setParentLoaderPriority(true);
+      contexts.addHandler(lcfCrawlerUI);
+      WebAppContext lcfAuthorityService = new 
WebAppContext(authorityserviceWarPath,"/mcf-authority-service");
+      // This will cause jetty to ignore all of the framework and jdbc jars in 
the war, which is what we want.
+      lcfAuthorityService.setParentLoaderPriority(true);
+      contexts.addHandler(lcfAuthorityService);
+      WebAppContext lcfApi = new WebAppContext(apiWarPath,"/mcf-api-service");
+      lcfApi.setParentLoaderPriority(true);
+      contexts.addHandler(lcfApi);
+      server.start();
 
-    daemonThread = new DaemonThread();
-    daemonThread.start();
+      // If all worked, then we can start the daemon.
+      // Clear the agents shutdown signal.
+      IThreadContext tc = ThreadContextFactory.make();
+      ILockManager lockManager = LockManagerFactory.make(tc);
+      lockManager.clearGlobalFlag(agentShutdownSignal);
+
+      daemonThread = new DaemonThread();
+      daemonThread.start();
+    }
   }
   
   public void stop()
@@ -531,10 +563,10 @@ public class ManifoldCFInstance
     IThreadContext tc = ThreadContextFactory.make();
 
     // Delete all jobs (and wait for them to go away)
-    if (daemonThread != null)
+    if (daemonThread != null || singleWar)
     {
       IJobManager jobManager = JobManagerFactory.make(tc);
-        
+          
       // Get a list of the current active jobs
       IJobDescription[] jobs = jobManager.getAllJobs();
       int i = 0;
@@ -609,28 +641,31 @@ public class ManifoldCFInstance
         }
       }
 
-      // Shut down daemon
-      ILockManager lockManager = LockManagerFactory.make(tc);
-      lockManager.setGlobalFlag(agentShutdownSignal);
-      
-      // Wait for daemon thread to exit.
-      while (true)
+      if (!singleWar)
       {
-        if (daemonThread.isAlive())
+        // Shut down daemon
+        ILockManager lockManager = LockManagerFactory.make(tc);
+        lockManager.setGlobalFlag(agentShutdownSignal);
+        
+        // Wait for daemon thread to exit.
+        while (true)
         {
-          Thread.sleep(1000L);
-          continue;
+          if (daemonThread.isAlive())
+          {
+            Thread.sleep(1000L);
+            continue;
+          }
+          break;
         }
-        break;
-      }
 
-      Exception e = daemonThread.getDaemonException();
-      if (e != null)
-        currentException = e;
+        Exception e = daemonThread.getDaemonException();
+        if (e != null)
+          currentException = e;
+      }
+        
+      if (currentException != null)
+        throw currentException;
     }
-      
-    if (currentException != null)
-      throw currentException;
   }
   
   public void unload()

Modified: 
manifoldcf/trunk/tests/rss/src/test/java/org/apache/manifoldcf/rss_tests/BaseHSQLDB.java
URL: 
http://svn.apache.org/viewvc/manifoldcf/trunk/tests/rss/src/test/java/org/apache/manifoldcf/rss_tests/BaseHSQLDB.java?rev=1421775&r1=1421774&r2=1421775&view=diff
==============================================================================
--- 
manifoldcf/trunk/tests/rss/src/test/java/org/apache/manifoldcf/rss_tests/BaseHSQLDB.java
 (original)
+++ 
manifoldcf/trunk/tests/rss/src/test/java/org/apache/manifoldcf/rss_tests/BaseHSQLDB.java
 Fri Dec 14 09:58:53 2012
@@ -30,6 +30,16 @@ import org.junit.*;
 /** Tests that run the "agents daemon" should be derived from this */
 public class BaseHSQLDB extends 
org.apache.manifoldcf.crawler.tests.BaseITHSQLDB
 {
+  public BaseHSQLDB()
+  {
+    super();
+  }
+  
+  public BaseHSQLDB(boolean singleWar)
+  {
+    super(true);
+  }
+  
   protected String[] getConnectorNames()
   {
     return new String[]{"File Connector"};

Copied: 
manifoldcf/trunk/tests/rss/src/test/java/org/apache/manifoldcf/rss_tests/RSSSimpleCrawlCombinedHSQLDBIT.java
 (from r1421624, 
manifoldcf/trunk/tests/rss/src/test/java/org/apache/manifoldcf/rss_tests/RSSSimpleCrawlHSQLDBIT.java)
URL: 
http://svn.apache.org/viewvc/manifoldcf/trunk/tests/rss/src/test/java/org/apache/manifoldcf/rss_tests/RSSSimpleCrawlCombinedHSQLDBIT.java?p2=manifoldcf/trunk/tests/rss/src/test/java/org/apache/manifoldcf/rss_tests/RSSSimpleCrawlCombinedHSQLDBIT.java&p1=manifoldcf/trunk/tests/rss/src/test/java/org/apache/manifoldcf/rss_tests/RSSSimpleCrawlHSQLDBIT.java&r1=1421624&r2=1421775&rev=1421775&view=diff
==============================================================================
--- 
manifoldcf/trunk/tests/rss/src/test/java/org/apache/manifoldcf/rss_tests/RSSSimpleCrawlHSQLDBIT.java
 (original)
+++ 
manifoldcf/trunk/tests/rss/src/test/java/org/apache/manifoldcf/rss_tests/RSSSimpleCrawlCombinedHSQLDBIT.java
 Fri Dec 14 09:58:53 2012
@@ -23,14 +23,15 @@ import java.util.*;
 import org.junit.*;
 
 /** This is a very basic sanity check */
-public class RSSSimpleCrawlHSQLDBIT extends BaseHSQLDB
+public class RSSSimpleCrawlCombinedHSQLDBIT extends BaseHSQLDB
 {
 
   protected RSSSimpleCrawlTester tester;
   protected MockRSSService rssService = null;
   
-  public RSSSimpleCrawlHSQLDBIT()
+  public RSSSimpleCrawlCombinedHSQLDBIT()
   {
+    super(true);
     tester = new RSSSimpleCrawlTester(mcfInstance);
   }
   

Modified: manifoldcf/trunk/tests/test-build.xml
URL: 
http://svn.apache.org/viewvc/manifoldcf/trunk/tests/test-build.xml?rev=1421775&r1=1421774&r2=1421775&view=diff
==============================================================================
--- manifoldcf/trunk/tests/test-build.xml (original)
+++ manifoldcf/trunk/tests/test-build.xml Fri Dec 14 09:58:53 2012
@@ -113,6 +113,7 @@
             <jvmarg 
value="-DcrawlerWarPath=../../../framework/build/war-proprietary/mcf-crawler-ui.war"/>
             <jvmarg 
value="-DauthorityserviceWarPath=../../../framework/build/war-proprietary/mcf-authority-service.war"/>
             <jvmarg 
value="-DapiWarPath=../../../framework/build/war-proprietary/mcf-api-service.war"/>
+            <jvmarg 
value="-DcombinedWarPath=../../../framework/build/war-proprietary/mcf-combined-service.war"/>
             <classpath>
                 <path refid="test-classpath"/>
                 <pathelement location="build/test/classes"/>
@@ -132,6 +133,7 @@
             <jvmarg 
value="-DcrawlerWarPath=../../../framework/build/war-proprietary/mcf-crawler-ui.war"/>
             <jvmarg 
value="-DauthorityserviceWarPath=../../../framework/build/war-proprietary/mcf-authority-service.war"/>
             <jvmarg 
value="-DapiWarPath=../../../framework/build/war-proprietary/mcf-api-service.war"/>
+            <jvmarg 
value="-DcombinedWarPath=../../../framework/build/war-proprietary/mcf-combined-service.war"/>
             <classpath>
                 <path refid="test-classpath"/>
                 <pathelement location="build/test/classes"/>
@@ -151,6 +153,7 @@
             <jvmarg 
value="-DcrawlerWarPath=../../../framework/build/war-proprietary/mcf-crawler-ui.war"/>
             <jvmarg 
value="-DauthorityserviceWarPath=../../../framework/build/war-proprietary/mcf-authority-service.war"/>
             <jvmarg 
value="-DapiWarPath=../../../framework/build/war-proprietary/mcf-api-service.war"/>
+            <jvmarg 
value="-DcombinedWarPath=../../../framework/build/war-proprietary/mcf-combined-service.war"/>
             <classpath>
                 <path refid="test-classpath"/>
                 <pathelement location="build/test/classes"/>
@@ -170,6 +173,7 @@
             <jvmarg 
value="-DcrawlerWarPath=../../../framework/build/war-proprietary/mcf-crawler-ui.war"/>
             <jvmarg 
value="-DauthorityserviceWarPath=../../../framework/build/war-proprietary/mcf-authority-service.war"/>
             <jvmarg 
value="-DapiWarPath=../../../framework/build/war-proprietary/mcf-api-service.war"/>
+            <jvmarg 
value="-DcombinedWarPath=../../../framework/build/war-proprietary/mcf-combined-service.war"/>
             <classpath>
                 <path refid="test-classpath"/>
                 <pathelement location="build/test/classes"/>
@@ -189,6 +193,7 @@
             <jvmarg 
value="-DcrawlerWarPath=../../../framework/build/war-proprietary/mcf-crawler-ui.war"/>
             <jvmarg 
value="-DauthorityserviceWarPath=../../../framework/build/war-proprietary/mcf-authority-service.war"/>
             <jvmarg 
value="-DapiWarPath=../../../framework/build/war-proprietary/mcf-api-service.war"/>
+            <jvmarg 
value="-DcombinedWarPath=../../../framework/build/war-proprietary/mcf-combined-service.war"/>
             <classpath>
                 <path refid="test-classpath"/>
                 <pathelement location="build/test/classes"/>
@@ -208,6 +213,7 @@
             <jvmarg 
value="-DcrawlerWarPath=../../../framework/build/war-proprietary/mcf-crawler-ui.war"/>
             <jvmarg 
value="-DauthorityserviceWarPath=../../../framework/build/war-proprietary/mcf-authority-service.war"/>
             <jvmarg 
value="-DapiWarPath=../../../framework/build/war-proprietary/mcf-api-service.war"/>
+            <jvmarg 
value="-DcombinedWarPath=../../../framework/build/war-proprietary/mcf-combined-service.war"/>
             <classpath>
                 <path refid="test-classpath"/>
                 <pathelement location="build/test/classes"/>
@@ -227,6 +233,7 @@
             <jvmarg 
value="-DcrawlerWarPath=../../../framework/build/war-proprietary/mcf-crawler-ui.war"/>
             <jvmarg 
value="-DauthorityserviceWarPath=../../../framework/build/war-proprietary/mcf-authority-service.war"/>
             <jvmarg 
value="-DapiWarPath=../../../framework/build/war-proprietary/mcf-api-service.war"/>
+            <jvmarg 
value="-DcombinedWarPath=../../../framework/build/war-proprietary/mcf-combined-service.war"/>
             <classpath>
                 <path refid="test-classpath"/>
                 <pathelement location="build/test/classes"/>
@@ -246,6 +253,7 @@
             <jvmarg 
value="-DcrawlerWarPath=../../../framework/build/war-proprietary/mcf-crawler-ui.war"/>
             <jvmarg 
value="-DauthorityserviceWarPath=../../../framework/build/war-proprietary/mcf-authority-service.war"/>
             <jvmarg 
value="-DapiWarPath=../../../framework/build/war-proprietary/mcf-api-service.war"/>
+            <jvmarg 
value="-DcombinedWarPath=../../../framework/build/war-proprietary/mcf-combined-service.war"/>
             <classpath>
                 <path refid="test-classpath"/>
                 <pathelement location="build/test/classes"/>
@@ -265,6 +273,7 @@
             <jvmarg 
value="-DcrawlerWarPath=../../../framework/build/war-proprietary/mcf-crawler-ui.war"/>
             <jvmarg 
value="-DauthorityserviceWarPath=../../../framework/build/war-proprietary/mcf-authority-service.war"/>
             <jvmarg 
value="-DapiWarPath=../../../framework/build/war-proprietary/mcf-api-service.war"/>
+            <jvmarg 
value="-DcombinedWarPath=../../../framework/build/war-proprietary/mcf-combined-service.war"/>
             <classpath>
                 <path refid="test-classpath"/>
                 <pathelement location="build/test/classes"/>
@@ -284,6 +293,7 @@
             <jvmarg 
value="-DcrawlerWarPath=../../../framework/build/war-proprietary/mcf-crawler-ui.war"/>
             <jvmarg 
value="-DauthorityserviceWarPath=../../../framework/build/war-proprietary/mcf-authority-service.war"/>
             <jvmarg 
value="-DapiWarPath=../../../framework/build/war-proprietary/mcf-api-service.war"/>
+            <jvmarg 
value="-DcombinedWarPath=../../../framework/build/war-proprietary/mcf-combined-service.war"/>
             <classpath>
                 <path refid="test-classpath"/>
                 <pathelement location="build/test/classes"/>
@@ -303,6 +313,7 @@
             <jvmarg 
value="-DcrawlerWarPath=../../../framework/build/war-proprietary/mcf-crawler-ui.war"/>
             <jvmarg 
value="-DauthorityserviceWarPath=../../../framework/build/war-proprietary/mcf-authority-service.war"/>
             <jvmarg 
value="-DapiWarPath=../../../framework/build/war-proprietary/mcf-api-service.war"/>
+            <jvmarg 
value="-DcombinedWarPath=../../../framework/build/war-proprietary/mcf-combined-service.war"/>
             <classpath>
                 <path refid="test-classpath"/>
                 <pathelement location="build/test/classes"/>
@@ -322,6 +333,7 @@
             <jvmarg 
value="-DcrawlerWarPath=../../../framework/build/war-proprietary/mcf-crawler-ui.war"/>
             <jvmarg 
value="-DauthorityserviceWarPath=../../../framework/build/war-proprietary/mcf-authority-service.war"/>
             <jvmarg 
value="-DapiWarPath=../../../framework/build/war-proprietary/mcf-api-service.war"/>
+            <jvmarg 
value="-DcombinedWarPath=../../../framework/build/war-proprietary/mcf-combined-service.war"/>
             <classpath>
                 <path refid="test-classpath"/>
                 <pathelement location="build/test/classes"/>
@@ -341,6 +353,7 @@
             <jvmarg 
value="-DcrawlerWarPath=../../../framework/build/war-proprietary/mcf-crawler-ui.war"/>
             <jvmarg 
value="-DauthorityserviceWarPath=../../../framework/build/war-proprietary/mcf-authority-service.war"/>
             <jvmarg 
value="-DapiWarPath=../../../framework/build/war-proprietary/mcf-api-service.war"/>
+            <jvmarg 
value="-DcombinedWarPath=../../../framework/build/war-proprietary/mcf-combined-service.war"/>
             <classpath>
                 <path refid="test-classpath"/>
                 <pathelement location="build/test/classes"/>
@@ -360,6 +373,7 @@
             <jvmarg 
value="-DcrawlerWarPath=../../../framework/build/war-proprietary/mcf-crawler-ui.war"/>
             <jvmarg 
value="-DauthorityserviceWarPath=../../../framework/build/war-proprietary/mcf-authority-service.war"/>
             <jvmarg 
value="-DapiWarPath=../../../framework/build/war-proprietary/mcf-api-service.war"/>
+            <jvmarg 
value="-DcombinedWarPath=../../../framework/build/war-proprietary/mcf-combined-service.war"/>
             <classpath>
                 <path refid="test-classpath"/>
                 <pathelement location="build/test/classes"/>
@@ -379,6 +393,7 @@
             <jvmarg 
value="-DcrawlerWarPath=../../../framework/build/war-proprietary/mcf-crawler-ui.war"/>
             <jvmarg 
value="-DauthorityserviceWarPath=../../../framework/build/war-proprietary/mcf-authority-service.war"/>
             <jvmarg 
value="-DapiWarPath=../../../framework/build/war-proprietary/mcf-api-service.war"/>
+            <jvmarg 
value="-DcombinedWarPath=../../../framework/build/war-proprietary/mcf-combined-service.war"/>
             <classpath>
                 <path refid="test-classpath"/>
                 <pathelement location="build/test/classes"/>


Reply via email to