Skip to content

Commit 0a5b754

Browse files
committed
Use JUnit 5 convention for test method visibility
1 parent 11933b3 commit 0a5b754

16 files changed

+97
-97
lines changed

src/test/java/org/apache/commons/cli/AbstractParserTestCase.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ public void setUp() {
6565
}
6666

6767
@Test
68-
public void testAmbiguousArgParsing() throws Exception {
68+
void testAmbiguousArgParsing() throws Exception {
6969
final String[] args = { "-=-" };
7070
final Options options = new Options();
7171
assertThrows(UnrecognizedOptionException.class, () -> parser.parse(options, args));

src/test/java/org/apache/commons/cli/BasicParserTest.java

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -36,162 +36,162 @@ public void setUp() {
3636
@Override
3737
@Test
3838
@Disabled("not supported by the BasicParser")
39-
public void testAmbiguousLongWithoutEqualSingleDash() throws Exception {
39+
void testAmbiguousLongWithoutEqualSingleDash() throws Exception {
4040
}
4141

4242
@Override
4343
@Test
4444
@Disabled("not supported by the BasicParser")
45-
public void testAmbiguousLongWithoutEqualSingleDash2() throws Exception {
45+
void testAmbiguousLongWithoutEqualSingleDash2() throws Exception {
4646
}
4747

4848
@Override
4949
@Test
5050
@Disabled("not supported by the BasicParser")
51-
public void testAmbiguousPartialLongOption1() throws Exception {
51+
void testAmbiguousPartialLongOption1() throws Exception {
5252
}
5353

5454
@Override
5555
@Test
5656
@Disabled("not supported by the BasicParser")
57-
public void testAmbiguousPartialLongOption2() throws Exception {
57+
void testAmbiguousPartialLongOption2() throws Exception {
5858
}
5959

6060
@Override
6161
@Test
6262
@Disabled("not supported by the BasicParser")
63-
public void testAmbiguousPartialLongOption3() throws Exception {
63+
void testAmbiguousPartialLongOption3() throws Exception {
6464
}
6565

6666
@Override
6767
@Test
6868
@Disabled("not supported by the BasicParser")
69-
public void testAmbiguousPartialLongOption4() throws Exception {
69+
void testAmbiguousPartialLongOption4() throws Exception {
7070
}
7171

7272
@Override
7373
@Test
7474
@Disabled("not supported by the BasicParser")
75-
public void testBursting() throws Exception {
75+
void testBursting() throws Exception {
7676
}
7777

7878
@Override
7979
@Test
8080
@Disabled("not supported by the BasicParser")
81-
public void testDoubleDash2() throws Exception {
81+
void testDoubleDash2() throws Exception {
8282
}
8383

8484
@Override
8585
@Test
8686
@Disabled("not supported by the BasicParser")
87-
public void testLongOptionWithEqualsQuoteHandling() throws Exception {
87+
void testLongOptionWithEqualsQuoteHandling() throws Exception {
8888
}
8989

9090
@Override
9191
@Test
9292
@Disabled("not supported by the BasicParser")
93-
public void testLongWithEqualDoubleDash() throws Exception {
93+
void testLongWithEqualDoubleDash() throws Exception {
9494
}
9595

9696
@Override
9797
@Test
9898
@Disabled("not supported by the BasicParser")
99-
public void testLongWithEqualSingleDash() throws Exception {
99+
void testLongWithEqualSingleDash() throws Exception {
100100
}
101101

102102
@Override
103103
@Test
104104
@Disabled("not supported by the BasicParser")
105-
public void testLongWithoutEqualSingleDash() throws Exception {
105+
void testLongWithoutEqualSingleDash() throws Exception {
106106
}
107107

108108
@Override
109109
@Test
110110
@Disabled("not supported by the BasicParser")
111-
public void testMissingArgWithBursting() throws Exception {
111+
void testMissingArgWithBursting() throws Exception {
112112
}
113113

114114
@Override
115115
@Test
116116
@Disabled("not supported by the BasicParser (CLI-184)")
117-
public void testNegativeOption() throws Exception {
117+
void testNegativeOption() throws Exception {
118118
}
119119

120120
@Override
121121
@Test
122122
@Disabled("not supported by the BasicParser")
123-
public void testPartialLongOptionSingleDash() throws Exception {
123+
void testPartialLongOptionSingleDash() throws Exception {
124124
}
125125

126126
@Override
127127
@Test
128128
@Disabled("not supported by the BasicParser")
129-
public void testPropertiesOption1() throws Exception {
129+
void testPropertiesOption1() throws Exception {
130130
}
131131

132132
@Override
133133
@Test
134134
@Disabled("not supported by the BasicParser")
135-
public void testPropertiesOption2() throws Exception {
135+
void testPropertiesOption2() throws Exception {
136136
}
137137

138138
@Override
139139
@Test
140140
@Disabled("not supported by the BasicParser")
141-
public void testShortOptionConcatenatedQuoteHandling() throws Exception {
141+
void testShortOptionConcatenatedQuoteHandling() throws Exception {
142142
}
143143

144144
@Override
145145
@Test
146146
@Disabled("not supported by the BasicParser")
147-
public void testShortWithEqual() throws Exception {
147+
void testShortWithEqual() throws Exception {
148148
}
149149

150150
@Override
151151
@Test
152152
@Disabled("not supported by the BasicParser")
153-
public void testShortWithoutEqual() throws Exception {
153+
void testShortWithoutEqual() throws Exception {
154154
}
155155

156156
@Override
157157
@Test
158158
@Disabled("not supported by the BasicParser")
159-
public void testStopBursting() throws Exception {
159+
void testStopBursting() throws Exception {
160160
}
161161

162162
@Override
163163
@Test
164164
@Disabled("not supported by the BasicParser")
165-
public void testStopBursting2() throws Exception {
165+
void testStopBursting2() throws Exception {
166166
}
167167

168168
@Override
169169
@Test
170170
@Disabled("not supported by the BasicParser")
171-
public void testUnambiguousPartialLongOption1() throws Exception {
171+
void testUnambiguousPartialLongOption1() throws Exception {
172172
}
173173

174174
@Override
175175
@Test
176176
@Disabled("not supported by the BasicParser")
177-
public void testUnambiguousPartialLongOption2() throws Exception {
177+
void testUnambiguousPartialLongOption2() throws Exception {
178178
}
179179

180180
@Override
181181
@Test
182182
@Disabled("not supported by the BasicParser")
183-
public void testUnambiguousPartialLongOption3() throws Exception {
183+
void testUnambiguousPartialLongOption3() throws Exception {
184184
}
185185

186186
@Override
187187
@Test
188188
@Disabled("not supported by the BasicParser")
189-
public void testUnambiguousPartialLongOption4() throws Exception {
189+
void testUnambiguousPartialLongOption4() throws Exception {
190190
}
191191

192192
@Override
193193
@Test
194194
@Disabled("not supported by the BasicParser")
195-
public void testUnrecognizedOptionWithBursting() throws Exception {
195+
void testUnrecognizedOptionWithBursting() throws Exception {
196196
}
197197
}

src/test/java/org/apache/commons/cli/CommandLineTest.java

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -386,7 +386,7 @@ void testGetOptionsCtor() {
386386
*/
387387
@ParameterizedTest(name = "{0}, {1}")
388388
@MethodSource("createOptionValueParameters")
389-
public void testGetOptionValue(final String[] args, final Option opt, final OptionGroup optionGroup, final boolean optDep,
389+
void testGetOptionValue(final String[] args, final Option opt, final OptionGroup optionGroup, final boolean optDep,
390390
final String optValue, final boolean grpDep, final String grpValue, final Option grpOpt) throws ParseException {
391391
final Options options = new Options().addOptionGroup(optionGroup);
392392
final List<Option> handler = new ArrayList<>();
@@ -492,7 +492,7 @@ public void testGetOptionValue(final String[] args, final Option opt, final Opti
492492
*/
493493
@ParameterizedTest(name = "{0}, {1}")
494494
@MethodSource("createOptionValuesParameters")
495-
public void testGetOptionValues(final String[] args, final Option opt, final OptionGroup optionGroup, final boolean optDep,
495+
void testGetOptionValues(final String[] args, final Option opt, final OptionGroup optionGroup, final boolean optDep,
496496
final String[] optValue, final boolean grpDep, final String[] grpValue, final Option grpOpt) throws ParseException {
497497
final Options options = new Options().addOptionGroup(optionGroup);
498498
final List<Option> handler = new ArrayList<>();
@@ -536,7 +536,7 @@ public void testGetOptionValues(final String[] args, final Option opt, final Opt
536536

537537
@ParameterizedTest(name = "{0}, {1}")
538538
@MethodSource("createParsedOptionValueParameters")
539-
public void testGetParsedOptionValue(final String[] args, final Option opt, final OptionGroup optionGroup, final boolean optDep,
539+
void testGetParsedOptionValue(final String[] args, final Option opt, final OptionGroup optionGroup, final boolean optDep,
540540
final Integer optValue, final boolean grpDep, final Integer grpValue, final Option grpOpt) throws ParseException {
541541
final Options options = new Options().addOptionGroup(optionGroup);
542542
final List<Option> handler = new ArrayList<>();
@@ -630,7 +630,7 @@ public void testGetParsedOptionValue(final String[] args, final Option opt, fina
630630

631631
@ParameterizedTest(name = "{0}, {1}")
632632
@MethodSource("createParsedOptionValuesParameters")
633-
public void testGetParsedOptionValues(final String[] args, final Option opt, final OptionGroup optionGroup, final boolean optDep,
633+
void testGetParsedOptionValues(final String[] args, final Option opt, final OptionGroup optionGroup, final boolean optDep,
634634
final Integer[] optValue, final boolean grpDep, final Integer[] grpValue, final Option grpOpt) throws ParseException {
635635
final Options options = new Options().addOptionGroup(optionGroup);
636636
final List<Option> handler = new ArrayList<>();
@@ -736,7 +736,7 @@ public void testGetParsedOptionValues(final String[] args, final Option opt, fin
736736
*/
737737
@ParameterizedTest(name = "{0}, {1}")
738738
@MethodSource("createHasOptionParameters")
739-
public void testHasOption(final String[] args, final Option opt, final OptionGroup optionGroup, final boolean optDep,
739+
void testHasOption(final String[] args, final Option opt, final OptionGroup optionGroup, final boolean optDep,
740740
final boolean has, final boolean grpDep, final boolean hasGrp, final Option grpOpt) throws ParseException {
741741
final Options options = new Options().addOptionGroup(optionGroup);
742742
final List<Option> handler = new ArrayList<>();
@@ -792,7 +792,7 @@ public void testHasOption(final String[] args, final Option opt, final OptionGro
792792
*/
793793
@ParameterizedTest(name = "{0}, {1}")
794794
@MethodSource("createHasOptionParameters")
795-
public void testHasOptionNoDeprecationHandler(final String[] args, final Option opt, final OptionGroup optionGroup, final boolean optDep,
795+
void testHasOptionNoDeprecationHandler(final String[] args, final Option opt, final OptionGroup optionGroup, final boolean optDep,
796796
final boolean has, final boolean grpDep, final boolean hasGrp, final Option grpOpt) throws ParseException {
797797
final Options options = new Options().addOptionGroup(optionGroup);
798798
final ByteArrayOutputStream baos = new ByteArrayOutputStream();
@@ -843,7 +843,7 @@ public void testHasOptionNoDeprecationHandler(final String[] args, final Option
843843
*/
844844
@ParameterizedTest(name = "{0}, {1}")
845845
@MethodSource("createHasOptionParameters")
846-
public void testHasOptionNullDeprecationHandler(final String[] args, final Option opt, final OptionGroup optionGroup, final boolean optDep,
846+
void testHasOptionNullDeprecationHandler(final String[] args, final Option opt, final OptionGroup optionGroup, final boolean optDep,
847847
final boolean has, final boolean grpDep, final boolean hasGrp, final Option grpOpt) throws ParseException {
848848
final Options options = new Options().addOptionGroup(optionGroup);
849849
final ByteArrayOutputStream baos = new ByteArrayOutputStream();
@@ -882,7 +882,7 @@ public void testHasOptionNullDeprecationHandler(final String[] args, final Optio
882882

883883
@ParameterizedTest(name = "{0}, {1}")
884884
@MethodSource("createOptionValueParameters")
885-
public void testNoDeprecationHandler(final String[] args, final Option opt, final OptionGroup optionGroup, final boolean optDep,
885+
void testNoDeprecationHandler(final String[] args, final Option opt, final OptionGroup optionGroup, final boolean optDep,
886886
final String optValue, final boolean grpDep, final String grpValue, final Option grpOpt) throws ParseException {
887887
final Options options = new Options().addOptionGroup(optionGroup);
888888
final CommandLine commandLine = DefaultParser.builder().get().parse(options, args);

src/test/java/org/apache/commons/cli/ConverterTests.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ void testFile() throws Exception {
100100

101101
@ParameterizedTest
102102
@MethodSource("numberTestParameters")
103-
public void testNumber(final String str, final Number expected) throws Exception {
103+
void testNumber(final String str, final Number expected) throws Exception {
104104
if (expected != null) {
105105
assertEquals(expected, Converter.NUMBER.apply(str));
106106
} else {

src/test/java/org/apache/commons/cli/DefaultParserTest.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -203,12 +203,12 @@ void testDeprecated() throws ParseException {
203203
@Override
204204
@Test
205205
@Disabled("Test case handled in the parameterized tests as \"DEFAULT behavior\"")
206-
public void testLongOptionWithEqualsQuoteHandling() throws Exception {
206+
void testLongOptionWithEqualsQuoteHandling() throws Exception {
207207
}
208208

209209
@ParameterizedTest(name = "{index}. {0}")
210210
@ArgumentsSource(ExternalArgumentsProvider.class)
211-
public void testParameterized(final String testName, final CommandLineParser parser, final String[] args, final String expected,
211+
void testParameterized(final String testName, final CommandLineParser parser, final String[] args, final String expected,
212212
final String option, final String message) throws Exception {
213213
final CommandLine cl = parser.parse(options, args);
214214

@@ -218,6 +218,6 @@ public void testParameterized(final String testName, final CommandLineParser par
218218
@Override
219219
@Test
220220
@Disabled("Test case handled in the parameterized tests as \"DEFAULT behavior\"")
221-
public void testShortOptionConcatenatedQuoteHandling() throws Exception {
221+
void testShortOptionConcatenatedQuoteHandling() throws Exception {
222222
}
223223
}

0 commit comments

Comments
 (0)