32
32
33
33
import static org .junit .jupiter .api .Assertions .assertEquals ;
34
34
35
- public class ParseVersionTest {
36
- public static class TestParseVersionMojo extends ParseVersionMojo {
35
+ class ParseVersionTest {
36
+ static class TestParseVersionMojo extends ParseVersionMojo {
37
37
private final Properties properties ;
38
38
39
- public TestParseVersionMojo (Properties properties ) {
39
+ TestParseVersionMojo (Properties properties ) {
40
40
this .properties = properties ;
41
41
}
42
42
43
+ @ Override
43
44
protected void defineProperty (String name , String value ) {
44
45
properties .put (name , value );
45
46
}
46
47
}
47
48
48
49
@ Nested
49
- public class TestParseVersion {
50
+ class TestParseVersion {
50
51
private Properties props ;
51
52
52
53
private ParseVersionMojo mojo ;
53
54
54
55
@ BeforeEach
55
- public void beforeClass () {
56
+ void beforeClass () {
56
57
props = new Properties ();
57
58
mojo = new TestParseVersionMojo (props );
58
59
mojo .setPropertyPrefix ("parsed" );
@@ -67,7 +68,7 @@ public void beforeClass() {
67
68
}
68
69
69
70
@ Test
70
- public void checkJunkVersion () {
71
+ void checkJunkVersion () {
71
72
// Test a junk version string
72
73
mojo .parseVersion ("junk" );
73
74
@@ -80,7 +81,7 @@ public void checkJunkVersion() {
80
81
}
81
82
82
83
@ Test
83
- public void checkBasicMavenVersionString () {
84
+ void checkBasicMavenVersionString () {
84
85
// Test a basic maven version string
85
86
mojo .parseVersion ("1.0.0" );
86
87
@@ -93,7 +94,7 @@ public void checkBasicMavenVersionString() {
93
94
}
94
95
95
96
@ Test
96
- public void checkVersionStringWithQualifier () {
97
+ void checkVersionStringWithQualifier () {
97
98
// Test a version string with qualifier
98
99
mojo .parseVersion ("2.3.4-beta-5" );
99
100
@@ -106,7 +107,7 @@ public void checkVersionStringWithQualifier() {
106
107
}
107
108
108
109
@ Test
109
- public void checkOSGiVersionStringWithQualifier () {
110
+ void checkOSGiVersionStringWithQualifier () {
110
111
// Test an osgi version string
111
112
mojo .parseVersion ("2.3.4.beta_5" );
112
113
@@ -119,7 +120,7 @@ public void checkOSGiVersionStringWithQualifier() {
119
120
}
120
121
121
122
@ Test
122
- public void checkSnapshotVersion () {
123
+ void checkSnapshotVersion () {
123
124
// Test a snapshot version string
124
125
mojo .parseVersion ("1.2.3-SNAPSHOT" );
125
126
@@ -132,7 +133,7 @@ public void checkSnapshotVersion() {
132
133
}
133
134
134
135
@ Test
135
- public void checkSnapshotVersion2 () {
136
+ void checkSnapshotVersion2 () {
136
137
// Test a snapshot version string
137
138
mojo .parseVersion ("2.0.17-SNAPSHOT" );
138
139
@@ -145,7 +146,7 @@ public void checkSnapshotVersion2() {
145
146
}
146
147
147
148
@ Test
148
- public void checkVersionStringWithBuildNumber () {
149
+ void checkVersionStringWithBuildNumber () {
149
150
// Test a version string with a build number
150
151
mojo .parseVersion ("1.2.3-4" );
151
152
@@ -158,7 +159,7 @@ public void checkVersionStringWithBuildNumber() {
158
159
}
159
160
160
161
@ Test
161
- public void checkSnapshotVersionStringWithBuildNumber () {
162
+ void checkSnapshotVersionStringWithBuildNumber () {
162
163
// Test a version string with a build number
163
164
mojo .parseVersion ("1.2.3-4-SNAPSHOT" );
164
165
@@ -178,7 +179,7 @@ class TestParseNextVersion {
178
179
private ParseVersionMojo mojo ;
179
180
180
181
@ BeforeEach
181
- public void beforeClass () {
182
+ void beforeClass () {
182
183
props = new Properties ();
183
184
mojo = new TestParseVersionMojo (props );
184
185
mojo .setPropertyPrefix ("parsed" );
@@ -192,7 +193,7 @@ public void beforeClass() {
192
193
}
193
194
194
195
@ Test
195
- public void checkJunkVersion () {
196
+ void checkJunkVersion () {
196
197
mojo .parseVersion ("junk" );
197
198
198
199
assertEquals ("1" , props .getProperty ("parsed.nextMajorVersion" ));
@@ -202,7 +203,7 @@ public void checkJunkVersion() {
202
203
}
203
204
204
205
@ Test
205
- public void testBasicMavenVersion () {
206
+ void testBasicMavenVersion () {
206
207
mojo .parseVersion ("1.0.0" );
207
208
208
209
assertEquals ("2" , props .getProperty ("parsed.nextMajorVersion" ));
@@ -212,7 +213,7 @@ public void testBasicMavenVersion() {
212
213
}
213
214
214
215
@ Test
215
- public void testVersionStringWithQualifier () {
216
+ void testVersionStringWithQualifier () {
216
217
mojo .parseVersion ("2.3.4-beta-5" );
217
218
218
219
assertEquals ("3" , props .getProperty ("parsed.nextMajorVersion" ));
@@ -222,7 +223,7 @@ public void testVersionStringWithQualifier() {
222
223
}
223
224
224
225
@ Test
225
- public void testOSGiVersion () {
226
+ void testOSGiVersion () {
226
227
mojo .parseVersion ("2.3.4.beta_5" );
227
228
228
229
assertEquals ("3" , props .getProperty ("parsed.nextMajorVersion" ));
@@ -232,7 +233,7 @@ public void testOSGiVersion() {
232
233
}
233
234
234
235
@ Test
235
- public void testSnapshotVersion () {
236
+ void testSnapshotVersion () {
236
237
// Test a snapshot version string
237
238
mojo .parseVersion ("1.2.3-SNAPSHOT" );
238
239
@@ -243,7 +244,7 @@ public void testSnapshotVersion() {
243
244
}
244
245
245
246
@ Test
246
- public void testSnapshotVersion2 () {
247
+ void testSnapshotVersion2 () {
247
248
// Test a snapshot version string
248
249
mojo .parseVersion ("2.0.17-SNAPSHOT" );
249
250
@@ -254,7 +255,7 @@ public void testSnapshotVersion2() {
254
255
}
255
256
256
257
@ Test
257
- public void testVersionStringWithBuildNumber () {
258
+ void testVersionStringWithBuildNumber () {
258
259
mojo .parseVersion ("1.2.3-4" );
259
260
260
261
assertEquals ("2" , props .getProperty ("parsed.nextMajorVersion" ));
@@ -271,7 +272,7 @@ class TestFormattedVersion {
271
272
private ParseVersionMojo mojo ;
272
273
273
274
@ BeforeEach
274
- public void beforeClass () {
275
+ void beforeClass () {
275
276
props = new Properties ();
276
277
mojo = new TestParseVersionMojo (props );
277
278
mojo .setPropertyPrefix ("parsed" );
@@ -285,7 +286,7 @@ public void beforeClass() {
285
286
}
286
287
287
288
@ Test
288
- public void testJunkVersion () {
289
+ void testJunkVersion () {
289
290
mojo .parseVersion ("junk" );
290
291
291
292
assertEquals ("00" , props .getProperty ("formatted.majorVersion" ));
@@ -300,7 +301,7 @@ public void testJunkVersion() {
300
301
}
301
302
302
303
@ Test
303
- public void testBasicMavenVersion () {
304
+ void testBasicMavenVersion () {
304
305
mojo .parseVersion ("1.0.0" );
305
306
306
307
assertEquals ("01" , props .getProperty ("formatted.majorVersion" ));
@@ -315,7 +316,7 @@ public void testBasicMavenVersion() {
315
316
}
316
317
317
318
@ Test
318
- public void testVersionStringWithQualifier () {
319
+ void testVersionStringWithQualifier () {
319
320
mojo .parseVersion ("2.3.4-beta-5" );
320
321
321
322
assertEquals ("02" , props .getProperty ("formatted.majorVersion" ));
@@ -330,7 +331,7 @@ public void testVersionStringWithQualifier() {
330
331
}
331
332
332
333
@ Test
333
- public void testOSGiVersion () {
334
+ void testOSGiVersion () {
334
335
mojo .parseVersion ("2.3.4.beta_5" );
335
336
336
337
assertEquals ("02" , props .getProperty ("formatted.majorVersion" ));
@@ -345,7 +346,7 @@ public void testOSGiVersion() {
345
346
}
346
347
347
348
@ Test
348
- public void testSnapshotVersion () {
349
+ void testSnapshotVersion () {
349
350
// Test a snapshot version string
350
351
mojo .parseVersion ("1.2.3-SNAPSHOT" );
351
352
@@ -361,7 +362,7 @@ public void testSnapshotVersion() {
361
362
}
362
363
363
364
@ Test
364
- public void testSnapshotVersion2 () {
365
+ void testSnapshotVersion2 () {
365
366
// Test a snapshot version string
366
367
mojo .parseVersion ("2.0.17-SNAPSHOT" );
367
368
@@ -377,7 +378,7 @@ public void testSnapshotVersion2() {
377
378
}
378
379
379
380
@ Test
380
- public void testVersionStringWithBuildNumber () {
381
+ void testVersionStringWithBuildNumber () {
381
382
mojo .parseVersion ("1.2.3-4" );
382
383
383
384
assertEquals ("01" , props .getProperty ("formatted.majorVersion" ));
0 commit comments