Search in sources :

Example 1 with IdentityGetter

use of org.simpleflatmapper.reflect.getter.IdentityGetter in project SimpleFlatMapper by arnaudroger.

the class SelfPropertyMetaTest method testDirect.

@Test
public void testDirect() {
    ClassMeta<String> direct = ReflectionService.newInstance().getClassMeta(String.class);
    PropertyMeta<String, Object> property = direct.newPropertyFinder(isValidPropertyMeta).findProperty(new DefaultPropertyNameMatcher("bbb", 0, true, true), new Object[0]);
    assertTrue("Expect SelfPropertyMeta " + property, property instanceof SelfPropertyMeta);
    assertEquals("SelfPropertyMeta{type=class java.lang.String,name=self}", property.toString());
    assertTrue(property.getGetter() instanceof IdentityGetter);
    assertTrue(NullSetter.isNull(property.getSetter()));
    assertEquals("{this}", property.getPath());
    assertEquals(String.class, direct.getType());
}
Also used : IdentityGetter(org.simpleflatmapper.reflect.getter.IdentityGetter) SelfPropertyMeta(org.simpleflatmapper.reflect.meta.SelfPropertyMeta) DefaultPropertyNameMatcher(org.simpleflatmapper.reflect.meta.DefaultPropertyNameMatcher) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)1 IdentityGetter (org.simpleflatmapper.reflect.getter.IdentityGetter)1 DefaultPropertyNameMatcher (org.simpleflatmapper.reflect.meta.DefaultPropertyNameMatcher)1 SelfPropertyMeta (org.simpleflatmapper.reflect.meta.SelfPropertyMeta)1