Issue #1293: One more unit test for PackageDeclarationCheck.

This commit is contained in:
Baratali Izmailov 2015-07-09 12:12:35 -07:00 committed by Roman Ivanov
parent 95eb2122d5
commit 6e1b8917c1
4 changed files with 19 additions and 2 deletions

View File

@ -1113,7 +1113,6 @@
<regex><pattern>.*.checks.coding.MultipleStringLiteralsCheck</pattern><branchRate>90</branchRate><lineRate>96</lineRate></regex>
<regex><pattern>.*.checks.coding.MultipleVariableDeclarationsCheck</pattern><branchRate>96</branchRate><lineRate>100</lineRate></regex>
<regex><pattern>.*.checks.coding.OverloadMethodsDeclarationOrderCheck</pattern><branchRate>93</branchRate><lineRate>100</lineRate></regex>
<regex><pattern>.*.checks.coding.PackageDeclarationCheck</pattern><branchRate>75</branchRate><lineRate>85</lineRate></regex>
<regex><pattern>.*.checks.coding.ParameterAssignmentCheck</pattern><branchRate>80</branchRate><lineRate>96</lineRate></regex>
<regex><pattern>.*.checks.coding.ReturnCountCheck</pattern><branchRate>55</branchRate><lineRate>74</lineRate></regex>
<regex><pattern>.*.checks.coding.SimplifyBooleanReturnCheck</pattern><branchRate>83</branchRate><lineRate>100</lineRate></regex>

View File

@ -50,7 +50,17 @@ public class PackageDeclarationCheckTest extends BaseCheckTestSupport {
"1: " + getCheckMessage(MSG_KEY),
};
verify(checkConfig, getPath("InputWithCommentOnly.java"), expected);
verify(checkConfig, getPath("coding/InputWithCommentOnly.java"), expected);
}
@Test
public void testCorrectFile() throws Exception {
DefaultConfiguration checkConfig = createCheckConfig(PackageDeclarationCheck.class);
String[] expected = {
};
verify(checkConfig, getPath("coding/InputPackageDeclaration.java"), expected);
}
@Test

View File

@ -0,0 +1,8 @@
package com.puppycrawl.tools.checkstyle.checks.coding;
class InputPackageDeclaration {
public String value;
private void get(){
}
}