diff --git a/test/java/foundation/pEp/jniadapter/test/jni167/TestAlice.java b/test/java/foundation/pEp/jniadapter/test/jni167/TestAlice.java index fb61057..8089d66 100644 --- a/test/java/foundation/pEp/jniadapter/test/jni167/TestAlice.java +++ b/test/java/foundation/pEp/jniadapter/test/jni167/TestAlice.java @@ -1,5 +1,7 @@ package foundation.pEp.jniadapter.test.jni167; +import foundation.pEp.jniadapter.Message; +import foundation.pEp.jniadapter.test.utils.AdapterTestUtils; import foundation.pEp.jniadapter.test.utils.CTXBase; import foundation.pEp.pitytest.TestSuite; import foundation.pEp.pitytest.TestUnit; @@ -11,6 +13,9 @@ import static foundation.pEp.pitytest.TestLogger.log; /* JNI-167 - ASN1 Support +TODO: +just spot test that the encoding/decoding generally works. Dont test the whole codec. + */ @@ -21,12 +26,41 @@ class TestAlice { CTXBase ctxBase = new CTXBase(); - new TestUnit("encodeASN1XER", ctxBase, ctx -> { + new TestUnit("toXER", ctxBase, ctx -> { log("fdfd"); - String tmp = ctx.msgAliceToAlice.encodeASN1XER(); + String tmp = ctx.msgAliceToAlice.toXER(); log(tmp); }); + + new TestUnit("decodeASN1XER", ctxBase, ctx -> { + log("fdfd"); + String msgXER = "\n" + + " \n" + + "
alice@peptest.org
\n" + + " \n" + + " alice\n" + + " 0\n" + + " en\n" + + "
\n" + + " \n" + + " \n" + + "
bob@peptest.org
\n" + + " \n" + + " bob\n" + + " 0\n" + + " en\n" + + "
\n" + + "
\n" + + " Hi i am the shortMessage\n" + + " Hi i am the longMessage\n" + + "
\n"; + + Message m = Message.fromXER(msgXER); + log(AdapterTestUtils.msgToString(m, false)); + }); + + TestSuite.getDefault().run(); } }