1 package org
.argeo
.slc
.ws
;
4 import java
.util
.Vector
;
6 import org
.springframework
.ws
.client
.core
.WebServiceTemplate
;
7 import org
.springframework
.ws
.soap
.client
.SoapFaultClientException
;
9 import org
.apache
.commons
.logging
.Log
;
10 import org
.apache
.commons
.logging
.LogFactory
;
12 import org
.argeo
.slc
.core
.process
.SlcExecution
;
13 import org
.argeo
.slc
.core
.process
.SlcExecutionStep
;
14 import org
.argeo
.slc
.msg
.process
.SlcExecutionRequest
;
15 import org
.argeo
.slc
.msg
.process
.SlcExecutionStatusRequest
;
16 import org
.argeo
.slc
.msg
.process
.SlcExecutionStepsRequest
;
17 import org
.argeo
.slc
.unit
.AbstractSpringTestCase
;
18 import org
.argeo
.slc
.unit
.process
.SlcExecutionTestUtils
;
19 import org
.argeo
.slc
.ws
.client
.WebServiceUtils
;
21 public class SlcExecutionWsIntegrationTest
extends AbstractSpringTestCase
{
22 private Log log
= LogFactory
.getLog(getClass());
24 WebServiceTemplate template
;
27 template
= getBean(WebServiceTemplate
.class);
31 public void testSlcExecutionRequests() {
32 SlcExecution slcExec
= SlcExecutionTestUtils
.createSimpleSlcExecution();
34 log
.info("Send create SlcExecutionRequest for SlcExecution #"
36 template
.marshalSendAndReceive(new SlcExecutionRequest(slcExec
));
38 slcExec
.setUser("otherUser");
39 log
.info("Send update SlcExecutionRequest for SlcExecution #"
41 template
.marshalSendAndReceive(new SlcExecutionRequest(slcExec
));
44 public void testSlcExecutionStatusRequest() {
45 SlcExecution slcExec
= SlcExecutionTestUtils
.createSimpleSlcExecution();
47 log
.info("Send create SlcExecutionRequest for SlcExecution #"
49 template
.marshalSendAndReceive(new SlcExecutionRequest(slcExec
));
51 slcExec
.setStatus(SlcExecution
.STATUS_FINISHED
);
52 log
.info("Send update SlcExecutionStatusRequest for SlcExecution #"
54 template
.marshalSendAndReceive(new SlcExecutionStatusRequest(slcExec
55 .getUuid(), slcExec
.getStatus()));
58 public void testSendSlcExecutionStepRequest() {
59 SlcExecution slcExec
= SlcExecutionTestUtils
.createSimpleSlcExecution();
61 log
.info("Send create SlcExecutionRequest for SlcExecution #"
63 template
.marshalSendAndReceive(new SlcExecutionRequest(slcExec
));
65 SlcExecutionStep step1
= new SlcExecutionStep(
66 "Logline\nAnother log line.");
67 SlcExecutionStep step2
= new SlcExecutionStep(
68 "Logline2\nAnother log line2.");
69 List
<SlcExecutionStep
> steps
= new Vector
<SlcExecutionStep
>();
73 slcExec
.setStatus(SlcExecution
.STATUS_FINISHED
);
74 log
.info("Send SlcExecutionStepsRequest for SlcExecution #"
77 template
.marshalSendAndReceive(new SlcExecutionStepsRequest(slcExec
79 } catch (SoapFaultClientException e
) {
80 WebServiceUtils
.manageSoapException(e
);