Package org.impalaframework.service.reference

Examples of org.impalaframework.service.reference.BasicServiceRegistryEntry


        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


        };
    }

    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

        };
    }

    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

        };
    }

    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

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

    }
   
    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

        super.setUp();
        filter = new LdapServiceReferenceFilter("(name=value)");
    }

    public void testMatchesNoAttributes() {
        BasicServiceRegistryEntry reference = new StaticServiceRegistryEntry("object", "bean", "module", ClassUtils.getDefaultClassLoader());
        assertFalse(filter.matches(reference));
    }
View Full Code Here

    }
   
    public void testMatchesWithEmptyAttributes() {
       
        Map<String,Object> attributes = new HashMap<String, Object>();
        BasicServiceRegistryEntry reference = new StaticServiceRegistryEntry("object", "bean", "module", null, attributes, ClassUtils.getDefaultClassLoader());
        assertFalse(filter.matches(reference));
       
        attributes.put("name","anothervalue");  reference = new StaticServiceRegistryEntry("object", "bean", "module", null, attributes, ClassUtils.getDefaultClassLoader());
        assertFalse(filter.matches(reference));
       
View Full Code Here

                logger.debug("Registering service " + service.getClass().getName() + " with no explicit name or service classes. One of these is recommended");
            }
        }

        //Note: null checks performed by BasicServiceRegistryReference constructor
        BasicServiceRegistryEntry serviceReference = new BasicServiceRegistryEntry(
                beanReference,
                beanName,
                moduleName,
                classes,
                attributes, classLoader);
View Full Code Here

                logger.debug("Registering service " + service.getClass().getName() + " with no explicit name or service classes. One of these is recommended");
            }
        }

        //Note: null checks performed by BasicServiceRegistryReference constructor
        BasicServiceRegistryEntry serviceReference = new BasicServiceRegistryEntry(
                beanReference,
                beanName,
                moduleName,
                classes,
                attributes, classLoader);
View Full Code Here

TOP

Related Classes of org.impalaframework.service.reference.BasicServiceRegistryEntry

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.