Package org.apache.hivemind.lib

Examples of org.apache.hivemind.lib.BeanFactory


        if (locator.length() == 0)
            throw new ApplicationRuntimeException(
                FactoryMessages.invalidBeanTranslatorFormat(inputValue));

        BeanFactory f = (BeanFactory) contributingModule.getService(serviceId, BeanFactory.class);

        return f.get(locator);
    }
View Full Code Here


            throw new ApplicationRuntimeException(
                FactoryMessages.invalidBeanTranslatorFormat(inputValue),
                location,
                null);

        BeanFactory f = (BeanFactory) contributingModule.getService(serviceId, BeanFactory.class);

        return f.get(locator);
    }
View Full Code Here

    public void testSuccess()
    {
        String result = "Obtained via BeanFactory.";

        MockControl factoryControl = newControl(BeanFactory.class);
        BeanFactory factory = (BeanFactory) factoryControl.getMock();

        MockControl moduleControl = newControl(Module.class);
        Module module = (Module) moduleControl.getMock();

        module.getService("factory", BeanFactory.class);
        moduleControl.setReturnValue(factory);

        factory.get("my-bean,initialized");
        factoryControl.setReturnValue(result);

        replayControls();

        ObjectProvider op = new BeanFactoryObjectProvider();
View Full Code Here

        replayControls();

        BeanFactoryBuilder b = new BeanFactoryBuilder();

        BeanFactory f = (BeanFactory) b.createCoreServiceImplementation(fp);

        Integer i = (Integer) f.get("integer,5");

        assertEquals(new Integer(5), i);

        verifyControls();
    }
View Full Code Here

     */
    public void testIntegration() throws Exception
    {
        Registry r = buildFrameworkRegistry("NumberFactory.xml");

        BeanFactory f = (BeanFactory) r.getService(
                "hivemind.lib.test.NumberFactory",
                BeanFactory.class);

        assertEquals(new Integer(27), f.get("int,27"));
        assertEquals(new Double(-22.5), f.get("double,-22.5"));
    }
View Full Code Here

        replayControls();

        BeanFactoryBuilder b = new BeanFactoryBuilder();

        BeanFactory f = (BeanFactory) b.createCoreServiceImplementation(fp);

        Integer i = (Integer) f.get("integer,5");

        assertEquals(new Integer(5), i);

        verifyControls();
    }
View Full Code Here

     */
    public void testIntegration() throws Exception
    {
        Registry r = buildFrameworkRegistry("NumberFactory.xml");

        BeanFactory f = (BeanFactory) r.getService(
                "hivemind.lib.test.NumberFactory",
                BeanFactory.class);

        assertEquals(new Integer(27), f.get("int,27"));
        assertEquals(new Double(-22.5), f.get("double,-22.5"));
    }
View Full Code Here

    public void testSuccess()
    {
        String result = "Obtained via BeanFactory.";

        MockControl factoryControl = newControl(BeanFactory.class);
        BeanFactory factory = (BeanFactory) factoryControl.getMock();

        MockControl moduleControl = newControl(Module.class);
        Module module = (Module) moduleControl.getMock();

        module.getService("factory", BeanFactory.class);
        moduleControl.setReturnValue(factory);

        factory.get("my-bean,initialized");
        factoryControl.setReturnValue(result);

        replayControls();

        Translator t = new BeanTranslator();
View Full Code Here

        BeanFactoryParameter p = new BeanFactoryParameter();
        p.setContributions(l);

        BeanFactoryBuilder b = new BeanFactoryBuilder();

        BeanFactory f =
            (BeanFactory) b.createCoreServiceImplementation(
                "foo.bar",
                BeanFactory.class,
                null,
                Collections.singletonList(p));

        Integer i = (Integer) f.get("integer,5");

        assertEquals(new Integer(5), i);
    }
View Full Code Here

     */
    public void testIntegration() throws Exception
    {
        Registry r = buildFrameworkRegistry("NumberFactory.sdl");

        BeanFactory f =
            (BeanFactory) r.getService("hivemind.lib.test.NumberFactory", BeanFactory.class);

        assertEquals(new Integer(27), f.get("int,27"));
        assertEquals(new Double(-22.5), f.get("double,-22.5"));
    }
View Full Code Here

TOP

Related Classes of org.apache.hivemind.lib.BeanFactory

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.