Search in sources :

Example 6 with TextDiffResponse

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);
}
Also used : TextDiffResponse(com.google.startupos.tools.reviewer.local_server.service.Protos.TextDiffResponse) File(com.google.startupos.common.repo.Protos.File) Test(org.junit.Test)

Example 7 with TextDiffResponse

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);
}
Also used : TextDiffResponse(com.google.startupos.tools.reviewer.local_server.service.Protos.TextDiffResponse) File(com.google.startupos.common.repo.Protos.File) Test(org.junit.Test)

Example 8 with TextDiffResponse

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);
}
Also used : TextDiffResponse(com.google.startupos.tools.reviewer.local_server.service.Protos.TextDiffResponse) File(com.google.startupos.common.repo.Protos.File) Test(org.junit.Test)

Example 9 with TextDiffResponse

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);
}
Also used : TextDiffResponse(com.google.startupos.tools.reviewer.local_server.service.Protos.TextDiffResponse) File(com.google.startupos.common.repo.Protos.File) Test(org.junit.Test)

Aggregations

File (com.google.startupos.common.repo.Protos.File)9 TextDiffResponse (com.google.startupos.tools.reviewer.local_server.service.Protos.TextDiffResponse)9 Test (org.junit.Test)9