X-Git-Url: http://git.argeo.org/?a=blobdiff_plain;f=runtime%2Forg.argeo.slc.support.castor%2Fsrc%2Ftest%2Fjava%2Forg%2Fargeo%2Fslc%2Fcastor%2FExecutionAnswerCastorTest.java;fp=runtime%2Forg.argeo.slc.support.castor%2Fsrc%2Ftest%2Fjava%2Forg%2Fargeo%2Fslc%2Fcastor%2FExecutionAnswerCastorTest.java;h=a9bc16024841a63371b2f44e471297689993dde7;hb=66a8dc805e2edf46a9d73452d5d9af1d4656eea4;hp=0000000000000000000000000000000000000000;hpb=e9071e983eea635a04f409487359aaedd679901d;p=gpl%2Fargeo-slc.git 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 index 000000000..a9bc16024 --- /dev/null +++ b/runtime/org.argeo.slc.support.castor/src/test/java/org/argeo/slc/castor/ExecutionAnswerCastorTest.java @@ -0,0 +1,25 @@ +package org.argeo.slc.castor; + +import org.argeo.slc.msg.ExecutionAnswer; + +public class ExecutionAnswerCastorTest extends AbstractCastorTestCase { + public void testMarshUnmarshOk() throws Exception { + ExecutionAnswer answer = new ExecutionAnswer(ExecutionAnswer.OK, + "No problem!"); + ExecutionAnswer answerUnm = marshUnmarsh(answer); + assertExecutionAnswer(answer, answerUnm); + } + + public void testMarshUnmarshError() throws Exception { + ExecutionAnswer answer = new ExecutionAnswer(ExecutionAnswer.ERROR, + "Oooops..."); + ExecutionAnswer answerUnm = marshUnmarsh(answer); + assertExecutionAnswer(answer, answerUnm); + } + + public static void assertExecutionAnswer(ExecutionAnswer expected, + ExecutionAnswer reached) { + assertEquals(expected.getStatus(), reached.getStatus()); + assertEquals(expected.getMessage(), reached.getMessage()); + } +}