use of com.thoughtworks.qdox.model.JavaField in project jsonschema2pojo by joelittlejohn.
the class TitleIT method titleAppearsBeforeDescriptionInJavadoc.
@Test
public void titleAppearsBeforeDescriptionInJavadoc() {
JavaField javaField = classWithTitle.getFieldByName("titleAndDescription");
String javaDocComment = javaField.getComment();
assertThat(javaDocComment, containsString("A description for this property"));
assertThat(javaDocComment.indexOf("A title for this property"), is(lessThan(javaDocComment.indexOf("A description for this property"))));
}
use of com.thoughtworks.qdox.model.JavaField in project jsonschema2pojo by joelittlejohn.
the class DollarCommentIT method dollarCommentAppearsInFieldJavadoc.
@Test
public void dollarCommentAppearsInFieldJavadoc() {
JavaField javaField = classWithDescription.getFieldByName("withComment");
String javaDocComment = javaField.getComment();
assertThat(javaDocComment, containsString("JavaDoc linking to {@link #descriptionAndComment}"));
}
use of com.thoughtworks.qdox.model.JavaField in project jsonschema2pojo by joelittlejohn.
the class JavaNameIT method arrayRequiredAppearsInFieldJavadoc.
@Test
public void arrayRequiredAppearsInFieldJavadoc() throws IOException {
schemaRule.generateAndCompile("/schema/javaName/javaNameWithRequiredProperties.json", "com.example.required");
File generatedJavaFileWithRequiredProperties = schemaRule.generated("com/example/required/JavaNameWithRequiredProperties.java");
JavaDocBuilder javaDocBuilder = new JavaDocBuilder();
javaDocBuilder.addSource(generatedJavaFileWithRequiredProperties);
JavaClass classWithRequiredProperties = javaDocBuilder.getClassByName("com.example.required.JavaNameWithRequiredProperties");
JavaField javaFieldWithoutJavaName = classWithRequiredProperties.getFieldByName("requiredPropertyWithoutJavaName");
JavaField javaFieldWithJavaName = classWithRequiredProperties.getFieldByName("requiredPropertyWithoutJavaName");
assertThat(javaFieldWithoutJavaName.getComment(), containsString("(Required)"));
assertThat(javaFieldWithJavaName.getComment(), containsString("(Required)"));
}
use of com.thoughtworks.qdox.model.JavaField in project jsonschema2pojo by joelittlejohn.
the class JavaNameIT method inlineRequiredAppearsInFieldJavadoc.
@Test
public void inlineRequiredAppearsInFieldJavadoc() throws IOException {
schemaRule.generateAndCompile("/schema/javaName/javaNameWithRequiredProperties.json", "com.example.required");
File generatedJavaFileWithRequiredProperties = schemaRule.generated("com/example/required/JavaNameWithRequiredProperties.java");
JavaDocBuilder javaDocBuilder = new JavaDocBuilder();
javaDocBuilder.addSource(generatedJavaFileWithRequiredProperties);
JavaClass classWithRequiredProperties = javaDocBuilder.getClassByName("com.example.required.JavaNameWithRequiredProperties");
JavaField javaFieldWithoutJavaName = classWithRequiredProperties.getFieldByName("inlineRequiredPropertyWithoutJavaName");
JavaField javaFieldWithJavaName = classWithRequiredProperties.getFieldByName("inlineRequiredPropertyWithoutJavaName");
assertThat(javaFieldWithoutJavaName.getComment(), containsString("(Required)"));
assertThat(javaFieldWithJavaName.getComment(), containsString("(Required)"));
}
use of com.thoughtworks.qdox.model.JavaField in project jsonschema2pojo by joelittlejohn.
the class RequiredIT method requiredAppearsInFieldJavadoc.
@Test
public void requiredAppearsInFieldJavadoc() {
JavaField javaField = classWithRequired.getFieldByName("requiredProperty");
String javaDocComment = javaField.getComment();
assertThat(javaDocComment, containsString("(Required)"));
}
Aggregations