Author: bdelacretaz
Date: Mon Mar 7 13:47:53 2011
New Revision: 1078776
URL: http://svn.apache.org/viewvc?rev=1078776&view=rev
Log:
SLING-2021 - JarExecutor does not need to be a singleton
Modified:
sling/trunk/testing/tools/src/main/java/org/apache/sling/testing/tools/jarexec/JarExecutor.java
sling/trunk/testing/tools/src/main/java/org/apache/sling/testing/tools/sling/SlingTestBase.java
Modified:
sling/trunk/testing/tools/src/main/java/org/apache/sling/testing/tools/jarexec/JarExecutor.java
URL:
http://svn.apache.org/viewvc/sling/trunk/testing/tools/src/main/java/org/apache/sling/testing/tools/jarexec/JarExecutor.java?rev=1078776&r1=1078775&r2=1078776&view=diff
==============================================================================
---
sling/trunk/testing/tools/src/main/java/org/apache/sling/testing/tools/jarexec/JarExecutor.java
(original)
+++
sling/trunk/testing/tools/src/main/java/org/apache/sling/testing/tools/jarexec/JarExecutor.java
Mon Mar 7 13:47:53 2011
@@ -36,7 +36,6 @@ import org.slf4j.LoggerFactory;
* and terminate the process when this VM exits.
*/
public class JarExecutor {
- private static JarExecutor instance;
private final File jarToExecute;
private final String javaExecutable;
private final int serverPort;
@@ -65,19 +64,8 @@ public class JarExecutor {
return serverPort;
}
- public static JarExecutor getInstance(Properties config) throws
ExecutorException {
- if(instance == null) {
- synchronized (JarExecutor.class) {
- if(instance == null) {
- instance = new JarExecutor(config);
- }
- }
- }
- return instance;
- }
-
/** Build a JarExecutor, locate the jar to run, etc */
- private JarExecutor(Properties config) throws ExecutorException {
+ public JarExecutor(Properties config) throws ExecutorException {
final boolean isWindows =
System.getProperty("os.name").toLowerCase().contains("windows");
String portStr = config.getProperty(PROP_SERVER_PORT);
Modified:
sling/trunk/testing/tools/src/main/java/org/apache/sling/testing/tools/sling/SlingTestBase.java
URL:
http://svn.apache.org/viewvc/sling/trunk/testing/tools/src/main/java/org/apache/sling/testing/tools/sling/SlingTestBase.java?rev=1078776&r1=1078775&r2=1078776&view=diff
==============================================================================
---
sling/trunk/testing/tools/src/main/java/org/apache/sling/testing/tools/sling/SlingTestBase.java
(original)
+++
sling/trunk/testing/tools/src/main/java/org/apache/sling/testing/tools/sling/SlingTestBase.java
Mon Mar 7 13:47:53 2011
@@ -100,7 +100,7 @@ public class SlingTestBase {
serverBaseUrl = configuredUrl;
log.info(TEST_SERVER_URL_PROP + " is set: not starting server jar
(" + serverBaseUrl + ")");
} else {
- final JarExecutor j =
JarExecutor.getInstance(System.getProperties());
+ final JarExecutor j = new JarExecutor(System.getProperties());
log.info(TEST_SERVER_URL_PROP + " not set, starting server jar
{}", j);
j.start();
serverBaseUrl = "http://localhost:" + j.getServerPort();