use of com.baidu.hugegraph.loader.HugeGraphLoader in project incubator-hugegraph-toolchain by apache.
the class HDFSLoadTest method testHDFSWithCoreSitePath.
@Test
public void testHDFSWithCoreSitePath() {
ioUtil.write("vertex_person.csv", "name,age,city", "marko,29,Beijing", "vadas,27,Hongkong", "josh,32,Beijing", "peter,35,Shanghai", "\"li,nary\",26,\"Wu,han\"");
String[] args = new String[] { "-f", structPath("hdfs_with_core_site_path/struct.json"), "-s", configPath("hdfs_with_core_site_path/schema.groovy"), "-g", GRAPH, "-h", SERVER, "--batch-insert-threads", "2", "--test-mode", "true" };
HugeGraphLoader loader = new HugeGraphLoader(args);
loader.load();
List<Vertex> vertices = CLIENT.graph().listVertices();
Assert.assertEquals(5, vertices.size());
}
use of com.baidu.hugegraph.loader.HugeGraphLoader in project incubator-hugegraph-toolchain by apache.
the class HDFSLoadTest method testHDFSWithInvalidCoreSitePath.
@Test
public void testHDFSWithInvalidCoreSitePath() {
ioUtil.write("vertex_person.csv", "name,age,city", "marko,29,Beijing", "vadas,27,Hongkong", "josh,32,Beijing", "peter,35,Shanghai", "\"li,nary\",26,\"Wu,han\"");
String[] args = new String[] { "-f", structPath("hdfs_with_invalid_core_site_path/struct.json"), "-s", configPath("hdfs_with_invalid_core_site_path/schema.groovy"), "-g", GRAPH, "-h", SERVER, "--batch-insert-threads", "2", "--test-mode", "true" };
Assert.assertThrows(LoadException.class, () -> {
HugeGraphLoader loader = new HugeGraphLoader(args);
loader.load();
}, e -> {
String message = "An exception occurred while checking HDFS path";
Assert.assertTrue(e.getMessage().contains(message));
});
}
Aggregations