use of org.cristalise.kernel.persistency.outcome.Outcome in project kernel by cristal-ise.
the class XMLClusterStorage method get.
@Override
public C2KLocalObject get(ItemPath itemPath, String path) throws PersistencyException {
try {
ClusterType type = ClusterStorage.getClusterType(path);
String filePath = getFilePath(itemPath, path) + fileExtension;
String objString = FileStringUtility.file2String(filePath);
if (objString.length() == 0)
return null;
Logger.debug(9, "XMLClusterStorage.get() - objString:" + objString);
if (type == ClusterType.OUTCOME)
return new Outcome(path, objString);
else
return (C2KLocalObject) Gateway.getMarshaller().unmarshall(objString);
} catch (Exception e) {
Logger.msg(3, "XMLClusterStorage.get() - The path " + path + " from " + itemPath + " does not exist: " + e.getMessage());
Logger.error(e);
throw new PersistencyException(e.getMessage());
}
}
use of org.cristalise.kernel.persistency.outcome.Outcome in project kernel by cristal-ise.
the class OutcomeTest method testGetAllRecords.
@Test
public void testGetAllRecords() throws Exception {
Outcome patients = getOutcome("allPatients.xml");
compareListOfRecord(patients.getAllRecords("/AllPatients/PatientDetails"));
String[] names = { "InsuranceNumber", "DateOfBirth", "Gender", "Weight" };
compareListOfRecord2(patients.getAllRecords("/AllPatients/PatientDetails", Arrays.asList(names)));
}
use of org.cristalise.kernel.persistency.outcome.Outcome in project kernel by cristal-ise.
the class OutcomeTest method testStorageDetails.
@Test
public void testStorageDetails() throws Exception {
Outcome storage = getOutcome("storageDetails1", "StorageDetails");
storage.setField("Type", "SECTION");
storage.setField("Capacity", "55000");
storage.setField("Commodity", null);
storage.setField("Grade", null, true);
storage.setField("Note", "");
storage.validateAndCheck();
assertNotNull(storage.getData());
Logger.msg(storage.getData());
assertTrue(storage.isIdentical(getOutcome("storageDetails1_updated.xml")));
}
use of org.cristalise.kernel.persistency.outcome.Outcome in project kernel by cristal-ise.
the class OutcomeTest method testSite.
@Test
public void testSite() throws Exception {
Outcome site1 = getOutcome("site1", "NewSite");
Logger.msg(site1.getData());
Map<String, String> record = new HashMap<>();
record.put("Name", "kovax");
site1.setRecord(record);
site1.validateAndCheck();
}
Aggregations