Skip to content

Commit

Permalink
Issue checkstyle#4220: Modified EmptyBlockCheckTest.java and moved it…
Browse files Browse the repository at this point in the history
…s input files to the emptyblock subdirectory
  • Loading branch information
Subbu Dantu authored and Subbu Dantu committed Apr 18, 2017
1 parent 172f035 commit e14ef6a
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 14 deletions.
Expand Up @@ -40,7 +40,7 @@ public class EmptyBlockCheckTest
@Override
protected String getPath(String filename) throws IOException {
return super.getPath("checks" + File.separator
+ "blocks" + File.separator + filename);
+ "blocks" + File.separator + "emptyblock" + File.separator + filename);
}

/* Additional test for jacoco, since valueOf()
Expand Down Expand Up @@ -68,7 +68,7 @@ public void testDefault()
"73:41: " + getCheckMessage(MSG_KEY_BLOCK_NO_STMT),
"84:12: " + getCheckMessage(MSG_KEY_BLOCK_NO_STMT),
};
verify(checkConfig, getPath("InputSemantic.java"), expected);
verify(checkConfig, getPath("InputEmptyBlockDefault.java"), expected);
}

@Test
Expand All @@ -84,7 +84,7 @@ public void testText()
"71:29: " + getCheckMessage(MSG_KEY_BLOCK_EMPTY, "synchronized"),
"84:12: " + getCheckMessage(MSG_KEY_BLOCK_EMPTY, "STATIC_INIT"),
};
verify(checkConfig, getPath("InputSemantic.java"), expected);
verify(checkConfig, getPath("InputEmptyBlockDefault.java"), expected);
}

@Test
Expand All @@ -103,7 +103,7 @@ public void testStatement()
"73:41: " + getCheckMessage(MSG_KEY_BLOCK_NO_STMT),
"84:12: " + getCheckMessage(MSG_KEY_BLOCK_NO_STMT),
};
verify(checkConfig, getPath("InputSemantic.java"), expected);
verify(checkConfig, getPath("InputEmptyBlockDefault.java"), expected);
}

@Test
Expand All @@ -120,7 +120,7 @@ public void allowEmptyLoops() throws Exception {
"22:29: " + getCheckMessage(MSG_KEY_BLOCK_NO_STMT),
"23:28: " + getCheckMessage(MSG_KEY_BLOCK_NO_STMT),
};
verify(checkConfig, getPath("InputSemantic2.java"), expected);
verify(checkConfig, getPath("InputEmptyBlockAllowEmptyLoops.java"), expected);
}

@Test
Expand All @@ -137,7 +137,7 @@ public void allowEmptyLoopsText() throws Exception {
"22:29: " + getCheckMessage(MSG_KEY_BLOCK_EMPTY, "if"),
"23:28: " + getCheckMessage(MSG_KEY_BLOCK_EMPTY, "switch"),
};
verify(checkConfig, getPath("InputSemantic2.java"), expected);
verify(checkConfig, getPath("InputEmptyBlockAllowEmptyLoops.java"), expected);
}

@Test
Expand All @@ -148,7 +148,7 @@ public void testInvalidOption() throws Exception {
try {
final String[] expected = CommonUtils.EMPTY_STRING_ARRAY;

verify(checkConfig, getPath("InputSemantic.java"), expected);
verify(checkConfig, getPath("InputEmptyBlockDefault.java"), expected);
fail("exception expected");
}
catch (CheckstyleException ex) {
Expand All @@ -170,7 +170,7 @@ public void testAllowEmptyCaseWithText() throws Exception {
"31:37: " + getCheckMessage(MSG_KEY_BLOCK_EMPTY, "case"),
"32:29: " + getCheckMessage(MSG_KEY_BLOCK_EMPTY, "case"),
};
verify(checkConfig, getPath("InputEmptyCase.java"), expected);
verify(checkConfig, getPath("InputEmptyBlockCase.java"), expected);
}

@Test
Expand All @@ -187,6 +187,6 @@ public void testForbidCaseWithoutStmt() throws Exception {
"32:29: " + getCheckMessage(MSG_KEY_BLOCK_NO_STMT, "case"),
"32:40: " + getCheckMessage(MSG_KEY_BLOCK_NO_STMT, "case"),
};
verify(checkConfig, getPath("InputEmptyCase.java"), expected);
verify(checkConfig, getPath("InputEmptyBlockCase.java"), expected);
}
}
Expand Up @@ -2,7 +2,7 @@
// Test case file for checkstyle.
// Created: 2001
////////////////////////////////////////////////////////////////////////////////
package com.puppycrawl.tools.checkstyle.checks.blocks;
package com.puppycrawl.tools.checkstyle.checks.blocks.emptyblock;

import java.io.*; // star import for instantiation tests
import java.awt.Dimension; // explicit import for instantiation tests
Expand Down
Expand Up @@ -2,9 +2,9 @@
// Input test file for testing empty LITERAL_CASE.
// Created: 2017
////////////////////////////////////////////////////////////////////////////////
package com.puppycrawl.tools.checkstyle.checks.blocks;
package com.puppycrawl.tools.checkstyle.checks.blocks.emptyblock;

class InputEmptyCase
class InputEmptyBlockCase
{
void method1(int a) {
switch (a) {}
Expand Down
Expand Up @@ -2,7 +2,7 @@
// Test case file for checkstyle.
// Created: 2001
////////////////////////////////////////////////////////////////////////////////
package com.puppycrawl.tools.checkstyle.checks.blocks;
package com.puppycrawl.tools.checkstyle.checks.blocks.emptyblock;

import java.io.*; // star import for instantiation tests
import java.awt.Dimension; // explicit import for instantiation tests
Expand All @@ -12,7 +12,7 @@
* Test case for detecting empty block statements.
* @author Lars Kühne
**/
class InputSemantic
class InputEmptyBlockDefault
{
static {
Boolean x = new Boolean(true);
Expand Down

0 comments on commit e14ef6a

Please sign in to comment.