org.testifyproject.TestContext.verify()方法的使用及代码示例

x33g5p2x  于2022-01-30 转载在 其他  
字(3.2k)|赞(0)|评价(0)|浏览(96)

本文整理了Java中org.testifyproject.TestContext.verify()方法的一些代码示例,展示了TestContext.verify()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。TestContext.verify()方法的具体详情如下:
包路径:org.testifyproject.TestContext
类名称:TestContext
方法名:verify

TestContext.verify介绍

[英]Verify the integrity test context. This method checks to see if the test has any errors or warning. If errors are found they are reported and the test is terminated. If warnings are found they are reported and the test continues to execute.
[中]验证完整性测试上下文。此方法检查测试是否有任何错误或警告。如果发现错误,则报告错误并终止测试。如果发现警告,将报告这些警告,并继续执行测试。

代码示例

代码示例来源:origin: org.testifyproject.level/unit

@Override
public void stop(TestContext testContext) {
  Object testInstance = testContext.getTestInstance();
  TestDescriptor testDescriptor = testContext.getTestDescriptor();
  Collection<Class<? extends Annotation>> guidelines = testDescriptor.getGuidelines();
  serviceLocatorUtil
      .findAllWithFilter(PostVerifier.class, guidelines, UnitCategory.class)
      .forEach(p -> p.verify(testContext));
  testContext.verify();
  //invoke destroy method on fields annotated with Fixture
  testDescriptor.getFieldDescriptors()
      .forEach(p -> p.destroy(testInstance));
  //invoke destroy method on sut field annotated with Fixture
  testContext.getSutDescriptor()
      .ifPresent(p -> p.destroy(testInstance));
  testContext.<ServiceInstance>findProperty(SERVICE_INSTANCE)
      .ifPresent(ServiceInstance::destroy);
  resourceController.stop(testContext);
}

代码示例来源:origin: org.testifyproject.level/integration

@Override
public void stop(TestContext testContext) {
  Object testInstance = testContext.getTestInstance();
  TestDescriptor testDescriptor = testContext.getTestDescriptor();
  Collection<Class<? extends Annotation>> guidelines = testDescriptor.getGuidelines();
  serviceLocatorUtil
      .findAllWithFilter(PostVerifier.class, guidelines, IntegrationCategory.class)
      .forEach(p -> p.verify(testContext));
  testContext.verify();
  //invoke destroy method on fields annotated with Fixture
  testDescriptor.getFieldDescriptors()
      .forEach(p -> p.destroy(testInstance));
  //invoke destroy method on sut field annotated with Fixture
  testContext.getSutDescriptor()
      .ifPresent(p -> p.destroy(testInstance));
  if (resourceController != null) {
    resourceController.stop(testContext);
  }
  testContext.<ServiceInstance>findProperty(SERVICE_INSTANCE)
      .ifPresent(ServiceInstance::destroy);
}

代码示例来源:origin: org.testifyproject.level/system

SystemCategory.class
).forEach(p -> p.verify(testContext));
testContext.verify();

代码示例来源:origin: org.testifyproject.level/system

.forEach(p -> p.verify(testContext));
    testContext.verify();
      .findAllWithFilter(Verifier.class, guidelines, SystemCategory.class)
      .forEach(p -> p.verify(testContext));
  testContext.verify();
});

代码示例来源:origin: org.testifyproject.level/unit

.findAllWithFilter(PreVerifier.class, guidelines, UnitCategory.class)
    .forEach(p -> p.verify(testContext));
testContext.verify();
    .findAllWithFilter(Verifier.class, guidelines, UnitCategory.class)
    .forEach(p -> p.verify(testContext));
testContext.verify();

代码示例来源:origin: org.testifyproject.level/integration

.findAllWithFilter(PreVerifier.class, guidelines, IntegrationCategory.class)
    .forEach(p -> p.verify(testContext));
testContext.verify();
    .findAllWithFilter(Verifier.class, guidelines, IntegrationCategory.class)
    .forEach(p -> p.verify(testContext));
testContext.verify();

相关文章