SOLR-2002: add -Dtests.iter

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@989321 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Robert Muir 2010-08-25 19:45:22 +00:00
parent 6621fd22a9
commit 6e05f994b8
8 changed files with 21 additions and 1 deletions

View File

@ -67,6 +67,7 @@
<property name="tests.locale" value="random" />
<property name="tests.timezone" value="random" />
<property name="tests.directory" value="RAMDirectory" />
<property name="tests.iter" value="1" />
<property name="javac.deprecation" value="off"/>
<property name="javac.debug" value="on"/>
@ -447,6 +448,8 @@
<sysproperty key="tests.timezone" value="${tests.timezone}"/>
<!-- set the directory tests should run with -->
<sysproperty key="tests.directory" value="${tests.directory}"/>
<!-- set the number of times tests should run -->
<sysproperty key="tests.iter" value="${tests.iter}"/>
<!-- TODO: create propertyset for test properties, so each project can have its own set -->
<sysproperty key="tests.multiplier" value="${tests.multiplier}"/>

View File

@ -367,7 +367,8 @@ public abstract class LuceneTestCase extends TestCase {
@Override
public void run(TestResult result) {
if (LuceneTestCaseJ4.TEST_METHOD == null ||
for (int i = 0; i < LuceneTestCaseJ4.TEST_ITER; i++)
if (LuceneTestCaseJ4.TEST_METHOD == null ||
getName().equals(LuceneTestCaseJ4.TEST_METHOD))
super.run(result);
}

View File

@ -52,6 +52,7 @@ import org.junit.runner.Description;
import org.junit.runner.RunWith;
import org.junit.runner.manipulation.Filter;
import org.junit.runner.manipulation.NoTestsRemainException;
import org.junit.runner.notification.RunNotifier;
import org.junit.runners.BlockJUnit4ClassRunner;
import org.junit.runners.model.FrameworkMethod;
import org.junit.runners.model.InitializationError;
@ -155,6 +156,8 @@ public class LuceneTestCaseJ4 {
static final String TEST_TIMEZONE = System.getProperty("tests.timezone", "random");
/** Gets the directory to run tests with */
static final String TEST_DIRECTORY = System.getProperty("tests.directory", "RAMDirectory");
/** Get the number of times to run tests */
static final int TEST_ITER = Integer.parseInt(System.getProperty("tests.iter", "1"));
private static final Pattern codecWithParam = Pattern.compile("(.*)\\(\\s*(\\d+)\\s*\\)");
@ -720,6 +723,13 @@ public class LuceneTestCaseJ4 {
/** optionally filters the tests to be run by TEST_METHOD */
public static class LuceneTestCaseRunner extends BlockJUnit4ClassRunner {
@Override
protected void runChild(FrameworkMethod arg0, RunNotifier arg1) {
for (int i = 0; i < TEST_ITER; i++)
super.runChild(arg0, arg1);
}
public LuceneTestCaseRunner(Class<?> clazz) throws InitializationError {
super(clazz);
Filter f = new Filter() {

View File

@ -434,6 +434,7 @@
<sysproperty key="tests.locale" value="${tests.locale}"/>
<sysproperty key="tests.timezone" value="${tests.timezone}"/>
<sysproperty key="tests.multiplier" value="${tests.multiplier}"/>
<sysproperty key="tests.iter" value="${tests.iter}"/>
<sysproperty key="jetty.insecurerandom" value="1"/>
<sysproperty key="tempDir" file="@{tempDir}/@{threadNum}"/>
<sysproperty key="testmethod" value="${testmethod}"/>

View File

@ -54,6 +54,7 @@
<property name="tests.codec" value="random" />
<property name="tests.locale" value="random" />
<property name="tests.timezone" value="random" />
<property name="tests.iter" value="1" />
<condition property="dir.prop" value="-Dsolr.directoryFactory=solr.StandardDirectoryFactory">
<isset property="use.fsdir"/>

View File

@ -113,6 +113,7 @@
<sysproperty key="tests.locale" value="${tests.locale}"/>
<sysproperty key="tests.timezone" value="${tests.timezone}"/>
<sysproperty key="tests.multiplier" value="${tests.multiplier}"/>
<sysproperty key="tests.iter" value="${tests.iter}"/>
<sysproperty key="jetty.insecurerandom" value="1"/>
<sysproperty key="tempDir" file="${junit.output.dir}"/>
<sysproperty key="testmethod" value="${testmethod}"/>

View File

@ -165,6 +165,7 @@
<sysproperty key="tests.locale" value="${tests.locale}"/>
<sysproperty key="tests.timezone" value="${tests.timezone}"/>
<sysproperty key="tests.multiplier" value="${tests.multiplier}"/>
<sysproperty key="tests.iter" value="${tests.iter}"/>
<sysproperty key="jetty.insecurerandom" value="1"/>
<sysproperty key="tempDir" file="${tempDir}"/>
<sysproperty key="testmethod" value="${testmethod}"/>
@ -220,6 +221,7 @@
<sysproperty key="tests.locale" value="${tests.locale}"/>
<sysproperty key="tests.timezone" value="${tests.timezone}"/>
<sysproperty key="tests.multiplier" value="${tests.multiplier}"/>
<sysproperty key="tests.iter" value="${tests.iter}"/>
<sysproperty key="jetty.insecurerandom" value="1"/>
<sysproperty key="tempDir" file="${tempDir}"/>
<sysproperty key="testmethod" value="${testmethod}"/>

View File

@ -114,6 +114,7 @@
<sysproperty key="tests.locale" value="${tests.locale}"/>
<sysproperty key="tests.timezone" value="${tests.timezone}"/>
<sysproperty key="tests.multiplier" value="${tests.multiplier}"/>
<sysproperty key="tests.iter" value="${tests.iter}"/>
<sysproperty key="jetty.insecurerandom" value="1"/>
<sysproperty key="tempDir" file="${tempDir}"/>
<sysproperty key="testmethod" value="${testmethod}"/>