* @exception Exception if an error occurs
*/
public void modifyData() throws Exception {
ProcessMgr mgr = defDir.processMgr("SystemTest_full", "full");
WfProcess proc = mgr.createProcess(requester);
ProcessData data = proc.processContext();
assertTrue(((Boolean)data.get("packageBooleanData")).booleanValue());
assertTrue(((String)data.get("testString")).equals("WfMOpen"));
assertTrue((((String)data.get("packageStringData")) == null));
assertTrue(((Long)data.get("packageIntegerData")).intValue() == 3);
data.put("", null);
// Illegal empty entry
boolean invalidData = false;
try {
proc.setProcessContext(data);
} catch (InvalidDataException exc) {
invalidData = true;
}
assertTrue(invalidData);
data.remove("");
data.put("teststring", "illegal");
data.put("packageIntegerData", "5");
// Misspelled teststring and wrong data type for Integer
invalidData = false;
try {
proc.setProcessContext(data);
} catch (InvalidDataException exc) {
invalidData = true;
}
data.remove("teststring");
Iterator it = data.keySet().iterator();
// Still wrong data type for Integer
invalidData = false;
try {
proc.setProcessContext(data);
} catch (InvalidDataException exc) {
invalidData = true;
}
data.put("packageIntegerData", new Integer("5"));
proc.setProcessContext(data);
ProcessDataInfo ctxInfo = mgr.contextSignature();
// Fetch data to check modifications
data = proc.processContext();
assertTrue(((Long)data.get("packageIntegerData")).intValue() == 5);
procDir.removeProcess(proc);
mgr = defDir.processMgr("SystemTest_minimal", "minimal");
proc = mgr.createProcess(requester);
data = proc.processContext();
assertTrue(data.isEmpty());
proc.setProcessContext(data);
data.put("", null);
invalidData = false;
try {
proc.setProcessContext(data);
} catch (InvalidDataException exc) {
invalidData = true;
}
assertTrue(invalidData);
data.remove("");
proc.setProcessContext(data);
procDir.removeProcess(proc);
}