Fixing tests for JDK 1.7

Fixed a couple of tests so that they work under JDK 1.7.
This commit is contained in:
Arjen Poutsma
2014-02-12 16:49:37 +01:00
parent a201cfcb1e
commit 473b4285fd
7 changed files with 31 additions and 11 deletions

View File

@@ -124,7 +124,7 @@ public class AnnotationDrivenBeanDefinitionParserTest {
break;
}
}
assertTrue("No [" + clazz.getName() + "] instance found", found);
assertTrue("No [" + clazz.getName() + "] instance found in " + collection, found);
}
}

View File

@@ -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">
<sws:annotation-driven/>

View File

@@ -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">
<sws:static-wsdl location="classpath:org/springframework/ws/client/support/destination/simple.wsdl"/>

View File

@@ -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">
<sws:annotation-driven/>

View File

@@ -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(
"<test xmlns=\"http://www.example.org/schema\"><number>0</number><text>text</text></test>"));
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(
"<test xmlns=\"http://www.example.org/schema\"><number>a</number><text>text</text></test>")).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(
"<test xmlns=\"http://www.example.org/schema\"><number>a</number><text>text</text></test>")).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(
"<test xmlns=\"http://www.example.org/schema\"><number>a</number><text>text</text></test>")).times(2);
SchemaValidatingMatcher matcher = new SchemaValidatingMatcher(schema1);
SchemaValidatingMatcher matcher = new SchemaValidatingMatcher(schema);
replay(message);

View File

@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="http://www.example.org/schema" xmlns:tns="http://www.example.org/schema" elementFormDefault="qualified">
<element name="test" type="tns:testMessage"/>
<complexType name="testMessage">
<sequence>
<element name="number" type="int"/>
<element name="text" type="string" minOccurs="0"/>
</sequence>
</complexType>
</schema>

View File

@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="http://www.example.org/schema" xmlns:tns="http://www.example.org/schema" elementFormDefault="qualified">
</schema>