public void testDeleteEventStuff() throws Exception {
System.out.println("= testDeleteEvent");
EventManagerLocal eventManager = LookupUtil.getEventManager();
ResourceType platform = null;
Resource testResource = null;
// prepare basic stuff
try {
registerPlugin("event1-2.xml");
getTransactionManager().begin();
platform = getResourceType("events");
testResource = new Resource("-test-", "-test resource", platform);
testResource.setUuid("" + new Random().nextInt());
em.persist(testResource);
setUpAgent(testResource);
getTransactionManager().commit();
getTransactionManager().begin();
platform = em.find(ResourceType.class, platform.getId());
testResource = em.find(Resource.class, testResource.getId());
Set<EventDefinition> eDefs = platform.getEventDefinitions();
assert eDefs.size() == 2 : "Did not find the expected 2 eventDefinitions, but " + eDefs.size();
Iterator<EventDefinition> eIter = eDefs.iterator();
boolean found = false;
Map<EventSource, Set<Event>> events = new HashMap<EventSource, Set<Event>>(1);