Examples of TypeInformation


Examples of org.neo4j.rest.graphdb.converter.TypeInformation

       converter.convertToResultType(MapUtil.map("test",2), new TypeInformation(String.class));
    }

    @Test (expected = RestResultException.class)
    public void testConvertFromMapWithSameTypeAndMultipleElementsToObject(){
        converter.convertToResultType(MapUtil.map("test","test","test2","test2"), new TypeInformation(String.class));
    }
View Full Code Here

Examples of org.neo4j.rest.graphdb.converter.TypeInformation

*/
public class TypeInformationTest {

    @Test
    public void testSingleValueNode(){
        TypeInformation typeInfo = createTypeInfo("testSingleValueNode");
        assertEquals(Node.class, typeInfo.getType());
    }
View Full Code Here

Examples of org.neo4j.rest.graphdb.converter.TypeInformation

        assertEquals(Node.class, typeInfo.getType());
    }

    @Test
    public void testSingleValueString(){
        TypeInformation typeInfo = createTypeInfo("testSingleValueString");
        assertEquals(String.class, typeInfo.getType());
    }
View Full Code Here

Examples of org.neo4j.rest.graphdb.converter.TypeInformation

        assertEquals(String.class, typeInfo.getType());
    }

    @Test
    public void testIterableObject(){
        TypeInformation typeInfo = createTypeInfo("testIterableObject");
        assertEquals(Iterable.class, typeInfo.getType());
        assertEquals(1, typeInfo.getGenericArguments().length);
        assertEquals(Object.class, typeInfo.getGenericArguments()[0]);
    }
View Full Code Here

Examples of org.neo4j.rest.graphdb.converter.TypeInformation

        assertEquals(Object.class, typeInfo.getGenericArguments()[0]);
    }

    @Test
    public void testIterableNode(){
        TypeInformation typeInfo = createTypeInfo("testIterableNode");
        assertEquals(Iterable.class, typeInfo.getType());
        assertEquals(1, typeInfo.getGenericArguments().length);
        assertEquals(Node.class, typeInfo.getGenericArguments()[0]);
    }
View Full Code Here

Examples of org.neo4j.rest.graphdb.converter.TypeInformation

        assertEquals(Node.class, typeInfo.getGenericArguments()[0]);
    }

    @Test
    public void testCollectionObject(){
        TypeInformation typeInfo = createTypeInfo("testCollectionObject");
        assertEquals(Collection.class, typeInfo.getType());
        assertEquals(1, typeInfo.getGenericArguments().length);
        assertEquals(Object.class, typeInfo.getGenericArguments()[0]);
    }
View Full Code Here

Examples of org.neo4j.rest.graphdb.converter.TypeInformation

        assertEquals(Object.class, typeInfo.getGenericArguments()[0]);
    }

    @Test
    public void testCollectionNode(){
        TypeInformation typeInfo = createTypeInfo("testCollectionNode");
        assertEquals(Collection.class, typeInfo.getType());
        assertEquals(1, typeInfo.getGenericArguments().length);
        assertEquals(Node.class, typeInfo.getGenericArguments()[0]);
    }
View Full Code Here

Examples of org.neo4j.rest.graphdb.converter.TypeInformation

        assertEquals(Node.class, typeInfo.getGenericArguments()[0]);
    }

    @Test
    public void testMapStringObject(){
        TypeInformation typeInfo = createTypeInfo("testMapStringObject");
        assertEquals(Map.class, typeInfo.getType());
        assertEquals(2, typeInfo.getGenericArguments().length);
        assertEquals(String.class, typeInfo.getGenericArguments()[0]);
        assertEquals(Object.class, typeInfo.getGenericArguments()[1]);
    }
View Full Code Here

Examples of org.neo4j.rest.graphdb.converter.TypeInformation

    public RestPathParser(RestAPI restAPI) {
        this.restAPI = restAPI;
    }

    public static Path parse(Map path, final RestAPI restApi) {
         TypeInformation typeInfo = new TypeInformation(path.get("nodes"));
        RestPathParser restPathParser = new RestPathParser(restApi);
        if (restPathParser.isFullPath(typeInfo)){
            return restPathParser.parseFullPath(path, restApi);
         }
         if (restPathParser.isPath(typeInfo)){
             return restPathParser.parsePath(path, restApi);
         }

         throw new IllegalArgumentException("params map contained illegal type "+typeInfo.getGenericArguments()[0]);
    }
View Full Code Here

Examples of org.springframework.data.util.TypeInformation

  @Test
  @SuppressWarnings({ "rawtypes" })
  public void resolvesTypeByLoadingClass() {

    TypeInformationMapper mapper = new SimpleTypeInformationMapper();
    TypeInformation type = mapper.resolveTypeFrom("java.lang.String");

    TypeInformation expected = ClassTypeInformation.from(String.class);

    assertThat(type, is(expected));
  }
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.