Package org.apache.tapestry5.ioc

Examples of org.apache.tapestry5.ioc.ObjectLocator


    }

    @Test
    public void exception_injecting_into_field()
    {
        ObjectLocator ol = mockObjectLocator();
        FieldInjectionViaInjectService target = new FieldInjectionViaInjectService();

        // It's very hard to come up with a value that causes an error when assigned. We have to break
        // a lot of rules.

        ol.getService("FredService", Runnable.class);
        EasyMock.expectLastCall().andReturn("NotTheRightType");

        replay();

        try
View Full Code Here


    @Test
    public void proper_key_and_value()
    {
        ContributionDef def = mockContributionDef();
        Map<Class, ContributionDef> keyToContribution = newMap();
        ObjectLocator locator = mockObjectLocator();
        Map<Class, Runnable> map = CollectionFactory.newMap();

        Class key = Integer.class;
        Runnable value = mockRunnable();
View Full Code Here

    public void duplicate_key()
    {
        ContributionDef def1 = newContributionDef("contributionPlaceholder1");
        ContributionDef def2 = newContributionDef("contributionPlaceholder2");
        Map<Class, ContributionDef> keyToContribution = newMap();
        ObjectLocator locator = mockObjectLocator();
        Map<Class, Runnable> map = CollectionFactory.newMap();

        keyToContribution.put(Integer.class, def1);

        Class key = Integer.class;
View Full Code Here

    public void null_key()
    {
        ContributionDef def = newContributionDef("contributionPlaceholder1");
        Map<Class, ContributionDef> keyToContribution = newMap();
        Runnable value = mockRunnable();
        ObjectLocator locator = mockObjectLocator();
        Map<Class, Runnable> map = CollectionFactory.newMap();

        replay();

        MappedConfiguration<Class, Runnable> wrapper = new ValidatingMappedConfigurationWrapper<Class, Runnable>(
View Full Code Here

    public void wrong_key_type()
    {
        ContributionDef def = newContributionDef("contributionPlaceholder1");
        Map<?, ContributionDef> keyToContribution = CollectionFactory.newMap();
        Runnable value = mockRunnable();
        ObjectLocator locator = mockObjectLocator();
        Map<Class, Runnable> map = CollectionFactory.newMap();

        replay();

        MappedConfiguration wrapper = new ValidatingMappedConfigurationWrapper(Runnable.class, locator, map, null,
View Full Code Here

    @Test
    public void wrong_value_type()
    {
        ContributionDef def = newContributionDef("contributionPlaceholder1");
        Map<?, ContributionDef> keyToContribution = CollectionFactory.newMap();
        ObjectLocator locator = mockObjectLocator();
        Map<Class, Runnable> map = CollectionFactory.newMap();


        replay();
View Full Code Here

    public void null_value()
    {
        ContributionDef def = newContributionDef("contributionPlaceholder1");
        Map<Class, ContributionDef> keyToContribution = CollectionFactory.newMap();
        Map<Class, Runnable> map = CollectionFactory.newMap();
        ObjectLocator locator = mockObjectLocator();

        replay();

        MappedConfiguration<Class, Runnable> wrapper = new ValidatingMappedConfigurationWrapper<Class, Runnable>(
                Runnable.class, locator, map, null, SERVICE_ID, def, Class.class, keyToContribution);
View Full Code Here

    {
        ObjectProvider prov1 = mockObjectProvider();
        ObjectProvider prov2 = mockObjectProvider();
        Class type = Runnable.class;
        AnnotationProvider ap = mockAnnotationProvider();
        ObjectLocator locator = mockObjectLocator();
        Object expected = mockRunnable();

        train_provide(prov1, type, ap, locator, expected);

        List<ObjectProvider> configuration = Arrays.asList(prov1, prov2);
View Full Code Here

    {
        ObjectProvider prov1 = mockObjectProvider();
        ObjectProvider prov2 = mockObjectProvider();
        Class type = Runnable.class;
        AnnotationProvider ap = mockAnnotationProvider();
        ObjectLocator locator = mockObjectLocator();
        Object expected = mockRunnable();

        train_provide(prov1, type, ap, locator, null);
        train_provide(prov2, type, ap, locator, expected);
View Full Code Here

    {
        ObjectProvider prov1 = mockObjectProvider();
        ObjectProvider prov2 = mockObjectProvider();
        Class type = Runnable.class;
        AnnotationProvider ap = mockAnnotationProvider();
        ObjectLocator locator = mockObjectLocator();

        train_provide(prov1, type, ap, locator, null);
        train_provide(prov2, type, ap, locator, null);

        List<ObjectProvider> configuration = Arrays.asList(prov1, prov2);
View Full Code Here

TOP

Related Classes of org.apache.tapestry5.ioc.ObjectLocator

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.