类org.testng.annotations.AfterTest源码实例Demo

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

@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);

        }
    }
}
 
@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);
        }

    }
}
 
源代码3 项目: quarkus   文件: QuarkusTestNgCallbacks.java
static void invokeTestNgAfterMethods(Object testInstance)
        throws IllegalAccessException, IllegalArgumentException, InvocationTargetException, ClassNotFoundException {
    if (testInstance != null) {
        List<Method> afterMethods = new ArrayList<>();
        collectCallbacks(testInstance.getClass(), afterMethods, (Class<? extends Annotation>) testInstance.getClass()
                .getClassLoader().loadClass(AfterMethod.class.getName()));
        collectCallbacks(testInstance.getClass(), afterMethods, (Class<? extends Annotation>) testInstance.getClass()
                .getClassLoader().loadClass(AfterTest.class.getName()));
        for (Method m : afterMethods) {
            // we don't know the values for parameterized methods that TestNG allows, we just skip those
            if (m.getParameterCount() == 0) {
                m.setAccessible(true);
                m.invoke(testInstance);
            }
        }
    }
}
 
@SetEnvironment(executionEnvironments = { ExecutionEnvironment.STANDALONE })
@AfterTest(alwaysRun = true)
public void unDeployServices()
        throws MalformedURLException, LoginAuthenticationExceptionException, ExceptionException, RemoteException {
    if (axis2Server1 != null && axis2Server1.isStarted()) {
        axis2Server1.stop();
    }

}
 
源代码5 项目: presto   文件: TestBlackHoleSmoke.java
@AfterTest(alwaysRun = true)
public void tearDown()
{
    assertThatNoBlackHoleTableIsCreated();
    queryRunner.close();
    queryRunner = null;
}
 
@AfterTest
public void tearDownClient() {
    ConfigProviderResolver cpr = ConfigProviderResolver.instance();
    try {
        Config old = cpr.getConfig();
        cpr.releaseConfig(old);
    } catch (IllegalStateException ignored) {
    }
}
 
@AfterTest
public void tearDownClient() {
    ConfigProviderResolver cpr = ConfigProviderResolver.instance();
    try {
        Config old = cpr.getConfig();
        cpr.releaseConfig(old);
    } catch (IllegalStateException ignored) {
    }
}
 
源代码8 项目: azure-cosmosdb-java   文件: TimeTokenTest.java
@AfterTest(groups = { "unit" })
public void afterMethod() {
    // set back default locale before test
    if (defaultLocale != null) {
        Locale.setDefault(defaultLocale);
    } else {
        Locale.setDefault(Locale.US);
    }
}
 
源代码9 项目: samples   文件: AndroidWebTest.java
@AfterTest
public void Teardown() {
	try {
		if (driver != null)
			driver.quit();
	} catch (Exception e) {
		e.printStackTrace();
	}
}
 
源代码10 项目: samples   文件: AndroidAppTest.java
@AfterTest
public void Teardown() {
	try {
		if (driver != null)
			driver.quit();
	} catch (Exception e) {
		e.printStackTrace();
	}
}
 
源代码11 项目: samples   文件: iOSWebTest.java
@AfterTest
public void Teardown() {
	try {
		if (driver != null)
			driver.quit();
	} catch (Exception e) {
		e.printStackTrace();
	}
}
 
源代码12 项目: samples   文件: iOSAppTest.java
@AfterTest
public void Teardown() {
  try {
  	if(driver != null)
      driver.quit();
  } catch (Exception e) {
      e.printStackTrace();
  }
}
 
源代码13 项目: samples   文件: AndroidAppTest.java
@AfterTest
public void Teardown() {
    try {
        if (driver != null)
            driver.quit();
    } catch (Exception e) {
        e.printStackTrace();
    }
}
 
源代码14 项目: Graphene   文件: GrapheneCLITest.java
@AfterTest
void printIfError() {
    if (asserted) {
        System.setOut(originalOut);
        System.setErr(originalErr);

        System.out.println(outContent.toString());
        System.err.println(errContent.toString());
    }
}
 
@AfterTest(alwaysRun = true)
public void cleanUp() throws Exception {
    GreenMailServer.stopServer();
}
 
源代码16 项目: micro-integrator   文件: SenderBaseClass.java
@AfterTest(alwaysRun = true)
public void cleanUp() throws Exception {
    greenMailServer.stopServer();
}
 
@AfterTest(alwaysRun = true)
public void destroy() throws Exception {
    carbonLogReader.stop();
    Utils.undeploySynapseConfiguration("inbound1", "inbound-endpoints", false);
    Utils.undeploySynapseConfiguration("inbound2", "inbound-endpoints", true);
}
 
@AfterTest(alwaysRun = true)
public void stop() throws Exception {
    client.destroy();
    tomcatServerManager.stop();
    super.cleanup();
}
 
@AfterTest(alwaysRun = true)
public void destroy() throws Exception {
    super.cleanup();
}
 
@AfterTest(alwaysRun = true)
public void cleanupEnvironment() throws Exception {
    super.cleanup();
}
 
@AfterTest(alwaysRun = true)
public void cleanupEnvironment() throws Exception {
    super.cleanup();
}
 
@AfterTest(alwaysRun = true)
public void cleanupEnvironment() throws Exception {
    super.cleanup();
}
 
@AfterTest(alwaysRun = true)
public void cleanupEnvironment() throws Exception {
    super.cleanup();
}
 
源代码24 项目: micro-integrator   文件: NhttpBaseTestCase.java
@AfterTest(alwaysRun = true)
public void close() throws Exception {
    serverConfigurationManager.restoreToLastMIConfiguration();
}
 
@AfterTest(alwaysRun = true)
public void destroy() throws Exception {
    super.cleanup();
}
 
@AfterTest(alwaysRun = true)
public void destroy() throws Exception {
    super.cleanup();
}
 
@AfterTest
public void tearDown() throws Exception {

    System.getProperties().remove(USER_CONTEXT_EXPIRY_IN_SECONDS);
    userContextStore = null;
}
 
源代码28 项目: smallrye-mutiny   文件: MultiFlatMapTckTest.java
@AfterTest
public void shutdown() {
    executor.shutdown();
}
 
@AfterTest
public void cleanup() {
    executor.shutdown();
}
 
源代码30 项目: smallrye-mutiny   文件: UniOrTest.java
@AfterTest
public void shutdown() {
    executor.shutdown();
}