Package org.apache.karaf.service.guard.impl.GuardProxyCatalog

Examples of org.apache.karaf.service.guard.impl.GuardProxyCatalog.ServiceRegistrationHolder


        EasyMock.expect(proxyReg.getReference()).andReturn((ServiceReference)
                mockServiceReference(props)).anyTimes();
        proxyReg.unregister();
        EasyMock.expectLastCall().once();
        EasyMock.replay(proxyReg);
        ServiceRegistrationHolder srh = new GuardProxyCatalog.ServiceRegistrationHolder();
        srh.registration = proxyReg;

        ServiceRegistration<?> proxy2Reg = EasyMock.createMock(ServiceRegistration.class);
        EasyMock.replay(proxy2Reg);
        ServiceRegistrationHolder srh2 = new GuardProxyCatalog.ServiceRegistrationHolder();
        srh2.registration = proxy2Reg;

        gpc.proxyMap.put(originalServiceID, srh);
        gpc.proxyMap.put(anotherServiceID, srh2);
        assertEquals("Precondition", 2, gpc.proxyMap.size());
View Full Code Here


        gpc.proxyIfNotAlreadyProxied(sr);
        GuardProxyCatalog.CreateProxyRunnable runnable = gpc.createProxyQueue.take();
        runnable.run(getProxyManager());

        ServiceRegistrationHolder holder = gpc.proxyMap.get(serviceID);
        ServiceRegistration<?> reg = holder.registration;

        for (String key : serviceProps.keySet()) {
            if (GuardProxyCatalog.SERVICE_GUARD_ROLES_PROPERTY.equals(key)) {
                assertEquals(new HashSet(Arrays.asList("role.1", "role.2")), reg.getReference().getProperty(key));
View Full Code Here

        gpc.proxyIfNotAlreadyProxied(sr);
        GuardProxyCatalog.CreateProxyRunnable runnable = gpc.createProxyQueue.take();
        runnable.run(getProxyManager());

        ServiceRegistrationHolder holder = gpc.proxyMap.get(serviceID);
        ServiceRegistration<?> reg = holder.registration;

        assertFalse("No roles defined for this service using configuration, so roles property should not be set",
                Arrays.asList(reg.getReference().getPropertyKeys()).contains(GuardProxyCatalog.SERVICE_GUARD_ROLES_PROPERTY));
        for (String key : serviceProps.keySet()) {
View Full Code Here

TOP

Related Classes of org.apache.karaf.service.guard.impl.GuardProxyCatalog.ServiceRegistrationHolder

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.