checkstyle MutableException
checkstyle EmptyBlock checkstyle fixRightCurly Script checkstyle EmptyStatement checkstyle RightCurly checkstyle TailingWhite checkstyle NeedBraces Fix the line separator in the `fixRightCurly.gradle`
This commit is contained in:
committed by
Artem Bilan
parent
c0b19e61b5
commit
842aded9a4
@@ -27,7 +27,7 @@ import org.springframework.oxm.XmlMappingException;
|
||||
import org.springframework.xml.transform.StringSource;
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* @author Jonas Partner
|
||||
*
|
||||
*/
|
||||
|
||||
@@ -23,11 +23,11 @@ import org.springframework.integration.xml.transformer.ResultTransformer;
|
||||
public class StubResultTransformer implements ResultTransformer {
|
||||
|
||||
Object toReturn;
|
||||
|
||||
|
||||
public StubResultTransformer(Object toReturn){
|
||||
this.toReturn = toReturn;
|
||||
}
|
||||
|
||||
|
||||
public Object transformResult(Result res) {
|
||||
return toReturn;
|
||||
}
|
||||
|
||||
@@ -25,7 +25,7 @@ import org.springframework.oxm.Unmarshaller;
|
||||
import org.springframework.oxm.XmlMappingException;
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* @author Jonas Partner
|
||||
*
|
||||
*/
|
||||
|
||||
@@ -27,7 +27,7 @@ import org.springframework.core.io.Resource;
|
||||
public class TestXmlApplicationContext extends AbstractXmlApplicationContext {
|
||||
|
||||
private final Resource[] resources;
|
||||
|
||||
|
||||
public TestXmlApplicationContext(String ... xmlStrings){
|
||||
resources = new Resource[xmlStrings.length];
|
||||
for (int i = 0 ; i < xmlStrings.length; i++) {
|
||||
@@ -35,7 +35,7 @@ public class TestXmlApplicationContext extends AbstractXmlApplicationContext {
|
||||
}
|
||||
refresh();
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected Resource[] getConfigResources() {
|
||||
return resources;
|
||||
@@ -44,20 +44,20 @@ public class TestXmlApplicationContext extends AbstractXmlApplicationContext {
|
||||
private static class TestResource extends AbstractResource{
|
||||
|
||||
String xmlString;
|
||||
|
||||
|
||||
TestResource(String xmlString){
|
||||
this.xmlString = xmlString;
|
||||
}
|
||||
|
||||
|
||||
|
||||
public String getDescription() {
|
||||
return "test";
|
||||
}
|
||||
|
||||
public InputStream getInputStream() throws IOException {
|
||||
return new ByteArrayInputStream(xmlString.getBytes("UTF-8"));
|
||||
return new ByteArrayInputStream(xmlString.getBytes("UTF-8"));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -75,7 +75,8 @@ public class XPathExpressionParserTests {
|
||||
|
||||
try {
|
||||
getXPathExpression(xmlDoc.toString());
|
||||
} catch (BeanDefinitionStoreException e) {
|
||||
}
|
||||
catch (BeanDefinitionStoreException e) {
|
||||
assertTrue(e.getCause() instanceof SAXParseException);
|
||||
return;
|
||||
}
|
||||
@@ -100,7 +101,8 @@ public class XPathExpressionParserTests {
|
||||
|
||||
try {
|
||||
getXPathExpression(xmlDoc.toString());
|
||||
} catch (BeanDefinitionStoreException e) {
|
||||
}
|
||||
catch (BeanDefinitionStoreException e) {
|
||||
assertEquals("It is not valid to specify both, the namespace attributes ('ns-prefix' and 'ns-uri') and the 'namespace-map' attribute.", e.getCause().getMessage());
|
||||
return;
|
||||
}
|
||||
@@ -117,7 +119,8 @@ public class XPathExpressionParserTests {
|
||||
.append("</si-xml:xpath-expression>");
|
||||
try {
|
||||
getXPathExpression(xmlDoc.toString());
|
||||
} catch (BeanDefinitionStoreException e) {
|
||||
}
|
||||
catch (BeanDefinitionStoreException e) {
|
||||
assertEquals("It is not valid to specify both, the namespace attributes ('ns-prefix' and 'ns-uri') and the 'map' sub-element.", e.getCause().getMessage());
|
||||
return;
|
||||
}
|
||||
@@ -135,7 +138,8 @@ public class XPathExpressionParserTests {
|
||||
.append("<util:map id='myNamespaces'><entry key='ns1' value='www.example.org' /></util:map>");
|
||||
try {
|
||||
getXPathExpression(xmlDoc.toString());
|
||||
} catch (BeanDefinitionStoreException e) {
|
||||
}
|
||||
catch (BeanDefinitionStoreException e) {
|
||||
assertEquals("It is not valid to specify both, the 'namespace-map' attribute and the 'map' sub-element.", e.getCause().getMessage());
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -30,7 +30,7 @@ import org.springframework.integration.xml.util.XmlTestUtil;
|
||||
import org.springframework.xml.xpath.XPathExpression;
|
||||
import org.springframework.xml.xpath.XPathExpressionFactory;
|
||||
|
||||
/**
|
||||
/**
|
||||
* @author Jonas Partner
|
||||
*/
|
||||
public class XPathRouterTests {
|
||||
@@ -45,7 +45,7 @@ public class XPathRouterTests {
|
||||
assertEquals("Wrong number of channels returned", 1, channelNames.length);
|
||||
assertEquals("Wrong channel name", "one", channelNames[0]);
|
||||
}
|
||||
|
||||
|
||||
@Test
|
||||
@SuppressWarnings({ "unchecked", "rawtypes" })
|
||||
public void simpleSingleAttributeAsString() throws Exception {
|
||||
@@ -57,10 +57,10 @@ public class XPathRouterTests {
|
||||
assertEquals("Wrong number of channels returned", 1, channelNames.length);
|
||||
assertEquals("Wrong channel name", "one", channelNames[0]);
|
||||
}
|
||||
|
||||
|
||||
@Test
|
||||
@SuppressWarnings({ "unchecked", "rawtypes" })
|
||||
public void simpleRootNode() throws Exception {
|
||||
public void simpleRootNode() throws Exception {
|
||||
Document doc = XmlTestUtil.getDocumentForString("<doc><foo>oleg</foo><bar>bang</bar></doc>");
|
||||
XPathExpression expression = XPathExpressionFactory.createXPathExpression("name(./node())");
|
||||
XPathRouter router = new XPathRouter(expression);
|
||||
@@ -81,15 +81,15 @@ public class XPathRouterTests {
|
||||
assertEquals("Wrong channel name", "bOne", channelNames[0]);
|
||||
assertEquals("Wrong channel name", "bTwo", channelNames[1]);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Test
|
||||
@SuppressWarnings({ "unchecked", "rawtypes" })
|
||||
/*
|
||||
* Will return only one (the first node text in the collection), since
|
||||
* Will return only one (the first node text in the collection), since
|
||||
* the evaluation return type use is String (not NODESET)
|
||||
* This test is just for sanity and the reminder that setting 'evaluateAsNode'
|
||||
* to 'false' would still result in no exception but result will most likely be
|
||||
* to 'false' would still result in no exception but result will most likely be
|
||||
* not what is expected.
|
||||
*/
|
||||
public void multipleNodeValuesAsString() throws Exception {
|
||||
@@ -116,7 +116,7 @@ public class XPathRouterTests {
|
||||
assertEquals("bob",channelNames[0]);
|
||||
assertEquals("dave",channelNames[1]);
|
||||
}
|
||||
|
||||
|
||||
@Test
|
||||
public void testSimpleDocType() throws Exception {
|
||||
Document doc = XmlTestUtil.getDocumentForString("<doc type='one' />");
|
||||
|
||||
@@ -22,7 +22,7 @@ import javax.xml.bind.annotation.XmlType;
|
||||
|
||||
@XmlType @XmlRootElement(name="person")
|
||||
public class JaxbAnnotatedPerson {
|
||||
|
||||
|
||||
@XmlElement(name="firstname")
|
||||
public String getFirstName() {
|
||||
return firstName;
|
||||
@@ -32,9 +32,9 @@ public class JaxbAnnotatedPerson {
|
||||
this.firstName = firstName;
|
||||
}
|
||||
|
||||
|
||||
|
||||
private String firstName;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -41,20 +41,20 @@ import org.springframework.xml.transform.StringSource;
|
||||
*/
|
||||
@ContextConfiguration
|
||||
public class JaxbMarshallingIntegrationTests extends AbstractJUnit4SpringContextTests {
|
||||
|
||||
|
||||
@Autowired @Qualifier("marshallIn")
|
||||
MessageChannel marshallIn;
|
||||
|
||||
|
||||
@Autowired @Qualifier("marshallOut")
|
||||
PollableChannel marshalledOut;
|
||||
|
||||
|
||||
@Autowired @Qualifier("unmarshallIn")
|
||||
MessageChannel unmarshallIn;
|
||||
|
||||
|
||||
@Autowired @Qualifier("unmarshallOut")
|
||||
PollableChannel unmarshallOut;
|
||||
|
||||
|
||||
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@Test
|
||||
public void testMarshalling() throws Exception{
|
||||
@@ -68,7 +68,7 @@ public class JaxbMarshallingIntegrationTests extends AbstractJUnit4SpringContext
|
||||
assertEquals("Wrong name for root element ", "person",doc.getDocumentElement().getLocalName());
|
||||
}
|
||||
|
||||
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@Test
|
||||
public void testUnmarshalling() throws Exception{
|
||||
@@ -79,8 +79,8 @@ public class JaxbMarshallingIntegrationTests extends AbstractJUnit4SpringContext
|
||||
assertTrue("Not a Person ", res.getPayload() instanceof JaxbAnnotatedPerson);
|
||||
JaxbAnnotatedPerson person = (JaxbAnnotatedPerson)res.getPayload();
|
||||
assertEquals("Worng firstname", "bob", person.getFirstName());
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user