@Test
  public void testParseTimestampMapInteger() {
    TimestampIntegerMap expected = new TimestampIntegerMap();
    expected.put(1.0, 1);
    expected.put(3.0, 2);
    expected.put(5.0, 3);
    expected.put(6.0, 4);

    assertEqualTimestampMaps(
        expected,
        TimestampsParser.parseTimestampMap(Integer.class, "[1, 1]; [3, 2]; [5, '3']; [6, \"4\"]"));
    assertEqualTimestampMaps(
        expected,
        TimestampsParser.parseTimestampMap(int.class, "[1, 1]; [3, 2]; [5, '3']; [6, \"4\"]"));
  }
Example #2
0
  @Test
  public void testSetAttributeTimestamp() {
    GraphStore store = new GraphStore();
    Column column = generateTimestampColumn(store);

    TimestampIntegerMap ti = new TimestampIntegerMap();
    ti.put(1.0, 42);
    ti.put(2.0, 10);

    NodeImpl node = new NodeImpl("0", store);
    node.setAttribute(column, ti);

    Assert.assertEquals(node.attributes.length, 1 + getElementPropertiesLength());
    Assert.assertEquals(node.attributes[getFirstNonPropertyIndex()], ti);
    Assert.assertEquals(node.getAttribute(column), ti);
  }