X-Git-Url: http://git.argeo.org/?a=blobdiff_plain;f=runtime%2Forg.argeo.slc.unit%2Fsrc%2Fmain%2Fjava%2Forg%2Fargeo%2Fslc%2Funit%2Ftest%2Ftree%2FTreeTestResultTestUtils.java;h=2d1725887440588975040a26546d99817f49f921;hb=5fe677bf811739592b1089471181e39f9cbe4f3f;hp=cf4b0c1e4db848c081d6422199f6467540905bf2;hpb=ee6c3543a0ff9403420ce6a9c647723269f14331;p=gpl%2Fargeo-slc.git diff --git a/runtime/org.argeo.slc.unit/src/main/java/org/argeo/slc/unit/test/tree/TreeTestResultTestUtils.java b/runtime/org.argeo.slc.unit/src/main/java/org/argeo/slc/unit/test/tree/TreeTestResultTestUtils.java index cf4b0c1e4..2d1725887 100644 --- a/runtime/org.argeo.slc.unit/src/main/java/org/argeo/slc/unit/test/tree/TreeTestResultTestUtils.java +++ b/runtime/org.argeo.slc.unit/src/main/java/org/argeo/slc/unit/test/tree/TreeTestResultTestUtils.java @@ -1,8 +1,25 @@ +/* + * 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.unit.test.tree; import java.util.UUID; + import org.argeo.slc.build.Distribution; +import org.argeo.slc.core.attachment.SimpleAttachment; import org.argeo.slc.core.structure.SimpleSElement; import org.argeo.slc.core.structure.tree.TreeSPath; import org.argeo.slc.core.structure.tree.TreeSRegistry; @@ -41,11 +58,32 @@ public abstract class TreeTestResultTestUtils { return ttr; } + public static TreeTestResult createComplexeTreeTestResult() { + SlcExecution slcExecution = SlcExecutionTestUtils + .createSimpleSlcExecution(); + SlcExecutionStep step = new SlcExecutionStep("JUnit step"); + slcExecution.getSteps().add(step); + + TreeTestResult ttr = createMinimalConsistentTreeTestResult(slcExecution); + + ttr.addResultPart(createSimpleResultPartPassed()); + ttr.addResultPart(createSimpleResultPartFailed()); + //ttr.addResultPart(createSimpleResultPartError()); + + SimpleAttachment sa = new SimpleAttachment(UUID.randomUUID().toString(),"AnAttachment","UTF8"); + SimpleAttachment sa2 = new SimpleAttachment(UUID.randomUUID().toString(),"AnOtherAttachment","UTF8"); + ttr.addAttachment(sa); + ttr.addAttachment(sa2); + return ttr; + } + public static TreeTestResult createMinimalConsistentTreeTestResult( SlcExecution slcExecution) { SimpleTestRun testRun = new SimpleTestRun(); testRun.setUuid(UUID.randomUUID().toString()); + // Doesn't work in hibernate with such a path. + //String pathStr = "/fileDiff/testcases/issue"; String pathStr = "/test"; TreeSPath path = new TreeSPath(pathStr);