if(tpd[3] instanceof RelationshipTimePhasedData) { RelationshipTimePhasedData rel = (RelationshipTimePhasedData)tpd[3]; assertEquals("Test Relationship Role", "MetricsControlProvider", rel.getRole()); assertEquals("Test Item", "Initializer", rel.getItem()); assertEquals("Test Cluster", "Initializer", rel.getCluster()); } else { fail("Expected RelationshipTimePhasedData"); }
  public void testComponentDataTimePhased() {    String[] supplies = {"Supplies.Agent"};    agent.getProperty(ABCAgent.PROP_SUPPLIES).setValue(supplies);    agent.getProperty(ABCAgent.PROP_INITIALIZER).setValue("Initializer");    ComponentData data = (ComponentData)agent.addComponentData(new GenericComponentData());        TimePhasedData[] tpd = data.getTimePhasedData();    if(tpd[0] instanceof CommunityTimePhasedData) {      CommunityTimePhasedData comm = (CommunityTimePhasedData)tpd[0];      assertEquals("Test Community Name", "Generic", comm.getCommunity(0));    } else {      fail("Expected CommunityTimePhasedData");    }    if(tpd[1] instanceof RelationshipTimePhasedData) {      RelationshipTimePhasedData rel = (RelationshipTimePhasedData)tpd[1];      assertEquals("Test Relationship Role", "Role1", rel.getRole());      assertEquals("Test Item", "Supplies.Agent", rel.getItem());      assertEquals("Test Type", "Agent" ,rel.getType());      assertEquals("Test Cluster", "Supplies.Agent", rel.getCluster());    } else {      fail("Expected RelationshipTimePhasedData");    }    if(tpd[2] instanceof RelationshipTimePhasedData) {      RelationshipTimePhasedData rel = (RelationshipTimePhasedData)tpd[2];      assertEquals("Test Relationship Role", "Role2", rel.getRole());      assertEquals("Test Item", "Supplies.Agent", rel.getItem());      assertEquals("Test Type", "Agent" ,rel.getType());      assertEquals("Test Cluster", "Supplies.Agent", rel.getCluster());    } else {      fail("Expected RelationshipTimePhasedData");    }    if(tpd[3] instanceof RelationshipTimePhasedData) {      RelationshipTimePhasedData rel = (RelationshipTimePhasedData)tpd[3];      assertEquals("Test Relationship Role", "MetricsControlProvider", rel.getRole());      assertEquals("Test Item", "Initializer", rel.getItem());      assertEquals("Test Cluster", "Initializer", rel.getCluster());    } else {      fail("Expected RelationshipTimePhasedData");    }  }