Package org.apache.hivemind.lib.impl

Examples of org.apache.hivemind.lib.impl.SpringLookupFactory


        return p;
    }

    public void testDefaultFactory()
    {
        SpringLookupFactory lf = new SpringLookupFactory();

        BeanFactory beanFactory = (BeanFactory) newMock(BeanFactory.class);

        ServiceImplementationFactoryParameters fp = (ServiceImplementationFactoryParameters) newMock(ServiceImplementationFactoryParameters.class);

        lf.setDefaultBeanFactory(beanFactory);

        SpringBeanParameter param = buildParameter("fred", null);

        Object fred = new Object();

        beanFactory.getBean("fred", List.class);
        setReturnValue(beanFactory, fred);

        fp.getFirstParameter();
        setReturnValue(fp, param);

        fp.getServiceInterface();
        setReturnValue(fp, List.class);

        replayControls();

        Object actual = lf.createCoreServiceImplementation(fp);

        assertSame(fred, actual);

        verifyControls();
    }
View Full Code Here


        verifyControls();
    }

    public void testBeanSpecificFactory()
    {
        SpringLookupFactory lf = new SpringLookupFactory();
        BeanFactory beanFactory = (BeanFactory) newMock(BeanFactory.class);

        ServiceImplementationFactoryParameters fp = (ServiceImplementationFactoryParameters) newMock(ServiceImplementationFactoryParameters.class);

        SpringBeanParameter param = buildParameter("fred", beanFactory);

        Object fred = new Object();

        beanFactory.getBean("fred", List.class);
        setReturnValue(beanFactory, fred);

        fp.getFirstParameter();
        setReturnValue(fp, param);

        fp.getServiceInterface();
        setReturnValue(fp, List.class);

        replayControls();

        Object actual = lf.createCoreServiceImplementation(fp);

        assertSame(fred, actual);

        verifyControls();
    }
View Full Code Here

        return p;
    }

    public void testDefaultFactory()
    {
        SpringLookupFactory lf = new SpringLookupFactory();

        BeanFactory beanFactory = (BeanFactory) newMock(BeanFactory.class);

        ServiceImplementationFactoryParameters fp = (ServiceImplementationFactoryParameters) newMock(ServiceImplementationFactoryParameters.class);

        lf.setDefaultBeanFactory(beanFactory);

        SpringBeanParameter param = buildParameter("fred", null);

        Object fred = new Object();

        beanFactory.getBean("fred", List.class);
        setReturnValue(beanFactory, fred);

        fp.getFirstParameter();
        setReturnValue(fp, param);

        fp.getServiceInterface();
        setReturnValue(fp, List.class);

        replayControls();

        Object actual = lf.createCoreServiceImplementation(fp);

        assertSame(fred, actual);

        verifyControls();
    }
View Full Code Here

        verifyControls();
    }

    public void testBeanSpecificFactory()
    {
        SpringLookupFactory lf = new SpringLookupFactory();
        BeanFactory beanFactory = (BeanFactory) newMock(BeanFactory.class);

        ServiceImplementationFactoryParameters fp = (ServiceImplementationFactoryParameters) newMock(ServiceImplementationFactoryParameters.class);

        SpringBeanParameter param = buildParameter("fred", beanFactory);

        Object fred = new Object();

        beanFactory.getBean("fred", List.class);
        setReturnValue(beanFactory, fred);

        fp.getFirstParameter();
        setReturnValue(fp, param);

        fp.getServiceInterface();
        setReturnValue(fp, List.class);

        replayControls();

        Object actual = lf.createCoreServiceImplementation(fp);

        assertSame(fred, actual);

        verifyControls();
    }
