I2P Address: [http://git.idk.i2p]

Skip to content
Snippets Groups Projects
Commit f2503744 authored by zzz's avatar zzz
Browse files

unit test tweaks

parent df3a03af
No related branches found
No related tags found
No related merge requests found
......@@ -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;
......
......@@ -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");
......
......@@ -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);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment