本文整理汇总了Java中org.testng.annotations.AfterMethod类的典型用法代码示例。如果您正苦于以下问题:Java AfterMethod类的具体用法?Java AfterMethod怎么用?Java AfterMethod使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
AfterMethod类属于org.testng.annotations包,在下文中一共展示了AfterMethod类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: disposeDriver
import org.testng.annotations.AfterMethod; //导入依赖的package包/类
@AfterMethod public void disposeDriver() throws Throwable {
SwingUtilities.invokeAndWait(new Runnable() {
@Override public void run() {
frame.setVisible(false);
frame.dispose();
if (window != null) {
window.setVisible(false);
window.dispose();
window = null;
}
}
});
if (driver != null) {
driver.quit();
}
}
示例2: tearDown
import org.testng.annotations.AfterMethod; //导入依赖的package包/类
@AfterMethod
public void tearDown(){
File compressedFile = new File(transformation.getTransformedApplicationLocation().getAbsolutePath() + ".zip");
if(compressedFile.exists()) {
boolean deleted = compressedFile.delete();
logger.info("CompressionHandlerTest:tearDown: Removed Compressed File :" + deleted);
}
}
示例3: disposeDriver
import org.testng.annotations.AfterMethod; //导入依赖的package包/类
@AfterMethod public void disposeDriver() throws Throwable {
SwingUtilities.invokeAndWait(new Runnable() {
@Override public void run() {
frame.setVisible(false);
frame.dispose();
}
});
}
示例4: disposeDriver
import org.testng.annotations.AfterMethod; //导入依赖的package包/类
@AfterMethod public void disposeDriver() throws Throwable {
SwingUtilities.invokeAndWait(new Runnable() {
@Override public void run() {
frame.setVisible(false);
frame.dispose();
}
});
JavaElementFactory.reset();
}
示例5: tearDown
import org.testng.annotations.AfterMethod; //导入依赖的package包/类
@AfterMethod
public void tearDown() {
// 删除mainStem节点
String path = StagePathUtils.getPipeline(pipelineId) + "/" + ArbitrateConstants.NODE_MAINSTEM;
zookeeper.delete(path);
nodeEvent.destory(one.getId());
// 关闭pipeline
pipelineEvent.destory(channelId, pipelineId);
// channelEvent.destory(channelId);
}
示例6: tearDown
import org.testng.annotations.AfterMethod; //导入依赖的package包/类
@AfterMethod
public void tearDown() {
nodeEvent.destory(node1.getId());
nodeEvent.destory(node2.getId());
nodeEvent.destory(node3.getId());
nodeEvent.destory(node4.getId());
}
示例7: afterMethod
import org.testng.annotations.AfterMethod; //导入依赖的package包/类
@AfterMethod
public void afterMethod() {
String fromBefore = (String) Reporter.getCurrentTestResult().getAttribute(FROM_BEFORE);
String fromMethod = (String) Reporter.getCurrentTestResult().getAttribute(FROM_METHOD);
assertEquals(fromBefore, FROM_BEFORE, "Incorrect [fromBefore] value");
assertEquals(fromMethod, FROM_METHOD, "Incorrect [fromMethod] value");
}
示例8: disposeDriver
import org.testng.annotations.AfterMethod; //导入依赖的package包/类
@AfterMethod public void disposeDriver() throws Throwable {
SwingUtilities.invokeAndWait(new Runnable() {
@Override public void run() {
frame.setVisible(false);
frame.dispose();
}
});
EventQueueWait.waitTillInvisibled(frame);
}
示例9: cleanupResources
import org.testng.annotations.AfterMethod; //导入依赖的package包/类
@AfterMethod
public void cleanupResources() throws SQLException {
TEST_NUMBER++;
//todo issue #232 fix increment topic partition name for tests on multi jvm
ALL_RESOURCES.cleanUpClusters();
DB_RESOURCE.executeResource(JDBCUtil.DROP_TABLE_SQL_RESOURCE);
}
示例10: testCleanup
import org.testng.annotations.AfterMethod; //导入依赖的package包/类
@AfterMethod
public void testCleanup() {
for (BaseSubject subject : this.privilegeManagementService.getSubjects()) {
this.privilegeManagementService.deleteSubject(subject.getSubjectIdentifier());
}
for (BaseResource resource : this.privilegeManagementService.getResources()) {
this.privilegeManagementService.deleteResource(resource.getResourceIdentifier());
}
}
示例11: disposeDriver
import org.testng.annotations.AfterMethod; //导入依赖的package包/类
@AfterMethod public void disposeDriver() throws Throwable {
SwingUtilities.invokeAndWait(new Runnable() {
@Override public void run() {
frame.setVisible(false);
frame.dispose();
}
});
if (driver != null) {
driver.quit();
}
}
示例12: printCaseError
import org.testng.annotations.AfterMethod; //导入依赖的package包/类
@AfterMethod
public void printCaseError(ITestResult result) {
if (result.getStatus() == ITestResult.FAILURE) {
Hierarchy hs = (Hierarchy)result.getParameters()[0];
System.out.println("Separate compilation case " + hs);
printCaseDetails(hs);
}
}
示例13: stopTestApp
import org.testng.annotations.AfterMethod; //导入依赖的package包/类
@AfterMethod
public void stopTestApp() throws Exception {
testApp.getOutputStream().write(1);
testApp.getOutputStream().flush();
testApp.waitFor();
testApp = null;
}
示例14: setUpAfterMethod
import org.testng.annotations.AfterMethod; //导入依赖的package包/类
@AfterMethod
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.destroyTable(regionName, map, false, true);
}
示例15: afterMethod
import org.testng.annotations.AfterMethod; //导入依赖的package包/类
@AfterMethod
public void afterMethod(Method method) {
if ("testMethod".equals(method.getName())) {
afterResult = Reporter.getCurrentTestResult();
fromAfter = (String) afterResult.getAttribute(ATTRIBUTE);
}
}