\r
import java.util.UUID;\r
\r
-import junit.framework.TestCase;\r
+import static junit.framework.Assert.assertEquals;\r
+import static junit.framework.Assert.assertNotNull;\r
+import static org.argeo.slc.unit.UnitUtils.assertDateSec;\r
\r
-public abstract class SlcExecutionTestUtils extends TestCase{\r
+public abstract class SlcExecutionTestUtils {\r
\r
public static SlcExecution createSimpleSlcExecution() {\r
SlcExecution slcExec = new SlcExecution();\r
slcExec.setUuid(UUID.randomUUID().toString());\r
slcExec.setHost("localhost");\r
- slcExec.setPath("/test");\r
+ slcExec.setUser("user");\r
slcExec.setType("slcAnt");\r
slcExec.setStatus("STARTED");\r
+ slcExec.getAttributes().put("ant.file", "/test");\r
return slcExec;\r
}\r
\r
- public static void assertSlcExecution(SlcExecution expected, SlcExecution reached) {\r
+ public static void assertSlcExecution(SlcExecution expected,\r
+ SlcExecution reached) {\r
assertNotNull(reached);\r
assertEquals(expected.getHost(), reached.getHost());\r
- assertEquals(expected.getPath(), reached.getPath());\r
+ assertEquals(expected.getUser(), reached.getUser());\r
assertEquals(expected.getType(), reached.getType());\r
assertEquals(expected.getStatus(), reached.getStatus());\r
+ assertEquals(expected.getAttributes().size(), reached.getAttributes()\r
+ .size());\r
+ for (String key : expected.getAttributes().keySet()) {\r
+ String expectedValue = expected.getAttributes().get(key);\r
+ String reachedValue = reached.getAttributes().get(key);\r
+ assertNotNull(reachedValue);\r
+ assertEquals(expectedValue, reachedValue);\r
+ }\r
}\r
\r
public static void assertSlcExecutionStep(SlcExecutionStep expected,\r
assertEquals(expected.getUuid(), reached.getUuid());\r
assertEquals(expected.getType(), reached.getType());\r
assertEquals(expected.logAsString(), reached.logAsString());\r
- assertEquals(expected.getBegin(), reached.getBegin());\r
+ assertDateSec(expected.getBegin(), reached.getBegin());\r
}\r
\r
- private SlcExecutionTestUtils(){\r
- \r
+ private SlcExecutionTestUtils() {\r
+\r
}\r
}\r