X-Git-Url: http://git.argeo.org/?a=blobdiff_plain;f=runtime%2Forg.argeo.slc.unit%2Fsrc%2Fmain%2Fjava%2Forg%2Fargeo%2Fslc%2Funit%2Fprocess%2FSlcExecutionTestUtils.java;h=ea4910b6f0a9f75a9d7dca6d34f29a87b4e22f9f;hb=a0a151ee3a0aed29a3cb03d81e35d540ca9fdb03;hp=508db662c39fdc749454619f254d35332a7243fa;hpb=9b15274f8e1425882bee220a1dd7f9ab9e5aba6f;p=gpl%2Fargeo-slc.git diff --git a/runtime/org.argeo.slc.unit/src/main/java/org/argeo/slc/unit/process/SlcExecutionTestUtils.java b/runtime/org.argeo.slc.unit/src/main/java/org/argeo/slc/unit/process/SlcExecutionTestUtils.java index 508db662c..ea4910b6f 100644 --- a/runtime/org.argeo.slc.unit/src/main/java/org/argeo/slc/unit/process/SlcExecutionTestUtils.java +++ b/runtime/org.argeo.slc.unit/src/main/java/org/argeo/slc/unit/process/SlcExecutionTestUtils.java @@ -1,3 +1,18 @@ +/* + * 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.process; import static junit.framework.Assert.assertEquals; @@ -9,6 +24,7 @@ import java.util.List; import java.util.UUID; import org.argeo.slc.execution.ExecutionFlowDescriptor; +import org.argeo.slc.execution.ExecutionStep; import org.argeo.slc.process.RealizedFlow; import org.argeo.slc.process.SlcExecution; import org.argeo.slc.process.SlcExecutionStep; @@ -36,7 +52,7 @@ public abstract class SlcExecutionTestUtils { realizedFlow.setModuleName("test.module"); realizedFlow.setModuleVersion("1.0.0"); realizedFlow.setFlowDescriptor(flowDescriptor); - realizedFlow.setExecutionSpec(flowDescriptor.getExecutionSpec()); + //realizedFlow.setExecutionSpec(flowDescriptor.getExecutionSpec()); realizedFlows.add(realizedFlow); slcExec.setRealizedFlows(realizedFlows); return slcExec; @@ -73,17 +89,21 @@ public abstract class SlcExecutionTestUtils { } - public static void assertSlcExecutionStep(SlcExecutionStep expected, - SlcExecutionStep reached) { + public static void assertSlcExecutionStep(ExecutionStep expected, + ExecutionStep reached) { assertNotNull(reached); - assertEquals(expected.getUuid(), reached.getUuid()); assertEquals(expected.getType(), reached.getType()); - assertDateSec(expected.getBegin(), reached.getBegin()); - assertEquals(expected.getLogLines().size(), reached.getLogLines() - .size()); - for (int i = 0; i < expected.getLogLines().size(); i++) { - assertEquals(expected.getLogLines().get(i), reached.getLogLines() - .get(i)); + assertDateSec(expected.getTimestamp(), reached.getTimestamp()); + if (expected instanceof SlcExecutionStep) { + SlcExecutionStep slcExpected = (SlcExecutionStep)expected; + SlcExecutionStep slcReached = (SlcExecutionStep)reached; + assertEquals(slcExpected.getUuid(), slcReached.getUuid()); + assertEquals(slcExpected.getLogLines().size(), slcReached.getLogLines() + .size()); + for (int i = 0; i < slcExpected.getLogLines().size(); i++) { + assertEquals(slcExpected.getLogLines().get(i), slcReached + .getLogLines().get(i)); + } } }