]> git.argeo.org Git - gpl/argeo-slc.git/blobdiff - runtime/org.argeo.slc.unit/src/main/java/org/argeo/slc/unit/test/tree/TreeTestResultTestUtils.java
Adapt to changes in Argeo Commons
[gpl/argeo-slc.git] / runtime / org.argeo.slc.unit / src / main / java / org / argeo / slc / unit / test / tree / TreeTestResultTestUtils.java
index cf4b0c1e4db848c081d6422199f6467540905bf2..2d1725887440588975040a26546d99817f49f921 100644 (file)
@@ -1,8 +1,25 @@
+/*\r
+ * Copyright (C) 2007-2012 Mathieu Baudier\r
+ *\r
+ * Licensed under the Apache License, Version 2.0 (the "License");\r
+ * you may not use this file except in compliance with the License.\r
+ * You may obtain a copy of the License at\r
+ *\r
+ *         http://www.apache.org/licenses/LICENSE-2.0\r
+ *\r
+ * Unless required by applicable law or agreed to in writing, software\r
+ * distributed under the License is distributed on an "AS IS" BASIS,\r
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ * See the License for the specific language governing permissions and\r
+ * limitations under the License.\r
+ */\r
 package org.argeo.slc.unit.test.tree;\r
 \r
 import java.util.UUID;\r
 \r
+\r
 import org.argeo.slc.build.Distribution;\r
+import org.argeo.slc.core.attachment.SimpleAttachment;\r
 import org.argeo.slc.core.structure.SimpleSElement;\r
 import org.argeo.slc.core.structure.tree.TreeSPath;\r
 import org.argeo.slc.core.structure.tree.TreeSRegistry;\r
@@ -41,11 +58,32 @@ public abstract class TreeTestResultTestUtils {
                return ttr;\r
        }\r
 \r
+       public static TreeTestResult createComplexeTreeTestResult() {\r
+               SlcExecution slcExecution = SlcExecutionTestUtils\r
+                               .createSimpleSlcExecution();\r
+               SlcExecutionStep step = new SlcExecutionStep("JUnit step");\r
+               slcExecution.getSteps().add(step);\r
+\r
+               TreeTestResult ttr = createMinimalConsistentTreeTestResult(slcExecution);\r
+\r
+               ttr.addResultPart(createSimpleResultPartPassed());\r
+               ttr.addResultPart(createSimpleResultPartFailed());\r
+               //ttr.addResultPart(createSimpleResultPartError());\r
+               \r
+               SimpleAttachment sa = new SimpleAttachment(UUID.randomUUID().toString(),"AnAttachment","UTF8");\r
+               SimpleAttachment sa2 = new SimpleAttachment(UUID.randomUUID().toString(),"AnOtherAttachment","UTF8");\r
+               ttr.addAttachment(sa);\r
+               ttr.addAttachment(sa2);\r
+               return ttr;\r
+       }\r
+\r
        public static TreeTestResult createMinimalConsistentTreeTestResult(\r
                        SlcExecution slcExecution) {\r
                SimpleTestRun testRun = new SimpleTestRun();\r
                testRun.setUuid(UUID.randomUUID().toString());\r
 \r
+               // Doesn't work in hibernate with such a path.\r
+               //String pathStr = "/fileDiff/testcases/issue";\r
                String pathStr = "/test";\r
                TreeSPath path = new TreeSPath(pathStr);\r
 \r