Search in sources :

Example 6 with JavaField

use of com.thoughtworks.qdox.model.JavaField in project jsonschema2pojo by joelittlejohn.

the class RequiredIT method nonRequiredFiedHasNoRequiredText.

@Test
public void nonRequiredFiedHasNoRequiredText() {
    JavaField javaField = classWithRequired.getFieldByName("nonRequiredProperty");
    String javaDocComment = javaField.getComment();
    assertThat(javaDocComment, not(containsString("(Required)")));
}
Also used : JavaField(com.thoughtworks.qdox.model.JavaField) Test(org.junit.Test)

Example 7 with JavaField

use of com.thoughtworks.qdox.model.JavaField in project jsonschema2pojo by joelittlejohn.

the class DescriptionIT method descriptionAppearsInFieldJavadoc.

@Test
public void descriptionAppearsInFieldJavadoc() {
    JavaField javaField = classWithDescription.getFieldByName("description");
    String javaDocComment = javaField.getComment();
    assertThat(javaDocComment, containsString("A description for this property"));
}
Also used : JavaField(com.thoughtworks.qdox.model.JavaField) Test(org.junit.Test)

Example 8 with JavaField

use of com.thoughtworks.qdox.model.JavaField in project jsonschema2pojo by joelittlejohn.

the class DescriptionIT method descriptionAppearsAfterTitleInJavadoc.

@Test
public void descriptionAppearsAfterTitleInJavadoc() {
    JavaField javaField = classWithDescription.getFieldByName("descriptionAndTitle");
    String javaDocComment = javaField.getComment();
    assertThat(javaDocComment, containsString("A title for this property"));
    assertThat(javaDocComment.indexOf("A description for this property"), is(greaterThan(javaDocComment.indexOf("A title for this property"))));
}
Also used : JavaField(com.thoughtworks.qdox.model.JavaField) Test(org.junit.Test)

Example 9 with JavaField

use of com.thoughtworks.qdox.model.JavaField in project jsonschema2pojo by joelittlejohn.

the class RequiredArrayIT method notRequiredIsTheDefault.

@Test
public void notRequiredIsTheDefault() {
    JavaField javaField = classWithRequired.getFieldByName("defaultNotRequiredProperty");
    String javaDocComment = javaField.getComment();
    assertThat(javaDocComment, not(containsString("(Required)")));
}
Also used : JavaField(com.thoughtworks.qdox.model.JavaField) Test(org.junit.Test)

Example 10 with JavaField

use of com.thoughtworks.qdox.model.JavaField in project jsonschema2pojo by joelittlejohn.

the class TitleIT method descriptionAppearsInFieldJavadoc.

@Test
public void descriptionAppearsInFieldJavadoc() {
    JavaField javaField = classWithTitle.getFieldByName("title");
    String javaDocComment = javaField.getComment();
    assertThat(javaDocComment, containsString("A title for this property"));
}
Also used : JavaField(com.thoughtworks.qdox.model.JavaField) Test(org.junit.Test)

Aggregations

JavaField (com.thoughtworks.qdox.model.JavaField)17 Test (org.junit.Test)15 File (java.io.File)5 JavaDocBuilder (com.thoughtworks.qdox.JavaDocBuilder)3 JavaClass (com.thoughtworks.qdox.model.JavaClass)3 JavaMethod (com.thoughtworks.qdox.model.JavaMethod)2 BufferedReader (java.io.BufferedReader)2 StringReader (java.io.StringReader)2 StringWriter (java.io.StringWriter)2 JavaConstructor (com.thoughtworks.qdox.model.JavaConstructor)1