Examples of StaticServiceRegistryEntry


Examples of org.impalaframework.service.reference.StaticServiceRegistryEntry

        verify(serviceActivityNotifiable);
    }

    public void testHandleServiceWithCorrectTypes() {
       
        BasicServiceRegistryEntry ref = new StaticServiceRegistryEntry("service", "beanName", "module", null, Collections.singletonMap("name", "somevalue"), ClassUtils.getDefaultClassLoader());
       
        expect(serviceActivityNotifiable.getServiceReferenceFilter()).andReturn(new LdapServiceReferenceFilter("(name=*)"));
        expect(serviceActivityNotifiable.getProxyTypes()).andReturn(new Class<?>[] {String.class});
        expect(serviceActivityNotifiable.getExportTypes()).andReturn(null);
       
View Full Code Here

Examples of org.impalaframework.service.reference.StaticServiceRegistryEntry

        verify(serviceActivityNotifiable);
    }

    public void testTypeNotMatches() {
       
        BasicServiceRegistryEntry ref = new StaticServiceRegistryEntry("service", "beanName", "module", null, Collections.singletonMap("name", "somevalue"), ClassUtils.getDefaultClassLoader());
       
        expect(serviceActivityNotifiable.getServiceReferenceFilter()).andReturn(new LdapServiceReferenceFilter("(name=*)"));
        expect(serviceActivityNotifiable.getProxyTypes()).andReturn(new Class<?>[] {Integer.class});
        expect(serviceActivityNotifiable.getExportTypes()).andReturn(null);
        //no call to add
View Full Code Here

Examples of org.impalaframework.service.reference.StaticServiceRegistryEntry

        verify(serviceActivityNotifiable);
    }
   
    public void testWithExportTypesNotMatches() {
       
        BasicServiceRegistryEntry ref = new StaticServiceRegistryEntry("service", "beanName", "module", null, Collections.singletonMap("name", "somevalue"), ClassUtils.getDefaultClassLoader());
       
        expect(serviceActivityNotifiable.getServiceReferenceFilter()).andReturn(new LdapServiceReferenceFilter("(name=*)"));
        Class<?>[] exportTypes = new Class<?>[] {Integer.class};
        expect(serviceActivityNotifiable.getExportTypes()).andReturn(exportTypes);
        expect(serviceRegistry.isPresentInExportTypes(ref, exportTypes)).andReturn(false);
View Full Code Here

Examples of org.impalaframework.service.reference.StaticServiceRegistryEntry

        verify(serviceRegistry);
    }
   
    public void testWithExportTypesMatches() {
       
        BasicServiceRegistryEntry ref = new StaticServiceRegistryEntry("service", "beanName", "module", null, Collections.singletonMap("name", "somevalue"), ClassUtils.getDefaultClassLoader());
       
        expect(serviceActivityNotifiable.getServiceReferenceFilter()).andReturn(new LdapServiceReferenceFilter("(name=*)"));
        Class<?>[] exportTypes = new Class<?>[] {Integer.class};
        expect(serviceActivityNotifiable.getExportTypes()).andReturn(exportTypes);
        expect(serviceRegistry.isPresentInExportTypes(ref, exportTypes)).andReturn(true);
View Full Code Here

Examples of org.impalaframework.service.reference.StaticServiceRegistryEntry

        verify(serviceRegistry);
    }

    public void testHandleServiceNotMatches() {
       
        BasicServiceRegistryEntry ref = new StaticServiceRegistryEntry("service", "beanName", "module", null, Collections.singletonMap("name", "somevalue"), ClassUtils.getDefaultClassLoader());
       
        expect(serviceActivityNotifiable.getServiceReferenceFilter()).andReturn(new LdapServiceReferenceFilter("(missing=*)"));
        expect(serviceActivityNotifiable.getProxyTypes()).andReturn(null);
        expect(serviceActivityNotifiable.getExportTypes()).andReturn(null);
       
View Full Code Here

Examples of org.impalaframework.service.reference.StaticServiceRegistryEntry

        };
    }

    public void testAddRemove() throws Exception {

        BasicServiceRegistryEntry ref1 = new StaticServiceRegistryEntry("service1", "beanName1", "module", null, Collections.singletonMap("mapkey", "bean1"), ClassUtils.getDefaultClassLoader());
        BasicServiceRegistryEntry ref2 = new StaticServiceRegistryEntry("service2", "beanName2", "module", null, Collections.singletonMap("mapkey", "bean2"), ClassUtils.getDefaultClassLoader());
        assertTrue(map.add(ref1));
        assertTrue(map.add(ref2));

        assertTrue(map.add(ref1));
        assertTrue(map.add(ref2));
       
        assertEquals(2, map.size());
       
        assertEquals("service1", map.get("bean1"));
        assertEquals("service2", map.get("bean2"));
       
        BasicServiceRegistryEntry refWithNoMapKey = new StaticServiceRegistryEntry("service2", "beanName2", "module", null, null, ClassUtils.getDefaultClassLoader());

        assertFalse(map.add(refWithNoMapKey));
        assertEquals(2, map.size());
       
        assertTrue(map.remove(ref1));
View Full Code Here

Examples of org.impalaframework.service.reference.StaticServiceRegistryEntry

        };
    }

    public void testAddRemove() throws Exception {

        BasicServiceRegistryEntry ref1 = new StaticServiceRegistryEntry("service1", "beanName1", "module", null, Collections.singletonMap("service.ranking", 0), ClassUtils.getDefaultClassLoader());
        BasicServiceRegistryEntry ref2 = new StaticServiceRegistryEntry("service2", "beanName2", "module", null, Collections.singletonMap("service.ranking", 100), ClassUtils.getDefaultClassLoader());
        list.add(ref1);
        assertTrue(list.add(ref2));
       
        //service2 has higher service ranking
        assertEquals("service2", list.get(0));
View Full Code Here

Examples of org.impalaframework.service.reference.StaticServiceRegistryEntry

        };
    }

    public void testAddRemove() throws Exception {

        BasicServiceRegistryEntry ref1 = new StaticServiceRegistryEntry("service1", "beanName1", "module", null, Collections.singletonMap("service.ranking", 0), ClassUtils.getDefaultClassLoader());
        BasicServiceRegistryEntry ref2 = new StaticServiceRegistryEntry("service2", "beanName2", "module", null, Collections.singletonMap("service.ranking", 100), ClassUtils.getDefaultClassLoader());
        set.add(ref1);
        assertTrue(set.add(ref2));
       
        //service2 has higher service ranking
        assertEquals("service1", set.iterator().next());
View Full Code Here

Examples of org.impalaframework.service.reference.StaticServiceRegistryEntry

import org.springframework.util.ClassUtils;

public class StaticServiceRegistryTargetSourceTest extends TestCase {

    public void testWithBean() throws Exception {
        final BasicServiceRegistryEntry reference = new StaticServiceRegistryEntry("bean", "beanName", "moduleName", ClassUtils.getDefaultClassLoader());
        doTest(reference);
    }
View Full Code Here

Examples of org.impalaframework.service.reference.StaticServiceRegistryEntry

    }
   
    public void testWithFactoryBean() throws Exception {
        final StringFactoryBean bean = new StringFactoryBean();
        bean.setValue("bean");
        final BasicServiceRegistryEntry reference = new StaticServiceRegistryEntry(bean, "beanName", "moduleName", ClassUtils.getDefaultClassLoader());
        doTest(reference);
    }
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.