Add TreeTestResultCollection Castor mapping
authorMathieu Baudier <mbaudier@argeo.org>
Thu, 3 Jul 2008 21:04:15 +0000 (21:04 +0000)
committerMathieu Baudier <mbaudier@argeo.org>
Thu, 3 Jul 2008 21:04:15 +0000 (21:04 +0000)
git-svn-id: https://svn.argeo.org/slc/trunk@1347 4cfe0d0a-d680-48aa-b62c-e0a02a3f76cc

org.argeo.slc.core/src/main/resources/org/argeo/slc/castor/test/mapping.xml
org.argeo.slc.core/src/main/resources/org/argeo/slc/xml/slc.xsd
org.argeo.slc.core/src/test/java/org/argeo/slc/core/test/tree/TreeTestResultCollectionCastorTest.java [new file with mode: 0644]
org.argeo.slc.core/src/test/resources/log4j.properties

index 3d407e224518eafa7f78c6b2a7ad066b485a65e0..e35450e16e662a54b5f3858364ecdc427390c38f 100644 (file)
@@ -1,27 +1,27 @@
-<?xml version="1.0"?>\r
-\r
-<mapping>\r
-       <description>Test objects XML mapping</description>\r
-\r
-       <class name="org.argeo.slc.core.test.TestRunDescriptor"\r
-               auto-complete="false">\r
-               <map-to ns-uri="http://argeo.org/projects/slc/schemas"\r
-                       ns-prefix="slc" />\r
-               <field name="testRunUuid" />\r
-               <field name="slcExecutionUuid" />\r
-               <field name="slcExecutionStepUuid" />\r
-               <field name="testResultUuid" />\r
-               <field name="deployedSytemId" />\r
-       </class>\r
-\r
-       <class name="org.argeo.slc.core.test.tree.TreeTestResult"\r
-               auto-complete="false">\r
-               <map-to ns-uri="http://argeo.org/projects/slc/schemas"\r
-                       ns-prefix="slc" />\r
-               <field name="uuid" type="string">\r
-                       <bind-xml name="uuid" node="attribute" />\r
-               </field>\r
-               <field name="closeDate" />\r
+<?xml version="1.0"?>
+
+<mapping>
+       <description>Test objects XML mapping</description>
+
+       <class name="org.argeo.slc.core.test.TestRunDescriptor"
+               auto-complete="false">
+               <map-to ns-uri="http://argeo.org/projects/slc/schemas"
+                       ns-prefix="slc" />
+               <field name="testRunUuid" />
+               <field name="slcExecutionUuid" />
+               <field name="slcExecutionStepUuid" />
+               <field name="testResultUuid" />
+               <field name="deployedSytemId" />
+       </class>
+
+       <class name="org.argeo.slc.core.test.tree.TreeTestResult"
+               auto-complete="false">
+               <map-to ns-uri="http://argeo.org/projects/slc/schemas"
+                       ns-prefix="slc" />
+               <field name="uuid" type="string">
+                       <bind-xml name="uuid" node="attribute" />
+               </field>
+               <field name="closeDate" />
                <field name="attributes" collection="map">
                        <bind-xml name="attribute" location="attributes">
                                <class name="org.exolab.castor.mapping.MapItem">
                                </class>
                        </bind-xml>
                </field>
