Search in sources :

Example 16 with JavaClass

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);
}
Also used : JavaClass(com.thoughtworks.qdox.model.JavaClass)

Example 17 with JavaClass

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);
}
Also used : JavaClass(com.thoughtworks.qdox.model.JavaClass)

Example 18 with JavaClass

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);
}
Also used : JavaClass(com.thoughtworks.qdox.model.JavaClass)

Example 19 with JavaClass

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);
}
Also used : JavaClass(com.thoughtworks.qdox.model.JavaClass)

Example 20 with JavaClass

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);
}
Also used : JavaClass(com.thoughtworks.qdox.model.JavaClass)

Aggregations

JavaClass (com.thoughtworks.qdox.model.JavaClass)48 AbstractInheritableJavaEntity (com.thoughtworks.qdox.model.AbstractInheritableJavaEntity)12 JavaMethod (com.thoughtworks.qdox.model.JavaMethod)12 DocletTag (com.thoughtworks.qdox.model.DocletTag)10 JavaDocBuilder (com.thoughtworks.qdox.JavaDocBuilder)6 File (java.io.File)6 StringReader (java.io.StringReader)6 JavaParameter (com.thoughtworks.qdox.model.JavaParameter)5 JavaSource (com.thoughtworks.qdox.model.JavaSource)5 ArrayList (java.util.ArrayList)5 JavaProjectBuilder (com.thoughtworks.qdox.JavaProjectBuilder)4 BeanProperty (com.thoughtworks.qdox.model.BeanProperty)4 JavaField (com.thoughtworks.qdox.model.JavaField)3 HashSet (java.util.HashSet)3 List (java.util.List)3 Test (org.junit.Test)3 AbstractJavaEntity (com.thoughtworks.qdox.model.AbstractJavaEntity)2 JavaExecutable (com.thoughtworks.qdox.model.JavaExecutable)2 JavaMember (com.thoughtworks.qdox.model.JavaMember)2 JavaType (com.thoughtworks.qdox.model.JavaType)2