1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18 package org.owasp.dependencycheck.xml.pom;
19
20 import java.util.ArrayList;
21 import java.util.List;
22 import java.util.Properties;
23
24 import org.junit.Test;
25 import static org.junit.Assert.*;
26
27
28
29
30
31 public class ModelTest {
32
33
34
35
36 @Test
37 public void testGetName() {
38 Model instance = new Model();
39 instance.setName("");
40 String expResult = "";
41 String result = instance.getName();
42 assertEquals(expResult, result);
43 }
44
45
46
47
48 @Test
49 public void testSetName() {
50 String name = "";
51 Model instance = new Model();
52 instance.setName(name);
53 }
54
55
56
57
58 @Test
59 public void testGetOrganization() {
60 Model instance = new Model();
61 instance.setOrganization("");
62 String expResult = "";
63 String result = instance.getOrganization();
64 assertEquals(expResult, result);
65 }
66
67
68
69
70 @Test
71 public void testSetOrganization() {
72 String organization = "";
73 Model instance = new Model();
74 instance.setOrganization(organization);
75 }
76
77
78
79
80 @Test
81 public void testGetDescription() {
82 Model instance = new Model();
83 instance.setDescription("");
84 String expResult = "";
85 String result = instance.getDescription();
86 assertEquals(expResult, result);
87 }
88
89
90
91
92 @Test
93 public void testSetDescription() {
94 String description = "";
95 Model instance = new Model();
96 instance.setDescription(description);
97 }
98
99
100
101
102 @Test
103 public void testGetGroupId() {
104 Model instance = new Model();
105 instance.setGroupId("");
106 String expResult = "";
107 String result = instance.getGroupId();
108 assertEquals(expResult, result);
109 }
110
111
112
113
114 @Test
115 public void testSetGroupId() {
116 String groupId = "";
117 Model instance = new Model();
118 instance.setGroupId(groupId);
119 }
120
121
122
123
124 @Test
125 public void testGetArtifactId() {
126 Model instance = new Model();
127 instance.setArtifactId("");
128 String expResult = "";
129 String result = instance.getArtifactId();
130 assertEquals(expResult, result);
131 }
132
133
134
135
136 @Test
137 public void testSetArtifactId() {
138 String artifactId = "";
139 Model instance = new Model();
140 instance.setArtifactId(artifactId);
141 }
142
143
144
145
146 @Test
147 public void testGetVersion() {
148 Model instance = new Model();
149 instance.setVersion("");
150 String expResult = "";
151 String result = instance.getVersion();
152 assertEquals(expResult, result);
153 }
154
155
156
157
158 @Test
159 public void testSetVersion() {
160 String version = "";
161 Model instance = new Model();
162 instance.setVersion(version);
163 }
164
165
166
167
168 @Test
169 public void testGetParentGroupId() {
170 Model instance = new Model();
171 instance.setParentGroupId("");
172 String expResult = "";
173 String result = instance.getParentGroupId();
174 assertEquals(expResult, result);
175 }
176
177
178
179
180 @Test
181 public void testSetParentGroupId() {
182 String parentGroupId = "";
183 Model instance = new Model();
184 instance.setParentGroupId(parentGroupId);
185 }
186
187
188
189
190 @Test
191 public void testGetParentArtifactId() {
192 Model instance = new Model();
193 instance.setParentArtifactId("");
194 String expResult = "";
195 String result = instance.getParentArtifactId();
196 assertEquals(expResult, result);
197 }
198
199
200
201
202 @Test
203 public void testSetParentArtifactId() {
204 String parentArtifactId = "";
205 Model instance = new Model();
206 instance.setParentArtifactId(parentArtifactId);
207 }
208
209
210
211
212 @Test
213 public void testGetParentVersion() {
214 Model instance = new Model();
215 instance.setParentVersion("");
216 String expResult = "";
217 String result = instance.getParentVersion();
218 assertEquals(expResult, result);
219 }
220
221
222
223
224 @Test
225 public void testSetParentVersion() {
226 String parentVersion = "";
227 Model instance = new Model();
228 instance.setParentVersion(parentVersion);
229 }
230
231
232
233
234 @Test
235 public void testGetLicenses() {
236 Model instance = new Model();
237 instance.addLicense(new License("name", "url"));
238 List<License> expResult = new ArrayList<License>();
239 expResult.add(new License("name", "url"));
240 List<License> result = instance.getLicenses();
241 assertEquals(expResult, result);
242 }
243
244
245
246
247 @Test
248 public void testAddLicense() {
249 License license = new License("name", "url");
250 Model instance = new Model();
251 instance.addLicense(license);
252 }
253
254
255
256
257 @Test
258 public void testProcessProperties() {
259 Properties prop = new Properties();
260 prop.setProperty("key", "value");
261 prop.setProperty("nested", "nested ${key}");
262 String text = "This is a test of '${key}' '${nested}'";
263
264 Model instance = new Model();
265 instance.setName(text);
266 instance.processProperties(prop);
267 String expResults = "This is a test of 'value' 'nested value'";
268 assertEquals(expResults, instance.getName());
269 }
270
271
272
273
274 @Test
275 public void testInterpolateString() {
276 Properties prop = new Properties();
277 prop.setProperty("key", "value");
278 prop.setProperty("nested", "nested ${key}");
279 String text = "This is a test of '${key}' '${nested}'";
280 String expResults = "This is a test of 'value' 'nested value'";
281 String results = Model.interpolateString(text, prop);
282 assertEquals(expResults, results);
283 }
284
285 }