use of com.puppycrawl.tools.checkstyle.checks.coding.VariableDeclarationUsageDistanceCheck in project checkstyle by checkstyle.
the class VariableDeclarationUsageDistanceTest method arrayTypeStyleTest.
@Test
public void arrayTypeStyleTest() throws Exception {
final String msgExt = "variable.declaration.usage.distance.extend";
final Class<VariableDeclarationUsageDistanceCheck> clazz = VariableDeclarationUsageDistanceCheck.class;
final String[] expected = { "71: " + getCheckMessage(clazz, msgExt, "count", 4, 3), "219: " + getCheckMessage(clazz, msgExt, "t", 5, 3), "479: " + getCheckMessage(clazz, msgExt, "myOption", 7, 3), "491: " + getCheckMessage(clazz, msgExt, "myOption", 6, 3) };
final Configuration checkConfig = getCheckConfig("VariableDeclarationUsageDistance");
final String filePath = getPath("InputVariableDeclarationUsageDistanceCheck.java");
final Integer[] warnList = getLinesWithWarn(filePath);
verify(checkConfig, filePath, expected, warnList);
}
Aggregations