Examples of Touchable


Examples of org.picocontainer.testmodel.Touchable

    public void testWillOmitSelfFromCollection() {
        MutablePicoContainer pico = getDefaultPicoContainer();
        pico.registerComponentImplementation(SimpleTouchable.class);
        pico.registerComponentImplementation(TouchableObserver.class);
        Touchable observer = (Touchable) pico.getComponentInstanceOfType(TouchableObserver.class);
        assertNotNull(observer);
        observer.touch();
        SimpleTouchable touchable = (SimpleTouchable) pico.getComponentInstanceOfType(SimpleTouchable.class);
        assertTrue(touchable.wasTouched);
    }
View Full Code Here

Examples of org.picocontainer.testmodel.Touchable

     */
    public void testUnambiguouSelfDependency() {
        MutablePicoContainer pico = createPicoContainer(null);
        pico.registerComponentImplementation(SimpleTouchable.class);
        pico.registerComponentImplementation(DecoratedTouchable.class);
        Touchable t = (Touchable) pico.getComponentInstance(DecoratedTouchable.class);
        assertNotNull(t);
    }
View Full Code Here

Examples of org.picocontainer.testmodel.Touchable

         */
        pico.registerComponentImplementation(Touchable.class, DecoratedTouchable.class, new Parameter[]{
            new ComponentParameter("default")
        });

        Touchable touchable = (Touchable) pico.getComponentInstanceOfType(Touchable.class);
        assertEquals(DecoratedTouchable.class, touchable.getClass());
    }
View Full Code Here

Examples of org.picocontainer.testmodel.Touchable

        // Use the List variant instead, so we get better test coverage.
        pico.registerComponentImplementation(Touchable.class, DecoratedTouchable.class, Collections.singletonList(new ComponentParameter("default")));

        DefaultPicoContainer grandChild = new DefaultPicoContainer(new DefaultPicoContainer(new DefaultPicoContainer(pico)));

        Touchable touchable = (Touchable) grandChild.getComponentInstanceOfType(Touchable.class);
        assertEquals(DecoratedTouchable.class, touchable.getClass());

    }
View Full Code Here

Examples of tests.jfun.yan.testmodel.Touchable

    }
     
    public void testSerializedContainerCanRetrieveImplementation()
    throws Exception {
     
      Touchable touchable = getTouchableFromSerializedContainer();
     
      SimpleTouchable simpleTouchable = (SimpleTouchable) touchable;
     
      assertTrue(simpleTouchable.wasTouched);
    }
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.