1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.common.util;
17
18 import junit.framework.Assert;
19
20 import org.junit.Test;
21 import org.slf4j.Logger;
22 import org.slf4j.LoggerFactory;
23
24 @Deprecated
25 public class RepositoryUtilsTest {
26
27 private static final Logger logger = LoggerFactory.getLogger(RepositoryUtilsTest.class);
28
29 @Test
30 public void testArtifact() {
31 Artifact a = new Artifact();
32 a.setGroupId("org.kuali.common");
33 a.setArtifactId("kuali-util");
34 a.setVersion("1.0.0");
35 a.setClassifier("webapp");
36 a.setType("jar");
37 String gav1 = RepositoryUtils.toString(a);
38 Artifact parsed = RepositoryUtils.parseArtifact(gav1);
39 String gav2 = RepositoryUtils.toString(parsed);
40 logger.info("gav1={}", gav1);
41 logger.info("gav2={}", gav2);
42 Assert.assertEquals(gav1, gav2);
43 }
44
45 @Test
46 public void testEmptyArtifact() {
47 Artifact a = new Artifact();
48 String gav1 = RepositoryUtils.toString(a);
49 Artifact parsed = RepositoryUtils.parseArtifact(gav1);
50 String gav2 = RepositoryUtils.toString(parsed);
51 logger.info("gav1={}", gav1);
52 logger.info("gav2={}", gav2);
53 Assert.assertEquals(gav1, gav2);
54 }
55
56 @Test
57 public void testGroupIdArtifact() {
58 Artifact a = new Artifact();
59 a.setGroupId("org.kuali.common");
60 String gav1 = RepositoryUtils.toString(a);
61 Artifact parsed = RepositoryUtils.parseArtifact(gav1);
62 String gav2 = RepositoryUtils.toString(parsed);
63 logger.info("gav1={}", gav1);
64 logger.info("gav2={}", gav2);
65 Assert.assertEquals(gav1, gav2);
66 }
67
68 @Test
69 public void testTypeArtifact() {
70 Artifact a = new Artifact();
71 a.setType("jar");
72 String gav1 = RepositoryUtils.toString(a);
73 Artifact parsed = RepositoryUtils.parseArtifact(gav1);
74 String gav2 = RepositoryUtils.toString(parsed);
75 logger.info("gav1={}", gav1);
76 logger.info("gav2={}", gav2);
77 Assert.assertEquals(gav1, gav2);
78 }
79 }