org.testng.annotations.AfterGroups Java Examples

The following examples show how to use org.testng.annotations.AfterGroups. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: CommandRestTest.java    From netbeans with Apache License 2.0 6 votes vote down vote up
/**
 * 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());
    }
}
 
Example #2
Source File: CommandHttpTest.java    From netbeans with Apache License 2.0 6 votes vote down vote up
/**
 * 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());
    }
}
 
Example #3
Source File: CommandRestTest.java    From netbeans with Apache License 2.0 6 votes vote down vote up
/**
 * 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());
    }
}
 
Example #4
Source File: CommandHttpTest.java    From netbeans with Apache License 2.0 6 votes vote down vote up
/**
 * 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());
    }
}
 
Example #5
Source File: PrintStreamHandler.java    From ballerina-message-broker with Apache License 2.0 5 votes vote down vote up
@AfterGroups("StreamReading")
public void closeStreams() throws IOException {
    System.setErr(originalErrorStream);
    System.setOut(originalOutStream);
    errPrintStream.close();
    outPrintStream.close();
}
 
Example #6
Source File: OmidTestBase.java    From phoenix-omid with Apache License 2.0 5 votes vote down vote up
@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);
}
 
Example #7
Source File: AllFeatures.java    From allure-java with Apache License 2.0 4 votes vote down vote up
@AfterGroups
public void afterGroups1() throws IOException {
    addImgAttachment();
    addStringAttachment();
}
 
Example #8
Source File: AllFeatures.java    From allure-java with Apache License 2.0 4 votes vote down vote up
@AfterGroups
public void afterGroups2() throws IOException {
    addImgAttachment();
    addStringAttachment();
}
 
Example #9
Source File: AbstractTestCase.java    From qaf with MIT License 4 votes vote down vote up
@AfterGroups(alwaysRun = true)
final public void afterGroup(ITestContext testContext) {
	tearDownPrrallelThreads(testContext, "groups");
}
 
Example #10
Source File: TimeBasedRetentionPolicyTest.java    From incubator-gobblin with Apache License 2.0 4 votes vote down vote up
@AfterGroups("SystemTimeTests")
public void resetSystemCurrentTime() {
  DateTimeUtils.setCurrentMillisSystem();
}
 
Example #11
Source File: ConfigMethodsTest.java    From allure1 with Apache License 2.0 4 votes vote down vote up
@AfterGroups(groups = {"group1"})
public void configAfterGroups(XmlTest test) {
    if (test.getName().equals("AfterGroups")) {
        throw new RuntimeException();
    }
}
 
Example #12
Source File: GroupIntegrationTest.java    From tutorials with MIT License 4 votes vote down vote up
@AfterGroups("database")
public void cleanDB() {
    System.out.println("cleanDB()");
}
 
Example #13
Source File: SummationServiceIntegrationTest.java    From tutorials with MIT License 4 votes vote down vote up
@AfterGroups("positive_tests,regression,negative_tests")
public void runAfterEachGroup() {
    numbers.clear();
}