You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by rm...@apache.org on 2010/08/02 18:59:23 UTC
svn commit: r981598 - in /lucene/dev/trunk/solr: build.xml
contrib/dataimporthandler/build.xml contrib/extraction/build.xml
src/test/org/apache/solr/SolrTestCaseJ4.java
src/test/org/apache/solr/util/AbstractSolrTestCase.java
Author: rmuir
Date: Mon Aug 2 16:59:23 2010
New Revision: 981598
URL: http://svn.apache.org/viewvc?rev=981598&view=rev
Log:
SOLR-2011: Solr tests now use a tempdir in build/ which is removed by 'ant clean', like lucene
Modified:
lucene/dev/trunk/solr/build.xml
lucene/dev/trunk/solr/contrib/dataimporthandler/build.xml
lucene/dev/trunk/solr/contrib/extraction/build.xml
lucene/dev/trunk/solr/src/test/org/apache/solr/SolrTestCaseJ4.java
lucene/dev/trunk/solr/src/test/org/apache/solr/util/AbstractSolrTestCase.java
Modified: lucene/dev/trunk/solr/build.xml
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/build.xml?rev=981598&r1=981597&r2=981598&view=diff
==============================================================================
--- lucene/dev/trunk/solr/build.xml (original)
+++ lucene/dev/trunk/solr/build.xml Mon Aug 2 16:59:23 2010
@@ -410,6 +410,7 @@
<macrodef name="junit-macro">
<attribute name="threadNum" default="1"/>
<attribute name="threadTotal" default="1"/>
+ <attribute name="tempDir" default="${junit.output.dir}/temp"/>
<sequential>
<!-- no description so it doesn't show up in -projecthelp -->
<condition property="runall">
@@ -424,6 +425,10 @@
<condition property="dir.prop" value="-Dsolr.directoryFactory=solr.StandardDirectoryFactory">
<isset property="use.fsdir"/>
</condition>
+ <!-- <mkdir dir="@{tempDir}/@{pattern}"/>
+ This is very loud and obnoxious. abuse touch instead for a "quiet" mkdir
+ -->
+ <touch file="@{tempDir}/@{threadNum}/quiet.ant" verbose="false" mkdirs="true"/>
<property name="dir.prop" value=""/>
<junit printsummary="no"
haltonfailure="no"
@@ -431,12 +436,13 @@
errorProperty="tests.failed"
failureProperty="tests.failed"
dir="src/test/test-files/"
- tempdir="${junit.output.dir}"
+ tempdir="@{tempDir}/@{threadNum}"
>
<sysproperty key="java.util.logging.config.file" value="${common-solr.dir}/testlogging.properties"/>
<sysproperty key="tests.luceneMatchVersion" value="${tests.luceneMatchVersion}"/>
<sysproperty key="tests.codec" value="${tests.codec}"/>
<sysproperty key="jetty.insecurerandom" value="1"/>
+ <sysproperty key="tempDir" file="@{tempDir}/@{threadNum}"/>
<jvmarg line="${dir.prop}"/>
<jvmarg line="${args}"/>
Modified: lucene/dev/trunk/solr/contrib/dataimporthandler/build.xml
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/contrib/dataimporthandler/build.xml?rev=981598&r1=981597&r2=981598&view=diff
==============================================================================
--- lucene/dev/trunk/solr/contrib/dataimporthandler/build.xml (original)
+++ lucene/dev/trunk/solr/contrib/dataimporthandler/build.xml Mon Aug 2 16:59:23 2010
@@ -128,11 +128,15 @@
</solr-javac>
</target>
+ <property name="tempDir" value="${junit.output.dir}/temp" />
<target name="test" depends="testCore,testExtras"/>
<target name="testCore" depends="compileTests">
<mkdir dir="${junit.output.dir}"/>
-
+ <!-- <mkdir dir="@{tempDir}/@{pattern}"/>
+ This is very loud and obnoxious. abuse touch instead for a "quiet" mkdir
+ -->
+ <touch file="${tempDir}/quiet.ant" verbose="false" mkdirs="true"/>
<condition property="runall">
<not>
<or>
@@ -149,9 +153,10 @@
errorProperty="tests.failed"
failureProperty="tests.failed"
dir="src/test/resources/"
- tempdir="${junit.output.dir}"
+ tempdir="${tempDir}"
>
<sysproperty key="jetty.insecurerandom" value="1"/>
+ <sysproperty key="tempDir" file="${tempDir}"/>
<formatter type="brief" usefile="false" if="junit.details"/>
<classpath refid="test.classpath"/>
<formatter type="xml"/>
@@ -174,6 +179,10 @@
<target name="testExtras" depends="compileExtrasTests">
<mkdir dir="${junit.output.dir}"/>
+ <!-- <mkdir dir="@{tempDir}/@{pattern}"/>
+ This is very loud and obnoxious. abuse touch instead for a "quiet" mkdir
+ -->
+ <touch file="${tempDir}/quiet.ant" verbose="false" mkdirs="true"/>
<condition property="runall">
<not>
@@ -191,8 +200,10 @@
errorProperty="tests.failed"
failureProperty="tests.failed"
dir="src/extras/test/resources/"
+ tempdir="${tempDir}"
>
<sysproperty key="jetty.insecurerandom" value="1"/>
+ <sysproperty key="tempDir" file="${tempDir}"/>
<formatter type="brief" usefile="false" if="junit.details"/>
<classpath refid="test.extras.classpath"/>
<assertions>
Modified: lucene/dev/trunk/solr/contrib/extraction/build.xml
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/contrib/extraction/build.xml?rev=981598&r1=981597&r2=981598&view=diff
==============================================================================
--- lucene/dev/trunk/solr/contrib/extraction/build.xml (original)
+++ lucene/dev/trunk/solr/contrib/extraction/build.xml Mon Aug 2 16:59:23 2010
@@ -78,8 +78,14 @@
</solr-javac>
</target>
+ <property name="tempDir" value="${junit.output.dir}/temp" />
+
<target name="test" depends="compileTests">
<mkdir dir="${junit.output.dir}"/>
+ <!-- <mkdir dir="@{tempDir}/@{pattern}"/>
+ This is very loud and obnoxious. abuse touch instead for a "quiet" mkdir
+ -->
+ <touch file="${tempDir}/quiet.ant" verbose="false" mkdirs="true"/>
<condition property="runall">
<not>
@@ -97,9 +103,10 @@
errorProperty="tests.failed"
failureProperty="tests.failed"
dir="src/test/resources/"
- tempdir="${junit.output.dir}"
+ tempdir="${tempDir}"
>
<sysproperty key="jetty.insecurerandom" value="1"/>
+ <sysproperty key="tempDir" file="${tempDir}"/>
<formatter type="brief" usefile="false" if="junit.details"/>
<classpath refid="test.classpath"/>
<assertions>
Modified: lucene/dev/trunk/solr/src/test/org/apache/solr/SolrTestCaseJ4.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/src/test/org/apache/solr/SolrTestCaseJ4.java?rev=981598&r1=981597&r2=981598&view=diff
==============================================================================
--- lucene/dev/trunk/solr/src/test/org/apache/solr/SolrTestCaseJ4.java (original)
+++ lucene/dev/trunk/solr/src/test/org/apache/solr/SolrTestCaseJ4.java Mon Aug 2 16:59:23 2010
@@ -181,9 +181,8 @@ public class SolrTestCaseJ4 extends Luce
public static void createTempDir() {
String cname = getSimpleClassName();
- dataDir = new File(System.getProperty("java.io.tmpdir")
- + System.getProperty("file.separator")
- +"solrtest-" + cname + "-" + System.currentTimeMillis());
+ dataDir = new File(TEMP_DIR,
+ "solrtest-" + cname + "-" + System.currentTimeMillis());
dataDir.mkdirs();
}
Modified: lucene/dev/trunk/solr/src/test/org/apache/solr/util/AbstractSolrTestCase.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/src/test/org/apache/solr/util/AbstractSolrTestCase.java?rev=981598&r1=981597&r2=981598&view=diff
==============================================================================
--- lucene/dev/trunk/solr/src/test/org/apache/solr/util/AbstractSolrTestCase.java (original)
+++ lucene/dev/trunk/solr/src/test/org/apache/solr/util/AbstractSolrTestCase.java Mon Aug 2 16:59:23 2010
@@ -110,9 +110,8 @@ public abstract class AbstractSolrTestCa
if (factoryProp == null) {
System.setProperty("solr.directoryFactory","solr.RAMDirectoryFactory");
}
- dataDir = new File(System.getProperty("java.io.tmpdir")
- + System.getProperty("file.separator")
- + getClass().getName() + "-" + System.currentTimeMillis());
+ dataDir = new File(TEMP_DIR,
+ getClass().getName() + "-" + System.currentTimeMillis());
dataDir.mkdirs();
String configFile = getSolrConfigFile();