StringBuffer sb = new StringBuffer();
String st;
while ((st = br.readLine()) != null) {
sb.append(st + "\n");
}
ProcessDefinition pd = new DefaultProcessDefinition (sb.toString());
assertTrue (pd.packageId().equals ("unittests"));
assertTrue (pd.packageName().equals ("Initial workflow processes"));
assertTrue (pd.processId().equals ("account_neu"));
assertTrue (pd.processName().equals ("Account anlegen"));
assertTrue (pd.processHeader().packageHeader().xpdlVersion().equals ("0.09"));
assertTrue (pd.processHeader().packageHeader().vendor().equals ("Danet GmbH, GS AN"));
assertTrue (pd.processHeader().packageHeader().created().equals ("Sat Aug 24 15:12:01 CEST 2002"));
assertTrue (pd.processHeader().created().equals ("01.09.2001"));
assertTrue (pd.processHeader().description().equals ("Anlegen eines Accounts"));
assertTrue (pd.processHeader().priority().equals ("1"));
assertTrue (pd.contextSignature()
.get ("packageString") == String.class);
assertTrue (pd.contextSignature()
.get ("packageFloat") == Double.class);
assertTrue (pd.contextSignature()
.get ("packageInteger") == Long.class);
assertTrue (pd.contextSignature()
.get ("packageDateTime") == Date.class);
assertTrue (pd.contextSignature()
.get ("packageBoolean") == Boolean.class);
assertTrue (pd.contextSignature()
.get ("packageXML") == org.w3c.dom.Element.class);
assertTrue ((pd.contextSignature()
.get ("packageXMLDefined")).getClass().toString(),
(pd.contextSignature()
.get ("packageXMLDefined")) instanceof SAXEventBuffer);
assertTrue (pd.contextSignature()
.get ("processString") == String.class);
assertTrue (pd.resultSignature() .get ("formalParam1") == null);
assertTrue (pd.resultSignature()
.get ("formalParam2") == String.class);
assertTrue (pd.resultSignature()
.get ("formalParam3") == String.class);
ApplicationDefinition appl
= (ApplicationDefinition)pd.applicationById("WebForm");
assertTrue (appl != null);
assertTrue (appl.description(), appl.description().equals
("Bearbeitung einer Aktivit�t �ber ein Web-Formular "));
appl = (ApplicationDefinition)pd.applicationById("WebFormPlus");
assertTrue (appl != null);
FormalParameter[] fps = appl.formalParameters();
assertTrue (fps.length == 2);
Participant p = pd.participantById("currentUser");
assertTrue (p != null);
assertTrue (p.getName().equals("Current User"));
assertTrue (p.getParticipantType() == ParticipantType.HUMAN);
}