当前位置: 首页>>代码示例>>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;未经允许,请勿转载。