本文整理匯總了Java中org.testng.annotations.AfterSuite類的典型用法代碼示例。如果您正苦於以下問題:Java AfterSuite類的具體用法?Java AfterSuite怎麽用?Java AfterSuite使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
AfterSuite類屬於org.testng.annotations包,在下文中一共展示了AfterSuite類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: after_suite
import org.testng.annotations.AfterSuite; //導入依賴的package包/類
@AfterSuite
public void after_suite() {
Assert.assertEquals(orderMethods.size(), 8, "Incorrect size of called methods");
Assert.assertEquals(orderMethods.get(0), BEFORE_CLASS_BASE, "Incorrect called method by index 0");
Assert.assertEquals(orderMethods.get(1), BEFORE_CLASS_TEST_PUBLIC, "Incorrect called method by index 1");
Assert.assertEquals(orderMethods.get(2), BEFORE_METHOD_BASE, "Incorrect called method by index 2");
Assert.assertEquals(orderMethods.get(3), BEFORE_METHOD_TEST_PUBLIC, "Incorrect called method by index 3");
Assert.assertEquals(orderMethods.get(4), AFTER_METHOD_TEST_PUBLIC, "Incorrect called method by index 4");
Assert.assertEquals(orderMethods.get(5), AFTER_METHOD_BASE_PUBLIC, "Incorrect called method by index 5");
Assert.assertEquals(orderMethods.get(6), AFTER_CLASS_TEST_PUBLIC, "Incorrect called method by index 6");
Assert.assertEquals(orderMethods.get(7), AFTER_CLASS_BASE_PUBLIC, "Incorrect called method by index 7");
Assert.assertFalse(orderMethods.contains(BEFORE_CLASS_BASE_PRIVATE), "Private method with @OurBeforeClass from super class was called");
Assert.assertFalse(orderMethods.contains(BEFORE_METHOD_BASE_PRIVATE), "Private method with @OurBeforeMethod from super class was called");
Assert.assertFalse(orderMethods.contains(AFTER_METHOD_BASE_PRIVATE), "Private method with @OurAfterMethod from super class was called");
Assert.assertFalse(orderMethods.contains(AFTER_CLASS_BASE_PRIVATE), "Private method with @OurAfterClass from super class was called");
}
示例2: cleanupAfterSuite
import org.testng.annotations.AfterSuite; //導入依賴的package包/類
@AfterSuite
public void cleanupAfterSuite(ITestContext context)
{
if( suite != null )
{
@SuppressWarnings("unchecked")
List<CleanupAfter> cleanups = (List<CleanupAfter>) suite.getAttribute("cleanups");
if( cleanups != null )
{
ListIterator<CleanupAfter> listIterator = cleanups.listIterator(cleanups.size());
while( listIterator.hasPrevious() )
{
CleanupAfter cleanup = listIterator.previous();
if( cleanup != null )
{
cleanup.cleanUp();
}
}
}
}
}
示例3: tearDownAfterSuite
import org.testng.annotations.AfterSuite; //導入依賴的package包/類
@AfterSuite(groups={"init"})
public static void tearDownAfterSuite() throws Exception {
System.out.println("CLOSING CASSANDRA CONNECTION");
if(dynamicCluster){
System.out.println("Stopping nodes");
clusterHasBuilt = false;
try{
ccmBridge.forceStop();
System.out.println("Discarding cluster");
ccmBridge.remove();
HOST = System.getProperty("host", ConnectionDetails.getHost());
}catch(Exception e){
System.out.println("Silent error discarding cluster");
}
}
}
示例4: getValue
import org.testng.annotations.AfterSuite; //導入依賴的package包/類
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;
}
示例5: afterSuite
import org.testng.annotations.AfterSuite; //導入依賴的package包/類
@AfterSuite
public void afterSuite() throws Exception {
ZKClientPool.reset();
if (_gZkClient != null) {
_gZkClient.close();
_gZkClient = null;
}
if (_zkServer != null) {
TestHelper.stopZkServer(_zkServer);
_zkServer = null;
}
if (_gZkClientTestNS != null) {
_gZkClientTestNS.close();
_gZkClientTestNS = null;
}
if (_zkServerTestNS != null) {
TestHelper.stopZkServer(_zkServerTestNS);
_zkServerTestNS = null;
}
}
示例6: stopRCServer
import org.testng.annotations.AfterSuite; //導入依賴的package包/類
/**
* Stop RC server if it's running.
*/
@AfterSuite(alwaysRun = true)
private void stopRCServer() {
if (isRCStarted) {
Object server = seleniumServer[0];
Method stopMethod = (Method) seleniumServer[1];
try {
stopMethod.invoke(server);
} catch (Exception e) {
STEVIA_TEST_BASE_LOG.warn("Failed to shutdown the Selenium Server",e);
}
}
}
示例7: deleteRoot
import org.testng.annotations.AfterSuite; //導入依賴的package包/類
@BeforeSuite
@AfterSuite(alwaysRun=true)
public static void deleteRoot() throws Exception {
// always use standard HTTP requestor for delete root
DbxClientV2 client = newClientV2(
newRequestConfig()
.withHttpRequestor(newStandardHttpRequestor())
);
try {
client.files().delete(RootContainer.ROOT);
} catch (DeleteErrorException ex) {
if (ex.errorValue.isPathLookup() &&
ex.errorValue.getPathLookupValue().isNotFound()) {
// ignore
} else {
throw ex;
}
}
}
示例8: tearDownTestSuite
import org.testng.annotations.AfterSuite; //導入依賴的package包/類
/**
* @author wasiq.bhamla
* @since 17-Apr-2017 3:47:41 PM
*/
@AfterSuite (alwaysRun = true)
public void tearDownTestSuite () {
if (this.androidServer != null && this.androidDevice != null) {
this.androidDevice.stop ();
this.androidServer.stop ();
}
}
示例9: afterSuite
import org.testng.annotations.AfterSuite; //導入依賴的package包/類
@AfterSuite
public void afterSuite(){
System.out.println("BaseCase: afterSuite");
Log.close();
TestReport.endTime = DateUtil.getNow("yyyy-MM-dd HH:mm:ss");
TestReport.endMsTime = DateUtil.getNow("yyyy-MM-dd HH:mm:ss.SSS");
System.out.println("case����--->" + TestReport.caseCount);
System.out.println("fail����--->"+TestReport.failureCount);
System.out.println("success����--->"+TestReport.successCount);
System.out.println("skip����--->"+TestReport.skipedCount);
if(! LogConfig.receivers.equals("")){
new TestReport(LogConfig.receivers, LogConfig.subject).sendReport();
}
}
示例10: setUpAfterClass
import org.testng.annotations.AfterSuite; //導入依賴的package包/類
@AfterSuite
public void setUpAfterClass() throws Exception {
// System.out.println("@AfterSuite -> TestBase.setUpAfterClass");
MonarchUtils.getConnection(new HashMap<String, String>(1){{
put(MonarchUtils.LOCATOR_PORT, testBase.getLocatorPort());
}}).close();
testBase.tearDown2();
}
示例11: setUpAfterClass
import org.testng.annotations.AfterSuite; //導入依賴的package包/類
@AfterSuite
public void setUpAfterClass() throws Exception {
// System.out.println("@AfterSuite -> TestBase.setUpAfterClass");
/*MonarchUtils.getConnection(new HashMap<String, String>(1){{
put(MonarchUtils.LOCATOR_PORT, testBase.getLocatorPort());
}}).close();*/
MonarchUtils.getConnection(MonarchUtils.LOCATOR_PORT, testBase.getLocatorPort()).close();
testBase.tearDown2();
}
示例12: tearDown
import org.testng.annotations.AfterSuite; //導入依賴的package包/類
@AfterSuite
public void tearDown() {
if (!skipTest) {
if (s3Connection != null) {
assert s3Bucket != null && executorService != null : "must have been initialized in setup()";
cleanS3(s3Connection, s3Bucket);
executorService.shutdownNow();
}
}
}
示例13: tearDownSuite
import org.testng.annotations.AfterSuite; //導入依賴的package包/類
/**
* Code run after entire suite.
* @throws Exception if an error occurs
*/
@AfterSuite(groups = {TestGroup.UNIT_DB, TestGroup.INTEGRATION })
public static final void tearDownSuite() throws Exception {
for (DbConnector connector : s_connectors.values()) {
ReflectionUtils.close(connector);
}
}
示例14: destroy
import org.testng.annotations.AfterSuite; //導入依賴的package包/類
@AfterSuite
protected static void destroy() throws Exception {
if (logger.isInfoEnabled()) {
logger.info("Unbinding jdbc/WSO2MetricsDB");
}
InitialContext ic = new InitialContext();
ic.unbind("jdbc/WSO2MetricsDB");
ic.unbind("jdbc");
if (logger.isInfoEnabled()) {
logger.info("Stopping reporters");
}
metrics.deactivate();
}
示例15: destroy
import org.testng.annotations.AfterSuite; //導入依賴的package包/類
@AfterSuite
protected static void destroy() throws Exception {
if (logger.isInfoEnabled()) {
logger.info("Deactivating Metrics");
}
metrics.deactivate();
}