下面列出了org.testng.annotations.AfterTest#org.testng.annotations.AfterMethod 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。
@AfterMethod(groups = "wso2.esb")
public void startServersA() throws InterruptedException, IOException {
if (!axis2Server1.isStarted()) {
axis2Server1.start();
}
if (!axis2Server2.isStarted()) {
axis2Server2.start();
}
if (!axis2Server3.isStarted()) {
axis2Server3.start();
}
Thread.sleep(1000);
}
@AfterMethod(groups = "wso2.esb")
public void startServersA() throws InterruptedException, IOException {
if (!axis2Server1.isStarted()) {
axis2Server1.start();
}
if (!axis2Server2.isStarted()) {
axis2Server2.start();
}
if (!axis2Server3.isStarted()) {
axis2Server3.start();
}
Thread.sleep(1000);
}
@AfterMethod
void tearDown() throws Exception {
numTearDownCalls++;
if (inTransaction()) {
numTearDownCallsInTransaction++;
}
assertNumRowsInPersonTable((inTransaction() ? 4 : 1), "after a test method");
}
@AfterMethod
public void printError(ITestResult result) {
if (result.getStatus() == ITestResult.FAILURE) {
String clsName = result.getTestClass().getName();
clsName = clsName.substring(clsName.lastIndexOf(".") + 1);
System.out.println("Test " + clsName + "." +
result.getName() + " FAILED");
}
}
@AfterMethod(alwaysRun = true)
public void tearDown()
{
serdeFactory = null;
orderingCompiler = null;
httpClient.close();
httpClient = null;
executor.shutdownNow();
executor = null;
exchangeClientFactory.stop();
exchangeClientFactory = null;
}
@AfterMethod
@Override
public void cleanup() throws Exception {
if (groupMetadataManager != null) {
groupMetadataManager.shutdown();
}
scheduler.shutdown();
super.internalCleanup();
}
@AfterMethod
void tearDown() throws Exception {
numTearDownCalls++;
if (inTransaction()) {
numTearDownCallsInTransaction++;
}
assertNumRowsInPersonTable((inTransaction() ? 4 : 1), "after a test method");
}
@AfterMethod
public void after(ITestResult result) {
if (!result.isSuccess()) {
List<Object> list = new ArrayList<>();
Collections.addAll(list, result.getParameters());
list.add(context.toString());
result.setParameters(list.toArray(new Object[list.size()]));
}
}
@AfterMethod(alwaysRun = true)
public void tearDown()
throws Exception
{
if (dummyHandle != null) {
dummyHandle.close();
}
deleteRecursively(temporary.toPath(), ALLOW_INSECURE);
}
@AfterMethod
void tearDown() {
numTearDownCalls++;
if (inTransaction()) {
numTearDownCallsInTransaction++;
}
assertNumRowsInPersonTable((inTransaction() ? 4 : 1), "after a test method");
}
@AfterMethod(alwaysRun = true)
public void teardown()
throws IOException
{
if (dummyHandle != null) {
dummyHandle.close();
}
deleteRecursively(temporary.toPath(), ALLOW_INSECURE);
}
@AfterMethod(alwaysRun = true)
public void teardown()
throws IOException
{
dummyHandle.close();
deleteRecursively(dataDir.toPath(), ALLOW_INSECURE);
}
@AfterMethod(alwaysRun = true)
public void teardown()
throws IOException
{
dummyHandle.close();
deleteRecursively(temporary.toPath(), ALLOW_INSECURE);
}
@AfterMethod(alwaysRun = true)
public void teardown()
{
closeQuietly(statement);
closeQuietly(connection);
executor.shutdownNow();
}
@AfterMethod(alwaysRun = true)
public void tearDown()
throws Exception
{
singleStreamSpillerFactory.destroy();
deleteRecursively(spillPath.toPath(), ALLOW_INSECURE);
}
@AfterMethod(alwaysRun = true)
public void tearDown()
{
executor.shutdownNow();
scheduledExecutor.shutdownNow();
spillerFactory = null;
}
@AfterMethod(alwaysRun = true)
public void teardown()
{
if (dummyHandle != null) {
dummyHandle.close();
}
}
@AfterMethod(alwaysRun = true)
public void tearDown()
{
queryRunner.close();
queryRunner = null;
generatedEvents = null;
}
@AfterMethod
public void copyErrors(ITestResult result) {
if (!result.isSuccess()) {
suiteErrors.addAll(diags.errorKeys());
List<Object> list = new ArrayList<>();
Collections.addAll(list, result.getParameters());
list.add("Test case: " + getTestCaseDescription());
for (Pair<String, Template> e : sourceFiles)
list.add("Source file " + e.fst + ": " + e.snd);
if (diags.errorsFound())
list.add("Compile diagnostics: " + diags.toString());
result.setParameters(list.toArray(new Object[list.size()]));
}
}
@AfterMethod(alwaysRun = true)
public void undeployProxyService() throws Exception {
super.cleanup();
super.init();
}
@AfterMethod
@Override
protected void cleanup() throws Exception {
super.internalCleanup();
}
@AfterMethod
public void shutdown() {
executor.shutdown();
}
@AfterMethod
public void tearDownMethod() throws Exception {
}
@AfterMethod(alwaysRun = true)
public void tearDown()
{
executor.shutdownNow();
}
@AfterMethod
public void tearDownMethod() throws Exception {
}
@AfterMethod
public void tearDownMethod() throws Exception {
graph = null;
}
@AfterMethod(alwaysRun = true)
public void teardown()
{
dummyHandle.close();
}
@AfterMethod(alwaysRun = true)
public void teardown()
{
closeQuietly(statement);
closeQuietly(connection);
}
@AfterMethod(alwaysRun = true)
public void synchronizePersistenceContext() {
em.flush();
}
@AfterMethod
public void tearDownMethod() throws Exception {
graph = null;
}