Package org.picocontainer.testmodel

Examples of org.picocontainer.testmodel.DependsOnList


    public void testComponentDependsOnCollectionOfEverythingElse() {
        container.registerComponentImplementation(DependsOnList.class,
                                                  DependsOnList.class,
                                                  new Parameter[] { new CollectionConstraint(Anything.ANYTHING) });
        DependsOnList dol = (DependsOnList) container.getComponentInstance(DependsOnList.class);
        assertNotNull(dol);
        List dependencies = dol.getDependencies();
        assertEquals(5, dependencies.size());
    }
View Full Code Here


                                                  DecoratedTouchable.class,
                                                  new Parameter[] { new Not(new IsType(SimpleTouchable.class)) });
        container.registerComponentImplementation(DependsOnList.class,
                                                  DependsOnList.class,
                                                  new Parameter[] { new CollectionConstraint(new IsType(Touchable.class)) });
        DependsOnList dol = (DependsOnList) container.getComponentInstance(DependsOnList.class);
        assertNotNull(dol);
        List dependencies = dol.getDependencies();
        assertEquals(3, dependencies.size());
    }
View Full Code Here

                                                  new Parameter[] {
            new CollectionConstraint(new Or(new IsType(AlternativeTouchable.class),
                                            new IsType(DecoratedTouchable.class)))
        });

        DependsOnList dol = (DependsOnList) container.getComponentInstance(DependsOnList.class);
        AlternativeTouchable at = (AlternativeTouchable) container.getComponentInstance(AlternativeTouchable.class);
        DecoratedTouchable dt = (DecoratedTouchable) container.getComponentInstance(DecoratedTouchable.class);
        assertNotNull(dol);
        List dependencies = dol.getDependencies();
        assertEquals(2, dependencies.size());
        assertTrue(dependencies.contains(at));
        assertTrue(dependencies.contains(dt));
    }
View Full Code Here

TOP

Related Classes of org.picocontainer.testmodel.DependsOnList

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.