-               <field name="resultParts" collection="map">\r
-                       <bind-xml name="result-part" location="result-parts">\r
-                               <class name="org.exolab.castor.mapping.MapItem">\r
-                                       <map-to\r
-                                               ns-uri="http://argeo.org/projects/slc/schemas" ns-prefix="slc" />\r
-                                       <field name="key"\r
-                                               type="org.argeo.slc.core.structure.tree.TreeSPath"\r
-                                               handler="org.argeo.slc.castor.structure.tree.TreeSPathFieldHandler">\r
-                                               <bind-xml name="path" node="attribute" />\r
-                                       </field>\r
-                                       <field name="value"\r
-                                               type="org.argeo.slc.core.test.tree.PartSubList">\r
-                                               <bind-xml name="part-sub-list" />\r
-                                       </field>\r
-                               </class>\r
-                       </bind-xml>\r
-               </field>\r
-               <field name="elements" collection="map">\r
-                       <bind-xml name="element" location="elements">\r
-                               <class name="org.exolab.castor.mapping.MapItem">\r
-                                       <map-to\r
-                                               ns-uri="http://argeo.org/projects/slc/schemas" ns-prefix="slc" />\r
-                                       <field name="key"\r
-                                               type="org.argeo.slc.core.structure.tree.TreeSPath"\r
-                                               handler="org.argeo.slc.castor.structure.tree.TreeSPathFieldHandler">\r
-                                               <bind-xml name="path" node="attribute" />\r
-                                       </field>\r
-                                       <field name="value"\r
-                                               type="org.argeo.slc.core.structure.SimpleSElement">\r
-                                               <bind-xml auto-naming="deriveByClass" />\r
-                                       </field>\r
-                               </class>\r
-                       </bind-xml>\r
-               </field>\r
-       </class>\r
-\r
-       <class name="org.argeo.slc.core.test.tree.PartSubList"\r
-               auto-complete="false">\r
-               <map-to ns-uri="http://argeo.org/projects/slc/schemas"\r
-                       ns-prefix="slc" />\r
-               <field name="parts" collection="arraylist"\r
-                       type="org.argeo.slc.core.test.SimpleResultPart">\r
-                       <bind-xml auto-naming="deriveByClass" location="parts" />\r
-               </field>\r
-       </class>\r
-\r
-       <class name="org.argeo.slc.core.test.SimpleResultPart"\r
-               auto-complete="false">\r
-               <map-to ns-uri="http://argeo.org/projects/slc/schemas"\r
-                       ns-prefix="slc" />\r
-               <field name="testRunUuid" type="string" />\r
-               <field name="message" type="string"/>\r
-               <field name="status" type="string"\r
-                       handler="org.argeo.slc.castor.test.tree.StatusFieldHandler" />\r
-               <field name="exceptionMessage" type="string"/>\r
-       </class>\r
-\r
+               <field name="resultParts" collection="map">
+                       <bind-xml name="result-part" location="result-parts">
+                               <class name="org.exolab.castor.mapping.MapItem">
+                                       <map-to
+                                               ns-uri="http://argeo.org/projects/slc/schemas" ns-prefix="slc" />
+                                       <field name="key"
+                                               type="org.argeo.slc.core.structure.tree.TreeSPath"
+                                               handler="org.argeo.slc.castor.structure.tree.TreeSPathFieldHandler">
+                                               <bind-xml name="path" node="attribute" />
+                                       </field>
+                                       <field name="value"
+                                               type="org.argeo.slc.core.test.tree.PartSubList">
+                                               <bind-xml name="part-sub-list" />
+                                       </field>
+                               </class>
+                       </bind-xml>
+               </field>
+               <field name="elements" collection="map">
+                       <bind-xml name="element" location="elements">
+                               <class name="org.exolab.castor.mapping.MapItem">
+                                       <map-to
+                                               ns-uri="http://argeo.org/projects/slc/schemas" ns-prefix="slc" />
+                                       <field name="key"
+                                               type="org.argeo.slc.core.structure.tree.TreeSPath"
+                                               handler="org.argeo.slc.castor.structure.tree.TreeSPathFieldHandler">
+                                               <bind-xml name="path" node="attribute" />
+                                       </field>
+                                       <field name="value"
+                                               type="org.argeo.slc.core.structure.SimpleSElement">
+                                               <bind-xml auto-naming="deriveByClass" />
+                                       </field>
+                               </class>
+                       </bind-xml>
+               </field>
+       </class>
+
+       <class name="org.argeo.slc.core.test.tree.PartSubList"
+               auto-complete="false">
+               <map-to ns-uri="http://argeo.org/projects/slc/schemas"
+                       ns-prefix="slc" />
+               <field name="parts" collection="arraylist"
+                       type="org.argeo.slc.core.test.SimpleResultPart">
+                       <bind-xml auto-naming="deriveByClass" location="parts" />
+               </field>
+       </class>
+
+       <class name="org.argeo.slc.core.test.SimpleResultPart"
+               auto-complete="false">
+               <map-to ns-uri="http://argeo.org/projects/slc/schemas"
+                       ns-prefix="slc" />
+               <field name="testRunUuid" type="string" />
+               <field name="message" type="string" />
+               <field name="status" type="string"
+                       handler="org.argeo.slc.castor.test.tree.StatusFieldHandler" />
+               <field name="exceptionMessage" type="string" />
+       </class>
+
+       <class name="org.argeo.slc.core.test.tree.TreeTestResultCollection"
+               auto-complete="false">
+               <map-to ns-uri="http://argeo.org/projects/slc/schemas"
+                       ns-prefix="slc" />
+               <field name="id" type="string">
+                       <bind-xml name="id" node="attribute" />
+               </field>
+               <field name="results" collection="set"
+                       type="org.argeo.slc.core.test.tree.TreeTestResult">
+                       <bind-xml auto-naming="deriveByClass" location="results" />
+               </field>
+       </class>
 </mapping>
