CommentsIT: Add coverage of range values and file comments

Change If6c4cbce introduced a null pointer exception when a draft
change comment includes a range, and we didn't notice because ranges
are not used in the tests. This null pointer exception was already
fixed by change I0e3c734d. The test cases now fail when that change
is not applied.

Change I77772b6f fixed another null pointer exception when posting a
file level comment (i.e. the optional line member was null).

Extend CommentsIT to include test coverage of comment ranges and file
comments.

Fix another null pointer exception when posting file comments, that
was exposed by the newly added tests.

Change-Id: I517cc24ff3bbabdcbc14d743b8788de33b9c0241
This commit is contained in:
David Pursehouse
2015-01-10 21:30:09 +09:00
parent b28b27b834
commit d13b7f9b89
2 changed files with 96 additions and 61 deletions

View File

@@ -358,7 +358,7 @@ public class PostReview implements RestModifyView<RevisionResource, ReviewInput>
new PatchLineComment.Key(
new Patch.Key(rsrc.getPatchSet().getId(), path),
ChangeUtil.messageUUID(db.get())),
c.line,
c.line != null ? c.line : 0,
rsrc.getAccountId(),
parent, timestamp);
} else if (parent != null) {