summaryrefslogtreecommitdiffstats
path: root/java/sca/modules/node-launcher-equinox
diff options
context:
space:
mode:
authorrfeng <rfeng@13f79535-47bb-0310-9956-ffa450edef68>2009-07-01 20:02:09 +0000
committerrfeng <rfeng@13f79535-47bb-0310-9956-ffa450edef68>2009-07-01 20:02:09 +0000
commit8cf421f79b81434596fad9e698bdeb44384cd242 (patch)
treee8f529dc5dfdc343a95cd3b062e3abf577d37a72 /java/sca/modules/node-launcher-equinox
parent9b1dc77f9c79d4782425edf449565d088861ea70 (diff)
Use system property to check if the launcher is running under maven surefire test
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@790349 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to '')
-rw-r--r--java/sca/modules/node-launcher-equinox/pom.xml7
-rw-r--r--java/sca/modules/node-launcher-equinox/src/main/java/org/apache/tuscany/sca/node/equinox/launcher/NodeLauncherUtil.java16
2 files changed, 16 insertions, 7 deletions
diff --git a/java/sca/modules/node-launcher-equinox/pom.xml b/java/sca/modules/node-launcher-equinox/pom.xml
index 77e7f932ed..45d6ecc970 100644
--- a/java/sca/modules/node-launcher-equinox/pom.xml
+++ b/java/sca/modules/node-launcher-equinox/pom.xml
@@ -78,7 +78,12 @@
<version>2.0-SNAPSHOT</version>
<scope>test</scope>
</dependency>
-
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-node-impl</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ <scope>test</scope>
+ </dependency>
<dependency>
<groupId>org.apache.tuscany.sca</groupId>
<artifactId>tuscany-extensibility-equinox</artifactId>
diff --git a/java/sca/modules/node-launcher-equinox/src/main/java/org/apache/tuscany/sca/node/equinox/launcher/NodeLauncherUtil.java b/java/sca/modules/node-launcher-equinox/src/main/java/org/apache/tuscany/sca/node/equinox/launcher/NodeLauncherUtil.java
index 35dcd9bd5f..e795723b38 100644
--- a/java/sca/modules/node-launcher-equinox/src/main/java/org/apache/tuscany/sca/node/equinox/launcher/NodeLauncherUtil.java
+++ b/java/sca/modules/node-launcher-equinox/src/main/java/org/apache/tuscany/sca/node/equinox/launcher/NodeLauncherUtil.java
@@ -767,8 +767,8 @@ final class NodeLauncherUtil {
count++;
}
}
- if (count != 0) {
- logger.info("Runtime classpath: " + count
+ if (count != 0 && logger.isLoggable(Level.FINE)) {
+ logger.fine("Runtime classpath: " + count
+ " classes folder"
+ (count > 1 ? "s" : "")
+ " from "
@@ -816,6 +816,11 @@ final class NodeLauncherUtil {
}
}
+ private static boolean isMavenTestMode() {
+ return getProperty("surefire.test.class.path") != null || getProperty("surefire.real.class.path") != null
+ || getProperty("localRepository") != null;
+ }
+
/**
* Determine the Tuscany runtime classpath entries.
*
@@ -873,8 +878,7 @@ final class NodeLauncherUtil {
// Development mode, we're running off classes in a workspace
// and not from Maven surefire, collect all bundles in the workspace
if (useModulesDirectory) {
- ClassLoader cl = NodeLauncherUtil.class.getClassLoader();
- if (!cl.getClass().getName().startsWith("org.apache.maven.surefire")) {
+ if (!isMavenTestMode()) {
File file = new File(uri);
if (file.exists()) {
File moduleDirectory = file.getParentFile().getParentFile();
@@ -982,8 +986,8 @@ final class NodeLauncherUtil {
}
count = urls.size() - count;
- if (count != 0) {
- logger.info("Runtime classpath: " + count
+ if (count != 0 && logger.isLoggable(Level.FINE)) {
+ logger.fine("Runtime classpath: " + count
+ " JAR"
+ (count > 1 ? "s" : "")
+ " from application classpath.");