use of com.google.startupos.tools.reviewer.aa.AaModule in project startup-os by google.
the class CodeReviewServiceTextDiffTest method setup.
@Before
public void setup() throws IOException {
Flags.parse(new String[0], AuthService.class.getPackage(), CodeReviewService.class.getPackage());
String testFolder = Files.createTempDirectory("temp").toAbsolutePath().toString();
final String initialRepoFolder = joinToAbsolutePath(testFolder, "initial_repo");
aaBaseFolder = joinToAbsolutePath(testFolder, "base_folder");
component = DaggerCodeReviewServiceTextDiffTest_TestComponent.builder().aaModule(new AaModule() {
@Provides
@Singleton
@Override
@Named("Base path")
public String provideBasePath(FileUtils fileUtils) {
return aaBaseFolder;
}
}).build();
gitRepoFactory = component.getGitRepoFactory();
fileUtils = component.getFileUtils();
codeReviewService = new CodeReviewService(component.getAuthService(), fileUtils, aaBaseFolder, gitRepoFactory, component.getTextDifferencer());
createInitialRepo(initialRepoFolder);
initAaBase(initialRepoFolder, aaBaseFolder);
createAaWorkspace(TEST_WORKSPACE);
createBlockingStub();
writeFile(TEST_FILE_CONTENTS);
testFileCommitId = repo.commit(repo.getUncommittedFiles(), COMMIT_MESSAGE).getId();
}
use of com.google.startupos.tools.reviewer.aa.AaModule in project startup-os by google.
the class CodeReviewServiceGetDiffFilesTest method setup.
@Before
public void setup() throws IOException {
Flags.parse(new String[0], AuthService.class.getPackage(), CodeReviewService.class.getPackage());
component = DaggerCodeReviewServiceGetDiffFilesTest_TestComponent.builder().aaModule(new AaModule() {
@Provides
@Singleton
@Override
@Named("Base path")
public String provideBasePath(FileUtils fileUtils) {
return aaBaseFolder;
}
}).build();
gitRepoFactory = component.getGitRepoFactory();
fileUtils = component.getFileUtils();
String testFolder = Files.createTempDirectory("temp").toAbsolutePath().toString();
String initialRepoFolder = fileUtils.joinToAbsolutePath(testFolder, "initial_repo");
aaBaseFolder = fileUtils.joinToAbsolutePath(testFolder, "base_folder");
codeReviewService = new CodeReviewService(component.getAuthService(), fileUtils, aaBaseFolder, gitRepoFactory, component.getTextDifferencer());
createInitialRepo(initialRepoFolder);
initAaBase(initialRepoFolder, aaBaseFolder);
createAaWorkspace(TEST_WORKSPACE);
createBlockingStub();
writeFile(TEST_FILE_CONTENTS);
testFileCommitId = repo.commit(repo.getUncommittedFiles(), COMMIT_MESSAGE).getId();
mockFirestoreClientMethods();
}
use of com.google.startupos.tools.reviewer.aa.AaModule 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();
}
Aggregations