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

Examples of org.rioproject.impl.system.measurable.disk.DiskSpace


        Assert.assertTrue(SigarHelper.sigarAvailable());
    }

    @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


        Assert.assertTrue("Utilization should be > 0", utilization>0);
    }

    @Test
    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

        Assert.assertTrue(l.getType()==null);
    }

    @Test
    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

        CPU cpuProc = getCapability(CPU.class, "CPU (Proc)", mCaps);
        Assert.assertNotNull(cpuProc);
        log(cpuProc);

        DiskSpace diskSpace = getCapability(DiskSpace.class, mCaps);
        Assert.assertNotNull(diskSpace);
        log(diskSpace);

    }
View Full Code Here

        MeasurableCapability diskSpace = null;
        try {
            diskSpace = (MeasurableCapability)config.getEntry(COMPONENT,
                                                              "disk",
                                                              MeasurableCapability.class,
                                                              new DiskSpace(config),
                                                              config);
        } catch(ConfigurationException e) {
            logger.warn("Loading DiskSpace MeasurableCapability", e);
        }
        return diskSpace;
View Full Code Here

TOP

Related Classes of org.rioproject.impl.system.measurable.disk.DiskSpace

Copyright © 2018 www.massapicom. 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.