Issue #2161: unify test input locations for javadoc package
This commit is contained in:
parent
1f0b9653e1
commit
bf94ea4127
|
|
@ -1,4 +1,4 @@
|
|||
<!-- ATTENTION: this file is not used by TeamCity, all excludes should be specified in build configuration -->
|
||||
<component name="DependencyValidationManager">
|
||||
<scope name="Checkstyle Inspection Scope" pattern="!file:target//*&&!file:src/test/resources*//**&&!file:src/test/java/com/puppycrawl/tools/checkstyle/checks/javadoc/ParseTreeBuilder.java&&!file:src/site/resources/js/google-analytics.js"/>
|
||||
<scope name="Checkstyle Inspection Scope" pattern="!file:target//*&&!file:src/test/resources*//**&&!file:src/test/java/com/puppycrawl/tools/checkstyle/grammars/javadoc/ParseTreeBuilder.java&&!file:src/site/resources/js/google-analytics.js"/>
|
||||
</component>
|
||||
|
|
|
|||
|
|
@ -24,6 +24,9 @@ import static com.puppycrawl.tools.checkstyle.checks.javadoc.AbstractJavadocChec
|
|||
import static com.puppycrawl.tools.checkstyle.checks.javadoc.AbstractJavadocCheck.PARSE_ERROR_MESSAGE_KEY;
|
||||
import static com.puppycrawl.tools.checkstyle.checks.javadoc.AbstractJavadocCheck.UNRECOGNIZED_ANTLR_ERROR_MESSAGE_KEY;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
|
||||
import org.apache.commons.lang3.ArrayUtils;
|
||||
import org.junit.Test;
|
||||
|
||||
|
|
@ -35,6 +38,11 @@ import com.puppycrawl.tools.checkstyle.api.DetailNode;
|
|||
import com.puppycrawl.tools.checkstyle.api.TokenTypes;
|
||||
|
||||
public class AbstractJavadocCheckTest extends BaseCheckTestSupport {
|
||||
@Override
|
||||
protected String getPath(String filename) throws IOException {
|
||||
return super.getPath("checks" + File.separator
|
||||
+ "javadoc" + File.separator + filename);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testNumberFormatException() throws Exception {
|
||||
|
|
@ -44,7 +52,7 @@ public class AbstractJavadocCheckTest extends BaseCheckTestSupport {
|
|||
+ "alternative at input '<ul><li>a' {@link EntityEntry} (by way of {@link #;' "
|
||||
+ "while parsing HTML_TAG"),
|
||||
};
|
||||
verify(checkConfig, getPath("javadoc/InputTestNumberFormatException.java"), expected);
|
||||
verify(checkConfig, getPath("InputTestNumberFormatException.java"), expected);
|
||||
}
|
||||
|
||||
@Test
|
||||
|
|
@ -53,7 +61,7 @@ public class AbstractJavadocCheckTest extends BaseCheckTestSupport {
|
|||
final String[] expected = {
|
||||
"4: " + getCheckMessage(UNRECOGNIZED_ANTLR_ERROR_MESSAGE_KEY, 4, "null"),
|
||||
};
|
||||
verify(checkConfig, getPath("javadoc/InputCustomTag.java"), expected);
|
||||
verify(checkConfig, getPath("InputCustomTag.java"), expected);
|
||||
}
|
||||
|
||||
@Test
|
||||
|
|
@ -63,7 +71,7 @@ public class AbstractJavadocCheckTest extends BaseCheckTestSupport {
|
|||
"4: " + getCheckMessage(JAVADOC_MISSED_HTML_CLOSE, 4, "unclosedTag"),
|
||||
"8: " + getCheckMessage(JAVADOC_WRONG_SINGLETON_TAG, 35, "img"),
|
||||
};
|
||||
verify(checkConfig, getPath("javadoc/InputParsingErrors.java"), expected);
|
||||
verify(checkConfig, getPath("InputParsingErrors.java"), expected);
|
||||
}
|
||||
|
||||
@Test
|
||||
|
|
@ -78,7 +86,7 @@ public class AbstractJavadocCheckTest extends BaseCheckTestSupport {
|
|||
checker.configure(checkerConfig);
|
||||
|
||||
final String[] expected = ArrayUtils.EMPTY_STRING_ARRAY;
|
||||
verify(checker, getPath("javadoc/InputCorrectJavaDocParagraphCheck.java"), expected);
|
||||
verify(checker, getPath("InputCorrectJavaDocParagraphCheck.java"), expected);
|
||||
}
|
||||
|
||||
private static class TempCheck extends AbstractJavadocCheck {
|
||||
|
|
|
|||
|
|
@ -25,6 +25,8 @@ import static org.junit.Assert.assertFalse;
|
|||
import static org.junit.Assert.assertNull;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.lang.reflect.Constructor;
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
import java.lang.reflect.Method;
|
||||
|
|
@ -46,6 +48,12 @@ public class AbstractTypeAwareCheckTest extends BaseCheckTestSupport {
|
|||
checkConfig = createCheckConfig(JavadocMethodCheck.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String getPath(String filename) throws IOException {
|
||||
return super.getPath("checks" + File.separator
|
||||
+ "javadoc" + File.separator + filename);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testIsSubclassWithNulls() throws Exception {
|
||||
JavadocMethodCheck check = new JavadocMethodCheck();
|
||||
|
|
@ -154,7 +162,7 @@ public class AbstractTypeAwareCheckTest extends BaseCheckTestSupport {
|
|||
"7:8: " + getCheckMessage(MSG_CLASS_INFO, "@throws", "InvalidExceptionName"),
|
||||
};
|
||||
try {
|
||||
verify(config, getPath("javadoc/InputLoadErrors.java"), expected);
|
||||
verify(config, getPath("InputLoadErrors.java"), expected);
|
||||
}
|
||||
catch (IllegalStateException ex) {
|
||||
assertEquals("Unable to get"
|
||||
|
|
@ -169,6 +177,6 @@ public class AbstractTypeAwareCheckTest extends BaseCheckTestSupport {
|
|||
checkConfig.addAttribute("allowUndeclaredRTE", "true");
|
||||
final String[] expected = ArrayUtils.EMPTY_STRING_ARRAY;
|
||||
|
||||
verify(checkConfig, getPath("javadoc/InputLoadErrors.java"), expected);
|
||||
verify(checkConfig, getPath("InputLoadErrors.java"), expected);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -22,6 +22,9 @@ package com.puppycrawl.tools.checkstyle.checks.javadoc;
|
|||
import static com.puppycrawl.tools.checkstyle.checks.javadoc.AtclauseOrderCheck.MSG_KEY;
|
||||
import static org.junit.Assert.assertArrayEquals;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
|
||||
import org.apache.commons.lang3.ArrayUtils;
|
||||
import org.junit.Test;
|
||||
|
||||
|
|
@ -30,6 +33,11 @@ import com.puppycrawl.tools.checkstyle.DefaultConfiguration;
|
|||
import com.puppycrawl.tools.checkstyle.api.TokenTypes;
|
||||
|
||||
public class AtclauseOrderCheckTest extends BaseCheckTestSupport {
|
||||
@Override
|
||||
protected String getPath(String filename) throws IOException {
|
||||
return super.getPath("checks" + File.separator
|
||||
+ "javadoc" + File.separator + filename);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testGetAcceptableTokens() {
|
||||
|
|
@ -50,7 +58,7 @@ public class AtclauseOrderCheckTest extends BaseCheckTestSupport {
|
|||
DefaultConfiguration checkConfig = createCheckConfig(AtclauseOrderCheck.class);
|
||||
final String[] expected = ArrayUtils.EMPTY_STRING_ARRAY;
|
||||
|
||||
verify(checkConfig, getPath("javadoc/InputCorrectAtClauseOrderCheck.java"), expected);
|
||||
verify(checkConfig, getPath("InputCorrectAtClauseOrderCheck.java"), expected);
|
||||
}
|
||||
|
||||
@Test
|
||||
|
|
@ -100,7 +108,7 @@ public class AtclauseOrderCheckTest extends BaseCheckTestSupport {
|
|||
"278: " + getCheckMessage(MSG_KEY, tagOrder),
|
||||
"288: " + getCheckMessage(MSG_KEY, tagOrder),
|
||||
};
|
||||
verify(checkConfig, getPath("javadoc/InputIncorrectAtClauseOrderCheck.java"), expected);
|
||||
verify(checkConfig, getPath("InputIncorrectAtClauseOrderCheck.java"), expected);
|
||||
}
|
||||
|
||||
@Test
|
||||
|
|
@ -117,6 +125,6 @@ public class AtclauseOrderCheckTest extends BaseCheckTestSupport {
|
|||
final String[] expected = {
|
||||
"113: " + getCheckMessage(MSG_KEY, tagOrder),
|
||||
};
|
||||
verify(checkConfig, getPath("javadoc/InputIncorrectAtClauseOrderCheck.java"), expected);
|
||||
verify(checkConfig, getPath("InputIncorrectAtClauseOrderCheck.java"), expected);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -75,7 +75,7 @@ public class JavadocMethodCheckTest extends BaseCheckTestSupport {
|
|||
final String[] expected = {
|
||||
"7:8: " + getCheckMessage(MSG_CLASS_INFO, "@throws", "InvalidExceptionName"),
|
||||
};
|
||||
verify(config, getPath("javadoc/InputLoadErrors.java"), expected);
|
||||
verify(config, getPath("checks/javadoc/InputLoadErrors.java"), expected);
|
||||
}
|
||||
|
||||
@Test
|
||||
|
|
@ -327,7 +327,8 @@ public class JavadocMethodCheckTest extends BaseCheckTestSupport {
|
|||
"106:9: " + getCheckMessage(MSG_JAVADOC_MISSING),
|
||||
"107:9: " + getCheckMessage(MSG_JAVADOC_MISSING),
|
||||
"108:9: " + getCheckMessage(MSG_JAVADOC_MISSING), };
|
||||
verify(checkConfig, getPath("javadoc" + File.separator
|
||||
verify(checkConfig, getPath("checks" + File.separator
|
||||
+ "javadoc" + File.separator
|
||||
+ "InputNoJavadoc.java"), expected);
|
||||
}
|
||||
|
||||
|
|
@ -339,7 +340,8 @@ public class JavadocMethodCheckTest extends BaseCheckTestSupport {
|
|||
"11:5: " + getCheckMessage(MSG_JAVADOC_MISSING),
|
||||
"21:9: " + getCheckMessage(MSG_JAVADOC_MISSING),
|
||||
"22:9: " + getCheckMessage(MSG_JAVADOC_MISSING), };
|
||||
verify(checkConfig, getPath("javadoc" + File.separator
|
||||
verify(checkConfig, getPath("checks" + File.separator
|
||||
+ "javadoc" + File.separator
|
||||
+ "InputNoJavadoc.java"), expected);
|
||||
}
|
||||
|
||||
|
|
@ -372,7 +374,8 @@ public class JavadocMethodCheckTest extends BaseCheckTestSupport {
|
|||
"105:9: " + getCheckMessage(MSG_JAVADOC_MISSING),
|
||||
"107:9: " + getCheckMessage(MSG_JAVADOC_MISSING),
|
||||
"108:9: " + getCheckMessage(MSG_JAVADOC_MISSING), };
|
||||
verify(checkConfig, getPath("javadoc" + File.separator
|
||||
verify(checkConfig, getPath("checks" + File.separator
|
||||
+ "javadoc" + File.separator
|
||||
+ "InputNoJavadoc.java"), expected);
|
||||
}
|
||||
|
||||
|
|
@ -380,7 +383,8 @@ public class JavadocMethodCheckTest extends BaseCheckTestSupport {
|
|||
public void testAllowMissingJavadoc() throws Exception {
|
||||
checkConfig.addAttribute("allowMissingJavadoc", "true");
|
||||
final String[] expected = ArrayUtils.EMPTY_STRING_ARRAY;
|
||||
verify(checkConfig, getPath("javadoc" + File.separator
|
||||
verify(checkConfig, getPath("checks" + File.separator
|
||||
+ "javadoc" + File.separator
|
||||
+ "InputNoJavadoc.java"), expected);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -23,6 +23,7 @@ import static com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocPackageCheck
|
|||
import static com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocPackageCheck.MSG_PACKAGE_INFO;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
|
||||
import org.apache.commons.lang3.ArrayUtils;
|
||||
import org.junit.Test;
|
||||
|
|
@ -33,6 +34,12 @@ import com.puppycrawl.tools.checkstyle.api.Configuration;
|
|||
|
||||
public class JavadocPackageCheckTest
|
||||
extends BaseCheckTestSupport {
|
||||
@Override
|
||||
protected String getPath(String filename) throws IOException {
|
||||
return super.getPath("checks" + File.separator
|
||||
+ "javadoc" + File.separator + filename);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected DefaultConfiguration createCheckerConfig(
|
||||
Configuration config) {
|
||||
|
|
@ -49,8 +56,8 @@ public class JavadocPackageCheckTest
|
|||
};
|
||||
verify(
|
||||
createChecker(checkConfig),
|
||||
getPath("checks/javadoc/BadCls.java"),
|
||||
getPath("checks/javadoc/BadCls.java"),
|
||||
getPath("BadCls.java"),
|
||||
getPath("BadCls.java"),
|
||||
expected);
|
||||
}
|
||||
|
||||
|
|
@ -63,16 +70,16 @@ public class JavadocPackageCheckTest
|
|||
};
|
||||
verify(
|
||||
createChecker(checkConfig),
|
||||
getPath("checks/javadoc/BadCls.java"),
|
||||
getPath("checks/javadoc/BadCls.java"),
|
||||
getPath("BadCls.java"),
|
||||
getPath("BadCls.java"),
|
||||
expected);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testWithMultipleFiles() throws Exception {
|
||||
final Configuration checkConfig = createCheckConfig(JavadocPackageCheck.class);
|
||||
final String path1 = getPath("javadoc/InputNoJavadoc.java");
|
||||
final String path2 = getPath("javadoc/InputBadTag.java");
|
||||
final String path1 = getPath("InputNoJavadoc.java");
|
||||
final String path2 = getPath("InputBadTag.java");
|
||||
final String[] expected = {
|
||||
"0: " + getCheckMessage(MSG_PACKAGE_INFO),
|
||||
};
|
||||
|
|
@ -90,8 +97,8 @@ public class JavadocPackageCheckTest
|
|||
"0: " + getCheckMessage(MSG_LEGACY_PACKAGE_HTML),
|
||||
};
|
||||
verify(createChecker(checkConfig),
|
||||
getPath("javadoc/bothfiles/Ignored.java"),
|
||||
getPath("javadoc/bothfiles/Ignored.java"), expected);
|
||||
getPath("bothfiles" + File.separator + "Ignored.java"),
|
||||
getPath("bothfiles" + File.separator + "Ignored.java"), expected);
|
||||
}
|
||||
|
||||
@Test
|
||||
|
|
@ -101,8 +108,8 @@ public class JavadocPackageCheckTest
|
|||
"0: Missing package-info.java file.",
|
||||
};
|
||||
verify(createChecker(checkConfig),
|
||||
getPath("javadoc/pkghtml/Ignored.java"),
|
||||
getPath("javadoc/pkghtml/Ignored.java"), expected);
|
||||
getPath("pkghtml" + File.separator + "Ignored.java"),
|
||||
getPath("pkghtml" + File.separator + "Ignored.java"), expected);
|
||||
}
|
||||
|
||||
@Test
|
||||
|
|
@ -111,8 +118,8 @@ public class JavadocPackageCheckTest
|
|||
checkConfig.addAttribute("allowLegacy", "true");
|
||||
final String[] expected = ArrayUtils.EMPTY_STRING_ARRAY;
|
||||
verify(createChecker(checkConfig),
|
||||
getPath("javadoc/pkghtml/Ignored.java"),
|
||||
getPath("javadoc/pkghtml/package-info.java"), expected);
|
||||
getPath("pkghtml" + File.separator + "Ignored.java"),
|
||||
getPath("pkghtml" + File.separator + "package-info.java"), expected);
|
||||
}
|
||||
|
||||
@Test
|
||||
|
|
@ -120,7 +127,9 @@ public class JavadocPackageCheckTest
|
|||
final DefaultConfiguration checkConfig = createCheckConfig(JavadocPackageCheck.class);
|
||||
final String[] expected = ArrayUtils.EMPTY_STRING_ARRAY;
|
||||
verify(createChecker(checkConfig),
|
||||
getPath("javadoc/pkginfo/annotation/package-info.java"),
|
||||
getPath("javadoc/pkginfo/annotation/package-info.java"), expected);
|
||||
getPath("pkginfo" + File.separator + "annotation"
|
||||
+ File.separator + "package-info.java"),
|
||||
getPath("pkginfo" + File.separator + "annotation"
|
||||
+ File.separator + "package-info.java"), expected);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -25,6 +25,9 @@ import static com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocParagraphChe
|
|||
import static com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocParagraphCheck.MSG_TAG_AFTER;
|
||||
import static org.junit.Assert.assertArrayEquals;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
|
||||
import org.apache.commons.lang3.ArrayUtils;
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
|
|
@ -34,7 +37,6 @@ import com.puppycrawl.tools.checkstyle.DefaultConfiguration;
|
|||
import com.puppycrawl.tools.checkstyle.api.TokenTypes;
|
||||
|
||||
public class JavadocParagraphCheckTest extends BaseCheckTestSupport {
|
||||
|
||||
private DefaultConfiguration checkConfig;
|
||||
|
||||
@Before
|
||||
|
|
@ -42,6 +44,12 @@ public class JavadocParagraphCheckTest extends BaseCheckTestSupport {
|
|||
checkConfig = createCheckConfig(JavadocParagraphCheck.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String getPath(String filename) throws IOException {
|
||||
return super.getPath("checks" + File.separator
|
||||
+ "javadoc" + File.separator + filename);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testGetRequiredTokens() {
|
||||
JavadocParagraphCheck checkObj = new JavadocParagraphCheck();
|
||||
|
|
@ -53,7 +61,7 @@ public class JavadocParagraphCheckTest extends BaseCheckTestSupport {
|
|||
public void testCorrect() throws Exception {
|
||||
final String[] expected = ArrayUtils.EMPTY_STRING_ARRAY;
|
||||
|
||||
verify(checkConfig, getPath("javadoc/InputCorrectJavaDocParagraphCheck.java"), expected);
|
||||
verify(checkConfig, getPath("InputCorrectJavaDocParagraphCheck.java"), expected);
|
||||
}
|
||||
|
||||
@Test
|
||||
|
|
@ -96,7 +104,7 @@ public class JavadocParagraphCheckTest extends BaseCheckTestSupport {
|
|||
"81: " + getCheckMessage(MSG_TAG_AFTER),
|
||||
"82: " + getCheckMessage(MSG_TAG_AFTER),
|
||||
};
|
||||
verify(checkConfig, getPath("javadoc/InputIncorrectJavaDocParagraphCheck.java"), expected);
|
||||
verify(checkConfig, getPath("InputIncorrectJavaDocParagraphCheck.java"), expected);
|
||||
}
|
||||
|
||||
@Test
|
||||
|
|
@ -123,6 +131,6 @@ public class JavadocParagraphCheckTest extends BaseCheckTestSupport {
|
|||
"81: " + getCheckMessage(MSG_TAG_AFTER),
|
||||
"82: " + getCheckMessage(MSG_TAG_AFTER),
|
||||
};
|
||||
verify(checkConfig, getPath("javadoc/InputIncorrectJavaDocParagraphCheck.java"), expected);
|
||||
verify(checkConfig, getPath("InputIncorrectJavaDocParagraphCheck.java"), expected);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -28,6 +28,7 @@ import static com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocStyleCheck.U
|
|||
import static org.junit.Assert.assertArrayEquals;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
|
||||
import org.apache.commons.lang3.ArrayUtils;
|
||||
import org.junit.Test;
|
||||
|
|
@ -38,6 +39,11 @@ import com.puppycrawl.tools.checkstyle.api.TokenTypes;
|
|||
|
||||
public class JavadocStyleCheckTest
|
||||
extends BaseCheckTestSupport {
|
||||
@Override
|
||||
protected String getPath(String filename) throws IOException {
|
||||
return super.getPath("checks" + File.separator
|
||||
+ "javadoc" + File.separator + filename);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testGetRequiredTokens() {
|
||||
|
|
@ -335,11 +341,8 @@ public class JavadocStyleCheckTest
|
|||
"1: " + getCheckMessage(NO_PERIOD),
|
||||
};
|
||||
|
||||
String basePath = "javadoc" + File.separator
|
||||
+ "pkginfo" + File.separator + "invalidinherit" + File.separator;
|
||||
|
||||
verify(createChecker(checkConfig),
|
||||
getPath(basePath + "package-info.java"),
|
||||
getPath("pkginfo" + File.separator + "invalidinherit" + File.separator + "package-info.java"),
|
||||
expected);
|
||||
}
|
||||
|
||||
|
|
@ -351,11 +354,8 @@ public class JavadocStyleCheckTest
|
|||
"1: " + getCheckMessage(NO_PERIOD),
|
||||
};
|
||||
|
||||
String basePath = "javadoc" + File.separator
|
||||
+ "pkginfo" + File.separator + "invalidformat" + File.separator;
|
||||
|
||||
verify(createChecker(checkConfig),
|
||||
getPath(basePath + "package-info.java"),
|
||||
getPath("pkginfo" + File.separator + "invalidformat" + File.separator + "package-info.java"),
|
||||
expected);
|
||||
}
|
||||
|
||||
|
|
@ -365,11 +365,8 @@ public class JavadocStyleCheckTest
|
|||
createCheckConfig(JavadocStyleCheck.class);
|
||||
final String[] expected = ArrayUtils.EMPTY_STRING_ARRAY;
|
||||
|
||||
String basePath = "javadoc" + File.separator
|
||||
+ "pkginfo" + File.separator + "annotation" + File.separator;
|
||||
|
||||
verify(createChecker(checkConfig),
|
||||
getPath(basePath + "package-info.java"),
|
||||
getPath("pkginfo" + File.separator + "annotation" + File.separator + "package-info.java"),
|
||||
expected);
|
||||
}
|
||||
|
||||
|
|
@ -381,11 +378,8 @@ public class JavadocStyleCheckTest
|
|||
"1: " + getCheckMessage(JAVADOC_MISSING),
|
||||
};
|
||||
|
||||
String basePath = "javadoc" + File.separator
|
||||
+ "bothfiles" + File.separator;
|
||||
|
||||
verify(createChecker(checkConfig),
|
||||
getPath(basePath + "package-info.java"),
|
||||
getPath("bothfiles" + File.separator + "package-info.java"),
|
||||
expected);
|
||||
}
|
||||
|
||||
|
|
@ -395,11 +389,8 @@ public class JavadocStyleCheckTest
|
|||
createCheckConfig(JavadocStyleCheck.class);
|
||||
final String[] expected = ArrayUtils.EMPTY_STRING_ARRAY;
|
||||
|
||||
String basePath = "javadoc" + File.separator
|
||||
+ "pkginfo" + File.separator + "valid" + File.separator;
|
||||
|
||||
verify(createChecker(checkConfig),
|
||||
getPath(basePath + "package-info.java"),
|
||||
getPath("pkginfo" + File.separator + "valid" + File.separator + "package-info.java"),
|
||||
expected);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -22,6 +22,9 @@ package com.puppycrawl.tools.checkstyle.checks.javadoc;
|
|||
import static com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocTagContinuationIndentationCheck.MSG_KEY;
|
||||
import static org.junit.Assert.assertArrayEquals;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
|
||||
import org.apache.commons.lang3.ArrayUtils;
|
||||
import org.junit.Test;
|
||||
|
||||
|
|
@ -31,6 +34,11 @@ import com.puppycrawl.tools.checkstyle.api.TokenTypes;
|
|||
|
||||
public class JavadocTagContinuationIndentationCheckTest
|
||||
extends BaseCheckTestSupport {
|
||||
@Override
|
||||
protected String getPath(String filename) throws IOException {
|
||||
return super.getPath("checks" + File.separator
|
||||
+ "javadoc" + File.separator + filename);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testGetRequiredTokens() {
|
||||
|
|
@ -45,7 +53,7 @@ public class JavadocTagContinuationIndentationCheckTest
|
|||
final DefaultConfiguration checkConfig =
|
||||
createCheckConfig(JavadocTagContinuationIndentationCheck.class);
|
||||
final String[] expected = ArrayUtils.EMPTY_STRING_ARRAY;
|
||||
verify(checkConfig, getPath("javadoc/InputGuavaFalsePositive.java"), expected);
|
||||
verify(checkConfig, getPath("InputGuavaFalsePositive.java"), expected);
|
||||
}
|
||||
|
||||
@Test
|
||||
|
|
@ -66,7 +74,7 @@ public class JavadocTagContinuationIndentationCheckTest
|
|||
"310: " + getCheckMessage(MSG_KEY, 4),
|
||||
"322: " + getCheckMessage(MSG_KEY, 4),
|
||||
};
|
||||
verify(checkConfig, getPath("javadoc/InputJavaDocTagContinuationIndentation.java"),
|
||||
verify(checkConfig, getPath("InputJavaDocTagContinuationIndentation.java"),
|
||||
expected);
|
||||
}
|
||||
|
||||
|
|
@ -79,7 +87,7 @@ public class JavadocTagContinuationIndentationCheckTest
|
|||
"7: " + getCheckMessage(MSG_KEY, 3),
|
||||
"19: " + getCheckMessage(MSG_KEY, 3),
|
||||
};
|
||||
verify(checkConfig, getPath("javadoc/InputJavaDocTagContinuationIndentationOffset3.java"),
|
||||
verify(checkConfig, getPath("InputJavaDocTagContinuationIndentationOffset3.java"),
|
||||
expected);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -281,7 +281,8 @@ public class JavadocTypeCheckTest extends BaseCheckTestSupport {
|
|||
"111: " + getCheckMessage(JAVADOC_MISSING),
|
||||
};
|
||||
verify(checkConfig,
|
||||
getPath("javadoc" + File.separator + "InputNoJavadoc.java"),
|
||||
getPath("checks" + File.separator
|
||||
+ "javadoc" + File.separator + "InputNoJavadoc.java"),
|
||||
expected);
|
||||
}
|
||||
|
||||
|
|
@ -295,7 +296,8 @@ public class JavadocTypeCheckTest extends BaseCheckTestSupport {
|
|||
"15: " + getCheckMessage(JAVADOC_MISSING),
|
||||
};
|
||||
verify(checkConfig,
|
||||
getPath("javadoc" + File.separator + "InputNoJavadoc.java"),
|
||||
getPath("checks" + File.separator
|
||||
+ "javadoc" + File.separator + "InputNoJavadoc.java"),
|
||||
expected);
|
||||
}
|
||||
|
||||
|
|
@ -316,7 +318,8 @@ public class JavadocTypeCheckTest extends BaseCheckTestSupport {
|
|||
"111: " + getCheckMessage(JAVADOC_MISSING),
|
||||
};
|
||||
verify(checkConfig,
|
||||
getPath("javadoc" + File.separator + "InputNoJavadoc.java"),
|
||||
getPath("checks" + File.separator
|
||||
+ "javadoc" + File.separator + "InputNoJavadoc.java"),
|
||||
expected);
|
||||
}
|
||||
|
||||
|
|
@ -353,7 +356,8 @@ public class JavadocTypeCheckTest extends BaseCheckTestSupport {
|
|||
"5:4: " + getCheckMessage(UNKNOWN_TAG, "mytag"),
|
||||
};
|
||||
verify(checkConfig,
|
||||
getPath("javadoc" + File.separator + "InputBadTag.java"),
|
||||
getPath("checks" + File.separator
|
||||
+ "javadoc" + File.separator + "InputBadTag.java"),
|
||||
expected);
|
||||
}
|
||||
|
||||
|
|
@ -364,7 +368,8 @@ public class JavadocTypeCheckTest extends BaseCheckTestSupport {
|
|||
checkConfig.addAttribute("allowUnknownTags", "true");
|
||||
final String[] expected = ArrayUtils.EMPTY_STRING_ARRAY;
|
||||
verify(checkConfig,
|
||||
getPath("javadoc" + File.separator + "InputBadTag.java"),
|
||||
getPath("checks" + File.separator
|
||||
+ "javadoc" + File.separator + "InputBadTag.java"),
|
||||
expected);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -168,7 +168,8 @@ public class JavadocVariableCheckTest
|
|||
"113:9: " + getCheckMessage(JAVADOC_MISSING),
|
||||
};
|
||||
verify(checkConfig,
|
||||
getPath("javadoc" + File.separator + "InputNoJavadoc.java"),
|
||||
getPath("checks" + File.separator
|
||||
+ "javadoc" + File.separator + "InputNoJavadoc.java"),
|
||||
expected);
|
||||
}
|
||||
|
||||
|
|
@ -184,7 +185,8 @@ public class JavadocVariableCheckTest
|
|||
"17:9: " + getCheckMessage(JAVADOC_MISSING),
|
||||
};
|
||||
verify(checkConfig,
|
||||
getPath("javadoc" + File.separator + "InputNoJavadoc.java"),
|
||||
getPath("checks" + File.separator
|
||||
+ "javadoc" + File.separator + "InputNoJavadoc.java"),
|
||||
expected);
|
||||
}
|
||||
|
||||
|
|
@ -230,7 +232,8 @@ public class JavadocVariableCheckTest
|
|||
"113:9: " + getCheckMessage(JAVADOC_MISSING),
|
||||
};
|
||||
verify(checkConfig,
|
||||
getPath("javadoc" + File.separator + "InputNoJavadoc.java"),
|
||||
getPath("checks" + File.separator
|
||||
+ "javadoc" + File.separator + "InputNoJavadoc.java"),
|
||||
expected);
|
||||
}
|
||||
|
||||
|
|
@ -279,7 +282,8 @@ public class JavadocVariableCheckTest
|
|||
"103:9: " + getCheckMessage(JAVADOC_MISSING),
|
||||
};
|
||||
verify(checkConfig,
|
||||
getPath("javadoc" + File.separator + "InputNoJavadoc.java"),
|
||||
getPath("checks" + File.separator
|
||||
+ "javadoc" + File.separator + "InputNoJavadoc.java"),
|
||||
expected);
|
||||
}
|
||||
|
||||
|
|
@ -329,7 +333,8 @@ public class JavadocVariableCheckTest
|
|||
"113:9: " + getCheckMessage(JAVADOC_MISSING),
|
||||
};
|
||||
verify(checkConfig,
|
||||
getPath("javadoc" + File.separator + "InputNoJavadoc.java"),
|
||||
getPath("checks" + File.separator
|
||||
+ "javadoc" + File.separator + "InputNoJavadoc.java"),
|
||||
expected);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -22,6 +22,9 @@ package com.puppycrawl.tools.checkstyle.checks.javadoc;
|
|||
import static com.puppycrawl.tools.checkstyle.checks.javadoc.NonEmptyAtclauseDescriptionCheck.MSG_KEY;
|
||||
import static org.junit.Assert.assertArrayEquals;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
import com.puppycrawl.tools.checkstyle.BaseCheckTestSupport;
|
||||
|
|
@ -30,6 +33,11 @@ import com.puppycrawl.tools.checkstyle.api.TokenTypes;
|
|||
|
||||
public class NonEmptyAtclauseDescriptionCheckTest
|
||||
extends BaseCheckTestSupport {
|
||||
@Override
|
||||
protected String getPath(String filename) throws IOException {
|
||||
return super.getPath("checks" + File.separator
|
||||
+ "javadoc" + File.separator + filename);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testGetAcceptableTokens() {
|
||||
|
|
@ -77,6 +85,6 @@ public class NonEmptyAtclauseDescriptionCheckTest
|
|||
"92: " + getCheckMessage(MSG_KEY),
|
||||
"93: " + getCheckMessage(MSG_KEY),
|
||||
};
|
||||
verify(checkConfig, getPath("javadoc/InputNonEmptyAtclauseDescriptionCheck.java"), expected);
|
||||
verify(checkConfig, getPath("InputNonEmptyAtclauseDescriptionCheck.java"), expected);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -22,6 +22,9 @@ package com.puppycrawl.tools.checkstyle.checks.javadoc;
|
|||
import static com.puppycrawl.tools.checkstyle.checks.javadoc.SingleLineJavadocCheck.MSG_KEY;
|
||||
import static org.junit.Assert.assertArrayEquals;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
import com.puppycrawl.tools.checkstyle.BaseCheckTestSupport;
|
||||
|
|
@ -29,6 +32,11 @@ import com.puppycrawl.tools.checkstyle.DefaultConfiguration;
|
|||
import com.puppycrawl.tools.checkstyle.api.TokenTypes;
|
||||
|
||||
public class SingleLineJavadocCheckTest extends BaseCheckTestSupport {
|
||||
@Override
|
||||
protected String getPath(String filename) throws IOException {
|
||||
return super.getPath("checks" + File.separator
|
||||
+ "javadoc" + File.separator + filename);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testAcceptableTokens() {
|
||||
|
|
@ -55,7 +63,7 @@ public class SingleLineJavadocCheckTest extends BaseCheckTestSupport {
|
|||
"43: " + getCheckMessage(MSG_KEY),
|
||||
"49: " + getCheckMessage(MSG_KEY),
|
||||
};
|
||||
verify(checkConfig, getPath("javadoc/InputSingleLineJavadocCheck.java"), expected);
|
||||
verify(checkConfig, getPath("InputSingleLineJavadocCheck.java"), expected);
|
||||
}
|
||||
|
||||
@Test
|
||||
|
|
@ -74,6 +82,6 @@ public class SingleLineJavadocCheckTest extends BaseCheckTestSupport {
|
|||
"46: " + getCheckMessage(MSG_KEY),
|
||||
"49: " + getCheckMessage(MSG_KEY),
|
||||
};
|
||||
verify(checkConfig, getPath("javadoc/InputSingleLineJavadocCheck.java"), expected);
|
||||
verify(checkConfig, getPath("InputSingleLineJavadocCheck.java"), expected);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -23,6 +23,9 @@ import static com.puppycrawl.tools.checkstyle.checks.javadoc.SummaryJavadocCheck
|
|||
import static com.puppycrawl.tools.checkstyle.checks.javadoc.SummaryJavadocCheck.SUMMARY_JAVADOC;
|
||||
import static org.junit.Assert.assertArrayEquals;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
|
||||
import org.apache.commons.lang3.ArrayUtils;
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
|
|
@ -39,6 +42,12 @@ public class SummaryJavadocCheckTest extends BaseCheckTestSupport {
|
|||
checkConfig = createCheckConfig(SummaryJavadocCheck.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String getPath(String filename) throws IOException {
|
||||
return super.getPath("checks" + File.separator
|
||||
+ "javadoc" + File.separator + filename);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testGetRequiredTokens() {
|
||||
SummaryJavadocCheck checkObj = new SummaryJavadocCheck();
|
||||
|
|
@ -52,7 +61,7 @@ public class SummaryJavadocCheckTest extends BaseCheckTestSupport {
|
|||
"^@return the *|^This method returns *|^A [{]@code [a-zA-Z0-9]+[}]( is a )");
|
||||
final String[] expected = ArrayUtils.EMPTY_STRING_ARRAY;
|
||||
|
||||
verify(checkConfig, getPath("javadoc/InputCorrectSummaryJavaDocCheck.java"), expected);
|
||||
verify(checkConfig, getPath("InputCorrectSummaryJavaDocCheck.java"), expected);
|
||||
}
|
||||
|
||||
@Test
|
||||
|
|
@ -68,7 +77,7 @@ public class SummaryJavadocCheckTest extends BaseCheckTestSupport {
|
|||
"83: " + getCheckMessage(SUMMARY_JAVADOC),
|
||||
"103: " + getCheckMessage(SUMMARY_FIRST_SENTENCE),
|
||||
};
|
||||
verify(checkConfig, getPath("javadoc/InputIncorrectSummaryJavaDocCheck.java"), expected);
|
||||
verify(checkConfig, getPath("InputIncorrectSummaryJavaDocCheck.java"), expected);
|
||||
}
|
||||
|
||||
@Test
|
||||
|
|
@ -79,7 +88,7 @@ public class SummaryJavadocCheckTest extends BaseCheckTestSupport {
|
|||
"10: " + getCheckMessage(SUMMARY_FIRST_SENTENCE),
|
||||
};
|
||||
|
||||
verify(checkConfig, getPath("javadoc/InputSummaryJavadocCheckPeriod.java"), expected);
|
||||
verify(checkConfig, getPath("InputSummaryJavadocCheckPeriod.java"), expected);
|
||||
}
|
||||
|
||||
@Test
|
||||
|
|
@ -87,7 +96,7 @@ public class SummaryJavadocCheckTest extends BaseCheckTestSupport {
|
|||
checkConfig.addAttribute("period", "");
|
||||
final String[] expected = ArrayUtils.EMPTY_STRING_ARRAY;
|
||||
|
||||
verify(checkConfig, getPath("javadoc/InputSummaryJavadocCheckNoPeriod.java"), expected);
|
||||
verify(checkConfig, getPath("InputSummaryJavadocCheckNoPeriod.java"), expected);
|
||||
}
|
||||
|
||||
@Test
|
||||
|
|
@ -100,6 +109,6 @@ public class SummaryJavadocCheckTest extends BaseCheckTestSupport {
|
|||
};
|
||||
|
||||
createChecker(checkConfig);
|
||||
verify(checkConfig, getPath("javadoc/InputIncorrectSummaryJavaDocCheck.java"), expected);
|
||||
verify(checkConfig, getPath("InputIncorrectSummaryJavaDocCheck.java"), expected);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -27,6 +27,7 @@ import static org.junit.Assert.assertTrue;
|
|||
|
||||
import java.io.ByteArrayInputStream;
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStreamReader;
|
||||
import java.io.LineNumberReader;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
|
|
@ -54,6 +55,12 @@ public class WriteTagCheckTest extends BaseCheckTestSupport {
|
|||
checkConfig = createCheckConfig(WriteTagCheck.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String getPath(String filename) throws IOException {
|
||||
return super.getPath("checks" + File.separator
|
||||
+ "javadoc" + File.separator + filename);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testDefaultSettings() throws Exception {
|
||||
final String[] expected = ArrayUtils.EMPTY_STRING_ARRAY;
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@
|
|||
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
package com.puppycrawl.tools.checkstyle.checks.javadoc;
|
||||
package com.puppycrawl.tools.checkstyle.grammars.javadoc;
|
||||
|
||||
import java.io.ByteArrayInputStream;
|
||||
import java.io.File;
|
||||
|
|
@ -36,12 +36,8 @@ import org.junit.Test;
|
|||
|
||||
import com.google.common.base.Charsets;
|
||||
import com.google.common.io.Files;
|
||||
import com.puppycrawl.tools.checkstyle.grammars.javadoc.JavadocLexer;
|
||||
import com.puppycrawl.tools.checkstyle.grammars.javadoc.JavadocParser;
|
||||
|
||||
public class JavadocParseTreeTest {
|
||||
private final File folderWithInputFiles = new File(
|
||||
"src/test/resources/com/puppycrawl/tools/checkstyle/grammars/javadoc");
|
||||
private JavadocParser parser;
|
||||
private final BaseErrorListener errorListener = new FailOnErrorListener();
|
||||
|
||||
|
|
@ -69,10 +65,23 @@ public class JavadocParseTreeTest {
|
|||
return Files.toString(filename, Charsets.UTF_8);
|
||||
}
|
||||
|
||||
private static String getPath(String filename) throws IOException {
|
||||
return new File(
|
||||
"src/test/resources/com/puppycrawl/tools/checkstyle/grammars/javadoc/" + filename).getCanonicalPath();
|
||||
}
|
||||
|
||||
private static String getHtmlPath(String filename) throws IOException {
|
||||
return getPath("htmlTags" + File.separator + filename);
|
||||
}
|
||||
|
||||
private static String getDocPath(String filename) throws IOException {
|
||||
return getPath("javadocTags" + File.separator + filename);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void oneSimpleHtmlTag()
|
||||
throws IOException {
|
||||
String filename = folderWithInputFiles + "/htmlTags/OneSimpleHtmlTag.txt";
|
||||
String filename = getHtmlPath("OneSimpleHtmlTag.txt");
|
||||
ParseTree generatedTree = parseJavadoc(getFileContent(new File(filename)));
|
||||
ParseTree expectedTree = ParseTreeBuilder.treeOneSimpleHtmlTag();
|
||||
compareTrees(expectedTree, generatedTree);
|
||||
|
|
@ -81,7 +90,7 @@ public class JavadocParseTreeTest {
|
|||
@Test
|
||||
public void textBeforeJavadocTags()
|
||||
throws IOException {
|
||||
String filename = folderWithInputFiles + "/javadocTags/TextBeforeJavadocTags.txt";
|
||||
String filename = getDocPath("TextBeforeJavadocTags.txt");
|
||||
ParseTree generatedTree = parseJavadoc(getFileContent(new File(filename)));
|
||||
ParseTree expectedTree = ParseTreeBuilder.treeTextBeforeJavadocTags();
|
||||
compareTrees(expectedTree, generatedTree);
|
||||
|
|
@ -90,7 +99,7 @@ public class JavadocParseTreeTest {
|
|||
@Test
|
||||
public void customJavadocTags()
|
||||
throws IOException {
|
||||
String filename = folderWithInputFiles + "/javadocTags/CustomJavadocTags.txt";
|
||||
String filename = getDocPath("CustomJavadocTags.txt");
|
||||
ParseTree generatedTree = parseJavadoc(getFileContent(new File(filename)));
|
||||
ParseTree expectedTree = ParseTreeBuilder.treeCustomJavadocTags();
|
||||
compareTrees(expectedTree, generatedTree);
|
||||
|
|
@ -99,7 +108,7 @@ public class JavadocParseTreeTest {
|
|||
@Test
|
||||
public void javadocTagDescriptionWithInlineTags()
|
||||
throws IOException {
|
||||
String filename = folderWithInputFiles + "/javadocTags/JavadocTagDescriptionWithInlineTags.txt";
|
||||
String filename = getDocPath("JavadocTagDescriptionWithInlineTags.txt");
|
||||
ParseTree generatedTree = parseJavadoc(getFileContent(new File(filename)));
|
||||
ParseTree expectedTree = ParseTreeBuilder.treeJavadocTagDescriptionWithInlineTags();
|
||||
compareTrees(expectedTree, generatedTree);
|
||||
|
|
@ -108,7 +117,7 @@ public class JavadocParseTreeTest {
|
|||
@Test
|
||||
public void leadingAsterisks()
|
||||
throws IOException {
|
||||
String filename = folderWithInputFiles + "/LeadingAsterisks.txt";
|
||||
String filename = getPath("LeadingAsterisks.txt");
|
||||
ParseTree generatedTree = parseJavadoc(getFileContent(new File(filename)));
|
||||
ParseTree expectedTree = ParseTreeBuilder.treeLeadingAsterisks();
|
||||
compareTrees(expectedTree, generatedTree);
|
||||
|
|
@ -117,7 +126,7 @@ public class JavadocParseTreeTest {
|
|||
@Test
|
||||
public void authorWithMailto()
|
||||
throws IOException {
|
||||
String filename = folderWithInputFiles + "/javadocTags/AuthorWithMailto.txt";
|
||||
String filename = getDocPath("AuthorWithMailto.txt");
|
||||
ParseTree generatedTree = parseJavadoc(getFileContent(new File(filename)));
|
||||
ParseTree expectedTree = ParseTreeBuilder.treeAuthorWithMailto();
|
||||
compareTrees(expectedTree, generatedTree);
|
||||
|
|
@ -126,7 +135,7 @@ public class JavadocParseTreeTest {
|
|||
@Test
|
||||
public void htmlTagsInParagraph()
|
||||
throws IOException {
|
||||
String filename = folderWithInputFiles + "/htmlTags/HtmlTagsInParagraph.txt";
|
||||
String filename = getHtmlPath("HtmlTagsInParagraph.txt");
|
||||
ParseTree generatedTree = parseJavadoc(getFileContent(new File(filename)));
|
||||
ParseTree expectedTree = ParseTreeBuilder.treeHtmlTagsInParagraph();
|
||||
compareTrees(expectedTree, generatedTree);
|
||||
|
|
@ -135,7 +144,7 @@ public class JavadocParseTreeTest {
|
|||
@Test
|
||||
public void linkInlineTags()
|
||||
throws IOException {
|
||||
String filename = folderWithInputFiles + "/javadocTags/LinkInlineTags.txt";
|
||||
String filename = getDocPath("LinkInlineTags.txt");
|
||||
ParseTree generatedTree = parseJavadoc(getFileContent(new File(filename)));
|
||||
ParseTree expectedTree = ParseTreeBuilder.treeLinkInlineTags();
|
||||
compareTrees(expectedTree, generatedTree);
|
||||
|
|
@ -144,7 +153,7 @@ public class JavadocParseTreeTest {
|
|||
@Test
|
||||
public void seeReferenceWithFewNestedClasses()
|
||||
throws IOException {
|
||||
String filename = folderWithInputFiles + "/javadocTags/SeeReferenceWithFewNestedClasses.txt";
|
||||
String filename = getDocPath("SeeReferenceWithFewNestedClasses.txt");
|
||||
ParseTree generatedTree = parseJavadoc(getFileContent(new File(filename)));
|
||||
ParseTree expectedTree = ParseTreeBuilder.treeSeeReferenceWithFewNestedClasses();
|
||||
compareTrees(expectedTree, generatedTree);
|
||||
|
|
@ -153,7 +162,7 @@ public class JavadocParseTreeTest {
|
|||
@Test
|
||||
public void paramWithGeneric()
|
||||
throws IOException {
|
||||
String filename = folderWithInputFiles + "/javadocTags/ParamWithGeneric.txt";
|
||||
String filename = getDocPath("ParamWithGeneric.txt");
|
||||
ParseTree generatedTree = parseJavadoc(getFileContent(new File(filename)));
|
||||
ParseTree expectedTree = ParseTreeBuilder.treeParamWithGeneric();
|
||||
compareTrees(expectedTree, generatedTree);
|
||||
|
|
@ -162,7 +171,7 @@ public class JavadocParseTreeTest {
|
|||
@Test
|
||||
public void serial()
|
||||
throws IOException {
|
||||
String filename = folderWithInputFiles + "/javadocTags/Serial.txt";
|
||||
String filename = getDocPath("Serial.txt");
|
||||
ParseTree generatedTree = parseJavadoc(getFileContent(new File(filename)));
|
||||
ParseTree expectedTree = ParseTreeBuilder.treeSerial();
|
||||
compareTrees(expectedTree, generatedTree);
|
||||
|
|
@ -171,7 +180,7 @@ public class JavadocParseTreeTest {
|
|||
@Test
|
||||
public void since()
|
||||
throws IOException {
|
||||
String filename = folderWithInputFiles + "/javadocTags/Since.txt";
|
||||
String filename = getDocPath("Since.txt");
|
||||
ParseTree generatedTree = parseJavadoc(getFileContent(new File(filename)));
|
||||
ParseTree expectedTree = ParseTreeBuilder.treeSince();
|
||||
compareTrees(expectedTree, generatedTree);
|
||||
|
|
@ -180,7 +189,7 @@ public class JavadocParseTreeTest {
|
|||
@Test
|
||||
public void unclosedAndClosedParagraphs()
|
||||
throws IOException {
|
||||
String filename = folderWithInputFiles + "/htmlTags/UnclosedAndClosedParagraphs.txt";
|
||||
String filename = getHtmlPath("UnclosedAndClosedParagraphs.txt");
|
||||
ParseTree generatedTree = parseJavadoc(getFileContent(new File(filename)));
|
||||
ParseTree expectedTree = ParseTreeBuilder.treeUnclosedAndClosedParagraphs();
|
||||
compareTrees(expectedTree, generatedTree);
|
||||
|
|
@ -189,7 +198,7 @@ public class JavadocParseTreeTest {
|
|||
@Test
|
||||
public void listWithUnclosedItemInUnclosedParagraph()
|
||||
throws IOException {
|
||||
String filename = folderWithInputFiles + "/htmlTags/ListWithUnclosedItemInUnclosedParagraph.txt";
|
||||
String filename = getHtmlPath("ListWithUnclosedItemInUnclosedParagraph.txt");
|
||||
ParseTree generatedTree = parseJavadoc(getFileContent(new File(filename)));
|
||||
ParseTree expectedTree = ParseTreeBuilder.treeListWithUnclosedItemInUnclosedParagraph();
|
||||
compareTrees(expectedTree, generatedTree);
|
||||
|
|
@ -198,7 +207,7 @@ public class JavadocParseTreeTest {
|
|||
@Test
|
||||
public void unclosedParagraphFollowedByJavadocTag()
|
||||
throws IOException {
|
||||
String filename = folderWithInputFiles + "/htmlTags/UnclosedParagraphFollowedByJavadocTag.txt";
|
||||
String filename = getHtmlPath("UnclosedParagraphFollowedByJavadocTag.txt");
|
||||
ParseTree generatedTree = parseJavadoc(getFileContent(new File(filename)));
|
||||
ParseTree expectedTree = ParseTreeBuilder.treeUnclosedParagraphFollowedByJavadocTag();
|
||||
compareTrees(expectedTree, generatedTree);
|
||||
|
|
@ -207,7 +216,7 @@ public class JavadocParseTreeTest {
|
|||
@Test
|
||||
public void allJavadocInlineTags()
|
||||
throws IOException {
|
||||
String filename = folderWithInputFiles + "/javadocTags/AllJavadocInlineTags.txt";
|
||||
String filename = getDocPath("AllJavadocInlineTags.txt");
|
||||
ParseTree generatedTree = parseJavadoc(getFileContent(new File(filename)));
|
||||
ParseTree expectedTree = ParseTreeBuilder.treeAllJavadocInlineTags();
|
||||
compareTrees(expectedTree, generatedTree);
|
||||
|
|
@ -216,7 +225,7 @@ public class JavadocParseTreeTest {
|
|||
@Test
|
||||
public void docRootInheritDoc()
|
||||
throws IOException {
|
||||
String filename = folderWithInputFiles + "/javadocTags/DocRootInheritDoc.txt";
|
||||
String filename = getDocPath("DocRootInheritDoc.txt");
|
||||
ParseTree generatedTree = parseJavadoc(getFileContent(new File(filename)));
|
||||
ParseTree expectedTree = ParseTreeBuilder.treeDocRootInheritDoc();
|
||||
compareTrees(expectedTree, generatedTree);
|
||||
|
|
@ -225,7 +234,7 @@ public class JavadocParseTreeTest {
|
|||
@Test
|
||||
public void fewWhiteSpacesAsSeparator()
|
||||
throws IOException {
|
||||
String filename = folderWithInputFiles + "/javadocTags/FewWhiteSpacesAsSeparator.txt";
|
||||
String filename = getDocPath("FewWhiteSpacesAsSeparator.txt");
|
||||
ParseTree generatedTree = parseJavadoc(getFileContent(new File(filename)));
|
||||
ParseTree expectedTree = ParseTreeBuilder.treeFewWhiteSpacesAsSeparator();
|
||||
compareTrees(expectedTree, generatedTree);
|
||||
|
|
@ -234,7 +243,7 @@ public class JavadocParseTreeTest {
|
|||
@Test
|
||||
public void mixedCaseOfHtmlTags()
|
||||
throws IOException {
|
||||
String filename = folderWithInputFiles + "/htmlTags/MixedCaseOfHtmlTags.txt";
|
||||
String filename = getHtmlPath("MixedCaseOfHtmlTags.txt");
|
||||
ParseTree generatedTree = parseJavadoc(getFileContent(new File(filename)));
|
||||
ParseTree expectedTree = ParseTreeBuilder.treeMixedCaseOfHtmlTags();
|
||||
compareTrees(expectedTree, generatedTree);
|
||||
|
|
@ -243,7 +252,7 @@ public class JavadocParseTreeTest {
|
|||
@Test
|
||||
public void htmlComments()
|
||||
throws IOException {
|
||||
String filename = folderWithInputFiles + "/htmlTags/Comments.txt";
|
||||
String filename = getHtmlPath("Comments.txt");
|
||||
ParseTree generatedTree = parseJavadoc(getFileContent(new File(filename)));
|
||||
ParseTree expectedTree = ParseTreeBuilder.treeComments();
|
||||
compareTrees(expectedTree, generatedTree);
|
||||
|
|
@ -252,7 +261,7 @@ public class JavadocParseTreeTest {
|
|||
@Test
|
||||
public void negativeNumberInAttribute()
|
||||
throws IOException {
|
||||
String filename = folderWithInputFiles + "/htmlTags/NegativeNumberInAttribute.txt";
|
||||
String filename = getHtmlPath("NegativeNumberInAttribute.txt");
|
||||
ParseTree generatedTree = parseJavadoc(getFileContent(new File(filename)));
|
||||
ParseTree expectedTree = ParseTreeBuilder.treeNegativeNumberInAttribute();
|
||||
compareTrees(expectedTree, generatedTree);
|
||||
|
|
@ -261,7 +270,7 @@ public class JavadocParseTreeTest {
|
|||
@Test
|
||||
public void dollarInLink()
|
||||
throws IOException {
|
||||
String filename = folderWithInputFiles + "/javadocTags/DollarInLink.txt";
|
||||
String filename = getDocPath("DollarInLink.txt");
|
||||
ParseTree generatedTree = parseJavadoc(getFileContent(new File(filename)));
|
||||
ParseTree expectedTree = ParseTreeBuilder.treeDollarInLink();
|
||||
compareTrees(expectedTree, generatedTree);
|
||||
|
|
@ -17,7 +17,7 @@
|
|||
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
package com.puppycrawl.tools.checkstyle.checks.javadoc;
|
||||
package com.puppycrawl.tools.checkstyle.grammars.javadoc;
|
||||
|
||||
import org.antlr.v4.runtime.CommonToken;
|
||||
import org.antlr.v4.runtime.tree.ParseTree;
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package com.puppycrawl.tools.checkstyle.javadoc;
|
||||
package com.puppycrawl.tools.checkstyle.checks.javadoc;
|
||||
|
||||
/**
|
||||
* The following is a bad tag.
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package com.puppycrawl.tools.checkstyle.javadoc;
|
||||
package com.puppycrawl.tools.checkstyle.checks.javadoc;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package com.puppycrawl.tools.checkstyle.javadoc;
|
||||
package com.puppycrawl.tools.checkstyle.checks.javadoc;
|
||||
|
||||
/**
|
||||
* Some Javadoc.
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package com.puppycrawl.tools.checkstyle.javadoc;
|
||||
package com.puppycrawl.tools.checkstyle.checks.javadoc;
|
||||
|
||||
/**
|
||||
* Some Javadoc A {@code Foo} is a simple Javadoc.
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package com.puppycrawl.tools.checkstyle.javadoc;
|
||||
package com.puppycrawl.tools.checkstyle.checks.javadoc;
|
||||
|
||||
public class InputCustomTag {
|
||||
/**
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package com.puppycrawl.tools.checkstyle.javadoc;
|
||||
package com.puppycrawl.tools.checkstyle.checks.javadoc;
|
||||
|
||||
import com.google.common.base.Function;
|
||||
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package com.puppycrawl.tools.checkstyle.javadoc;
|
||||
package com.puppycrawl.tools.checkstyle.checks.javadoc;
|
||||
/** Javadoc for import */
|
||||
import java.io.Serializable;
|
||||
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package com.puppycrawl.tools.checkstyle.javadoc;
|
||||
package com.puppycrawl.tools.checkstyle.checks.javadoc;
|
||||
|
||||
|
||||
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package com.puppycrawl.tools.checkstyle.javadoc;
|
||||
package com.puppycrawl.tools.checkstyle.checks.javadoc;
|
||||
|
||||
/**
|
||||
* A {@code Foo. Foo}
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package com.puppycrawl.tools.checkstyle.javadoc;
|
||||
package com.puppycrawl.tools.checkstyle.checks.javadoc;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
|
|
@ -14,7 +14,7 @@ import java.io.Serializable;
|
|||
* @author max
|
||||
* Some javadoc.
|
||||
*/
|
||||
class JavaDocTagContinuationIndentation implements Serializable
|
||||
class InputJavaDocTagContinuationIndentation implements Serializable
|
||||
{
|
||||
/**
|
||||
* The client's first name.
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package com.puppycrawl.tools.checkstyle.javadoc;
|
||||
package com.puppycrawl.tools.checkstyle.checks.javadoc;
|
||||
|
||||
/**
|
||||
* Some javadoc.
|
||||
|
|
@ -3,7 +3,7 @@
|
|||
// Created: 2003
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
package com.puppycrawl.tools.checkstyle;
|
||||
package com.puppycrawl.tools.checkstyle.checks.javadoc;
|
||||
|
||||
/**
|
||||
* Test input for the JavadocStyleCheck. This check is used to perform
|
||||
|
|
@ -3,7 +3,7 @@
|
|||
// Created: 2014
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
package com.puppycrawl.tools.checkstyle;
|
||||
package com.puppycrawl.tools.checkstyle.checks.javadoc;
|
||||
|
||||
/**
|
||||
* Test input for the JavadocStyleCheck. This check is used to perform
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package com.puppycrawl.tools.checkstyle.javadoc;
|
||||
package com.puppycrawl.tools.checkstyle.checks.javadoc;
|
||||
|
||||
public class InputLoadErrors
|
||||
{
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package com.puppycrawl.tools.checkstyle.javadoc;
|
||||
package com.puppycrawl.tools.checkstyle.checks.javadoc;
|
||||
|
||||
public class InputNoJavadoc //comment test
|
||||
{
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package com.puppycrawl.tools.checkstyle.javadoc;
|
||||
package com.puppycrawl.tools.checkstyle.checks.javadoc;
|
||||
class InputNonEmptyAtclauseDescriptionCheck
|
||||
{
|
||||
/**
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package com.puppycrawl.tools.checkstyle.javadoc;
|
||||
package com.puppycrawl.tools.checkstyle.checks.javadoc;
|
||||
|
||||
/**
|
||||
* <unclosedTag>
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package com.puppycrawl.tools.checkstyle.javadoc;
|
||||
package com.puppycrawl.tools.checkstyle.checks.javadoc;
|
||||
class Foo{
|
||||
|
||||
/** As of JDK 1.1, replaced by {@link #setBounds(int,int,int,int)} */
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package com.puppycrawl.tools.checkstyle.javadoc;
|
||||
package com.puppycrawl.tools.checkstyle.checks.javadoc;
|
||||
|
||||
public class InputSummaryJavadocCheckNoPeriod
|
||||
{
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package com.puppycrawl.tools.checkstyle.javadoc;
|
||||
package com.puppycrawl.tools.checkstyle.checks.javadoc;
|
||||
|
||||
public class InputSummaryJavadocCheckPeriod
|
||||
{
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
package com.puppycrawl.tools.checkstyle.checks.javadoc;
|
||||
|
||||
/** <ul><li>a' {@link EntityEntry} (by way of {@link #;}</li></ul> */
|
||||
class InputTestNumberFormatException{}
|
||||
|
|
@ -3,7 +3,7 @@
|
|||
// Created: 2004
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
package com.puppycrawl.tools.checkstyle;
|
||||
package com.puppycrawl.tools.checkstyle.checks.javadoc;
|
||||
|
||||
/**
|
||||
* Testing tag writing
|
||||
|
|
@ -3,7 +3,7 @@
|
|||
// Created: 2004
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
package com.puppycrawl.tools.checkstyle;
|
||||
package com.puppycrawl.tools.checkstyle.checks.javadoc;
|
||||
|
||||
/**
|
||||
* @incomplete This enum needs more code...
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
package com.puppycrawl.tools.checkstyle.checks.javadoc.bothfiles;
|
||||
|
||||
class Ignored
|
||||
{
|
||||
}
|
||||
|
|
@ -0,0 +1 @@
|
|||
package com.puppycrawl.tools.checkstyle.checks.javadoc.bothfiles;
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
package com.puppycrawl.tools.checkstyle.checks.javadoc.pkghtml;
|
||||
|
||||
class Ignored
|
||||
{
|
||||
}
|
||||
|
|
@ -9,4 +9,4 @@
|
|||
* </p>
|
||||
*/
|
||||
@Deprecated
|
||||
package com.puppycrawl.tools.checkstyle.javadoc.pkginfo.annotation;
|
||||
package com.puppycrawl.tools.checkstyle.checks.javadoc.pkginfo.annotation;
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
/**
|
||||
* blah blah
|
||||
*/
|
||||
package com.puppycrawl.tools.checkstyle.checks.javadoc.pkginfo.invalidformat;
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
/**
|
||||
* {@inheritDoc} Where are we inheriting from
|
||||
*/
|
||||
package com.puppycrawl.tools.checkstyle.checks.javadoc.pkginfo.invalidinherit;
|
||||
|
|
@ -8,4 +8,4 @@
|
|||
* with a legacy non-closed br element
|
||||
* </p>
|
||||
*/
|
||||
package com.puppycrawl.tools.checkstyle.javadoc.pkginfo.valid;
|
||||
package com.puppycrawl.tools.checkstyle.checks.javadoc.pkginfo.valid;
|
||||
|
|
@ -1,4 +0,0 @@
|
|||
package com.puppycrawl.tools.checkstyle.javadoc;
|
||||
|
||||
/** <ul><li>a' {@link EntityEntry} (by way of {@link #;}</li></ul> */
|
||||
class InputTestNumberFormatException{}
|
||||
|
|
@ -1,5 +0,0 @@
|
|||
package com.puppycrawl.tools.checkstyle.javadoc.bothfiles;
|
||||
|
||||
class Ignored
|
||||
{
|
||||
}
|
||||
|
|
@ -1 +0,0 @@
|
|||
package com.puppycrawl.tools.checkstyle.javadoc.bothfiles;
|
||||
|
|
@ -1,5 +0,0 @@
|
|||
package com.puppycrawl.tools.checkstyle.javadoc.pkghtml;
|
||||
|
||||
class Ignored
|
||||
{
|
||||
}
|
||||
|
|
@ -1,4 +0,0 @@
|
|||
/**
|
||||
* blah blah
|
||||
*/
|
||||
package com.puppycrawl.tools.checkstyle.javadoc.pkginfo.invalidformat;
|
||||
|
|
@ -1,4 +0,0 @@
|
|||
/**
|
||||
* {@inheritDoc} Where are we inheriting from
|
||||
*/
|
||||
package com.puppycrawl.tools.checkstyle.javadoc.pkginfo.invalidinherit;
|
||||
Loading…
Reference in New Issue