aboutsummaryrefslogtreecommitdiff
path: root/src/test/resources/com/puppycrawl/tools/checkstyle/checks/naming
diff options
context:
space:
mode:
authorDmytro Kytsmen <dmitrokytsmen@gmail.com>2017-05-02 12:24:02 +0300
committerRoman Ivanov <romani@users.noreply.github.com>2017-05-02 06:42:21 -0700
commitc151f0d2011695c80247da003b87f4581122ac8e (patch)
treee509582e30400f8170792e6e836863a57cd5b54a /src/test/resources/com/puppycrawl/tools/checkstyle/checks/naming
parentf5f66fad5c12bcef55056bd05d72ff6d0c6cf16f (diff)
downloadcheckstyle-c151f0d2011695c80247da003b87f4581122ac8e.tar.gz
Issue #3891: Split and Organize Checkstyle inputs by Test: naming package, TypeName
Diffstat (limited to 'src/test/resources/com/puppycrawl/tools/checkstyle/checks/naming')
-rw-r--r--src/test/resources/com/puppycrawl/tools/checkstyle/checks/naming/InputCatchOnly.java34
-rw-r--r--src/test/resources/com/puppycrawl/tools/checkstyle/checks/naming/InputEmptyStatement.java78
-rw-r--r--src/test/resources/com/puppycrawl/tools/checkstyle/checks/naming/InputSimple.java225
-rw-r--r--src/test/resources/com/puppycrawl/tools/checkstyle/checks/naming/typename/InputTypeName.java (renamed from src/test/resources/com/puppycrawl/tools/checkstyle/checks/naming/InputTypeName.java)2
4 files changed, 1 insertions, 338 deletions
diff --git a/src/test/resources/com/puppycrawl/tools/checkstyle/checks/naming/InputCatchOnly.java b/src/test/resources/com/puppycrawl/tools/checkstyle/checks/naming/InputCatchOnly.java
deleted file mode 100644
index ac1a01a11..000000000
--- a/src/test/resources/com/puppycrawl/tools/checkstyle/checks/naming/InputCatchOnly.java
+++ /dev/null
@@ -1,34 +0,0 @@
-package com.puppycrawl.tools.checkstyle.checks.naming;
-
-/**
- * Test case for skipping over catch names.
- **/
-public class InputCatchOnly {
- int foo() {
- if (System.currentTimeMillis() > 1000)
- return 1;
-
- int test = 0;
-
- try
- {
- return 1;
- }
- catch (Exception e)
- {
- return 0;
- }
- }
-
- public InputCatchOnly()
- {
- return;
- }
-
- class InnerFoo
- {
- public void fooInnerMethod ()
- {
- }
- }
-}
diff --git a/src/test/resources/com/puppycrawl/tools/checkstyle/checks/naming/InputEmptyStatement.java b/src/test/resources/com/puppycrawl/tools/checkstyle/checks/naming/InputEmptyStatement.java
deleted file mode 100644
index b1df844aa..000000000
--- a/src/test/resources/com/puppycrawl/tools/checkstyle/checks/naming/InputEmptyStatement.java
+++ /dev/null
@@ -1,78 +0,0 @@
-package com.puppycrawl.tools.checkstyle.checks.naming;
-
-public class InputEmptyStatement
-{
- public InputEmptyStatement()
- {
- ;
- }
-
- public void EmptyMethod()
- {
- ;
- }
-
- public void EmptyStatements(boolean cond)
- {
- for (;cond;);
-
- for (;cond;)
- {
- ;
- }
-
- if (true);
-
- if (true)
- {
- ;
- }
-
- if (cond)
- {
- int i;
- }
-
- else
- {
- ;
- }
-
- switch (1)
- {
- case 1 :
- ;
- default :
- ;
- }
-
- while (cond);
-
- while (cond)
- {
- ;
- }
-
- do;
- while (cond);
-
- do
- {
- ;
- }
- while (cond);
-
- try
- {
- ;
- }
- catch (Exception ex)
- {
- ;
- }
- finally
- {
- ;
- }
- }
-}
diff --git a/src/test/resources/com/puppycrawl/tools/checkstyle/checks/naming/InputSimple.java b/src/test/resources/com/puppycrawl/tools/checkstyle/checks/naming/InputSimple.java
deleted file mode 100644
index 6542859dd..000000000
--- a/src/test/resources/com/puppycrawl/tools/checkstyle/checks/naming/InputSimple.java
+++ /dev/null
@@ -1,225 +0,0 @@
-////////////////////////////////////////////////////////////////////////////////
-// Test case file for checkstyle.
-// Created: Feb-2001
-// Ignore error
-////////////////////////////////////////////////////////////////////////////////
-package com.puppycrawl.tools.checkstyle.checks.naming;
-import java.io.*;
-/**
- * Contains simple mistakes:
- * - Long lines
- * - Tabs
- * - Format of variables and parameters
- * - Order of modifiers
- * @author Oliver Burn
- **/
-final class InputSimple
-{
- // Long line ----------------------------------------------------------------
- // Contains a tab -> <-
- // Contains trailing whitespace ->
-
- // Name format tests
- //
- /** Invalid format **/
- public static final int badConstant = 2;
- /** Valid format **/
- public static final int MAX_ROWS = 2;
-
- /** Invalid format **/
- private static int badStatic = 2;
- /** Valid format **/
- private static int sNumCreated = 0;
-
- /** Invalid format **/
- private int badMember = 2;
- /** Valid format **/
- private int mNumCreated1 = 0;
- /** Valid format **/
- protected int mNumCreated2 = 0;
-
- /** commas are wrong **/
- private int[] mInts = new int[] {1,2, 3,
- 4};
-
- //
- // Accessor tests
- //
- /** should be private **/
- public static int sTest1;
- /** should be private **/
- protected static int sTest3;
- /** should be private **/
- static int sTest2;
-
- /** should be private **/
- int mTest1;
- /** should be private **/
- public int mTest2;
-
- //
- // Parameter name format tests
- //
-
- /**
- * @return hack
- * @param badFormat1 bad format
- * @param badFormat2 bad format
- * @param badFormat3 bad format
- * @throws java.lang.Exception abc
- **/
- int test1(int badFormat1,int badFormat2,
- final int badFormat3)
- throws java.lang.Exception
- {
- return 0;
- }
-
- /** method that is 20 lines long **/
- private void longMethod()
- {
- // a line
- // a line
- // a line
- // a line
- // a line
- // a line
- // a line
- // a line
- // a line
- // a line
- // a line
- // a line
- // a line
- // a line
- // a line
- // a line
- // a line
- // a line
- }
-
- /** constructor that is 10 lines long **/
- private InputSimple()
- {
- // a line
- // a line
- // a line
- // a line
- // a line
- // a line
- // a line
- // a line
- }
-
- /** test local variables */
- private void localVariables()
- {
- // normal decl
- int abc = 0;
- int ABC = 0;
-
- // final decls
- final int cde = 0;
- final int CDE = 0;
-
- // decl in for loop init statement
- for (int k = 0; k < 1; k++)
- {
- String innerBlockVariable = "";
- }
- for (int I = 0; I < 1; I++)
- {
- String InnerBlockVariable = "";
- }
- }
-
- /** test method pattern */
- void ALL_UPPERCASE_METHOD()
- {
- }
-
- /** test illegal constant **/
- private static final int BAD__NAME = 3;
-
- // A very, very long line that is OK because it matches the regexp "^.*is OK.*regexp.*$"
- // long line that has a tab -> <- and would be OK if tab counted as 1 char
- // tabs that count as one char because of their position -> <- -> <-, OK
-
- /** some lines to test the error column after tabs */
- void errorColumnAfterTabs()
- {
- // with tab-width 8 all statements below start at the same column,
- // with different combinations of ' ' and '\t' before the statement
- int tab0 =1;
- int tab1 =1;
- int tab2 =1;
- int tab3 =1;
- int tab4 =1;
- int tab5 =1;
- }
-
- // FIXME:
- /* FIXME: a
- * FIXME:
- * TODO
- */
- /* NOTHING */
- /* YES */ /* FIXME: x */ /* YES!! */
-
- /** test long comments **/
- void veryLong()
- {
- /*
- blah blah blah blah
- blah blah blah blah
- blah blah blah blah
- blah blah blah blah
- blah blah blah blah
- blah blah blah blah
- blah blah blah blah
- blah blah blah blah
- blah blah blah blah
- blah blah blah blah
- blah blah blah blah
- blah blah blah blah
- blah blah blah blah
- blah blah blah blah
- blah blah blah blah
- enough talk */
- }
-
- /**
- * @see to lazy to document all args. Testing excessive # args
- **/
- void toManyArgs(int aArg1, int aArg2, int aArg3, int aArg4, int aArg5,
- int aArg6, int aArg7, int aArg8, int aArg9)
- {
- }
-}
-
-/** Test class for variable naming in for each clauses. */
-class InputSimple2
-{
- /** Some more Javadoc. */
- public void doSomething()
- {
- //"O" should be named "o"
- for (Object O : new java.util.ArrayList())
- {
-
- }
- }
-}
-
-/** Test enum for member naming check */
-enum MyEnum1
-{
- /** ABC constant */
- ABC,
-
- /** XYZ constant */
- XYZ;
-
- /** Should be mSomeMemeber */
- private int someMember;
-}
diff --git a/src/test/resources/com/puppycrawl/tools/checkstyle/checks/naming/InputTypeName.java b/src/test/resources/com/puppycrawl/tools/checkstyle/checks/naming/typename/InputTypeName.java
index fa7128d3a..32bf4e0c1 100644
--- a/src/test/resources/com/puppycrawl/tools/checkstyle/checks/naming/InputTypeName.java
+++ b/src/test/resources/com/puppycrawl/tools/checkstyle/checks/naming/typename/InputTypeName.java
@@ -1,4 +1,4 @@
-package com.puppycrawl.tools.checkstyle.checks.naming;
+package com.puppycrawl.tools.checkstyle.checks.naming.typename;
class inputHeaderClass {