diff options
Diffstat (limited to 'utils')
-rw-r--r-- | utils/src/main/java/at/gv/egiz/slbinding/SLUnmarshaller.java | 8 | ||||
-rw-r--r-- | utils/src/test/java/at/gv/egiz/slbinding/UnmarshallCXSRTest.java | 5 |
2 files changed, 10 insertions, 3 deletions
diff --git a/utils/src/main/java/at/gv/egiz/slbinding/SLUnmarshaller.java b/utils/src/main/java/at/gv/egiz/slbinding/SLUnmarshaller.java index c69fd681..518723d8 100644 --- a/utils/src/main/java/at/gv/egiz/slbinding/SLUnmarshaller.java +++ b/utils/src/main/java/at/gv/egiz/slbinding/SLUnmarshaller.java @@ -228,7 +228,13 @@ public class SLUnmarshaller { this.jaxbContext = createJAXBContext(packageNames); } - public Object unmarshal(StreamSource source) throws XMLStreamException, JAXBException { + /** + * @param source a StreamSource wrapping a Reader (!) for the marshalled Object + * @return the unmarshalled Object + * @throws XMLStreamException + * @throws JAXBException + */ +public Object unmarshal(StreamSource source) throws XMLStreamException, JAXBException { ReportingValidationEventHandler validationEventHandler = new ReportingValidationEventHandler(); XMLInputFactory inputFactory = XMLInputFactory.newInstance(); diff --git a/utils/src/test/java/at/gv/egiz/slbinding/UnmarshallCXSRTest.java b/utils/src/test/java/at/gv/egiz/slbinding/UnmarshallCXSRTest.java index 43f2b5a0..99c11cbe 100644 --- a/utils/src/test/java/at/gv/egiz/slbinding/UnmarshallCXSRTest.java +++ b/utils/src/test/java/at/gv/egiz/slbinding/UnmarshallCXSRTest.java @@ -26,6 +26,7 @@ package at.gv.egiz.slbinding; import java.io.InputStream; +import java.io.InputStreamReader; import javax.xml.bind.JAXBElement; import javax.xml.bind.JAXBException; @@ -40,7 +41,7 @@ import static org.junit.Assert.*; public class UnmarshallCXSRTest { @Test - public void testUnmarshallCreateXMLSignatureResponse() throws XMLStreamException, JAXBException { + public void testUnmarshalCreateXMLSignatureResponse() throws XMLStreamException, JAXBException { ClassLoader cl = UnmarshallCXSRTest.class.getClassLoader(); InputStream s = cl.getResourceAsStream("at/gv/egiz/slbinding/CreateXMLSignatureResponse.xml"); @@ -48,7 +49,7 @@ public class UnmarshallCXSRTest { assertNotNull(s); SLUnmarshaller unmarshaller = new SLUnmarshaller(); - Object object = unmarshaller.unmarshal(new StreamSource(s)); + Object object = unmarshaller.unmarshal(new StreamSource(new InputStreamReader(s))); assertTrue(object.getClass().getName(), object instanceof JAXBElement<?>); |