diff options
author | Sagar <sagar.shah@evivehealth.com> | 2017-03-04 21:05:24 +0530 |
---|---|---|
committer | rnveach <rveach02@gmail.com> | 2017-03-08 20:46:31 -0500 |
commit | 0906005ee6cea1d121cbb81833dc21fbac3599f4 (patch) | |
tree | b742ba2734be2d066377c0b991993a319c6abd6c /src/test/resources/com/puppycrawl/tools/checkstyle/checks/whitespace | |
parent | 90f6cdc814f093a135ba1e50847dd86134120967 (diff) | |
download | checkstyle-0906005ee6cea1d121cbb81833dc21fbac3599f4.tar.gz |
Issue #3904: Split and Organize Checkstyle inputs by Test for SeparatorWrap
Diffstat (limited to 'src/test/resources/com/puppycrawl/tools/checkstyle/checks/whitespace')
3 files changed, 195 insertions, 0 deletions
diff --git a/src/test/resources/com/puppycrawl/tools/checkstyle/checks/whitespace/separatorwrap/InputSeparatorWrapForInvalidOption.java b/src/test/resources/com/puppycrawl/tools/checkstyle/checks/whitespace/separatorwrap/InputSeparatorWrapForInvalidOption.java new file mode 100644 index 000000000..f650ab2a1 --- /dev/null +++ b/src/test/resources/com/puppycrawl/tools/checkstyle/checks/whitespace/separatorwrap/InputSeparatorWrapForInvalidOption.java @@ -0,0 +1,65 @@ +package com.puppycrawl.tools.checkstyle.checks.whitespace.separatorwrap; + +public class InputSeparatorWrapForInvalidOption<T extends FooForInvalidOption + & BarForInvalidOption> { + public void goodCase() throws FooExceptionForInvalidOption, BarExceptionForInvalidOption + { + int i = 0; + String s = "ffffooooString"; + s + .isEmpty(); //good wrapping + s.isEmpty(); + try { + foo(i, s); + } catch (FooExceptionForInvalidOption | + BarExceptionForInvalidOption e) {} + foo(i, + s); //good wrapping + } + public static void foo(int i, String s) throws FooExceptionForInvalidOption, BarExceptionForInvalidOption + { + + } +} + +class badCaseForInvalidOption<T extends FooForInvalidOption & BarForInvalidOption> { + + + public void goodCaseForInvalidOption(int... aFoo) throws FooExceptionForInvalidOption, BarExceptionForInvalidOption + { + String s = "ffffooooString"; + s. + isEmpty(); //bad wrapping + try { + foo(1, s); + } catch (FooExceptionForInvalidOption + | BarExceptionForInvalidOption e) {} + + foo(1 + ,s); //bad wrapping + int[] i; + } + public static String foo(int i, String s) throws FooExceptionForInvalidOption, BarExceptionForInvalidOption + { + return new StringBuilder("") + .append("", 0, 1) + .append("") + .toString(); + } +} + +interface FooForInvalidOption { + +} + +interface BarForInvalidOption { + +} + +class FooExceptionForInvalidOption extends Exception { + +} + +class BarExceptionForInvalidOption extends Exception { + +}
\ No newline at end of file diff --git a/src/test/resources/com/puppycrawl/tools/checkstyle/checks/whitespace/separatorwrap/InputSeparatorWrapForTestComma.java b/src/test/resources/com/puppycrawl/tools/checkstyle/checks/whitespace/separatorwrap/InputSeparatorWrapForTestComma.java new file mode 100644 index 000000000..51720b9b8 --- /dev/null +++ b/src/test/resources/com/puppycrawl/tools/checkstyle/checks/whitespace/separatorwrap/InputSeparatorWrapForTestComma.java @@ -0,0 +1,65 @@ +package com.puppycrawl.tools.checkstyle.checks.whitespace.separatorwrap; + +public class InputSeparatorWrapForTestComma<T extends FooForTestComma + & BarForTestComma> { + public void goodCase() throws FooExceptionForTestComma, BarExceptionForTestComma + { + int i = 0; + String s = "ffffooooString"; + s + .isEmpty(); //good wrapping + s.isEmpty(); + try { + foo(i, s); + } catch (FooExceptionForTestComma | + BarExceptionForTestComma e) {} + foo(i, + s); //good wrapping + } + public static void foo(int i, String s) throws FooExceptionForTestComma, BarExceptionForTestComma + { + + } +} + +class badCaseForTestComma<T extends FooForTestComma & BarForTestComma> { + + + public void goodCaseForTestComma(int... aFoo) throws FooExceptionForTestComma, BarExceptionForTestComma + { + String s = "ffffooooString"; + s. + isEmpty(); //bad wrapping + try { + foo(1, s); + } catch (FooExceptionForTestComma + | BarExceptionForTestComma e) {} + + foo(1 + ,s); //bad wrapping + int[] i; + } + public static String foo(int i, String s) throws FooExceptionForTestComma, BarExceptionForTestComma + { + return new StringBuilder("") + .append("", 0, 1) + .append("") + .toString(); + } +} + +interface FooForTestComma { + +} + +interface BarForTestComma { + +} + +class FooExceptionForTestComma extends Exception { + +} + +class BarExceptionForTestComma extends Exception { + +}
\ No newline at end of file diff --git a/src/test/resources/com/puppycrawl/tools/checkstyle/checks/whitespace/separatorwrap/InputSeparatorWrapForTestDot.java b/src/test/resources/com/puppycrawl/tools/checkstyle/checks/whitespace/separatorwrap/InputSeparatorWrapForTestDot.java new file mode 100644 index 000000000..60a2b4b52 --- /dev/null +++ b/src/test/resources/com/puppycrawl/tools/checkstyle/checks/whitespace/separatorwrap/InputSeparatorWrapForTestDot.java @@ -0,0 +1,65 @@ +package com.puppycrawl.tools.checkstyle.checks.whitespace.separatorwrap; + +public class InputSeparatorWrapForTestDot<T extends FooForTestDot + & BarForTestDot> { + public void goodCase() throws FooExceptionForTestDot, BarExceptionForTestDot + { + int i = 0; + String s = "ffffooooString"; + s + .isEmpty(); //good wrapping + s.isEmpty(); + try { + foo(i, s); + } catch (FooExceptionForTestDot | + BarExceptionForTestDot e) {} + foo(i, + s); //good wrapping + } + public static void foo(int i, String s) throws FooExceptionForTestDot, BarExceptionForTestDot + { + + } +} + +class badCaseForTestDot<T extends FooForTestDot & BarForTestDot> { + + + public void goodCaseForTestDot(int... aFoo) throws FooExceptionForTestDot, BarExceptionForTestDot + { + String s = "ffffooooString"; + s. + isEmpty(); //bad wrapping + try { + foo(1, s); + } catch (FooExceptionForTestDot + | BarExceptionForTestDot e) {} + + foo(1 + ,s); //bad wrapping + int[] i; + } + public static String foo(int i, String s) throws FooExceptionForTestDot, BarExceptionForTestDot + { + return new StringBuilder("") + .append("", 0, 1) + .append("") + .toString(); + } +} + +interface FooForTestDot { + +} + +interface BarForTestDot { + +} + +class FooExceptionForTestDot extends Exception { + +} + +class BarExceptionForTestDot extends Exception { + +}
\ No newline at end of file |