diff --git a/LICENSES b/LICENSES index 1b323187..5c3ccaa6 100644 --- a/LICENSES +++ b/LICENSES @@ -12,10 +12,6 @@ The following components are included without modification: Information: http://logging.apache.org/ License: http://www.apache.org/licenses/LICENSE-2.0 -- junit - -Information: http://www.junit.org/index.htm -License: http://www.opensource.org/licenses/cpl.php - The following components are included with modification: - cpptasks - diff --git a/bindings/java/build.xml b/bindings/java/build.xml index e4727fe6..f422b458 100644 --- a/bindings/java/build.xml +++ b/bindings/java/build.xml @@ -56,6 +56,7 @@ + @@ -91,14 +92,19 @@ + + + + @@ -413,7 +419,6 @@ - diff --git a/bindings/java/lib/ant.jar b/bindings/java/lib/ant.jar deleted file mode 100644 index 1337ad42..00000000 Binary files a/bindings/java/lib/ant.jar and /dev/null differ diff --git a/bindings/java/lib/junit.jar b/bindings/java/lib/junit.jar deleted file mode 100644 index 674d71e8..00000000 Binary files a/bindings/java/lib/junit.jar and /dev/null differ diff --git a/bindings/java/src/org/hyperic/sigar/cmd/Shell.java b/bindings/java/src/org/hyperic/sigar/cmd/Shell.java index 70c0a3ef..25776eb2 100644 --- a/bindings/java/src/org/hyperic/sigar/cmd/Shell.java +++ b/bindings/java/src/org/hyperic/sigar/cmd/Shell.java @@ -20,6 +20,7 @@ package org.hyperic.sigar.cmd; import java.io.IOException; import java.io.File; +import java.lang.reflect.Constructor; import org.hyperic.sigar.Sigar; import org.hyperic.sigar.SigarException; @@ -36,9 +37,6 @@ import org.hyperic.sigar.shell.ShellCommandHandler; import org.hyperic.sigar.shell.ShellCommandInitException; import org.hyperic.sigar.shell.ShellCommandUsageException; -import org.hyperic.sigar.test.SigarTestCase; -import org.hyperic.sigar.test.SigarTestRunner; - import org.hyperic.sigar.util.Getline; /** @@ -112,14 +110,21 @@ public class Shell extends ShellBase { } try { //requires junit.jar - registerCommandHandler("test", new SigarTestRunner(this)); + registerCommandHandler("test", "org.hyperic.sigar.test.SigarTestRunner"); } catch (NoClassDefFoundError e) { } + catch (Exception e) { } try { //requires jre 1.5+ or mx4j registerCommandHandler("mx", new Mx(this)); } catch (NoClassDefFoundError e) { } } + private void registerCommandHandler(String name, String className) throws Exception { + Class cls = Class.forName(className); + Constructor con = cls.getConstructor(new Class[] { this.getClass() }); + registerCommandHandler(name, (ShellCommandHandler)con.newInstance(new Object[] { this })); + } + public void processCommand(ShellCommandHandler handler, String args[]) throws ShellCommandUsageException, ShellCommandExecException { @@ -201,7 +206,7 @@ public class Shell extends ShellBase { this.sigar.close(); //avoid possible Class Not Found: junit/framework/TestCase if (System.getProperty("jni.dmalloc") != null) { - SigarTestCase.closeSigar(); //shutup dmalloc + //org.hyperic.sigar.test.SigarTestCase.closeSigar(); //shutup dmalloc } super.shutdown(); }