[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] [libeufin] branch master updated: Closing #5923.
From: |
gnunet |
Subject: |
[GNUnet-SVN] [libeufin] branch master updated: Closing #5923. |
Date: |
Mon, 07 Oct 2019 17:11:31 +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 87974b4 Closing #5923.
87974b4 is described below
commit 87974b488382fabd262c63c0523aa2f26fbe557f
Author: Marcello Stanisci <address@hidden>
AuthorDate: Mon Oct 7 17:11:11 2019 +0200
Closing #5923.
---
src/main/kotlin/tech/libeufin/XML.kt | 2 +-
src/test/kotlin/XmlTest.kt | 19 ++++++++++++++++++-
2 files changed, 19 insertions(+), 2 deletions(-)
diff --git a/src/main/kotlin/tech/libeufin/XML.kt
b/src/main/kotlin/tech/libeufin/XML.kt
index 3acb218..13079df 100644
--- a/src/main/kotlin/tech/libeufin/XML.kt
+++ b/src/main/kotlin/tech/libeufin/XML.kt
@@ -111,7 +111,7 @@ class XML {
* @param xmlDoc the XML document to validate
* @return true when validation passes, false otherwise
*/
- private fun validate(xmlDoc: StreamSource): Boolean {
+ fun validate(xmlDoc: StreamSource): Boolean {
try {
validator?.validate(xmlDoc)
} catch (e: SAXException) {
diff --git a/src/test/kotlin/XmlTest.kt b/src/test/kotlin/XmlTest.kt
index 2b6fe54..63b6917 100644
--- a/src/test/kotlin/XmlTest.kt
+++ b/src/test/kotlin/XmlTest.kt
@@ -3,10 +3,27 @@ package tech.libeufin
import org.junit.Assert
import org.junit.Test
import org.junit.Assert.*
+import java.io.File
+import javax.xml.transform.Source
+import javax.xml.transform.stream.StreamSource
class XmlTest {
+
+ val processor = XML()
+
+ @Test
+ fun hevValidation(){
+
+ val classLoader = ClassLoader.getSystemClassLoader()
+ val hev = classLoader.getResourceAsStream("ebics_hev.xml")
+ assertTrue(processor.validate(StreamSource(hev)))
+ }
+
@Test
fun iniValidation(){
- assert(false)
+
+ val classLoader = ClassLoader.getSystemClassLoader()
+ val ini =
classLoader.getResourceAsStream("ebics_ini_request_sample.xml")
+ assertTrue(processor.validate(StreamSource(ini)))
}
}
\ 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: Closing #5923.,
gnunet <=