A framework for testing XML

We need a framework that tests applications that produce XML as output.

This project requires expertise in XML, xpath and xml schemas.

A detailed spec is available.

A simple test suite for a simple "hello world" application that uses this framework is shown below. The hello world application is an application that responds to hello command.

This application can be run as

hello sayhello

This command generates the following output

<XMLResponse status="200" statusText="OK" xmlns="">





This application has been compiled and the executable is placed in folder "Release"

To be able to test this application using XMLUnitTest, the test cases must be defined and saved in a file. For this example, let's assume that the test case is helloworldtest.xml. For this example, let's assume that the desired test is checking whether the content of the "Hello" element is "XMLUnitTest".

<TestCase name="helloworldtest" xmlns="">


<Action name="sayhello" >

<Command path="Release/hello" args="sayhello">


<Assert method="Equal" check="/XMLResponse/body/Hello" value="XMLUnitTest" />





To run the testcase, the executable "xmlunittest" is used.

xmlunittest -case [url removed, login to view]

<XMLResponse status="200" statusText="OK" xmlns="">


<TestCaseResult name="helloworldtest" passed="1" failed="0" skipped="0" xmlns="">

<ConfigurationResult name="default" passed="1" failed="0" skipped="0">


<ActionTestResult name="sayhello" passed="1" failed="0" skipped="0">

<Command path="Release/hello" args="sayhello">


<AssertResult status="passed" method="Equal" check="/XMLResponse/body/Hello">











This output indicates that the Assert statement has been evaluated and the executable "Release/hello" has behaved as expected and generated a Hello element that contains the the text node "XMLUnitTest".

Evner: XML

Se mere: testing test, xml &, a name for, testing framework, test case, test applications, hello world, framework c, xml http, xml application, xmlns, testing content, http command, xml quot, schemas, statement application, test framework, method available, suite application project, xml simple, generates, check output, action name, testing text, Method Statement

Om arbejdsgiveren:
( 121 bedømmelser ) Belfast, Ireland

Projekt ID: #265395