@Override public void onCoordinateEvent(Event event, String message) { System.err.println("Got unit test even " + event.toString() + " " + message); events.add(event); latch1.countDown(); latch2.countDown(); }
public boolean onEvent(Event event) { System.out.println(event.toString()); if (event.getEventType() == EventType.CALL && event.getCallHandle().equals(waitingForCallHandle) && event.getEventCode() == waitingForCallCode && event.getEventReason() == waitingForCallReason) { callSignal.notifyResponseEvent(); } return false; }
@Test public void testToString() { final Event event = this.createTestEvent(); final String result = event.toString(); assertTrue(result.contains("type=type")); assertTrue(result.contains("distributed=true")); assertTrue(result.contains("data={key1=val1, key2=val2}")); }
@Test public void testSamplingEvent() { System.out.println("- testSamplingEvent -"); System.out.println("Create event"); Event e = new Event(); e.setSamplingEvent(host1, 0, 4); System.out.println(e.toString()); System.out.println("Process event in tree"); tt.processEvent(e); System.out.println(tt.treeInfo()); }
@Test public void testProcessEvent() { System.out.println("- testProcessEvent -"); Host host3 = new Host(deme1, "Host3"); System.out.println("Create event"); Event e = new Event(); e.setInfectionEvent(host1, host3, 2, 3.5); System.out.println(e.toString()); System.out.println("Process event in tree"); tt.processEvent(e); System.out.println(tt.treeInfo()); // fail("Not yet implemented"); }