Issue #2161: unify test input locations

This commit is contained in:
rnveach 2015-10-11 00:09:27 -04:00 committed by Roman Ivanov
parent 708bb0271d
commit 9f66b0bde4
3 changed files with 12 additions and 5 deletions

View File

@ -22,6 +22,7 @@ package com.puppycrawl.tools.checkstyle.checks.coding;
import static com.puppycrawl.tools.checkstyle.checks.coding.IllegalCatchCheck.MSG_KEY;
import java.io.File;
import java.io.IOException;
import org.junit.Assert;
import org.junit.Test;
@ -30,6 +31,12 @@ import com.puppycrawl.tools.checkstyle.BaseCheckTestSupport;
import com.puppycrawl.tools.checkstyle.DefaultConfiguration;
public class IllegalCatchCheckTest extends BaseCheckTestSupport {
@Override
protected String getPath(String filename) throws IOException {
return super.getPath("checks" + File.separator
+ "coding" + File.separator + filename);
}
@Test
public void testDefault() throws Exception {
DefaultConfiguration checkConfig = createCheckConfig(IllegalCatchCheck.class);
@ -43,7 +50,7 @@ public class IllegalCatchCheckTest extends BaseCheckTestSupport {
"16:11: " + getCheckMessage(MSG_KEY, "java.lang.Throwable"),
};
verify(checkConfig, getPath("coding" + File.separator + "InputIllegalCatchCheck.java"), expected);
verify(checkConfig, getPath("InputIllegalCatchCheck.java"), expected);
}
@Test
@ -59,7 +66,7 @@ public class IllegalCatchCheckTest extends BaseCheckTestSupport {
"16:11: " + getCheckMessage(MSG_KEY, "java.lang.Throwable"),
};
verify(checkConfig, getPath("coding" + File.separator + "InputIllegalCatchCheck.java"), expected);
verify(checkConfig, getPath("InputIllegalCatchCheck.java"), expected);
}
@Test
@ -73,7 +80,7 @@ public class IllegalCatchCheckTest extends BaseCheckTestSupport {
"16:11: " + getCheckMessage(MSG_KEY, "RuntimeException"),
};
verify(checkConfig, getPath("coding" + File.separator + "InputIllegalCatchCheck2.java"), expected);
verify(checkConfig, getPath("InputIllegalCatchCheck2.java"), expected);
}
@Test

View File

@ -1,4 +1,4 @@
package com.puppycrawl.tools.checkstyle.coding;
package com.puppycrawl.tools.checkstyle.checks.coding;
public class InputIllegalCatchCheck {
public void foo() {

View File

@ -1,4 +1,4 @@
package com.puppycrawl.tools.checkstyle.coding;
package com.puppycrawl.tools.checkstyle.checks.coding;
public class InputIllegalCatchCheck2 {
public void foo() throws OneMoreException {