Move streaming demo out of tests

This commit is contained in:
str4d
2015-07-25 11:42:53 +00:00
parent 44bd14bd4d
commit d662514f74
10 changed files with 16 additions and 33 deletions

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<classpath> <classpath>
<classpathentry kind="src" path="src"/> <classpathentry kind="src" path="src"/>
<classpathentry kind="src" path="test/junit"/> <classpathentry kind="src" path="demo"/>
<classpathentry combineaccessrules="false" kind="src" path="/i2p_sdk"/> <classpathentry combineaccessrules="false" kind="src" path="/i2p_sdk"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/> <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="output" path="build/obj"/> <classpathentry kind="output" path="build/obj"/>

View File

@ -40,21 +40,21 @@
</javac> </javac>
</target> </target>
<target name="compileTest" depends="jar"> <target name="compileDemo" depends="jar">
<mkdir dir="./buildTest" /> <mkdir dir="./buildDemo" />
<mkdir dir="./buildTest/obj" /> <mkdir dir="./buildDemo/obj" />
<javac <javac
srcdir="./test/junit" srcdir="./demo"
debug="true" deprecation="on" source="${javac.version}" target="${javac.version}" debug="true" deprecation="on" source="${javac.version}" target="${javac.version}"
includeAntRuntime="false" includeAntRuntime="false"
destdir="./buildTest/obj" destdir="./buildDemo/obj"
classpath="../../../core/java/build/i2p.jar:./build/mstreaming.jar" > classpath="../../../core/java/build/i2p.jar:./build/mstreaming.jar" >
<compilerarg line="${javac.compilerargs}" /> <compilerarg line="${javac.compilerargs}" />
</javac> </javac>
</target> </target>
<target name="jarTest" depends="jar, compileTest"> <target name="jarDemo" depends="jar, compileDemo">
<jar destfile="./build/mstreamingTest.jar" basedir="./buildTest/obj" includes="**/*.class" update="true" /> <jar destfile="./build/mstreamingDemo.jar" basedir="./buildDemo/obj" includes="**/*.class" update="true" />
</target> </target>
<target name="listChangedFiles" depends="jarUpToDate" if="shouldListChanges" > <target name="listChangedFiles" depends="jarUpToDate" if="shouldListChanges" >
@ -140,7 +140,7 @@
</target> </target>
<target name="clean"> <target name="clean">
<delete dir="./build" /> <delete dir="./build" />
<delete dir="./buildTest" /> <delete dir="./buildDemo" />
</target> </target>
<target name="cleandep" depends="clean"> <target name="cleandep" depends="clean">
</target> </target>

View File

