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

项目:riot-automated-tests    文件:RiotParentTest.java   
@AfterGroups(groups={"2drivers_android","1driver_android","1driver_ios","2drivers_ios"})
public void tearDownAllDrivers() throws Exception{
    if(null!=appiumFactory.getAndroidDriver1()){
        appiumFactory.getAndroidDriver1().quit();
        System.out.println("Android DRIVER 1 quitted on ANDROID device "+ReadConfigFile.getInstance().getDevicesMap().get("androiddevice1").get("deviceName") +", closing application "+Constant.APPLICATION_NAME+"."); 
    }
    if(null!=appiumFactory.getAndroidDriver2()){
        appiumFactory.getAndroidDriver2().quit();
        System.out.println("Android DRIVER 2 quitted on ANDROID device "+ReadConfigFile.getInstance().getDevicesMap().get("androiddevice2").get("deviceName") +", closing application "+Constant.APPLICATION_NAME+"."); 
    }
    if(null!=appiumFactory.getiOsDriver1()){
        appiumFactory.getiOsDriver1().quit();
        System.out.println("Ios DRIVER 1 quitted on iOS device "+ReadConfigFile.getInstance().getDevicesMap().get("iosdevice1").get("deviceName") +", closing application "+Constant.APPLICATION_NAME+"."); 
    }
    if(null!=appiumFactory.getiOsDriver2()){
        appiumFactory.getiOsDriver2().quit();
        System.out.println("Ios DRIVER 2 quitted on iOS device "+ReadConfigFile.getInstance().getDevicesMap().get("iosdevice2").get("deviceName") +", closing application "+Constant.APPLICATION_NAME+"."); 
    }
    //Stop the two appium's servers.
    stop2AppiumServers();
}
项目:communote-server    文件:BlogRightsTest.java   
/**
 * Cleanup after group externalGroupBlogMemberTestsGroup.
 *
 * @throws Exception
 *             in case clean up failed
 */
@AfterGroups(groups = { "externalBlogMemberTestsGroup" })
public void afterExternalBlogMemberTestsGroup() throws Exception {
    AuthenticationHelper.removeAuthentication();
    // remove group from other blog
    AuthenticationTestUtils.setSecurityContext(UserAndGroupTestUtils.findNthUser(
            BLOG_MANAGER_ALIAS_PATTERN_PREFIX, 2));
    Long blogId = getBlogManagement().findBlogByIdentifier(BLOG_2_ALIAS).getId();
    Long groupId2 = UserAndGroupTestUtils.findGroup(GROUP_2_ALIAS).getId();
    getBlogRightsManagement().removeMemberByEntityId(blogId, groupId2);
    Long userId = UserAndGroupTestUtils.findNthUser(USER_GROUP_1A2_ALIAS_PATTERN_PREFIX, 1)
            .getId();
    Set<Long> usersToSkip = new HashSet<Long>(1);
    usersToSkip.add(userId);
    assertGroupBlogAccess(blogId, groupId2, null, false, usersToSkip);
    // user must be unaffected
    assertBlogAccess(blogId, userId, BlogRole.MANAGER, false, true);
    getBlogRightsManagement().removeMemberByEntityId(blogId, userId);
    assertBlogAccess(blogId, userId, null, false, false);
    AuthenticationHelper.removeAuthentication();
}
项目:communote-server    文件:BlogRightsTest.java   
/**
 * Cleanup after group xGroupBlogMemberTestsGroup.
 *
 * @throws Exception
 *             in case clean up failed
 */
