diff options
author | rfeng <rfeng@13f79535-47bb-0310-9956-ffa450edef68> | 2009-07-01 20:02:09 +0000 |
---|---|---|
committer | rfeng <rfeng@13f79535-47bb-0310-9956-ffa450edef68> | 2009-07-01 20:02:09 +0000 |
commit | 8cf421f79b81434596fad9e698bdeb44384cd242 (patch) | |
tree | e8f529dc5dfdc343a95cd3b062e3abf577d37a72 /java/sca/modules/node-launcher-equinox/src | |
parent | 9b1dc77f9c79d4782425edf449565d088861ea70 (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 'java/sca/modules/node-launcher-equinox/src')
-rw-r--r-- | java/sca/modules/node-launcher-equinox/src/main/java/org/apache/tuscany/sca/node/equinox/launcher/NodeLauncherUtil.java | 16 |
1 files changed, 10 insertions, 6 deletions
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."); |