@AfterClass public void cleanUp() { Query query = _em.createQuery("select t from Token t where t.userName='testToken'"); testToken = (Token)query.getSingleResult(); query = _em.createQuery("select t from Token t where t.userName='" + USER_NAME + "'"); token = (Token)query.getSingleResult(); _em.getTransaction().begin(); _em.remove(token); _em.remove(testToken); _em.getTransaction().commit(); query = _em.createQuery("select t from Token t where t.id='" + valToken.getId() + "'"); valToken = (Token)query.getSingleResult(); _em.getTransaction().begin(); _em.remove(valToken); _em.getTransaction().commit(); }
@AfterClass public void close() throws IOException { Files.walk(userdir, 1) .filter(p -> !p.equals(userdir)) .forEach(p -> { try { if (Files.isDirectory(p)) { FileUtils.deleteFileTreeWithRetry(p); } else { FileUtils.deleteFileIfExistsWithRetry(p); } } catch (IOException x) { throw new UncheckedIOException(x); } }); }
@AfterClass public static void tearDown() throws Exception { server.shutdown(); server.awaitTermination(); channel.shutdown(); server = null; channel = null; }
@AfterClass public static void shutdown() throws IOException { executorShutdown(); if (listener != null) { listener.close(); } }
@AfterClass public static void tearDownClass() throws Exception { if (origFactoryProperty != null) { System.setProperty("javax.sql.rowset.RowSetFactory", origFactoryProperty); } }
@AfterClass public void close() throws IOException { // Windows requires server to stop before file is deleted if (server != null) server.stop(); super.close(); }
@AfterClass public void tearDownClass() { factory = null; if (null != context) { context.close(); } context = null; }
@AfterClass public void cleanup() throws IOException { Files.delete(Paths.get("TestLambda.java")); Files.delete(Paths.get("LongPackageName.java")); Files.delete(Paths.get("file")); TestUtil.removeAll(Paths.get("com")); TestUtil.removeAll(Paths.get("dump")); TestUtil.removeAll(Paths.get("dumpLong")); }
@AfterClass public void dispose() { for (String key : dataSourceMap.keySet()) { try { final DataSource source = dataSourceMap.get(key); try (final Connection conn = source.getConnection()) { final Statement stmt = conn.createStatement(); stmt.execute("shutdown"); } } catch (Throwable t) { System.out.println("Failed to dispose connection for " + key); } } }
@AfterClass(alwaysRun = true) public void tearDownClass() throws Exception { RuntimeOptions ro = runtimeOptions.getRuntimeOptions(); Formatter formatter = ro.formatter(runtimeOptions.getClassLoader()); formatter.done(); formatter.close(); }
@AfterClass public void afterClass() { this.zoneRepository.delete(this.defaultZone); this.zoneRepository.delete(this.zone1); this.zoneRepository.delete(this.zone2); }
@AfterClass public static void after() { tearDownSecrets(); detachAdmin(secretsGroupManager, adminContext.principal); detachReadonly(secretsGroupManager, readOnlyContext.principal); IntegrationTestHelper.cleanupGroup(secretsGroupManager, identifier); readOnlyContext.teardown(); adminContext.teardown(); otherContext.teardown(); // Also cleanup anything left over from a previous test run that was not deleted properly. IntegrationTestHelper.cleanUpFromPreviousRuns(Regions.fromName(TEST_REGION.getName()), GROUP_PREFIX); }
@AfterClass(alwaysRun = true) public void finishedClass(ITestContext testContext) throws Exception { if( context == null ) { return; } String delValue = testConfig.getProperty("test.deleteitems"); if( delValue == null || Boolean.parseBoolean(delValue) ) { cleanupAfterClass(); } }
/** * Tear down test * @throws Exception */ @AfterClass public void tearDown() throws Exception { System.out.println("Close HBase test table"); admin.disableTable(tableName); admin.deleteTable(tableName); testTable.close(); }
@AfterClass public void destory() { ArbitrateFactory.destory(pipelineId); // 删除mainStem节点 String path = pipelinePath + "/" + ArbitrateConstants.NODE_MAINSTEM; zookeeper.delete(path); pipelineEvent.destory(channelId, pipelineId); channelEvent.destory(channelId); }
@AfterClass public void cleanUp() throws Exception { // Delete User _em.getTransaction().begin(); _em.remove(testUser); _em.flush(); _em.getTransaction().commit(); _em.close(); }
@AfterClass public void actualTest(ITestContext result){ long testsRunInClass = Stream.of(result.getAllTestMethods()) .filter(iTestNGMethod -> iTestNGMethod.getTestClass().getRealClass().equals(OrderByGroupsSpecialCasesTest.class)) .count(); Assert.assertEquals(testsRunInClass, 2L, "intended tests were'nt run"); }
@AfterClass public void finalAssert(){ SoftAssert softAssert = new SoftAssert(); softAssert.assertTrue(orderOfExecution.contains("test1 wayToName"), "group 'first' was not grouped"); softAssert.assertTrue(orderOfExecution.contains("originalName thisOne"), "group 'third' was not grouped"); softAssert.assertTrue(orderOfExecution.contains("coveredByTests treatThisRight"), "group 'second' was not grouped"); softAssert.assertAll(); }
@AfterClass public void cleanProject() { try { Path installationDirectory = Paths.get(getProjectBasePath(project), ".idea"); if (Files.exists(installationDirectory)) { FileUtils.forceDelete(installationDirectory.toFile()); } } catch (IOException e) { // Ignore } }
@AfterClass public void tearDown() { // // clean up resources // if (connectorFacade instanceof LocalConnectorFacadeImpl) { ((LocalConnectorFacadeImpl) connectorFacade).dispose(); } }
@AfterClass public void cleanup() throws Exception { this.privilegeHelper.deleteResources(this.acsitSetUpFactory.getAcsZoneAdminRestTemplate(), this.acsitSetUpFactory.getAcsUrl(), this.acsitSetUpFactory.getZone1Headers()); this.privilegeHelper.deleteSubjects(this.acsitSetUpFactory.getAcsZoneAdminRestTemplate(), this.acsitSetUpFactory.getAcsUrl(), this.acsitSetUpFactory.getZone1Headers()); this.policyHelper.deletePolicySets(this.acsitSetUpFactory.getAcsZoneAdminRestTemplate(), this.acsitSetUpFactory.getAcsUrl(), this.acsitSetUpFactory.getZone1Headers()); this.acsitSetUpFactory.destroy(); }
@AfterClass public void afterClass() { System.out.println("Test2.afterClass()"); }
@AfterClass public void afterClass() { System.out.println("Test1.afterClass()"); }
@AfterClass public void afterClass() { System.out.println("TestFactory[" + data + "].afterClass()"); }
@AfterClass public void teardown() { ComponentSupport.destroy(service); }
@AfterClass public void cleanUp() { // code that will be invoked after this test ends }
@AfterClass private void clearMemory() { inMemorySchemaRepository.clearForInstanceTesting(); inMemorySchemaRepository.clearForSchemaTesting(); }
@AfterClass public void cleanUp() { }
@AfterClass public void cleanUp() { assert false : "some message"; }
@AfterClass public static void tearDownClass() { e = null; o = null; }
@AfterClass public static void tearDownClass() throws Exception { }