Examples of TypeInformation


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

        assertEquals("testprop", ((Node)result).getProperty("propname"));
    }

    @Test
    public void testConvertJSONDataToRelationship(){
        Object result = converter.convertToResultType(MapUtil.map("self","http://localhost:7474/db/data/relationship/2", "data", MapUtil.map("propname", "testprop")), new TypeInformation(RestRelationship.class));
        assertEquals(RestRelationship.class, result.getClass());
        assertEquals("testprop", ((Relationship)result).getProperty("propname"));
    }
View Full Code Here

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

        path.put("start", node1);
        path.put("nodes", asList(node1, node2));
        path.put("length",1);
        path.put("relationships", asList(relationship1));
        path.put("end", node2);
        Path result = (Path)converter.convertToResultType(path, new TypeInformation(Path.class));

        assertEquals(SimplePath.class, result.getClass());
        assertEquals(1, result.startNode().getId());
        assertEquals(2, result.endNode().getId());
        assertEquals(1, result.lastRelationship().getId());
View Full Code Here

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

        path.put("start", node1);
        path.put("nodes", asList(node1, node2));
        path.put("length",1);
        path.put("relationships", asList(relationship1));
        path.put("end", node2);
        Object result = converter.convertToResultType(path, new TypeInformation(Path.class));
        assertEquals(SimplePath.class, result.getClass());
        assertEquals("testprop1"((SimplePath)result).startNode().getProperty("propname"));
        assertEquals("testprop2"((SimplePath)result).endNode().getProperty("propname"));
        assertEquals("testproprel1"((SimplePath)result).lastRelationship().getProperty("propname"));
View Full Code Here

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

    }

    @Test
    public void testConvertSimpleObjectToSameClass(){
        Object result = converter.convertToResultType("test", new TypeInformation(String.class));
        assertEquals(String.class, result.getClass());
        assertEquals("test", result);
    }
View Full Code Here

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

        assertEquals("test", result);
    }

    @Test
    public void testConvertIterableToIterableWithSameType(){
        Object result = converter.convertToResultType(asList("test","test2"), new TypeInformation(asList("test")));
        assertEquals(asList("test","test2"), result);
    }
View Full Code Here

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

        assertEquals(asList("test","test2"), result);
    }

    @Test (expected = RestResultException.class)
    public void testConvertIterableToIterableWithWrongType(){
        converter.convertToResultType(asList("test"), new TypeInformation(asList(2)));
    }
View Full Code Here

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

        converter.convertToResultType(asList("test"), new TypeInformation(asList(2)));
    }

    @Test
    public void testConvertMapToMapWithSameType(){
        Object result = converter.convertToResultType(MapUtil.map("test",1,"test2",2), new TypeInformation(MapUtil.map("test",0)));
        assertEquals(MapUtil.map("test", 1, "test2", 2), result);
    }
View Full Code Here

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

        assertEquals(MapUtil.map("test", 1, "test2", 2), result);
    }

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

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

        converter.convertToResultType(MapUtil.map("test",1,"test2",2), new TypeInformation(MapUtil.map("test","0")));
    }

    @Test (expected = RestResultException.class)
    public void testConvertSimpleObjectToWrongClass(){
         converter.convertToResultType("test", new TypeInformation(Integer.class));
    }
View Full Code Here

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

    @Test
    public void testConvertDifferentIterablesWithSameType(){
        HashSet<String> set = new HashSet<String>();
        set.add("test");
        Object result = converter.convertToResultType(set, new TypeInformation(asList("t")));
        assertEquals(asList("test"), result);
    }
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.