@AfterGroups(groups = { "xGroupBlogMemberTestsGroup" })
public void afterXGroupBlogMemberTestsGroup() throws Exception {
    // remove the group and user from the blog
    Long blogId2 = getBlogManagement().findBlogByIdentifier(BLOG_2_ALIAS).getId();
    Long groupId1 = UserAndGroupTestUtils.findGroup(GROUP_1_ALIAS).getId();
    getBlogRightsManagement().removeMemberByEntityId(blogId2, groupId1);
    Long userId = UserAndGroupTestUtils.findNthUser(USER_GROUP_1A2_ALIAS_PATTERN_PREFIX, 1)
            .getId();
    Set<Long> usersToSkip = new HashSet<Long>();
    usersToSkip.add(userId);
    assertGroupBlogAccess(blogId2, groupId1, null, false, usersToSkip);
    getBlogRightsManagement().removeMemberByEntityId(blogId2, userId);
    assertBlogAccess(blogId2, userId, null, false, true);
    AuthenticationHelper.removeAuthentication();
    // remove group from other blog
    AuthenticationTestUtils.setSecurityContext(UserAndGroupTestUtils.findNthUser(
            BLOG_MANAGER_ALIAS_PATTERN_PREFIX, 1));
    Long blogId1 = getBlogManagement().findBlogByIdentifier(BLOG_1_ALIAS).getId();
    Long groupId2 = UserAndGroupTestUtils.findGroup(GROUP_2_ALIAS).getId();
    getBlogRightsManagement().removeMemberByEntityId(blogId1, groupId2);
    AuthenticationHelper.removeAuthentication();
}
项目:incubator-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);
}
项目:communote-server    文件:UserManagementTest.java   
/**
 * Cleanup method for the test group DeleteTestUserByManager
 */
@AfterGroups(groups = { "DeleteTestUserByManager" })
public void cleanupDeleteUserByManagerTests() {
    try {
        if (userManagement.findUserByAlias(TEST_DEL_USER_ALIAS) != null) {
            internalTestAnonymizeUser(TEST_DEL_USER_EMAIL, TEST_DEL_USER_ALIAS);
        }
    } catch (Exception e) {
        Assert.fail("Cleanup operation failed.", e);
    } finally {
        AuthenticationTestUtils.setAuthentication(null);
    }
}
项目:communote-server    文件:BlogRightsTest.java   
/**
 * Cleanup after group userBlogMemberTestsGroup.
 *
 * @throws Exception
 *             in case clean up failed
 */
@AfterGroups(groups = { "groupBlogMemberTestsGroup" })
public void afterGroupBlogMemberTestsGroup() throws Exception {
    // remove the user from the blog
    Long userId = UserAndGroupTestUtils.findNthUser(USER_GROUP_1_ALIAS_PATTERN_PREFIX, 1)
            .getId();
    AuthenticationTestUtils.setSecurityContext(UserAndGroupTestUtils.findNthUser(
            BLOG_MANAGER_ALIAS_PATTERN_PREFIX, 2));
    Long blogId = getBlogManagement().findBlogByIdentifier(BLOG_2_ALIAS).getId();
    getBlogRightsManagement().removeMemberByEntityId(blogId, userId);
    assertBlogAccess(blogId, userId, null, false, true);
    AuthenticationHelper.removeAuthentication();
}
项目:webUIAuto    文件:BaseElementTest.java   
@AfterGroups(groups = "Test")
public void AfterClass(){
    try{
        webDriverDecorator.getDriver().quit();
    }catch (Exception e){

    }
}
项目:allure-java    文件:AllFeatures.java   
@AfterGroups
public void afterGroups1() throws IOException {
    addImgAttachment();
    addStringAttachment();
}
项目:allure-java    文件:AllFeatures.java   
@AfterGroups
public void afterGroups2() throws IOException {
    addImgAttachment();
    addStringAttachment();
}
项目:openjdk9    文件:JAXPFileReadOnlyBaseTest.java   
/**
 * Restore the system property.
 */
@AfterGroups (groups = {"readLocalFiles"})
public void restoreFilePermissions() {
    setPermissions();
}
项目:microservice-mock    文件:ConfigurationManagerTest.java   
@AfterGroups (groups = DEFAULT_CONFIG_MANAGER_REQUIRED)
public void afterDefaultGroup() {
    LOGGER.info("Testing done with default config manager....");
}
项目:microservice-mock    文件:ConfigurationManagerTest.java   
@AfterGroups (groups = TEST_CONFIG_MANAGER_REQUIRED)
public void afterTestGroup() {
    LOGGER.info("Testing done with test config manager....");
}
项目:microservice-mock    文件:ConfigurationManagerTest.java   
@AfterGroups (groups = TEST_QUERY_GROUP_CONFIG_MANAGER_REQUIRED)
public void afterTestQueryGroup() {
    LOGGER.info("Testing done with test queryGroup config manager....");
}
项目:qaf    文件:AbstractTestCase.java   
@AfterGroups(alwaysRun = true)
final public void afterGroup(ITestContext testContext) {
    tearDownPrrallelThreads(testContext, "groups");
}
项目:communote-server    文件:UserManagementTest.java   
/**
 * Cleanup method for the test group DeleteTestUserByUser
 */
