當前位置: 首頁>>代碼示例>>Java>>正文


Java VertxUnitRunner類代碼示例

本文整理匯總了Java中io.vertx.ext.unit.junit.VertxUnitRunner的典型用法代碼示例。如果您正苦於以下問題:Java VertxUnitRunner類的具體用法?Java VertxUnitRunner怎麽用?Java VertxUnitRunner使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


VertxUnitRunner類屬於io.vertx.ext.unit.junit包,在下文中一共展示了VertxUnitRunner類的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: run

import io.vertx.ext.unit.junit.VertxUnitRunner; //導入依賴的package包/類
private Result run(Class<?> testClass) {
  try {
    return new JUnitCore().run(new VertxUnitRunner(testClass));
  } catch (InitializationError initializationError) {
    throw new AssertionError(initializationError);
  }
}
 
開發者ID:vert-x3,項目名稱:vertx-unit,代碼行數:8,代碼來源:JUnitTest.java

示例2: testMethodRule

import io.vertx.ext.unit.junit.VertxUnitRunner; //導入依賴的package包/類
@Test
public void testMethodRule() throws Exception {
  Result result = new JUnitCore().run(new VertxUnitRunner(MethodRuleTestSuite.class));
  assertEquals(0, result.getFailures().size());
  assertEquals(1, MethodRuleTestSuite.count.get());
  assertEquals(0, MethodRuleTestSuite.rule.failures.size());
  assertEquals(1, MethodRuleTestSuite.rule.methods.size());
  assertEquals(MethodRuleTestSuite.class.getDeclaredMethod("testMethod", TestContext.class), MethodRuleTestSuite.rule.methods.get(0).getMethod());
  assertEquals(1, MethodRuleTestSuite.rule.targets.size());
  assertTrue(MethodRuleTestSuite.rule.targets.get(0) instanceof MethodRuleTestSuite);
  assertEquals(1, MethodRuleTestSuite.rule.evaluateCount.get());
}
 
開發者ID:vert-x3,項目名稱:vertx-unit,代碼行數:13,代碼來源:JUnitTest.java

示例3: testFailingMethodRule

import io.vertx.ext.unit.junit.VertxUnitRunner; //導入依賴的package包/類
@Test
public void testFailingMethodRule() throws Exception {
  Result result = new JUnitCore().run(new VertxUnitRunner(FailingMethodRuleTestSuite.class));
  assertEquals(1, FailingMethodRuleTestSuite.rule.failures.size());
  assertEquals(1, result.getFailures().size());
  Failure failure = result.getFailures().get(0);
  assertSame(failure.getException(), FailingMethodRuleTestSuite.rule.failures.get(0));
  assertEquals(1, FailingMethodRuleTestSuite.rule.methods.size());
  assertEquals(FailingMethodRuleTestSuite.class.getDeclaredMethod("testMethod", TestContext.class), FailingMethodRuleTestSuite.rule.methods.get(0).getMethod());
  assertEquals(1, FailingMethodRuleTestSuite.rule.targets.size());
  assertTrue(FailingMethodRuleTestSuite.rule.targets.get(0) instanceof FailingMethodRuleTestSuite);
  assertEquals(1, FailingMethodRuleTestSuite.rule.evaluateCount.get());
}
 
開發者ID:vert-x3,項目名稱:vertx-unit,代碼行數:14,代碼來源:JUnitTest.java


注:本文中的io.vertx.ext.unit.junit.VertxUnitRunner類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。