@ -1,14 +1,11 @@
package net.i2p.client.streaming.impl; package net.i2p.client.streaming;
import net.i2p.client.streaming.I2PSocketManagerFactory;
import net.i2p.client.streaming.StreamSinkSend; import net.i2p.client.streaming.StreamSinkSend;
import net.i2p.client.streaming.impl.I2PSocketManagerFull;
/** /**
* *
*/ */
public class StreamSinkTestClient { public class StreamSinkTestClient {
public static void main(String args[]) { public static void main(String args[]) {
System.setProperty(I2PSocketManagerFactory.PROP_MANAGER, I2PSocketManagerFull.class.getName());
//System.setProperty(I2PClient.PROP_TCP_HOST, "dev.i2p.net"); //System.setProperty(I2PClient.PROP_TCP_HOST, "dev.i2p.net");
//System.setProperty(I2PClient.PROP_TCP_PORT, "4501"); //System.setProperty(I2PClient.PROP_TCP_PORT, "4501");
System.setProperty("tunnels.depthInbound", "0"); System.setProperty("tunnels.depthInbound", "0");

View File

@ -1,14 +1,11 @@
package net.i2p.client.streaming.impl; package net.i2p.client.streaming;
import net.i2p.client.streaming.I2PSocketManagerFactory;
import net.i2p.client.streaming.StreamSinkServer; import net.i2p.client.streaming.StreamSinkServer;
import net.i2p.client.streaming.impl.I2PSocketManagerFull;
/** /**
* *
*/ */
public class StreamSinkTestServer { public class StreamSinkTestServer {
public static void main(String args[]) { public static void main(String args[]) {
System.setProperty(I2PSocketManagerFactory.PROP_MANAGER, I2PSocketManagerFull.class.getName());
//System.setProperty(I2PClient.PROP_TCP_HOST, "dev.i2p.net"); //System.setProperty(I2PClient.PROP_TCP_HOST, "dev.i2p.net");
//System.setProperty(I2PClient.PROP_TCP_PORT, "4101"); //System.setProperty(I2PClient.PROP_TCP_PORT, "4101");
System.setProperty("tunnels.depthInbound", "0"); System.setProperty("tunnels.depthInbound", "0");

View File

@ -1,10 +1,8 @@
package net.i2p.client.streaming.impl; package net.i2p.client.streaming;
import net.i2p.client.streaming.I2PSocketManagerFactory;
import net.i2p.client.streaming.StreamSinkClient; import net.i2p.client.streaming.StreamSinkClient;
import net.i2p.client.streaming.StreamSinkSend; import net.i2p.client.streaming.StreamSinkSend;
import net.i2p.client.streaming.StreamSinkServer; import net.i2p.client.streaming.StreamSinkServer;
import net.i2p.client.streaming.impl.I2PSocketManagerFull;
/** /**
* Usage: StreamSinkTest [(old|new) [#hops [#kb]]] * Usage: StreamSinkTest [(old|new) [#hops [#kb]]]
*/ */
@ -26,30 +24,23 @@ public class StreamSinkTestStandalone {
/* */ /* */
public static void main(String args[]) { public static void main(String args[]) {
boolean old = false;
int hops = 0; int hops = 0;
int kb = 32*1024; int kb = 32*1024;
if (args.length > 0) { if (args.length > 0) {
if ("old".equals(args[0]))
old = true;
}
if (args.length > 1) {
try { try {
hops = Integer.parseInt(args[1]); hops = Integer.parseInt(args[0]);
} catch (NumberFormatException nfe) { } catch (NumberFormatException nfe) {
hops = 0; hops = 0;
} }
} }
if (args.length > 2) { if (args.length > 1) {
try { try {
kb = Integer.parseInt(args[2]); kb = Integer.parseInt(args[1]);
} catch (NumberFormatException nfe) { } catch (NumberFormatException nfe) {
kb = 32*1024; kb = 32*1024;
} }
} }
if (!old)
System.setProperty(I2PSocketManagerFactory.PROP_MANAGER, I2PSocketManagerFull.class.getName());
System.setProperty("tunnels.depthInbound", ""+hops); System.setProperty("tunnels.depthInbound", ""+hops);
new Thread(new Runnable() { new Thread(new Runnable() {

View File

@ -39,7 +39,7 @@
</target> </target>
<target name="builddeptest"> <target name="builddeptest">
<ant dir="../../../core/java" target="jar" /> <ant dir="../../../core/java" target="jar" />
<ant dir="../../../apps/ministreaming/java/" target="jarTest" /> <ant dir="../../../apps/ministreaming/java/" target="jar" />
</target> </target>
<target name="junit.compileTest" depends="builddeptest, compile"> <target name="junit.compileTest" depends="builddeptest, compile">
@ -61,7 +61,6 @@
<classpath> <classpath>
<pathelement location="../../../core/java/build/i2p.jar" /> <pathelement location="../../../core/java/build/i2p.jar" />
<pathelement location="../../ministreaming/java/build/mstreaming.jar" /> <pathelement location="../../ministreaming/java/build/mstreaming.jar" />
<pathelement location="../../ministreaming/java/build/mstreamingTest.jar" />
<pathelement location="${junit.home}/junit4.jar" /> <pathelement location="${junit.home}/junit4.jar" />
<pathelement location="${hamcrest.home}/hamcrest.jar" /> <pathelement location="${hamcrest.home}/hamcrest.jar" />
<pathelement location="${hamcrest.home}/hamcrest-all.jar" /> <pathelement location="${hamcrest.home}/hamcrest-all.jar" />
@ -120,7 +119,6 @@
<pathelement location="../../../core/java/build/i2ptest.jar" /> <pathelement location="../../../core/java/build/i2ptest.jar" />
<pathelement location="../../../core/java/build/i2p.jar" /> <pathelement location="../../../core/java/build/i2p.jar" />
<pathelement location="../../ministreaming/java/build/mstreaming.jar" /> <pathelement location="../../ministreaming/java/build/mstreaming.jar" />
<pathelement location="../../ministreaming/java/build/mstreamingTest.jar" />
<pathelement location="../../build/jbigi.jar" /> <pathelement location="../../build/jbigi.jar" />
<pathelement location="${with.clover}" /> <pathelement location="${with.clover}" />
<pathelement location="${with.cobertura}" /> <pathelement location="${with.cobertura}" />