diff options
Diffstat (limited to '')
3 files changed, 17 insertions, 8 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."); diff --git a/java/sca/modules/node-launcher/src/main/java/org/apache/tuscany/sca/node/launcher/NodeLauncherUtil.java b/java/sca/modules/node-launcher/src/main/java/org/apache/tuscany/sca/node/launcher/NodeLauncherUtil.java index d616cb4f5c..38dea77eda 100644 --- a/java/sca/modules/node-launcher/src/main/java/org/apache/tuscany/sca/node/launcher/NodeLauncherUtil.java +++ b/java/sca/modules/node-launcher/src/main/java/org/apache/tuscany/sca/node/launcher/NodeLauncherUtil.java @@ -236,7 +236,7 @@ final class NodeLauncherUtil { count++; } } - if (count != 0) { + if (count != 0 && logger.isLoggable(Level.FINE)) { logger.fine("Runtime classpath: "+ count + " JAR" + (count > 1? "s":"")+ " from " + directory.toString()); } } |