summaryrefslogtreecommitdiff
path: root/utils/src
diff options
context:
space:
mode:
authortkellner <tkellner@8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4>2011-09-08 09:52:31 +0000
committertkellner <tkellner@8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4>2011-09-08 09:52:31 +0000
commit8493281dff4676cb191ea362f87ce1be987e2e44 (patch)
tree1ba404102055252957e3a34ef8edffa791cc0828 /utils/src
parent43c2d19d35904df088849444e24c39604470c8d6 (diff)
downloadmocca-8493281dff4676cb191ea362f87ce1be987e2e44.tar.gz
mocca-8493281dff4676cb191ea362f87ce1be987e2e44.tar.bz2
mocca-8493281dff4676cb191ea362f87ce1be987e2e44.zip
Comment SLUnmarshaller changes, adapt tests
git-svn-id: https://joinup.ec.europa.eu/svn/mocca/trunk@981 8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4
Diffstat (limited to 'utils/src')
-rw-r--r--utils/src/main/java/at/gv/egiz/slbinding/SLUnmarshaller.java8
-rw-r--r--utils/src/test/java/at/gv/egiz/slbinding/UnmarshallCXSRTest.java5
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<?>);