[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] [libeufin] branch master updated: resolving JAXB instantiat
From: |
gnunet |
Subject: |
[GNUnet-SVN] [libeufin] branch master updated: resolving JAXB instantiation for non-XmlRootElement(s) |
Date: |
Wed, 16 Oct 2019 15:21:34 +0200 |
This is an automated email from the git hooks/post-receive script.
marcello pushed a commit to branch master
in repository libeufin.
The following commit(s) were added to refs/heads/master by this push:
new bf7b604 resolving JAXB instantiation for non-XmlRootElement(s)
bf7b604 is described below
commit bf7b6048db5ecd249ee9b49b7d4967cdcd003f8f
Author: Marcello Stanisci <address@hidden>
AuthorDate: Wed Oct 16 15:21:25 2019 +0200
resolving JAXB instantiation for non-XmlRootElement(s)
---
sandbox/src/test/kotlin/IniLoadJaxbTest.kt | 23 +++++++++++++++++++----
1 file changed, 19 insertions(+), 4 deletions(-)
diff --git a/sandbox/src/test/kotlin/IniLoadJaxbTest.kt
b/sandbox/src/test/kotlin/IniLoadJaxbTest.kt
index 9244469..de9fc9d 100644
--- a/sandbox/src/test/kotlin/IniLoadJaxbTest.kt
+++ b/sandbox/src/test/kotlin/IniLoadJaxbTest.kt
@@ -4,8 +4,13 @@ import kotlinx.coroutines.io.jvm.javaio.toByteReadChannel
import org.junit.Assert
import org.junit.Test
import org.junit.Assert.*
+import org.xml.sax.InputSource
import tech.libeufin.messages.ebics.keyrequest.SignaturePubKeyOrderDataType
import java.io.File
+import java.io.InputStream
+import java.io.StringReader
+import javax.xml.bind.JAXBContext
+import javax.xml.bind.JAXBElement
import javax.xml.transform.Source
import javax.xml.transform.stream.StreamSource
@@ -16,11 +21,21 @@ class IniKeyMaterialTest {
@Test
fun importKey(){
val classLoader = ClassLoader.getSystemClassLoader()
- val ini = classLoader.getResource("ebics_ini_inner_key.xml")
- val obj = processor.convertStringToJaxb<SignaturePubKeyOrderDataType>(
- "tech.libeufin.messages.ebics.keyrequest",
- ini.readText()
+ val ini = classLoader.getResource(
+ "ebics_ini_inner_key.xml"
)
+ // manual unmarshalling now.
+ val jc = JAXBContext.newInstance(
+ "tech.libeufin.messages.ebics.keyrequest"
+ )
+
+ /* Marshalling the object into the document. */
+ val u = jc.createUnmarshaller()
+
+ val js = u.unmarshal(
+ StreamSource(((StringReader(ini.readText())))),
+ SignaturePubKeyOrderDataType::class.java)
+
}
}
\ No newline at end of file
--
To stop receiving notification emails like this one, please contact
address@hidden.
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] [libeufin] branch master updated: resolving JAXB instantiation for non-XmlRootElement(s),
gnunet <=