From 8a8d8343a2c5becde343de96252e136403a3b7ce Mon Sep 17 00:00:00 2001 From: Mark Fisher Date: Wed, 28 Sep 2011 07:40:44 -0400 Subject: [PATCH] fixed test to run in different environments --- .../integration/ws/config/UriVariableTests-context.xml | 6 +++--- .../integration/ws/config/UriVariableTests.java | 10 +++++++--- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/spring-integration-ws/src/test/java/org/springframework/integration/ws/config/UriVariableTests-context.xml b/spring-integration-ws/src/test/java/org/springframework/integration/ws/config/UriVariableTests-context.xml index 38b7de9f5e..7fff586b7f 100644 --- a/spring-integration-ws/src/test/java/org/springframework/integration/ws/config/UriVariableTests-context.xml +++ b/spring-integration-ws/src/test/java/org/springframework/integration/ws/config/UriVariableTests-context.xml @@ -7,9 +7,9 @@ http://www.springframework.org/schema/integration/ws http://www.springframework.org/schema/integration/ws/spring-integration-ws.xsd"> - - - + + + diff --git a/spring-integration-ws/src/test/java/org/springframework/integration/ws/config/UriVariableTests.java b/spring-integration-ws/src/test/java/org/springframework/integration/ws/config/UriVariableTests.java index c3093646d0..58c7697282 100644 --- a/spring-integration-ws/src/test/java/org/springframework/integration/ws/config/UriVariableTests.java +++ b/spring-integration-ws/src/test/java/org/springframework/integration/ws/config/UriVariableTests.java @@ -17,6 +17,7 @@ package org.springframework.integration.ws.config; import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertTrue; import java.net.URI; import java.net.URISyntaxException; @@ -36,6 +37,7 @@ import org.springframework.ws.client.WebServiceClientException; import org.springframework.ws.client.WebServiceIOException; import org.springframework.ws.client.support.interceptor.ClientInterceptor; import org.springframework.ws.context.MessageContext; +import org.springframework.ws.soap.SoapMessageCreationException; import org.springframework.ws.transport.context.TransportContext; import org.springframework.ws.transport.context.TransportContextHolder; import org.springframework.ws.transport.http.HttpUrlConnection; @@ -55,15 +57,17 @@ public class UriVariableTests { public void checkUriVariables() { MessageChannel input = context.getBean("input", MessageChannel.class); TestClientInterceptor interceptor = context.getBean("interceptor", TestClientInterceptor.class); - Message message = MessageBuilder.withPayload("").setHeader("bar", "BAR").build(); + Message message = MessageBuilder.withPayload("").setHeader("x", "integration").build(); try { input.send(message); } catch (MessageHandlingException e) { // expected - assertEquals(WebServiceIOException.class, e.getCause().getClass()); + Class causeType = e.getCause().getClass(); + assertTrue(WebServiceIOException.class.equals(causeType) // offline + || SoapMessageCreationException.class.equals(causeType)); } - assertEquals("http://localhost/test/FOO/BAR", interceptor.getLastUri().toString()); + assertEquals("http://springsource.org/spring-integration", interceptor.getLastUri().toString()); }