ElementImpl implements Element { @Override public void setAttribute(String key, Object value) { setAttribute(checkColumnExists(key), value); } ElementImpl(Object id, GraphStore graphStore); @Override Object getId(); @Override String getLabel(); @Override Object getAttribute(String key); @Override Object getAttribute(Column column); @Override Object getAttribute(String key, double timestamp); @Override Object getAttribute(Column column, double timestamp); @Override Object getAttribute(String key, Interval interval); @Override Object getAttribute(Column column, Interval interval); @Override Object getAttribute(String key, GraphView view); @Override Object getAttribute(Column column, GraphView view); @Override Object[] getAttributes(); @Override Set<String> getAttributeKeys(); @Override ColumnIterable getAttributeColumns(); @Override Object removeAttribute(String key); @Override Object removeAttribute(Column column); @Override Object removeAttribute(Column column, double timestamp); @Override Object removeAttribute(String key, double timestamp); @Override Object removeAttribute(Column column, Interval interval); @Override Object removeAttribute(String key, Interval interval); @Override void setLabel(String label); @Override void setAttribute(String key, Object value); @Override void setAttribute(Column column, Object value); @Override void setAttribute(String key, Object value, double timestamp); @Override void setAttribute(Column column, Object value, double timestamp); @Override void setAttribute(String key, Object value, Interval interval); @Override void setAttribute(Column column, Object value, Interval interval); @Override boolean addTimestamp(double timestamp); @Override boolean addInterval(Interval interval); @Override boolean removeTimestamp(double timestamp); @Override boolean removeInterval(Interval interval); @Override double[] getTimestamps(); @Override Interval[] getIntervals(); @Override boolean hasTimestamp(double timestamp); @Override boolean hasInterval(Interval interval); @Override Iterable<Map.Entry> getAttributes(Column column); @Override void clearAttributes(); @Override int hashCode(); @Override boolean equals(Object obj);  }
@Test(expectedExceptions = IllegalArgumentException.class) public void testSetAttributeStringNotFound() { GraphStore store = new GraphStore(); generateBasicColumn(store); NodeImpl node = new NodeImpl("0", store); node.setAttribute("foo", 1); }
@Test(expectedExceptions = IllegalArgumentException.class) public void testSetAttributeUnknownColumn() { GraphStore store = new GraphStore(); ColumnImpl columnImpl = new ColumnImpl("0", String.class, "title", "", Origin.DATA, false, false); NodeImpl node = new NodeImpl("0", store); node.setAttribute(columnImpl, "0"); }
@Test(expectedExceptions = IllegalArgumentException.class) public void testSetAttributeOtherStoreColumn() { GraphStore otherStore = new GraphStore(); Column column = generateBasicColumn(otherStore); GraphStore store = new GraphStore(); NodeImpl node = new NodeImpl("0", store); node.setAttribute(column, "0"); }
@Test(expectedExceptions = IllegalArgumentException.class) public void testSetAttributeWrongType() { GraphStore store = new GraphStore(); Column column = generateBasicColumn(store); NodeImpl node = new NodeImpl("0", store); node.setAttribute(column, "a"); }
@Test(expectedExceptions = IllegalArgumentException.class) public void testSetAttributeNonTimestamp() { GraphStore store = new GraphStore(); Column column = generateBasicColumn(store); NodeImpl node = new NodeImpl("0", store); node.setAttribute(column, 1, 2.0); }
@Test(expectedExceptions = IllegalArgumentException.class) public void testSetAttributeNonInterval() { GraphStore store = getIntervalGraphStore(); Column column = generateBasicColumn(store); NodeImpl node = new NodeImpl("0", store); node.setAttribute(column, 1, new Interval(1.0, 2.0)); }
@Test(expectedExceptions = IllegalArgumentException.class) public void testNaNTimestamp() { GraphStore store = new GraphStore(); Column column = generateTimestampColumn(store); NodeImpl node = new NodeImpl("0", store); node.setAttribute(column, 1, Double.NaN); }
@Test(expectedExceptions = IllegalArgumentException.class) public void testInfiniteTimestamp() { GraphStore store = new GraphStore(); Column column = generateTimestampColumn(store); NodeImpl node = new NodeImpl("0", store); node.setAttribute(column, 1, Double.POSITIVE_INFINITY); }