Issue #2161: unify test input locations
This commit is contained in:
parent
bff0f95962
commit
9509710845
|
|
@ -21,6 +21,9 @@ package com.puppycrawl.tools.checkstyle.checks.coding;
|
|||
|
||||
import static com.puppycrawl.tools.checkstyle.checks.coding.NestedForDepthCheck.MSG_KEY;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
|
||||
import org.apache.commons.lang3.ArrayUtils;
|
||||
import org.junit.Assert;
|
||||
import org.junit.Test;
|
||||
|
|
@ -33,6 +36,12 @@ import com.puppycrawl.tools.checkstyle.DefaultConfiguration;
|
|||
* @see NestedForDepthCheck
|
||||
*/
|
||||
public class NestedForDepthCheckTest extends BaseCheckTestSupport {
|
||||
@Override
|
||||
protected String getPath(String filename) throws IOException {
|
||||
return super.getPath("checks" + File.separator
|
||||
+ "coding" + File.separator + filename);
|
||||
}
|
||||
|
||||
/**
|
||||
* Call the check allowing 2 layers of nested for-statements. This
|
||||
* means the top-level for can contain up to 2 levels of nested for
|
||||
|
|
@ -53,7 +62,7 @@ public class NestedForDepthCheckTest extends BaseCheckTestSupport {
|
|||
"44:13: " + getCheckMessage(MSG_KEY, 4, 2),
|
||||
};
|
||||
|
||||
verify(checkConfig, getPath("coding/InputNestedForDepth.java"),
|
||||
verify(checkConfig, getPath("InputNestedForDepth.java"),
|
||||
expected);
|
||||
}
|
||||
|
||||
|
|
@ -75,7 +84,7 @@ public class NestedForDepthCheckTest extends BaseCheckTestSupport {
|
|||
|
||||
final String[] expected = ArrayUtils.EMPTY_STRING_ARRAY;
|
||||
|
||||
verify(checkConfig, getPath("coding/InputNestedForDepth.java"),
|
||||
verify(checkConfig, getPath("InputNestedForDepth.java"),
|
||||
expected);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@
|
|||
//License along with this library; if not, write to the Free Software
|
||||
//Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
package com.puppycrawl.tools.checkstyle.coding;
|
||||
package com.puppycrawl.tools.checkstyle.checks.coding;
|
||||
|
||||
/**
|
||||
* This Class contains no logic, but serves as test-input for the unit tests for the
|
||||
Loading…
Reference in New Issue