Examples of BasicServiceRegistryEntry


Examples of org.impalaframework.service.reference.BasicServiceRegistryEntry

    public void testNoAttributes() throws Exception {
       
        final List<ServiceRegistryEntry> emptyList = new ArrayList<ServiceRegistryEntry>();
        final HashMap<String,?> attributes = new HashMap<String,Object>();
       
        final BasicServiceRegistryEntry ref1 = new StaticServiceRegistryEntry("bean1", "name1", "module", null, attributes, ClassUtils.getDefaultClassLoader());
        final BasicServiceRegistryEntry ref2 = new StaticServiceRegistryEntry("bean2", "name2", "module", null, attributes, ClassUtils.getDefaultClassLoader());
       
        emptyList.add(ref1);
        emptyList.add(ref2);
        expect(serviceRegistry.getServices(filter, null, false)).andReturn(emptyList);
       
View Full Code Here

Examples of org.impalaframework.service.reference.BasicServiceRegistryEntry

    public void testWrongType() throws Exception {
       
        final List<ServiceRegistryEntry> emptyList = new ArrayList<ServiceRegistryEntry>();
        final HashMap<String,?> attributes = new HashMap<String,Object>();
       
        final BasicServiceRegistryEntry ref1 = new StaticServiceRegistryEntry(new Integer(1), "name1", "module", null, attributes, ClassUtils.getDefaultClassLoader());
       
        emptyList.add(ref1);
        expect(serviceRegistry.getServices(filter, null, false)).andReturn(emptyList);
       
        replay(serviceRegistry);
View Full Code Here

Examples of org.impalaframework.service.reference.BasicServiceRegistryEntry

        if (classes.isEmpty() && beanName == null) {
            logger.warn("Registering service 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

Examples of org.impalaframework.service.reference.BasicServiceRegistryEntry

        if (classes.isEmpty() && beanName == null) {
            logger.warn("Registering service 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

Examples of org.impalaframework.service.reference.BasicServiceRegistryEntry

        monitor.setServiceRegistry(serviceRegistry);
    }

    public void testHandleServiceNoTypes() {
       
        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(null);
        expect(serviceActivityNotifiable.getExportTypes()).andReturn(null);
       
View Full Code Here

Examples of org.impalaframework.service.reference.BasicServiceRegistryEntry

        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.BasicServiceRegistryEntry

        verify(serviceActivityNotifiable);
    }
   
    public void testNonStaticRegistryEntry() {
       
        BasicServiceRegistryEntry ref = new BasicServiceRegistryEntry(new ServiceBeanReference(){

            public Object getService() {
                return "service";
            }
View Full Code Here

Examples of org.impalaframework.service.reference.BasicServiceRegistryEntry

        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.BasicServiceRegistryEntry

        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.BasicServiceRegistryEntry

        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
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.