From 514da0237f6239322193d5d4b11b58fe4095da2b Mon Sep 17 00:00:00 2001 From: SHaselbauer <sarah.haselbauer@akquinet.de> Date: Wed, 23 Jan 2013 10:27:42 -0500 Subject: [PATCH] seleniumFixV2: connected thread pool creation to condition web.allowLuceneIndexing (otherwise thread pool will be kept open for more than a minute, what hinders the start of another gitblit instance in the same jvm during selenium test case execution), fixed naming of xpath variables, added missing property to gitblit.properties and test-ui-gitblit.properties, changed naming of methods (according to decision that owners is a much shorter word than repository administrator and that owners is fits better if you think of collective responsibilities and collective ownership) --- tests/de/akquinet/devops/test/ui/TestUISuite.java | 2 +- src/com/gitblit/GitBlit.java | 10 ++++++++-- tests/de/akquinet/devops/test/ui/cases/UI_MultiAdminSupportTest.java | 2 +- tests/de/akquinet/devops/test/ui/view/RepoEditView.java | 10 +++++----- 4 files changed, 15 insertions(+), 9 deletions(-) diff --git a/src/com/gitblit/GitBlit.java b/src/com/gitblit/GitBlit.java index 6bf75d7..f47e76c 100644 --- a/src/com/gitblit/GitBlit.java +++ b/src/com/gitblit/GitBlit.java @@ -3096,8 +3096,14 @@ } // schedule lucene engine - logger.info("Lucene executor is scheduled to process indexed branches every 2 minutes."); - scheduledExecutor.scheduleAtFixedRate(luceneExecutor, 1, 2, TimeUnit.MINUTES); + boolean luceneIndexing = settings.getBoolean(Keys.web.allowLuceneIndexing, true); + logger.info("Lucene indexing is " + (luceneIndexing ? "" : "not") + " activated"); + + if (luceneIndexing) { + scheduledExecutor.scheduleAtFixedRate(luceneExecutor, 1, 2, TimeUnit.MINUTES); + logger.info("Lucene executor is scheduled to process indexed branches every 2 minutes."); + } + // schedule gc engine if (gcExecutor.isReady()) { diff --git a/tests/de/akquinet/devops/test/ui/TestUISuite.java b/tests/de/akquinet/devops/test/ui/TestUISuite.java index 97bd903..08d7a00 100644 --- a/tests/de/akquinet/devops/test/ui/TestUISuite.java +++ b/tests/de/akquinet/devops/test/ui/TestUISuite.java @@ -27,7 +27,7 @@ * */ @RunWith(Suite.class) -@Suite.SuiteClasses({ UI_MultiAdminSupportTest.class }) +@Suite.SuiteClasses({ UI_MultiAdminSupportTest.class, UI_MultiAdminSupportTest.class }) public class TestUISuite { } diff --git a/tests/de/akquinet/devops/test/ui/cases/UI_MultiAdminSupportTest.java b/tests/de/akquinet/devops/test/ui/cases/UI_MultiAdminSupportTest.java index 9cdad16..a392571 100644 --- a/tests/de/akquinet/devops/test/ui/cases/UI_MultiAdminSupportTest.java +++ b/tests/de/akquinet/devops/test/ui/cases/UI_MultiAdminSupportTest.java @@ -64,7 +64,7 @@ .changeAuthorizationControl(RepoEditView.AUTHCONTROL_RWALL)); // with a second admin - editView.addRepoAdministrator("admin"); + editView.addOwner("admin"); Assert.assertTrue(editView.save()); // user is automatically forwarded to repo list view Assert.assertTrue(view.isEmptyRepo(TEST_MULTI_ADMIN_SUPPORT_REPO_PATH)); diff --git a/tests/de/akquinet/devops/test/ui/view/RepoEditView.java b/tests/de/akquinet/devops/test/ui/view/RepoEditView.java index ef0a317..a3365d1 100644 --- a/tests/de/akquinet/devops/test/ui/view/RepoEditView.java +++ b/tests/de/akquinet/devops/test/ui/view/RepoEditView.java @@ -68,7 +68,7 @@ return false; } - private void changeRepoAdministrators(String action, + private void changeOwners(String action, String affectedSelection, String username) { String xpath = "//select[@name=\"" + affectedSelection + "\"]/option[@value = \"" + username + "\" ]"; @@ -79,13 +79,13 @@ button.click(); } - public void removeRepoAdministrator(String username) { - changeRepoAdministrators("remove", "repoAdministrators:selection", + public void removeOwner(String username) { + changeOwners("remove", "owners:selection", username); } - public void addRepoAdministrator(String username) { - changeRepoAdministrators("add", "repoAdministrators:choices", username); + public void addOwner(String username) { + changeOwners("add", "owners:choices", username); } public WebElement getAccessRestrictionSelection() { -- Gitblit v1.9.1