assertEquals("did not persist all endpoint calltime data, only persisted: " + persistedData.get(0).getCount(),
count, persistedData.get(0).getCount());
}
private void createNewEvents(Resource res, long timestamp, int count) {
EventDefinition ed = res.getResourceType().getEventDefinitions().iterator().next();
EventSource source = new EventSource("datapurgejobtest", ed, res);
Map<EventSource, Set<Event>> eventMap = new HashMap<EventSource, Set<Event>>();
Set<Event> events = new HashSet<Event>();
for (int i = 0; i < count; i++) {
events.add(new Event(ed.getName(), source.getLocation(), timestamp + i, EventSeverity.DEBUG, "details"));
}
eventMap.put(source, events);
EventManagerLocal mgr = LookupUtil.getEventManager();
mgr.addEventData(eventMap);