类org.testng.annotations.AfterGroups源码实例Demo

下面列出了怎么用org.testng.annotations.AfterGroups的API类实例代码及写法,或者点击链接到github查看源代码。

源代码1 项目: netbeans   文件: CommandRestTest.java
/**
 * Test cleanup
 * 
 */
@AfterGroups(groups = {"rest-commands"}, alwaysRun = true)
//@Test(alwaysRun = true)
public static void stopPayara() {
    final String METHOD = "stopPayara";
    LOGGER.log(Level.INFO, METHOD, "stopFrame");
    LOGGER.log(Level.INFO, METHOD, "stopText");
    LOGGER.log(Level.INFO, METHOD, "stopFrame");
    PayaraServer server = payaraServer();
    try {
        ResultString result = CommandStopDAS.stopDAS(server);
        gfStdOut.close();
        gfStdErr.close();
        assertEquals(result.getState(), TaskState.COMPLETED);

    } catch (PayaraIdeException gfie) {
        fail("Version command execution failed: " + gfie.getMessage());
    }
}
 
源代码2 项目: netbeans   文件: CommandHttpTest.java
/**
 * Test cleanup
 * 
 */
@AfterGroups(groups = {"http-commands"})
public static void stopPayara() {
    final String METHOD = "stopPayara";
    LOGGER.log(Level.INFO, METHOD, "stopFrame");
    LOGGER.log(Level.INFO, METHOD, "stopText");
    LOGGER.log(Level.INFO, METHOD, "stopFrame");
    PayaraServer server = payaraServer();
    Command command = new CommandStopDAS();
    try {
        Future<ResultString> future = 
                ServerAdmin.<ResultString>exec(server, command);
        try {
            ResultString result = future.get();
            gfStdOut.close();
            gfStdErr.close();
            assertNotNull(result.getValue());
            assertTrue(result.getState() == TaskState.COMPLETED);
        } catch (InterruptedException | ExecutionException ie) {
            fail("Version command execution failed: " + ie.getMessage());
        }
    } catch (PayaraIdeException gfie) {
        fail("Version command execution failed: " + gfie.getMessage());
    }
}
 
源代码3 项目: netbeans   文件: CommandRestTest.java
/**
 * Test cleanup
 * 
 */
@AfterGroups(groups = {"rest-commands"}, alwaysRun = true)
//@Test(alwaysRun = true)
public static void stopGlassFish() {
    final String METHOD = "stopGlassFish";
    LOGGER.log(Level.INFO, METHOD, "stopFrame");
    LOGGER.log(Level.INFO, METHOD, "stopText");
    LOGGER.log(Level.INFO, METHOD, "stopFrame");
    GlassFishServer server = glassFishServer();
    try {
        ResultString result = CommandStopDAS.stopDAS(server);
        gfStdOut.close();
        gfStdErr.close();
        assertEquals(result.getState(), TaskState.COMPLETED);

    } catch (GlassFishIdeException gfie) {
        fail("Version command execution failed: " + gfie.getMessage());
    }
}
 
源代码4 项目: netbeans   文件: CommandHttpTest.java
/**
 * Test cleanup
 * 
 */
@AfterGroups(groups = {"http-commands"})
public static void stopGlassFish() {
    final String METHOD = "stopGlassFish";
    LOGGER.log(Level.INFO, METHOD, "stopFrame");
    LOGGER.log(Level.INFO, METHOD, "stopText");
    LOGGER.log(Level.INFO, METHOD, "stopFrame");
    GlassFishServer server = glassFishServer();
    Command command = new CommandStopDAS();
    try {
        Future<ResultString> future = 
                ServerAdmin.<ResultString>exec(server, command);
        try {
            ResultString result = future.get();
            gfStdOut.close();
            gfStdErr.close();
            assertNotNull(result.getValue());
            assertTrue(result.getState() == TaskState.COMPLETED);
        } catch (InterruptedException | ExecutionException ie) {
            fail("Version command execution failed: " + ie.getMessage());
        }
    } catch (GlassFishIdeException gfie) {
        fail("Version command execution failed: " + gfie.getMessage());
    }
}
 
@AfterGroups("StreamReading")
public void closeStreams() throws IOException {
    System.setErr(originalErrorStream);
    System.setOut(originalOutStream);
    errPrintStream.close();
    outPrintStream.close();
}
 
源代码6 项目: phoenix-omid   文件: OmidTestBase.java
@AfterGroups(groups = "sharedHBase")
public void afterGroups(ITestContext context) throws Exception {
    LOG.info("Tearing down OmidTestBase...");
    if (hbaseCluster != null) {
        hBaseUtils.shutdownMiniCluster();
    }

    getClient(context).close().get();
    getTSO(context).stopAndWait();
    TestUtils.waitForSocketNotListening("localhost", 1234, 1000);
}
 
源代码7 项目: allure-java   文件: AllFeatures.java
@AfterGroups
public void afterGroups1() throws IOException {
    addImgAttachment();
    addStringAttachment();
}
 
源代码8 项目: allure-java   文件: AllFeatures.java
@AfterGroups
public void afterGroups2() throws IOException {
    addImgAttachment();
    addStringAttachment();
}
 
源代码9 项目: qaf   文件: AbstractTestCase.java
@AfterGroups(alwaysRun = true)
final public void afterGroup(ITestContext testContext) {
	tearDownPrrallelThreads(testContext, "groups");
}
 
@AfterGroups("SystemTimeTests")
public void resetSystemCurrentTime() {
  DateTimeUtils.setCurrentMillisSystem();
}
 
源代码11 项目: allure1   文件: ConfigMethodsTest.java
@AfterGroups(groups = {"group1"})
public void configAfterGroups(XmlTest test) {
    if (test.getName().equals("AfterGroups")) {
        throw new RuntimeException();
    }
}
 
源代码12 项目: tutorials   文件: GroupIntegrationTest.java
@AfterGroups("database")
public void cleanDB() {
    System.out.println("cleanDB()");
}
 
@AfterGroups("positive_tests,regression,negative_tests")
public void runAfterEachGroup() {
    numbers.clear();
}