use of com.thoughtworks.qdox.model.JavaClass in project maven-plugins by apache.
the class AbstractFixJavadocMojoTest method testReplaceLinkTags_containingHash.
public void testReplaceLinkTags_containingHash() throws Throwable {
String comment = "/** {@link ConnectException#getMessage()} */";
String source = "import java.net.ConnectException;\n" + comment + "\n" + "public class ContainingHashes {}";
JavaClass clazz = getJavaSource(source).getClassByName("ContainingHashes");
String newComment = AbstractFixJavadocMojo.replaceLinkTags(comment, clazz);
assertEquals("/** {@link java.net.ConnectException#getMessage()} */", newComment);
}
use of com.thoughtworks.qdox.model.JavaClass in project maven-plugins by apache.
the class AbstractFixJavadocMojoTest method testReplaceLinkTags_spacesAfterClassName.
public void testReplaceLinkTags_spacesAfterClassName() throws Throwable {
String comment = "/** {@link ConnectException } */";
String source = "import java.net.ConnectException;\n" + comment + "\n" + "public class SpacesAfterClassName {}";
JavaClass clazz = getJavaSource(source).getClassByName("SpacesAfterClassName");
String newComment = AbstractFixJavadocMojo.replaceLinkTags(comment, clazz);
assertEquals("/** {@link java.net.ConnectException} */", newComment);
}
use of com.thoughtworks.qdox.model.JavaClass in project maven-plugins by apache.
the class AbstractFixJavadocMojoTest method testReplaceLinkTags_noLinkTag.
public void testReplaceLinkTags_noLinkTag() throws Throwable {
String comment = "/** @see ConnectException */";
String source = "import java.net.ConnectException;\n" + comment + "\n" + "public class NoLinkTag {}";
JavaClass clazz = getJavaSource(source).getClassByName("NoLinkTag");
String newComment = AbstractFixJavadocMojo.replaceLinkTags(comment, clazz);
assertEquals("/** @see ConnectException */", newComment);
}
use of com.thoughtworks.qdox.model.JavaClass in project maven-plugins by apache.
the class AbstractFixJavadocMojoTest method testReplaceLinkTags_spacesAfterLinkTag.
public void testReplaceLinkTags_spacesAfterLinkTag() throws Throwable {
String comment = "/** {@link ConnectException} */";
String source = "import java.net.ConnectException;\n" + comment + "\n" + "public class SpacesAfterLinkTag {}";
JavaClass clazz = getJavaSource(source).getClassByName("SpacesAfterLinkTag");
String newComment = AbstractFixJavadocMojo.replaceLinkTags(comment, clazz);
assertEquals("/** {@link java.net.ConnectException} */", newComment);
}
use of com.thoughtworks.qdox.model.JavaClass in project maven-plugins by apache.
the class AbstractFixJavadocMojoTest method testReplaceLinkTags_followedByHash.
public void testReplaceLinkTags_followedByHash() throws Throwable {
String comment = "/** {@link ConnectException} ##important## */";
String source = "import java.net.ConnectException;\n" + comment + "\n" + "public class FollowedByHash {}";
JavaClass clazz = getJavaSource(source).getClassByName("FollowedByHash");
String newComment = AbstractFixJavadocMojo.replaceLinkTags(comment, clazz);
assertEquals("/** {@link java.net.ConnectException} ##important## */", newComment);
}
Aggregations