Author: kwright
Date: Sun Sep 13 01:24:37 2020
New Revision: 1881672

URL: http://svn.apache.org/viewvc?rev=1881672&view=rev
Log:
Pass in the pointer to the test-materials area for both maven and ant, so the 
test doesn't have to care

Modified:
    manifoldcf/trunk/connectors/elasticsearch/   (props changed)
    
manifoldcf/trunk/connectors/elasticsearch/connector/src/test/java/org/apache/manifoldcf/agents/output/elasticsearch/tests/BaseITHSQLDB.java
    manifoldcf/trunk/connectors/elasticsearch/pom.xml
    manifoldcf/trunk/framework/buildfiles/connector-build.xml

Propchange: manifoldcf/trunk/connectors/elasticsearch/
------------------------------------------------------------------------------
--- svn:ignore (original)
+++ svn:ignore Sun Sep 13 01:24:37 2020
@@ -8,3 +8,5 @@ test-postgresql-output
 test-HSQLDB-output
 test-HSQLDBext-output
 test-mysql-output
+test-materials/unix
+test-materials/windows

Modified: 
manifoldcf/trunk/connectors/elasticsearch/connector/src/test/java/org/apache/manifoldcf/agents/output/elasticsearch/tests/BaseITHSQLDB.java
URL: 
http://svn.apache.org/viewvc/manifoldcf/trunk/connectors/elasticsearch/connector/src/test/java/org/apache/manifoldcf/agents/output/elasticsearch/tests/BaseITHSQLDB.java?rev=1881672&r1=1881671&r2=1881672&view=diff
==============================================================================
--- 
manifoldcf/trunk/connectors/elasticsearch/connector/src/test/java/org/apache/manifoldcf/agents/output/elasticsearch/tests/BaseITHSQLDB.java
 (original)
+++ 
manifoldcf/trunk/connectors/elasticsearch/connector/src/test/java/org/apache/manifoldcf/agents/output/elasticsearch/tests/BaseITHSQLDB.java
 Sun Sep 13 01:24:37 2020
