]> git.argeo.org Git - gpl/argeo-slc.git/blobdiff - runtime/org.argeo.slc.support.castor/src/test/java/org/argeo/slc/castor/ExecutionAnswerCastorTest.java
Introduce ExecutionAnswer
[gpl/argeo-slc.git] / runtime / org.argeo.slc.support.castor / src / test / java / org / argeo / slc / castor / ExecutionAnswerCastorTest.java
diff --git a/runtime/org.argeo.slc.support.castor/src/test/java/org/argeo/slc/castor/ExecutionAnswerCastorTest.java b/runtime/org.argeo.slc.support.castor/src/test/java/org/argeo/slc/castor/ExecutionAnswerCastorTest.java
new file mode 100644 (file)
index 0000000..a9bc160
--- /dev/null
@@ -0,0 +1,25 @@
+package org.argeo.slc.castor;\r
+\r
+import org.argeo.slc.msg.ExecutionAnswer;\r
+\r
+public class ExecutionAnswerCastorTest extends AbstractCastorTestCase {\r
+       public void testMarshUnmarshOk() throws Exception {\r
+               ExecutionAnswer answer = new ExecutionAnswer(ExecutionAnswer.OK,\r
+                               "No problem!");\r
+               ExecutionAnswer answerUnm = marshUnmarsh(answer);\r
+               assertExecutionAnswer(answer, answerUnm);\r
+       }\r
+\r
+       public void testMarshUnmarshError() throws Exception {\r
+               ExecutionAnswer answer = new ExecutionAnswer(ExecutionAnswer.ERROR,\r
+                               "Oooops...");\r
+               ExecutionAnswer answerUnm = marshUnmarsh(answer);\r
+               assertExecutionAnswer(answer, answerUnm);\r
+       }\r
+\r
+       public static void assertExecutionAnswer(ExecutionAnswer expected,\r
+                       ExecutionAnswer reached) {\r
+               assertEquals(expected.getStatus(), reached.getStatus());\r
+               assertEquals(expected.getMessage(), reached.getMessage());\r
+       }\r
+}\r