unit test tweaks

This commit is contained in:
zzz
2020-05-21 14:11:30 +00:00
parent df3a03afc5
commit f25037447d
3 changed files with 9 additions and 3 deletions

View File

@ -76,7 +76,7 @@ class LocalClientManager extends ClientManager {
if (jitter > 0)
delay += (int) (jitter * _ctx.random().nextGaussian());
if (delay > 0) {
System.out.println("Message " + msgId + " DELAYED " + delay + " ms");
//System.out.println("Message " + msgId + " DELAYED " + delay + " ms");
DelayedSend ds = new DelayedSend(_ctx, sender, runner, fromDest, toDest, payload, msgId, messageNonce);
ds.schedule(delay);
return;

View File

@ -28,6 +28,7 @@ public class SSUDemo {
public static void main(String args[]) {
boolean testNTCP = args.length > 0 && args[0].equals("ntcp");
System.out.println("Testing " + (testNTCP ? "NTCP" : "SSU"));
SSUDemo demo = new SSUDemo();
demo.run(testNTCP);
}
@ -38,10 +39,12 @@ public class SSUDemo {
String cfgFile = "router.config";
Properties envProps = getEnv(testNTCP);
Router r = new Router(cfgFile, envProps);
System.out.println("Starting router...");
r.runRouter();
_us = r.getContext();
setupHandlers();
// wait for it to warm up a bit
System.out.println("30 second warmup...");
try { Thread.sleep(30*1000); } catch (InterruptedException ie) {}
// now write out our ident and info
RouterInfo myInfo = _us.router().getRouterInfo();
@ -60,8 +63,7 @@ public class SSUDemo {
else
envProps.setProperty("i2np.ntcp.enable", "false");
envProps.setProperty("i2np.upnp.enable", "false");
// we want SNTP synchronization for replay prevention
envProps.setProperty("time.disabled", "false");
envProps.setProperty("time.disabled", "true");
// allow 127.0.0.1/10.0.0.1/etc (useful for testing). If this is false,
// peers who say they're on an invalid IP are banlisted
envProps.setProperty("i2np.allowLocal", "true");

View File

@ -46,6 +46,10 @@ public class OutboundTest extends TestCase{
}
boolean eq = DataHelper.eq(orig, 16, message, 16, orig.length - 16);
if (!eq) {
System.out.println("Orig:\n" + net.i2p.util.HexDump.dump(orig, 16, orig.length - 16));
System.out.println("Rcvd:\n" + net.i2p.util.HexDump.dump(message, 16, orig.length - 16));
}
assertTrue(eq);
}