Code Coverage XSD

The following is the code coverage XSD which you should use to validate the XML generated by your code coverage tool. This document is available in the following location: <CA Framework installation>\CodeAnalysis\CodeCoverage.xsd.

<?xml version="1.0" encoding="utf-8"?>
<xs:schema id="data" xmlns="" xmlns:xs="http://www.w3.org/2001/XMLSchema">
  <xs:element name="coverage">
    <xs:complexType>
      <!--type will be method when defined as a child to class or line when defined as a child to method-->
      <xs:attribute name="type" type="xs:string" />
      <!--hits for the definition file will be 0, the update file will define the hits count-->
      <xs:attribute name="hits" type="xs:string" />
      <!--the total count will be sent with both the definition and update file, both counts will match-->
      <xs:attribute name="total" type="xs:string" />
      <!--this will be an empty string for the definition file, the line numbers will be sent in the update file delimited by a colon-->
      <xs:attribute name="lines" type="xs:string" />
    </xs:complexType>
  </xs:element>
  <xs:element name="data">
    <xs:complexType>
      <xs:choice minOccurs="0" maxOccurs="unbounded">
        <xs:element ref="coverage" />
        <xs:element name="class">
          <xs:complexType>
            <xs:sequence>
              <xs:element name="sourcefile" minOccurs="0" maxOccurs="unbounded">
                <xs:complexType>
                  <!--full path to the code file-->
                  <xs:attribute name="name" type="xs:string" />
                </xs:complexType>
              </xs:element>
              <xs:element ref="coverage" minOccurs="0" maxOccurs="unbounded" />
              <xs:element name="method" minOccurs="0" maxOccurs="unbounded">
                <xs:complexType>
                  <xs:sequence>
                    <xs:element ref="coverage" minOccurs="0" maxOccurs="unbounded" />
                  </xs:sequence>
                  <!--
                  	<field_signature> ::= <field_type>
                  	<field_type>      ::= <base_type>|<object_type>|<array_type>
                  	<base_type>       ::= B|C|D|F|I|J|S|Z
                  	<object_type>     ::= L<fullclassname>;
                  	<array_type>      ::= [<field_type>

                  	The meaning of the base types is as follows:
                  	B byte signed byte
                  	C char character
                  	D double double precision IEEE float
                  	F float single precision IEEE float
                  	I int integer
                  	J long long integer
                  	L<fullclassname>; ... an object of the given class
                  	S short signed short
                  	Z boolean true or false
                  	[<field sig> ... array
                  	
                  	example signature for a java method 'doctypeDecl' with 3 string params and a return type void
                  	
                  		doctypeDecl : (Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V
                  		
                  	refer to org.apache.bcel.classfile.Utility for more information on signatureToString
                  -->
                  <xs:attribute name="name" type="xs:string" />
                  <!--method invokation count, this will be 0 for the definition file-->
                  <xs:attribute name="inv" type="xs:string" />
                </xs:complexType>
              </xs:element>
            </xs:sequence>
            <xs:attribute name="name" type="xs:string" />
          </xs:complexType>
        </xs:element>
      </xs:choice>
    </xs:complexType>
  </xs:element>
</xs:schema>