View Full Code Here

        return p;
    }

    public void testDefaultFactory()
    {
        SpringLookupFactory lf = new SpringLookupFactory();

        MockControl control = newControl(BeanFactory.class);
        BeanFactory beanFactory = (BeanFactory) control.getMock();

        MockControl fpc = newControl(ServiceImplementationFactoryParameters.class);
        ServiceImplementationFactoryParameters fp = (ServiceImplementationFactoryParameters) fpc
                .getMock();

        lf.setDefaultBeanFactory(beanFactory);

        SpringBeanParameter param = buildParameter("fred", null);

        Object fred = new Object();

        beanFactory.getBean("fred", List.class);
        control.setReturnValue(fred);

        fp.getFirstParameter();
        fpc.setReturnValue(param);

        fp.getServiceInterface();
        fpc.setReturnValue(List.class);

        replayControls();

        Object actual = lf.createCoreServiceImplementation(fp);

        assertSame(fred, actual);

        verifyControls();
    }
View Full Code Here

        verifyControls();
    }

    public void testBeanSpecificFactory()
    {
        SpringLookupFactory lf = new SpringLookupFactory();

        MockControl control = newControl(BeanFactory.class);
        BeanFactory beanFactory = (BeanFactory) control.getMock();

        MockControl fpc = newControl(ServiceImplementationFactoryParameters.class);
        ServiceImplementationFactoryParameters fp = (ServiceImplementationFactoryParameters) fpc
                .getMock();

        SpringBeanParameter param = buildParameter("fred", beanFactory);

        Object fred = new Object();

        beanFactory.getBean("fred", List.class);
        control.setReturnValue(fred);

        fp.getFirstParameter();
        fpc.setReturnValue(param);

        fp.getServiceInterface();
        fpc.setReturnValue(List.class);

        replayControls();

        Object actual = lf.createCoreServiceImplementation(fp);

        assertSame(fred, actual);

        verifyControls();
    }
View Full Code Here

        return Collections.singletonList(p);
    }

    public void testDefaultFactory()
    {
        SpringLookupFactory lf = new SpringLookupFactory();

        MockControl control = newControl(BeanFactory.class);
        BeanFactory beanFactory = (BeanFactory) control.getMock();

        lf.setDefaultBeanFactorySource(buildSource(beanFactory));

        List params = buildParameters("fred", null);

        Object fred = new Object();

        beanFactory.getBean("fred", List.class);
        control.setReturnValue(fred);

        replayControls();

        Object actual = lf.createCoreServiceImplementation("fred", List.class, null, params);

        assertSame(fred, actual);

        verifyControls();
    }
View Full Code Here

        verifyControls();
    }

    public void testBeanSpecificFactory()
    {
        SpringLookupFactory lf = new SpringLookupFactory();

        MockControl control = newControl(BeanFactory.class);
        BeanFactory beanFactory = (BeanFactory) control.getMock();

        List params = buildParameters("fred", beanFactory);

        Object fred = new Object();

        beanFactory.getBean("fred", List.class);
        control.setReturnValue(fred);

        replayControls();

        Object actual = lf.createCoreServiceImplementation("fred", List.class, null, params);

        assertSame(fred, actual);

        verifyControls();
    }
View Full Code Here

        return Collections.singletonList(p);
    }

    public void testDefaultFactory()
    {
        SpringLookupFactory lf = new SpringLookupFactory();

        MockControl control = newControl(BeanFactory.class);
        BeanFactory beanFactory = (BeanFactory) control.getMock();

        lf.setDefaultBeanFactorySource(buildSource(beanFactory));

        List params = buildParameters("fred", null);

        Object fred = new Object();

        beanFactory.getBean("fred", List.class);
        control.setReturnValue(fred);

        replayControls();

        Object actual = lf.createCoreServiceImplementation("fred", List.class, null, null, params);

        assertSame(fred, actual);

        verifyControls();
    }
View Full Code Here

        verifyControls();
    }

    public void testBeanSpecificFactory()
    {
        SpringLookupFactory lf = new SpringLookupFactory();

        MockControl control = newControl(BeanFactory.class);
        BeanFactory beanFactory = (BeanFactory) control.getMock();

        List params = buildParameters("fred", beanFactory);

        Object fred = new Object();

        beanFactory.getBean("fred", List.class);
        control.setReturnValue(fred);

        replayControls();

        Object actual = lf.createCoreServiceImplementation("fred", List.class, null, null, params);

        assertSame(fred, actual);

        verifyControls();
    }
View Full Code Here

TOP

Related Classes of org.apache.hivemind.lib.impl.SpringLookupFactory

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.