Package org.apache.hivemind.lib

Examples of org.apache.hivemind.lib.BeanFactory


    {
        Location l = newLocation();
        ValueConverter vc = newValueConverter();
        IComponent component = newComponent();
       
        BeanFactory bf = newMock(BeanFactory.class);

        Translator translator =newMock(Translator.class);

        expect(bf.get("string")).andReturn(translator);

        replay();

        TranslatorBindingFactory f = new TranslatorBindingFactory();
        f.setValueConverter(vc);
View Full Code Here


    public void test_Failure()
    {
        Location l = newLocation();
        IComponent component = newComponent();

        BeanFactory bf = newMock(BeanFactory.class);

        Throwable t = new RuntimeException("Boom!");

        expect(bf.get("string")).andThrow(t);

        replay();

        TranslatorBindingFactory f = new TranslatorBindingFactory();
        f.setTranslatorBeanFactory(bf);
View Full Code Here

    public void testFactory()
    {
        IValidator validator = newMock(IValidator.class);
        ValueConverter vc = newMock(ValueConverter.class);
       
        BeanFactory vbf = newMock(BeanFactory.class);

        IScriptSource scriptSource = newMock(IScriptSource.class);
       
        expect(vbf.get("foo,bar=baz")).andReturn(validator);
       
        Location l = newLocation();
       
        validator.setScriptSource(scriptSource);
       
View Full Code Here

        Location l = newLocation();
        ValueConverter vc = newValueConverter();
        IComponent component = newComponent();

        MockControl bfc = newControl(BeanFactory.class);
        BeanFactory bf = (BeanFactory) bfc.getMock();

        Translator translator = (Translator) newMock(Translator.class);

        bf.get("string");
        bfc.setReturnValue(translator);

        replayControls();

        TranslatorBindingFactory f = new TranslatorBindingFactory();
View Full Code Here

    {
        Location l = newLocation();
        IComponent component = newComponent();

        MockControl bfc = newControl(BeanFactory.class);
        BeanFactory bf = (BeanFactory) bfc.getMock();

        Throwable t = new RuntimeException("Boom!");

        bf.get("string");
        bfc.setThrowable(t);

        replayControls();

        TranslatorBindingFactory f = new TranslatorBindingFactory();
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.