@AfterGroups(groups = { "DeleteTestUserByUser" })
public void cleanupDeleteUserByUserTests() {
    AuthenticationTestUtils.setAuthentication(null);
}
项目:communote-server    文件:BlogRightsTest.java   
/**
 * Cleanup after group allCanBlogMemberTestsGroup.
 *
 */
@AfterGroups(groups = { "allCanBlogMemberTestsGroup" })
public void afterAllCanBlogMemberTestsGroup() {
    AuthenticationHelper.removeAuthentication();

}
项目:communote-server    文件:BlogRightsTest.java   
/**
 * Cleanup after group modGroupBlogMemberTestsGroup.
 *
 */
@AfterGroups(groups = { "modGroupBlogMemberTestsGroup" })
public void afterModGroupBlogMemberTestsGroup() {
    AuthenticationHelper.removeAuthentication();
}
项目:android-testng    文件:LifecycleTest.java   
@AfterGroups(groups="Lifecycle")
public void afterGroups() {
    EVENTS.add("AFTER_GROUPS");
}
项目:incubator-gobblin    文件:TimeBasedRetentionPolicyTest.java   
@AfterGroups("SystemTimeTests")
public void resetSystemCurrentTime() {
  DateTimeUtils.setCurrentMillisSystem();
}
项目:cats    文件:AxisServerStreamTest.java   
/**
 * Stops the jetty web server.
 */
