Beispiel #1
0
 @Test
 public void testFlowPartInfoCreation() throws Exception {
   Flow flow = Flows.createFlow(PACKET, 1);
   FlowPart part = flow.getPart("0.0");
   FlowPartInfo info = part.getInfo(flow);
   assertEquals("CLEAN", info.getStatus());
   assertEquals(0, info.getContributionCount());
   flow.acknowledge("0.0", false);
   info = part.getInfo(flow);
   assertEquals(1, info.getContributionCount());
 }
Beispiel #2
0
 @Test
 public void testFlowPartGetLatestUpdate() throws Exception {
   Flow flow = Flows.createFlow(PACKET, 1);
   FlowPart part = flow.getPart("0.0");
   part.setContributionTime(null);
   part.setFilterTime(null);
   assertNull(part.getLatestUpdate());
   part.setContributionTime(dateHigh());
   part.setFilterTime(null);
   assertEquals(dateHigh(), part.getLatestUpdate());
   part.setContributionTime(null);
   part.setFilterTime(dateHigh());
   assertEquals(dateHigh(), part.getLatestUpdate());
   part.setContributionTime(dateHigh());
   part.setFilterTime(dateLow());
   assertEquals(dateHigh(), part.getLatestUpdate());
   part.setContributionTime(dateLow());
   part.setFilterTime(dateHigh());
   assertEquals(dateHigh(), part.getLatestUpdate());
 }