Package org.rioproject.impl.system.measurable

Examples of org.rioproject.impl.system.measurable.SimpleThresholdListener


    @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();
        if(!System.getProperty("os.name").startsWith("Windows")) {
            double utilization = diskSpace.getUtilization();
            Assert.assertTrue("Utilization should be > 0", utilization>0);
        }
        Assert.assertTrue(l.getType()==null);
    }
View Full Code Here


    @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();
        if(!System.getProperty("os.name").startsWith("Windows")) {
            double utilization = diskSpace.getUtilization();
            Assert.assertTrue("Utilization should be > 0", utilization>0);
        }
        Assert.assertTrue(l.getType()==null);
    }
View Full Code Here

    }

    @Test
    public void createAndVerifyMemoryClass() {
        Memory mem = new Memory(EmptyConfiguration.INSTANCE);
        SimpleThresholdListener l = new SimpleThresholdListener();
        mem.start();
        mem.checkValue();
        double utilization = mem.getUtilization();
        Assert.assertTrue("Utilization should be > 0", utilization>0);
        Assert.assertTrue(l.getType()== null);
    }
View Full Code Here

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

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

    @Test
    public void createAndVerifyMemoryClass() {
        String poolName = "Perm Gen";
        MemoryPool mem = new MemoryPool(poolName, EmptyConfiguration.INSTANCE, new ThresholdValues(0.0, 0.80));
        SimpleThresholdListener l = new SimpleThresholdListener();
        mem.start();
        mem.checkValue();
        double utilization = mem.getUtilization();
        Assert.assertTrue("Utilization should be > 0, got: " + utilization, utilization > 0);
        Assert.assertTrue(l.getType()== null);
    }
View Full Code Here

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

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

TOP

Related Classes of org.rioproject.impl.system.measurable.SimpleThresholdListener

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.