Exemplo n.º 1
0
  @Test
  public void testPrimitiveTypeFabricType() throws Exception {
    ReferenceSupplier<?> tr =
        TypeReference.referenceFabric(
            SimpleClass.class.getDeclaredField("simpleString").getGenericType());

    assertEquals(tr.getType(), String.class);
  }
Exemplo n.º 2
0
  @Test
  public void testParametrizedTypeFabricType() throws Exception {
    ReferenceSupplier<?> tr =
        TypeReference.referenceFabric(
            SimpleClass.class.getDeclaredField("genericField").getGenericType());

    assertEquals(((ParameterizedType) tr.getType()).getActualTypeArguments()[0], String.class);
    assertEquals(((ParameterizedType) tr.getType()).getRawType(), List.class);
  }
Exemplo n.º 3
0
 @Test
 public void testSimpleObjectFabricClass() throws Exception {
   ReferenceSupplier<SimpleClass> tr = TypeReference.referenceFabric(SimpleClass.class);
   assertEquals(tr.getType(), SimpleClass.class);
 }
Exemplo n.º 4
0
 @Test
 public void testSimpleTypeFabricClass() throws Exception {
   ReferenceSupplier<String> tr = TypeReference.referenceFabric(String.class);
   assertEquals(tr.getType(), String.class);
 }