當前位置: 首頁>>代碼示例>>Java>>正文


Java AfterSuite類代碼示例

本文整理匯總了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");
}
 
開發者ID:WileyLabs,項目名稱:teasy,代碼行數:20,代碼來源:OurBeforeAfterAnnotationsOrderBase.java

示例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();
				}
			}
		}
	}
}
 
開發者ID:equella,項目名稱:Equella,代碼行數:22,代碼來源:AbstractRestAssuredTest.java

示例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");
		}
	}
}
 
開發者ID:adejanovski,項目名稱:cassandra-jdbc-wrapper,代碼行數:17,代碼來源:BuildCluster.java

示例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;
}
 
開發者ID:web-auto,項目名稱:wtf-core,代碼行數:25,代碼來源:AnnotationReader.java

示例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;
  }
}
 
開發者ID:apache,項目名稱:helix,代碼行數:23,代碼來源:AbstractTestClass.java

示例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);
		}

	}
}
 
開發者ID:persado,項目名稱:stevia,代碼行數:19,代碼來源:SteviaTestBase.java

示例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;
        }
    }
}
 
開發者ID:dropbox,項目名稱:dropbox-sdk-java,代碼行數:20,代碼來源:ITUtil.java

示例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 ();
	}
}
 
開發者ID:WasiqB,項目名稱:coteafs-appium,代碼行數:12,代碼來源:DefaultTest.java

示例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();
	}
	
}
 
開發者ID:AlanYangs,項目名稱:Log4Reports,代碼行數:16,代碼來源:BaseCase.java

示例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();
  }
 
開發者ID:ampool,項目名稱:monarch,代碼行數:9,代碼來源:TestBase.java

示例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();
  }
 
開發者ID:ampool,項目名稱:monarch,代碼行數:10,代碼來源:TestBase.java

示例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();
        }
    }
}
 
開發者ID:cloudkeeper-project,項目名稱:cloudkeeper,代碼行數:11,代碼來源:ITS3StagingArea.java

示例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);
  }
}
 
開發者ID:DevStreet,項目名稱:FinanceAnalytics,代碼行數:11,代碼來源:AbstractDbTest.java

示例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();
}
 
開發者ID:wso2,項目名稱:carbon-metrics,代碼行數:15,代碼來源:BaseReporterTest.java

示例15: destroy

import org.testng.annotations.AfterSuite; //導入依賴的package包/類
@AfterSuite
protected static void destroy() throws Exception {
    if (logger.isInfoEnabled()) {
        logger.info("Deactivating Metrics");
    }
    metrics.deactivate();
}
 
開發者ID:wso2,項目名稱:carbon-metrics,代碼行數:8,代碼來源:BaseReporterTest.java


注:本文中的org.testng.annotations.AfterSuite類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。