+ (testResultPart.getExceptionMessage() == null) ? ""
+ : testResultPart.getExceptionMessage());
+ }
+
+ // helper update aggregate status node
+ Node mainStatus;
+ if (!node.hasNode(SLC_AGGREGATED_STATUS)) {
+
+ mainStatus = node.addNode(SLC_AGGREGATED_STATUS,
+ SlcTypes.SLC_CHECK);
+ mainStatus.setProperty(SLC_SUCCESS,
+ resultPartNode.getProperty(SLC_SUCCESS).getBoolean());
+ if (resultPartNode.hasProperty(SLC_MESSAGE))
+ mainStatus.setProperty(SLC_MESSAGE, resultPartNode
+ .getProperty(SLC_MESSAGE).getString());
+ if (resultPartNode.hasProperty(SLC_ERROR_MESSAGE))
+ mainStatus.setProperty(SLC_ERROR_MESSAGE, resultPartNode
+ .getProperty(SLC_ERROR_MESSAGE).getString());
+ } else {
+ mainStatus = node.getNode(SLC_AGGREGATED_STATUS);
+ if (mainStatus.hasProperty(SLC_ERROR_MESSAGE)) {
+ // main status already in error we do nothing
+ } else if (resultPartNode.hasProperty(SLC_ERROR_MESSAGE)) {
+ // main status was not in error and new result part is in
+ // error; we update main status
+ mainStatus.setProperty(SLC_SUCCESS, false);
+ mainStatus.setProperty(SLC_ERROR_MESSAGE, resultPartNode
+ .getProperty(SLC_ERROR_MESSAGE).getString());
+ if (resultPartNode.hasProperty(SLC_MESSAGE))
+ mainStatus.setProperty(SLC_MESSAGE, resultPartNode
+ .getProperty(SLC_MESSAGE).getString());
+ else
+ // remove old message to remain consistent
+ mainStatus.setProperty(SLC_MESSAGE, "");
+ } else if (!mainStatus.getProperty(SLC_SUCCESS).getBoolean()) {
+ // main status was already failed and new result part is not
+ // in error, we do nothing
+ } else if (!resultPartNode.getProperty(SLC_SUCCESS)
+ .getBoolean()) {
+ // new resultPart that is failed
+ mainStatus.setProperty(SLC_SUCCESS, false);
+ if (resultPartNode.hasProperty(SLC_MESSAGE))
+ mainStatus.setProperty(SLC_MESSAGE, resultPartNode
+ .getProperty(SLC_MESSAGE).getString());
+ else
+ // remove old message to remain consistent
+ mainStatus.setProperty(SLC_MESSAGE, "");
+ } else if (resultPartNode.hasProperty(SLC_MESSAGE)
+ && (!mainStatus.hasProperty(SLC_MESSAGE) || (""
+ .equals(mainStatus.getProperty(SLC_MESSAGE)
+ .getString().trim())))) {
+ mainStatus.setProperty(SLC_MESSAGE, resultPartNode
+ .getProperty(SLC_MESSAGE).getString());
+ }
+ }