本文整理汇总了Java中org.testng.annotations.AfterGroups类的典型用法代码示例。如果您正苦于以下问题:Java AfterGroups类的具体用法?Java AfterGroups怎么用?Java AfterGroups使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
AfterGroups类属于org.testng.annotations包,在下文中一共展示了AfterGroups类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: tearDownAllDrivers
import org.testng.annotations.AfterGroups; //导入依赖的package包/类
@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();
}
示例2: afterExternalBlogMemberTestsGroup
import org.testng.annotations.AfterGroups; //导入依赖的package包/类
/**
* 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();
}
示例3: afterXGroupBlogMemberTestsGroup
import org.testng.annotations.AfterGroups; //导入依赖的package包/类
/**
* 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();
}
示例4: afterGroups
import org.testng.annotations.AfterGroups; //导入依赖的package包/类
@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);
}
示例5: cleanupDeleteUserByManagerTests
import org.testng.annotations.AfterGroups; //导入依赖的package包/类
/**
* 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);
}
}
示例6: afterGroupBlogMemberTestsGroup
import org.testng.annotations.AfterGroups; //导入依赖的package包/类
/**
* 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();
}
示例7: AfterClass
import org.testng.annotations.AfterGroups; //导入依赖的package包/类
@AfterGroups(groups = "Test")
public void AfterClass(){
try{
webDriverDecorator.getDriver().quit();
}catch (Exception e){
}
}
示例8: afterGroups1
import org.testng.annotations.AfterGroups; //导入依赖的package包/类
@AfterGroups
public void afterGroups1() throws IOException {
addImgAttachment();
addStringAttachment();
}
示例9: afterGroups2
import org.testng.annotations.AfterGroups; //导入依赖的package包/类
@AfterGroups
public void afterGroups2() throws IOException {
addImgAttachment();
addStringAttachment();
}
示例10: restoreFilePermissions
import org.testng.annotations.AfterGroups; //导入依赖的package包/类
/**
* Restore the system property.
*/
@AfterGroups (groups = {"readLocalFiles"})
public void restoreFilePermissions() {
setPermissions();
}
示例11: afterDefaultGroup
import org.testng.annotations.AfterGroups; //导入依赖的package包/类
@AfterGroups (groups = DEFAULT_CONFIG_MANAGER_REQUIRED)
public void afterDefaultGroup() {
LOGGER.info("Testing done with default config manager....");
}
示例12: afterTestGroup
import org.testng.annotations.AfterGroups; //导入依赖的package包/类
@AfterGroups (groups = TEST_CONFIG_MANAGER_REQUIRED)
public void afterTestGroup() {
LOGGER.info("Testing done with test config manager....");
}
示例13: afterTestQueryGroup
import org.testng.annotations.AfterGroups; //导入依赖的package包/类
@AfterGroups (groups = TEST_QUERY_GROUP_CONFIG_MANAGER_REQUIRED)
public void afterTestQueryGroup() {
LOGGER.info("Testing done with test queryGroup config manager....");
}
示例14: afterGroup
import org.testng.annotations.AfterGroups; //导入依赖的package包/类
@AfterGroups(alwaysRun = true)
final public void afterGroup(ITestContext testContext) {
tearDownPrrallelThreads(testContext, "groups");
}
示例15: cleanupDeleteUserByUserTests
import org.testng.annotations.AfterGroups; //导入依赖的package包/类
/**
* Cleanup method for the test group DeleteTestUserByUser
*/
@AfterGroups(groups = { "DeleteTestUserByUser" })
public void cleanupDeleteUserByUserTests() {
AuthenticationTestUtils.setAuthentication(null);
}