Package org.osgi.service.cm

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


    }

    @Test
    public void testConfigurationEventAddedNonCommand() throws Exception {
        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 testConfigurationEventDeleted() 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

        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

        Configuration otherConfig = mockConfiguration(props3);

        final Map<String, Configuration> configurations = new HashMap<String, Configuration>();

        ConfigurationAdmin ca = EasyMock.createMock(ConfigurationAdmin.class);
        EasyMock.expect(ca.listConfigurations(
                "(service.pid=" + SecuredCommandConfigTransformer.PROXY_COMMAND_ACL_PID_PREFIX + "*)")).
                andReturn(new Configuration [] {commandConfig, commandConfig2, otherConfig}).anyTimes();
        EasyMock.expect(ca.getConfiguration(EasyMock.isA(String.class))).andAnswer(new IAnswer<Configuration>() {
            @Override
            public Configuration answer() throws Throwable {
View Full Code Here

        Configuration conf = EasyMock.createMock(Configuration.class);
        EasyMock.expect(conf.getPid()).andReturn(testPid).anyTimes();
        EasyMock.replay(conf);

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

        final List<String> generateCalled = new ArrayList<String>();
        SecuredCommandConfigTransformer scct = new SecuredCommandConfigTransformer() {
View Full Code Here

    }

    @Test
    public void testConfigurationEventAddedNonCommand() throws Exception {
        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 testConfigurationEventDeleted() 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

        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

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.