use sigar.jar as a file to test with

This commit is contained in:
Doug MacEachern 2004-07-01 01:03:04 +00:00
parent a2c655476c
commit 5df1139c53
1 changed files with 7 additions and 4 deletions

View File

@ -4,6 +4,7 @@ import java.io.File;
import java.io.FileInputStream; import java.io.FileInputStream;
import net.hyperic.sigar.Sigar; import net.hyperic.sigar.Sigar;
import net.hyperic.sigar.SigarLoader;
import net.hyperic.sigar.SigarNotImplementedException; import net.hyperic.sigar.SigarNotImplementedException;
public class TestProcFd extends SigarTestCase { public class TestProcFd extends SigarTestCase {
@ -21,11 +22,13 @@ public class TestProcFd extends SigarTestCase {
long pid = sigar.getPid(); long pid = sigar.getPid();
long total = sigar.getProcFd(pid).getTotal(); long total = sigar.getProcFd(pid).getTotal();
String sigarJar =
new SigarLoader(Sigar.class).findJarPath("sigar.jar");
File file = new File(sigarJar + File.separator + "sigar.jar");
traceln("Opening " + file);
File file = new File("bin", "run_tests.sh");
if (!file.exists()) {
file = new File("build.xml");
}
FileInputStream is = new FileInputStream(file); FileInputStream is = new FileInputStream(file);
assertEqualsTrace("Total", total + 1, assertEqualsTrace("Total", total + 1,