You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by do...@apache.org on 2011/10/27 09:57:59 UTC
svn commit: r1189655 - in /lucene/dev/trunk/lucene: CHANGES.txt
common-build.xml
src/test-framework/org/apache/lucene/util/LuceneTestCase.java
Author: doronc
Date: Thu Oct 27 07:57:59 2011
New Revision: 1189655
URL: http://svn.apache.org/viewvc?rev=1189655&view=rev
Log:
LUCENE-3506: (take 2): -Dtests.asserts.gracious=true test framework will not validate java assertions are enabled.
Modified:
lucene/dev/trunk/lucene/CHANGES.txt
lucene/dev/trunk/lucene/common-build.xml
lucene/dev/trunk/lucene/src/test-framework/org/apache/lucene/util/LuceneTestCase.java
Modified: lucene/dev/trunk/lucene/CHANGES.txt
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/CHANGES.txt?rev=1189655&r1=1189654&r2=1189655&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/CHANGES.txt (original)
+++ lucene/dev/trunk/lucene/CHANGES.txt Thu Oct 27 07:57:59 2011
@@ -731,7 +731,8 @@ Test Cases
* LUCENE-3506: tests relying on assertions being enabled were no-op because
they ignored AssertionError. With this fix now entire test framework
- (all tests) fail if assertions are disabled. (Doron Cohen)
+ (every test) fails if assertions are disabled, unless
+ -Dtests.asserts.gracious=true is specified. (Doron Cohen)
======================= Lucene 3.4.0 =======================
Modified: lucene/dev/trunk/lucene/common-build.xml
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/common-build.xml?rev=1189655&r1=1189654&r2=1189655&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/common-build.xml (original)
+++ lucene/dev/trunk/lucene/common-build.xml Thu Oct 27 07:57:59 2011
@@ -95,6 +95,7 @@
<property name="tests.loggingfile" value="/dev/null"/>
<property name="tests.nightly" value="false" />
<property name="tests.cleanthreads.sysprop" value="perMethod"/>
+ <property name="tests.asserts.gracious" value="false"/>
<property name="javac.deprecation" value="off"/>
<property name="javac.debug" value="on"/>
@@ -575,6 +576,9 @@
<sysproperty key="java.util.logging.config.file" value="${tests.loggingfile}"/>
<!-- set whether or not nightly tests should run -->
<sysproperty key="tests.nightly" value="@{tests.nightly}"/>
+
+ <!-- set whether tests framework should not require java assertions enabled -->
+ <sysproperty key="tests.asserts.gracious" value="${tests.asserts.gracious}"/>
<!-- TODO: create propertyset for test properties, so each project can have its own set -->
<sysproperty key="tests.multiplier" value="@{tests.multiplier}"/>
Modified: lucene/dev/trunk/lucene/src/test-framework/org/apache/lucene/util/LuceneTestCase.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/src/test-framework/org/apache/lucene/util/LuceneTestCase.java?rev=1189655&r1=1189654&r2=1189655&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/src/test-framework/org/apache/lucene/util/LuceneTestCase.java (original)
+++ lucene/dev/trunk/lucene/src/test-framework/org/apache/lucene/util/LuceneTestCase.java Thu Oct 27 07:57:59 2011
@@ -402,7 +402,9 @@ public abstract class LuceneTestCase ext
testsFailed = false;
// verify assertions are enabled (do last, for smooth cleanup)
- assertTrue("assertions are not enabled!", assertionsEnabled());
+ if (!Boolean.parseBoolean(System.getProperty("tests.asserts.gracious", "false"))) {
+ assertTrue("assertions are not enabled!", assertionsEnabled());
+ }
}
@AfterClass