You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by dw...@apache.org on 2014/03/11 13:01:43 UTC

svn commit: r1576292 - in /lucene/dev/trunk/lucene: ./ core/src/test/org/apache/lucene/util/junitcompat/ licenses/

Author: dweiss
Date: Tue Mar 11 12:01:43 2014
New Revision: 1576292

URL: http://svn.apache.org/r1576292
Log:
LUCENE-5475: upgraded randomized testing to 2.1.1. This will print full annotations on assumption-ignored tests. It also includes more fancy test filtering.:

Added:
    lucene/dev/trunk/lucene/core/src/test/org/apache/lucene/util/junitcompat/TestGroupFiltering.java   (with props)
    lucene/dev/trunk/lucene/licenses/junit4-ant-2.1.1.jar.sha1   (with props)
    lucene/dev/trunk/lucene/licenses/randomizedtesting-runner-2.1.1.jar.sha1   (with props)
Removed:
    lucene/dev/trunk/lucene/licenses/junit4-ant-2.0.13.jar.sha1
    lucene/dev/trunk/lucene/licenses/randomizedtesting-runner-2.0.13.jar.sha1
Modified:
    lucene/dev/trunk/lucene/common-build.xml
    lucene/dev/trunk/lucene/core/src/test/org/apache/lucene/util/junitcompat/WithNestedTests.java
    lucene/dev/trunk/lucene/ivy-versions.properties

Modified: lucene/dev/trunk/lucene/common-build.xml
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/common-build.xml?rev=1576292&r1=1576291&r2=1576292&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/common-build.xml (original)
+++ lucene/dev/trunk/lucene/common-build.xml Tue Mar 11 12:01:43 2014
@@ -989,6 +989,7 @@
                 <propertyref prefix="tests.timeoutSuite" />
                 <propertyref prefix="tests.jettyConnector" />
                 <propertyref prefix="tests.disableHdfs" />
+                <propertyref prefix="tests.filter" />
             </syspropertyset>
 
             <!-- Pass randomized settings to the forked JVM. -->

Added: lucene/dev/trunk/lucene/core/src/test/org/apache/lucene/util/junitcompat/TestGroupFiltering.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/core/src/test/org/apache/lucene/util/junitcompat/TestGroupFiltering.java?rev=1576292&view=auto
==============================================================================
--- lucene/dev/trunk/lucene/core/src/test/org/apache/lucene/util/junitcompat/TestGroupFiltering.java (added)
+++ lucene/dev/trunk/lucene/core/src/test/org/apache/lucene/util/junitcompat/TestGroupFiltering.java Tue Mar 11 12:01:43 2014
@@ -0,0 +1,61 @@
+package org.apache.lucene.util.junitcompat;
+
+import java.lang.annotation.Documented;
+import java.lang.annotation.Inherited;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+
+import org.apache.lucene.util.LuceneTestCase;
+
+import com.carrotsearch.randomizedtesting.annotations.TestGroup;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+public class TestGroupFiltering extends LuceneTestCase {
+  @Documented
+  @Inherited
+  @Retention(RetentionPolicy.RUNTIME)
+  @TestGroup(enabled = false)
+  public @interface Foo {}
+  
+  @Documented
+  @Inherited
+  @Retention(RetentionPolicy.RUNTIME)
+  @TestGroup(enabled = false)
+  public @interface Bar {}
+
+  @Documented
+  @Inherited
+  @Retention(RetentionPolicy.RUNTIME)
+  @TestGroup(enabled = false)
+  public @interface Jira {
+    String bug();
+  }
+  
+  @Foo
+  public void testFoo() {}
+  
+  @Foo @Bar
+  public void testFooBar() {}
+
+  @Bar
+  public void testBar() {}
+
+  @Jira(bug = "JIRA bug reference")
+  public void testJira() {}
+}

Modified: lucene/dev/trunk/lucene/core/src/test/org/apache/lucene/util/junitcompat/WithNestedTests.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/core/src/test/org/apache/lucene/util/junitcompat/WithNestedTests.java?rev=1576292&r1=1576291&r2=1576292&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/core/src/test/org/apache/lucene/util/junitcompat/WithNestedTests.java (original)
+++ lucene/dev/trunk/lucene/core/src/test/org/apache/lucene/util/junitcompat/WithNestedTests.java Tue Mar 11 12:01:43 2014
@@ -28,6 +28,7 @@ import org.apache.lucene.util.TestRuleIg
 import org.apache.lucene.util.TestRuleMarkFailure;
 import org.junit.After;
 import org.junit.Assert;
+import org.junit.Assume;
 import org.junit.Before;
 import org.junit.ClassRule;
 import org.junit.Rule;
@@ -73,6 +74,13 @@ public abstract class WithNestedTests {
     private TestRuleIgnoreAfterMaxFailures prevRule;
 
     protected void before() throws Throwable {
+      String filter = System.getProperty("tests.filter");
+      if (filter != null && !filter.trim().isEmpty()) {
+        // We're running with a complex test filter. This will affect nested tests anyway
+        // so ignore them.
+        Assume.assumeTrue(false);
+      }
+      
       TestRuleIgnoreAfterMaxFailures newRule = new TestRuleIgnoreAfterMaxFailures(Integer.MAX_VALUE);
       prevRule = LuceneTestCase.replaceMaxFailureRule(newRule);
     }

Modified: lucene/dev/trunk/lucene/ivy-versions.properties
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/ivy-versions.properties?rev=1576292&r1=1576291&r2=1576292&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/ivy-versions.properties (original)
+++ lucene/dev/trunk/lucene/ivy-versions.properties Tue Mar 11 12:01:43 2014
@@ -8,7 +8,7 @@
 /cglib/cglib-nodep = 2.2
 /com.adobe.xmp/xmpcore = 5.1.2
 
-com.carrotsearch.randomizedtesting.version = 2.0.13
+com.carrotsearch.randomizedtesting.version = 2.1.1
 /com.carrotsearch.randomizedtesting/junit4-ant = ${com.carrotsearch.randomizedtesting.version}
 /com.carrotsearch.randomizedtesting/randomizedtesting-runner = ${com.carrotsearch.randomizedtesting.version}
 

Added: lucene/dev/trunk/lucene/licenses/junit4-ant-2.1.1.jar.sha1
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/licenses/junit4-ant-2.1.1.jar.sha1?rev=1576292&view=auto
==============================================================================
--- lucene/dev/trunk/lucene/licenses/junit4-ant-2.1.1.jar.sha1 (added)
+++ lucene/dev/trunk/lucene/licenses/junit4-ant-2.1.1.jar.sha1 Tue Mar 11 12:01:43 2014
@@ -0,0 +1 @@
+a8a7371e11a8b3a4a3eeea81ad3cedafe3e3550e

Added: lucene/dev/trunk/lucene/licenses/randomizedtesting-runner-2.1.1.jar.sha1
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/licenses/randomizedtesting-runner-2.1.1.jar.sha1?rev=1576292&view=auto
==============================================================================
--- lucene/dev/trunk/lucene/licenses/randomizedtesting-runner-2.1.1.jar.sha1 (added)
+++ lucene/dev/trunk/lucene/licenses/randomizedtesting-runner-2.1.1.jar.sha1 Tue Mar 11 12:01:43 2014
@@ -0,0 +1 @@
+5908c4e714dab40ccc892993a21537c7c0d6210c