@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");
}
java类org.testng.annotations.AfterSuite的实例源码
OurBeforeAfterAnnotationsOrderBase.java 文件源码
项目:teasy
阅读 27
收藏 0
点赞 0
评论 0
AbstractRestAssuredTest.java 文件源码
项目:Equella
阅读 32
收藏 0
点赞 0
评论 0
@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();
}
}
}
}
}
BuildCluster.java 文件源码
项目:cassandra-jdbc-wrapper
阅读 43
收藏 0
点赞 0
评论 0
@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");
}
}
}
AnnotationReader.java 文件源码
项目:wtf-core
阅读 108
收藏 0
点赞 0
评论 0
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;
}
AbstractTestClass.java 文件源码
项目:helix
阅读 36
收藏 0
点赞 0
评论 0
@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;
}
}
SteviaTestBase.java 文件源码
项目:stevia
阅读 33
收藏 0
点赞 0
评论 0
/**
* 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);
}
}
}
ITUtil.java 文件源码
项目:dropbox-sdk-java
阅读 34
收藏 0
点赞 0
评论 0
@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;
}
}
}
DefaultTest.java 文件源码
项目:coteafs-appium
阅读 36
收藏 0
点赞 0
评论 0
/**
* @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 ();
}
}
BaseCase.java 文件源码
项目:Log4Reports
阅读 30
收藏 0
点赞 0
评论 0
@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();
}
}
TestBase.java 文件源码
项目:monarch
阅读 40
收藏 0
点赞 0
评论 0
@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();
}
TestBase.java 文件源码
项目:monarch
阅读 29
收藏 0
点赞 0
评论 0
@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();
}
ITS3StagingArea.java 文件源码
项目:cloudkeeper
阅读 36
收藏 0
点赞 0
评论 0
@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();
}
}
}
AbstractDbTest.java 文件源码
项目:FinanceAnalytics
阅读 28
收藏 0
点赞 0
评论 0
/**
* 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);
}
}
BaseReporterTest.java 文件源码
项目:carbon-metrics
阅读 30
收藏 0
点赞 0
评论 0
@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();
}
BaseReporterTest.java 文件源码
项目:carbon-metrics
阅读 30
收藏 0
点赞 0
评论 0
@AfterSuite
protected static void destroy() throws Exception {
if (logger.isInfoEnabled()) {
logger.info("Deactivating Metrics");
}
metrics.deactivate();
}
Alien4CloudIntegrationTest.java 文件源码
项目:brooklyn-tosca
阅读 36
收藏 0
点赞 0
评论 0
@AfterSuite(alwaysRun = true)
public void tearDown() throws Exception {
try {
if (this.mgmt != null) {
Entities.destroyAll(this.mgmt);
}
} catch (Throwable e) {
LOG.error("Caught exception in tearDown method", e);
} finally {
this.mgmt = null;
if (origFeatureEnablement != null) {
BrooklynFeatureEnablement.setDefault(ToscaTypePlanTransformer.FEATURE_TOSCA_ENABLED, origFeatureEnablement);
}
}
}
SampleTestBase.java 文件源码
项目:restassured_cli
阅读 30
收藏 0
点赞 0
评论 0
/**
* Stops WireMock when all tests are executed.
*/
@AfterSuite
public void afterClass() {
logger.debug("========== Stopping WireMock ==========");
if (wireMockServer != null) {
wireMockServer.stop();
wireMockServer = null;
}
}
AbstractApiResourceInitializer.java 文件源码
项目:elide
阅读 35
收藏 0
点赞 0
评论 0
@AfterSuite
public final void tearDownServer() {
log.debug("...Stopping Server...");
try {
server.stop();
} catch (Exception e) {
log.debug(e.getMessage());
}
}
TestExpressionCompiler.java 文件源码
项目:presto
阅读 36
收藏 0
点赞 0
评论 0
@AfterSuite
public void tearDownClass()
{
if (executor != null) {
executor.shutdownNow();
executor = null;
}
}
TestNGBase.java 文件源码
项目:JDI
阅读 31
收藏 0
点赞 0
评论 0
@AfterSuite(alwaysRun = true)
public static void jdiTearDown() throws IOException {
LocalDateTime date = Instant.ofEpochMilli(21 * 3600000 + getTestRunTime())
.atZone(ZoneId.systemDefault())
.toLocalDateTime();
String formattedTime = DateTimeFormatter.ofPattern("HH:mm:ss.S").format(date);
logger.info("Test run finished. " + LINE_BREAK + "Total test run time: " + formattedTime);
if (WebSettings.killBrowser.toLowerCase().contains("after"))
killAllRunWebBrowsers();
}
TestNGBase.java 文件源码
项目:JDI
阅读 33
收藏 0
点赞 0
评论 0
@AfterSuite
public static void jdiTearDown() {
if (WinSettings.driverFactory instanceof WiniumDriverFactory) {
WiniumDriverFactory winiumDriverFactory = (WiniumDriverFactory) WinSettings.driverFactory;
winiumDriverFactory.getDriver("winniumdesctop").close(); //Can be useful only for *.exe applications
Process process = winiumDriverFactory.getStartedProcess();
if (process != null)
process.destroy();
// killAllRunDrivers();
}
}
BaseTest.java 文件源码
项目:edx-app-android
阅读 31
收藏 0
点赞 0
评论 0
/**
* 1) This will uninstall the app. 2) This will create an index.html file in
* output folder to list down the test runs.
*
* @throws IOException
* @throws MessagingException
* @throws AddressException
*/
@AfterSuite(alwaysRun = true, groups = { "Android", "iOS" })
public void createIndexFile(ITestContext testContext) throws IOException{
String root = PropertyLoader.loadProperty("output.path").get();
testLogger.info("report path " + root);
int pathLevel = root.split("/").length;
String reportFolder = root.split("/")[pathLevel - 1];
int numberOfPassedTests = testContext.getPassedTests().size();
int numberOfFailedTests = testContext.getFailedTests().size();
int numberOfSkippedTests = testContext.getSkippedTests().size();
String summaryFileName = "runSummary.csv";
String summaryFilePath = root + "/..";
String summaryReport = reportFolder + "," + numberOfPassedTests + ","
+ numberOfFailedTests + "," + numberOfSkippedTests;
FileGenerator.appendTextToBeginingOfFile(summaryFilePath,
summaryFileName, summaryReport);
testLogger.info(reportFolder);
testLogger.info("Passed: " + numberOfPassedTests);
testLogger.info("Failed: " + numberOfFailedTests);
testLogger.info("Skipped: " + numberOfSkippedTests);
FileGenerator.generateBarGraphIndexHTML(summaryFilePath);
String parentFolder = root + "/../..";
for (int i = 1; i < pathLevel; i++) {
FileGenerator.generateIndexHTML(parentFolder.toString());
parentFolder = parentFolder + "/..";
}
}
SingleServerFixture.java 文件源码
项目:clc-java-sdk
阅读 31
收藏 0
点赞 0
评论 0
@AfterSuite(groups = LONG_RUNNING)
public void deleteServer() {
ServerMetadata serverStateBeforeDelete = loadMetadataOf(server);
serverService.delete(server);
assertThatServerProperlyStarted(serverStateBeforeDelete);
}
AbstractTest.java 文件源码
项目:oap
阅读 34
收藏 0
点赞 0
评论 0
@AfterSuite
public void afterSuite() throws Exception {
if( cleanupTemp ) {
final long now = System.currentTimeMillis();
boolean empty = true;
if( !java.nio.file.Files.exists( Env.tmp ) ) return;
try( val stream = java.nio.file.Files.newDirectoryStream( Env.tmp ) ) {
for( Path build : stream ) {
final boolean self = Env.tmpRoot.equals( build );
final long lastModified = java.nio.file.Files.getLastModifiedTime( build ).toMillis();
final long diff = now - lastModified;
if( self || diff > TEN_HOURS ) {
log.info( "delete {}", build );
deleteDirectory( build );
} else {
log.info( "skip {}, self = {}, diff = {}", build, self, diff );
log.trace( "build={}, env={}", build );
log.trace( "now={}, lastModified={}", now, lastModified );
empty = false;
}
}
}
if( empty ) deleteDirectory( Env.tmp );
}
}
Word2010Test.java 文件源码
项目:community-edition-old
阅读 40
收藏 0
点赞 0
评论 0
@AfterSuite
public void tearDown()
{
File propFile = new File(location, "hello world.docx");
propFile.setWritable(true);
propFile.delete();
Assert.assertFalse(propFile.exists());
}
Word2013Test.java 文件源码
项目:community-edition-old
阅读 35
收藏 0
点赞 0
评论 0
@AfterSuite
public void tearDown() throws SecurityException
{
File propFile = new File(location, "hello world.docx");
propFile.setWritable(true);
propFile.delete();
Assert.assertFalse(propFile.exists());
}
PowerPoint2013Test.java 文件源码
项目:community-edition-old
阅读 32
收藏 0
点赞 0
评论 0
@AfterSuite
public void tearDown() throws IOException
{
// Files.delete(Paths.get(location, "hello world.pptx"));
File propFile = new File(location, "hello world.pptx");
propFile.setWritable(true);
propFile.delete();
Assert.assertFalse(propFile.exists());
}
PowerPoint2010Test.java 文件源码
项目:community-edition-old
阅读 34
收藏 0
点赞 0
评论 0
@AfterSuite
public void tearDown()
{
File propFile = new File(location, "hello world.pptx");
propFile.setWritable(true);
propFile.delete();
Assert.assertFalse(propFile.exists());
}
SeleniumTest.java 文件源码
项目:netarchivesuite-svngit-migration
阅读 32
收藏 0
点赞 0
评论 0
@AfterSuite(alwaysRun=true)
public void shutdown() {
try {
SelectiveHarvestPageHelper.deactivateAllHarvests();
driver.close();
} catch (Exception e) {
e.printStackTrace();
}
}
Kafka08DataWriterTest.java 文件源码
项目:incubator-gobblin
阅读 37
收藏 0
点赞 0
评论 0
@AfterSuite
public void afterSuite()
throws IOException {
try {
_kafkaTestHelper.stopClients();
}
finally {
_kafkaTestHelper.stopServers();
}
}