本文整理汇总了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());
}