Package org.rioproject.watch

Examples of org.rioproject.watch.ThresholdEvent


         * Argument combinations:
         *   source: valid object, null
         */

        Object obj = new Object();
        ThresholdEvent event = new ThresholdEvent(obj);
        Assert.assertSame(obj, event.getSource());
        Assert.assertSame(null, event.getCalculable());
        Assert.assertSame(null, event.getThresholdValues());
        Assert.assertEquals(null, event.getThresholdType());

        try {
            new ThresholdEvent(null);
            Assert.fail("IllegalArgumentException expected but not thrown");
        } catch (IllegalArgumentException e) {
        }
    }
View Full Code Here


            ThresholdValues tv = (ThresholdValues) combination[2];
            ThresholdType type = (ThresholdType) combination[3];

            if (source == null) {
                try {
                    new ThresholdEvent(source, calculable, tv, type);
                    Assert.fail("IllegalArgumentException expected but not thrown");
                } catch (IllegalArgumentException e) {
                }
            } else {
                ThresholdEvent event = new ThresholdEvent(source, calculable, tv, type);
                Assert.assertSame(source, event.getSource());
                Assert.assertSame(calculable, event.getCalculable());
                Assert.assertSame(tv, event.getThresholdValues());
                Assert.assertEquals(type, event.getThresholdType());
            }
        }
    }
View Full Code Here

     * Tests that <code>ThresholdEvent</code> implements
     * <code>Serializable</code>.
     */
    @Test
    public void testSerializable() {
        ThresholdEvent event = new ThresholdEvent(new Object());
        //noinspection ConstantConditions
        Assert.assertTrue(event instanceof Serializable);
    }
View Full Code Here

         *   Any
         * Argument combinations:
         *   type: BREACHED, CLEARED, 0, 12345
         */

        ThresholdEvent event = new ThresholdEvent(new Object());

        event.setThresholdType(ThresholdType.BREACHED);
        Assert.assertEquals(ThresholdType.BREACHED, event.getThresholdType());

        event.setThresholdType(ThresholdType.CLEARED);
        Assert.assertEquals(ThresholdType.CLEARED, event.getThresholdType());
    }
View Full Code Here

         *   Calculable: original, modified
         * Argument combinations:
         *   N/A
         */

        ThresholdEvent event = new ThresholdEvent(new Object());
        Assert.assertSame(null, event.getCalculable());

        Calculable c = new Calculable();
        event.setCalculable(c);
        Assert.assertSame(c, event.getCalculable());
    }
View Full Code Here

         *   Any
         * Argument combinations:
         *   calculable: valid alculable, null
         */

        ThresholdEvent event = new ThresholdEvent(new Object());

        Calculable c = new Calculable();
        event.setCalculable(c);
        Assert.assertSame(c, event.getCalculable());

        event.setCalculable(null);
        Assert.assertSame(null, event.getCalculable());
    }
View Full Code Here

         *   Threshold values: original, modified
         * Argument combinations:
         *   N/A
         */

        ThresholdEvent event = new ThresholdEvent(new Object());
        Assert.assertSame(null, event.getThresholdValues());

        ThresholdValues thv = new ThresholdValues();
        event.setThresholdValues(thv);
        Assert.assertSame(thv, event.getThresholdValues());
    }
View Full Code Here

         *   Any
         * Argument combinations:
         *   thresholdValues: valid object, null
         */

        ThresholdEvent event = new ThresholdEvent(new Object());

        ThresholdValues thv = new ThresholdValues();
        event.setThresholdValues(thv);
        Assert.assertSame(thv, event.getThresholdValues());

        event.setThresholdValues(null);
        Assert.assertSame(null, event.getThresholdValues());
    }
View Full Code Here

TOP

Related Classes of org.rioproject.watch.ThresholdEvent

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.