\ No newline at end of file
index 75831b2eda42ecef3785ef9e3bbb9c911fed948e..4be18ff74a22090ae37eaa72e7b977d3de4c74eb 100644 (file)
-<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"\r
-       xmlns:slc="http://argeo.org/projects/slc/schemas"\r
-       elementFormDefault="qualified"\r
-       targetNamespace="http://argeo.org/projects/slc/schemas">\r
-       <!-- TREE TEST RESULT -->\r
-       <xs:element name="tree-test-result" type="slc:TreeTestResultType" />\r
-       <xs:complexType name="TreeTestResultType">\r
-               <xs:all>\r
-                       <xs:element name="close-date" type="xs:dateTime"\r
-                               minOccurs="0" />\r
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
+       xmlns:slc="http://argeo.org/projects/slc/schemas"
+       elementFormDefault="qualified"
+       targetNamespace="http://argeo.org/projects/slc/schemas">
+       <!-- TREE TEST RESULT -->
+       <xs:element name="tree-test-result" type="slc:TreeTestResultType" />
+       <xs:element name="tree-test-result-collection"
+               type="slc:TreeTestResultCollectionType" />
+
+       <xs:complexType name="TreeTestResultCollectionType">
+               <xs:all>
+                       <xs:element name="results" minOccurs="0"
+                               type="slc:ResultsType" />
+               </xs:all>
+               <xs:attribute name="id" use="required" />
+       </xs:complexType>
+       <xs:complexType name="ResultsType">
+               <xs:sequence>
+                       <xs:element name="tree-test-result"
+                               type="slc:TreeTestResultType" minOccurs="0" maxOccurs="unbounded">
+                       </xs:element>
+               </xs:sequence>
+       </xs:complexType>
+       <xs:complexType name="TreeTestResultType">
+               <xs:all>
+                       <xs:element name="close-date" type="xs:dateTime"
+                               minOccurs="0" />
                        <xs:element name="attributes" minOccurs="0"
                                type="slc:AttributesType" />
