Examples of StaticServiceRegistryEntry


Examples of org.impalaframework.service.reference.StaticServiceRegistryEntry

       
        List<Class<?>> toCheck = new ArrayList<Class<?>>();
        toCheck.add(String.class);
        toCheck.add(Object.class);
       
        entryDelegate.checkClasses(new StaticServiceRegistryEntry("service", "bean", "module", toCheck, null, classLoader));
       
        try {
            //now create CustomClassLoader
            final URLClassLoader exceptionClassLoader = new URLClassLoader(new URL[0]){

                @Override
                protected synchronized Class<?> loadClass(String arg0, boolean arg1)
                        throws ClassNotFoundException {
                    throw new ClassNotFoundException();
                }
            };
           
            entryDelegate.checkClasses(new StaticServiceRegistryEntry("service", "bean", "module", toCheck, null, exceptionClassLoader));
            fail();
        } catch (InvalidStateException e) {
            System.out.println(e.getMessage());
            assertTrue(e.getMessage().startsWith("Class entry 'java.lang.String' contributed from module 'module' with bean name 'bean' could not be found using class loader"));
        }
View Full Code Here

Examples of org.impalaframework.service.reference.StaticServiceRegistryEntry

        List<Class<?>> toCheck = new ArrayList<Class<?>>();
        toCheck.add(String.class);
        toCheck.add(Object.class);
       
        try {
            entryDelegate.checkClasses(new StaticServiceRegistryEntry(new Integer(1), "bean", "module", toCheck, null, classLoader));
            fail();
        } catch (InvalidStateException e) {
            System.out.println(e.getMessage());
            assertTrue(e.getMessage().startsWith("Service class 'java.lang.Integer contributed from module 'module' with bean name 'bean' is not assignable declared export type java.lang.String"));
        }
View Full Code Here

Examples of org.impalaframework.service.reference.StaticServiceRegistryEntry

       
        List<Class<?>> toCheck = new ArrayList<Class<?>>();
        toCheck.add(String.class);
        toCheck.add(Object.class);
       
        entryDelegate.checkClasses(new StaticServiceRegistryEntry(service.getObject(), "bean", "module", toCheck, null, classLoader));
    }
View Full Code Here

Examples of org.impalaframework.service.reference.StaticServiceRegistryEntry

        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

Examples of org.impalaframework.service.reference.StaticServiceRegistryEntry

    }
   
    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));
       
        attributes.put("name","value"); reference = new StaticServiceRegistryEntry("object", "bean", "module", null, attributes, ClassUtils.getDefaultClassLoader());
        assertTrue(filter.matches(reference));
    }
View Full Code Here

Examples of org.impalaframework.service.reference.StaticServiceRegistryEntry

        final ClassWithNoInterface instance = new ClassWithNoInterface();
        assertSame(instance, proxyHelper.maybeGetProxy(ref(instance)));
    }
   
    private ServiceRegistryEntry ref(Object o) {
        return new StaticServiceRegistryEntry(o,"beanName","moduleName",ClassUtils.getDefaultClassLoader());
    }
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.