From 58102e97e16f9d89b2cedf789a3eb11d6c0a26fc Mon Sep 17 00:00:00 2001
From: SHaselbauer <sarah.haselbauer@akquinet.de>
Date: Wed, 23 Jan 2013 11:47:55 -0500
Subject: [PATCH] alternative variant to disable thread creation by the scheduledExecutor in test selenium test cases

---
 src/com/gitblit/GitBlit.java |   25 ++++++++++++++++++-------
 1 files changed, 18 insertions(+), 7 deletions(-)

diff --git a/src/com/gitblit/GitBlit.java b/src/com/gitblit/GitBlit.java
index f47e76c..4cfd61e 100644
--- a/src/com/gitblit/GitBlit.java
+++ b/src/com/gitblit/GitBlit.java
@@ -3096,13 +3096,7 @@
 		}
 		
 		// schedule lucene engine
-		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.");      
-		}
+		enableLuceneIndexing();
 
 		
 		// schedule gc engine
@@ -3184,6 +3178,23 @@
 		}
 	}
 	
+	protected void enableLuceneIndexing() {
+		scheduledExecutor.scheduleAtFixedRate(luceneExecutor, 1, 2,  TimeUnit.MINUTES);
+		logger.info("Lucene executor is scheduled to process indexed branches every 2 minutes.");
+	}
+	
+	protected final Logger getLogger() {
+		return logger;
+	}
+	
+	protected final ScheduledExecutorService getScheduledExecutor() {
+		return scheduledExecutor;
+	}
+
+	protected final LuceneExecutor getLuceneExecutor() {
+		return luceneExecutor;
+	}
+	
 	private void logTimezone(String type, TimeZone zone) {
 		SimpleDateFormat df = new SimpleDateFormat("z Z");
 		df.setTimeZone(zone);

--
Gitblit v1.9.1