1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19 package org.apache.maven.scm.provider.git.gitexe.command.remoteinfo;
20
21 import org.apache.maven.scm.ScmTestCase;
22 import org.apache.maven.scm.command.remoteinfo.RemoteInfoScmResult;
23 import org.junit.Test;
24
25 import static org.junit.Assert.assertEquals;
26
27
28
29
30 public class GitRemoteInfoConsumerTest extends ScmTestCase {
31
32 @Test
33 public void testConsumerRemoteInfo() {
34 GitRemoteInfoConsumer consumer = new GitRemoteInfoConsumer(null);
35
36 consumer.consumeLine("344581899752998038a74989142221ae08c381bc HEAD");
37 consumer.consumeLine("344581899752998038a74989142221ae08c381bc refs/heads/master");
38 consumer.consumeLine("9006c3dbaa9749aa435694f261638583c9088419 refs/tags/staging");
39
40 RemoteInfoScmResult remoteInfoScmResult = consumer.getRemoteInfoScmResult();
41
42 assertEquals(1, remoteInfoScmResult.getBranches().size());
43 assertEquals(
44 "344581899752998038a74989142221ae08c381bc",
45 remoteInfoScmResult.getBranches().get("master"));
46
47 assertEquals(1, remoteInfoScmResult.getTags().size());
48 assertEquals(
49 "9006c3dbaa9749aa435694f261638583c9088419",
50 remoteInfoScmResult.getTags().get("staging"));
51 }
52 }