From 473b4285fd9f585aeade861b01555b52c1d46f1e Mon Sep 17 00:00:00 2001 From: Arjen Poutsma Date: Wed, 12 Feb 2014 16:49:37 +0100 Subject: [PATCH] Fixing tests for JDK 1.7 Fixed a couple of tests so that they work under JDK 1.7. --- ...nnotationDrivenBeanDefinitionParserTest.java | 2 +- ...annotationDrivenBeanDefinitionParserTest.xml | 2 +- .../ws/config/wsdlBeanDefinitionParserTest.xml | 2 +- .../ws/transport/http/WEB-INF/sws-servlet.xml | 2 +- .../matcher/SchemaValidatingMatcherTest.java | 17 ++++++++++------- .../matcher/schemaValidatingMatcherTest-1.xsd | 12 ++++++++++++ .../matcher/schemaValidatingMatcherTest-2.xsd | 5 +++++ 7 files changed, 31 insertions(+), 11 deletions(-) create mode 100644 spring-ws-test/src/test/resources/org/springframework/ws/test/support/matcher/schemaValidatingMatcherTest-1.xsd create mode 100644 spring-ws-test/src/test/resources/org/springframework/ws/test/support/matcher/schemaValidatingMatcherTest-2.xsd diff --git a/spring-ws-core/src/test/java/org/springframework/ws/config/AnnotationDrivenBeanDefinitionParserTest.java b/spring-ws-core/src/test/java/org/springframework/ws/config/AnnotationDrivenBeanDefinitionParserTest.java index 12a50111..b6af0514 100644 --- a/spring-ws-core/src/test/java/org/springframework/ws/config/AnnotationDrivenBeanDefinitionParserTest.java +++ b/spring-ws-core/src/test/java/org/springframework/ws/config/AnnotationDrivenBeanDefinitionParserTest.java @@ -124,7 +124,7 @@ public class AnnotationDrivenBeanDefinitionParserTest { break; } } - assertTrue("No [" + clazz.getName() + "] instance found", found); + assertTrue("No [" + clazz.getName() + "] instance found in " + collection, found); } } diff --git a/spring-ws-core/src/test/resources/org/springframework/ws/config/annotationDrivenBeanDefinitionParserTest.xml b/spring-ws-core/src/test/resources/org/springframework/ws/config/annotationDrivenBeanDefinitionParserTest.xml index 1e75d683..e5c4b7ea 100644 --- a/spring-ws-core/src/test/resources/org/springframework/ws/config/annotationDrivenBeanDefinitionParserTest.xml +++ b/spring-ws-core/src/test/resources/org/springframework/ws/config/annotationDrivenBeanDefinitionParserTest.xml @@ -3,7 +3,7 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:sws="http://www.springframework.org/schema/web-services" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd - http://www.springframework.org/schema/web-services http://static.springframework.org/schema/web-services/web-services-2.0.xsd"> + http://www.springframework.org/schema/web-services http://www.springframework.org/schema/web-services/web-services-2.0.xsd"> diff --git a/spring-ws-core/src/test/resources/org/springframework/ws/config/wsdlBeanDefinitionParserTest.xml b/spring-ws-core/src/test/resources/org/springframework/ws/config/wsdlBeanDefinitionParserTest.xml index 5bf45dac..d091f7fd 100644 --- a/spring-ws-core/src/test/resources/org/springframework/ws/config/wsdlBeanDefinitionParserTest.xml +++ b/spring-ws-core/src/test/resources/org/springframework/ws/config/wsdlBeanDefinitionParserTest.xml @@ -3,7 +3,7 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:sws="http://www.springframework.org/schema/web-services" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd - http://www.springframework.org/schema/web-services http://static.springframework.org/schema/web-services/web-services-2.0.xsd"> + http://www.springframework.org/schema/web-services http://www.springframework.org/schema/web-services/web-services-2.0.xsd"> diff --git a/spring-ws-core/src/test/resources/org/springframework/ws/transport/http/WEB-INF/sws-servlet.xml b/spring-ws-core/src/test/resources/org/springframework/ws/transport/http/WEB-INF/sws-servlet.xml index c86c1376..5eef94b8 100644 --- a/spring-ws-core/src/test/resources/org/springframework/ws/transport/http/WEB-INF/sws-servlet.xml +++ b/spring-ws-core/src/test/resources/org/springframework/ws/transport/http/WEB-INF/sws-servlet.xml @@ -3,7 +3,7 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:sws="http://www.springframework.org/schema/web-services" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd - http://www.springframework.org/schema/web-services http://static.springframework.org/schema/web-services/web-services-2.0.xsd"> + http://www.springframework.org/schema/web-services http://www.springframework.org/schema/web-services/web-services-2.0.xsd"> diff --git a/spring-ws-test/src/test/java/org/springframework/ws/test/support/matcher/SchemaValidatingMatcherTest.java b/spring-ws-test/src/test/java/org/springframework/ws/test/support/matcher/SchemaValidatingMatcherTest.java index 755decd4..338cec3f 100644 --- a/spring-ws-test/src/test/java/org/springframework/ws/test/support/matcher/SchemaValidatingMatcherTest.java +++ b/spring-ws-test/src/test/java/org/springframework/ws/test/support/matcher/SchemaValidatingMatcherTest.java @@ -31,17 +31,20 @@ import static org.easymock.EasyMock.*; public class SchemaValidatingMatcherTest { - private Resource schema2; + private Resource schema; private Resource schema1; + private Resource schema2; + private WebServiceMessage message; @Before public void setUp() { message = createMock(WebServiceMessage.class); - schema1 = new ClassPathResource("schemaValidatingMatcherTest.xsd", SchemaValidatingMatcherTest.class); - schema2 = new ByteArrayResource("".getBytes()); + schema = new ClassPathResource("schemaValidatingMatcherTest.xsd", SchemaValidatingMatcherTest.class); + schema1 = new ClassPathResource("schemaValidatingMatcherTest-1.xsd", SchemaValidatingMatcherTest.class); + schema2 = new ClassPathResource("schemaValidatingMatcherTest-2.xsd", SchemaValidatingMatcherTest.class); } @Test @@ -49,7 +52,7 @@ public class SchemaValidatingMatcherTest { expect(message.getPayloadSource()).andReturn(new StringSource( "0text")); - SchemaValidatingMatcher matcher = new SchemaValidatingMatcher(schema1); + SchemaValidatingMatcher matcher = new SchemaValidatingMatcher(schema); replay(message); @@ -63,7 +66,7 @@ public class SchemaValidatingMatcherTest { expect(message.getPayloadSource()).andReturn(new StringSource( "atext")).times(2); - SchemaValidatingMatcher matcher = new SchemaValidatingMatcher(schema1); + SchemaValidatingMatcher matcher = new SchemaValidatingMatcher(schema); replay(message); @@ -105,7 +108,7 @@ public class SchemaValidatingMatcherTest { expect(message.getPayloadSource()).andReturn(new StringSource( "atext")).times(2); - SchemaValidatingMatcher matcher = new SchemaValidatingMatcher(schema2, schema1); + SchemaValidatingMatcher matcher = new SchemaValidatingMatcher(schema1, schema2); replay(message); @@ -119,7 +122,7 @@ public class SchemaValidatingMatcherTest { expect(message.getPayloadSource()).andReturn(new StringSource( "atext")).times(2); - SchemaValidatingMatcher matcher = new SchemaValidatingMatcher(schema1); + SchemaValidatingMatcher matcher = new SchemaValidatingMatcher(schema); replay(message); diff --git a/spring-ws-test/src/test/resources/org/springframework/ws/test/support/matcher/schemaValidatingMatcherTest-1.xsd b/spring-ws-test/src/test/resources/org/springframework/ws/test/support/matcher/schemaValidatingMatcherTest-1.xsd new file mode 100644 index 00000000..2c83de72 --- /dev/null +++ b/spring-ws-test/src/test/resources/org/springframework/ws/test/support/matcher/schemaValidatingMatcherTest-1.xsd @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff --git a/spring-ws-test/src/test/resources/org/springframework/ws/test/support/matcher/schemaValidatingMatcherTest-2.xsd b/spring-ws-test/src/test/resources/org/springframework/ws/test/support/matcher/schemaValidatingMatcherTest-2.xsd new file mode 100644 index 00000000..408e9057 --- /dev/null +++ b/spring-ws-test/src/test/resources/org/springframework/ws/test/support/matcher/schemaValidatingMatcherTest-2.xsd @@ -0,0 +1,5 @@ + + + + +