Create a Test Session using an XML configuration file

Zen4Sync allows you to create a Test Session using an XML file.

XML configuration file example

Test session XML configuration file example
<?xml version="1.0" encoding="utf-8"?>
<zen4SyncTestSession>
    <testSession name="Sample test session" createdOn="2011-03-10T09:00:00Z" scenarioId="6fcfd98d-5aee-4708-8561-4d477fa82894">
        <clientSessions>
            
            <!-- First client -->
            <clientSession enableLog="True">
                <name>client #1</name>
                <loadTestServerId>16eaa41e-e9da-4a2b-8a92-767bd2cca9fa</loadTestServerId>
                <clientEndPointBinding>
                    <binding>netTcpBinding</binding>
                    <adress>net.tcp://LTS1/zen4sync</adress>
                </clientEndPointBinding>
                <scheduledStartDateTime>2011-11-04T01:00:00Z</scheduledStartDateTime>
                <!--
                    We indicate which scenario we want the client to execute.
                    And for each activityItem in the scenario we specifiy metadata which will be used by this client.
                -->
                <scenario id="b80f5358-c44f-4a2b-a2bd-bad5f79b5a0e">
                    <activityItem id="aac891bb-0f67-4b55-b108-37985e4dfb8d" activityType="SQLExecutionActivity">
                        <sqlExecutionActivityContext>
                            <parameters count="2">
                                <parameter name="@Price" type="int">120</parameter>
                                <parameter name="@ID" type="string">ABC</parameter>
                            </parameters>
                        </sqlExecutionActivityContext>
                    </activityItem>
                    <activityItem id="cdcb0b74-0e36-4122-a0cf-1fcaf524a0a2" activityType="MergeSyncActivity">
                        <mergeSyncActivityContext>
                            <connectionString>Data Source=C:\MyDB_A.sdf</connectionString>
                        </mergeSyncActivityContext>
                    </activityItem>
                </scenario>
            </clientSession>

            <!-- Second client -->
            <clientSession enableLog="True">
                <name>client #2</name>
                <loadTestServerId>16eaa41e-e9da-4a2b-8a92-767bd2cca9fa</loadTestServerId>
                <clientEndPointBinding>
                    <binding>netTcpBinding</binding>
                    <adress>net.tcp://LTS1/zen4sync</adress>
                </clientEndPointBinding>
                <scheduledStartDateTime>2011-11-04T01:00:00Z </scheduledStartDateTime>
                <!-- Notice that the scenario differs from the first client. -->
                <scenario id="ca9db016-f3ac-49b8-a725-8e684fba152a">
                    <activityItem id="dbe239de-b71c-469e-91d1-b1b03f43fffd">
                        <sqlExecutionActivityContext>
                            <parameters count="2">
                                <parameter name="@Price" type="int">350</parameter>
                                <parameter name="@ID" type="string">ABC</parameter>
                            </parameters>
                        </sqlExecutionActivityContext>
                    </activityItem>                    
                    <!-- 
                        Notice that even though the scenario differs from the first client to the second, it uses the same synchronization activityItem.
                        The id attribute of the following activityItem is the same as the second activityItem of the first client.
                        We only modify the supplied metadata.
                        A scenario can (and is encouraged to) reuse existing activityItem.
                    -->
                    <activityItem id="cdcb0b74-0e36-4122-a0cf-1fcaf524a0a2" activityType="MergeSyncActivity">
                        <mergeSyncActivityContext>
                            <connectionString>Data Source=C:\MyDB_B.sdf</connectionString>
                        </mergeSyncActivityContext>
                    </activityItem>
                </scenario>
            </clientSession>

            <!-- Thrid client -->
            <clientSession enableLog="True">
                <name>client #3</name>
                <loadTestServerId>16eaa41e-e9da-4a2b-8a92-767bd2cca9fa</loadTestServerId>
                <clientEndPointBinding>
                    <binding>netTcpBinding</binding>
                    <adress>net.tcp://LTS1/zen4sync</adress>
                </clientEndPointBinding>
                <scheduledStartDateTime>2011-11-04T01:00:00Z </scheduledStartDateTime>
                <!-- Again, notice this is a different scenario. -->
                <scenario id="b4fd5d42-1e42-47c6-9c20-4fb8c912d213">
                    <!--
                        Again, the following activityItem has already been used by the second client scenario.
                        We only modify the supplied metadata.
                    -->
                    <activityItem id="dbe239de-b71c-469e-91d1-b1b03f43fffd">
                        <!--
                            This scenario involves two executions of this activityItem.
                            We want to use different metadata for each execution.
                            So we use the executionTime attribute to specify which metadata should be used for each execution.
                        -->
                        <!-- These metadata will be used for the first execution of the activityItem. -->
                        <sqlExecutionActivityContext executionTime="1">
                            <parameters count="2">
                                <parameter name="@Price" type="int">1000</parameter>
                                <parameter name="@ID" type="string">ABC</parameter>
                            </parameters>
                        </sqlExecutionActivityContext>
                        <!-- Whereas these metadata will be used for the second execution of the activityItem. -->
                        <sqlExecutionActivityContext executionTime="2">
                            <parameters count="2">
                                <parameter name="@Price" type="int">3000</parameter>
                                <parameter name="@ID" type="string">ABC</parameter>
                            </parameters>
                        </sqlExecutionActivityContext>
                    </activityItem>
                    <!--
                        Notice that this scenario involves two executions of the MergeSync activityItem.
                        Though we want to use the exact same metadata for both executions, so we only specify one context.
                        The lack of executionTime attribute implies that the same metadata will be used for both executions.
                    -->
                    <activityItem id="cdcb0b74-0e36-4122-a0cf-1fcaf524a0a2" activityType="MergeSyncActivity">
                        <mergeSyncActivityContext>
                            <connectionString>Data Source=C:\MyDB_C.sdf</connectionString>
                        </mergeSyncActivityContext>
                    </activityItem>
                </scenario>
            </clientSession>
            
        </clientSessions>
    </testSession>
</zen4SyncTestSession>

Sections description

Last edited Mar 10, 2011 at 3:46 PM by Christophe_, version 1

Comments

No comments yet.