Package org.osgi.service.cm

Examples of org.osgi.service.cm.ConfigurationAdmin.listConfigurations()


        c2.delete();
        EasyMock.expectLastCall().once();
        EasyMock.replay(c2);

        EasyMock.reset(cm);
        EasyMock.expect(cm.listConfigurations("(service.pid=org.apache.karaf.service.acl.command.test123.*)")).
                andReturn(new Configuration[] {c1, c2}).once();
        EasyMock.replay(cm);

        scct.configurationEvent(event);

View Full Code Here


    @Test
    public void testConfigurationEventDeletedNonScope() throws Exception {
        String testPid = SecuredCommandConfigTransformer.PROXY_COMMAND_ACL_PID_PREFIX + "abc.def";

        ConfigurationAdmin cm = EasyMock.createMock(ConfigurationAdmin.class);
        EasyMock.expect(cm.listConfigurations(EasyMock.isA(String.class))).andReturn(null).anyTimes();
        EasyMock.replay(cm);

        SecuredCommandConfigTransformer scct = new SecuredCommandConfigTransformer();
        scct.setConfigAdmin(cm);
        scct.init();
View Full Code Here

    @Test
    public void testConfigurationLocationChangedEventNoEffect() throws Exception {
        String testPid = SecuredCommandConfigTransformer.PROXY_COMMAND_ACL_PID_PREFIX + "test123";

        ConfigurationAdmin cm = EasyMock.createMock(ConfigurationAdmin.class);
        EasyMock.expect(cm.listConfigurations(EasyMock.isA(String.class))).andReturn(null).anyTimes();
        EasyMock.replay(cm);

        SecuredCommandConfigTransformer scct = new SecuredCommandConfigTransformer();
        scct.setConfigAdmin(cm);
        scct.init();
View Full Code Here

        Dictionary<String, Object> conf4 = new Hashtable<String, Object>();
        conf4.put("zar", "visitor");
        conf4.put(Constants.SERVICE_PID, "jmx.acl");

        ConfigurationAdmin ca = getMockConfigAdmin2(conf1, conf2, conf3, conf4);
        assertEquals("Precondition", 4, ca.listConfigurations("(service.pid=jmx.acl*)").length);

        KarafMBeanServerGuard guard = new KarafMBeanServerGuard();
        guard.setConfigAdmin(ca);

        ObjectName on = ObjectName.getInstance("foo.bar:type=Test");
View Full Code Here

        ConfigurationAdmin ca = EasyMock.createMock(ConfigurationAdmin.class);
        for (Configuration c : allConfigs) {
            EasyMock.expect(ca.getConfiguration(c.getPid(), null)).andReturn(c).anyTimes();
        }
        EasyMock.expect(ca.listConfigurations(EasyMock.eq("(service.pid=jmx.acl*)"))).andReturn(
                allConfigs.toArray(new Configuration[]{})).anyTimes();
        EasyMock.expect(ca.listConfigurations(EasyMock.eq("(service.pid=jmx.acl.whitelist)"))).andReturn(
                allConfigs.toArray(new Configuration[]{})).anyTimes();
        EasyMock.replay(ca);
        return ca;
View Full Code Here

        for (Configuration c : allConfigs) {
            EasyMock.expect(ca.getConfiguration(c.getPid(), null)).andReturn(c).anyTimes();
        }
        EasyMock.expect(ca.listConfigurations(EasyMock.eq("(service.pid=jmx.acl*)"))).andReturn(
                allConfigs.toArray(new Configuration[]{})).anyTimes();
        EasyMock.expect(ca.listConfigurations(EasyMock.eq("(service.pid=jmx.acl.whitelist)"))).andReturn(
                allConfigs.toArray(new Configuration[]{})).anyTimes();
        EasyMock.replay(ca);
        return ca;
    }

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.