本文整理匯總了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);
}
}
示例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());
}
示例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());
}