-                       <xs:element name="result-parts" minOccurs="0"\r
-                               type="slc:ResultPartsType" />\r
-                       <xs:element name="elements" minOccurs="0"\r
-                               type="slc:ElementsType" />\r
-               </xs:all>\r
-               <xs:attribute name="uuid" use="required" />\r
-       </xs:complexType>\r
-       <xs:complexType name="ResultPartsType">\r
-               <xs:sequence>\r
-                       <xs:element name="result-part" type="slc:ResultPartType"\r
-                               minOccurs="0" maxOccurs="unbounded">\r
-                       </xs:element>\r
-               </xs:sequence>\r
-       </xs:complexType>\r
-       <xs:complexType name="ResultPartType">\r
-               <xs:all>\r
-                       <xs:element name="part-sub-list" type="slc:PartSubListType" />\r
-               </xs:all>\r
-               <xs:attribute name="path" type="xs:string" use="required" />\r
-       </xs:complexType>\r
-       <xs:complexType name="PartSubListType">\r
-               <xs:all>\r
-                       <xs:element name="parts" minOccurs="0" type="slc:PartsType" />\r
-               </xs:all>\r
-       </xs:complexType>\r
-       <xs:complexType name="PartsType">\r
-               <xs:sequence>\r
-                       <xs:element name="simple-result-part"\r
-                               type="slc:SimpleResultPartType" maxOccurs="unbounded">\r
-                       </xs:element>\r
-               </xs:sequence>\r
-       </xs:complexType>\r
-       <xs:complexType name="SimpleResultPartType">\r
-               <xs:all>\r
-                       <xs:element name="status">\r
-                               <xs:simpleType>\r
-                                       <xs:restriction base="xs:string">\r
-                                               <xs:enumeration value="PASSED" />\r
-                                               <xs:enumeration value="FAILED" />\r
-                                               <xs:enumeration value="ERROR" />\r
-                                       </xs:restriction>\r
-                               </xs:simpleType>\r
-                       </xs:element>\r
-                       <xs:element name="message" type="xs:string" />\r
-                       <xs:element name="exception-message" minOccurs="0"\r
-                               type="xs:string" />\r
-                       <xs:element name="stack-lines" minOccurs="0"\r
-                               type="slc:StackLinesType" />\r
-                       <xs:element name="test-run-uuid" type="xs:string"\r
-                               minOccurs="0" />\r
-               </xs:all>\r
-       </xs:complexType>\r
-       <xs:complexType name="StackLinesType">\r
-               <xs:sequence>\r
-                       <xs:element name="stack-line" maxOccurs="unbounded"\r
-                               type="xs:string" />\r
-               </xs:sequence>\r
-               <xs:attribute name="message" type="xs:string" />\r
-       </xs:complexType>\r
-       <xs:complexType name="ElementsType">\r
-               <xs:sequence>\r
-                       <xs:element name="element" type="slc:ElementType"\r
-                               minOccurs="0" maxOccurs="unbounded">\r
-                       </xs:element>\r
-               </xs:sequence>\r
-       </xs:complexType>\r
-       <xs:complexType name="ElementType">\r
-               <xs:all>\r
-                       <xs:element name="simple-sElement"\r
-                               type="slc:SimpleSElementType" />\r
-               </xs:all>\r
-               <xs:attribute name="path" type="xs:string" use="required" />\r
-       </xs:complexType>\r
-       <xs:complexType name="SimpleSElementType">\r
-               <xs:all>\r
-                       <xs:element name="label" type="xs:string" />\r
-                       <xs:element name="tags" type="slc:TagsType" minOccurs="0" />\r
-               </xs:all>\r
-       </xs:complexType>\r
-       <xs:complexType name="TagsType">\r
-               <xs:sequence>\r
-                       <xs:element name="tag" type="slc:TagType" minOccurs="0"\r
-                               maxOccurs="unbounded">\r
-                       </xs:element>\r
-               </xs:sequence>\r
-       </xs:complexType>\r
-       <xs:complexType name="TagType">\r
-               <xs:all>\r
-                       <xs:element name="tag-value" type="xs:string" />\r
-               </xs:all>\r
-               <xs:attribute name="name" type="xs:string" use="required" />\r
-       </xs:complexType>\r
-       <xs:complexType name="TreeSPathType">\r
-               <xs:attribute name="as-unique-string" type="xs:string"\r
-                       use="required" />\r
-       </xs:complexType>\r
-       <xs:complexType name="TestRunDescriptorType">\r
-               <xs:all>\r
-                       <xs:element name="test-run-uuid" type="xs:string" />\r
-                       <xs:element name="slc-execution-uuid" type="xs:string"\r
-                               minOccurs="0" />\r
-                       <xs:element name="slc-execution-step-uuid" type="xs:string"\r
-                               minOccurs="0" />\r
-                       <xs:element name="deployed-sytem-id" type="xs:string"\r
-                               minOccurs="0" />\r
-                       <xs:element name="test-result-uuid" type="xs:string"\r
-                               minOccurs="0" />\r
-               </xs:all>\r
-       </xs:complexType>\r
-\r
-       <!-- TREE TEST RESULT REQUESTS -->\r
-       <xs:element name="create-tree-test-result-request">\r
-               <xs:complexType>\r
-                       <xs:all>\r
-                               <xs:element name="tree-test-result"\r
-                                       type="slc:TreeTestResultType" />\r
-                       </xs:all>\r
-               </xs:complexType>\r
-       </xs:element>\r
-\r
-       <xs:element name="close-tree-test-result-request">\r
-               <xs:complexType>\r
-                       <xs:all>\r
-                               <xs:element name="result-uuid" type="xs:string" />\r
-                               <xs:element name="close-date" type="xs:dateTime" />\r
-                       </xs:all>\r
-               </xs:complexType>\r
-       </xs:element>\r
-\r
-       <xs:element name="result-part-request">\r
-               <xs:complexType>\r
-                       <xs:all>\r
-                               <xs:element name="result-uuid" type="xs:string" />\r
-                               <xs:element name="simple-result-part"\r
-                                       type="slc:SimpleResultPartType" />\r
-                               <xs:element name="related-elements"\r
-                                       type="slc:ElementsType" />\r
-                               <xs:element name="tree-sPath" type="slc:TreeSPathType" />\r
-                               <xs:element name="test-run-descriptor"\r
-                                       type="slc:TestRunDescriptorType" />\r
-                       </xs:all>\r
-               </xs:complexType>\r
-       </xs:element>\r
-\r
-       <!-- SLC EXECUTION -->\r
-       <xs:element name="slc-execution" type="slc:SlcExecutionType" />\r
-       <xs:complexType name="SlcExecutionType">\r
-               <xs:all>\r
-                       <xs:element name="status" type="xs:string" />\r
-                       <xs:element name="type" type="xs:string" />\r
-                       <xs:element name="host" type="xs:string" />\r
-                       <xs:element name="user" type="xs:string" />\r
-                       <xs:element name="steps" minOccurs="0"\r
-                               type="slc:SlcExecutionStepsType" />\r
-                       <xs:element name="attributes" minOccurs="0"\r
-                               type="slc:AttributesType" />\r
-               </xs:all>\r
-               <xs:attribute name="uuid" type="xs:string" use="required" />\r
-       </xs:complexType>\r
-       <xs:complexType name="SlcExecutionStepsType">\r
-               <xs:sequence>\r
-                       <xs:element name="slc-execution-step"\r
-                               type="slc:SlcExecutionStepType" maxOccurs="unbounded">\r
-                       </xs:element>\r
-               </xs:sequence>\r
-       </xs:complexType>\r
-       <xs:complexType name="SlcExecutionStepType">\r
-               <xs:all>\r
-                       <xs:element name="type" type="xs:string" />\r
-                       <xs:element name="begin" type="xs:dateTime" />\r
-                       <xs:element name="log-lines" minOccurs="0">\r
-                               <xs:complexType>\r
-                                       <xs:sequence>\r
-                                               <xs:element name="log-line" type="xs:string"\r
-                                                       maxOccurs="unbounded" />\r
-                                       </xs:sequence>\r
-                               </xs:complexType>\r
-                       </xs:element>\r
-               </xs:all>\r
-               <xs:attribute name="uuid" type="xs:string" use="required" />\r
-       </xs:complexType>\r
-       <xs:complexType name="AttributesType">\r
-               <xs:sequence>\r
-                       <xs:element name="attribute" type="slc:AttributeType" minOccurs="0"\r
-                               maxOccurs="unbounded">\r
-                       </xs:element>\r
-               </xs:sequence>\r
-       </xs:complexType>\r
-       <xs:complexType name="AttributeType">\r
-               <xs:simpleContent>\r
-                       <xs:extension base="xs:string">\r
-                               <xs:attribute name="name" type="xs:string"\r
-                                       use="required" />\r
-                       </xs:extension>\r
-               </xs:simpleContent>\r
-       </xs:complexType>\r
-\r
-       <!-- SLC EXECUTION REQUESTS-->\r
-       <xs:element name="slc-execution-request">\r
-               <xs:complexType>\r
-                       <xs:all>\r
-                               <xs:element name="slc-execution"\r
-                                       type="slc:SlcExecutionType" />\r
-                       </xs:all>\r
-               </xs:complexType>\r
-       </xs:element>\r
-       <xs:element name="slc-execution-steps-request">\r
-               <xs:complexType>\r
-                       <xs:all>\r
-                               <xs:element name="slc-execution-uuid" type="xs:string" />\r
-                               <xs:element name="steps"\r
-                                       type="slc:SlcExecutionStepsType" />\r
-                       </xs:all>\r
-               </xs:complexType>\r
-       </xs:element>\r
-       <xs:element name="slc-execution-status-request">\r
-               <xs:complexType>\r
-                       <xs:all>\r
-                               <xs:element name="slc-execution-uuid" type="xs:string" />\r
-                               <xs:element name="new-status" type="xs:string" />\r
-                       </xs:all>\r
-               </xs:complexType>\r
-       </xs:element>\r
-\r
+                       <xs:element name="result-parts" minOccurs="0"
+                               type="slc:ResultPartsType" />
+                       <xs:element name="elements" minOccurs="0"
+                               type="slc:ElementsType" />
+               </xs:all>
+               <xs:attribute name="uuid" use="required" />
+       </xs:complexType>
+       <xs:complexType name="ResultPartsType">
+               <xs:sequence>
+                       <xs:element name="result-part" type="slc:ResultPartType"
+                               minOccurs="0" maxOccurs="unbounded">
+                       </xs:element>
+               </xs:sequence>
+       </xs:complexType>
+       <xs:complexType name="ResultPartType">
+               <xs:all>
+                       <xs:element name="part-sub-list" type="slc:PartSubListType" />
+               </xs:all>
+               <xs:attribute name="path" type="xs:string" use="required" />
+       </xs:complexType>
+       <xs:complexType name="PartSubListType">
+               <xs:all>
+                       <xs:element name="parts" minOccurs="0" type="slc:PartsType" />
+               </xs:all>
+       </xs:complexType>
+       <xs:complexType name="PartsType">
+               <xs:sequence>
+                       <xs:element name="simple-result-part"
+                               type="slc:SimpleResultPartType" maxOccurs="unbounded">
+                       </xs:element>
+               </xs:sequence>
+       </xs:complexType>
+       <xs:complexType name="SimpleResultPartType">
+               <xs:all>
+                       <xs:element name="status">
+                               <xs:simpleType>
+                                       <xs:restriction base="xs:string">
+                                               <xs:enumeration value="PASSED" />
+                                               <xs:enumeration value="FAILED" />
+                                               <xs:enumeration value="ERROR" />
+                                       </xs:restriction>
+                               </xs:simpleType>
+                       </xs:element>
+                       <xs:element name="message" type="xs:string" />
+                       <xs:element name="exception-message" minOccurs="0"
+                               type="xs:string" />
+                       <xs:element name="stack-lines" minOccurs="0"
+                               type="slc:StackLinesType" />
+                       <xs:element name="test-run-uuid" type="xs:string"
+                               minOccurs="0" />
+               </xs:all>
+       </xs:complexType>
+       <xs:complexType name="StackLinesType">
+               <xs:sequence>
+                       <xs:element name="stack-line" maxOccurs="unbounded"
+                               type="xs:string" />
+               </xs:sequence>
+               <xs:attribute name="message" type="xs:string" />
+       </xs:complexType>
+       <xs:complexType name="ElementsType">
+               <xs:sequence>
+                       <xs:element name="element" type="slc:ElementType"
+                               minOccurs="0" maxOccurs="unbounded">
+                       </xs:element>
+               </xs:sequence>
+       </xs:complexType>
+       <xs:complexType name="ElementType">
+               <xs:all>
+                       <xs:element name="simple-sElement"
+                               type="slc:SimpleSElementType" />
+               </xs:all>
+               <xs:attribute name="path" type="xs:string" use="required" />
+       </xs:complexType>
+       <xs:complexType name="SimpleSElementType">
+               <xs:all>
+                       <xs:element name="label" type="xs:string" />
+                       <xs:element name="tags" type="slc:TagsType" minOccurs="0" />
+               </xs:all>
+       </xs:complexType>
+       <xs:complexType name="TagsType">
+               <xs:sequence>
+                       <xs:element name="tag" type="slc:TagType" minOccurs="0"
+                               maxOccurs="unbounded">
+                       </xs:element>
+               </xs:sequence>
+       </xs:complexType>
+       <xs:complexType name="TagType">
+               <xs:all>
+                       <xs:element name="tag-value" type="xs:string" />
+               </xs:all>
+               <xs:attribute name="name" type="xs:string" use="required" />
+       </xs:complexType>
+       <xs:complexType name="TreeSPathType">
+               <xs:attribute name="as-unique-string" type="xs:string"
+                       use="required" />
+       </xs:complexType>
+       <xs:complexType name="TestRunDescriptorType">
+               <xs:all>
+                       <xs:element name="test-run-uuid" type="xs:string" />
+                       <xs:element name="slc-execution-uuid" type="xs:string"
+                               minOccurs="0" />
+                       <xs:element name="slc-execution-step-uuid" type="xs:string"
+                               minOccurs="0" />
+                       <xs:element name="deployed-sytem-id" type="xs:string"
+                               minOccurs="0" />
+                       <xs:element name="test-result-uuid" type="xs:string"
+                               minOccurs="0" />
+               </xs:all>
+       </xs:complexType>
+
+       <!-- TREE TEST RESULT REQUESTS -->
+       <xs:element name="create-tree-test-result-request">
+               <xs:complexType>
+                       <xs:all>
+                               <xs:element name="tree-test-result"
+                                       type="slc:TreeTestResultType" />
+                       </xs:all>
+               </xs:complexType>
+       </xs:element>
+
+       <xs:element name="close-tree-test-result-request">
+               <xs:complexType>
+                       <xs:all>
+                               <xs:element name="result-uuid" type="xs:string" />
+                               <xs:element name="close-date" type="xs:dateTime" />
+                       </xs:all>
+               </xs:complexType>
+       </xs:element>
+
+       <xs:element name="result-part-request">
+               <xs:complexType>
+                       <xs:all>
+                               <xs:element name="result-uuid" type="xs:string" />
+                               <xs:element name="simple-result-part"
+                                       type="slc:SimpleResultPartType" />
+                               <xs:element name="related-elements"
+                                       type="slc:ElementsType" />
+                               <xs:element name="tree-sPath" type="slc:TreeSPathType" />
+                               <xs:element name="test-run-descriptor"
+                                       type="slc:TestRunDescriptorType" />
+                       </xs:all>
+               </xs:complexType>
+       </xs:element>
+
+       <!-- SLC EXECUTION -->
+       <xs:element name="slc-execution" type="slc:SlcExecutionType" />
+       <xs:complexType name="SlcExecutionType">
+               <xs:all>
+                       <xs:element name="status" type="xs:string" />
+                       <xs:element name="type" type="xs:string" />
+                       <xs:element name="host" type="xs:string" />
+                       <xs:element name="user" type="xs:string" />
+                       <xs:element name="steps" minOccurs="0"
+                               type="slc:SlcExecutionStepsType" />
+                       <xs:element name="attributes" minOccurs="0"
+                               type="slc:AttributesType" />
+               </xs:all>
+               <xs:attribute name="uuid" type="xs:string" use="required" />
+       </xs:complexType>
+       <xs:complexType name="SlcExecutionStepsType">
+               <xs:sequence>
+                       <xs:element name="slc-execution-step"
+                               type="slc:SlcExecutionStepType" maxOccurs="unbounded">
+                       </xs:element>
+               </xs:sequence>
+       </xs:complexType>
+       <xs:complexType name="SlcExecutionStepType">
+               <xs:all>
+                       <xs:element name="type" type="xs:string" />
+                       <xs:element name="begin" type="xs:dateTime" />
+                       <xs:element name="log-lines" minOccurs="0">
+                               <xs:complexType>
+                                       <xs:sequence>
+                                               <xs:element name="log-line" type="xs:string"
+                                                       maxOccurs="unbounded" />
+                                       </xs:sequence>
+                               </xs:complexType>
+                       </xs:element>
+               </xs:all>
+               <xs:attribute name="uuid" type="xs:string" use="required" />
+       </xs:complexType>
+       <xs:complexType name="AttributesType">
+               <xs:sequence>
+                       <xs:element name="attribute" type="slc:AttributeType"
+                               minOccurs="0" maxOccurs="unbounded">
+                       </xs:element>
+               </xs:sequence>
+       </xs:complexType>
+       <xs:complexType name="AttributeType">
+               <xs:simpleContent>
+                       <xs:extension base="xs:string">
+                               <xs:attribute name="name" type="xs:string"
+                                       use="required" />
+                       </xs:extension>
+               </xs:simpleContent>
+       </xs:complexType>
+
+       <!-- SLC EXECUTION REQUESTS-->
+       <xs:element name="slc-execution-request">
+               <xs:complexType>
+                       <xs:all>
+                               <xs:element name="slc-execution"
+                                       type="slc:SlcExecutionType" />
+                       </xs:all>
+               </xs:complexType>
+       </xs:element>
+       <xs:element name="slc-execution-steps-request">
+               <xs:complexType>
+                       <xs:all>
+                               <xs:element name="slc-execution-uuid" type="xs:string" />
+                               <xs:element name="steps"
+                                       type="slc:SlcExecutionStepsType" />
+                       </xs:all>
+               </xs:complexType>
+       </xs:element>
+       <xs:element name="slc-execution-status-request">
+               <xs:complexType>
+                       <xs:all>
+                               <xs:element name="slc-execution-uuid" type="xs:string" />
+                               <xs:element name="new-status" type="xs:string" />
+                       </xs:all>
+               </xs:complexType>
+       </xs:element>
+
 </xs:schema>
