Java Code Examples for com.carrotsearch.randomizedtesting.RandomizedTest#assumeFalse()

The following examples show how to use com.carrotsearch.randomizedtesting.RandomizedTest#assumeFalse() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: WithNestedTests.java    From lucene-solr with Apache License 2.0 6 votes vote down vote up
protected void before() throws Throwable {
  if (!isPropertyEmpty(SysGlobals.SYSPROP_TESTFILTER()) ||
      !isPropertyEmpty(SysGlobals.SYSPROP_TESTCLASS())  ||
      !isPropertyEmpty(SysGlobals.SYSPROP_TESTMETHOD()) ||
      !isPropertyEmpty(SysGlobals.SYSPROP_ITERATIONS())) {
    // We're running with a complex test filter that is properly handled by classes
    // which are executed by RandomizedRunner. The "outer" classes testing LuceneTestCase
    // itself are executed by the default JUnit runner and would be always executed.
    // We thus always skip execution if any filtering is detected.
    Assume.assumeTrue(false);
  }
  
  // Check zombie threads from previous suites. Don't run if zombies are around.
  RandomizedTest.assumeFalse(RandomizedRunner.hasZombieThreads());

  TestRuleIgnoreAfterMaxFailures newRule = new TestRuleIgnoreAfterMaxFailures(Integer.MAX_VALUE);
  prevRule = LuceneTestCase.replaceMaxFailureRule(newRule);
  RandomizedTest.assumeFalse(FailureMarker.hadFailures());
}
 
Example 2
Source File: SSLTestConfig.java    From lucene-solr with Apache License 2.0 5 votes vote down vote up
/**
 * Helper method for sanity checking if it's safe to use SSL on this JVM
 *
 * @see <a href="https://issues.apache.org/jira/browse/SOLR-12988">SOLR-12988</a>
 * @throws org.junit.internal.AssumptionViolatedException if this JVM is known to have SSL problems
 */
public static void assumeSslIsSafeToTest() {
  if (Constants.JVM_NAME.startsWith("OpenJDK") ||
      Constants.JVM_NAME.startsWith("Java HotSpot(TM)")) {
    RandomizedTest.assumeFalse("Test (or randomization for this seed) wants to use SSL, " +
                               "but SSL is known to fail on your JVM: " +
                               Constants.JVM_NAME + " / " + Constants.JVM_VERSION, 
                               isOpenJdkJvmVersionKnownToHaveProblems(Constants.JVM_VERSION));
  }
}
 
Example 3
Source File: LuceneTestCase.java    From lucene-solr with Apache License 2.0 4 votes vote down vote up
public static void assumeFalse(String msg, boolean condition) {
  RandomizedTest.assumeFalse(msg, condition);
}