|
19 | 19 | import java.net.SocketAddress;
|
20 | 20 | import java.net.URI;
|
21 | 21 | import java.net.URISyntaxException;
|
| 22 | +import java.util.Arrays; |
22 | 23 | import java.util.List;
|
23 | 24 |
|
24 | 25 | import org.apache.commons.io.FileUtils;
|
|
38 | 39 | import org.mockito.exceptions.verification.WantedButNotInvoked;
|
39 | 40 | import org.scm4j.vcs.api.IVCS;
|
40 | 41 | import org.scm4j.vcs.api.VCSChangeType;
|
| 42 | +import org.scm4j.vcs.api.VCSCommit; |
41 | 43 | import org.scm4j.vcs.api.VCSTag;
|
42 | 44 | import org.scm4j.vcs.api.abstracttest.VCSAbstractTest;
|
43 | 45 | import org.scm4j.vcs.api.exceptions.EVCSException;
|
@@ -319,5 +321,23 @@ public void testCheckoutExceptions() throws Exception {
|
319 | 321 | assertTrue(e.getCause().getMessage().contains(eApi.getMessage()));
|
320 | 322 | }
|
321 | 323 | }
|
| 324 | + |
| 325 | + @Test |
| 326 | + public void testGetTagsOnRevisionUnannotated() throws Exception { |
| 327 | + VCSCommit c1 = vcs.setFileContent(null, FILE1_NAME, LINE_1, FILE1_ADDED_COMMIT_MESSAGE); |
| 328 | + VCSCommit c2 = vcs.setFileContent(null, FILE1_NAME, LINE_2, FILE1_CONTENT_CHANGED_COMMIT_MESSAGE + " " + LINE_2); |
| 329 | + vcs.createBranch(null, NEW_BRANCH, CREATED_DST_BRANCH_COMMIT_MESSAGE); |
| 330 | + VCSCommit c3 = vcs.setFileContent(NEW_BRANCH, FILE1_NAME, LINE_3, FILE1_CONTENT_CHANGED_COMMIT_MESSAGE + " " + LINE_3); |
| 331 | + |
| 332 | + VCSTag tag1 = createUnannotatedTag(null, TAG_NAME_1, c1.getRevision()); |
| 333 | + VCSTag tag2 = createUnannotatedTag(null, TAG_NAME_2, c1.getRevision()); |
| 334 | + VCSTag tag3 = createUnannotatedTag(NEW_BRANCH, TAG_NAME_3, c3.getRevision()); |
| 335 | + |
| 336 | + assertTrue(vcs.getTagsOnRevision(c1.getRevision()).containsAll(Arrays.asList( |
| 337 | + tag1, tag2))); |
| 338 | + assertTrue(vcs.getTagsOnRevision(c2.getRevision()).isEmpty()); |
| 339 | + assertTrue(vcs.getTagsOnRevision(c3.getRevision()).containsAll(Arrays.asList( |
| 340 | + tag3))); |
| 341 | + } |
322 | 342 | }
|
323 | 343 |
|
0 commit comments