Package org.rioproject.impl.system.measurable.disk

Examples of org.rioproject.impl.system.measurable.disk.DiskSpace.start()


    }

    @Test
    public void createAndVerifyDiskSpaceClass() {
        DiskSpace diskSpace = new DiskSpace(EmptyConfiguration.INSTANCE);
        diskSpace.start();
        MeasuredResource mRes = diskSpace.getMeasuredResource();
        Assert.assertTrue("MeasuredResource should not be null", mRes!=null);
        Assert.assertTrue("MeasuredResource should be a DiskSpaceUtilization", mRes instanceof DiskSpaceUtilization);
        double utilization = diskSpace.getUtilization();
        Assert.assertTrue("Utilization should be > 0", utilization>0);
View Full Code Here


    public void createAndVerifyDiskSpaceWithLowerThresholdBeingCrossed() {
        DiskSpace diskSpace = new DiskSpace(EmptyConfiguration.INSTANCE);
        ThresholdValues tVals = new ThresholdValues(0.30, 0.90);
        diskSpace.setThresholdValues(tVals);
        SimpleThresholdListener l = new SimpleThresholdListener();
        diskSpace.start();
        double utilization = diskSpace.getUtilization();
        Assert.assertTrue("Utilization should be > 0", utilization>0);
        Assert.assertTrue(l.getType()==null);
    }
View Full Code Here

    public void createAndVerifyDiskSpaceWithUpperThresholdBeingCrossed() {
        DiskSpace diskSpace = new DiskSpace(EmptyConfiguration.INSTANCE);
        ThresholdValues tVals = new ThresholdValues(0.00, 0.05);
        diskSpace.setThresholdValues(tVals);
        SimpleThresholdListener l = new SimpleThresholdListener();
        diskSpace.start();
        double utilization = diskSpace.getUtilization();
        Assert.assertTrue("Utilization should be > 0", utilization>0);
        Assert.assertTrue(l.getType()==null);
    }
       
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.