assertNotNull(unloader.getAttributeModel().getEdgeTable().getColumn("weight", AttributeType.DYNAMIC_FLOAT));
}
@Test
public void testNode() {
final Container container = Lookup.getDefault().lookup(ContainerFactory.class).newContainer();
container.setReport(new Report());
importer.execute(container.getLoader());
NodeDraftGetter n1 = (NodeDraftGetter) container.getLoader().getNode("4c175b4b2c9016b90d1b4bc2");
NodeDraftGetter n2 = (NodeDraftGetter) container.getLoader().getNode("4c175b542c9016b9ce1b4bc2");
NodeDraftGetter n3 = (NodeDraftGetter) container.getLoader().getNode("4c175b4b2c9016b9071b4bc2");
NodeDraftGetter n4 = (NodeDraftGetter) container.getLoader().getNode("4c175b4b2c9016b9101b4bc2");
NodeDraftGetter n5 = (NodeDraftGetter) container.getLoader().getNode("4c175b4b2c9016b93a1b4bc2");
NodeDraftGetter n6 = (NodeDraftGetter) container.getLoader().getNode("4c175b4a2c9016b9a51a4bc2");
NodeDraftGetter n7 = (NodeDraftGetter) container.getLoader().getNode("4c175b4b2c9016b9ba1a4bc2");
NodeDraftGetter n8 = (NodeDraftGetter) container.getLoader().getNode("4c175b4b2c9016b9ed1a4bc2");
NodeDraftGetter n9 = (NodeDraftGetter) container.getLoader().getNode("4c175b4b2c9016b9f61a4bc2");
assertNotNull(n1);
assertNotNull(n2);
assertNotNull(n3);
assertNotNull(n4);
assertNotNull(n5);
assertNotNull(n6);
assertNotNull(n7);
assertNotNull(n8);
assertNotNull(n9);
ContainerUnloader unloader = container.getUnloader();
AttributeColumn col0 = unloader.getAttributeModel().getNodeTable().getColumn("0");
AttributeColumn col1 = unloader.getAttributeModel().getNodeTable().getColumn("1");
AttributeColumn col2 = unloader.getAttributeModel().getNodeTable().getColumn("2");
AttributeColumn col3 = unloader.getAttributeModel().getNodeTable().getColumn("3");
AttributeColumn col4 = unloader.getAttributeModel().getNodeTable().getColumn("4");
try {
assertEquals("Node 1", n1.getLabel());
assertEquals("2000-01-01", DynamicUtilities.getXMLDateStringFromDouble(n1.getTimeInterval().getValues().get(0)[0]));
assertEquals("2000-12-31", DynamicUtilities.getXMLDateStringFromDouble(n1.getTimeInterval().getValues().get(0)[1]));
AttributeValue[] values1 = n1.getAttributeRow().getValues();
assertEquals("0", values1[col0.getIndex()].getColumn().getId());
assertEquals("3", values1[col3.getIndex()].getColumn().getId());
assertEquals("Author", ((DynamicType) values1[col0.getIndex()].getValue()).getValue());
assertEquals(new Float(1), ((DynamicType) values1[col3.getIndex()].getValue()).getValue());
AttributeValue[] values2 = n2.getAttributeRow().getValues();
assertEquals("0", values2[col0.getIndex()].getColumn().getId());
assertEquals("2", values2[col2.getIndex()].getColumn().getId());
assertEquals("Author", ((DynamicType) values2[col0.getIndex()].getValue()).getValue());
assertEquals(new StringList("String1, String2, String 3"), values2[col2.getIndex()].getValue());
AttributeValue[] values3 = n3.getAttributeRow().getValues();
DynamicType val4 = (DynamicType) values3[col4.getIndex()].getValue();
double low = DynamicUtilities.getDoubleFromXMLDateString("2009-01-01");
double high = DynamicUtilities.getDoubleFromXMLDateString("2009-12-31");
assertEquals(new Float(3f), val4.getValue(low, high));
assertEquals("2000-01-01", DynamicUtilities.getXMLDateStringFromDouble(n3.getTimeInterval().getValues().get(0)[0]));
assertEquals("2000-01-15", DynamicUtilities.getXMLDateStringFromDouble(n3.getTimeInterval().getValues().get(0)[1]));
assertEquals("2001-01-30", DynamicUtilities.getXMLDateStringFromDouble(n3.getTimeInterval().getValues().get(1)[0]));
assertEquals("2001-02-01", DynamicUtilities.getXMLDateStringFromDouble(n3.getTimeInterval().getValues().get(1)[1]));
assertEquals(2, n3.getTimeInterval().getValues().size());
container.verify();
assertEquals("2000-01-01", DynamicUtilities.getXMLDateStringFromDouble(n4.getTimeInterval().getValues().get(0)[0]));
assertEquals("2010-12-31", DynamicUtilities.getXMLDateStringFromDouble(n4.getTimeInterval().getValues().get(0)[1]));
assertEquals("2000-01-01", DynamicUtilities.getXMLDateStringFromDouble(n3.getTimeInterval().getValues().get(0)[0]));
assertEquals("2000-01-15", DynamicUtilities.getXMLDateStringFromDouble(n3.getTimeInterval().getValues().get(0)[1]));
assertEquals("2001-01-30", DynamicUtilities.getXMLDateStringFromDouble(n3.getTimeInterval().getValues().get(1)[0]));
assertEquals("2001-02-01", DynamicUtilities.getXMLDateStringFromDouble(n3.getTimeInterval().getValues().get(1)[1]));
} catch (Exception e) {
e.printStackTrace();
fail(e.getMessage());
}
container.closeLoader();
System.out.println(container.getReport().getText());
}