Test: Update JNI-153

android-nettle-update
heck 2 years ago
parent c20c5c4ef3
commit 088b5c13af

@ -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++;
}
}

@ -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