From: SHaselbauer Date: Wed, 23 Jan 2013 15:27:42 +0000 (+0100) Subject: seleniumFixV2: connected thread pool creation to condition web.allowLuceneIndexing... X-Git-Tag: v1.3.0~241^2~1 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=514da0237f6239322193d5d4b11b58fe4095da2b;p=gitblit.git 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) --- diff --git a/src/com/gitblit/GitBlit.java b/src/com/gitblit/GitBlit.java index 6bf75d75..f47e76ca 100644 --- a/src/com/gitblit/GitBlit.java +++ b/src/com/gitblit/GitBlit.java @@ -3096,8 +3096,14 @@ public class GitBlit implements ServletContextListener { } // 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 97bd9037..08d7a00b 100644 --- a/tests/de/akquinet/devops/test/ui/TestUISuite.java +++ b/tests/de/akquinet/devops/test/ui/TestUISuite.java @@ -27,7 +27,7 @@ import de.akquinet.devops.test.ui.cases.UI_MultiAdminSupportTest; * */ @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 9cdad160..a3925719 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 @@ public class UI_MultiAdminSupportTest extends AbstractUITest { .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 ef0a3171..a3365d1c 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 @@ public class RepoEditView extends GitblitDashboardView { 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 @@ public class RepoEditView extends GitblitDashboardView { 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() {