Package org.apache.tapestry5.ioc

Examples of org.apache.tapestry5.ioc.ObjectLocator


    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, null, map,
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, null, map, null, SERVICE_ID, def, Class.class, keyToContribution);
View Full Code Here

public class InjectWorkerTest extends InternalBaseTestCase {
  private static final String REQUEST_CLASS_NAME = Request.class.getName();

  @Test
  public void anonymous_injection() {
    ObjectLocator locator = mockObjectLocator();
    InjectionProvider ip = newMock(InjectionProvider.class);
    Inject annotation = newInject();
    ClassTransformation ct = mockClassTransformation();
    MutableComponentModel model = mockMutableComponentModel();
    TransformField field = newMock(TransformField.class);
View Full Code Here

    verify();
  }

  @Test
  public void anonymous_injection_not_provided() {
    ObjectLocator locator = mockObjectLocator();
    InjectionProvider ip = newMock(InjectionProvider.class);
    Inject annotation = newInject();
    ClassTransformation ct = mockClassTransformation();
    MutableComponentModel model = mockMutableComponentModel();
    TransformField field = newMock(TransformField.class);
View Full Code Here

    verify();
  }

  @Test
  public void injection_provider_threw_exception() {
    ObjectLocator locator = mockObjectLocator();
    InjectionProvider ip = newMock(InjectionProvider.class);
    Inject annotation = newInject();
    ClassTransformation ct = mockClassTransformation();
    MutableComponentModel model = mockMutableComponentModel();
    TransformField field = newMock(TransformField.class);
View Full Code Here

        Constructor constructor = constructors[0];

        if (insideConstructor)
            throw new RuntimeException(IOCMessages.recursiveModuleConstructor(moduleClass, constructor));

        ObjectLocator locator = new ObjectLocatorImpl(registry, this);
        Map<Class, Object> resourcesMap = CollectionFactory.newMap();

        resourcesMap.put(Logger.class, logger);
        resourcesMap.put(ObjectLocator.class, locator);
        resourcesMap.put(OperationTracker.class, registry);
View Full Code Here

    {
        ApplicationStatePersistenceStrategy strategy = mockApplicationStatePersistenceStrategy();
        ApplicationStatePersistenceStrategySource source = mockApplicationStatePersistenceStrategySource();
        Class asoClass = ReadOnlyBean.class;
        final Holder holder = new Holder();
        ObjectLocator locator = mockObjectLocator();

        train_get(source, ApplicationStateManagerImpl.DEFAULT_STRATEGY, strategy);

        IAnswer answer = new IAnswer()
        {
            public Object answer() throws Throwable
            {
                ApplicationStateCreator creator = (ApplicationStateCreator) EasyMock
                        .getCurrentArguments()[1];

                Object aso = creator.create();

                holder.put(aso);

                return aso;
            }
        };

        expect(strategy.get(eq(asoClass), isA(ApplicationStateCreator.class))).andAnswer(answer);

        expect(locator.autobuild(EasyMock.isA(String.class), EasyMock.eq(asoClass))).andReturn(
                new ReadOnlyBean());

        replay();

        Map<Class, ApplicationStateContribution> configuration = Collections.emptyMap();
View Full Code Here

    private static final String REQUEST_CLASS_NAME = Request.class.getName();

    @Test
    public void anonymous_injection()
    {
        ObjectLocator locator = mockObjectLocator();
        InjectionProvider ip = newMock(InjectionProvider.class);
        Inject annotation = newInject();
        ClassTransformation ct = mockClassTransformation();
        MutableComponentModel model = mockMutableComponentModel();
View Full Code Here

    }

    @Test
    public void anonymous_injection_not_provided()
    {
        ObjectLocator locator = mockObjectLocator();
        InjectionProvider ip = newMock(InjectionProvider.class);
        Inject annotation = newInject();
        ClassTransformation ct = mockClassTransformation();
        MutableComponentModel model = mockMutableComponentModel();
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.