Issue #2161: unify test input locations

This commit is contained in:
rnveach 2015-10-12 12:11:51 -04:00 committed by Roman Ivanov
parent f793032724
commit 2f584ef4d5
2 changed files with 11 additions and 4 deletions

View File

@ -25,6 +25,7 @@ import static org.junit.Assert.assertEquals;
import static org.junit.Assert.fail;
import java.io.File;
import java.io.IOException;
import org.junit.Test;
@ -36,6 +37,12 @@ import com.puppycrawl.tools.checkstyle.api.DetailAST;
import com.puppycrawl.tools.checkstyle.api.TokenTypes;
public class ThrowsCountCheckTest extends BaseCheckTestSupport {
@Override
protected String getPath(String filename) throws IOException {
return super.getPath("checks" + File.separator
+ "design" + File.separator + filename);
}
@Test
public void testDefault() throws Exception {
DefaultConfiguration checkConfig = createCheckConfig(ThrowsCountCheck.class);
@ -47,7 +54,7 @@ public class ThrowsCountCheckTest extends BaseCheckTestSupport {
"55:43: " + getCheckMessage(MSG_KEY, 5, 4),
};
verify(checkConfig, getPath("design" + File.separator + "InputThrowsCount.java"), expected);
verify(checkConfig, getPath("InputThrowsCount.java"), expected);
}
@Test
@ -59,7 +66,7 @@ public class ThrowsCountCheckTest extends BaseCheckTestSupport {
"27:20: " + getCheckMessage(MSG_KEY, 6, 5),
};
verify(checkConfig, getPath("design" + File.separator + "InputThrowsCount.java"), expected);
verify(checkConfig, getPath("InputThrowsCount.java"), expected);
}
@Test
@ -101,6 +108,6 @@ public class ThrowsCountCheckTest extends BaseCheckTestSupport {
"35:28: " + getCheckMessage(MSG_KEY, 5, 4),
"55:43: " + getCheckMessage(MSG_KEY, 5, 4),
};
verify(checkConfig, getPath("design" + File.separator + "InputThrowsCount.java"), expected);
verify(checkConfig, getPath("InputThrowsCount.java"), expected);
}
}

View File

@ -1,4 +1,4 @@
package com.puppycrawl.tools.checkstyle.design;
package com.puppycrawl.tools.checkstyle.checks.design;
import java.awt.AWTException;
import java.io.EOFException;