Examples of StaticServiceRegistryEntry


Examples of org.impalaframework.service.reference.StaticServiceRegistryEntry

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

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

        serviceRegistry = createMock(ServiceRegistry.class);
    }   
   
    public void testInfrastructure() throws Exception {
        final List<String> list = new ArrayList<String>();
        ServiceRegistryEntry ref = new StaticServiceRegistryEntry(list, "mybean", "mymod", ClassUtils.getDefaultClassLoader());
       
        final ProxyFactory proxyFactory = creator.createProxyFactory(new StaticServiceReferenceProxyFactorySource(classes, ref), null, null);
       
        Object proxy = proxyFactory.getProxy();
        assertTrue(proxy instanceof List);
View Full Code Here

Examples of org.impalaframework.service.reference.StaticServiceRegistryEntry

        assertTrue(wrappedObject instanceof ArrayList);
    }   
   
    public void testInfrastructureClassOnly() throws Exception {
        final List<String> list = new ArrayList<String>();
        ServiceRegistryEntry ref = new StaticServiceRegistryEntry(list, "mybean", "mymod", ClassUtils.getDefaultClassLoader());
       
        final ProxyFactory proxyFactory = creator.createProxyFactory(new StaticServiceReferenceProxyFactorySource(null, ref), null, null);
       
        Object proxy = proxyFactory.getProxy();
        assertTrue(proxy instanceof ArrayList);
View Full Code Here

Examples of org.impalaframework.service.reference.StaticServiceRegistryEntry

    }

    @SuppressWarnings("unchecked")
    public void testDynamicProxyFactory() throws Exception {
        final List<String> list = new ArrayList<String>();
        ServiceRegistryEntry ref = new StaticServiceRegistryEntry(list, "mybean", "mymod", ClassUtils.getDefaultClassLoader());
        expect(serviceRegistry.getService("mykey", classes, false)).andReturn(ref);
       
        replay(serviceRegistry);
        final ProxyFactory proxyFactory = creator.createProxyFactory(new BeanRetrievingProxyFactorySource(serviceRegistry, classes, null, "mykey"), null, null);
       
View Full Code Here

Examples of org.impalaframework.service.reference.StaticServiceRegistryEntry

    public void testDynamicProxyFactoryForClass() throws Exception {
        classes = new Class[]{
                ArrayList.class
                };
        final List<String> list = new ArrayList<String>();
        ServiceRegistryEntry ref = new StaticServiceRegistryEntry(list, "mybean", "mymod", ClassUtils.getDefaultClassLoader());
        expect(serviceRegistry.getService("mykey", classes, false)).andReturn(ref);
       
        replay(serviceRegistry);
        final ProxyFactory proxyFactory = creator.createProxyFactory(new BeanRetrievingProxyFactorySource(serviceRegistry, classes, null, "mykey"), null, null);
       
View Full Code Here

Examples of org.impalaframework.service.reference.StaticServiceRegistryEntry

    }
   
    @SuppressWarnings("unchecked")
    public void testStaticProxyFactory() throws Exception {
        final List<String> list = new ArrayList<String>();
        ServiceRegistryEntry ref = new StaticServiceRegistryEntry(list, "mybean", "mymod", ClassUtils.getDefaultClassLoader());
       
        replay(serviceRegistry);
        final ProxyFactory proxyFactory = creator.createProxyFactory(new StaticServiceReferenceProxyFactorySource(new Class<?>[]{List.class}, ref), null, null);
       
        final List<String> proxy = (List<String>) proxyFactory.getProxy();
View Full Code Here

Examples of org.impalaframework.service.reference.StaticServiceRegistryEntry

    }
   
    @SuppressWarnings("unchecked")
    public void testStaticProxyFactoryWithNoInterfaces() throws Exception {
        final List<String> list = new ArrayList<String>();
        ServiceRegistryEntry ref = new StaticServiceRegistryEntry(list, "mybean", "mymod", ClassUtils.getDefaultClassLoader());
       
        replay(serviceRegistry);
        final ProxyFactory proxyFactory = creator.createProxyFactory(new StaticServiceReferenceProxyFactorySource(null, ref), null, null);
       
        final List<String> proxy = (List<String>) proxyFactory.getProxy();
View Full Code Here

Examples of org.impalaframework.service.reference.StaticServiceRegistryEntry

       
        verify(serviceRegistry);
    }
   
    public void testWithFinalClass() throws Exception {
        ServiceRegistryEntry ref = new StaticServiceRegistryEntry("service", "mybean", "mymod", ClassUtils.getDefaultClassLoader());
       
        replay(serviceRegistry);
        try {
            creator.createProxyFactory(new StaticServiceReferenceProxyFactorySource(null, ref), null, null);
            fail();
View Full Code Here

Examples of org.impalaframework.service.reference.StaticServiceRegistryEntry

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