当前位置: 首页>>代码示例>>Java>>正文


Java RandomizedTest.assumeTrue方法代码示例

本文整理汇总了Java中com.carrotsearch.randomizedtesting.RandomizedTest.assumeTrue方法的典型用法代码示例。如果您正苦于以下问题:Java RandomizedTest.assumeTrue方法的具体用法?Java RandomizedTest.assumeTrue怎么用?Java RandomizedTest.assumeTrue使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.carrotsearch.randomizedtesting.RandomizedTest的用法示例。


在下文中一共展示了RandomizedTest.assumeTrue方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: testFailIfUnreferencedFiles

import com.carrotsearch.randomizedtesting.RandomizedTest; //导入方法依赖的package包/类
@Test
public void testFailIfUnreferencedFiles() {
  Result r = JUnitCore.runClasses(Nested1.class);
  RandomizedTest.assumeTrue("Ignoring nested test, very likely zombie threads present.", 
      r.getIgnoreCount() == 0);

  // We are suppressing output anyway so dump the failures.
  for (Failure f : r.getFailures()) {
    System.out.println(f.getTrace());
  }

  Assert.assertEquals("Expected exactly one failure.", 
      1, r.getFailureCount());
  Assert.assertTrue("Expected unreferenced files assertion.", 
      r.getFailures().get(0).getTrace().contains("unreferenced files:"));
}
 
开发者ID:europeana,项目名称:search,代码行数:17,代码来源:TestFailIfUnreferencedFiles.java

示例2: apply

import com.carrotsearch.randomizedtesting.RandomizedTest; //导入方法依赖的package包/类
@Override
public Statement apply(final Statement s, final Description d) {
  return new Statement() {
    @Override
    public void evaluate() throws Throwable {
      if (failuresSoFar >= maxFailures) {
        RandomizedTest.assumeTrue("Ignored, failures limit reached (" + 
            failuresSoFar + " >= " + maxFailures + ").", false);
      }

      try {
        s.evaluate();
      } catch (Throwable t) {
        if (!TestRuleMarkFailure.isAssumption(t)) {
          failuresSoFar++;
        }
        throw t;
      }
    }
  };
}
 
开发者ID:pkarmstr,项目名称:NYBC,代码行数:22,代码来源:TestRuleIgnoreAfterMaxFailures.java

示例3: apply

import com.carrotsearch.randomizedtesting.RandomizedTest; //导入方法依赖的package包/类
@Override
public Statement apply(final Statement s, final Description d) {
  return new Statement() {
    @Override
    public void evaluate() throws Throwable {
      int failuresSoFar = FailureMarker.getFailures();
      if (failuresSoFar >= maxFailures) {
        RandomizedTest.assumeTrue("Ignored, failures limit reached (" + 
            failuresSoFar + " >= " + maxFailures + ").", false);
      }

      s.evaluate();
    }
  };
}
 
开发者ID:europeana,项目名称:search,代码行数:16,代码来源:TestRuleIgnoreAfterMaxFailures.java

示例4: testFailIfDirectoryNotClosed

import com.carrotsearch.randomizedtesting.RandomizedTest; //导入方法依赖的package包/类
@Test
public void testFailIfDirectoryNotClosed() {
  Result r = JUnitCore.runClasses(Nested1.class);
  RandomizedTest.assumeTrue("Ignoring nested test, very likely zombie threads present.", 
      r.getIgnoreCount() == 0);
  assertFailureCount(1, r);
  Assert.assertTrue(r.getFailures().get(0).toString().contains("Resource in scope SUITE failed to close"));
}
 
开发者ID:europeana,项目名称:search,代码行数:9,代码来源:TestFailIfDirectoryNotClosed.java

示例5: testWindowsUnremovableFile

import com.carrotsearch.randomizedtesting.RandomizedTest; //导入方法依赖的package包/类
@Test
public void testWindowsUnremovableFile() throws IOException {
  RandomizedTest.assumeTrue("Requires Windows.", Constants.WINDOWS);
  RandomizedTest.assumeFalse(LuceneTestCase.LEAVE_TEMPORARY);

  Result r = JUnitCore.runClasses(Nested2.class);
  Assert.assertEquals(1, r.getFailureCount());

  Nested2.openFile.close();
  TestUtil.rm(Nested2.parent);
}
 
开发者ID:europeana,项目名称:search,代码行数:12,代码来源:TestLeaveFilesIfTestFails.java

示例6: testFailIfDirectoryNotClosed

import com.carrotsearch.randomizedtesting.RandomizedTest; //导入方法依赖的package包/类
@Test
public void testFailIfDirectoryNotClosed() {
  Result r = JUnitCore.runClasses(Nested1.class);
  RandomizedTest.assumeTrue("Ignoring nested test, very likely zombie threads present.", 
      r.getIgnoreCount() == 0);

  for (Failure f : r.getFailures()) {
    System.out.println("Failure: " + f);
  }
  Assert.assertEquals(1, r.getFailureCount());
  Assert.assertTrue(r.getFailures().get(0).toString().contains("Resource in scope SUITE failed to close"));
}
 
开发者ID:jimaguere,项目名称:Maskana-Gestor-de-Conocimiento,代码行数:13,代码来源:TestFailIfDirectoryNotClosed.java

示例7: assumeTrue

import com.carrotsearch.randomizedtesting.RandomizedTest; //导入方法依赖的package包/类
public static void assumeTrue(String msg, boolean condition) {
  RandomizedTest.assumeTrue(msg, condition);
}
 
开发者ID:europeana,项目名称:search,代码行数:4,代码来源:LuceneTestCase.java


注:本文中的com.carrotsearch.randomizedtesting.RandomizedTest.assumeTrue方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。