if (eventAdmin == null) {
fail(getName() + " event admin should not be null");
}
/* a Hash table to store message in */
Dictionary message = new Hashtable();
for(int j = 0; j < propertiesToSend.length; j += 2) {
/*fill the propstable*/
System.out.println("Adding the following to the propsTable:" + propertiesToSend[j] + " and " + propertiesToSend[j+1]);
message.put(propertiesToSend[j], propertiesToSend[j+1]);
}
for (int i = 0; i < messageTosend; i++) {
message.put("Synchronus message",new Integer(i));
/* test print out */
System.out.println(getName() + " sending a Synchronus event with message:" +
message.toString() + "and the topic:" + topicToSend);
/* send the message */
eventAdmin.sendEvent(new Event(topicToSend, message));
}
/* a Hash table to store message in */
message = new Hashtable();
for(int j = 0; j < propertiesToSend.length; j += 2) {
/*fill the propstable*/
System.out.println("Adding the following to the propsTable:" + propertiesToSend[j] + " and " + propertiesToSend[j+1]);
message.put(propertiesToSend[j], propertiesToSend[j+1]);
}
for (int i = 0; i < messageTosend; i++) {
message.put("Asynchronus message",new Integer(i));
/* test print out */
System.out.println(getName() + " sending an Asynchronus event with message:" +
message.toString() + "and the topic:" + topicToSend);
/* send the message */
eventAdmin.sendEvent(new Event(topicToSend, message));
}
}