use of com.google.startupos.tools.reviewer.local_server.service.Protos.TextDiffResponse in project startup-os by google.
the class CodeReviewServiceTextDiffTest method testTextDiff_locallyModifiedWorkspaceExistsNewFile.
// ADD, locally modified, workspace exists, new file
@Test
public void testTextDiff_locallyModifiedWorkspaceExistsNewFile() {
writeFile("somefile.txt", TEST_FILE_CONTENTS);
writeFile(TEST_FILE_CONTENTS);
File file = File.newBuilder().setRepoId("startup-os").setWorkspace(TEST_WORKSPACE).setFilename("somefile.txt").build();
TextDiffResponse response = getResponse(file);
assertEquals(getExpectedResponse(TEST_FILE_CONTENTS), response);
}
use of com.google.startupos.tools.reviewer.local_server.service.Protos.TextDiffResponse in project startup-os by google.
the class CodeReviewServiceTextDiffTest method testTextDiff_committedAndWorkspaceExists.
// Committed, workspace exists
@Test
public void testTextDiff_committedAndWorkspaceExists() {
File file = File.newBuilder().setRepoId("startup-os").setWorkspace(TEST_WORKSPACE).setCommitId(testFileCommitId).setFilename(TEST_FILE).build();
TextDiffResponse response = getResponse(file);
assertEquals(getExpectedResponse(TEST_FILE_CONTENTS), response);
}
use of com.google.startupos.tools.reviewer.local_server.service.Protos.TextDiffResponse in project startup-os by google.
the class CodeReviewServiceTextDiffTest method testTextDiff_committedAndWorkspaceNotExists_pushed.
// Committed, workspace doesn't exist (pushed)
@Test
public void testTextDiff_committedAndWorkspaceNotExists_pushed() {
File file = File.newBuilder().setRepoId("startup-os").setWorkspace("non-existing-workspace").setCommitId(fileInHeadCommitId).setFilename(FILE_IN_HEAD).build();
TextDiffResponse response = getResponse(file);
assertEquals(getExpectedResponse(TEST_FILE_CONTENTS), response);
}
use of com.google.startupos.tools.reviewer.local_server.service.Protos.TextDiffResponse in project startup-os by google.
the class CodeReviewServiceTextDiffTest method testTextDiff_fileInHead.
// File in head
@Test
public void testTextDiff_fileInHead() {
File file = File.newBuilder().setRepoId("startup-os").setCommitId(fileInHeadCommitId).setFilename(FILE_IN_HEAD).build();
TextDiffResponse response = getResponse(file);
assertEquals(getExpectedResponse(TEST_FILE_CONTENTS), response);
}
Aggregations