Skip to content

Commit 1d7543f

Browse files
committed
#2 Extend test on case of element without annotation
1 parent 119baa9 commit 1d7543f

2 files changed

Lines changed: 3 additions & 1 deletion

File tree

src/test/groovy/info/hubbitus/XJCPluginDescriptionAnnotationTest.groovy

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,12 +100,13 @@ class XJCPluginDescriptionAnnotationTest extends Specification {
100100
<sequence>
101101
<element name="name" type="{http://www.w3.org/2001/XMLSchema}string"/>
102102
<element name="age" type="{http://www.w3.org/2001/XMLSchema}positiveInteger"/>
103+
<element name="address" type="{http://www.w3.org/2001/XMLSchema}string"/>
103104
</sequence>
104105
</restriction>
105106
</complexContent>
106107
</complexType>'''
107108

108-
cls.getDeclaredFields().size() == 2
109+
cls.getDeclaredFields().size() == 3
109110
cls.getDeclaredFields().find{ 'name' == it.name }.getAnnotation(XsdInfo).name() == 'Фамилия и имя'
110111
cls.getDeclaredFields().find{ 'age' == it.name }.getAnnotation(XsdInfo).name() == 'Возраст'
111112
}

src/test/resources/Example.xsd

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
<xs:documentation>Возраст</xs:documentation>
1717
</xs:annotation>
1818
</xs:element>
19+
<xs:element name="address" type="xs:string"/>
1920
</xs:sequence>
2021
</xs:complexType>
2122
</xs:schema>

0 commit comments

Comments
 (0)