类org.junit.jupiter.api.AfterEach源码实例Demo

下面列出了怎么用org.junit.jupiter.api.AfterEach的API类实例代码及写法,或者点击链接到github查看源代码。

@AfterEach
public void tearDown() {
    DeleteStreamResult result = awsKinesisClient.deleteStream(AWSCommon.DEFAULT_KINESIS_STREAM);

    if (result.getSdkHttpMetadata().getHttpStatusCode() != 200) {
        fail("Failed to delete the stream");
    } else {
        try {
            // Because of the latency used to simulate the Kinesis API call (defined by the KINESIS_LATENCY) in
            // the LocalStack configuration, the test needs to wait at least the same amount of time as set there
            // in order to proceed. Otherwise the it fails to create the stream in the setUp phase.
            // Ref.: https://github.com/localstack/localstack/issues/231#issuecomment-319959693
            Thread.sleep(500);
            LOG.info("Stream deleted successfully");
        } catch (InterruptedException e) {
            fail("Test interrupted while waiting for the stream to cool down");
        }
    }

    awsKinesisClient.shutdown();

    deleteKafkaTopic(TestUtils.getDefaultTestTopic(this.getClass()));
}
 
源代码2 项目: incubator-tuweni   文件: ServerWhitelistTest.java
@AfterEach
void stopServer() throws Exception {
  httpServer.close();

  List<String> knownClients = Files.readAllLines(knownClientsFile);
  assertEquals(2, knownClients.size());
  assertEquals("#First line", knownClients.get(0));
  assertEquals("foo.com " + fooFingerprint, knownClients.get(1));
}
 
@AfterEach
public void disposeKSession() throws Exception {
    if( ksession != null ) { 
        ksession.dispose();
        ksession = null;
    }
}
 
源代码4 项目: kogito-runtimes   文件: KubeClientConfigTest.java
@AfterEach
public void teardown() throws IOException {
    if (Files.exists(KUBE_CONFIG_PATH) && Files.readAllBytes(KUBE_CONFIG_PATH).length == 0) {
        Files.delete(KUBE_CONFIG_PATH);
        Files.delete(KUBE_CONFIG_DIR);
    }
    System.clearProperty("kubernetes.master");
}
 
源代码5 项目: incubator-tuweni   文件: ClientWhitelistTest.java
@AfterEach
void cleanupClient() throws Exception {
  client.close();

  List<String> knownServers = Files.readAllLines(knownServersFile);
  assertEquals(2, knownServers.size(), "Host was verified via TOFU and not CA");
  assertEquals("#First line", knownServers.get(0));
  assertEquals("localhost:" + fooServer.actualPort() + " " + fooFingerprint, knownServers.get(1));
}
 
@AfterEach
void cleanupClient() throws Exception {
  client.close();

  List<String> knownServers = Files.readAllLines(knownServersFile);
  assertEquals(2, knownServers.size(), "Host was verified via TOFU and not CA");
  assertEquals("#First line", knownServers.get(0));
  assertEquals("localhost:" + fooServer.actualPort() + " " + fooFingerprint, knownServers.get(1));
}
 
源代码7 项目: ethsigner   文件: ReadTimeoutAcceptanceTest.java
@AfterEach
public synchronized void tearDown() {
  if (ethSigner != null) {
    ethSigner.shutdown();
  }

  close(unresponsiveSocketA);
  close(unresponsiveSocketB);
}
 
@AfterEach
void cleanup() {
  if (ethSigner != null) {
    ethSigner.shutdown();
    ethSigner = null;
  }
}
 
源代码9 项目: ethsigner   文件: ClientSideTlsAcceptanceTest.java
@AfterEach
void cleanup() {
  serverFactory.shutdown();
  if (signer != null) {
    signer.shutdown();
    signer = null;
  }
}
 
源代码10 项目: ethsigner   文件: ServerSideTlsAcceptanceTest.java
@AfterEach
void cleanup() {
  if (ethSigner != null) {
    ethSigner.shutdown();
    ethSigner = null;
  }
}
 
源代码11 项目: ethsigner   文件: MultiKeyAcceptanceTestBase.java
@AfterEach
public void cleanUp() {
  if (ethSigner != null) {
    ethSigner.shutdown();
    ethSigner = null;
  }
}
 
源代码12 项目: ethsigner   文件: CorsAcceptanceTest.java
@AfterEach
public void tearDown() {
  if (ethNode != null) {
    ethNode.shutdown();
  }

  if (ethSigner != null) {
    ethSigner.shutdown();
  }
}
 
源代码13 项目: kogito-runtimes   文件: DynamicEvalTest.java
@AfterEach
public void tearDown() {
    if (session != null) {
        session.dispose();
    }
    kbase = null;
    effects = null;
    clock = null;
    kbuilder = null;
    baseConfig = null;
    sessionConfig = null;
}
 
源代码14 项目: apicurio-registry   文件: RegistryMojoTestBase.java
@AfterEach
public void cleanupTempDirectory() {
    for (File tempFile : this.tempDirectory.listFiles()) {
        tempFile.delete();
    }
    this.tempDirectory.delete();
}
 
