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