@@ -81,15 +81,25 @@ public class BaseITHSQLDB extends org.ap
   {
     final ProcessBuilder pb = new ProcessBuilder();
     
+    if (System.getenv("JAVA_HOME")!= null) {
+      pb.environment().put("JAVA_HOME", System.getenv("JAVA_HOME"));
+    } else {
+      throw new Exception("JAVA_HOME is required to be set for this test");
+    }
+    
     final File absFile = new File(".").getAbsoluteFile();
     System.out.println("ES working directory is '"+absFile+"'");
     pb.directory(absFile);
     
+    final String testMaterialsPath = System.getProperty("testMaterialsPath");
+    if (testMaterialsPath == null) {
+      throw new Exception("Can't find testMaterialsPath argument; test cannot 
be run");
+    }
     if (isUnix) {
-      pb.command("bash", "-c", 
"../test-materials/unix/elasticsearch-7.6.2/bin/elasticsearch -q 
-Expack.ml.enabled=false");
+      pb.command("bash", "-c", testMaterialsPath + 
"unix/elasticsearch-7.6.2/bin/elasticsearch -q -Expack.ml.enabled=false");
       System.out.println("Unix process");
     } else {
-      pb.command("cmd.exe", "/c", 
"..\\test-materials\\windows\\elasticsearch-7.6.2\\bin\\elasticsearch.bat -q 
-Expack.ml.enabled=false");
+      pb.command("cmd.exe", "/c", testMaterialsPath.replace("/", "\\") + 
"windows\\elasticsearch-7.6.2\\bin\\elasticsearch.bat -q 
-Expack.ml.enabled=false");
       System.out.println("Windows process");
     }
 

Modified: manifoldcf/trunk/connectors/elasticsearch/pom.xml
URL: 
http://svn.apache.org/viewvc/manifoldcf/trunk/connectors/elasticsearch/pom.xml?rev=1881672&r1=1881671&r2=1881672&view=diff
==============================================================================
--- manifoldcf/trunk/connectors/elasticsearch/pom.xml (original)
+++ manifoldcf/trunk/connectors/elasticsearch/pom.xml Sun Sep 13 01:24:37 2020
@@ -171,6 +171,7 @@
             <crawlerWarPath>../dependency/mcf-crawler-ui.war</crawlerWarPath>
             
<authorityserviceWarPath>../dependency/mcf-authority-service.war</authorityserviceWarPath>
             <apiWarPath>../dependency/mcf-api-service.war</apiWarPath>
+            <testMaterialsPath>../../test-materials/</testMaterialsPath>
           </systemPropertyVariables>
           <excludes>
             <exclude>**/*Postgresql*.java</exclude>

Modified: manifoldcf/trunk/framework/buildfiles/connector-build.xml
URL: 
http://svn.apache.org/viewvc/manifoldcf/trunk/framework/buildfiles/connector-build.xml?rev=1881672&r1=1881671&r2=1881672&view=diff
==============================================================================
--- manifoldcf/trunk/framework/buildfiles/connector-build.xml (original)
+++ manifoldcf/trunk/framework/buildfiles/connector-build.xml Sun Sep 13 
01:24:37 2020
@@ -1048,6 +1048,7 @@
            <jvmarg 
value="-DauthorityserviceWarPath=${mcf-dist}/web/war/mcf-authority-service.war"/>
            <jvmarg 
value="-DapiWarPath=${mcf-dist}/web/war/mcf-api-service.war"/>
            <jvmarg 
value="-DcombinedWarPath=${mcf-dist}/web/war/mcf-combined-service.war"/>
+              <jvmarg value="-DtestMaterialsPath=../test-materials/"/>
            <classpath>
                <fileset dir="${env.JAVA_HOME}/lib">
                    <include name="tools.jar"/>
@@ -1071,6 +1072,7 @@
            <jvmarg 
value="-DauthorityserviceWarPath=${mcf-dist}/web/war/mcf-authority-service.war"/>
            <jvmarg 
value="-DapiWarPath=${mcf-dist}/web/war/mcf-api-service.war"/>
            <jvmarg 
value="-DcombinedWarPath=${mcf-dist}/web/war/mcf-combined-service.war"/>
+              <jvmarg value="-DtestMaterialsPath=../test-materials/"/>
            <classpath>
                <fileset dir="${env.JAVA_HOME}/lib">
                    <include name="tools.jar"/>
@@ -1094,6 +1096,7 @@
            <jvmarg 
value="-DauthorityserviceWarPath=${mcf-dist}/web/war/mcf-authority-service.war"/>
            <jvmarg 
value="-DapiWarPath=${mcf-dist}/web/war/mcf-api-service.war"/>
            <jvmarg 
value="-DcombinedWarPath=${mcf-dist}/web/war/mcf-combined-service.war"/>
+              <jvmarg value="-DtestMaterialsPath=../test-materials/"/>
            <classpath>
                <fileset dir="${env.JAVA_HOME}/lib">
                    <include name="tools.jar"/>
@@ -1117,6 +1120,7 @@
            <jvmarg 
value="-DauthorityserviceWarPath=${mcf-dist}/web-proprietary/war/mcf-authority-service.war"/>
            <jvmarg 
value="-DapiWarPath=${mcf-dist}/web-proprietary/war/mcf-api-service.war"/>
            <jvmarg 
value="-DcombinedWarPath=${mcf-dist}/web-proprietary/war/mcf-combined-service.war"/>
+              <jvmarg value="-DtestMaterialsPath=../test-materials/"/>
            <classpath>
                <fileset dir="${env.JAVA_HOME}/lib">
                    <include name="tools.jar"/>
@@ -1140,6 +1144,7 @@
            <jvmarg 
value="-DauthorityserviceWarPath=${mcf-dist}/web/war/mcf-authority-service.war"/>
            <jvmarg 
value="-DapiWarPath=${mcf-dist}/web/war/mcf-api-service.war"/>
            <jvmarg 
value="-DcombinedWarPath=${mcf-dist}/web/war/mcf-combined-service.war"/>
+              <jvmarg value="-DtestMaterialsPath=../test-materials/"/>
            <classpath>
                <fileset dir="${env.JAVA_HOME}/lib">
                    <include name="tools.jar"/>
@@ -1163,6 +1168,7 @@
            <jvmarg 
value="-DauthorityserviceWarPath=${mcf-dist}/web/war/mcf-authority-service.war"/>
            <jvmarg 
value="-DapiWarPath=${mcf-dist}/web/war/mcf-api-service.war"/>
            <jvmarg 
value="-DcombinedWarPath=${mcf-dist}/web/war/mcf-combined-service.war"/>
+              <jvmarg value="-DtestMaterialsPath=../test-materials/"/>
            <classpath>
                <fileset dir="${env.JAVA_HOME}/lib">
                    <include name="tools.jar"/>
@@ -1186,6 +1192,7 @@
            <jvmarg 
value="-DauthorityserviceWarPath=${mcf-dist}/web/war/mcf-authority-service.war"/>
            <jvmarg 
value="-DapiWarPath=${mcf-dist}/web/war/mcf-api-service.war"/>
            <jvmarg 
value="-DcombinedWarPath=${mcf-dist}/web/war/mcf-combined-service.war"/>
+              <jvmarg value="-DtestMaterialsPath=../test-materials/"/>
            <classpath>
                <fileset dir="${env.JAVA_HOME}/lib">
                    <include name="tools.jar"/>
@@ -1209,6 +1216,7 @@
            <jvmarg 
value="-DauthorityserviceWarPath=${mcf-dist}/web-proprietary/war/mcf-authority-service.war"/>
            <jvmarg 
value="-DapiWarPath=${mcf-dist}/web-proprietary/war/mcf-api-service.war"/>
            <jvmarg 
value="-DcombinedWarPath=${mcf-dist}/web-proprietary/war/mcf-combined-service.war"/>
+              <jvmarg value="-DtestMaterialsPath=../test-materials/"/>
            <classpath>
                <fileset dir="${env.JAVA_HOME}/lib">
                    <include name="tools.jar"/>
@@ -1236,6 +1244,7 @@
            <jvmarg 
value="-DauthorityserviceWarPath=${mcf-dist}/web/war/mcf-authority-service.war"/>
            <jvmarg 
value="-DapiWarPath=${mcf-dist}/web/war/mcf-api-service.war"/>
            <jvmarg 
value="-DcombinedWarPath=${mcf-dist}/web/war/mcf-combined-service.war"/>
+              <jvmarg value="-DtestMaterialsPath=../test-materials/"/>
            <classpath>
                <fileset dir="${env.JAVA_HOME}/lib">
                    <include name="tools.jar"/>
@@ -1263,6 +1272,7 @@
            <jvmarg 
value="-DauthorityserviceWarPath=${mcf-dist}/web/war/mcf-authority-service.war"/>
            <jvmarg 
value="-DapiWarPath=${mcf-dist}/web/war/mcf-api-service.war"/>
            <jvmarg 
value="-DcombinedWarPath=${mcf-dist}/web/war/mcf-combined-service.war"/>
+              <jvmarg value="-DtestMaterialsPath=../test-materials/"/>
            <classpath>
                <fileset dir="${env.JAVA_HOME}/lib">
                    <include name="tools.jar"/>
@@ -1290,6 +1300,7 @@
            <jvmarg 
value="-DauthorityserviceWarPath=${mcf-dist}/web/war/mcf-authority-service.war"/>
            <jvmarg 
value="-DapiWarPath=${mcf-dist}/web/war/mcf-api-service.war"/>
            <jvmarg 
value="-DcombinedWarPath=${mcf-dist}/web/war/mcf-combined-service.war"/>
+              <jvmarg value="-DtestMaterialsPath=../test-materials/"/>
            <classpath>
                <fileset dir="${env.JAVA_HOME}/lib">
                    <include name="tools.jar"/>
@@ -1317,6 +1328,7 @@
            <jvmarg 
value="-DauthorityserviceWarPath=${mcf-dist}/web-proprietary/war/mcf-authority-service.war"/>
            <jvmarg 
value="-DapiWarPath=${mcf-dist}/web-proprietary/war/mcf-api-service.war"/>
            <jvmarg 
value="-DcombinedWarPath=${mcf-dist}/web-proprietary/war/mcf-combined-service.war"/>
+              <jvmarg value="-DtestMaterialsPath=../test-materials/"/>
            <classpath>
                <fileset dir="${env.JAVA_HOME}/lib">
                    <include name="tools.jar"/>


Reply via email to