Package org.osgi.service.monitor

Examples of org.osgi.service.monitor.MonitorAdmin.switchEvents()


        monitorAdmin.switchEvents("*/sv.id1", false);
        paths = common.getDisabledNotificationPaths();
        Assert.assertEquals(1, paths.length);
        Assert.assertEquals("com.acme.pid/sv.id1", paths[0]);

        monitorAdmin.switchEvents("*/*", true);
        paths = common.getDisabledNotificationPaths();
        Assert.assertEquals(0, paths.length);
    }

    @Test
View Full Code Here


        Assert.assertEquals("com.acme.pid", events[0].getProperty(ConstantsMonitorAdmin.MON_MONITORABLE_PID));
        Assert.assertEquals("sv.id1", events[0].getProperty(ConstantsMonitorAdmin.MON_STATUSVARIABLE_NAME));
        Assert.assertEquals("15", events[0].getProperty(ConstantsMonitorAdmin.MON_STATUSVARIABLE_VALUE));
        Assert.assertNull(events[0].getProperty(ConstantsMonitorAdmin.MON_LISTENER_ID));

        monitorAdmin.switchEvents("com.acme.pid/sv.id1", false);
        osgiVisitor.cleanPostedEvents();

        monitorable.setNewStatusVariableValue("sv.id1", "25");
        events = osgiVisitor.getPostedEvents();
        Assert.assertEquals(0, events.length);
View Full Code Here

        monitorable.setNewStatusVariableValue("sv.id1", "25");
        events = osgiVisitor.getPostedEvents();
        Assert.assertEquals(0, events.length);

        monitorAdmin.switchEvents("com.acme.pid/sv.id1", true);
        monitorable.setNewStatusVariableValue("sv.id1", "25");
        events = osgiVisitor.getPostedEvents();
        Assert.assertEquals(1, events.length);
        Assert.assertEquals(ConstantsMonitorAdmin.TOPIC, events[0].getTopic());
        Assert.assertEquals("com.acme.pid", events[0].getProperty(ConstantsMonitorAdmin.MON_MONITORABLE_PID));
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.