Package org.impalaframework.service.reference

Examples of org.impalaframework.service.reference.StaticServiceRegistryEntry


   
    public void testNoMapKey() throws Exception {
        LdapServiceReferenceFilter filter = new LdapServiceReferenceFilter("(name=myname)");
        map.setFilter(filter);
       
        ServiceRegistryEntry ref = new StaticServiceRegistryEntry("service", "mybean", "mymodule", ClassUtils.getDefaultClassLoader());
        List<ServiceRegistryEntry> singletonList = Collections.singletonList(ref);
        expect(serviceRegistry.getServices(filter, supportedTypes, false)).andReturn(singletonList);
        expect(serviceRegistry.addEventListener(map)).andReturn(true);
       
        replay(serviceRegistry);
View Full Code Here


        LdapServiceReferenceFilter filter = new LdapServiceReferenceFilter("(name=myname)");
        map.setFilter(filter);
       
        Map<String, String> attributes = new HashMap<String, String>();
        attributes.put("mapkey", "key");
        ServiceRegistryEntry ref = new StaticServiceRegistryEntry(service, "mybean", "mymodule", null, attributes, ClassUtils.getDefaultClassLoader());
        List<ServiceRegistryEntry> singletonList = Collections.singletonList(ref);
        expect(serviceRegistry.getServices(filter, supportedTypes, false)).andReturn(singletonList);
        expect(serviceRegistry.addEventListener(map)).andReturn(true);
       
        replay(serviceRegistry);
View Full Code Here

        map.setFilter(filter);
        map.setProxyTypes(null);
       
        Map<String, String> attributes = new HashMap<String, String>();
        attributes.put("mapkey", "key");
        ServiceRegistryEntry ref = new StaticServiceRegistryEntry(service, "mybean", "mymodule", null, attributes, ClassUtils.getDefaultClassLoader());
        List<ServiceRegistryEntry> singletonList = Collections.singletonList(ref);
        expect(serviceRegistry.getServices(filter, null, false)).andReturn(singletonList);
        expect(serviceRegistry.addEventListener(map)).andReturn(true);
       
        replay(serviceRegistry);
View Full Code Here

        map.setFilter(filter);
        map.setProxyTypes(null);
       
        Map<String, String> attributes = new HashMap<String, String>();
        attributes.put("mapkey", "key");
        ServiceRegistryEntry ref = new StaticServiceRegistryEntry("stringservice", "mybean", "mymodule", null, attributes, ClassUtils.getDefaultClassLoader());
        List<ServiceRegistryEntry> singletonList = Collections.singletonList(ref);
        expect(serviceRegistry.getServices(filter, null, false)).andReturn(singletonList);
       
        replay(serviceRegistry);
       
View Full Code Here

    public void testWithList() throws Exception {

        serviceRegistry = createMock(ServiceRegistry.class);
        set.setServiceRegistry(serviceRegistry);
        List<String> service = new ArrayList<String>();
        ServiceRegistryEntry ref = new StaticServiceRegistryEntry(service, "mybean", "mymodule", ClassUtils.getDefaultClassLoader());
        List<ServiceRegistryEntry> singletonList = Collections.singletonList(ref);
        expect(serviceRegistry.getServices(filter, supportedTypes, false)).andReturn(singletonList);
        expect(serviceRegistry.addEventListener(set)).andReturn(true);
       
        replay(serviceRegistry);
View Full Code Here

    public void testWithList() throws Exception {

        serviceRegistry = createMock(ServiceRegistry.class);
        list.setServiceRegistry(serviceRegistry);
        List<String> service = new ArrayList<String>();
        ServiceRegistryEntry ref = new StaticServiceRegistryEntry(service, "mybean", "mymodule", ClassUtils.getDefaultClassLoader());
        List<ServiceRegistryEntry> singletonList = Collections.singletonList(ref);
        expect(serviceRegistry.getServices(filter, supportedTypes, false)).andReturn(singletonList);
        expect(serviceRegistry.addEventListener(list)).andReturn(true);
       
        replay(serviceRegistry);
View Full Code Here

        filter = new TypeServiceReferenceFilter();
        classLoader = ClassUtils.getDefaultClassLoader();
    }
   
    public void testMatches() {
        assertFalse(filter.matches(new StaticServiceRegistryEntry("value1", "beanName", "moduleName", classLoader)));
       
        filter.setType(String.class);
        assertTrue(filter.matches(new StaticServiceRegistryEntry("value1", "beanName", "moduleName", classLoader)));
        assertFalse(filter.matches(new StaticServiceRegistryEntry(new Integer(1), "beanName", "moduleName", classLoader)));
    }
View Full Code Here

       
        LinkedList<Class<?>> list = new LinkedList<Class<?>>();
        list.add(String.class);
        list.add(Integer.class);
        filter.setTypes(list);
        assertFalse(filter.matches(new StaticServiceRegistryEntry("value1", "beanName", "moduleName", classLoader)));
        assertFalse(filter.matches(new StaticServiceRegistryEntry(new Integer(1), "beanName", "moduleName", classLoader)));
    }
View Full Code Here

       
        LinkedList<Class<?>> list = new LinkedList<Class<?>>();
        list.add(String.class);
        list.add(Integer.class);
        filter.setTypes(list);
        assertTrue(filter.matches(new StaticServiceRegistryEntry("value1", "beanName", "moduleName", classLoader)));
        assertTrue(filter.matches(new StaticServiceRegistryEntry(new Integer(1), "beanName", "moduleName", classLoader)));
    }
View Full Code Here

        list.add(filter1);
        list.add(filter2);
       
        ClassLoader loader = ClassUtils.getDefaultClassLoader();
        composite.setMatchAny(false);
        assertFalse(composite.matches(new StaticServiceRegistryEntry("value1", "beanName", "moduleName", loader)));
         
        composite.setFilters(list);
        assertFalse(composite.matches(new StaticServiceRegistryEntry("value1", "beanName", "moduleName", loader)));
        assertFalse(composite.matches(new StaticServiceRegistryEntry(new Integer(1), "beanName", "moduleName", loader)));

        composite.setMatchAny(true);
        assertTrue(composite.matches(new StaticServiceRegistryEntry("value1", "beanName", "moduleName", loader)));
        assertTrue(composite.matches(new StaticServiceRegistryEntry(new Integer(1), "beanName", "moduleName", loader)));
    }
View Full Code Here

TOP

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

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.