Commit 7a0e22d4 authored by akwizgran's avatar akwizgran

Renamed clock API package and fixed a test.

parent 2e2eba82
package net.sf.briar.clock;
package net.sf.briar.api.clock;
/**
* An interface for time-related system functions that allows them to be
......
package net.sf.briar.clock;
package net.sf.briar.api.clock;
/** Default clock implementation. */
public class SystemClock implements Clock {
......
package net.sf.briar.clock;
import net.sf.briar.api.clock.Clock;
import net.sf.briar.api.clock.SystemClock;
import com.google.inject.AbstractModule;
public class ClockModule extends AbstractModule {
......
......@@ -25,6 +25,7 @@ import net.sf.briar.api.ContactId;
import net.sf.briar.api.Rating;
import net.sf.briar.api.TransportConfig;
import net.sf.briar.api.TransportProperties;
import net.sf.briar.api.clock.Clock;
import net.sf.briar.api.db.DatabaseComponent;
import net.sf.briar.api.db.DbException;
import net.sf.briar.api.db.MessageHeader;
......@@ -61,7 +62,6 @@ import net.sf.briar.api.protocol.TransportIndex;
import net.sf.briar.api.protocol.TransportUpdate;
import net.sf.briar.api.transport.ConnectionContext;
import net.sf.briar.api.transport.ConnectionWindow;
import net.sf.briar.clock.Clock;
import net.sf.briar.util.ByteUtils;
import com.google.inject.Inject;
......
......@@ -4,6 +4,7 @@ import java.io.File;
import java.sql.Connection;
import java.util.concurrent.Executor;
import net.sf.briar.api.clock.Clock;
import net.sf.briar.api.crypto.Password;
import net.sf.briar.api.db.DatabaseComponent;
import net.sf.briar.api.db.DatabaseDirectory;
......@@ -15,7 +16,6 @@ import net.sf.briar.api.protocol.GroupFactory;
import net.sf.briar.api.protocol.PacketFactory;
import net.sf.briar.api.transport.ConnectionContextFactory;
import net.sf.briar.api.transport.ConnectionWindowFactory;
import net.sf.briar.clock.Clock;
import net.sf.briar.util.BoundedExecutor;
import com.google.inject.AbstractModule;
......
......@@ -8,6 +8,7 @@ import java.sql.SQLException;
import java.util.Arrays;
import java.util.Properties;
import net.sf.briar.api.clock.Clock;
import net.sf.briar.api.crypto.Password;
import net.sf.briar.api.db.DatabaseDirectory;
import net.sf.briar.api.db.DatabaseMaxSize;
......@@ -16,7 +17,6 @@ import net.sf.briar.api.db.DbException;
import net.sf.briar.api.protocol.GroupFactory;
import net.sf.briar.api.transport.ConnectionContextFactory;
import net.sf.briar.api.transport.ConnectionWindowFactory;
import net.sf.briar.clock.Clock;
import org.apache.commons.io.FileSystemUtils;
......
......@@ -24,6 +24,7 @@ import net.sf.briar.api.ContactId;
import net.sf.briar.api.Rating;
import net.sf.briar.api.TransportConfig;
import net.sf.briar.api.TransportProperties;
import net.sf.briar.api.clock.Clock;
import net.sf.briar.api.db.DbException;
import net.sf.briar.api.db.MessageHeader;
import net.sf.briar.api.db.Status;
......@@ -42,7 +43,6 @@ import net.sf.briar.api.transport.ConnectionContext;
import net.sf.briar.api.transport.ConnectionContextFactory;
import net.sf.briar.api.transport.ConnectionWindow;
import net.sf.briar.api.transport.ConnectionWindowFactory;
import net.sf.briar.clock.Clock;
import net.sf.briar.util.FileUtils;
/**
......
......@@ -26,13 +26,13 @@ import javax.microedition.io.StreamConnectionNotifier;
import net.sf.briar.api.ContactId;
import net.sf.briar.api.TransportProperties;
import net.sf.briar.api.clock.Clock;
import net.sf.briar.api.crypto.PseudoRandom;
import net.sf.briar.api.plugins.PluginExecutor;
import net.sf.briar.api.plugins.duplex.DuplexPlugin;
import net.sf.briar.api.plugins.duplex.DuplexPluginCallback;
import net.sf.briar.api.plugins.duplex.DuplexTransportConnection;
import net.sf.briar.api.protocol.TransportId;
import net.sf.briar.clock.Clock;
import net.sf.briar.util.OsUtils;
import net.sf.briar.util.StringUtils;
......
......@@ -2,11 +2,11 @@ package net.sf.briar.plugins.bluetooth;
import java.util.concurrent.Executor;
import net.sf.briar.api.clock.SystemClock;
import net.sf.briar.api.plugins.PluginExecutor;
import net.sf.briar.api.plugins.duplex.DuplexPlugin;
import net.sf.briar.api.plugins.duplex.DuplexPluginCallback;
import net.sf.briar.api.plugins.duplex.DuplexPluginFactory;
import net.sf.briar.clock.SystemClock;
public class BluetoothPluginFactory implements DuplexPluginFactory {
......
......@@ -5,11 +5,11 @@ import static net.sf.briar.db.DatabaseConstants.MIN_FREE_SPACE;
import java.util.Collections;
import net.sf.briar.api.clock.SystemClock;
import net.sf.briar.api.db.DatabaseComponent;
import net.sf.briar.api.db.DbException;
import net.sf.briar.api.lifecycle.ShutdownManager;
import net.sf.briar.api.protocol.PacketFactory;
import net.sf.briar.clock.SystemClock;
import net.sf.briar.db.DatabaseCleaner.Callback;
import org.jmock.Expectations;
......
......@@ -24,6 +24,7 @@ import net.sf.briar.api.ContactId;
import net.sf.briar.api.Rating;
import net.sf.briar.api.TransportConfig;
import net.sf.briar.api.TransportProperties;
import net.sf.briar.api.clock.SystemClock;
import net.sf.briar.api.crypto.Password;
import net.sf.briar.api.db.DbException;
import net.sf.briar.api.db.MessageHeader;
......@@ -42,7 +43,7 @@ import net.sf.briar.api.transport.ConnectionContextFactory;
import net.sf.briar.api.transport.ConnectionWindow;
import net.sf.briar.api.transport.ConnectionWindowFactory;
import net.sf.briar.api.transport.TransportConstants;
import net.sf.briar.clock.SystemClock;
import net.sf.briar.clock.ClockModule;
import net.sf.briar.crypto.CryptoModule;
import net.sf.briar.lifecycle.LifecycleModule;
import net.sf.briar.protocol.ProtocolModule;
......@@ -94,7 +95,8 @@ public class H2DatabaseTest extends BriarTestCase {
public H2DatabaseTest() throws Exception {
super();
Injector i = Guice.createInjector(new CryptoModule(),
// FIXME: Use mocks for the factories rather than building the whole app
Injector i = Guice.createInjector(new ClockModule(), new CryptoModule(),
new DatabaseModule(), new LifecycleModule(),
new ProtocolModule(), new SerialModule(),
new SimplexProtocolModule(), new TransportModule(),
......
......@@ -9,7 +9,7 @@ import java.util.concurrent.Executors;
import net.sf.briar.api.ContactId;
import net.sf.briar.api.TransportConfig;
import net.sf.briar.api.TransportProperties;
import net.sf.briar.clock.SystemClock;
import net.sf.briar.api.clock.SystemClock;
import net.sf.briar.plugins.DuplexClientTest;
// This is not a JUnit test - it has to be run manually while the server test
......
......@@ -7,7 +7,7 @@ import java.util.concurrent.Executors;
import net.sf.briar.api.TransportConfig;
import net.sf.briar.api.TransportProperties;
import net.sf.briar.clock.SystemClock;
import net.sf.briar.api.clock.SystemClock;
import net.sf.briar.plugins.DuplexServerTest;
// This is not a JUnit test - it has to be run manually while the client test
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment