Iterator<String> it = dateRelPathes.iterator();
StringBuffer clause = new StringBuffer();
clause.append("SELECT * FROM [");
- clause.append(SlcTypes.SLC_DIFF_RESULT);
+ clause.append(SlcTypes.SLC_TEST_RESULT);
clause.append("] as results");
clause.append(" WHERE ");
while (it.hasNext()) {
*/
public static void updatePassedStatus(Node node, boolean passed) {
try {
- if (!node.hasNode(SlcNames.SLC_STATUS))
+ if (!node.hasNode(SlcNames.SLC_AGGREGATED_STATUS))
// we have reached the root of the tree. stop the
// recursivity
return;
- boolean pStatus = node.getNode(SlcNames.SLC_STATUS)
+ boolean pStatus = node.getNode(SlcNames.SLC_AGGREGATED_STATUS)
.getProperty(SlcNames.SLC_SUCCESS).getBoolean();
if (pStatus == passed)
// nothing to update
// New status is 'failed' : we only update status of the result
// folder and its
// parent if needed
- node.getNode(SlcNames.SLC_STATUS).setProperty(
+ node.getNode(SlcNames.SLC_AGGREGATED_STATUS).setProperty(
SlcNames.SLC_SUCCESS, passed);
updatePassedStatus(node.getParent(), passed);
} else {
Node currNode = ni.nextNode();
if ((currNode.isNodeType(SlcTypes.SLC_DIFF_RESULT) || currNode
.isNodeType(SlcTypes.SLC_RESULT_FOLDER))
- && !currNode.getNode(SlcNames.SLC_STATUS)
+ && !currNode
+ .getNode(SlcNames.SLC_AGGREGATED_STATUS)
.getProperty(SlcNames.SLC_SUCCESS)
.getBoolean()) {
success = false;
}
}
if (success) {
- node.getNode(SlcNames.SLC_STATUS).setProperty(
+ node.getNode(SlcNames.SLC_AGGREGATED_STATUS).setProperty(
SlcNames.SLC_SUCCESS, passed);
updatePassedStatus(node.getParent(), passed);
} else
throw new SlcException("Cannot update result passed status", e);
}
}
-
- public static void updateStatusOnRemoval(Node node) {
- try {
- if (!node.hasNode(SlcNames.SLC_STATUS))
- // nothing to do
- return;
- boolean pStatus = node.getNode(SlcNames.SLC_STATUS)
- .getProperty(SlcNames.SLC_SUCCESS).getBoolean();
- if (pStatus == true)
- // nothing to update
- return;
- else {
- // success we must first check if all siblings have also
- // successfully completed
- boolean success = true;
- NodeIterator ni = node.getNodes();
- children: while (ni.hasNext()) {
- Node currNode = ni.nextNode();
- if ((currNode.isNodeType(SlcTypes.SLC_DIFF_RESULT) || currNode
- .isNodeType(SlcTypes.SLC_RESULT_FOLDER))
- && !currNode.getNode(SlcNames.SLC_STATUS)
- .getProperty(SlcNames.SLC_SUCCESS)
- .getBoolean()) {
- success = false;
- break children;
- }
- }
- if (success) {
- node.getNode(SlcNames.SLC_STATUS).setProperty(
- SlcNames.SLC_SUCCESS, true);
- updatePassedStatus(node, true);
- } else
- // one of the siblings had also the failed status so
- // above tree remains unchanged.
- return;
- }
- } catch (RepositoryException e) {
- throw new SlcException(
- "Unexpected error while updating status on removal", e);
- }
- }
-
}