mirror of https://github.com/apache/lucene.git
make apps/SolarTest runnable via ant test
git-svn-id: https://svn.apache.org/repos/asf/incubator/solr/trunk@375736 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
773ec8344b
commit
d978defacf
23
build.xml
23
build.xml
|
@ -70,6 +70,12 @@
|
|||
<!-- For now, it's the same as main classpath. Later it will have JUnit, Clover, etc. -->
|
||||
<path id="test.compile.classpath">
|
||||
<path refid="compile.classpath" />
|
||||
<pathelement location="${dest}"/>
|
||||
</path>
|
||||
|
||||
<path id="test.run.classpath">
|
||||
<path refid="test.compile.classpath" />
|
||||
<pathelement location="${dest}/tests"/>
|
||||
</path>
|
||||
|
||||
<!-- Compile unit tests. -->
|
||||
|
@ -77,10 +83,11 @@
|
|||
description="Compile unit tests."
|
||||
depends="compile">
|
||||
<mkdir dir="${dest}/tests" />
|
||||
<javac destdir="${dest}/tests"
|
||||
<javac
|
||||
destdir="${dest}/tests"
|
||||
classpathref="test.compile.classpath">
|
||||
<src dir="${src}/test" />
|
||||
<src dir="${src}/apps/SolarTest/src" />
|
||||
<src path="${src}/test" />
|
||||
<src path="${src}/apps/SolarTest/src" />
|
||||
</javac>
|
||||
</target>
|
||||
|
||||
|
@ -89,6 +96,14 @@
|
|||
description="Runs the unit tests."
|
||||
depends="compileTests">
|
||||
<echo message="TO-DO later or after we convert tests to JUnit." />
|
||||
|
||||
<java classname="SolrTest" fork="true" dir="src/apps/SolarTest" failonerror="true">
|
||||
<arg line="-test newtest.txt"/>
|
||||
<classpath>
|
||||
<path refid="test.run.classpath" />
|
||||
</classpath>
|
||||
</java>
|
||||
|
||||
</target>
|
||||
|
||||
|
||||
|
@ -103,7 +118,7 @@
|
|||
description="Creates the Solr distribution files."
|
||||
depends="dist-src, dist-war, dist-bin" />
|
||||
|
||||
<!-- Creates the demo WAR file. -->
|
||||
<!-- Creates the Solr WAR file. -->
|
||||
<target name="dist-war"
|
||||
description="Creates the demo WAR file."
|
||||
depends="compile">
|
||||
|
|
|
@ -1 +0,0 @@
|
|||
java -cp "../solar/classes;classes;../../lucene/lucene-1.4.3.jar" SolarPerf -schema test_schema.xml -index F:/root/index -verbose -test newtest.txt
|
|
@ -83,7 +83,9 @@ public class SolrTest extends Thread {
|
|||
boolean sequenceTest=false;
|
||||
|
||||
public void run() {
|
||||
|
||||
if (sequenceTest) {
|
||||
try {
|
||||
for (int i=0; i<testDict.length; i++) {
|
||||
String s = testDict[i];
|
||||
int lineno = testDictLineno.get(i);
|
||||
|
@ -112,9 +114,9 @@ public class SolrTest extends Thread {
|
|||
if (startParams > 0) params = s.substring(startParams+2,endParams).trim();
|
||||
if (startTests > 0) test = s.substring(startTests+1,endTests).trim();
|
||||
|
||||
System.out.println("###req=" + req);
|
||||
System.out.println("###params=" + params);
|
||||
System.out.println("###tests=" + test);
|
||||
// System.out.println("###req=" + req);
|
||||
// System.out.println("###params=" + params);
|
||||
// System.out.println("###tests=" + test);
|
||||
|
||||
if (req.startsWith("<")) {
|
||||
resp = doUpdate(req);
|
||||
|
@ -127,6 +129,11 @@ public class SolrTest extends Thread {
|
|||
System.out.println("#### no validation performed");
|
||||
}
|
||||
}
|
||||
} catch (RuntimeException e) {
|
||||
numErr++;
|
||||
throw(e);
|
||||
}
|
||||
|
||||
System.out.println(">>>>>>>>>>>>>>>>>>>>>>>> SUCCESS <<<<<<<<<<<<<<<<<<<<<<<<<<");
|
||||
}
|
||||
|
||||
|
@ -359,9 +366,23 @@ public class SolrTest extends Thread {
|
|||
clients[i].join();
|
||||
}
|
||||
|
||||
} finally {
|
||||
if (core != null) core.close();
|
||||
core.close();
|
||||
core=null;
|
||||
|
||||
if (testFile!=null) {
|
||||
if (clients[0].numErr == 0) {
|
||||
System.out.println(">>>>>>>>>>>>>>>>>>>>>>>> SUCCESS <<<<<<<<<<<<<<<<<<<<<<<<<<");
|
||||
} else {
|
||||
System.exit(1);
|
||||
}
|
||||
}
|
||||
|
||||
} catch (Throwable e) {
|
||||
if (core!=null) {try{core.close();} catch (Throwable th){}}
|
||||
e.printStackTrace();
|
||||
System.exit(1);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue