use of com.google.startupos.common.repo.Protos.File in project startup-os by google.
the class CodeReviewServiceTextDiffTest method testTextDiff_committedAndWorkspaceNotExists.
// Committed, workspace doesn't exist
@Test(expected = StatusRuntimeException.class)
public void testTextDiff_committedAndWorkspaceNotExists() {
File file = File.newBuilder().setRepoId("startup-os").setWorkspace("non-existing-workspace").setCommitId(testFileCommitId).setFilename(TEST_FILE).build();
getResponse(file);
}
use of com.google.startupos.common.repo.Protos.File 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.common.repo.Protos.File 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.common.repo.Protos.File 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