Search in sources :

Example 1 with OverloadMethodsDeclarationOrderCheck

use of com.puppycrawl.tools.checkstyle.checks.coding.OverloadMethodsDeclarationOrderCheck in project checkstyle by checkstyle.

the class OverloadMethodsDeclarationOrderTest method overloadMethodsTest.

@Test
public void overloadMethodsTest() throws Exception {
    final Class<OverloadMethodsDeclarationOrderCheck> clazz = OverloadMethodsDeclarationOrderCheck.class;
    final String messageKey = "overload.methods.declaration";
    final String[] expected = { "26: " + getCheckMessage(clazz, messageKey, 15), "54: " + getCheckMessage(clazz, messageKey, 43), "66: " + getCheckMessage(clazz, messageKey, 64), "109: " + getCheckMessage(clazz, messageKey, 98) };
    final Configuration checkConfig = getCheckConfig("OverloadMethodsDeclarationOrder");
    final String filePath = getPath("InputOverloadMethodsDeclarationOrder.java");
    final Integer[] warnList = getLinesWithWarn(filePath);
    verify(checkConfig, filePath, expected, warnList);
}
Also used : Configuration(com.puppycrawl.tools.checkstyle.api.Configuration) OverloadMethodsDeclarationOrderCheck(com.puppycrawl.tools.checkstyle.checks.coding.OverloadMethodsDeclarationOrderCheck) Test(org.junit.Test)

Aggregations

Configuration (com.puppycrawl.tools.checkstyle.api.Configuration)1 OverloadMethodsDeclarationOrderCheck (com.puppycrawl.tools.checkstyle.checks.coding.OverloadMethodsDeclarationOrderCheck)1 Test (org.junit.Test)1