use of com.baidu.hugegraph.computer.core.graph.properties.DefaultProperties in project hugegraph-computer by hugegraph.
the class DefaultEdgeTest method testConstructor.
@Test
public void testConstructor() {
DefaultEdge edge = new DefaultEdge(graphFactory());
Assert.assertEquals(Constants.EMPTY_STR, edge.label());
Assert.assertEquals(Constants.EMPTY_STR, edge.name());
Assert.assertNull(edge.targetId());
Assert.assertEquals(new DefaultProperties(graphFactory()), edge.properties());
edge = new DefaultEdge(graphFactory(), "knows", "2021-06-01", BytesId.of(1L));
Assert.assertEquals("knows", edge.label());
Assert.assertEquals("2021-06-01", edge.name());
Assert.assertEquals(BytesId.of(1L), edge.targetId());
Assert.assertEquals(new DefaultProperties(graphFactory()), edge.properties());
}
use of com.baidu.hugegraph.computer.core.graph.properties.DefaultProperties in project hugegraph-computer by hugegraph.
the class DefaultPropertiesTest method testReadWrite.
@Test
public void testReadWrite() throws IOException {
DefaultProperties properties = new DefaultProperties(graphFactory());
Assert.assertEquals(0, properties.get().size());
properties.put("p1", new LongValue(1L));
properties.put("p2", new DoubleValue(2.0D));
DefaultProperties props2 = new DefaultProperties(graphFactory());
UnitTestBase.assertEqualAfterWriteAndRead(properties, props2);
}
use of com.baidu.hugegraph.computer.core.graph.properties.DefaultProperties in project hugegraph-computer by hugegraph.
the class DefaultPropertiesTest method testEquals.
@Test
public void testEquals() {
DefaultProperties props1 = new DefaultProperties(graphFactory());
props1.put("p1", new LongValue(1L));
props1.put("p2", new DoubleValue(2.0D));
DefaultProperties props2 = new DefaultProperties(props1.get(), UnitTestBase.graphFactory());
Assert.assertEquals(props1, props2);
}
Aggregations