import org.argeo.slc.test.TestRun;
import org.argeo.slc.test.TestStatus;
-/** {@link TestResult} wrapping a JCR node of type {@link SlcTypes#SLC_TEST_RESULT}. */
+/**
+ * {@link TestResult} wrapping a JCR node of type
+ * {@link SlcTypes#SLC_TEST_RESULT}.
+ */
public class JcrTestResult implements TestResult, SlcNames, AttachmentsEnabled {
/** Should only be set for an already existing result. */
private String uuid;
if (uuid == null) {
// create new result
uuid = UUID.randomUUID().toString();
- String path = SlcJcrUtils.createResultPath(session.getUserID(),
- uuid);
+ String path = SlcJcrUtils.createResultPath(session, uuid);
Node resultNode = JcrUtils.mkdirs(session, path, resultType);
resultNode.setProperty(SLC_UUID, uuid);
for (String attr : attributes.keySet()) {
return session.getNodeByIdentifier(nodeIdentifier);
} else {
QueryManager qm = session.getWorkspace().getQueryManager();
- Query q = qm.createQuery(
- "select * from [" + SlcTypes.SLC_TEST_RESULT
- + "] where [slc:uuid]='" + uuid
- + "'", Query.JCR_SQL2);
+ Query q = qm.createQuery("select * from ["
+ + SlcTypes.SLC_TEST_RESULT + "] where [slc:uuid]='"
+ + uuid + "'", Query.JCR_SQL2);
resultNode = JcrUtils.querySingleNode(q);
if (resultNode != null)
nodeIdentifier = resultNode.getIdentifier();
public void addResultPart(TestResultPart testResultPart) {
Node node = getNode();
try {
- Node resultPartNode = node.addNode(SlcNames.SLC_STATUS, SlcTypes.SLC_CHECK);
+ Node resultPartNode = node.addNode(SlcNames.SLC_STATUS,
+ SlcTypes.SLC_CHECK);
resultPartNode.setProperty(SLC_SUCCESS,
testResultPart.getStatus() == TestStatus.PASSED);
if (testResultPart.getMessage() != null)
this.attributes = attributes;
}
-// public void setLogoutWhenDestroyed(Boolean logoutWhenDestroyed) {
-// this.logoutWhenDestroyed = logoutWhenDestroyed;
-// }
+ // public void setLogoutWhenDestroyed(Boolean logoutWhenDestroyed) {
+ // this.logoutWhenDestroyed = logoutWhenDestroyed;
+ // }
}