@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(); }
/** * 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(); }
/** * 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(); }
@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); }
/** * 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); } }
/** * 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(); }
@AfterGroups(groups = "Test") public void AfterClass(){ try{ webDriverDecorator.getDriver().quit(); }catch (Exception e){ } }
@AfterGroups public void afterGroups1() throws IOException { addImgAttachment(); addStringAttachment(); }
@AfterGroups public void afterGroups2() throws IOException { addImgAttachment(); addStringAttachment(); }
/** * Restore the system property. */ @AfterGroups (groups = {"readLocalFiles"}) public void restoreFilePermissions() { setPermissions(); }
@AfterGroups (groups = DEFAULT_CONFIG_MANAGER_REQUIRED) public void afterDefaultGroup() { LOGGER.info("Testing done with default config manager...."); }
@AfterGroups (groups = TEST_CONFIG_MANAGER_REQUIRED) public void afterTestGroup() { LOGGER.info("Testing done with test config manager...."); }
@AfterGroups (groups = TEST_QUERY_GROUP_CONFIG_MANAGER_REQUIRED) public void afterTestQueryGroup() { LOGGER.info("Testing done with test queryGroup config manager...."); }
@AfterGroups(alwaysRun = true) final public void afterGroup(ITestContext testContext) { tearDownPrrallelThreads(testContext, "groups"); }
/** * Cleanup method for the test group DeleteTestUserByUser */ @AfterGroups(groups = { "DeleteTestUserByUser" }) public void cleanupDeleteUserByUserTests() { AuthenticationTestUtils.setAuthentication(null); }
/** * Cleanup after group allCanBlogMemberTestsGroup. * */ @AfterGroups(groups = { "allCanBlogMemberTestsGroup" }) public void afterAllCanBlogMemberTestsGroup() { AuthenticationHelper.removeAuthentication(); }
/** * Cleanup after group modGroupBlogMemberTestsGroup. * */ @AfterGroups(groups = { "modGroupBlogMemberTestsGroup" }) public void afterModGroupBlogMemberTestsGroup() { AuthenticationHelper.removeAuthentication(); }
@AfterGroups(groups="Lifecycle") public void afterGroups() { EVENTS.add("AFTER_GROUPS"); }
@AfterGroups("SystemTimeTests") public void resetSystemCurrentTime() { DateTimeUtils.setCurrentMillisSystem(); }
/** * 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"); }
@AfterGroups(groups = {"G13_1"}) public void tearDownG1() { System.out.println("tearDownG3_1"); }
@AfterGroups(groups = {"group1"}) public void configAfterGroups(XmlTest test) { if (test.getName().equals("AfterGroups")) { throw new RuntimeException(); } }
@Override @AfterGroups(dependsOnGroups = { TestGroupNames.SC_INIT_REQUIRED }, value = { TestGroupNames.SC_TEST_DERBY }, groups = { TestGroupNames.SC_TEST_DERBY }) public void discard() { super.discard(); }
@Override @AfterGroups(dependsOnGroups = { TestGroupNames.SC_INIT_REQUIRED }, value = { TestGroupNames.SC_TEST_H2 }, groups = { TestGroupNames.SC_TEST_H2 }) public void discard() { super.discard(); }
@Override @AfterGroups(dependsOnGroups = { TestGroupNames.SC_INIT_REQUIRED }, value = { TestGroupNames.SC_TEST_SOLID }, groups = { TestGroupNames.SC_TEST_SOLID }) public void discard() { super.discard(); }
@Override @AfterGroups(dependsOnGroups = { TestGroupNames.SC_INIT_REQUIRED }, value = { TestGroupNames.SC_TEST_MYSQL }, groups = { TestGroupNames.SC_TEST_MYSQL }) public void discard() { super.discard(); }