X-Git-Url: http://git.argeo.org/?a=blobdiff_plain;f=legacy%2Fintegration-tests%2Forg.argeo.slc.it.webapp%2Fsrc%2Ftest%2Fjava-old%2Forg%2Fargeo%2Fslc%2Fws%2FSlcExecutionWsIntegrationTest.java;fp=legacy%2Fintegration-tests%2Forg.argeo.slc.it.webapp%2Fsrc%2Ftest%2Fjava-old%2Forg%2Fargeo%2Fslc%2Fws%2FSlcExecutionWsIntegrationTest.java;h=0000000000000000000000000000000000000000;hb=0e75bed97c103d94640dd4c8e36cdce24b11390a;hp=2f5d05b23bfd122752d51961253fc7c5d70112e2;hpb=57aa5d64fb38af2d98076eeaaa11573b3147cc26;p=gpl%2Fargeo-slc.git diff --git a/legacy/integration-tests/org.argeo.slc.it.webapp/src/test/java-old/org/argeo/slc/ws/SlcExecutionWsIntegrationTest.java b/legacy/integration-tests/org.argeo.slc.it.webapp/src/test/java-old/org/argeo/slc/ws/SlcExecutionWsIntegrationTest.java deleted file mode 100644 index 2f5d05b23..000000000 --- a/legacy/integration-tests/org.argeo.slc.it.webapp/src/test/java-old/org/argeo/slc/ws/SlcExecutionWsIntegrationTest.java +++ /dev/null @@ -1,95 +0,0 @@ -/* - * Copyright (C) 2010 Mathieu Baudier - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.argeo.slc.ws; - -import java.util.List; -import java.util.Vector; - -import org.springframework.ws.client.core.WebServiceTemplate; -import org.springframework.ws.soap.client.SoapFaultClientException; - -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; - -import org.argeo.slc.msg.process.SlcExecutionRequest; -import org.argeo.slc.msg.process.SlcExecutionStatusRequest; -import org.argeo.slc.msg.process.SlcExecutionStepsRequest; -import org.argeo.slc.process.SlcExecution; -import org.argeo.slc.process.SlcExecutionStep; -import org.argeo.slc.unit.AbstractSpringTestCase; -import org.argeo.slc.unit.process.SlcExecutionTestUtils; -import org.argeo.slc.ws.client.WebServiceUtils; - -public class SlcExecutionWsIntegrationTest extends AbstractSpringTestCase { - private Log log = LogFactory.getLog(getClass()); - - private WebServiceTemplate template; - - public void setUp() { - template = getBean(WebServiceTemplate.class); - } - - public void testSlcExecutionRequests() { - SlcExecution slcExec = createAndSendSlcExecution(); - - slcExec.setUser("otherUser"); - log.info("Send update SlcExecutionRequest for SlcExecution #" - + slcExec.getUuid()); - template.marshalSendAndReceive(new SlcExecutionRequest(slcExec)); - } - - public void testSlcExecutionStatusRequest() { - SlcExecution slcExec = createAndSendSlcExecution(); - - slcExec.setStatus(SlcExecution.STATUS_FINISHED); - log.info("Send SlcExecutionStatusRequest for SlcExecution #" - + slcExec.getUuid()); - template.marshalSendAndReceive(new SlcExecutionStatusRequest(slcExec - .getUuid(), slcExec.getStatus())); - } - - public void testSendSlcExecutionStepRequest() { - SlcExecution slcExec = createAndSendSlcExecution(); - - SlcExecutionStep step1 = new SlcExecutionStep( - "Logline\nAnother log line."); - SlcExecutionStep step2 = new SlcExecutionStep( - "Logline2\nAnother log line2."); - List steps = new Vector(); - steps.add(step1); - steps.add(step2); - - log.info("Send SlcExecutionStepsRequest for SlcExecution #" - + slcExec.getUuid()); - try { - template.marshalSendAndReceive(new SlcExecutionStepsRequest(slcExec - .getUuid(), steps)); - } catch (SoapFaultClientException e) { - WebServiceUtils.manageSoapException(e); - throw e; - } - } - - protected SlcExecution createAndSendSlcExecution() { - SlcExecution slcExec = SlcExecutionTestUtils.createSimpleSlcExecution(); - - log.info("Send create SlcExecutionRequest for SlcExecution #" - + slcExec.getUuid()); - template.marshalSendAndReceive(new SlcExecutionRequest(slcExec)); - return slcExec; - } -}