mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-14 11:49:04 +01:00
Test cleanup. #280
This commit is contained in:
@@ -1,27 +1,28 @@
|
||||
package org.briarproject;
|
||||
|
||||
import org.briarproject.api.db.DatabaseConfig;
|
||||
import org.briarproject.api.db.DatabaseExecutor;
|
||||
import org.briarproject.db.DatabaseModule;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.concurrent.Executor;
|
||||
|
||||
import javax.inject.Singleton;
|
||||
|
||||
import dagger.Module;
|
||||
import dagger.Provides;
|
||||
|
||||
@Module
|
||||
public class TestDatabaseModule {
|
||||
public class TestDatabaseModule extends DatabaseModule {
|
||||
|
||||
private final DatabaseConfig config;
|
||||
|
||||
public TestDatabaseModule() {
|
||||
this(new File("."), Long.MAX_VALUE);
|
||||
this(new File("."));
|
||||
}
|
||||
|
||||
public TestDatabaseModule(File dir) {
|
||||
this(dir, Long.MAX_VALUE);
|
||||
}
|
||||
|
||||
public TestDatabaseModule(File dir, long maxSize) {
|
||||
this.config = new TestDatabaseConfig(dir, maxSize);
|
||||
config = new TestDatabaseConfig(dir, Long.MAX_VALUE);
|
||||
}
|
||||
|
||||
@Provides
|
||||
@@ -29,4 +30,10 @@ public class TestDatabaseModule {
|
||||
return config;
|
||||
}
|
||||
|
||||
@Provides
|
||||
@Singleton
|
||||
@DatabaseExecutor
|
||||
Executor provideDatabaseExecutor() {
|
||||
return new ImmediateExecutor();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user