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 10:24:42 UTC

svn commit: r1189663 - in /lucene/dev/branches/branch_3x: ./ lucene/ lucene/CHANGES.txt lucene/common-build.xml lucene/src/test-framework/org/apache/lucene/util/LuceneTestCase.java solr/

Author: doronc
Date: Thu Oct 27 08:24:42 2011
New Revision: 1189663

URL: http://svn.apache.org/viewvc?rev=1189663&view=rev
Log:
LUCENE-3506: merge from trunk: (take 2): with -Dtests.asserts.gracious=true, test framework will not validate java assertions are enabled.

Modified:
    lucene/dev/branches/branch_3x/   (props changed)
    lucene/dev/branches/branch_3x/lucene/   (props changed)
    lucene/dev/branches/branch_3x/lucene/CHANGES.txt
    lucene/dev/branches/branch_3x/lucene/common-build.xml
    lucene/dev/branches/branch_3x/lucene/src/test-framework/org/apache/lucene/util/LuceneTestCase.java
    lucene/dev/branches/branch_3x/solr/   (props changed)

Modified: lucene/dev/branches/branch_3x/lucene/CHANGES.txt
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_3x/lucene/CHANGES.txt?rev=1189663&r1=1189662&r2=1189663&view=diff
==============================================================================
--- lucene/dev/branches/branch_3x/lucene/CHANGES.txt (original)
+++ lucene/dev/branches/branch_3x/lucene/CHANGES.txt Thu Oct 27 08:24:42 2011
@@ -107,7 +107,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/branches/branch_3x/lucene/common-build.xml
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_3x/lucene/common-build.xml?rev=1189663&r1=1189662&r2=1189663&view=diff
==============================================================================
--- lucene/dev/branches/branch_3x/lucene/common-build.xml (original)
+++ lucene/dev/branches/branch_3x/lucene/common-build.xml Thu Oct 27 08:24:42 2011
@@ -93,6 +93,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"/>
@@ -567,6 +568,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/branches/branch_3x/lucene/src/test-framework/org/apache/lucene/util/LuceneTestCase.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_3x/lucene/src/test-framework/org/apache/lucene/util/LuceneTestCase.java?rev=1189663&r1=1189662&r2=1189663&view=diff
==============================================================================
--- lucene/dev/branches/branch_3x/lucene/src/test-framework/org/apache/lucene/util/LuceneTestCase.java (original)
+++ lucene/dev/branches/branch_3x/lucene/src/test-framework/org/apache/lucene/util/LuceneTestCase.java Thu Oct 27 08:24:42 2011
@@ -247,7 +247,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