Previous Topic

Next Topic

Book Contents

Book Index

Defining a New Project

The Test Execution Environment provides you with the opportunity to combine multiple test cases into logical groups. You may then run the whole collection at once and save yourself the trouble of executing each test case separately. These groups are called test projects.

A default test project, the System Project, is available when you execute a single test case, a set of test cases or all test cases. The System Project is configured so that test cases are executed consecutively and each test case is executed only once. Default test case configurations and default system properties are used.

The following is the project descriptor DTD for defining a new TEE project.

DTD Element

Description

<!ELEMENT project (name,description,execution,options)>

Indicates that the block that follows contains information about the test project execution.

Elements describing the properties of a test project

<!ATTLIST project tree:immutable NMTOKEN #REQUIRED tree:modelref NMTOKEN #REQUIRED tree:proctype CDATA #REQUIRED xmlns:tree CDATA #REQUIRED>

Required. Contains the root element of the project descriptor.

The attributes must be exactly the same as the ones given here.

<!ELEMENT name (#PCDATA)>

Required. Contains the name of the project.

<!ELEMENT description (#PCDATA)>

Optional. Contains the project's description.

Elements describing the properties for the execution of a test project

<!ELEMENT execution (mode,punit,duration,tunit,timeout,tcOverloading,testcases)>

Required. Describes all execution options of a project.

<!ELEMENT mode (#PCDATA)>

Contains information about the execution mode of the projects. This attribute has two values:

  • consec – Test cases will be executed one after another.
  • simul – All tests will be executed in parallel.

Currently, only consec mode is supported.

<!ELEMENT punit (#PCDATA)>

Required. Contains the execution of punit – progress unit. This tag defines the units needed to measure the duration defined within the duration tag. The possible values are: pass, ms, sec, min, hour and day. When the duration time elapses no more test cases are executed. If there are test cases still running, they are waited to finish. The pass value defines whether you want to execute the project several times. The number of repetitions is specified with the duration tag.

<!ELEMENT duration (#PCDATA)>

Required. Contains the duration you want to specify for a test case execution. It is a whole positive number with a max value java.lang.Integer.MAX_VALUE.

<!ELEMENT tunit (#PCDATA)>

Required. Contains the execution tunit – timeout unit. Defines the units used for measuring the time for a pause between the execution of the different test cases. The possible values are: ms, sec, min, hour and day. The amount of units for this tag is specified in the timeout tag. Currently, this element is not supported.

<!ELEMENT timeout (#PCDATA)>

Required. Contains the timeout you want to wait after test case execution completes until the next test case is started. Its value can be a whole positive number smaller than java.lang.Integer.MAX_VALUE. This tag defines the amount of units, specified with the tunit tag, you want to wait until the next test case is processed. Currently, this element is not supported.

<!ELEMENT tcGC (#PCDATA)>

Optional. Indicates if the Garbage Collector should be invoked automatically after each test case execution.

<!ELEMENT tcOverloading (#PCDATA)>

Optional. Contains the number of times the test case will be executed during test project execution. The value can be a whole positive number smaller that java.lang.Integer.MAX_VALUE.

Elements describing the properties of the test cases included in a test project

<!ELEMENT testcases (testcase+)>

Required. Contains a list of all test cases in the project. There must be one or more testcase tags.

<!ELEMENT testcase (location,config?)>

Required. Contains information about a test case included in the project.

<!ELEMENT location (#PCDATA)>

Required. Contains the location of the test case bundle JAR.

<!ELEMENT config (#PCDATA)>

Optional. Contains the available external configurations for the current test case. The configurations placed in ../../../tee/sa/configs directory are merged with the test case configurations in the test case JAR file. If the external configurations hold different values they are used for the test case execution.

External configuration files are a powerful way to ensure that certain conditions are met before a test case is executed. For example, they can assert if some system properties have the values needed for the test project execution or if some additional bundles are active, etc.

<!ELEMENT options (option)>

Optional. Contains the system properties of the TEE that must be changed for the test project execution.

<!ELEMENT option (name,value)>

Contains information about a single TEE system property that must be changed according to the current test project execution.

You cannot change the values of the tee.core.auto.* and tee.core.base.projects system properties.

<!ELEMENT name (#PCDATA)>

Contains the name of the system property represented as an option. See the "System Properties" section from the Setup Guide for more information about the available TEE system properties.

<!ELEMENT value (#PCDATA)>

Contains the new value that you want to set to the specified system property.

A test project example:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<project tree:immutable="true" tree:modelref="sa_project"
tree:proctype="" xmlns:tree="https://www.bosch.io/tee/tree">
  <name>My Project</name>  
  <description>My demo project for the TEE.</description>
  <execution>
    <mode>consec</mode>
    <punit>pass</punit>
    <duration>1</duration>
    <tunit>sec</tunit>
    <timeout>10</timeout>
    <tcOverloading>1</tcOverloading>
    <tcGC>false</tcGC>
    <testcases>
      <testcase>
        <location>my_test_case.jar</location>
        <config>my_tc-config.xml</config>
      </testcase>      
      <testcase>
        <location>my_second_test_case.jar</location>
      </testcase>
    </testcases>
  </execution>
  <options>
    <option>
      <name>tee.core.dump.allLogs</name>
      <value>true</value>
    </option>
  </options>
</project>  

This project is executed only once. The two test cases included in it are executed one after the other. The my_test_case.jar test case needs an external configuration to ensure its proper work which is specified within the <config> tag. When the project is started information about the execution of each test case within it is printed line by line on the console. This is due to the changed value of the tee.core.dump.allLogs system property, defined within the option tag.