mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-12 18:59:06 +01:00
32 lines
718 B
Java
32 lines
718 B
Java
package org.briarproject;
|
|
|
|
import com.google.inject.AbstractModule;
|
|
|
|
import org.briarproject.api.db.DatabaseConfig;
|
|
import org.briarproject.api.system.FileUtils;
|
|
import org.briarproject.system.FileUtilsImpl;
|
|
|
|
import java.io.File;
|
|
|
|
public class TestDatabaseModule extends AbstractModule {
|
|
|
|
private final DatabaseConfig config;
|
|
|
|
public TestDatabaseModule() {
|
|
this(new File("."), Long.MAX_VALUE);
|
|
}
|
|
|
|
public TestDatabaseModule(File dir) {
|
|
this(dir, Long.MAX_VALUE);
|
|
}
|
|
|
|
public TestDatabaseModule(File dir, long maxSize) {
|
|
this.config = new TestDatabaseConfig(dir, maxSize);
|
|
}
|
|
|
|
protected void configure() {
|
|
bind(DatabaseConfig.class).toInstance(config);
|
|
bind(FileUtils.class).to(FileUtilsImpl.class);
|
|
}
|
|
}
|