Skip to content

Commit

Permalink
Merge pull request #1172 from jim-krueger/1162-sseBroadcastTest
Browse files Browse the repository at this point in the history
1162 sse broadcast test
  • Loading branch information
jim-krueger authored Sep 11, 2023
2 parents 1c25e3d + 878383e commit 694f39b
Showing 1 changed file with 12 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -188,17 +188,20 @@ public void sseBroadcastTest() throws Fault {
}
}

for (int i = 0; i != CLIENTS; i++) {
List<String> events = clients[i].getEvents();
assertEquals(events.size(), MSG_MAX + 1,
"Received unexpected number of events", events.size());
assertTrue(events.get(0).contains("WELCOME"),
"Received unexpected message"+ events.get(0));
for (int j = 0; j != MSG_MAX; j++)
assertEquals(events.get(j + 1), SSEMessage.MESSAGE + j,
"Received unexpected message", events.get(j + 1));
List<String> expectedEvents = new ArrayList<String>();
for (int j = 0; j != MSG_MAX; j++) {
expectedEvents.add(SSEMessage.MESSAGE + j);
}

for (int i = 0; i != CLIENTS; i++) {
List<String> events = clients[i].getEvents();
assertEquals(events.size(), MSG_MAX + 1,
"Received unexpected number of events", events.size());
assertTrue(events.get(0).contains("WELCOME"),
"Received unexpected message"+ events.get(0));
assertTrue(events.containsAll(expectedEvents), "An expected message was not received");
}

setProperty(Property.REQUEST, buildRequest(Request.GET, "broadcast/check"));
invoke();
String response = getResponseBody();
Expand Down

0 comments on commit 694f39b

Please sign in to comment.