while (msg.hasNext()) {
System.out.println(((PrioritizedMessage)msg.next()).unmappedMessage());
}
}
// Test all attributes of process definition
ProcessDefinition procdef = defDir.lookupProcessDefinition("SystemTest_full",
"full");
boolean gotException = false;
try {
procdef.applicationById("Dummy");
} catch (InvalidIdException exc) {
gotException = true;
}
assertTrue(gotException);
Application appl = procdef.applicationById("dummy");
assertTrue(appl.description().equals("Dummy application for testing"
+ " purposes only."));
assertTrue(appl.id().equals("dummy"));
assertTrue(procdef.applications().size() == 1);
assertTrue(((Application)procdef.applications().iterator().next())
.id().equals("dummy"));
gotException = false;
try {
procdef.participantById("CurrentUser");
} catch (InvalidIdException exc) {
gotException = true;
}
assertTrue(gotException);
Participant part = procdef.participantById("currentUser");
assertTrue(part.getId().equals("currentUser"));
assertTrue(part.getName().equals("Aktueller Benutzer"));
assertTrue(part.getParticipantType()
.equals(Participant.ParticipantType.HUMAN));
assertTrue(procdef.participants().size() == 1);
assertTrue(((Participant)procdef.participants().iterator().next())
.getId().equals("currentUser"));
assertTrue(procdef.removeClosedProcess());
assertTrue(procdef.cleanupMode() == ProcessDefinition.REMOVE_AUTOMATIC);
assertTrue(procdef.packageId().equals("SystemTest_full"));
assertTrue(procdef.processId().equals("full"));
assertTrue(procdef.packageName().equals("System Test (procdef)"));
assertTrue(procdef.processName().equals("PROCESS_COMPLETE_ATTRIBUTES"));
assertTrue(procdef.mgrName().equals("SystemTest_full/full"));
ProcessDefinition.ProcessHeaderData hdr = procdef.processHeader();
assertTrue(hdr.created().equals("Tue Jan 14 14:58:01 CEST 2003"));
assertTrue(hdr.description().equals("Description for test of all"
+ " accessible attributes"));
assertTrue(hdr.priority().equals("5"));
assertTrue(hdr.limit().equals("3 days"));