Search in sources :

Example 11 with GraphConnection

use of com.baidu.hugegraph.entity.GraphConnection in project incubator-hugegraph-toolchain by apache.

the class EntityUtilTest method testMerge.

@Test
public void testMerge() throws InterruptedException {
    GraphConnection oldEntity;
    GraphConnection newEntity;
    oldEntity = new GraphConnection(1, "conn1", "graph1", "host1", 8001, 30, "", "", true, "", new Date(), "http", "", "");
    Thread.sleep(10);
    newEntity = new GraphConnection(2, "conn2", "graph2", "host2", 8002, 40, "u", "p", false, "xxx", new Date(), "http", "", "");
    GraphConnection entity = EntityUtil.merge(oldEntity, newEntity);
    Assert.assertEquals(oldEntity.getId(), entity.getId());
    Assert.assertEquals(newEntity.getName(), entity.getName());
    Assert.assertEquals(newEntity.getGraph(), entity.getGraph());
    Assert.assertEquals(newEntity.getHost(), entity.getHost());
    Assert.assertEquals(newEntity.getPort(), entity.getPort());
    Assert.assertEquals(oldEntity.getTimeout(), entity.getTimeout());
    Assert.assertEquals(newEntity.getUsername(), entity.getUsername());
    Assert.assertEquals(newEntity.getPassword(), entity.getPassword());
    Assert.assertEquals(oldEntity.getCreateTime(), entity.getCreateTime());
}
Also used : GraphConnection(com.baidu.hugegraph.entity.GraphConnection) Date(java.util.Date) Test(org.junit.Test)

Aggregations

GraphConnection (com.baidu.hugegraph.entity.GraphConnection)11 ExternalException (com.baidu.hugegraph.exception.ExternalException)9 JobManager (com.baidu.hugegraph.entity.load.JobManager)5 PostMapping (org.springframework.web.bind.annotation.PostMapping)5 HugeClient (com.baidu.hugegraph.driver.HugeClient)3 FileMapping (com.baidu.hugegraph.entity.load.FileMapping)1 LoadTask (com.baidu.hugegraph.entity.load.LoadTask)1 ArrayList (java.util.ArrayList)1 Date (java.util.Date)1 Test (org.junit.Test)1 DeleteMapping (org.springframework.web.bind.annotation.DeleteMapping)1 GetMapping (org.springframework.web.bind.annotation.GetMapping)1 PutMapping (org.springframework.web.bind.annotation.PutMapping)1