1 package org
.argeo
.slc
.core
.process
;
5 import junit
.framework
.TestCase
;
7 public abstract class SlcExecutionTestUtils
extends TestCase
{
9 public static SlcExecution
createSimpleSlcExecution() {
10 SlcExecution slcExec
= new SlcExecution();
11 slcExec
.setUuid(UUID
.randomUUID().toString());
12 slcExec
.setHost("localhost");
13 slcExec
.setUser("user");
14 slcExec
.setType("slcAnt");
15 slcExec
.setStatus("STARTED");
16 slcExec
.getAttributes().put("ant.file", "/test");
20 public static void assertSlcExecution(SlcExecution expected
,
21 SlcExecution reached
) {
22 assertNotNull(reached
);
23 assertEquals(expected
.getHost(), reached
.getHost());
24 assertEquals(expected
.getUser(), reached
.getUser());
25 assertEquals(expected
.getType(), reached
.getType());
26 assertEquals(expected
.getStatus(), reached
.getStatus());
27 assertEquals(expected
.getAttributes().size(), reached
.getAttributes()
29 for (String key
: expected
.getAttributes().keySet()) {
30 String expectedValue
= expected
.getAttributes().get(key
);
31 String reachedValue
= reached
.getAttributes().get(key
);
32 assertNotNull(reachedValue
);
33 assertEquals(expectedValue
, reachedValue
);
37 public static void assertSlcExecutionStep(SlcExecutionStep expected
,
38 SlcExecutionStep reached
) {
39 assertNotNull(reached
);
40 assertEquals(expected
.getUuid(), reached
.getUuid());
41 assertEquals(expected
.getType(), reached
.getType());
42 assertEquals(expected
.logAsString(), reached
.logAsString());
43 // assertEquals(expected.getBegin(), reached.getBegin());
46 private SlcExecutionTestUtils() {