Fix compiler warnings in XML module
This commit is contained in:
@@ -26,9 +26,9 @@ import org.springframework.core.io.ClassPathResource;
|
||||
/**
|
||||
* @author Jonas Partner
|
||||
*/
|
||||
public class TestTemplatesFactory implements FactoryBean {
|
||||
public class TestTemplatesFactory implements FactoryBean<Templates> {
|
||||
|
||||
public Object getObject() throws Exception {
|
||||
public Templates getObject() throws Exception {
|
||||
org.springframework.core.io.Resource xslResource = new ClassPathResource("test.xsl", getClass());
|
||||
return TransformerFactory.newInstance().newTemplates(new StreamSource(xslResource.getInputStream()));
|
||||
}
|
||||
|
||||
@@ -87,7 +87,6 @@ public class XPathMessageSplitterParserTests {
|
||||
|
||||
@Test
|
||||
public void testProvideDocumentBuilder() throws Exception {
|
||||
Document doc = XmlTestUtil.getDocumentForString("<names><name>Bob</name><name>John</name></names>");
|
||||
TestXmlApplicationContext ctx = TestXmlApplicationContextHelper
|
||||
.getTestAppContext("<bean id='docBuilderFactory' class='org.springframework.integration.xml.config.StubDocumentBuilderFactory' />"
|
||||
+ channelDefinitions
|
||||
@@ -102,7 +101,6 @@ public class XPathMessageSplitterParserTests {
|
||||
|
||||
@Test
|
||||
public void testXPathExpressionRef() throws Exception {
|
||||
Document doc = XmlTestUtil.getDocumentForString("<names><name>Bob</name><name>John</name></names>");
|
||||
TestXmlApplicationContext ctx = TestXmlApplicationContextHelper
|
||||
.getTestAppContext(
|
||||
channelDefinitions +
|
||||
|
||||
@@ -16,9 +16,12 @@
|
||||
|
||||
package org.springframework.integration.xml.enricher;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertNull;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
import org.springframework.integration.core.Message;
|
||||
import org.springframework.integration.core.MessageHeaders;
|
||||
@@ -27,9 +30,6 @@ import org.springframework.integration.xml.xpath.XPathEvaluationType;
|
||||
import org.springframework.xml.xpath.XPathExpression;
|
||||
import org.springframework.xml.xpath.XPathExpressionFactory;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
|
||||
public class XPathHeaderEnricherTests {
|
||||
|
||||
@@ -43,7 +43,7 @@ public class XPathHeaderEnricherTests {
|
||||
String docAsString = "<root><elementOne>1</elementOne><elementTwo>2</elementTwo></root>";
|
||||
|
||||
XPathHeaderEnricher enricher = new XPathHeaderEnricher(expressionMap);
|
||||
Message result = enricher.transform(MessageBuilder.withPayload(docAsString).build());
|
||||
Message<?> result = enricher.transform(MessageBuilder.withPayload(docAsString).build());
|
||||
|
||||
MessageHeaders headers = result.getHeaders();
|
||||
|
||||
@@ -58,7 +58,7 @@ public class XPathHeaderEnricherTests {
|
||||
String docAsString = "<root><elementOne>1</elementOne></root>";
|
||||
|
||||
XPathHeaderEnricher enricher = new XPathHeaderEnricher(expressionMap);
|
||||
Message result = enricher.transform(MessageBuilder.withPayload(docAsString).build());
|
||||
Message<?> result = enricher.transform(MessageBuilder.withPayload(docAsString).build());
|
||||
|
||||
MessageHeaders headers = result.getHeaders();
|
||||
assertNull("value set for two when result was null",headers.get("two"));
|
||||
@@ -72,7 +72,7 @@ public class XPathHeaderEnricherTests {
|
||||
|
||||
XPathHeaderEnricher enricher = new XPathHeaderEnricher(expressionMap);
|
||||
enricher.setSkipSettingNullResults(false);
|
||||
Message result = enricher.transform(MessageBuilder.withPayload(docAsString).build());
|
||||
Message<?> result = enricher.transform(MessageBuilder.withPayload(docAsString).build());
|
||||
|
||||
MessageHeaders headers = result.getHeaders();
|
||||
assertEquals("no value set for two when result was null and skip null was false","" ,headers.get("two"));
|
||||
@@ -90,7 +90,7 @@ public class XPathHeaderEnricherTests {
|
||||
|
||||
XPathHeaderEnricher enricher = new XPathHeaderEnricher(expressionMap);
|
||||
enricher.setEvaluationTypes(evalTypeMap);
|
||||
Message result = enricher.transform(MessageBuilder.withPayload(docAsString).build());
|
||||
Message<?> result = enricher.transform(MessageBuilder.withPayload(docAsString).build());
|
||||
|
||||
MessageHeaders headers = result.getHeaders();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user