This is an automated email from the ASF dual-hosted git repository. ggregory pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/commons-cli.git
The following commit(s) were added to refs/heads/master by this push: new 0a5b7547 Use JUnit 5 convention for test method visibility 0a5b7547 is described below commit 0a5b7547044ec71a2e413abb9fb77d3092553e16 Author: Gary D. Gregory <garydgreg...@gmail.com> AuthorDate: Sat Jun 7 09:42:43 2025 -0400 Use JUnit 5 convention for test method visibility --- .../apache/commons/cli/AbstractParserTestCase.java | 2 +- .../org/apache/commons/cli/BasicParserTest.java | 54 +++++++++++----------- .../org/apache/commons/cli/CommandLineTest.java | 16 +++---- .../org/apache/commons/cli/ConverterTests.java | 2 +- .../org/apache/commons/cli/DefaultParserTest.java | 6 +-- .../java/org/apache/commons/cli/GnuParserTest.java | 44 +++++++++--------- .../org/apache/commons/cli/HelpFormatterTest.java | 2 +- .../apache/commons/cli/OptionValidatorTest.java | 2 +- .../org/apache/commons/cli/PosixParserTest.java | 20 ++++---- .../org/apache/commons/cli/TypeHandlerTest.java | 4 +- .../java/org/apache/commons/cli/ValueTest.java | 30 ++++++------ .../java/org/apache/commons/cli/ValuesTest.java | 2 +- .../commons/cli/help/OptionFormatterTest.java | 2 +- .../commons/cli/help/TextHelpAppendableTest.java | 2 +- .../apache/commons/cli/help/TextStyleTests.java | 2 +- .../java/org/apache/commons/cli/help/UtilTest.java | 4 +- 16 files changed, 97 insertions(+), 97 deletions(-) diff --git a/src/test/java/org/apache/commons/cli/AbstractParserTestCase.java b/src/test/java/org/apache/commons/cli/AbstractParserTestCase.java index de84d3f1..e71ae503 100644 --- a/src/test/java/org/apache/commons/cli/AbstractParserTestCase.java +++ b/src/test/java/org/apache/commons/cli/AbstractParserTestCase.java @@ -65,7 +65,7 @@ public abstract class AbstractParserTestCase { } @Test - public void testAmbiguousArgParsing() throws Exception { + void testAmbiguousArgParsing() throws Exception { final String[] args = { "-=-" }; final Options options = new Options(); assertThrows(UnrecognizedOptionException.class, () -> parser.parse(options, args)); diff --git a/src/test/java/org/apache/commons/cli/BasicParserTest.java b/src/test/java/org/apache/commons/cli/BasicParserTest.java index 50598f73..8f85bc63 100644 --- a/src/test/java/org/apache/commons/cli/BasicParserTest.java +++ b/src/test/java/org/apache/commons/cli/BasicParserTest.java @@ -36,162 +36,162 @@ public class BasicParserTest extends AbstractParserTestCase { @Override @Test @Disabled("not supported by the BasicParser") - public void testAmbiguousLongWithoutEqualSingleDash() throws Exception { + void testAmbiguousLongWithoutEqualSingleDash() throws Exception { } @Override @Test @Disabled("not supported by the BasicParser") - public void testAmbiguousLongWithoutEqualSingleDash2() throws Exception { + void testAmbiguousLongWithoutEqualSingleDash2() throws Exception { } @Override @Test @Disabled("not supported by the BasicParser") - public void testAmbiguousPartialLongOption1() throws Exception { + void testAmbiguousPartialLongOption1() throws Exception { } @Override @Test @Disabled("not supported by the BasicParser") - public void testAmbiguousPartialLongOption2() throws Exception { + void testAmbiguousPartialLongOption2() throws Exception { } @Override @Test @Disabled("not supported by the BasicParser") - public void testAmbiguousPartialLongOption3() throws Exception { + void testAmbiguousPartialLongOption3() throws Exception { } @Override @Test @Disabled("not supported by the BasicParser") - public void testAmbiguousPartialLongOption4() throws Exception { + void testAmbiguousPartialLongOption4() throws Exception { } @Override @Test @Disabled("not supported by the BasicParser") - public void testBursting() throws Exception { + void testBursting() throws Exception { } @Override @Test @Disabled("not supported by the BasicParser") - public void testDoubleDash2() throws Exception { + void testDoubleDash2() throws Exception { } @Override @Test @Disabled("not supported by the BasicParser") - public void testLongOptionWithEqualsQuoteHandling() throws Exception { + void testLongOptionWithEqualsQuoteHandling() throws Exception { } @Override @Test @Disabled("not supported by the BasicParser") - public void testLongWithEqualDoubleDash() throws Exception { + void testLongWithEqualDoubleDash() throws Exception { } @Override @Test @Disabled("not supported by the BasicParser") - public void testLongWithEqualSingleDash() throws Exception { + void testLongWithEqualSingleDash() throws Exception { } @Override @Test @Disabled("not supported by the BasicParser") - public void testLongWithoutEqualSingleDash() throws Exception { + void testLongWithoutEqualSingleDash() throws Exception { } @Override @Test @Disabled("not supported by the BasicParser") - public void testMissingArgWithBursting() throws Exception { + void testMissingArgWithBursting() throws Exception { } @Override @Test @Disabled("not supported by the BasicParser (CLI-184)") - public void testNegativeOption() throws Exception { + void testNegativeOption() throws Exception { } @Override @Test @Disabled("not supported by the BasicParser") - public void testPartialLongOptionSingleDash() throws Exception { + void testPartialLongOptionSingleDash() throws Exception { } @Override @Test @Disabled("not supported by the BasicParser") - public void testPropertiesOption1() throws Exception { + void testPropertiesOption1() throws Exception { } @Override @Test @Disabled("not supported by the BasicParser") - public void testPropertiesOption2() throws Exception { + void testPropertiesOption2() throws Exception { } @Override @Test @Disabled("not supported by the BasicParser") - public void testShortOptionConcatenatedQuoteHandling() throws Exception { + void testShortOptionConcatenatedQuoteHandling() throws Exception { } @Override @Test @Disabled("not supported by the BasicParser") - public void testShortWithEqual() throws Exception { + void testShortWithEqual() throws Exception { } @Override @Test @Disabled("not supported by the BasicParser") - public void testShortWithoutEqual() throws Exception { + void testShortWithoutEqual() throws Exception { } @Override @Test @Disabled("not supported by the BasicParser") - public void testStopBursting() throws Exception { + void testStopBursting() throws Exception { } @Override @Test @Disabled("not supported by the BasicParser") - public void testStopBursting2() throws Exception { + void testStopBursting2() throws Exception { } @Override @Test @Disabled("not supported by the BasicParser") - public void testUnambiguousPartialLongOption1() throws Exception { + void testUnambiguousPartialLongOption1() throws Exception { } @Override @Test @Disabled("not supported by the BasicParser") - public void testUnambiguousPartialLongOption2() throws Exception { + void testUnambiguousPartialLongOption2() throws Exception { } @Override @Test @Disabled("not supported by the BasicParser") - public void testUnambiguousPartialLongOption3() throws Exception { + void testUnambiguousPartialLongOption3() throws Exception { } @Override @Test @Disabled("not supported by the BasicParser") - public void testUnambiguousPartialLongOption4() throws Exception { + void testUnambiguousPartialLongOption4() throws Exception { } @Override @Test @Disabled("not supported by the BasicParser") - public void testUnrecognizedOptionWithBursting() throws Exception { + void testUnrecognizedOptionWithBursting() throws Exception { } } diff --git a/src/test/java/org/apache/commons/cli/CommandLineTest.java b/src/test/java/org/apache/commons/cli/CommandLineTest.java index e7ad12ff..2da8975d 100644 --- a/src/test/java/org/apache/commons/cli/CommandLineTest.java +++ b/src/test/java/org/apache/commons/cli/CommandLineTest.java @@ -386,7 +386,7 @@ public class CommandLineTest { */ @ParameterizedTest(name = "{0}, {1}") @MethodSource("createOptionValueParameters") - public void testGetOptionValue(final String[] args, final Option opt, final OptionGroup optionGroup, final boolean optDep, + void testGetOptionValue(final String[] args, final Option opt, final OptionGroup optionGroup, final boolean optDep, final String optValue, final boolean grpDep, final String grpValue, final Option grpOpt) throws ParseException { final Options options = new Options().addOptionGroup(optionGroup); final List<Option> handler = new ArrayList<>(); @@ -492,7 +492,7 @@ public class CommandLineTest { */ @ParameterizedTest(name = "{0}, {1}") @MethodSource("createOptionValuesParameters") - public void testGetOptionValues(final String[] args, final Option opt, final OptionGroup optionGroup, final boolean optDep, + void testGetOptionValues(final String[] args, final Option opt, final OptionGroup optionGroup, final boolean optDep, final String[] optValue, final boolean grpDep, final String[] grpValue, final Option grpOpt) throws ParseException { final Options options = new Options().addOptionGroup(optionGroup); final List<Option> handler = new ArrayList<>(); @@ -536,7 +536,7 @@ public class CommandLineTest { @ParameterizedTest(name = "{0}, {1}") @MethodSource("createParsedOptionValueParameters") - public void testGetParsedOptionValue(final String[] args, final Option opt, final OptionGroup optionGroup, final boolean optDep, + void testGetParsedOptionValue(final String[] args, final Option opt, final OptionGroup optionGroup, final boolean optDep, final Integer optValue, final boolean grpDep, final Integer grpValue, final Option grpOpt) throws ParseException { final Options options = new Options().addOptionGroup(optionGroup); final List<Option> handler = new ArrayList<>(); @@ -630,7 +630,7 @@ public class CommandLineTest { @ParameterizedTest(name = "{0}, {1}") @MethodSource("createParsedOptionValuesParameters") - public void testGetParsedOptionValues(final String[] args, final Option opt, final OptionGroup optionGroup, final boolean optDep, + void testGetParsedOptionValues(final String[] args, final Option opt, final OptionGroup optionGroup, final boolean optDep, final Integer[] optValue, final boolean grpDep, final Integer[] grpValue, final Option grpOpt) throws ParseException { final Options options = new Options().addOptionGroup(optionGroup); final List<Option> handler = new ArrayList<>(); @@ -736,7 +736,7 @@ public class CommandLineTest { */ @ParameterizedTest(name = "{0}, {1}") @MethodSource("createHasOptionParameters") - public void testHasOption(final String[] args, final Option opt, final OptionGroup optionGroup, final boolean optDep, + void testHasOption(final String[] args, final Option opt, final OptionGroup optionGroup, final boolean optDep, final boolean has, final boolean grpDep, final boolean hasGrp, final Option grpOpt) throws ParseException { final Options options = new Options().addOptionGroup(optionGroup); final List<Option> handler = new ArrayList<>(); @@ -792,7 +792,7 @@ public class CommandLineTest { */ @ParameterizedTest(name = "{0}, {1}") @MethodSource("createHasOptionParameters") - public void testHasOptionNoDeprecationHandler(final String[] args, final Option opt, final OptionGroup optionGroup, final boolean optDep, + void testHasOptionNoDeprecationHandler(final String[] args, final Option opt, final OptionGroup optionGroup, final boolean optDep, final boolean has, final boolean grpDep, final boolean hasGrp, final Option grpOpt) throws ParseException { final Options options = new Options().addOptionGroup(optionGroup); final ByteArrayOutputStream baos = new ByteArrayOutputStream(); @@ -843,7 +843,7 @@ public class CommandLineTest { */ @ParameterizedTest(name = "{0}, {1}") @MethodSource("createHasOptionParameters") - public void testHasOptionNullDeprecationHandler(final String[] args, final Option opt, final OptionGroup optionGroup, final boolean optDep, + void testHasOptionNullDeprecationHandler(final String[] args, final Option opt, final OptionGroup optionGroup, final boolean optDep, final boolean has, final boolean grpDep, final boolean hasGrp, final Option grpOpt) throws ParseException { final Options options = new Options().addOptionGroup(optionGroup); final ByteArrayOutputStream baos = new ByteArrayOutputStream(); @@ -882,7 +882,7 @@ public class CommandLineTest { @ParameterizedTest(name = "{0}, {1}") @MethodSource("createOptionValueParameters") - public void testNoDeprecationHandler(final String[] args, final Option opt, final OptionGroup optionGroup, final boolean optDep, + void testNoDeprecationHandler(final String[] args, final Option opt, final OptionGroup optionGroup, final boolean optDep, final String optValue, final boolean grpDep, final String grpValue, final Option grpOpt) throws ParseException { final Options options = new Options().addOptionGroup(optionGroup); final CommandLine commandLine = DefaultParser.builder().get().parse(options, args); diff --git a/src/test/java/org/apache/commons/cli/ConverterTests.java b/src/test/java/org/apache/commons/cli/ConverterTests.java index bf65447e..8691d075 100644 --- a/src/test/java/org/apache/commons/cli/ConverterTests.java +++ b/src/test/java/org/apache/commons/cli/ConverterTests.java @@ -100,7 +100,7 @@ public class ConverterTests { @ParameterizedTest @MethodSource("numberTestParameters") - public void testNumber(final String str, final Number expected) throws Exception { + void testNumber(final String str, final Number expected) throws Exception { if (expected != null) { assertEquals(expected, Converter.NUMBER.apply(str)); } else { diff --git a/src/test/java/org/apache/commons/cli/DefaultParserTest.java b/src/test/java/org/apache/commons/cli/DefaultParserTest.java index 322cd0ef..759700ad 100644 --- a/src/test/java/org/apache/commons/cli/DefaultParserTest.java +++ b/src/test/java/org/apache/commons/cli/DefaultParserTest.java @@ -203,12 +203,12 @@ public class DefaultParserTest extends AbstractParserTestCase { @Override @Test @Disabled("Test case handled in the parameterized tests as \"DEFAULT behavior\"") - public void testLongOptionWithEqualsQuoteHandling() throws Exception { + void testLongOptionWithEqualsQuoteHandling() throws Exception { } @ParameterizedTest(name = "{index}. {0}") @ArgumentsSource(ExternalArgumentsProvider.class) - public void testParameterized(final String testName, final CommandLineParser parser, final String[] args, final String expected, + void testParameterized(final String testName, final CommandLineParser parser, final String[] args, final String expected, final String option, final String message) throws Exception { final CommandLine cl = parser.parse(options, args); @@ -218,6 +218,6 @@ public class DefaultParserTest extends AbstractParserTestCase { @Override @Test @Disabled("Test case handled in the parameterized tests as \"DEFAULT behavior\"") - public void testShortOptionConcatenatedQuoteHandling() throws Exception { + void testShortOptionConcatenatedQuoteHandling() throws Exception { } } diff --git a/src/test/java/org/apache/commons/cli/GnuParserTest.java b/src/test/java/org/apache/commons/cli/GnuParserTest.java index fee57535..9ac1a7a3 100644 --- a/src/test/java/org/apache/commons/cli/GnuParserTest.java +++ b/src/test/java/org/apache/commons/cli/GnuParserTest.java @@ -36,132 +36,132 @@ public class GnuParserTest extends AbstractParserTestCase { @Override @Test @Disabled("not supported by the GnuParser") - public void testAmbiguousLongWithoutEqualSingleDash() throws Exception { + void testAmbiguousLongWithoutEqualSingleDash() throws Exception { } @Override @Test @Disabled("not supported by the GnuParser") - public void testAmbiguousLongWithoutEqualSingleDash2() throws Exception { + void testAmbiguousLongWithoutEqualSingleDash2() throws Exception { } @Override @Test @Disabled("not supported by the GnuParser") - public void testAmbiguousPartialLongOption1() throws Exception { + void testAmbiguousPartialLongOption1() throws Exception { } @Override @Test @Disabled("not supported by the GnuParser") - public void testAmbiguousPartialLongOption2() throws Exception { + void testAmbiguousPartialLongOption2() throws Exception { } @Override @Test @Disabled("not supported by the GnuParser") - public void testAmbiguousPartialLongOption3() throws Exception { + void testAmbiguousPartialLongOption3() throws Exception { } @Override @Test @Disabled("not supported by the GnuParser") - public void testAmbiguousPartialLongOption4() throws Exception { + void testAmbiguousPartialLongOption4() throws Exception { } @Override @Test @Disabled("not supported by the GnuParser") - public void testBursting() throws Exception { + void testBursting() throws Exception { } @Override @Test @Disabled("not supported by the GnuParser") - public void testDoubleDash2() throws Exception { + void testDoubleDash2() throws Exception { } @Override @Test @Disabled("not supported by the GnuParser") - public void testLongWithoutEqualSingleDash() throws Exception { + void testLongWithoutEqualSingleDash() throws Exception { } @Override @Test @Disabled("not supported by the GnuParser") - public void testLongWithUnexpectedArgument1() throws Exception { + void testLongWithUnexpectedArgument1() throws Exception { } @Override @Test @Disabled("not supported by the GnuParser") - public void testLongWithUnexpectedArgument2() throws Exception { + void testLongWithUnexpectedArgument2() throws Exception { } @Override @Test @Disabled("not supported by the GnuParser") - public void testMissingArgWithBursting() throws Exception { + void testMissingArgWithBursting() throws Exception { } @Override @Test @Disabled("not supported by the GnuParser (CLI-184)") - public void testNegativeOption() throws Exception { + void testNegativeOption() throws Exception { } @Override @Test @Disabled("not supported by the GnuParser") - public void testPartialLongOptionSingleDash() throws Exception { + void testPartialLongOptionSingleDash() throws Exception { } @Override @Test @Disabled("not supported by the GnuParser") - public void testShortWithUnexpectedArgument() throws Exception { + void testShortWithUnexpectedArgument() throws Exception { } @Override @Test @Disabled("not supported by the GnuParser") - public void testStopBursting() throws Exception { + void testStopBursting() throws Exception { } @Override @Test @Disabled("not supported by the GnuParser") - public void testStopBursting2() throws Exception { + void testStopBursting2() throws Exception { } @Override @Test @Disabled("not supported by the GnuParser") - public void testUnambiguousPartialLongOption1() throws Exception { + void testUnambiguousPartialLongOption1() throws Exception { } @Override @Test @Disabled("not supported by the GnuParser") - public void testUnambiguousPartialLongOption2() throws Exception { + void testUnambiguousPartialLongOption2() throws Exception { } @Override @Test @Disabled("not supported by the GnuParser") - public void testUnambiguousPartialLongOption3() throws Exception { + void testUnambiguousPartialLongOption3() throws Exception { } @Override @Test @Disabled("not supported by the GnuParser") - public void testUnambiguousPartialLongOption4() throws Exception { + void testUnambiguousPartialLongOption4() throws Exception { } @Override @Test @Disabled("not supported by the GnuParser") - public void testUnrecognizedOptionWithBursting() throws Exception { + void testUnrecognizedOptionWithBursting() throws Exception { } } diff --git a/src/test/java/org/apache/commons/cli/HelpFormatterTest.java b/src/test/java/org/apache/commons/cli/HelpFormatterTest.java index 585aa6fb..279ff688 100644 --- a/src/test/java/org/apache/commons/cli/HelpFormatterTest.java +++ b/src/test/java/org/apache/commons/cli/HelpFormatterTest.java @@ -413,7 +413,7 @@ public class HelpFormatterTest { @ParameterizedTest @MethodSource("deprecatedOptionsProvider") - public void testPrintDeprecatedOptions(final HelpFormatter hf, final Option option, final String expectedTxt) { + void testPrintDeprecatedOptions(final HelpFormatter hf, final Option option, final String expectedTxt) { final StringBuffer sb = new StringBuffer(); final int leftPad = 1; diff --git a/src/test/java/org/apache/commons/cli/OptionValidatorTest.java b/src/test/java/org/apache/commons/cli/OptionValidatorTest.java index 65feefcb..1f03840d 100644 --- a/src/test/java/org/apache/commons/cli/OptionValidatorTest.java +++ b/src/test/java/org/apache/commons/cli/OptionValidatorTest.java @@ -173,7 +173,7 @@ public class OptionValidatorTest { @ParameterizedTest(name = "{2}") @MethodSource("optionParameters") - public void testValidate(final String str, final boolean expected, final String name) { + void testValidate(final String str, final boolean expected, final String name) { if (expected) { assertEquals(str, OptionValidator.validate(str)); } else { diff --git a/src/test/java/org/apache/commons/cli/PosixParserTest.java b/src/test/java/org/apache/commons/cli/PosixParserTest.java index f51fc1f6..581f09ff 100644 --- a/src/test/java/org/apache/commons/cli/PosixParserTest.java +++ b/src/test/java/org/apache/commons/cli/PosixParserTest.java @@ -38,60 +38,60 @@ public class PosixParserTest extends AbstractParserTestCase { @Override @Test @Disabled("not supported by the PosixParser") - public void testAmbiguousLongWithoutEqualSingleDash() throws Exception { + void testAmbiguousLongWithoutEqualSingleDash() throws Exception { } @Override @Test @Disabled("not supported by the PosixParser") - public void testAmbiguousLongWithoutEqualSingleDash2() throws Exception { + void testAmbiguousLongWithoutEqualSingleDash2() throws Exception { } @Override @Test @Disabled("not supported by the PosixParser") - public void testAmbiguousPartialLongOption4() throws Exception { + void testAmbiguousPartialLongOption4() throws Exception { } @Override @Test @Disabled("not supported by the PosixParser") - public void testDoubleDash2() throws Exception { + void testDoubleDash2() throws Exception { } @Override @Test @Disabled("not supported by the PosixParser") - public void testLongWithEqualSingleDash() throws Exception { + void testLongWithEqualSingleDash() throws Exception { } @Override @Test @Disabled("not supported by the PosixParser") - public void testLongWithoutEqualSingleDash() throws Exception { + void testLongWithoutEqualSingleDash() throws Exception { } @Override @Test @Disabled("not supported by the PosixParser") - public void testLongWithUnexpectedArgument1() throws Exception { + void testLongWithUnexpectedArgument1() throws Exception { } @Override @Test @Disabled("not supported by the PosixParser (CLI-184)") - public void testNegativeOption() throws Exception { + void testNegativeOption() throws Exception { } @Override @Test @Disabled("not supported by the PosixParser") - public void testShortWithEqual() throws Exception { + void testShortWithEqual() throws Exception { } @Override @Test @Disabled("not supported by the PosixParser") - public void testUnambiguousPartialLongOption4() throws Exception { + void testUnambiguousPartialLongOption4() throws Exception { } } diff --git a/src/test/java/org/apache/commons/cli/TypeHandlerTest.java b/src/test/java/org/apache/commons/cli/TypeHandlerTest.java index cdba1715..7ef5d6c3 100644 --- a/src/test/java/org/apache/commons/cli/TypeHandlerTest.java +++ b/src/test/java/org/apache/commons/cli/TypeHandlerTest.java @@ -176,7 +176,7 @@ public class TypeHandlerTest { @ParameterizedTest @MethodSource("createDateFixtures") - public void testCreateDate(final Date date) { + void testCreateDate(final Date date) { assertEquals(date, TypeHandler.createDate(date.toString())); } @@ -211,7 +211,7 @@ public class TypeHandlerTest { @SuppressWarnings("unchecked") @ParameterizedTest(name = "{0} as {1}") @MethodSource("createValueTestParameters") - public void testCreateValue(final String str, final Class<?> type, final Object expected) throws Exception { + void testCreateValue(final String str, final Class<?> type, final Object expected) throws Exception { @SuppressWarnings("cast") final Object objectApiTest = type; // KEEP this cast if (expected instanceof Class<?> && Throwable.class.isAssignableFrom((Class<?>) expected)) { diff --git a/src/test/java/org/apache/commons/cli/ValueTest.java b/src/test/java/org/apache/commons/cli/ValueTest.java index 574a8815..6e2d56b8 100644 --- a/src/test/java/org/apache/commons/cli/ValueTest.java +++ b/src/test/java/org/apache/commons/cli/ValueTest.java @@ -77,7 +77,7 @@ public class ValueTest { @ParameterizedTest @MethodSource("parsers") - public void testLongOptionalArgValue(final CommandLineParser parser) throws Exception { + void testLongOptionalArgValue(final CommandLineParser parser) throws Exception { final String[] args = { "--fish", "face" }; final CommandLine cmd = parser.parse(opts, args); assertTrue(cmd.hasOption("fish")); @@ -86,7 +86,7 @@ public class ValueTest { @ParameterizedTest @MethodSource("parsers") - public void testLongOptionalArgValues(final CommandLineParser parser) throws Exception { + void testLongOptionalArgValues(final CommandLineParser parser) throws Exception { final String[] args = { "--gravy", "gold", "garden" }; final CommandLine cmd = parser.parse(opts, args); assertNull(cmd.getOptionValues(NULL_OPTION)); @@ -100,7 +100,7 @@ public class ValueTest { @ParameterizedTest @MethodSource("parsers") - public void testLongOptionalArgValuesWithOption(final CommandLineParser parser) throws Exception { + void testLongOptionalArgValuesWithOption(final CommandLineParser parser) throws Exception { final String[] args = { "--gravy", "gold", "garden" }; final CommandLine cmd = parser.parse(opts, args); assertNull(cmd.getOptionValues(NULL_OPTION)); @@ -114,7 +114,7 @@ public class ValueTest { @ParameterizedTest @MethodSource("parsers") - public void testLongOptionalArgValueWithOption(final CommandLineParser parser) throws Exception { + void testLongOptionalArgValueWithOption(final CommandLineParser parser) throws Exception { final String[] args = { "--fish", "face" }; final CommandLine cmd = parser.parse(opts, args); assertTrue(cmd.hasOption(opts.getOption("fish"))); @@ -123,7 +123,7 @@ public class ValueTest { @ParameterizedTest @MethodSource("parsers") - public void testLongOptionalNArgValues(final CommandLineParser parser) throws Exception { + void testLongOptionalNArgValues(final CommandLineParser parser) throws Exception { final String[] args = { "--hide", "house", "hair", "head" }; final CommandLine cmd = parser.parse(opts, args); assertTrue(cmd.hasOption("hide")); @@ -136,7 +136,7 @@ public class ValueTest { @ParameterizedTest @MethodSource("parsers") - public void testLongOptionalNArgValuesWithOption(final CommandLineParser parser) throws Exception { + void testLongOptionalNArgValuesWithOption(final CommandLineParser parser) throws Exception { final CommandLine cmd = parser.parse(opts, new String[] { "--hide", "house", "hair", "head" }); assertNull(cmd.getOptionValues(NULL_OPTION)); assertNull(cmd.getOptionValues(NULL_STRING)); @@ -150,7 +150,7 @@ public class ValueTest { @ParameterizedTest @MethodSource("parsers") - public void testLongOptionalNoValue(final CommandLineParser parser) throws Exception { + void testLongOptionalNoValue(final CommandLineParser parser) throws Exception { final String[] args = { "--fish" }; final CommandLine cmd = parser.parse(opts, args); assertTrue(cmd.hasOption("fish")); @@ -159,7 +159,7 @@ public class ValueTest { @ParameterizedTest @MethodSource("parsers") - public void testLongOptionalNoValueWithOption(final CommandLineParser parser) throws Exception { + void testLongOptionalNoValueWithOption(final CommandLineParser parser) throws Exception { final String[] args = { "--fish" }; final CommandLine cmd = parser.parse(opts, args); assertTrue(cmd.hasOption(opts.getOption("fish"))); @@ -194,7 +194,7 @@ public class ValueTest { @ParameterizedTest @MethodSource("parsers") - public void testShortOptionalArgNoValue(final CommandLineParser parser) throws Exception { + void testShortOptionalArgNoValue(final CommandLineParser parser) throws Exception { final String[] args = { "-e" }; final CommandLine cmd = parser.parse(opts, args); assertTrue(cmd.hasOption("e")); @@ -203,7 +203,7 @@ public class ValueTest { @ParameterizedTest @MethodSource("parsers") - public void testShortOptionalArgNoValueWithOption(final CommandLineParser parser) throws Exception { + void testShortOptionalArgNoValueWithOption(final CommandLineParser parser) throws Exception { final String[] args = { "-e" }; final CommandLine cmd = parser.parse(opts, args); assertTrue(cmd.hasOption(opts.getOption("e"))); @@ -212,7 +212,7 @@ public class ValueTest { @ParameterizedTest @MethodSource("parsers") - public void testShortOptionalArgValue(final CommandLineParser parser) throws Exception { + void testShortOptionalArgValue(final CommandLineParser parser) throws Exception { final String[] args = { "-e", "everything" }; final CommandLine cmd = parser.parse(opts, args); assertTrue(cmd.hasOption("e")); @@ -221,7 +221,7 @@ public class ValueTest { @ParameterizedTest @MethodSource("parsers") - public void testShortOptionalArgValues(final CommandLineParser parser) throws Exception { + void testShortOptionalArgValues(final CommandLineParser parser) throws Exception { final String[] args = { "-j", "ink", "idea" }; final CommandLine cmd = parser.parse(opts, args); assertTrue(cmd.hasOption("j")); @@ -233,7 +233,7 @@ public class ValueTest { @ParameterizedTest @MethodSource("parsers") - public void testShortOptionalArgValuesWithOption(final CommandLineParser parser) throws Exception { + void testShortOptionalArgValuesWithOption(final CommandLineParser parser) throws Exception { final String[] args = { "-j", "ink", "idea" }; final CommandLine cmd = parser.parse(opts, args); assertNull(cmd.getOptionValues(NULL_OPTION)); @@ -247,7 +247,7 @@ public class ValueTest { @ParameterizedTest @MethodSource("parsers") - public void testShortOptionalArgValueWithOption(final CommandLineParser parser) throws Exception { + void testShortOptionalArgValueWithOption(final CommandLineParser parser) throws Exception { final String[] args = { "-e", "everything" }; final CommandLine cmd = parser.parse(opts, args); assertNull(cmd.getOptionValues(NULL_OPTION)); @@ -258,7 +258,7 @@ public class ValueTest { @ParameterizedTest @MethodSource("parsers") - public void testShortOptionalNArgValues(final CommandLineParser parser) throws Exception { + void testShortOptionalNArgValues(final CommandLineParser parser) throws Exception { final String[] args = { "-i", "ink", "idea", "isotope", "ice" }; final CommandLine cmd = parser.parse(opts, args); assertNull(cmd.getOptionValues(NULL_OPTION)); diff --git a/src/test/java/org/apache/commons/cli/ValuesTest.java b/src/test/java/org/apache/commons/cli/ValuesTest.java index 7cda4baa..638d8ae1 100644 --- a/src/test/java/org/apache/commons/cli/ValuesTest.java +++ b/src/test/java/org/apache/commons/cli/ValuesTest.java @@ -140,7 +140,7 @@ public class ValuesTest { * in case I get a brainwave on how to resolve this. */ /* - * public void testGetValue() { // the 'm' option assertTrue(_option.getValues().length == 2); assertEquals( + * void testGetValue() { // the 'm' option assertTrue(_option.getValues().length == 2); assertEquals( * _option.getValue(), "key"); assertEquals(_option.getValue(0), "key"); assertEquals(_option.getValue(1), * "value"); * diff --git a/src/test/java/org/apache/commons/cli/help/OptionFormatterTest.java b/src/test/java/org/apache/commons/cli/help/OptionFormatterTest.java index 0dae2642..feb13a29 100644 --- a/src/test/java/org/apache/commons/cli/help/OptionFormatterTest.java +++ b/src/test/java/org/apache/commons/cli/help/OptionFormatterTest.java @@ -134,7 +134,7 @@ public class OptionFormatterTest { @ParameterizedTest(name = "{index} {0}") @MethodSource("deprecatedAttributesData") - public void testComplexDeprecationFormat(final DeprecatedAttributes da, final String expected) { + void testComplexDeprecationFormat(final DeprecatedAttributes da, final String expected) { final Option.Builder builder = Option.builder("o").deprecated(da); final Option.Builder builderWithDesc = Option.builder("o").desc("The description").deprecated(da); diff --git a/src/test/java/org/apache/commons/cli/help/TextHelpAppendableTest.java b/src/test/java/org/apache/commons/cli/help/TextHelpAppendableTest.java index e60fa074..d1e16d38 100644 --- a/src/test/java/org/apache/commons/cli/help/TextHelpAppendableTest.java +++ b/src/test/java/org/apache/commons/cli/help/TextHelpAppendableTest.java @@ -334,7 +334,7 @@ public final class TextHelpAppendableTest { @ParameterizedTest @MethodSource("org.apache.commons.cli.help.UtilTest#charArgs") - public void testindexOfWrapPosWithWhitespace(final Character c, final boolean isWhitespace) { + void testindexOfWrapPosWithWhitespace(final Character c, final boolean isWhitespace) { final String text = String.format("Hello%cWorld", c); assertEquals(isWhitespace ? 5 : 6, TextHelpAppendable.indexOfWrap(text, 7, 0)); } diff --git a/src/test/java/org/apache/commons/cli/help/TextStyleTests.java b/src/test/java/org/apache/commons/cli/help/TextStyleTests.java index 29ae9d41..e745922a 100644 --- a/src/test/java/org/apache/commons/cli/help/TextStyleTests.java +++ b/src/test/java/org/apache/commons/cli/help/TextStyleTests.java @@ -97,7 +97,7 @@ public class TextStyleTests { @ParameterizedTest(name = "{index} {0}") @MethodSource("padTestData") - public void testPad(final TextStyle underTest, final String unindentedString, final String indentedString) { + void testPad(final TextStyle underTest, final String unindentedString, final String indentedString) { assertEquals(unindentedString, underTest.pad(false, "Hello world"), "Unindented string test failed"); assertEquals(indentedString, underTest.pad(true, "Hello world"), "Indented string test failed"); } diff --git a/src/test/java/org/apache/commons/cli/help/UtilTest.java b/src/test/java/org/apache/commons/cli/help/UtilTest.java index 0a031590..e736b6fc 100644 --- a/src/test/java/org/apache/commons/cli/help/UtilTest.java +++ b/src/test/java/org/apache/commons/cli/help/UtilTest.java @@ -65,7 +65,7 @@ public class UtilTest { @ParameterizedTest @MethodSource("charArgs") - public void testFindNonWhitespacePos(final Character c, final boolean isWhitespace) { + void testFindNonWhitespacePos(final Character c, final boolean isWhitespace) { String text = String.format("%cWorld", c); assertEquals(isWhitespace ? 1 : 0, Util.indexOfNonWhitespace(text, 0)); text = String.format("%c%c%c", c, c, c); @@ -84,7 +84,7 @@ public class UtilTest { @ParameterizedTest @MethodSource("charArgs") - public void testRtrim(final Character c, final boolean isWhitespace) { + void testRtrim(final Character c, final boolean isWhitespace) { if (isWhitespace) { assertEquals("worx", Util.rtrim(String.format("worx%s", c)), () -> String.format("Did not process character 0x%x", (int) c)); } else {