use of com.google.startupos.common.CommonModule in project startup-os by google.
the class InitCommandTest method setup.
@Before
public void setup() {
// XXX parametrize test
FileSystem fileSystem = Jimfs.newFileSystem(Configuration.unix());
TestComponent component = DaggerInitCommandTest_TestComponent.builder().commonModule(new CommonModule() {
@Provides
@Singleton
@Override
public FileSystem provideDefaultFileSystem() {
return fileSystem;
}
}).build();
initCommand = component.getCommand();
fileUtils = component.getFileUtils();
}
use of com.google.startupos.common.CommonModule in project startup-os by google.
the class WorkspaceCommandTest method setup.
@Before
public void setup() throws IOException {
// XXX parametrize test
FileSystem fileSystem = Jimfs.newFileSystem(Configuration.unix());
TestComponent component = DaggerWorkspaceCommandTest_TestComponent.builder().commonModule(new CommonModule() {
@Override
@Provides
@Singleton
public FileSystem provideDefaultFileSystem() {
return fileSystem;
}
}).aaModule(new AaModule() {
@Override
@Provides
@Singleton
@Named("Base path")
public String provideBasePath(FileUtils fileUtils) {
return "/base";
}
}).build();
fileUtils = component.getFileUtils();
initEmptyWorkspace();
workspaceCommand = component.getCommand();
outContent = new ByteArrayOutputStream();
errContent = new ByteArrayOutputStream();
System.setOut(new PrintStream(outContent));
System.setErr(new PrintStream(errContent));
Flags.resetForTesting();
WorkspaceCommand.force.resetValueForTesting();
}
use of com.google.startupos.common.CommonModule in project startup-os by google.
the class FileUtilsTest method setup.
@Before
public void setup() {
fileSystem = Jimfs.newFileSystem(fileSystemConfig);
CommonComponent commonComponent = DaggerCommonComponent.builder().commonModule(new CommonModule() {
@Provides
@Singleton
@Override
public FileSystem provideDefaultFileSystem() {
return fileSystem;
}
}).build();
fileUtils = commonComponent.getFileUtils();
}
Aggregations