Examples of InjectionProvider


Examples of org.apache.tapestry.services.InjectionProvider

    @Test
    public void injection_provider_threw_exception()
    {
        ObjectLocator locator = mockObjectLocator();
        InjectionProvider ip = newMock(InjectionProvider.class);
        Inject annotation = newInject();
        ClassTransformation ct = mockClassTransformation();
        MutableComponentModel model = mockMutableComponentModel();
        RuntimeException failure = new RuntimeException("Oops.");

        train_findFieldsWithAnnotation(ct, Inject.class, "myfield");
        train_getFieldAnnotation(ct, "myfield", Inject.class, annotation);

        train_getFieldType(ct, "myfield", REQUEST_CLASS_NAME);
        train_toClass(ct, REQUEST_CLASS_NAME, Request.class);

        expect(ip.provideInjection("myfield", Request.class, locator, ct, model)).andThrow(failure);

        train_getClassName(ct, "foo.bar.Baz");

        replay();
View Full Code Here

Examples of org.apache.tapestry.services.InjectionProvider

    @Test
    public void anonymous_injection()
    {
        ServiceLocator locator = newServiceLocator();
        InjectionProvider ip = newMock(InjectionProvider.class);
        Inject annotation = newMock(Inject.class);
        ClassTransformation ct = newClassTransformation();
        MutableComponentModel model = newMutableComponentModel();

        train_findFieldsWithAnnotation(ct, Inject.class, "myfield");
View Full Code Here

Examples of org.apache.tapestry.services.InjectionProvider

    @Test
    public void anonymous_injection_not_provided()
    {
        ServiceLocator locator = newServiceLocator();
        InjectionProvider ip = newMock(InjectionProvider.class);
        Inject annotation = newMock(Inject.class);
        ClassTransformation ct = newClassTransformation();
        MutableComponentModel model = newMutableComponentModel();

        train_findFieldsWithAnnotation(ct, Inject.class, "myfield");
View Full Code Here

Examples of org.apache.tapestry.services.InjectionProvider

        train_getFieldAnnotation(ct, fieldName, Path.class, null);

        replay();

        InjectionProvider provider = new AssetInjectionProvider(symbolSource, assetSource);

        assertFalse(provider.provideInjection(fieldName, String.class, locator, ct, model));

        verify();
    }
View Full Code Here

Examples of org.apache.tapestry.services.InjectionProvider

        ct.makeReadOnly(fieldName);

        replay();

        InjectionProvider provider = new AssetInjectionProvider(symbolSource, assetSource);

        assertTrue(provider.provideInjection(fieldName, fieldType, locator, ct, model));

        verify();
    }
View Full Code Here

Examples of org.apache.tapestry5.services.InjectionProvider

  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

Examples of org.apache.tapestry5.services.InjectionProvider

  }

  @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

Examples of org.apache.tapestry5.services.InjectionProvider

  }

  @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);
    RuntimeException failure = new RuntimeException("Oops.");

    train_matchFields(ct, field);

    train_getName(field, "myfield");

    train_getAnnotation(field, Inject.class, annotation);

    train_getType(field, REQUEST_CLASS_NAME);
    train_toClass(ct, REQUEST_CLASS_NAME, Request.class);

    expect(
        ip.provideInjection("myfield", Request.class, locator, ct,
            model)).andThrow(failure);

    train_getClassName(ct, "foo.bar.Baz");

    replay();
View Full Code Here

Examples of org.apache.tapestry5.services.InjectionProvider

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

        train_findFieldsWithAnnotation(ct, Inject.class, "myfield");
View Full Code Here

Examples of org.apache.tapestry5.services.InjectionProvider

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

        train_findFieldsWithAnnotation(ct, Inject.class, "myfield");
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.