Cleaned up sandbox a bit

This commit is contained in:
Arjen Poutsma
2007-11-13 18:18:00 +00:00
parent bccd721644
commit 55b8cae1d5
19 changed files with 245 additions and 908 deletions

View File

@@ -4,9 +4,9 @@
package org.springframework.ws.soap.addressing;
import java.net.URI;
import java.util.Iterator;
import org.easymock.MockControl;
import org.springframework.ws.context.DefaultMessageContext;
import org.springframework.ws.context.MessageContext;
import org.springframework.ws.soap.SoapHeaderElement;
@@ -16,6 +16,8 @@ import org.springframework.ws.soap.saaj.SaajSoapMessageFactory;
import org.springframework.ws.transport.WebServiceConnection;
import org.springframework.ws.transport.WebServiceMessageSender;
import org.easymock.MockControl;
public abstract class AbstractWsAddressingInterceptorTestCase extends AbstractWsAddressingTestCase {
protected WsAddressingInterceptor interceptor;
@@ -107,7 +109,7 @@ public abstract class AbstractWsAddressingInterceptorTestCase extends AbstractWs
String messageId = "uid:1234";
strategyControl.expectAndReturn(strategyMock.newMessageId(response), messageId);
String uri = "http://example.com/business/client1";
URI uri = new URI("http://example.com/business/client1");
senderControl.expectAndReturn(senderMock.supports(uri), true);
senderControl.expectAndReturn(senderMock.createConnection(uri), connectionMock);
connectionMock.send(response);

View File

@@ -0,0 +1,45 @@
/*
* Copyright 2007 the original author or authors.
*
* 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.springframework.ws.transport.tcp;
import org.springframework.test.AbstractDependencyInjectionSpringContextTests;
import org.springframework.ws.client.core.WebServiceTemplate;
import org.springframework.xml.transform.StringResult;
import org.springframework.xml.transform.StringSource;
import org.custommonkey.xmlunit.XMLAssert;
public class TcpIntegrationTest extends AbstractDependencyInjectionSpringContextTests {
private WebServiceTemplate webServiceTemplate;
protected String[] getConfigLocations() {
return new String[]{"classpath:org/springframework/ws/transport/tcp/tcp-applicationContext.xml"};
}
public void setWebServiceTemplate(WebServiceTemplate webServiceTemplate) {
this.webServiceTemplate = webServiceTemplate;
}
public void testJmsTransport() throws Exception {
String content = "<root xmlns='http://springframework.org/spring-ws'><child/></root>";
StringResult result = new StringResult();
webServiceTemplate.sendSourceAndReceiveToResult(new StringSource(content), result);
XMLAssert.assertXMLEqual("Invalid content received", content, result.toString());
applicationContext.close();
}
}

View File

@@ -0,0 +1,38 @@
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:util="http://www.springframework.org/schema/util"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-2.0.xsd">
<bean id="messageFactory" class="org.springframework.ws.soap.saaj.SaajSoapMessageFactory">
<property name="soapVersion">
<util:constant static-field="org.springframework.ws.soap.SoapVersion.SOAP_12"/>
</property>
</bean>
<bean id="messagingReceiver" class="org.springframework.ws.transport.tcp.TcpMessageReceiver">
<property name="messageFactory" ref="messageFactory"/>
<property name="messageReceiver" ref="messageDispatcher"/>
<property name="bindAddress" value="localhost"/>
</bean>
<bean id="webServiceTemplate" class="org.springframework.ws.client.core.WebServiceTemplate">
<constructor-arg ref="messageFactory"/>
<property name="messageSender">
<bean class="org.springframework.ws.transport.tcp.TcpMessageSender"/>
</property>
<property name="defaultUri" value="tcp://localhost"/>
</bean>
<bean id="messageDispatcher" class="org.springframework.ws.soap.server.SoapMessageDispatcher">
<property name="endpointMappings">
<bean class="org.springframework.ws.server.endpoint.mapping.PayloadRootQNameEndpointMapping">
<property name="defaultEndpoint">
<bean class="org.springframework.ws.transport.support.EchoPayloadEndpoint"/>
</property>
</bean>
</property>
</bean>
</beans>