(SIGAR-213) remove junit.jar from distribution

This commit is contained in:
Doug MacEachern committed 2010-04-07 21:23:56 -07:00
1 parent 7f4a3a3fd4
commit cd422901c9
5 files changed
+16 -10

No files matched your search

+6 -1
View File
@@ -56,6 +56,7 @@
<path id="alljars">
<path refid="libjars"/>
<fileset dir="${sigar-bin}/lib" includes="${sigar.jar}"/>
<fileset dir="${env.ANT_HOME}/lib" includes="junit*.jar"/>
</path>
<target name="javadoc_check">
@@ -91,14 +92,19 @@
<target name="compile">
<mkdir dir="${build}/classes"/>
<available classname="junit.framework.TestCase" property="junit.present">
<classpath refid="alljars"/>
</available>
<javac destdir="${build}/classes"
source="1.4" target="1.4"
sourcepath=""
debug="true"
classpathref="libjars">
<src path="${src}"/>
<src path="${build}/src"/>
<src path="${jni.src.java}"/>
<include name="**/*.java"/>
<exclude name="**/test/*.java" unless="junit.present"/>
</javac>
</target>
@@ -411,7 +417,6 @@
<include name="lib/*.lib"/>
</fileset>
<fileset dir=".">
<include name="lib/junit.jar"/>
<include name="lib/log4j.jar"/>
</fileset>
</copy>
Binary file not shown.
Binary file not shown.
@@ -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;
/**
@@ -111,8 +109,15 @@ 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) { }
}
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[])
@@ -196,7 +201,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();
}