Separate out streaming integration tests, make them optional

This commit is contained in:
str4d
2015-07-27 00:58:42 +00:00
parent 8dcbc9958e
commit 6f1bb85397
10 changed files with 21 additions and 14 deletions

View File

@ -84,6 +84,8 @@
<include name="**/*.class"/> <include name="**/*.class"/>
<!-- exclude Test classes --> <!-- exclude Test classes -->
<exclude name="**/*Test.class" /> <exclude name="**/*Test.class" />
<exclude name="**/*IT.class" />
<exclude name="**/StreamingITBase.class" />
<!-- exclude anything not in net.i2p.* --> <!-- exclude anything not in net.i2p.* -->
<exclude name="org/cybergarage/**/*.class" /> <exclude name="org/cybergarage/**/*.class" />
<exclude name="org/freenetproject/**/*.class" /> <exclude name="org/freenetproject/**/*.class" />
@ -126,6 +128,7 @@
<batchtest todir="../../../reports/streaming/junit/"> <batchtest todir="../../../reports/streaming/junit/">
<fileset dir="./test/junit"> <fileset dir="./test/junit">
<include name="**/*Test.java" /> <include name="**/*Test.java" />
<include name="**/*IT.java" if="runIntegrationTests" />
</fileset> </fileset>
</batchtest> </batchtest>
<formatter type="xml"/> <formatter type="xml"/>

View File

