forked from I2P_Developers/i2p.i2p
work on test
This commit is contained in:
@ -30,9 +30,7 @@ public class ConnectTimeoutTest extends TestCase {
|
|||||||
I2PAppContext context = I2PAppContext.getGlobalContext();
|
I2PAppContext context = I2PAppContext.getGlobalContext();
|
||||||
_log = context.logManager().getLog(ConnectTest.class);
|
_log = context.logManager().getLog(ConnectTest.class);
|
||||||
_log.debug("creating server dest");
|
_log.debug("creating server dest");
|
||||||
try {
|
_serverDest = I2PClientFactory.createClient().createDestination(new ByteArrayOutputStream());
|
||||||
_serverDest = I2PClientFactory.createClient().createDestination(new ByteArrayOutputStream());
|
|
||||||
} catch (Exception e) {}
|
|
||||||
_log.debug("creating client session");
|
_log.debug("creating client session");
|
||||||
_client = createSession();
|
_client = createSession();
|
||||||
_log.debug("running client");
|
_log.debug("running client");
|
||||||
@ -75,20 +73,15 @@ public class ConnectTimeoutTest extends TestCase {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private I2PSession createSession() {
|
private I2PSession createSession() throws Exception {
|
||||||
try {
|
I2PClient client = I2PClientFactory.createClient();
|
||||||
I2PClient client = I2PClientFactory.createClient();
|
ByteArrayOutputStream baos = new ByteArrayOutputStream(512);
|
||||||
ByteArrayOutputStream baos = new ByteArrayOutputStream(512);
|
Destination dest = client.createDestination(baos);
|
||||||
Destination dest = client.createDestination(baos);
|
Properties p = getProps();
|
||||||
Properties p = getProps();
|
|
||||||
|
|
||||||
I2PSession sess = client.createSession(new ByteArrayInputStream(baos.toByteArray()), p);
|
I2PSession sess = client.createSession(new ByteArrayInputStream(baos.toByteArray()), p);
|
||||||
sess.connect();
|
sess.connect();
|
||||||
return sess;
|
return sess;
|
||||||
} catch (Exception e) {
|
|
||||||
_log.error("error running", e);
|
|
||||||
throw new RuntimeException("b0rk b0rk b0rk");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private static Properties getProps() {
|
private static Properties getProps() {
|
||||||
|
Reference in New Issue
Block a user