@AfterGroups(groups = JETTY_TEST)
public final void tearDownJettyServer() {
    Assert.assertTrue(server.stopServer(), "Could not stop jetty server.");
    Reporter.log("Jetty Server Stopped");
}
项目:testng_samples    文件:GroupFixturesTest.java   
@AfterGroups(groups = {"G13_1"})
public void tearDownG1() {
  System.out.println("tearDownG3_1");
}
项目:allure1    文件:ConfigMethodsTest.java   
@AfterGroups(groups = {"group1"})
public void configAfterGroups(XmlTest test) {
    if (test.getName().equals("AfterGroups")) {
        throw new RuntimeException();
    }
}
项目:StreamCruncher    文件:DerbyTimeWF2PartitionAggTest.java   
@Override
@AfterGroups(dependsOnGroups = { TestGroupNames.SC_INIT_REQUIRED }, value = { TestGroupNames.SC_TEST_DERBY }, groups = { TestGroupNames.SC_TEST_DERBY })
public void discard() {
    super.discard();
}
项目:StreamCruncher    文件:DerbyTimeWF1ChainedPartitionTest.java   
@Override
@AfterGroups(dependsOnGroups = { TestGroupNames.SC_INIT_REQUIRED }, value = { TestGroupNames.SC_TEST_DERBY }, groups = { TestGroupNames.SC_TEST_DERBY })
public void discard() {
    super.discard();
}
项目:StreamCruncher    文件:DerbySLAAlertTest.java   
@Override
@AfterGroups(dependsOnGroups = { TestGroupNames.SC_INIT_REQUIRED }, value = { TestGroupNames.SC_TEST_DERBY }, groups = { TestGroupNames.SC_TEST_DERBY })
public void discard() {
    super.discard();
}
项目:StreamCruncher    文件:H2TopSellingItemsUpdateGroupTest.java   
@Override
@AfterGroups(dependsOnGroups = { TestGroupNames.SC_INIT_REQUIRED }, value = { TestGroupNames.SC_TEST_H2 }, groups = { TestGroupNames.SC_TEST_H2 })
public void discard() {
    super.discard();
}
项目:StreamCruncher    文件:DerbyOAFJoinTest.java   
@Override
@AfterGroups(dependsOnGroups = { TestGroupNames.SC_INIT_REQUIRED }, value = { TestGroupNames.SC_TEST_DERBY }, groups = { TestGroupNames.SC_TEST_DERBY })
public void discard() {
    super.discard();
}
项目:StreamCruncher    文件:SolidTopSellingItemsUpdateGroupTest.java   
@Override
@AfterGroups(dependsOnGroups = { TestGroupNames.SC_INIT_REQUIRED }, value = { TestGroupNames.SC_TEST_SOLID }, groups = { TestGroupNames.SC_TEST_SOLID })
public void discard() {
    super.discard();
}
项目:StreamCruncher    文件:H2SlidingWF3PartitionWhereTest.java   
@Override
@AfterGroups(dependsOnGroups = { TestGroupNames.SC_INIT_REQUIRED }, value = { TestGroupNames.SC_TEST_H2 }, groups = { TestGroupNames.SC_TEST_H2 })
public void discard() {
    super.discard();
}
项目:StreamCruncher    文件:H2TimeWF1PartitionAvgCountTest.java   
@Override
@AfterGroups(dependsOnGroups = { TestGroupNames.SC_INIT_REQUIRED }, value = { TestGroupNames.SC_TEST_H2 }, groups = { TestGroupNames.SC_TEST_H2 })
public void discard() {
    super.discard();
}
项目:StreamCruncher    文件:SolidOAFJoinTest.java   
@Override
@AfterGroups(dependsOnGroups = { TestGroupNames.SC_INIT_REQUIRED }, value = { TestGroupNames.SC_TEST_SOLID }, groups = { TestGroupNames.SC_TEST_SOLID })
public void discard() {
    super.discard();
}
项目:StreamCruncher    文件:SolidOAConfigurableFTest.java   
@Override
@AfterGroups(dependsOnGroups = { TestGroupNames.SC_INIT_REQUIRED }, value = { TestGroupNames.SC_TEST_SOLID }, groups = { TestGroupNames.SC_TEST_SOLID })
public void discard() {
    super.discard();
}
项目:StreamCruncher    文件:SolidReStockAlertTest.java   
@Override
@AfterGroups(dependsOnGroups = { TestGroupNames.SC_INIT_REQUIRED }, value = { TestGroupNames.SC_TEST_SOLID }, groups = { TestGroupNames.SC_TEST_SOLID })
public void discard() {
    super.discard();
}
项目:StreamCruncher    文件:SolidShipmentAggregatorTest.java   
@Override
@AfterGroups(dependsOnGroups = { TestGroupNames.SC_INIT_REQUIRED }, value = { TestGroupNames.SC_TEST_SOLID }, groups = { TestGroupNames.SC_TEST_SOLID })
public void discard() {
    super.discard();
}
项目:StreamCruncher    文件:H2CorrelationPerfTest.java   
@Override
@AfterGroups(dependsOnGroups = { TestGroupNames.SC_INIT_REQUIRED }, value = { TestGroupNames.SC_TEST_H2 }, groups = { TestGroupNames.SC_TEST_H2 })
public void discard() {
    super.discard();
}
项目:StreamCruncher    文件:SolidSLAAlertTest.java   
@Override
@AfterGroups(dependsOnGroups = { TestGroupNames.SC_INIT_REQUIRED }, value = { TestGroupNames.SC_TEST_SOLID }, groups = { TestGroupNames.SC_TEST_SOLID })
public void discard() {
    super.discard();
}
项目:StreamCruncher    文件:SolidTimeWF2PartitionAggTest.java   
@Override
@AfterGroups(dependsOnGroups = { TestGroupNames.SC_INIT_REQUIRED }, value = { TestGroupNames.SC_TEST_SOLID }, groups = { TestGroupNames.SC_TEST_SOLID })
public void discard() {
    super.discard();
}
项目:StreamCruncher    文件:MySQLTimeWF1ChainedPartitionTest.java   
@Override
@AfterGroups(dependsOnGroups = { TestGroupNames.SC_INIT_REQUIRED }, value = { TestGroupNames.SC_TEST_MYSQL }, groups = { TestGroupNames.SC_TEST_MYSQL })
public void discard() {
    super.discard();
}
项目:StreamCruncher    文件:MySQLSLAAlertTest.java   
@Override
@AfterGroups(dependsOnGroups = { TestGroupNames.SC_INIT_REQUIRED }, value = { TestGroupNames.SC_TEST_MYSQL }, groups = { TestGroupNames.SC_TEST_MYSQL })
public void discard() {
    super.discard();
}
项目:StreamCruncher    文件:MySQLTimeWindowFTest.java   
@Override
@AfterGroups(dependsOnGroups = { TestGroupNames.SC_INIT_REQUIRED }, value = { TestGroupNames.SC_TEST_MYSQL }, groups = { TestGroupNames.SC_TEST_MYSQL })
public void discard() {
    super.discard();
}