Browse Source

Test: Update JNI-153

android-nettle-update
heck 5 months ago
parent
commit
088b5c13af
2 changed files with 10 additions and 7 deletions
  1. +6
    -5
      test/java/foundation/pEp/jniadapter/test/jni153/TestAlice.java
  2. +4
    -2
      test/java/foundation/pEp/jniadapter/test/jni153/TestBob.java

+ 6
- 5
test/java/foundation/pEp/jniadapter/test/jni153/TestAlice.java View File

@ -23,14 +23,15 @@ class TestAlice {
log(AdapterTestUtils.identityToString(ctx.myself.pEpIdent, true));
ctx.transport.start();
ctx.transport.sendAsync(AdapterTestUtils.newOutMessage(ctx.myself.pEpIdent, ctx.partner.pEpIdent, "UNIQUE_" + String.valueOf(0)));
Message outMsg = AdapterTestUtils.newOutMessage(ctx.myself.pEpIdent, ctx.partner.pEpIdent, "UNIQUE_" + String.valueOf(0));
ctx.transport.sendAsync(outMsg.encodeMIME(), ctx.partner);
int counter = 0;
// TestUtils.readKey();
while (true) {
while (ctx.transport.canReceiveAsync()) {
ctx.transport.sendAsync(AdapterTestUtils.newOutMessage(ctx.myself.pEpIdent, ctx.partner.pEpIdent, "UNIQUE_" + String.valueOf(counter)));
Message msg = ctx.transport.receiveAsyncNonBlocking();
outMsg = AdapterTestUtils.newOutMessage(ctx.myself.pEpIdent, ctx.partner.pEpIdent, "UNIQUE_" + String.valueOf(counter));
ctx.transport.sendAsync(outMsg.encodeMIME(), ctx.partner);
Message msg = new Message(ctx.transport.receiveAsyncNonBlocking());
counter++;
}
}


+ 4
- 2
test/java/foundation/pEp/jniadapter/test/jni153/TestBob.java View File

@ -32,9 +32,11 @@ class TestBob {
while (true) {
while (ctx.transport.canReceiveAsync()) {
Message msgRx = ctx.transport.receiveAsyncNonBlocking();
Message msgRx = new Message(ctx.transport.receiveAsyncNonBlocking());
log(AdapterTestUtils.identityToString(msgRx.getFrom(),true));
ctx.transport.sendAsync(AdapterTestUtils.newOutMessage(ctx.myself.pEpIdent, msgRx.getFrom(), msgRx.getLongmsg() + " - ACK"));
Message msgOut = AdapterTestUtils.newOutMessage(ctx.myself.pEpIdent, msgRx.getFrom(), msgRx.getLongmsg() + " - ACK");
// ctx.transport.sendAsync(msgOut, ms);
ctx.transport.sendAsync(msgOut.encodeMIME(), ctx.partner); // HACK NEED TO RESOLVE FROM ADDRESS
counter++;
if (counter % 4 == 0) {


Loading…
Cancel
Save