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());
}
Aggregations