/
ModuleUtilTest.java
489 lines (444 loc) · 21.3 KB
/
ModuleUtilTest.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
/**
* The contents of this file are subject to the OpenMRS Public License
* Version 1.0 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://license.openmrs.org
*
* Software distributed under the License is distributed on an "AS IS"
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
* License for the specific language governing rights and limitations
* under the License.
*
* Copyright (C) OpenMRS, LLC. All Rights Reserved.
*/
package org.openmrs.module;
import java.io.File;
import java.net.URL;
import junit.framework.Assert;
import org.junit.Ignore;
import org.junit.Test;
import org.openmrs.test.BaseContextSensitiveTest;
import org.openmrs.test.Verifies;
import org.openmrs.util.OpenmrsUtil;
/**
* Tests methods on the {@link ModuleUtil} class
*/
public class ModuleUtilTest extends BaseContextSensitiveTest {
/**
* This test requires a connection to the internet to pass
*
* @see {@link ModuleUtil#getURLStream(URL)}
*/
@Test
@Verifies(value = "should return a valid input stream for old module urls", method = "getURLStream(URL)")
public void getURLStream_shouldReturnAValidInputStreamForOldModuleUrls() throws Exception {
ModuleUtil.getURLStream(new URL("https://dev.openmrs.org/modules/download/formentry/update.rdf"));
}
/**
* This test requires a connection to the internet to pass
*
* @see {@link ModuleUtil#getURL(URL)}
*/
@Test
@Ignore
@Verifies(value = "should return an update rdf page for old https dev urls", method = "getURL(URL)")
public void getURL_shouldReturnAnUpdateRdfPageForOldHttpsDevUrls() throws Exception {
String url = "https://dev.openmrs.org/modules/download/formentry/update.rdf";
String updateRdf = ModuleUtil.getURL(new URL(url));
Assert.assertTrue("Unable to fetch module update url: " + url, updateRdf.contains("<updates"));
}
/**
* This test requires a connection to the internet to pass
*
* @see {@link ModuleUtil#getURL(URL)}
*/
@Test
@Ignore
@Verifies(value = "should return an update rdf page for old https module urls", method = "getURL(URL)")
public void getURL_shouldReturnAnUpdateRdfPageForOldHttpsModuleUrls() throws Exception {
String url = "https://modules.openmrs.org/modules/download/formentry/update.rdf";
String updateRdf = ModuleUtil.getURL(new URL(url));
Assert.assertTrue("Unable to fetch module update url: " + url, updateRdf.contains("<updates"));
}
/**
* This test requires a connection to the internet to pass
*
* @see {@link ModuleUtil#getURL(URL)}
*/
@Test
@Ignore
@Verifies(value = "should return an update rdf page for module urls", method = "getURL(URL)")
public void getURL_shouldReturnAnUpdateRdfPageForModuleUrls() throws Exception {
String url = "http://modules.openmrs.org/modules/download/formentry/update.rdf";
String updateRdf = ModuleUtil.getURL(new URL(url));
Assert.assertTrue("Unable to fetch module update url: " + url, updateRdf.contains("<updates"));
}
/**
* @see {@link ModuleUtil#checkMandatoryModulesStarted()}
*/
@Test(expected = MandatoryModuleException.class)
@Verifies(value = "should throw ModuleException if a mandatory module is not started", method = "checkMandatoryModulesStarted()")
public void checkMandatoryModulesStarted_shouldThrowModuleExceptionIfAMandatoryModuleIsNotStarted() throws Exception {
executeDataSet("org/openmrs/module/include/mandatoryModulesGlobalProperties.xml");
ModuleUtil.checkMandatoryModulesStarted();
}
/**
* @see {@link ModuleUtil#checkOpenmrsCoreModulesStarted()}
*/
@Test(expected = OpenmrsCoreModuleException.class)
@Verifies(value = "should throw ModuleException if a core module is not started", method = "checkOpenmrsCoreModulesStarted()")
public void checkMandatoryModulesStarted_shouldThrowModuleExceptionIfACoreModuleIsNotStarted() throws Exception {
runtimeProperties.setProperty(ModuleConstants.IGNORE_CORE_MODULES_PROPERTY, "false");
try {
ModuleUtil.checkOpenmrsCoreModulesStarted();
}
finally {
runtimeProperties.setProperty(ModuleConstants.IGNORE_CORE_MODULES_PROPERTY, "true");
}
}
/**
* @see {@link ModuleUtil#getMandatoryModules()}
*/
@Test
@Verifies(value = "should return mandatory module ids", method = "getMandatoryModules()")
public void getMandatoryModules_shouldReturnMandatoryModuleIds() throws Exception {
executeDataSet("org/openmrs/module/include/mandatoryModulesGlobalProperties.xml");
Assert.assertEquals(1, ModuleUtil.getMandatoryModules().size());
Assert.assertEquals("firstmodule", ModuleUtil.getMandatoryModules().get(0));
}
/**
* @see {@link ModuleUtil#matchRequiredVersions(String,String)}
*/
@Test
@Verifies(value = "should allow ranged required version", method = "matchRequiredVersions(String,String)")
public void matchRequiredVersions_shouldAllowRangedRequiredVersion() throws Exception {
String openmrsVersion = "1.4.3";
String requiredOpenmrsVersion = "1.2.3 - 1.4.4";
Assert.assertTrue(ModuleUtil.matchRequiredVersions(openmrsVersion, requiredOpenmrsVersion));
}
/**
* @see {@link ModuleUtil#matchRequiredVersions(String,String)}
*/
@Test
@Verifies(value = "should allow ranged required version with wild card", method = "matchRequiredVersions(String,String)")
public void matchRequiredVersions_shouldAllowRangedRequiredVersionWithWildCard() throws Exception {
String openmrsVersion = "1.4.3";
String requiredOpenmrsVersion = "1.2.* - 1.4.*";
Assert.assertTrue(ModuleUtil.matchRequiredVersions(openmrsVersion, requiredOpenmrsVersion));
}
/**
* @see {@link ModuleUtil#matchRequiredVersions(String,String)}
*/
@Test
@Verifies(value = "should allow ranged required version with wild card on one end", method = "matchRequiredVersions(String,String)")
public void matchRequiredVersions_shouldAllowRangedRequiredVersionWithWildCardOnOneEnd() throws Exception {
String openmrsVersion = "1.4.3";
String requiredOpenmrsVersion = "1.2.3 - 1.4.*";
Assert.assertTrue(ModuleUtil.matchRequiredVersions(openmrsVersion, requiredOpenmrsVersion));
requiredOpenmrsVersion = "1.4.* - 1.4.5";
Assert.assertTrue(ModuleUtil.matchRequiredVersions(openmrsVersion, requiredOpenmrsVersion));
}
/**
* @see {@link ModuleUtil#matchRequiredVersions(String,String)}
*/
@Test
@Verifies(value = "should allow single entry for required version", method = "matchRequiredVersions(String,String)")
public void matchRequiredVersions_shouldAllowSingleEntryForRequiredVersion() throws Exception {
String openmrsVersion = "1.4.3";
String requiredOpenmrsVersion = "1.4.2";
Assert.assertTrue(ModuleUtil.matchRequiredVersions(openmrsVersion, requiredOpenmrsVersion));
}
/**
* @see {@link ModuleUtil#matchRequiredVersions(String,String)}
*/
@Test
@Verifies(value = "should allow required version with wild card", method = "matchRequiredVersions(String,String)")
public void matchRequiredVersions_shouldAllowRequiredVersionWithWildCard() throws Exception {
String openmrsVersion = "1.4.3";
String requiredOpenmrsVersion = "1.4.*";
Assert.assertTrue(ModuleUtil.matchRequiredVersions(openmrsVersion, requiredOpenmrsVersion));
}
/**
* @see {@link ModuleUtil#matchRequiredVersions(String,String)}
*/
@Test
@Verifies(value = "should allow non numeric character required version", method = "matchRequiredVersions(String,String)")
public void matchRequiredVersions_shouldAllowNonNumericCharacterRequiredVersion() throws Exception {
String openmrsVersion = "1.4.3";
String requiredOpenmrsVersion = "1.4.3a";
Assert.assertTrue(ModuleUtil.matchRequiredVersions(openmrsVersion, requiredOpenmrsVersion));
}
/**
* @see {@link ModuleUtil#matchRequiredVersions(String,String)}
*/
@Test
@Verifies(value = "should allow ranged non numeric character required version", method = "matchRequiredVersions(String,String)")
public void matchRequiredVersions_shouldAllowRangedNonNumericCharacterRequiredVersion() throws Exception {
String openmrsVersion = "1.4.3";
String requiredOpenmrsVersion = "1.4.1a - 1.4.3a";
Assert.assertTrue(ModuleUtil.matchRequiredVersions(openmrsVersion, requiredOpenmrsVersion));
}
/**
* @see {@link ModuleUtil#matchRequiredVersions(String,String)}
*/
@Test
@Verifies(value = "should allow ranged non numeric character with wild card", method = "matchRequiredVersions(String,String)")
public void matchRequiredVersions_shouldAllowRangedNonNumericCharacterWithWildCard() throws Exception {
String openmrsVersion = "1.4.3";
String requiredOpenmrsVersion = "1.3.*a - 1.4.*a";
Assert.assertTrue(ModuleUtil.matchRequiredVersions(openmrsVersion, requiredOpenmrsVersion));
}
/**
* @see {@link ModuleUtil#matchRequiredVersions(String,String)}
*/
@Test
@Verifies(value = "should allow ranged non numeric character with wild card on one end", method = "matchRequiredVersions(String,String)")
public void matchRequiredVersions_shouldAllowRangedNonNumericCharacterWithWildCardOnOneEnd() throws Exception {
String openmrsVersion = "1.4.3";
String requiredOpenmrsVersion = "1.2.3 - 1.4.*a";
Assert.assertTrue(ModuleUtil.matchRequiredVersions(openmrsVersion, requiredOpenmrsVersion));
requiredOpenmrsVersion = "1.4.*a - 1.4.5a";
Assert.assertTrue(ModuleUtil.matchRequiredVersions(openmrsVersion, requiredOpenmrsVersion));
}
/**
* @see {@link ModuleUtil#matchRequiredVersions(String,String)}
*/
@Test
@Verifies(value = "should return false when openmrs version beyond wild card range", method = "matchRequiredVersions(String,String)")
public void matchRequiredVersions_shouldReturnFalseWhenOpenmrsVersionBeyondWildCardRange() throws Exception {
String openmrsVersion = "1.4.3";
String requiredOpenmrsVersion = "1.3.*";
Assert.assertFalse(ModuleUtil.matchRequiredVersions(openmrsVersion, requiredOpenmrsVersion));
requiredOpenmrsVersion = "1.5.*";
Assert.assertFalse(ModuleUtil.matchRequiredVersions(openmrsVersion, requiredOpenmrsVersion));
}
/**
* @see {@link ModuleUtil#matchRequiredVersions(String,String)}
*/
@Test
@Verifies(value = "should return false when required version beyond openmrs version", method = "matchRequiredVersions(String,String)")
public void matchRequiredVersions_shouldReturnFalseWhenRequiredVersionBeyondOpenmrsVersion() throws Exception {
String openmrsVersion = "1.4.3";
String requiredOpenmrsVersion = "1.5.*";
Assert.assertFalse(ModuleUtil.matchRequiredVersions(openmrsVersion, requiredOpenmrsVersion));
}
/**
* @see {@link ModuleUtil#matchRequiredVersions(String,String)}
*/
@Test
@Verifies(value = "should return false when required version with wild card beyond openmrs version", method = "matchRequiredVersions(String,String)")
public void matchRequiredVersions_shouldReturnFalseWhenRequiredVersionWithWildCardBeyondOpenmrsVersion()
throws Exception {
String openmrsVersion = "1.4.3";
String requiredOpenmrsVersion = "1.5.* - 1.6.*";
Assert.assertFalse(ModuleUtil.matchRequiredVersions(openmrsVersion, requiredOpenmrsVersion));
}
/**
* @see {@link ModuleUtil#matchRequiredVersions(String,String)}
*/
@Test
@Verifies(value = "should return false when required version with wild card on one end beyond openmrs version", method = "matchRequiredVersions(String,String)")
public void matchRequiredVersions_shouldReturnFalseWhenRequiredVersionWithWildCardOnOneEndBeyondOpenmrsVersion()
throws Exception {
String openmrsVersion = "1.4.3";
String requiredOpenmrsVersion = "1.4.5 - 1.5.*";
Assert.assertFalse(ModuleUtil.matchRequiredVersions(openmrsVersion, requiredOpenmrsVersion));
requiredOpenmrsVersion = "1.5.* - 1.6.0";
Assert.assertFalse(ModuleUtil.matchRequiredVersions(openmrsVersion, requiredOpenmrsVersion));
}
/**
* @see {@link ModuleUtil#matchRequiredVersions(String,String)}
*/
@Test
@Verifies(value = "should return false when single entry required version beyond openmrs version", method = "matchRequiredVersions(String,String)")
public void matchRequiredVersions_shouldReturnFalseWhenSingleEntryRequiredVersionBeyondOpenmrsVersion() throws Exception {
String openmrsVersion = "1.4.3";
String requiredOpenmrsVersion = "1.5.0";
Assert.assertFalse(ModuleUtil.matchRequiredVersions(openmrsVersion, requiredOpenmrsVersion));
}
/**
* @see {@link ModuleUtil#matchRequiredVersions(String,String)}
*/
@Test
@Verifies(value = "should allow release type in the version", method = "matchRequiredVersions(String,String)")
public void matchRequiredVersions_shouldAllowReleaseTypeInTheVersion() throws Exception {
String openmrsVersion = "1.4.3";
String requiredOpenmrsVersion = "1.4.1-dev - 1.5.*-alpha";
Assert.assertTrue(ModuleUtil.matchRequiredVersions(openmrsVersion, requiredOpenmrsVersion));
requiredOpenmrsVersion = "1.5.*-dev - 1.6.0-dev";
Assert.assertFalse(ModuleUtil.matchRequiredVersions(openmrsVersion, requiredOpenmrsVersion));
}
/**
* @see {@link ModuleUtil#getPathForResource(Module,String)}
*/
@Test
@Verifies(value = "should handle ui springmvc css ui dot css example", method = "getPathForResource(Module,String)")
public void getPathForResource_shouldHandleUiSpringmvcCssUiDotCssExample() throws Exception {
Module module = new Module("Unit test");
module.setModuleId("ui.springmvc");
String path = "/ui/springmvc/css/ui.css";
Assert.assertEquals("/css/ui.css", ModuleUtil.getPathForResource(module, path));
}
/**
* @see {@link ModuleUtil#getModuleForPath(String)}
*/
@Test
@Verifies(value = "should handle ui springmvc css ui dot css when ui dot springmvc module is running", method = "getModuleForPath(String)")
public void getModuleForPath_shouldHandleUiSpringmvcCssUiDotCssWhenUiDotSpringmvcModuleIsRunning() throws Exception {
ModuleFactory.getStartedModulesMap().clear();
Module module = new Module("For Unit Test");
module.setModuleId("ui.springmvc");
ModuleFactory.getStartedModulesMap().put(module.getModuleId(), module);
String path = "/ui/springmvc/css/ui.css";
Assert.assertEquals(module, ModuleUtil.getModuleForPath(path));
}
/**
* @see {@link ModuleUtil#getModuleForPath(String)}
*/
@Test
@Verifies(value = "should handle ui springmvc css ui dot css when ui module is running", method = "getModuleForPath(String)")
public void getModuleForPath_shouldHandleUiSpringmvcCssUiDotCssWhenUiModuleIsRunning() throws Exception {
ModuleFactory.getStartedModulesMap().clear();
Module module = new Module("For Unit Test");
module.setModuleId("ui");
ModuleFactory.getStartedModulesMap().put(module.getModuleId(), module);
String path = "/ui/springmvc/css/ui.css";
Assert.assertEquals(module, ModuleUtil.getModuleForPath(path));
}
/**
* @see {@link ModuleUtil#getModuleForPath(String)}
*/
@Test
@Verifies(value = "should return null for ui springmvc css ui dot css when no relevant module is running", method = "getModuleForPath(String)")
public void getModuleForPath_shouldReturnNullForUiSpringmvcCssUiDotCssWhenNoRelevantModuleIsRunning() throws Exception {
ModuleFactory.getStartedModulesMap().clear();
String path = "/ui/springmvc/css/ui.css";
Assert.assertNull(ModuleUtil.getModuleForPath(path));
}
/**
* @see {@link ModuleUtil#checkRequiredVersion(String, String)}
*/
@Test(expected = ModuleException.class)
@Verifies(value = "should throw ModuleException if openmrs version beyond wild card range", method = "checkRequiredVersion(String, String)")
public void checkRequiredVersion_shouldThrowModuleExceptionIfOpenmrsVersionBeyondWildCardRange() throws Exception {
String openmrsVersion = "1.4.3";
String requiredOpenmrsVersion = "1.3.*";
ModuleUtil.checkRequiredVersion(openmrsVersion, requiredOpenmrsVersion);
}
/**
* @see {@link ModuleUtil#checkRequiredVersion(String, String)}
*/
@Test(expected = ModuleException.class)
@Verifies(value = "should throw ModuleException if required version beyond openmrs version", method = "checkRequiredVersion(String, String)")
public void checkRequiredVersion_shouldThrowModuleExceptionIfRequiredVersionBeyondOpenmrsVersion() throws Exception {
String openmrsVersion = "1.4.3";
String requiredOpenmrsVersion = "1.5.*";
ModuleUtil.checkRequiredVersion(openmrsVersion, requiredOpenmrsVersion);
}
/**
* @see {@link ModuleUtil#checkRequiredVersion(String, String)}
*/
@Test(expected = ModuleException.class)
@Verifies(value = "should throw ModuleException if required version with wild card beyond openmrs version", method = "checkRequiredVersion(String, String)")
public void checkRequiredVersion_shouldThrowModuleExceptionIfRequiredVersionWithWildCardBeyondOpenmrsVersion()
throws Exception {
String openmrsVersion = "1.4.3";
String requiredOpenmrsVersion = "1.5.* - 1.6.*";
ModuleUtil.checkRequiredVersion(openmrsVersion, requiredOpenmrsVersion);
}
/**
* @see {@link ModuleUtil#checkRequiredVersion(String, String)}
*/
@Test(expected = ModuleException.class)
@Verifies(value = "should throw ModuleException if required version with wild card on one end beyond openmrs version", method = "checkRequiredVersion(String, String)")
public void checkRequiredVersion_shouldThrowModuleExceptionIfRequiredVersionWithWildCardOnOneEndBeyondOpenmrsVersion()
throws Exception {
String openmrsVersion = "1.4.3";
String requiredOpenmrsVersion = "1.4.5 - 1.5.*";
ModuleUtil.checkRequiredVersion(openmrsVersion, requiredOpenmrsVersion);
}
/**
* @see {@link ModuleUtil#checkRequiredVersion(String, String)}
*/
@Test(expected = ModuleException.class)
@Verifies(value = "should throw ModuleException if single entry required version beyond openmrs version", method = "checkRequiredVersion(String, String)")
public void checkRequiredVersion_shouldThrowModuleExceptionIfSingleEntryRequiredVersionBeyondOpenmrsVersion()
throws Exception {
String openmrsVersion = "1.4.3";
String requiredOpenmrsVersion = "1.5.0";
ModuleUtil.checkRequiredVersion(openmrsVersion, requiredOpenmrsVersion);
}
/**
* @see {@link ModuleUtil#compareVersion(String,String)}
*/
@Test
@Verifies(value = "should correctly comparing two version numbers", method = "compareVersion(String,String)")
public void compareVersion_shouldCorrectlyComparingTwoVersionNumbers() throws Exception {
String olderVersion = "2.1.1";
String newerVersion = "2.1.10";
Assert.assertTrue(ModuleUtil.compareVersion(olderVersion, newerVersion) < 0);
}
/**
* @see {@link ModuleUtil#compareVersion(String,String)}
*/
@Test
@Verifies(value = "treat SNAPSHOT as earliest version", method = "compareVersion(String,String)")
public void compareVersion_shouldTreatSNAPSHOTAsEarliestVersion() throws Exception {
String olderVersion = "1.8.3";
String newerVersion = "1.8.4-SNAPSHOT";
Assert.assertTrue(ModuleUtil.compareVersion(newerVersion, olderVersion) > 0);
//should still return the correct value if the arguments are switched
Assert.assertTrue(ModuleUtil.compareVersion(olderVersion, newerVersion) < 0);
}
/**
* @see {@link ModuleUtil#getModuleRepository()}
*/
@Test
@Verifies(value = "should use the runtime property as the first choice if specified", method = "getModuleRepository()")
public void getModuleRepository_shouldUseTheRuntimePropertyAsTheFirstChoiceIfSpecified() throws Exception {
final String folderName = "test_folder";
File testFolder = null;
runtimeProperties.setProperty(ModuleConstants.REPOSITORY_FOLDER_RUNTIME_PROPERTY, folderName);
try {
testFolder = ModuleUtil.getModuleRepository();
Assert.assertNotNull(testFolder);
Assert.assertEquals(new File(OpenmrsUtil.getApplicationDataDirectory(), folderName), ModuleUtil
.getModuleRepository());
}
finally {
if (testFolder != null)
testFolder.deleteOnExit();
runtimeProperties.setProperty(ModuleConstants.REPOSITORY_FOLDER_RUNTIME_PROPERTY, "");
}
}
/**
* @see {@link ModuleUtil#getModuleRepository()}
*/
@Test
@Verifies(value = "should return the correct file if the runtime property is an absolute path", method = "getModuleRepository()")
public void getModuleRepository_shouldReturnTheCorrectFileIfTheRuntimePropertyIsAnAbsolutePath() throws Exception {
final File expectedModuleRepo = new File(System.getProperty("java.io.tmpdir"), "test_folder");
expectedModuleRepo.mkdirs();
runtimeProperties.setProperty(ModuleConstants.REPOSITORY_FOLDER_RUNTIME_PROPERTY, expectedModuleRepo
.getAbsolutePath());
try {
File testFolder = ModuleUtil.getModuleRepository();
Assert.assertNotNull(testFolder);
Assert.assertEquals(expectedModuleRepo, testFolder);
}
finally {
runtimeProperties.setProperty(ModuleConstants.REPOSITORY_FOLDER_RUNTIME_PROPERTY, "");
expectedModuleRepo.deleteOnExit();
}
}
/**
* @see {@link ModuleUtil#checkRequiredVersion(String, String)}
*/
@Test(expected = ModuleException.class)
@Verifies(value = "should throw ModuleException if SNAPSHOT not handled correctly", method = "checkRequiredVersion(String, String)")
public void checkRequiredVersion_shouldThrowModuleExceptionIfSNAPSHOTNotHandledCorrectly() throws Exception {
String openmrsVersion = "1.4.3";
String requiredOpenmrsVersion = "1.4.5 - ";
ModuleUtil.checkRequiredVersion(openmrsVersion, requiredOpenmrsVersion);
}
}