mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-13 19:29:06 +01:00
Changed the root package from net.sf.briar to org.briarproject.
This commit is contained in:
@@ -0,0 +1,47 @@
|
||||
package org.briarproject.plugins.tcp;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.Executor;
|
||||
import java.util.concurrent.ExecutorService;
|
||||
import java.util.concurrent.Executors;
|
||||
|
||||
import org.briarproject.api.ContactId;
|
||||
import org.briarproject.api.TransportConfig;
|
||||
import org.briarproject.api.TransportProperties;
|
||||
import org.briarproject.api.system.Clock;
|
||||
import org.briarproject.api.system.SystemClock;
|
||||
import org.briarproject.plugins.DuplexClientTest;
|
||||
|
||||
// This is not a JUnit test - it has to be run manually while the server test
|
||||
// is running on another machine
|
||||
public class LanTcpClientTest extends DuplexClientTest {
|
||||
|
||||
private LanTcpClientTest(Executor executor, String serverAddress,
|
||||
String serverPort) {
|
||||
// Store the server's internal address and port
|
||||
TransportProperties p = new TransportProperties();
|
||||
p.put("internal", serverAddress);
|
||||
p.put("port", serverPort);
|
||||
Map<ContactId, TransportProperties> remote =
|
||||
Collections.singletonMap(contactId, p);
|
||||
// Create the plugin
|
||||
callback = new ClientCallback(new TransportConfig(),
|
||||
new TransportProperties(), remote);
|
||||
Clock clock = new SystemClock();
|
||||
plugin = new LanTcpPlugin(executor, clock, callback, 0, 0, 0);
|
||||
}
|
||||
|
||||
public static void main(String[] args) throws Exception {
|
||||
if(args.length != 2) {
|
||||
System.err.println("Please specify the server's address and port");
|
||||
System.exit(1);
|
||||
}
|
||||
ExecutorService executor = Executors.newCachedThreadPool();
|
||||
try {
|
||||
new LanTcpClientTest(executor, args[0], args[1]).run();
|
||||
} finally {
|
||||
executor.shutdown();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user