@ -18,14 +18,14 @@ import net.i2p.util.Log;
* EOF. * EOF.
* *
*/ */
public class ConnectCloseTest extends StreamingTestBase { public class ConnectCloseIT extends StreamingITBase {
private Log _log; private Log _log;
private I2PSession _server; private I2PSession _server;
@Test @Test
public void test() throws Exception { public void test() throws Exception {
I2PAppContext context = I2PAppContext.getGlobalContext(); I2PAppContext context = I2PAppContext.getGlobalContext();
_log = context.logManager().getLog(ConnectCloseTest.class); _log = context.logManager().getLog(ConnectCloseIT.class);
_log.debug("creating server session"); _log.debug("creating server session");
_server = createSession(); _server = createSession();
_log.debug("running server"); _log.debug("running server");

View File

@ -15,7 +15,7 @@ import net.i2p.util.Log;
/** /**
* *
*/ */
public class ConnectTest extends StreamingTestBase { public class ConnectIT extends StreamingITBase {
private Log _log; private Log _log;
private I2PSession _server; private I2PSession _server;
@ -28,7 +28,7 @@ public class ConnectTest extends StreamingTestBase {
@Test @Test
public void test() throws Exception { public void test() throws Exception {
I2PAppContext context = I2PAppContext.getGlobalContext(); I2PAppContext context = I2PAppContext.getGlobalContext();
_log = context.logManager().getLog(ConnectTest.class); _log = context.logManager().getLog(ConnectIT.class);
_log.debug("creating server session"); _log.debug("creating server session");
_server = createSession(); _server = createSession();
_log.debug("running server"); _log.debug("running server");

View File

@ -15,7 +15,7 @@ import net.i2p.util.Log;
/** /**
* *
*/ */
public class ConnectInactivityTest extends StreamingTestBase { public class ConnectInactivityIT extends StreamingITBase {
private static final long LONG_TIME = 60 * 1000; private static final long LONG_TIME = 60 * 1000;
private static void sleep() throws Exception { private static void sleep() throws Exception {
@ -29,7 +29,7 @@ public class ConnectInactivityTest extends StreamingTestBase {
@Test @Test
public void test() throws Exception { public void test() throws Exception {
I2PAppContext context = I2PAppContext.getGlobalContext(); I2PAppContext context = I2PAppContext.getGlobalContext();
_log = context.logManager().getLog(ConnectTest.class); _log = context.logManager().getLog(ConnectIT.class);
_log.debug("creating server session"); _log.debug("creating server session");
_server = createSession(); _server = createSession();
_log.debug("running server"); _log.debug("running server");

View File

@ -17,7 +17,7 @@ import net.i2p.util.Log;
* Try to connect to a new nonexistant peer and, of course, * Try to connect to a new nonexistant peer and, of course,
* timeout. * timeout.
*/ */
public class ConnectTimeoutTest extends StreamingTestBase { public class ConnectTimeoutIT extends StreamingITBase {
private Log _log; private Log _log;
private I2PSession _client; private I2PSession _client;
private Destination _serverDest; private Destination _serverDest;
@ -25,7 +25,7 @@ public class ConnectTimeoutTest extends StreamingTestBase {
@Test @Test
public void testNonexistant() throws Exception { public void testNonexistant() throws Exception {
I2PAppContext context = I2PAppContext.getGlobalContext(); I2PAppContext context = I2PAppContext.getGlobalContext();
_log = context.logManager().getLog(ConnectTest.class); _log = context.logManager().getLog(ConnectIT.class);
_log.debug("creating server dest"); _log.debug("creating server dest");
_serverDest = I2PClientFactory.createClient().createDestination(new ByteArrayOutputStream()); _serverDest = I2PClientFactory.createClient().createDestination(new ByteArrayOutputStream());
_log.debug("creating client session"); _log.debug("creating client session");

View File

@ -17,7 +17,7 @@ import net.i2p.util.Log;
/** /**
* *
*/ */
public class EchoTest extends StreamingTestBase { public class EchoIT extends StreamingITBase {
private Log _log; private Log _log;
private I2PSession _client; private I2PSession _client;
private I2PSession _server; private I2PSession _server;
@ -25,7 +25,7 @@ public class EchoTest extends StreamingTestBase {
@Test @Test
public void test() throws Exception { public void test() throws Exception {
I2PAppContext context = I2PAppContext.getGlobalContext(); I2PAppContext context = I2PAppContext.getGlobalContext();
_log = context.logManager().getLog(ConnectTest.class); _log = context.logManager().getLog(ConnectIT.class);
_log.debug("creating server session"); _log.debug("creating server session");
_server = createSession(); _server = createSession();
_log.debug("running server"); _log.debug("running server");

View File

@ -17,7 +17,7 @@ import net.i2p.util.Log;
/** /**
* *
*/ */
public class EchoLargeTest extends StreamingTestBase { public class EchoLargeIT extends StreamingITBase {
private Log _log; private Log _log;
private I2PSession _client; private I2PSession _client;
private I2PSession _server; private I2PSession _server;
@ -25,7 +25,7 @@ public class EchoLargeTest extends StreamingTestBase {
@Test @Test
public void test() throws Exception { public void test() throws Exception {
I2PAppContext context = I2PAppContext.getGlobalContext(); I2PAppContext context = I2PAppContext.getGlobalContext();
_log = context.logManager().getLog(ConnectTest.class); _log = context.logManager().getLog(ConnectIT.class);
_log.debug("creating server session"); _log.debug("creating server session");
_server = createSession(); _server = createSession();
_log.debug("running server"); _log.debug("running server");

View File

@ -13,7 +13,7 @@ import net.i2p.client.I2PClient;
import net.i2p.client.I2PClientFactory; import net.i2p.client.I2PClientFactory;
import net.i2p.client.I2PSession; import net.i2p.client.I2PSession;
public class PingTest extends TestCase { public class PingIT extends TestCase {
@Test @Test
public void test() throws Exception { public void test() throws Exception {

View File

@ -12,7 +12,7 @@ import net.i2p.util.Log;
import junit.framework.TestCase; import junit.framework.TestCase;
abstract class StreamingTestBase extends TestCase { abstract class StreamingITBase extends TestCase {
// TODO: this may need to start a full router // TODO: this may need to start a full router

View File

@ -68,6 +68,10 @@ javac.version=1.6
### UnitTests ## ### UnitTests ##
# Uncomment the next line to enable integration tests.
# These require a running router with I2CP available on 127.0.0.1:7654.
#runIntegrationTests=true
# Location of the libraries required for the ScalaTest tests. # Location of the libraries required for the ScalaTest tests.
# Define this in override.properties or pass in on the command line. # Define this in override.properties or pass in on the command line.
# The directory must contain the following library names: # The directory must contain the following library names: