getFileSystemUsage for all fs types

This commit is contained in:
Doug MacEachern 2004-12-05 22:36:54 +00:00
parent d7adfbd94a
commit 136f564d4b
1 changed files with 4 additions and 4 deletions

View File

@ -31,11 +31,11 @@ public class TestFileSystem extends SigarTestCase {
assertLengthTrace("TypeName", fs.getTypeName()); assertLengthTrace("TypeName", fs.getTypeName());
assertLengthTrace("SysTypeName", fs.getSysTypeName()); assertLengthTrace("SysTypeName", fs.getSysTypeName());
switch (fs.getType()) {
case FileSystem.TYPE_LOCAL_DISK:
FileSystemUsage usage = FileSystemUsage usage =
sigar.getFileSystemUsage(fs.getDirName()); sigar.getFileSystemUsage(fs.getDirName());
switch (fs.getType()) {
case FileSystem.TYPE_LOCAL_DISK:
assertGtZeroTrace(" Total", usage.getTotal()); assertGtZeroTrace(" Total", usage.getTotal());
//possible machines have full filesystems //possible machines have full filesystems
assertGtEqZeroTrace(" Free", usage.getFree()); assertGtEqZeroTrace(" Free", usage.getFree());
@ -43,9 +43,9 @@ public class TestFileSystem extends SigarTestCase {
double usePercent = usage.getUsePercent() * 100; double usePercent = usage.getUsePercent() * 100;
traceln(" Used=" + usePercent + "%"); traceln(" Used=" + usePercent + "%");
assertTrue(usePercent <= 100.0); assertTrue(usePercent <= 100.0);
default:
traceln(" DiskReads=" + usage.getDiskReads()); traceln(" DiskReads=" + usage.getDiskReads());
traceln(" DiskWrites=" + usage.getDiskWrites()); traceln(" DiskWrites=" + usage.getDiskWrites());
break;
} }
} }