Examples of StringHolder


Examples of hivemind.test.services.StringHolder

        p.process(elements, m);

        Map map = p.getMappedElements();

        assertEquals(1, map.size());
        StringHolder h = (StringHolder) map.get(flintstoneKey);

        assertEquals("fred", h.getValue());

        verifyControls();
    }
View Full Code Here

Examples of hivemind.test.services.StringHolder

    public void testServicePropertyObjectProvider()
    {
        MockControl mc = newControl(Module.class);
        Module m = (Module) mc.getMock();

        StringHolder h = new StringHolderImpl();

        h.setValue("abracadabra");

        m.getService("MyService", Object.class);
        mc.setReturnValue(h);

        replayControls();

        ServicePropertyObjectProvider p = new ServicePropertyObjectProvider();

        Object result = p.provideObject(m, String.class, "MyService:value", null);

        assertEquals(h.getValue(), result);

        verifyControls();
    }
View Full Code Here

Examples of hivemind.test.services.StringHolder

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

        StringHolder s =
            (StringHolder) r.getService("hivemind.test.services.Managed", StringHolder.class);

        interceptLogging("hivemind.test.services.Managed");

        assertNull(s.getValue());

        assertLoggedMessage("activateService()");

        s.setValue("funky monkey");
        assertEquals("funky monkey", s.getValue());

        ThreadEventNotifier n =
            (ThreadEventNotifier) r.getService(
                HiveMind.THREAD_EVENT_NOTIFIER_SERVICE,
                ThreadEventNotifier.class);

        n.fireThreadCleanup();

        assertLoggedMessage("passivateService()");

        assertNull(s.getValue());
    }
View Full Code Here

Examples of hivemind.test.services.StringHolder

        trainResolveType(
                module,
                "hivemind.test.services.ServiceAutowireTarget",
                ServiceAutowireTarget.class);

        final StringHolder h = new StringHolderImpl();
       
        Autowiring autowiring = new Autowiring() {

            public Object autowireProperties(Object target, String[] propertyNames)
            {
View Full Code Here

Examples of hivemind.test.services.StringHolder

                ConstructorAutowireTarget.class);

        trainContainsService(module, Comparable.class, false);
        trainContainsService(module, StringHolder.class, true);

        StringHolder h = new StringHolderImpl();

        trainGetService(module, StringHolder.class, h);

        trainGetClassResolver(module, getClassResolver());
       
View Full Code Here

Examples of hivemind.test.services.StringHolder

        p.process(elements, m);

        List l = p.getElements();

        assertEquals(1, l.size());
        StringHolder h = (StringHolder) l.get(0);

        assertEquals("flintstone", h.getValue());

        verifyControls();
    }
View Full Code Here

Examples of hivemind.test.services.StringHolder

        p.process(elements, m);

        List l = p.getElements();

        assertEquals(1, l.size());
        StringHolder h = (StringHolder) l.get(0);

        assertEquals("flintstone", h.getValue());

        verifyControls();
    }
View Full Code Here

Examples of hivemind.test.services.StringHolder

        p.process(elements, m);

        List l = p.getElements();

        assertEquals(1, l.size());
        StringHolder h = (StringHolder) l.get(0);

        assertEquals("wilma", h.getValue());

        verifyControls();
    }
View Full Code Here

Examples of hivemind.test.services.StringHolder

    public void testServicePropertyObjectProvider()
    {
        MockControl mc = newControl(Module.class);
        Module m = (Module) mc.getMock();

        StringHolder h = new StringHolderImpl();

        h.setValue("abracadabra");

        m.getService("MyService", Object.class);
        mc.setReturnValue(h);

        replayControls();

        ServicePropertyObjectProvider p = new ServicePropertyObjectProvider();

        Object result = p.provideObject(m, String.class, "MyService:value", null);

        assertEquals(h.getValue(), result);

        verifyControls();
    }
View Full Code Here

Examples of hivemind.test.services.StringHolder

        p.process(elements, m);

        Map map = p.getMappedElements();

        assertEquals(1, map.size());
        StringHolder h = (StringHolder) map.get(flintstoneKey);

        assertEquals("fred", h.getValue());

        verifyControls();
    }
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.