@AfterTest
public void shutdown() {
LOGGER.info("Trying to shutdown");
for (FakeInstance fakeInstance : FAKE_INSTANCES) {
try {
LOGGER.info("Trying to shutdown: " + fakeInstance);
fakeInstance.stop();
} catch (Exception e) {
}
}
LOGGER.info("Trying to stop controller");
CONTROLLER_STARTER.stop();
LOGGER.info("Trying to stop zk");
kafkaBrokerTopicObserver.stop();
KafkaStarterUtils.stopServer(kafkaStarter);
ZK_CLIENT.deleteRecursive("/" + HELIX_CLUSTER_NAME);
ZK_CLIENT.close();
ZkStarter.stopLocalZkServer();
}
java类org.testng.annotations.AfterTest的实例源码
ControllerStarterTest.java 文件源码
项目:uReplicator
阅读 32
收藏 0
点赞 0
评论 0
Axis2ServerStartupTestCase.java 文件源码
项目:product-ei
阅读 33
收藏 0
点赞 0
评论 0
@AfterTest(alwaysRun = true)
public void unDeployServices() throws Exception {
if (axis2Server1 != null && axis2Server1.isStarted()) {
axis2Server1.stop();
} else {
if (TestConfigurationProvider.isPlatform() && asContext!=null) {
int deploymentDelay = TestConfigurationProvider.getServiceDeploymentDelay();
String serviceName = ESBTestConstant.SIMPLE_AXIS2_SERVICE;
String studentServiceName = ESBTestConstant.STUDENT_REST_SERVICE;
ServiceDeploymentUtil deployer = new ServiceDeploymentUtil();
String sessionCookie = new LoginLogoutClient(asContext).login();
deployer.unDeployArrService(asContext.getContextUrls().getBackEndUrl(), sessionCookie
, serviceName, deploymentDelay);
deployer.unDeployArrService(asContext.getContextUrls().getBackEndUrl(), sessionCookie
, studentServiceName, deploymentDelay);
}
}
}
Axis2ServerStartupWithSecuredServices.java 文件源码
项目:product-ei
阅读 66
收藏 0
点赞 0
评论 0
@AfterTest(alwaysRun = true)
public void unDeployServices()
throws IOException, LoginAuthenticationExceptionException, ExceptionException,
XPathExpressionException, URISyntaxException, SAXException, XMLStreamException, AutomationUtilException {
if (TestConfigurationProvider.isIntegration() && axis2Server1 != null && axis2Server1.isStarted()) {
axis2Server1.stop();
} else {
AutomationContext asContext = new AutomationContext("AS", TestUserMode.SUPER_TENANT_ADMIN);
int deploymentDelay = TestConfigurationProvider.getServiceDeploymentDelay();
String serviceName = "SecureStockQuoteServiceScenario";
ServiceDeploymentUtil deployer = new ServiceDeploymentUtil();
LoginLogoutClient loginLogoutClient = new LoginLogoutClient(asContext);
for (int i = 1; i < 9; i++) {
deployer.unDeployArrService(asContext.getContextUrls().getBackEndUrl(), loginLogoutClient.login()
, serviceName + i, deploymentDelay);
}
}
}
ControllerStarterTest.java 文件源码
项目:chaperone
阅读 26
收藏 0
点赞 0
评论 0
@AfterTest
public void shutdown() {
LOGGER.info("Trying to shutdown");
for (FakeInstance fakeInstance : FAKE_INSTANCES) {
try {
LOGGER.info("Trying to shutdown: " + fakeInstance);
fakeInstance.stop();
} catch (Exception e) {
}
}
LOGGER.info("Trying to stop controller");
CONTROLLER_STARTER.stop();
LOGGER.info("Trying to stop zk");
kafkaBrokerTopicObserver.stop();
KafkaStarterUtils.stopServer(kafkaStarter);
ZK_CLIENT.deleteRecursive("/" + HELIX_CLUSTER_NAME);
ZK_CLIENT.close();
ZkStarter.stopLocalZkServer();
}
AbstractLogTest.java 文件源码
项目:copycat
阅读 35
收藏 0
点赞 0
评论 0
@BeforeTest
@AfterTest
protected void cleanLogDir() throws IOException {
Path directory = Paths.get("target/test-logs/");
if (Files.exists(directory)) {
Files.walkFileTree(directory, new SimpleFileVisitor<Path>() {
@Override
public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) throws IOException {
Files.delete(file);
return FileVisitResult.CONTINUE;
}
@Override
public FileVisitResult postVisitDirectory(Path dir, IOException exc) throws IOException {
Files.delete(dir);
return FileVisitResult.CONTINUE;
}
});
}
}
ApexManifestFileReaderTest.java 文件源码
项目:ApexUnit
阅读 33
收藏 0
点赞 0
评论 0
@AfterTest
public void cleanUpTestFiles() {
/*String testFilesDirPath = System.getProperty("user.dir") + System.getProperty("file.separator")
+ "MockTestFiles";
File testFilesDir = new File(testFilesDirPath);
if (testFilesDir.exists()) {
try {
FileUtils.deleteDirectory(testFilesDir);
} catch (IOException e) {
ApexUnitUtils.shutDownWithDebugLog(e, "IO Exception encountered while deleting the test files directory");
}
LOG.info("Test files directory deleted");
} else {
LOG.info("Test files directory does not exist; hence not deleted");
}*/
}
AnnotationReader.java 文件源码
项目:wtf-core
阅读 41
收藏 0
点赞 0
评论 0
public static Annotation getValue(Method javaMethod,
Class <? extends Annotation > annotationClass) {
Annotation annotation = javaMethod.getAnnotation(annotationClass);
if (annotation == null) {
boolean skip = false;
// Filter out the usual Annotations.
Annotation[] annots = javaMethod.getAnnotations();
for (Annotation an : annots) {
if (an.annotationType().equals(BeforeMethod.class) ||
an.annotationType().equals(AfterMethod.class) ||
an.annotationType().equals(BeforeSuite.class) ||
an.annotationType().equals(AfterSuite.class) ||
an.annotationType().equals(BeforeTest.class) ||
an.annotationType().equals(AfterTest.class)) {
skip = true;
break;
}
}
if (!skip) {
annotation = javaMethod.getDeclaringClass().getAnnotation(annotationClass);
}
}
return annotation;
}
AiravataIT.java 文件源码
项目:airavata
阅读 26
收藏 0
点赞 0
评论 0
@AfterTest(alwaysRun = true)
private void cleanUp(){
logger.info("cleanUp() -> Launching test experiment......");
Process p;
try {
String result = null;
p = Runtime.getRuntime().exec("base-airavata/apache-airavata-server-0.17-SNAPSHOT/bin/airavata-server-stop.sh -f");
BufferedReader br = new BufferedReader(
new InputStreamReader(p.getInputStream()));
while ((result = br.readLine()) != null)
System.out.println("line: " + result);
p.waitFor();
System.out.println ("exit: " + p.exitValue());
p.destroy();
} catch (Exception e) {
logger.error("Error occured while cleanup", e);
Assert.fail();
}
}
ScriptCompilerPluginSpecTest.java 文件源码
项目:Nicobar
阅读 32
收藏 0
点赞 0
评论 0
@AfterTest
public void cleanup() throws IOException {
Files.walkFileTree(rootPath.toAbsolutePath(), new SimpleFileVisitor<Path>() {
@Override
public FileVisitResult postVisitDirectory(Path directory, IOException exc) throws IOException {
Files.delete(directory);
return FileVisitResult.CONTINUE;
}
@Override
public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) throws IOException {
Files.delete(file);
return FileVisitResult.CONTINUE;
}
});
}
ExecutorTemplateTest.java 文件源码
项目:otter-G
阅读 38
收藏 0
点赞 0
评论 0
@AfterTest
public void tearDown() {
try {
template.destroy();
} catch (Exception e) {
want.fail(e.getMessage());
}
}
GrapheneCLITest.java 文件源码
项目:Graphene
阅读 28
收藏 0
点赞 0
评论 0
@AfterTest
void printIfError() {
if (asserted) {
System.setOut(originalOut);
System.setErr(originalErr);
System.out.println(outContent.toString());
System.err.println(errContent.toString());
}
}
BaseWebTestCase.java 文件源码
项目:selenium-testng-template
阅读 31
收藏 0
点赞 0
评论 0
@AfterTest
public void tearDown() {
super.tearDown();
if (Config.driver() != null) {
Config.driver().quit();
}
}
MonarchRecordReaderFTableTest.java 文件源码
项目:monarch
阅读 29
收藏 0
点赞 0
评论 0
@AfterTest
public void setUpAfterMethod() throws RMIException, Exception {
final Map<String, String> map = new HashMap<>();
map.put(MonarchUtils.LOCATOR_PORT, testBase.getLocatorPort());
map.put(MonarchUtils.REGION, regionName);
MonarchUtils.destroyFTable(regionName, map, false, true);
}
AmpoolSinkTaskTest.java 文件源码
项目:monarch
阅读 31
收藏 0
点赞 0
评论 0
@AfterTest
/*public void setUpAfterMethod() throws RMIException, Exception {
String locatorPort = testBase.getLocatorPort();
testBase.getClientVm().invoke(new SerializableRunnable() {
@Override
public void run() {
try {
MonarchUtils.destroyTable(regionName, locatorPort);
} catch (Exception e) {
e.printStackTrace();
}
}
});
}*/
public void setUpAfterMethod() throws Exception {
//final Map<String, String> map = new HashMap<>();
//map.put(MonarchUtils.LOCATOR_PORT, testBase.getLocatorPort());
//map.put(MonarchUtils.REGION, regionName);
final String locatorPort = testBase.getLocatorPort();
try {
MonarchUtils.destroyTable(TABLE1.trim(), locatorPort);
MonarchUtils.destroyTable(TABLE2.trim(), locatorPort);
MonarchUtils.destroyTable(TABLE3.trim(), locatorPort);
MonarchUtils.destroyTable(TABLE_ALL_TYPES.trim(), locatorPort);
MonarchUtils.destroyTable(TABLE_LOGICAL_TYPES.trim(), locatorPort);
MonarchUtils.destroyTable(TRANSACTION_TABLE.trim(), locatorPort);
} catch (Exception e) {
e.printStackTrace();
}
}
TestValidationManager.java 文件源码
项目:uReplicator
阅读 40
收藏 0
点赞 0
评论 0
@AfterTest
public void shutdown() {
LOGGER.info("Trying to shutdown");
helixMirrorMakerManager.stop();
kafkaBrokerTopicObserver.stop();
KafkaStarterUtils.stopServer(kafkaStarter);
ZkStarter.stopLocalZkServer();
}
TestSourceKafkaClusterValidationManager.java 文件源码
项目:uReplicator
阅读 29
收藏 0
点赞 0
评论 0
@AfterTest
public void shutdown() {
LOGGER.info("Trying to shutdown");
helixMirrorMakerManager.stop();
kafkaBrokerTopicObserver.stop();
KafkaStarterUtils.stopServer(kafkaStarter);
ZkStarter.stopLocalZkServer();
}
TestKafkaBrokerTopicObserver.java 文件源码
项目:uReplicator
阅读 34
收藏 0
点赞 0
评论 0
@AfterTest
public void shutdown() {
LOGGER.info("Trying to shutdown");
kafkaBrokerTopicObserver.stop();
KafkaStarterUtils.stopServer(kafkaStarter);
ZkStarter.stopLocalZkServer();
}
TestAutoTopicWhitelistingManager.java 文件源码
项目:uReplicator
阅读 31
收藏 0
点赞 0
评论 0
@AfterTest
public void shutdown() {
LOGGER.info("Trying to shutdown");
helixMirrorMakerManager.stop();
kafkaBrokerTopicObserver.stop();
KafkaStarterUtils.stopServer(kafkaStarter);
ZkStarter.stopLocalZkServer();
}
ServerApiLiveTest.java 文件源码
项目:amp-dimensiondata
阅读 35
收藏 0
点赞 0
评论 0
@AfterTest
public void testDeleteServer() {
if (serverId != null) {
Response response = api().deleteServer(serverId);
assertTrue(response.error().isEmpty());
}
}
TestNGXWorkTestCase.java 文件源码
项目:struts2
阅读 33
收藏 0
点赞 0
评论 0
@AfterTest
protected void tearDown() throws Exception {
XWorkTestCaseHelper.tearDown(configurationManager);
configurationManager = null;
configuration = null;
container = null;
actionProxyFactory = null;
}
OpcUaClientIT.java 文件源码
项目:milo
阅读 30
收藏 0
点赞 0
评论 0
@AfterTest
public void stopClientAndServer() throws ExecutionException, InterruptedException {
logger.info("stopClientAndServer()");
stopClient();
stopServer();
}
HumanTaskCoordinationTest.java 文件源码
项目:product-ei
阅读 30
收藏 0
点赞 0
评论 0
@AfterTest(alwaysRun = true, description = "Unload packages after test.")
public void removeArtifacts() throws PackageManagementException, InterruptedException, RemoteException,
LogoutAuthenticationExceptionException,
org.wso2.carbon.humantask.stub.mgt.PackageManagementException {
bpelPackageManagementClient.undeployBPEL("ClaimsApprovalProcess");
humanTaskPackageManagementClient.unDeployHumanTask("ClaimsApprovalTask", "ApproveClaim");
loginLogoutClient.logout();
}
HealthCareScenarioServerStartupTestCase.java 文件源码
项目:product-ei
阅读 36
收藏 0
点赞 0
评论 0
@SetEnvironment(executionEnvironments = {ExecutionEnvironment.STANDALONE})
@AfterTest(alwaysRun = true)
public void unDeployServices()
throws MalformedURLException, LoginAuthenticationExceptionException, ExceptionException,
RemoteException {
if (axis2Server1 != null && axis2Server1.isStarted()) {
axis2Server1.stop();
}
}
TestValidationManager.java 文件源码
项目:chaperone
阅读 25
收藏 0
点赞 0
评论 0
@AfterTest
public void shutdown() {
LOGGER.info("Trying to shutdown");
helixMirrorMakerManager.stop();
kafkaBrokerTopicObserver.stop();
KafkaStarterUtils.stopServer(kafkaStarter);
ZkStarter.stopLocalZkServer();
}
TestSourceKafkaClusterValidationManager.java 文件源码
项目:chaperone
阅读 35
收藏 0
点赞 0
评论 0
@AfterTest
public void shutdown() {
LOGGER.info("Trying to shutdown");
helixMirrorMakerManager.stop();
kafkaBrokerTopicObserver.stop();
KafkaStarterUtils.stopServer(kafkaStarter);
ZkStarter.stopLocalZkServer();
}
TestKafkaBrokerTopicObserver.java 文件源码
项目:chaperone
阅读 34
收藏 0
点赞 0
评论 0
@AfterTest
public void shutdown() {
LOGGER.info("Trying to shutdown");
kafkaBrokerTopicObserver.stop();
KafkaStarterUtils.stopServer(kafkaStarter);
ZkStarter.stopLocalZkServer();
}
TestAutoTopicWhitelistingManager.java 文件源码
项目:chaperone
阅读 30
收藏 0
点赞 0
评论 0
@AfterTest
public void shutdown() {
LOGGER.info("Trying to shutdown");
helixMirrorMakerManager.stop();
kafkaBrokerTopicObserver.stop();
KafkaStarterUtils.stopServer(kafkaStarter);
ZkStarter.stopLocalZkServer();
}
IntegrationTestClass.java 文件源码
项目:bjoern
阅读 41
收藏 0
点赞 0
评论 0
@AfterTest
public void finitOrientdb() throws java.io.IOException
{
main.stopOrientdb();
deleteOrientdbTestDatabases();
}
BaseElementTest.java 文件源码
项目:webUIAuto
阅读 33
收藏 0
点赞 0
评论 0
@AfterTest
public void afterTest(){
try{
webDriverDecorator.getDriver().close();
}catch (Exception e){
}
}
AbstractSeleniumTest.java 文件源码
项目:hugegherkin
阅读 31
收藏 0
点赞 0
评论 0
/**
* Tear down.
*
* @throws Exception the exception
*/
@AfterTest
public void tearDown() throws Exception {
String verificationErrorString = verificationErrors.toString();
if (!"".equals(verificationErrorString)) {
fail(verificationErrorString);
}
logger.debug("Test torn down");
}