Skip to content

Commit

Permalink
add missing test data
Browse files Browse the repository at this point in the history
  • Loading branch information
TomLemmensASML authored and Tom-Lemmens committed Jul 14, 2024
1 parent 6ac3688 commit 9726b5e
Show file tree
Hide file tree
Showing 40 changed files with 1,558 additions and 0 deletions.
3 changes: 3 additions & 0 deletions XmlStructLoader.jl/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@
!*.jl
!*.md

# Allow specific directories
!test/test_data/**

# Allow specific files
!.gitignore
!Project.toml
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<?xml version="1.0" encoding="utf-8"?><TestRootElementFirst:document xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="TestRootElementFirst root_element_on_first_line.xsd" xmlns:TestRootElementFirst="TestRootElementFirst"><TestElement1><Element_string>aaaa</Element_string><Element_double>100.22</Element_double><Element_boolean>true</Element_boolean><Element_decimal>5.55</Element_decimal><Element_dateTime>2022-05-10T10:22:49.152+01:00</Element_dateTime><Element_integer>-778</Element_integer><Element_nonNegativeInteger>0</Element_nonNegativeInteger><Element_positiveInteger>663</Element_positiveInteger></TestElement1><TestElement2>99A9</TestElement2></TestRootElementFirst:document>
39 changes: 39 additions & 0 deletions XmlStructLoader.jl/test/test_data/edge_cases/all_one_line.xsd
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
<?xml version="1.0"?>
<schema xmlns="http://www.w3.org/2001/XMLSchema" xmlns:TestRootElementFirst="TestRootElementFirst" targetNamespace="TestRootElementFirst">

<element name="document" type="TestRootElementFirst:documentType"/>

<complexType name="TestComplexType1">
<annotation>
<documentation>An example of a complex xsd type.</documentation>
</annotation>
<sequence>
<element name="Element_string" type="string"/>
<element name="Element_double" type="double"/>
<element name="Element_boolean" type="boolean"/>
<element name="Element_decimal" type="decimal"/>
<element name="Element_dateTime" type="dateTime"/>
<element name="Element_integer" type="integer"/>
<element name="Element_nonNegativeInteger" type="nonNegativeInteger"/>
<element name="Element_positiveInteger" type="positiveInteger"/>
</sequence>
</complexType>

<simpleType name="TestSimpleType1">
<annotation>
<documentation>An example of a simple xsd type.</documentation>
</annotation>
<restriction base="string">
<maxLength value="4"/>
<pattern value="([0-9A-Z]{4})?"/>
</restriction>
</simpleType>

<complexType name="documentType">
<sequence>
<element name="TestElement1" type="TestRootElementFirst:TestComplexType1"/>
<element name="TestElement2" type="TestRootElementFirst:TestSimpleType1"/>
</sequence>
</complexType>

</schema>
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="utf-8"?><TestRootElementFirst:document xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="TestRootElementFirst root_element_on_first_line.xsd" xmlns:TestRootElementFirst="TestRootElementFirst">
<TestElement1>
<Element_string>aaaa</Element_string>
<Element_double>100.22</Element_double>
<Element_boolean>true</Element_boolean>
<Element_decimal>5.55</Element_decimal>
<Element_dateTime>2022-05-10T10:22:49.152+01:00</Element_dateTime>
<Element_integer>-778</Element_integer>
<Element_nonNegativeInteger>0</Element_nonNegativeInteger>
<Element_positiveInteger>663</Element_positiveInteger>
</TestElement1>

<TestElement2>99A9</TestElement2>
</TestRootElementFirst:document>
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
<?xml version="1.0"?>
<schema xmlns="http://www.w3.org/2001/XMLSchema" xmlns:TestRootElementFirst="TestRootElementFirst" targetNamespace="TestRootElementFirst">

<element name="document" type="TestRootElementFirst:documentType"/>

<complexType name="TestComplexType1">
<annotation>
<documentation>An example of a complex xsd type.</documentation>
</annotation>
<sequence>
<element name="Element_string" type="string"/>
<element name="Element_double" type="double"/>
<element name="Element_boolean" type="boolean"/>
<element name="Element_decimal" type="decimal"/>
<element name="Element_dateTime" type="dateTime"/>
<element name="Element_integer" type="integer"/>
<element name="Element_nonNegativeInteger" type="nonNegativeInteger"/>
<element name="Element_positiveInteger" type="positiveInteger"/>
</sequence>
</complexType>

<simpleType name="TestSimpleType1">
<annotation>
<documentation>An example of a simple xsd type.</documentation>
</annotation>
<restriction base="string">
<maxLength value="4"/>
<pattern value="([0-9A-Z]{4})?"/>
</restriction>
</simpleType>

<complexType name="documentType">
<sequence>
<element name="TestElement1" type="TestRootElementFirst:TestComplexType1"/>
<element name="TestElement2" type="TestRootElementFirst:TestSimpleType1"/>
</sequence>
</complexType>

</schema>
22 changes: 22 additions & 0 deletions XmlStructLoader.jl/test/test_data/generic_cases/basic_types.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?xml version="1.0" encoding="utf-8"?>

<TestComplexAndSimple:document xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="TestComplexAndSimple basic_types.xsd" xmlns:TestComplexAndSimple="TestComplexAndSimple">
<TestElement1>
<Element_string>aaaa</Element_string>
<Element_double>100.22</Element_double>
<Element_boolean>true</Element_boolean>
<Element_decimal>5.55</Element_decimal>
<Element_dateTime>2022-05-10T10:22:49.152+01:00</Element_dateTime>
<Element_integer>-778</Element_integer>
<Element_nonNegativeInteger>0</Element_nonNegativeInteger>
<Element_positiveInteger>663</Element_positiveInteger>
</TestElement1>

<TestElement2>99A9</TestElement2>

<TestElement3>
<Element_string>bbbb</Element_string>
<Element_double>464.558</Element_double>
<Element_dateTime>2002-10-10T10:22:49.152-02:00</Element_dateTime>
</TestElement3>
</TestComplexAndSimple:document>
51 changes: 51 additions & 0 deletions XmlStructLoader.jl/test/test_data/generic_cases/basic_types.xsd
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
<?xml version="1.0"?>
<schema xmlns="http://www.w3.org/2001/XMLSchema" xmlns:TestComplexAndSimple="TestComplexAndSimple" targetNamespace="TestComplexAndSimple">

<element name="document" type="TestComplexAndSimple:documentType"/>

<complexType name="TestComplexType1">
<annotation>
<documentation>An example of a complex xsd type.</documentation>
</annotation>
<sequence>
<element name="Element_string" type="string"/>
<element name="Element_double" type="double"/>
<element name="Element_boolean" type="boolean"/>
<element name="Element_decimal" type="decimal"/>
<element name="Element_dateTime" type="dateTime"/>
<element name="Element_integer" type="integer"/>
<element name="Element_nonNegativeInteger" type="nonNegativeInteger"/>
<element name="Element_positiveInteger" type="positiveInteger"/>
</sequence>
</complexType>

<complexType name="TestComplexType6">
<annotation>
<documentation>An example of a complex xsd type.</documentation>
</annotation>
<sequence>
<element name="Element_string" type="string"/>
<element name="Element_double" type="double"/>
<element name="Element_dateTime" type="dateTime"/>
</sequence>
</complexType>

<simpleType name="TestSimpleType1">
<annotation>
<documentation>An example of a simple xsd type.</documentation>
</annotation>
<restriction base="string">
<maxLength value="4"/>
<pattern value="([0-9A-Z]{4})?"/>
</restriction>
</simpleType>

<complexType name="documentType">
<sequence>
<element name="TestElement1" type="TestComplexAndSimple:TestComplexType1"/>
<element name="TestElement2" type="TestComplexAndSimple:TestSimpleType1"/>
<element name="TestElement3" type="TestComplexAndSimple:TestComplexType6"/>
</sequence>
</complexType>

</schema>
89 changes: 89 additions & 0 deletions XmlStructLoader.jl/test/test_data/generic_cases/choice_element.xsd
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
<?xml version="1.0"?>
<schema xmlns="http://www.w3.org/2001/XMLSchema" xmlns:TestChoice="TestChoice" targetNamespace="TestChoice">

<element name="document" type="TestChoice:documentType"/>

<complexType name="TestComplexType1">
<annotation>
<documentation>Example of a complex XSD type that uses a choice.</documentation>
</annotation>
<sequence>
<element name="element1" type="string"/>
<choice>
<element name="choice1" type="string"/>
<element name="choice2" type="decimal"/>
</choice>
<element name="element2" type="string" default="default"/>
</sequence>
</complexType>

<complexType name="TestComplexType2">
<annotation>
<documentation>Example of a complex XSD type that uses a choice.</documentation>
</annotation>
<sequence>
<choice>
<element name="choice1" type="string"/>
<element name="choice2" type="decimal"/>
<element name="choice3">
<simpleType>
<annotation>
<documentation>An example of a simple xsd type.</documentation>
</annotation>
<restriction base="string">
<maxLength value="4"/>
<pattern value="([0-9A-Z]{4})?"/>
</restriction>
</simpleType>
</element>
</choice>
</sequence>
</complexType>

<!-- <complexType name="TestComplexType3">
<annotation>
<documentation>Example of a complex XSD type that uses a choice with a group.</documentation>
</annotation>
<sequence>
<choice>
<element name="choice1" type="string"/>
<element name="choice2" type="decimal"/>
<group ref="TestChoice:TestGroup"></group>
</choice>
</sequence>
</complexType>
<group name="TestGroup">
<sequence>
<element name="groupchoice1" type="string"/>
<element name="groupchoice2" type="decimal"/>
</sequence>
</group> -->

<complexType name="TestComplexType5">
<annotation>
<documentation>Example of a complex XSD type that uses a choice.</documentation>
</annotation>
<sequence>
<choice>
<element name="choice1" type="string"/>
<element name="choice2" type="decimal"/>
</choice>
<choice>
<element name="choice3" type="string"/>
<element name="choice4" type="decimal"/>
</choice>
</sequence>
</complexType>

<complexType name="documentType">
<sequence>
<element name="TestElement1" type="TestChoice:TestComplexType1"/>
<element name="TestElement2" type="TestChoice:TestComplexType2"/>
<!-- <element name="TestElement3" type="TestChoice:TestComplexType3"/> -->
<!-- <element name="TestElement4" type="TestChoice:TestComplexType4"/> -->
<element name="TestElement5" type="TestChoice:TestComplexType5"/>
</sequence>
</complexType>

</schema>
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?xml version="1.0" encoding="utf-8"?>

<TestChoice:document xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="TestChoice choice_element.xsd" xmlns:TestChoice="TestChoice">
<TestElement1>
<element1>eere</element1>
<choice1>aaaa</choice1>
<element2></element2>
</TestElement1>
<TestElement2>
<choice3>E2R3</choice3>
</TestElement2>
<TestElement5>
<choice2>20</choice2>
<choice4>55.6</choice4>
</TestElement5>
</TestChoice:document>
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?xml version="1.0" encoding="utf-8"?>

<TestChoice:document xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="TestChoice choice_element.xsd" xmlns:TestChoice="TestChoice">
<TestElement1>
<element1>etre</element1>
<choice2>9.0</choice2>
<element2>aaa</element2>
</TestElement1>
<TestElement2>
<choice2>14.5</choice2>
</TestElement2>
<TestElement5>
<choice1>rrr</choice1>
<choice4>55.6</choice4>
</TestElement5>
</TestChoice:document>
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<?xml version="1.0" encoding="utf-8"?>

<TestComplexContent:document xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="TestComplexContent complex_content.xsd" xmlns:TestComplexContent="TestComplexContent">
<TestElement2>
<Element_string>aaaa</Element_string>
<Element_double>100.22</Element_double>
<Element_boolean>true</Element_boolean>
<Element_decimal>5.55</Element_decimal>
<Element_dateTime>2022-05-10T10:22:49.152+01:00</Element_dateTime>
<Element_integer>-778</Element_integer>
<Element_nonNegativeInteger>0</Element_nonNegativeInteger>
<Element_positiveInteger>663</Element_positiveInteger>
<Element_integer_ext>-78</Element_integer_ext>
<Element_boolean_ext>false</Element_boolean_ext>
</TestElement2>
<TestElement3>
<Element_string>bbbb</Element_string>
<Element_double>55.22</Element_double>
<Element_boolean>false</Element_boolean>
<Element_decimal>57.55</Element_decimal>
<Element_dateTime>2022-05-15T10:22:49.152+01:00</Element_dateTime>
<Element_integer>1004</Element_integer>
<Element_nonNegativeInteger>10</Element_nonNegativeInteger>
<Element_positiveInteger>4</Element_positiveInteger>
</TestElement3>
<TestElement5>
<simple1>5.5</simple1>
</TestElement5>
</TestComplexContent:document>
Loading

0 comments on commit 9726b5e

Please sign in to comment.