当前位置: 首页>>代码示例>>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;未经允许,请勿转载。