\ No newline at end of file
diff --git a/org.argeo.slc.core/src/test/java/org/argeo/slc/core/test/tree/TreeTestResultCollectionCastorTest.java b/org.argeo.slc.core/src/test/java/org/argeo/slc/core/test/tree/TreeTestResultCollectionCastorTest.java
new file mode 100644 (file)
index 0000000..b37dfce
--- /dev/null
@@ -0,0 +1,67 @@
+package org.argeo.slc.core.test.tree;\r
+\r
+import static org.argeo.slc.unit.UnitUtils.assertDateSec;\r
+import static org.argeo.slc.unit.test.tree.TreeTestResultTestUtils.createCompleteTreeTestResult;\r
+import static org.argeo.slc.unit.test.tree.TreeTestResultTestUtils.createSimpleResultPartRequest;\r
+\r
+import org.apache.commons.logging.Log;\r
+import org.apache.commons.logging.LogFactory;\r
+import org.argeo.slc.msg.test.tree.CloseTreeTestResultRequest;\r
+import org.argeo.slc.msg.test.tree.CreateTreeTestResultRequest;\r
+import org.argeo.slc.msg.test.tree.ResultPartRequest;\r
+import org.argeo.slc.unit.AbstractSpringTestCase;\r
+import org.argeo.slc.unit.UnitXmlUtils;\r
+import org.argeo.slc.unit.test.tree.UnitTestTreeUtil;\r
+import org.springframework.oxm.Marshaller;\r
+import org.springframework.oxm.Unmarshaller;\r
+import org.springframework.xml.transform.StringResult;\r
+import org.springframework.xml.transform.StringSource;\r
+import org.springframework.xml.validation.XmlValidator;\r
+\r
+public class TreeTestResultCollectionCastorTest extends AbstractSpringTestCase {\r
+       private Log log = LogFactory.getLog(getClass());\r
+\r
+       private Marshaller marshaller;\r
+       private Unmarshaller unmarshaller;\r
+\r
+       @Override\r
+       public void setUp() {\r
+               marshaller = getBean(Marshaller.class);\r
+               unmarshaller = getBean(Unmarshaller.class);\r
+       }\r
+\r
+       public void testMarshUnmarsh() throws Exception {\r
+               TreeTestResult ttr = createCompleteTreeTestResult();\r
+               TreeTestResult ttr2 = createCompleteTreeTestResult();\r
+\r
+               TreeTestResultCollection ttrc = new TreeTestResultCollection();\r
+               ttrc.setId("testCollection");\r
+               ttrc.getResults().add(ttr);\r
+               ttrc.getResults().add(ttr2);\r
+\r
+               StringResult xml = marshallAndValidate(ttrc);\r
+\r
+               TreeTestResultCollection ttrcUnm = (TreeTestResultCollection) unmarshaller\r
+                               .unmarshal(new StringSource(xml.toString()));\r
+\r
+               assertEquals(ttrc.getId(), ttrcUnm.getId());\r
+               assertEquals(ttrc.getResults().size(), ttrcUnm.getResults().size());\r
+               for (TreeTestResult ttrT : ttrc.getResults()) {\r
+                       if (ttrT.getUuid().equals(ttr.getUuid()))\r
+                               UnitTestTreeUtil.assertTreeTestResult(ttr, ttrT);\r
+                       else\r
+                               UnitTestTreeUtil.assertTreeTestResult(ttr2, ttrT);\r
+               }\r
+       }\r
+\r
+       private StringResult marshallAndValidate(Object obj) throws Exception {\r
+               StringResult xml = new StringResult();\r
+               marshaller.marshal(obj, xml);\r
+\r
+               log.info("Marshalled ResultPart Request: " + xml);\r
+\r
+               UnitXmlUtils.assertXmlValidation(getBean(XmlValidator.class),\r
+                               new StringSource(xml.toString()));\r
+               return xml;\r
+       }\r
+}\r
index 41d85d15212dae790e8ce1e8f2ef457c6ccab8db..0133bab8851a98402b6707e4ab98fd5f227edf39 100644 (file)
@@ -3,7 +3,7 @@ log4j.rootLogger=WARN, console
 \r
 ## Levels\r
 # Slc\r
-log4j.logger.org.argeo=TRACE\r
+log4j.logger.org.argeo=DEBUG\r
 \r
 # Castor\r
 log4j.logger.org.exolab.castor=WARN\r