[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] [taler-libeufin] 14/25: Test with XML imported from string.
From: |
gnunet |
Subject: |
[GNUnet-SVN] [taler-libeufin] 14/25: Test with XML imported from string. |
Date: |
Fri, 20 Sep 2019 19:32:52 +0200 |
This is an automated email from the git hooks/post-receive script.
marcello pushed a commit to branch master
in repository libeufin.
commit 5b6c771afd40231606e57108189d1f876a14963e
Author: Marcello Stanisci <address@hidden>
AuthorDate: Mon Sep 16 00:23:34 2019 +0200
Test with XML imported from string.
---
src/main/kotlin/Main.kt | 5 ++++-
src/test/java/XMLManagementTest.java | 10 ++++++++++
2 files changed, 14 insertions(+), 1 deletion(-)
diff --git a/src/main/kotlin/Main.kt b/src/main/kotlin/Main.kt
index 74ba795..ad37c0d 100644
--- a/src/main/kotlin/Main.kt
+++ b/src/main/kotlin/Main.kt
@@ -26,14 +26,17 @@ import io.ktor.response.*
import io.ktor.routing.*
import io.ktor.server.engine.*
import io.ktor.server.netty.*
+import tech.libeufin.XMLManagement;
fun main(args: Array<String>) {
+ var xmlprocess = XMLManagement();
+
val server = embeddedServer(Netty, port = 5000) {
routing {
get("/") {
call.respondText("Hello LibEuFin!", ContentType.Text.Plain)
}
- post("/log") {
+ post("/") {
val body: String = call.receiveText()
println("Body: $body")
call.respondText("Your request has been logged.",
ContentType.Text.Plain)
diff --git a/src/test/java/XMLManagementTest.java
b/src/test/java/XMLManagementTest.java
index 2bacb64..3e37c71 100644
--- a/src/test/java/XMLManagementTest.java
+++ b/src/test/java/XMLManagementTest.java
@@ -1,6 +1,9 @@
import org.junit.Test;
import tech.libeufin.XMLManagement;
+
+import java.io.ByteArrayInputStream;
import java.io.File;
+import java.io.InputStream;
import javax.xml.transform.Source;
import javax.xml.transform.stream.StreamSource;
import static org.junit.Assert.*;
@@ -10,8 +13,15 @@ public class XMLManagementTest {
@Test
public void XMLManagementTest(){
XMLManagement xm = new XMLManagement();
+
+ /* Load XML from disk. */
ClassLoader classLoader = this.getClass().getClassLoader();
Source ebics_hev_sample = new
StreamSource(classLoader.getResourceAsStream("ebics_hev.xml"));
assertTrue(xm.validate(ebics_hev_sample));
+
+ /* Load XML from string. */
+ InputStream is = new ByteArrayInputStream("<InvalidXML>".getBytes());
+ Source ebics_from_string = new StreamSource(is);
+ assertFalse(xm.validate(ebics_from_string));
}
}
--
To stop receiving notification emails like this one, please contact
address@hidden.
- [GNUnet-SVN] [taler-libeufin] 02/25: instructions for running the sandbox, (continued)
- [GNUnet-SVN] [taler-libeufin] 02/25: instructions for running the sandbox, gnunet, 2019/09/20
- [GNUnet-SVN] [taler-libeufin] 09/25: load xsd from resources, gnunet, 2019/09/20
- [GNUnet-SVN] [taler-libeufin] 07/25: Test stub., gnunet, 2019/09/20
- [GNUnet-SVN] [taler-libeufin] 06/25: readme, gnunet, 2019/09/20
- [GNUnet-SVN] [taler-libeufin] 05/25: Copyright header., gnunet, 2019/09/20
- [GNUnet-SVN] [taler-libeufin] 01/25: Import initial project structure., gnunet, 2019/09/20
- [GNUnet-SVN] [taler-libeufin] 10/25: fix resource loading, gnunet, 2019/09/20
- [GNUnet-SVN] [taler-libeufin] 03/25: AGPL license, gnunet, 2019/09/20
- [GNUnet-SVN] [taler-libeufin] 12/25: Local test of XML validation., gnunet, 2019/09/20
- [GNUnet-SVN] [taler-libeufin] 11/25: import sample hev, gnunet, 2019/09/20
- [GNUnet-SVN] [taler-libeufin] 14/25: Test with XML imported from string.,
gnunet <=
- [GNUnet-SVN] [taler-libeufin] 13/25: fix test, gnunet, 2019/09/20
- [GNUnet-SVN] [taler-libeufin] 15/25: Abstracting string conversion to "stream"., gnunet, 2019/09/20
- [GNUnet-SVN] [taler-libeufin] 16/25: Introducing the converters:, gnunet, 2019/09/20
- [GNUnet-SVN] [taler-libeufin] 20/25: Server responds with ebicsHEVResponse., gnunet, 2019/09/20
- [GNUnet-SVN] [taler-libeufin] 18/25: method to get (XML) strings from JAXB objects., gnunet, 2019/09/20
- [GNUnet-SVN] [taler-libeufin] 23/25: Translating getLogger() into Kotlin., gnunet, 2019/09/20
- [GNUnet-SVN] [taler-libeufin] 19/25: Importing JAXB scaffolding to reflect ebics "hev" types., gnunet, 2019/09/20
- [GNUnet-SVN] [taler-libeufin] 21/25: Fix resource loading from JAR., gnunet, 2019/09/20
- [GNUnet-SVN] [taler-libeufin] 25/25: Finish translating Java into Kotlin., gnunet, 2019/09/20
- [GNUnet-SVN] [taler-libeufin] 17/25: Check if the message can be handled by the server., gnunet, 2019/09/20