Search in sources :

Example 1 with WrappedDeclaredType

use of org.robobinding.codegen.apt.type.WrappedDeclaredType in project RoboBinding by RoboBinding.

the class WrappedTypeElement method typeElementOf.

private WrappedTypeElement typeElementOf(DeclaredType declaredType) {
    WrappedDeclaredType type = typeWrapper.wrap(declaredType);
    TypeElement element = (TypeElement) types.asElement(declaredType);
    return new WrappedTypeElement(element, type, typeWrapper, loggerFactory, elements, wrapper, types);
}
Also used : TypeElement(javax.lang.model.element.TypeElement) WrappedDeclaredType(org.robobinding.codegen.apt.type.WrappedDeclaredType)

Example 2 with WrappedDeclaredType

use of org.robobinding.codegen.apt.type.WrappedDeclaredType in project RoboBinding by RoboBinding.

the class SimpleOneWayPropertyInfoTest method givenObjectPropertyType_thenReturnSameType.

@Test
public void givenObjectPropertyType_thenReturnSameType() {
    final SetterElement setter = context.mock(SetterElement.class);
    final WrappedDeclaredType declaredType = context.mock(WrappedDeclaredType.class);
    context.checking(new Expectations() {

        {
            oneOf(setter).parameterType();
            will(returnValue(declaredType));
            oneOf(declaredType).isPrimitive();
            will(returnValue(false));
            oneOf(declaredType).className();
            will(returnValue(Object.class.getName()));
        }
    });
    SimpleOneWayPropertyInfo info = new SimpleOneWayPropertyInfo(setter);
    assertThat(info.propertyType(), equalTo(Object.class.getName()));
}
Also used : Expectations(org.jmock.Expectations) SetterElement(org.robobinding.codegen.apt.element.SetterElement) WrappedDeclaredType(org.robobinding.codegen.apt.type.WrappedDeclaredType) Test(org.junit.Test)

Aggregations

WrappedDeclaredType (org.robobinding.codegen.apt.type.WrappedDeclaredType)2 TypeElement (javax.lang.model.element.TypeElement)1 Expectations (org.jmock.Expectations)1 Test (org.junit.Test)1 SetterElement (org.robobinding.codegen.apt.element.SetterElement)1