Polish tests
This commit is contained in:
@@ -43,6 +43,7 @@ import static org.junit.Assert.*;
|
||||
* Test fixture for {@link Jaxb2CollectionHttpMessageConverter}.
|
||||
*
|
||||
* @author Arjen Poutsma
|
||||
* @author Rossen Stoyanchev
|
||||
*/
|
||||
@SuppressWarnings("unused")
|
||||
public class Jaxb2CollectionHttpMessageConverterTests {
|
||||
@@ -151,9 +152,14 @@ public class Jaxb2CollectionHttpMessageConverterTests {
|
||||
}
|
||||
};
|
||||
|
||||
Collection<RootElement> result = converter.read(rootElementListType, null, inputMessage);
|
||||
assertEquals(1, result.size());
|
||||
assertEquals("", result.iterator().next().external);
|
||||
try {
|
||||
Collection<RootElement> result = converter.read(rootElementListType, null, inputMessage);
|
||||
assertEquals(1, result.size());
|
||||
assertEquals("", result.iterator().next().external);
|
||||
}
|
||||
catch (HttpMessageNotReadableException ex) {
|
||||
// Some parsers raise an exception
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -273,4 +279,4 @@ public class Jaxb2CollectionHttpMessageConverterTests {
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -51,6 +51,7 @@ import static org.junit.Assert.assertTrue;
|
||||
*
|
||||
* @author Arjen Poutsma
|
||||
* @author Sebastien Deleuze
|
||||
* @author Rossen Stoyanchev
|
||||
*/
|
||||
@SuppressWarnings("unused")
|
||||
public class Jaxb2RootElementHttpMessageConverterTests {
|
||||
|
||||
@@ -21,6 +21,7 @@ import java.io.InputStreamReader;
|
||||
import java.io.StringReader;
|
||||
import java.nio.charset.Charset;
|
||||
import javax.xml.parsers.DocumentBuilderFactory;
|
||||
import javax.xml.stream.XMLStreamException;
|
||||
import javax.xml.stream.XMLStreamReader;
|
||||
import javax.xml.transform.Source;
|
||||
import javax.xml.transform.dom.DOMSource;
|
||||
@@ -56,6 +57,7 @@ import static org.junit.Assert.assertTrue;
|
||||
|
||||
/**
|
||||
* @author Arjen Poutsma
|
||||
* @author Rossen Stoyanchev
|
||||
*/
|
||||
public class SourceHttpMessageConverterTests {
|
||||
|
||||
@@ -226,8 +228,13 @@ public class SourceHttpMessageConverterTests {
|
||||
streamReader.next();
|
||||
String s = streamReader.getLocalName();
|
||||
assertEquals("root", s);
|
||||
s = streamReader.getElementText();
|
||||
assertNotEquals("Foo Bar", s);
|
||||
try {
|
||||
s = streamReader.getElementText();
|
||||
assertNotEquals("Foo Bar", s);
|
||||
}
|
||||
catch (XMLStreamException ex) {
|
||||
// Some parsers raise a parse exception
|
||||
}
|
||||
streamReader.close();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user