Package org.apache.tapestry.services

Examples of org.apache.tapestry.services.ClassFinder


        MockControl namespacec = newControl(INamespace.class);
        INamespace namespace = (INamespace) namespacec.getMock();

        trainGetPackages(namespacec, namespace, "org.foo");
        ClassFinder finder = newClassFinder("org.foo", "folder.MyComponent", BaseComponent.class);

        trainGetResource(namespacec, namespace, namespaceResource);

        replayControls();
View Full Code Here


    public void testResolveClassFailure()
    {
        ClassResolver resolver = newResolver();
        IPage page = newPage();
        IComponent component = newComponent();
        ClassFinder finder = newClassFinder();

        trainForConstructor(page, component, resolver, finder);

        replayControls();
View Full Code Here

    public void testInstantiateBeanFailure()
    {
        ClassResolver resolver = newResolver();
        IPage page = newPage();
        IComponent component = newComponent();
        ClassFinder finder = newClassFinder();

        trainForConstructor(page, component, resolver, finder);

        replayControls();
View Full Code Here

    public void testInitializeFailure()
    {
        ClassResolver resolver = new DefaultClassResolver();
        IPage page = newPage();
        IComponent component = newComponent();
        ClassFinder finder = newClassFinder();

        trainForConstructor(page, component, resolver, finder);

        replayControls();
View Full Code Here

       
        expect(delegate.findComponentSpecification(cycle, namespace, "FrameworkComponent")).andReturn(null);
       
        trainGetPackages(namespace, "org.foo");
       
        ClassFinder finder = newClassFinder("org.foo", "FrameworkComponent", null);
       
        ISpecificationSource source = newSource(framework);

        expect(framework.containsComponentType("FrameworkComponent")).andReturn(true);
View Full Code Here

        .andReturn(packages);
    }

    private ClassFinder newClassFinder(String packages, String className, Class result)
    {
        ClassFinder finder = newMock(ClassFinder.class);

        expect(finder.findClass(packages, className)).andReturn(result);

        return finder;
    }
View Full Code Here

        ISpecificationSource source = newSource(framework);

        expect(framework.containsComponentType("NotFoundComponent")).andReturn(false);

        ClassFinder finder = newClassFinder("org.foo", "NotFoundComponent", null);
        trainGetPackages(namespace, "org.foo");

        replay();

        ComponentSpecificationResolverImpl resolver = new ComponentSpecificationResolverImpl();
View Full Code Here

    public void testFoundComponentClass()
    {  
        INamespace namespace = newMock(INamespace.class);

        trainGetPackages(namespace, "org.foo");
        ClassFinder finder = newClassFinder("org.foo", "folder.MyComponent", BaseComponent.class);

        Resource componentResource = newResource();
        Resource namespaceResource = newResource("folder/MyComponent.jwc", componentResource);
       
        trainGetResource(namespace, namespaceResource);
View Full Code Here

    }

    private ClassFinder newClassFinder(String packages, String className, Class result)
    {
        MockControl control = newControl(ClassFinder.class);
        ClassFinder finder = (ClassFinder) control.getMock();

        finder.findClass(packages, className);
        control.setReturnValue(result);

        return finder;
    }
View Full Code Here

        ISpecificationSource source = newSource(framework);

        framework.containsComponentType("NotFoundComponent");
        frameworkc.setReturnValue(false);

        ClassFinder finder = newClassFinder("org.foo", "NotFoundComponent", null);
        trainGetPackages(namespacec, namespace, "org.foo");

        replayControls();

        ComponentSpecificationResolverImpl resolver = new ComponentSpecificationResolverImpl();
View Full Code Here

TOP

Related Classes of org.apache.tapestry.services.ClassFinder

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.