From fbf766fb605ce7dc0a4fe59ec44c217ec8363d69 Mon Sep 17 00:00:00 2001 From: August Shi Date: Sun, 19 Jun 2016 16:14:46 -0500 Subject: [PATCH 1/2] Skipping empty tests --- .../apache/commons/cli/BasicParserTest.java | 50 ++++++++++--------- .../org/apache/commons/cli/GnuParserTest.java | 44 ++++++++-------- .../apache/commons/cli/PosixParserTest.java | 20 ++++---- 3 files changed, 60 insertions(+), 54 deletions(-) diff --git a/src/test/java/org/apache/commons/cli/BasicParserTest.java b/src/test/java/org/apache/commons/cli/BasicParserTest.java index 53683eb93..76a2dde32 100644 --- a/src/test/java/org/apache/commons/cli/BasicParserTest.java +++ b/src/test/java/org/apache/commons/cli/BasicParserTest.java @@ -18,6 +18,8 @@ package org.apache.commons.cli; import org.junit.Before; +import org.junit.Ignore; +import org.junit.Test; @SuppressWarnings("deprecation") // tests some deprecated classes public class BasicParserTest extends ParserTestCase @@ -29,145 +31,145 @@ public void setUp() parser = new BasicParser(); } - @Override + @Override @Test @Ignore public void testDoubleDash2() throws Exception { // not supported by the BasicParser } - @Override + @Override @Test @Ignore public void testLongWithoutEqualSingleDash() throws Exception { // not supported by the BasicParser } - @Override + @Override @Test @Ignore public void testAmbiguousLongWithoutEqualSingleDash() throws Exception { // not supported by the basicParser } - @Override + @Override @Test @Ignore public void testNegativeOption() throws Exception { // not supported by the BasicParser (CLI-184) } - @Override + @Override @Test @Ignore public void testPropertiesOption1() throws Exception { // not supported by the BasicParser } - @Override + @Override @Test @Ignore public void testPropertiesOption2() throws Exception { // not supported by the BasicParser } - @Override + @Override @Test @Ignore public void testShortWithEqual() throws Exception { // not supported by the BasicParser } - @Override + @Override @Test @Ignore public void testShortWithoutEqual() throws Exception { // not supported by the BasicParser } - @Override + @Override @Test @Ignore public void testLongWithEqualDoubleDash() throws Exception { // not supported by the BasicParser } - @Override + @Override @Test @Ignore public void testLongWithEqualSingleDash() throws Exception { // not supported by the BasicParser } - @Override + @Override @Test @Ignore public void testUnambiguousPartialLongOption1() throws Exception { // not supported by the BasicParser } - @Override + @Override @Test @Ignore public void testUnambiguousPartialLongOption2() throws Exception { // not supported by the BasicParser } - @Override + @Override @Test @Ignore public void testUnambiguousPartialLongOption3() throws Exception { // not supported by the BasicParser } - @Override + @Override @Test @Ignore public void testUnambiguousPartialLongOption4() throws Exception { // not supported by the BasicParser } - @Override + @Override @Test @Ignore public void testAmbiguousPartialLongOption1() throws Exception { // not supported by the BasicParser } - @Override + @Override @Test @Ignore public void testAmbiguousPartialLongOption2() throws Exception { // not supported by the BasicParser } - @Override + @Override @Test @Ignore public void testAmbiguousPartialLongOption3() throws Exception { // not supported by the BasicParser } - @Override + @Override @Test @Ignore public void testAmbiguousPartialLongOption4() throws Exception { // not supported by the BasicParser } - @Override + @Override @Test @Ignore public void testPartialLongOptionSingleDash() throws Exception { // not supported by the BasicParser } - @Override + @Override @Test @Ignore public void testBursting() throws Exception { // not supported by the BasicParser } - @Override + @Override @Test @Ignore public void testUnrecognizedOptionWithBursting() throws Exception { // not supported by the BasicParser } - @Override + @Override @Test @Ignore public void testMissingArgWithBursting() throws Exception { // not supported by the BasicParser } - @Override + @Override @Test @Ignore public void testStopBursting() throws Exception { // not supported by the BasicParser } - @Override + @Override @Test @Ignore public void testStopBursting2() throws Exception { // not supported by the BasicParser diff --git a/src/test/java/org/apache/commons/cli/GnuParserTest.java b/src/test/java/org/apache/commons/cli/GnuParserTest.java index 86b187b01..eb5b6bf5a 100644 --- a/src/test/java/org/apache/commons/cli/GnuParserTest.java +++ b/src/test/java/org/apache/commons/cli/GnuParserTest.java @@ -18,6 +18,8 @@ package org.apache.commons.cli; import org.junit.Before; +import org.junit.Ignore; +import org.junit.Test; @SuppressWarnings("deprecation") // tests some deprecated classes public class GnuParserTest extends ParserTestCase @@ -29,127 +31,127 @@ public void setUp() parser = new GnuParser(); } - @Override + @Override @Test @Ignore public void testDoubleDash2() throws Exception { // not supported by the GnuParser } - @Override + @Override @Test @Ignore public void testLongWithoutEqualSingleDash() throws Exception { // not supported by the GnuParser } - @Override + @Override @Test @Ignore public void testAmbiguousLongWithoutEqualSingleDash() throws Exception { // not supported by the GnuParser } - @Override + @Override @Test @Ignore public void testNegativeOption() throws Exception { // not supported by the GnuParser (CLI-184) } - @Override + @Override @Test @Ignore public void testLongWithUnexpectedArgument1() throws Exception { // not supported by the GnuParser } - @Override + @Override @Test @Ignore public void testLongWithUnexpectedArgument2() throws Exception { // not supported by the GnuParser } - @Override + @Override @Test @Ignore public void testShortWithUnexpectedArgument() throws Exception { // not supported by the GnuParser } - @Override + @Override @Test @Ignore public void testUnambiguousPartialLongOption1() throws Exception { // not supported by the GnuParser } - @Override + @Override @Test @Ignore public void testUnambiguousPartialLongOption2() throws Exception { // not supported by the GnuParser } - @Override + @Override @Test @Ignore public void testUnambiguousPartialLongOption3() throws Exception { // not supported by the GnuParser } - @Override + @Override @Test @Ignore public void testUnambiguousPartialLongOption4() throws Exception { // not supported by the GnuParser } - @Override + @Override @Test @Ignore public void testAmbiguousPartialLongOption1() throws Exception { // not supported by the GnuParser } - @Override + @Override @Test @Ignore public void testAmbiguousPartialLongOption2() throws Exception { // not supported by the GnuParser } - @Override + @Override @Test @Ignore public void testAmbiguousPartialLongOption3() throws Exception { // not supported by the GnuParser } - @Override + @Override @Test @Ignore public void testAmbiguousPartialLongOption4() throws Exception { // not supported by the GnuParser } - @Override + @Override @Test @Ignore public void testPartialLongOptionSingleDash() throws Exception { // not supported by the GnuParser } - @Override + @Override @Test @Ignore public void testBursting() throws Exception { // not supported by the GnuParser } - @Override + @Override @Test @Ignore public void testUnrecognizedOptionWithBursting() throws Exception { // not supported by the GnuParser } - @Override + @Override @Test @Ignore public void testMissingArgWithBursting() throws Exception { // not supported by the GnuParser } - @Override + @Override @Test @Ignore public void testStopBursting() throws Exception { // not supported by the GnuParser } - @Override + @Override @Test @Ignore public void testStopBursting2() throws Exception { // not supported by the GnuParser diff --git a/src/test/java/org/apache/commons/cli/PosixParserTest.java b/src/test/java/org/apache/commons/cli/PosixParserTest.java index 3ca78725d..61d6b1e37 100644 --- a/src/test/java/org/apache/commons/cli/PosixParserTest.java +++ b/src/test/java/org/apache/commons/cli/PosixParserTest.java @@ -18,6 +18,8 @@ package org.apache.commons.cli; import org.junit.Before; +import org.junit.Ignore; +import org.junit.Test; /** * Test case for the PosixParser. @@ -32,55 +34,55 @@ public void setUp() parser = new PosixParser(); } - @Override + @Override @Test @Ignore public void testDoubleDash2() throws Exception { // not supported by the PosixParser } - @Override + @Override @Test @Ignore public void testLongWithoutEqualSingleDash() throws Exception { // not supported by the PosixParser } - @Override + @Override @Test @Ignore public void testAmbiguousLongWithoutEqualSingleDash() throws Exception { // not supported by the PosixParser } - @Override + @Override @Test @Ignore public void testNegativeOption() throws Exception { // not supported by the PosixParser (CLI-184) } - @Override + @Override @Test @Ignore public void testLongWithUnexpectedArgument1() throws Exception { // not supported by the PosixParser } - @Override + @Override @Test @Ignore public void testLongWithEqualSingleDash() throws Exception { // not supported by the PosixParser } - @Override + @Override @Test @Ignore public void testShortWithEqual() throws Exception { // not supported by the PosixParser } - @Override + @Override @Test @Ignore public void testUnambiguousPartialLongOption4() throws Exception { // not supported by the PosixParser } - @Override + @Override @Test @Ignore public void testAmbiguousPartialLongOption4() throws Exception { // not supported by the PosixParser From 36c3901e273e89b44b0a97f5819b1ff1c3512842 Mon Sep 17 00:00:00 2001 From: August Shi Date: Mon, 20 Jun 2016 13:15:00 -0500 Subject: [PATCH 2/2] Moving reason for skipping test from comment in test body to @Ignore annotation --- .../apache/commons/cli/BasicParserTest.java | 72 +++++++------------ .../org/apache/commons/cli/GnuParserTest.java | 63 ++++++---------- .../apache/commons/cli/PosixParserTest.java | 27 +++---- 3 files changed, 54 insertions(+), 108 deletions(-) diff --git a/src/test/java/org/apache/commons/cli/BasicParserTest.java b/src/test/java/org/apache/commons/cli/BasicParserTest.java index 76a2dde32..10e5830fb 100644 --- a/src/test/java/org/apache/commons/cli/BasicParserTest.java +++ b/src/test/java/org/apache/commons/cli/BasicParserTest.java @@ -31,147 +31,123 @@ public void setUp() parser = new BasicParser(); } - @Override @Test @Ignore + @Override @Test @Ignore("not supported by the BasicParser") public void testDoubleDash2() throws Exception { - // not supported by the BasicParser } - @Override @Test @Ignore + @Override @Test @Ignore("not supported by the BasicParser") public void testLongWithoutEqualSingleDash() throws Exception { - // not supported by the BasicParser } - @Override @Test @Ignore + @Override @Test @Ignore("not supported by the BasicParser") public void testAmbiguousLongWithoutEqualSingleDash() throws Exception { - // not supported by the basicParser } - @Override @Test @Ignore + @Override @Test @Ignore("not supported by the BasicParser (CLI-184)") public void testNegativeOption() throws Exception { - // not supported by the BasicParser (CLI-184) } - @Override @Test @Ignore + @Override @Test @Ignore("not supported by the BasicParser") public void testPropertiesOption1() throws Exception { - // not supported by the BasicParser } - @Override @Test @Ignore + @Override @Test @Ignore("not supported by the BasicParser") public void testPropertiesOption2() throws Exception { - // not supported by the BasicParser } - @Override @Test @Ignore + @Override @Test @Ignore("not supported by the BasicParser") public void testShortWithEqual() throws Exception { - // not supported by the BasicParser } - @Override @Test @Ignore + @Override @Test @Ignore("not supported by the BasicParser") public void testShortWithoutEqual() throws Exception { - // not supported by the BasicParser } - @Override @Test @Ignore + @Override @Test @Ignore("not supported by the BasicParser") public void testLongWithEqualDoubleDash() throws Exception { - // not supported by the BasicParser } - @Override @Test @Ignore + @Override @Test @Ignore("not supported by the BasicParser") public void testLongWithEqualSingleDash() throws Exception { - // not supported by the BasicParser } - @Override @Test @Ignore + @Override @Test @Ignore("not supported by the BasicParser") public void testUnambiguousPartialLongOption1() throws Exception { - // not supported by the BasicParser } - @Override @Test @Ignore + @Override @Test @Ignore("not supported by the BasicParser") public void testUnambiguousPartialLongOption2() throws Exception { - // not supported by the BasicParser } - @Override @Test @Ignore + @Override @Test @Ignore("not supported by the BasicParser") public void testUnambiguousPartialLongOption3() throws Exception { - // not supported by the BasicParser } - @Override @Test @Ignore + @Override @Test @Ignore("not supported by the BasicParser") public void testUnambiguousPartialLongOption4() throws Exception { - // not supported by the BasicParser } - @Override @Test @Ignore + @Override @Test @Ignore("not supported by the BasicParser") public void testAmbiguousPartialLongOption1() throws Exception { - // not supported by the BasicParser } - @Override @Test @Ignore + @Override @Test @Ignore("not supported by the BasicParser") public void testAmbiguousPartialLongOption2() throws Exception { - // not supported by the BasicParser } - @Override @Test @Ignore + @Override @Test @Ignore("not supported by the BasicParser") public void testAmbiguousPartialLongOption3() throws Exception { - // not supported by the BasicParser } - @Override @Test @Ignore + @Override @Test @Ignore("not supported by the BasicParser") public void testAmbiguousPartialLongOption4() throws Exception { - // not supported by the BasicParser } - @Override @Test @Ignore + @Override @Test @Ignore("not supported by the BasicParser") public void testPartialLongOptionSingleDash() throws Exception { - // not supported by the BasicParser } - @Override @Test @Ignore + @Override @Test @Ignore("not supported by the BasicParser") public void testBursting() throws Exception { - // not supported by the BasicParser } - @Override @Test @Ignore + @Override @Test @Ignore("not supported by the BasicParser") public void testUnrecognizedOptionWithBursting() throws Exception { - // not supported by the BasicParser } - @Override @Test @Ignore + @Override @Test @Ignore("not supported by the BasicParser") public void testMissingArgWithBursting() throws Exception { - // not supported by the BasicParser } - @Override @Test @Ignore + @Override @Test @Ignore("not supported by the BasicParser") public void testStopBursting() throws Exception { - // not supported by the BasicParser } - @Override @Test @Ignore + @Override @Test @Ignore("not supported by the BasicParser") public void testStopBursting2() throws Exception { - // not supported by the BasicParser } } diff --git a/src/test/java/org/apache/commons/cli/GnuParserTest.java b/src/test/java/org/apache/commons/cli/GnuParserTest.java index eb5b6bf5a..0b1c2820b 100644 --- a/src/test/java/org/apache/commons/cli/GnuParserTest.java +++ b/src/test/java/org/apache/commons/cli/GnuParserTest.java @@ -31,129 +31,108 @@ public void setUp() parser = new GnuParser(); } - @Override @Test @Ignore + @Override @Test @Ignore("not supported by the GnuParser") public void testDoubleDash2() throws Exception { - // not supported by the GnuParser } - @Override @Test @Ignore + @Override @Test @Ignore("not supported by the GnuParser") public void testLongWithoutEqualSingleDash() throws Exception { - // not supported by the GnuParser } - @Override @Test @Ignore + @Override @Test @Ignore("not supported by the GnuParser") public void testAmbiguousLongWithoutEqualSingleDash() throws Exception { - // not supported by the GnuParser } - @Override @Test @Ignore + @Override @Test @Ignore("not supported by the GnuParser (CLI-184)") public void testNegativeOption() throws Exception { - // not supported by the GnuParser (CLI-184) } - @Override @Test @Ignore + @Override @Test @Ignore("not supported by the GnuParser") public void testLongWithUnexpectedArgument1() throws Exception { - // not supported by the GnuParser } - @Override @Test @Ignore + @Override @Test @Ignore("not supported by the GnuParser") public void testLongWithUnexpectedArgument2() throws Exception { - // not supported by the GnuParser } - @Override @Test @Ignore + @Override @Test @Ignore("not supported by the GnuParser") public void testShortWithUnexpectedArgument() throws Exception { - // not supported by the GnuParser } - @Override @Test @Ignore + @Override @Test @Ignore("not supported by the GnuParser") public void testUnambiguousPartialLongOption1() throws Exception { - // not supported by the GnuParser } - @Override @Test @Ignore + @Override @Test @Ignore("not supported by the GnuParser") public void testUnambiguousPartialLongOption2() throws Exception { - // not supported by the GnuParser } - @Override @Test @Ignore + @Override @Test @Ignore("not supported by the GnuParser") public void testUnambiguousPartialLongOption3() throws Exception { - // not supported by the GnuParser } - @Override @Test @Ignore + @Override @Test @Ignore("not supported by the GnuParser") public void testUnambiguousPartialLongOption4() throws Exception { - // not supported by the GnuParser } - @Override @Test @Ignore + @Override @Test @Ignore("not supported by the GnuParser") public void testAmbiguousPartialLongOption1() throws Exception { - // not supported by the GnuParser } - @Override @Test @Ignore + @Override @Test @Ignore("not supported by the GnuParser") public void testAmbiguousPartialLongOption2() throws Exception { - // not supported by the GnuParser } - @Override @Test @Ignore + @Override @Test @Ignore("not supported by the GnuParser") public void testAmbiguousPartialLongOption3() throws Exception { - // not supported by the GnuParser } - @Override @Test @Ignore + @Override @Test @Ignore("not supported by the GnuParser") public void testAmbiguousPartialLongOption4() throws Exception { - // not supported by the GnuParser } - @Override @Test @Ignore + @Override @Test @Ignore("not supported by the GnuParser") public void testPartialLongOptionSingleDash() throws Exception { - // not supported by the GnuParser } - @Override @Test @Ignore + @Override @Test @Ignore("not supported by the GnuParser") public void testBursting() throws Exception { - // not supported by the GnuParser } - @Override @Test @Ignore + @Override @Test @Ignore("not supported by the GnuParser") public void testUnrecognizedOptionWithBursting() throws Exception { - // not supported by the GnuParser } - @Override @Test @Ignore + @Override @Test @Ignore("not supported by the GnuParser") public void testMissingArgWithBursting() throws Exception { - // not supported by the GnuParser } - @Override @Test @Ignore + @Override @Test @Ignore("not supported by the GnuParser") public void testStopBursting() throws Exception { - // not supported by the GnuParser } - @Override @Test @Ignore + @Override @Test @Ignore("not supported by the GnuParser") public void testStopBursting2() throws Exception { - // not supported by the GnuParser } } diff --git a/src/test/java/org/apache/commons/cli/PosixParserTest.java b/src/test/java/org/apache/commons/cli/PosixParserTest.java index 61d6b1e37..2a8961a3a 100644 --- a/src/test/java/org/apache/commons/cli/PosixParserTest.java +++ b/src/test/java/org/apache/commons/cli/PosixParserTest.java @@ -34,57 +34,48 @@ public void setUp() parser = new PosixParser(); } - @Override @Test @Ignore + @Override @Test @Ignore("not supported by the PosixParser") public void testDoubleDash2() throws Exception { - // not supported by the PosixParser } - @Override @Test @Ignore + @Override @Test @Ignore("not supported by the PosixParser") public void testLongWithoutEqualSingleDash() throws Exception { - // not supported by the PosixParser } - @Override @Test @Ignore + @Override @Test @Ignore("not supported by the PosixParser") public void testAmbiguousLongWithoutEqualSingleDash() throws Exception { - // not supported by the PosixParser } - @Override @Test @Ignore + @Override @Test @Ignore("not supported by the PosixParser (CLI-184)") public void testNegativeOption() throws Exception { - // not supported by the PosixParser (CLI-184) } - @Override @Test @Ignore + @Override @Test @Ignore("not supported by the PosixParser") public void testLongWithUnexpectedArgument1() throws Exception { - // not supported by the PosixParser } - @Override @Test @Ignore + @Override @Test @Ignore("not supported by the PosixParser") public void testLongWithEqualSingleDash() throws Exception { - // not supported by the PosixParser } - @Override @Test @Ignore + @Override @Test @Ignore("not supported by the PosixParser") public void testShortWithEqual() throws Exception { - // not supported by the PosixParser } - @Override @Test @Ignore + @Override @Test @Ignore("not supported by the PosixParser") public void testUnambiguousPartialLongOption4() throws Exception { - // not supported by the PosixParser } - @Override @Test @Ignore + @Override @Test @Ignore("not supported by the PosixParser") public void testAmbiguousPartialLongOption4() throws Exception { - // not supported by the PosixParser } }