From a9d9e6b57280c12c65f8d7af16b955eb73b97762 Mon Sep 17 00:00:00 2001 From: zab2 <zab2@mail.i2p> Date: Fri, 28 Jun 2013 18:43:36 +0000 Subject: [PATCH] work on test --- .../client/streaming/ConnectTimeoutTest.java | 25 +++++++------------ 1 file changed, 9 insertions(+), 16 deletions(-) diff --git a/apps/streaming/java/test/junit/net/i2p/client/streaming/ConnectTimeoutTest.java b/apps/streaming/java/test/junit/net/i2p/client/streaming/ConnectTimeoutTest.java index 249142c3f0..3e671a8500 100644 --- a/apps/streaming/java/test/junit/net/i2p/client/streaming/ConnectTimeoutTest.java +++ b/apps/streaming/java/test/junit/net/i2p/client/streaming/ConnectTimeoutTest.java @@ -30,9 +30,7 @@ public class ConnectTimeoutTest extends TestCase { I2PAppContext context = I2PAppContext.getGlobalContext(); _log = context.logManager().getLog(ConnectTest.class); _log.debug("creating server dest"); - try { - _serverDest = I2PClientFactory.createClient().createDestination(new ByteArrayOutputStream()); - } catch (Exception e) {} + _serverDest = I2PClientFactory.createClient().createDestination(new ByteArrayOutputStream()); _log.debug("creating client session"); _client = createSession(); _log.debug("running client"); @@ -75,20 +73,15 @@ public class ConnectTimeoutTest extends TestCase { } - private I2PSession createSession() { - try { - I2PClient client = I2PClientFactory.createClient(); - ByteArrayOutputStream baos = new ByteArrayOutputStream(512); - Destination dest = client.createDestination(baos); - Properties p = getProps(); + private I2PSession createSession() throws Exception { + I2PClient client = I2PClientFactory.createClient(); + ByteArrayOutputStream baos = new ByteArrayOutputStream(512); + Destination dest = client.createDestination(baos); + Properties p = getProps(); - I2PSession sess = client.createSession(new ByteArrayInputStream(baos.toByteArray()), p); - sess.connect(); - return sess; - } catch (Exception e) { - _log.error("error running", e); - throw new RuntimeException("b0rk b0rk b0rk"); - } + I2PSession sess = client.createSession(new ByteArrayInputStream(baos.toByteArray()), p); + sess.connect(); + return sess; } private static Properties getProps() { -- GitLab