Extracts PTCP into separate test suite. Adds debug PTCP sample target.

This commit is contained in:
paweldomas 2013-11-21 18:55:20 +00:00
parent afd937ee54
commit 9964e3f296
3 changed files with 66 additions and 7 deletions

View File

@ -139,6 +139,7 @@
<formatter type="xml"/> <formatter type="xml"/>
<formatter type="brief" usefile="false"/> <formatter type="brief" usefile="false"/>
<test name="org.ice4j.StunTestSuite" todir="${junit.reports}"/> <test name="org.ice4j.StunTestSuite" todir="${junit.reports}"/>
<test name="org.ice4j.PseudoTcpTestSuite" todir="${junit.reports}"/>
<classpath refid="project.class.path"/> <classpath refid="project.class.path"/>
</junit> </junit>
@ -179,6 +180,20 @@
value="lib/logging.properties"/> value="lib/logging.properties"/>
</java> </java>
</target> </target>
<!-- Debug pseudotcp example on port 5005 -->
<target name="debug-pseudotcp" depends="compile">
<java fork="true"
classname="test.IcePseudoTcp"
classpathref="project.class.path">
<!-- Tell java.util.logging about our logging preferences -->
<sysproperty key="java.util.logging.config.file"
value="lib/logging.properties"/>
<jvmarg value="-Xdebug" />
<jvmarg value="-Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=5005" />
</java>
</target>
<!-- Debug pseudotcp example with netbeans --> <!-- Debug pseudotcp example with netbeans -->
<target name="nb-debug-pseudotcp" depends="compile"> <target name="nb-debug-pseudotcp" depends="compile">
<nbjpdastart addressproperty="jpda.address" name="ice4j" transport="dt_socket"> <nbjpdastart addressproperty="jpda.address" name="ice4j" transport="dt_socket">

View File

@ -0,0 +1,51 @@
/*
* ice4j, the OpenSource Java Solution for NAT and Firewall Traversal.
* Maintained by the SIP Communicator community (http://sip-communicator.org).
*
* Distributable under LGPL license. See terms of license at gnu.org.
*/
package org.ice4j;
import junit.framework.*;
/**
* Contains pseudo TCP tests.
*
* @author Pawel Domas
*/
public class PseudoTcpTestSuite
extends TestCase
{
/**
* Creates a new instance of the suite
*
* @param s test name
*/
public PseudoTcpTestSuite(String s)
{
super(s);
}
/**
* Returns the suite of tests to run.
* @return the suite of tests to run.
*/
public static Test suite()
{
TestSuite suite = new TestSuite();
// byte fifo buffer
suite.addTestSuite(org.ice4j.pseudotcp.util.ByteFifoBufferTest.class);
// transfer
suite.addTestSuite(org.ice4j.pseudotcp.PseudoTcpTestTransfer.class);
// ping pong
suite.addTestSuite(org.ice4j.pseudotcp.PseudoTcpTestPingPong.class);
// receive window
suite.addTestSuite(org.ice4j.pseudotcp.PseudoTcpTestRecvWindow.class);
// stream
suite.addTestSuite(org.ice4j.pseudotcp.PseudoTcpStreamTest.class);
return suite;
}
}

View File

@ -74,13 +74,6 @@ public class StunTestSuite
suite.addTestSuite(org.ice4j.stunclient.StunAddressDiscovererTest_v6.class); suite.addTestSuite(org.ice4j.stunclient.StunAddressDiscovererTest_v6.class);
suite.addTestSuite(org.ice4j.stunclient.StunAddressDiscovererTest_v4v6.class); suite.addTestSuite(org.ice4j.stunclient.StunAddressDiscovererTest_v4v6.class);
//pseudotcp
suite.addTestSuite(org.ice4j.pseudotcp.PseudoTcpTestTransfer.class);
suite.addTestSuite(org.ice4j.pseudotcp.PseudoTcpTestPingPong.class);
suite.addTestSuite(org.ice4j.pseudotcp.PseudoTcpTestRecvWindow.class);
suite.addTestSuite(org.ice4j.pseudotcp.PseudoTcpStreamTest.class);
suite.addTestSuite(org.ice4j.pseudotcp.util.ByteFifoBufferTest.class);
return suite; return suite;
} }
} }