源代码15 项目: apicurio-registry   文件: RulesResourceIT.java
@AfterEach
void clearRules(RegistryService service) throws Exception {
    service.deleteAllGlobalRules();
    TestUtils.retry(() -> {
        List<RuleType> rules = service.listGlobalRules();
        assertEquals(0, rules.size(), "All global rules not deleted");
    });
}
 
源代码16 项目: apicurio-registry   文件: AllArtifactTypesIT.java
@AfterEach
void deleteRules(RegistryService service) throws Exception {
    service.deleteAllGlobalRules();
    TestUtils.retry(() -> {
        List<RuleType> rules = service.listGlobalRules();
        assertEquals(0, rules.size(), "All global rules not deleted");
    });
}
 
源代码17 项目: apicurio-registry   文件: ArtifactsIT.java
@AfterEach
void deleteRules(RegistryService service) throws Exception {
    service.deleteAllGlobalRules();
    TestUtils.retry(() -> {
        List<RuleType> rules = service.listGlobalRules();
        assertEquals(0, rules.size(), "All global rules not deleted");
    });
}
 
源代码18 项目: cloud-spanner-r2dbc   文件: SpannerTestKit.java
@Override
@AfterEach
public void dropTable() {
  getJdbcOperations().execute("DELETE FROM test WHERE 1=1");
  getJdbcOperations().execute("DELETE FROM test_two_column WHERE 1=1");
  getJdbcOperations().execute("DELETE FROM blob_test WHERE 1=1");
  getJdbcOperations().execute("DELETE FROM clob_test WHERE 1=1");
}
 
@AfterEach
public void tearDown() {
    deleteKafkaTopic(TestUtils.getDefaultTestTopic(this.getClass()));
    if (!awssqsClient.deleteQueue(queueName)) {
        fail("Failed to delete queue");
    }
}
 
@AfterEach
public void tearDown() {
    deleteKafkaTopic(TestUtils.getDefaultTestTopic(this.getClass()));

    if (!awssqsClient.deleteQueue(queueName)) {
        fail("Failed to delete queue");
    }
}
 
@AfterEach
public void tearDown() throws IOException, InterruptedException {
    SfdxCommand sfdxCommand = SfdxCommand.forceDataRecordDelete()
            .withArgument("--sobjecttype", "Account")
            .withArgument("--where", String.format("Name=%s", account));

    LOG.debug("Deleting the test account");
    ExecResult result = container.execCommand(sfdxCommand);
    if (!verifyCommand(sfdxCommand, result)) {
        fail("Unable to delete the test account on Salesforce");
    }
    account = null;

    deleteKafkaTopic(TestUtils.getDefaultTestTopic(this.getClass()));
}
 
@AfterEach
public void tearDown() {
    cassandraClient = cassandraService.getClient();

    if (testDataDao != null) {
        testDataDao.dropTable();
    }

    deleteKafkaTopic(TestUtils.getDefaultTestTopic(this.getClass()));
}
 
源代码23 项目: vividus   文件: SystemStreamTests.java
@After
@AfterEach
public void after()
{
    out.reset();
    err.reset();
}
 
源代码24 项目: kogito-runtimes   文件: ListenersTest.java
@AfterEach
public void cleanup() {
    if (this.kieSession != null) {
        this.kieSession.dispose();
    }
    this.statelessKieSession = null;
}
 
源代码25 项目: springdoc-openapi   文件: SpringDocApp9Test.java
@AfterEach
private void clean() throws IllegalAccessException {
	Field convertersField2 = FieldUtils.getDeclaredField(ObjectMapper.class, "_mixIns", true);
	SimpleMixInResolver _mixIns = (SimpleMixInResolver) convertersField2.get(Json.mapper());
	Field convertersField3 = FieldUtils.getDeclaredField(SimpleMixInResolver.class, "_localMixIns", true);
	Map<ClassKey, Class<?>> _localMixIns = (Map<ClassKey, Class<?>>) convertersField3.get(_mixIns);
	_localMixIns.putAll(springMixins);
}
 
源代码26 项目: camel-quarkus   文件: QuteTestBase.java
@AfterEach
void afterEach() {
    if (template != null) {
        template.stop();
    }
    if (context != null) {
        context.stop();
    }
}
 
@AfterEach
void tearDown() throws IOException {
    packageJsonInputStream.close();
}
 
源代码28 项目: kogito-runtimes   文件: JbpmBpmn2TestCase.java
@AfterEach
public void clear() {
    clearHistory();
}
 
源代码29 项目: kogito-runtimes   文件: BooleanHandlerTest.java
@AfterEach
public void destroy() {
    registry.clear();
}
 
源代码30 项目: smithy   文件: SmithyBuildTest.java
@AfterEach
public void after() throws IOException {
    Files.walk(outputDirectory).sorted(Comparator.reverseOrder()).map(Path::toFile).forEach(File::delete);
}
 
 类所在包
 同包方法