+/*
+ * Copyright (C) 2007-2012 Mathieu Baudier
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
package org.argeo.slc.jcr.execution;
import java.util.Collections;
import org.argeo.slc.test.TestResultPart;
import org.argeo.slc.test.TestStatus;
-/** Persists results in JCR */
+/**
+ * Persists results in JCR by listening to {@link TreeTestResult}. This is to
+ * facilitate transition from legacy approaches and should not be used in new
+ * implementations.
+ */
public class JcrResultListener implements TreeTestResultListener, SlcNames {
private final static Log log = LogFactory.getLog(JcrResultListener.class);
protected Node createResultNode(TreeTestResult testResult)
throws RepositoryException {
String uuid = testResult.getUuid();
- String path = SlcJcrUtils.createResultPath(uuid);
- Node resultNode = JcrUtils.mkdirs(session, path, SlcTypes.SLC_RESULT);
+ String path = SlcJcrUtils.createResultPath(session, uuid);
+ Node resultNode = JcrUtils.mkdirs(session, path, SlcTypes.SLC_TEST_RESULT);
resultNode.setProperty(SLC_UUID, uuid);
for (Map.Entry<String, String> entry : testResult.getAttributes()
.entrySet()) {