mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-13 19:29:06 +01:00
Moved reliability layer into its own package.
This commit is contained in:
@@ -1,47 +0,0 @@
|
||||
package net.sf.briar.plugins.modem;
|
||||
|
||||
import static java.util.logging.Level.INFO;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.Executor;
|
||||
import java.util.concurrent.ExecutorService;
|
||||
import java.util.concurrent.Executors;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import net.sf.briar.api.ContactId;
|
||||
import net.sf.briar.api.TransportConfig;
|
||||
import net.sf.briar.api.TransportProperties;
|
||||
import net.sf.briar.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 ModemClientTest extends DuplexClientTest {
|
||||
|
||||
private ModemClientTest(Executor executor, String number) {
|
||||
// Store the server's phone number
|
||||
TransportProperties p = new TransportProperties();
|
||||
p.put("number", number);
|
||||
Map<ContactId, TransportProperties> remote =
|
||||
Collections.singletonMap(contactId, p);
|
||||
// Create the plugin
|
||||
callback = new ClientCallback(new TransportConfig(),
|
||||
new TransportProperties(), remote);
|
||||
plugin = new ModemPlugin(executor, new ModemFactoryImpl(executor,
|
||||
new ReliabilityLayerFactoryImpl(executor)), callback, 0L);
|
||||
}
|
||||
|
||||
public static void main(String[] args) throws Exception {
|
||||
if(args.length != 1) {
|
||||
System.err.println("Please specify the server's phone number");
|
||||
System.exit(1);
|
||||
}
|
||||
Logger.getLogger("net.sf.briar").setLevel(INFO);
|
||||
ExecutorService executor = Executors.newCachedThreadPool();
|
||||
try {
|
||||
new ModemClientTest(executor, args[0]).run();
|
||||
} finally {
|
||||
executor.shutdown();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,37 +0,0 @@
|
||||
package net.sf.briar.plugins.modem;
|
||||
|
||||
import static java.util.logging.Level.INFO;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.concurrent.Executor;
|
||||
import java.util.concurrent.ExecutorService;
|
||||
import java.util.concurrent.Executors;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import net.sf.briar.api.TransportConfig;
|
||||
import net.sf.briar.api.TransportProperties;
|
||||
import net.sf.briar.plugins.DuplexServerTest;
|
||||
|
||||
//This is not a JUnit test - it has to be run manually while the client test
|
||||
//is running on another machine
|
||||
public class ModemServerTest extends DuplexServerTest {
|
||||
|
||||
private ModemServerTest(Executor executor) {
|
||||
// Create the plugin
|
||||
callback = new ServerCallback(new TransportConfig(),
|
||||
new TransportProperties(), Collections.singletonMap(contactId,
|
||||
new TransportProperties()));
|
||||
plugin = new ModemPlugin(executor, new ModemFactoryImpl(executor,
|
||||
new ReliabilityLayerFactoryImpl(executor)), callback, 0L);
|
||||
}
|
||||
|
||||
public static void main(String[] args) throws Exception {
|
||||
Logger.getLogger("net.sf.briar").setLevel(INFO);
|
||||
ExecutorService executor = Executors.newCachedThreadPool();
|
||||
try {
|
||||
new ModemServerTest(executor).run();
|
||||
} finally {
|
||||
executor.shutdown();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user