Skip to Content
0
Former Member
Nov 07, 2006 at 11:37 AM

Testing Detroubulator tool u0096 multiple message mapping within one test file

34 Views

<b>Issue</b>

I am testing the Detroubulator tool for unit testing message mappings.

When I was testing the tool I was wondering if itÂ’s possible to test multiple message mappings within one test file.

<b>Already tried</b>

I tried already the following options:

Within the <configuration>-tag I added more message mappings, name spaces and software component versions IDÂ’s

I added more then one testcases with deferent inputdocuments and Xpath content assertions. See the code below

<?xml version="1.0" encoding="UTF-8"?>
<testsuite>
	<server>
		<configuration>
			<parameter name="host">uphdxi</parameter>
			<parameter name="gateway">sapgw13</parameter>
			<parameter name="client">100</parameter>
			<parameter name="user">cursist2</parameter>
			<parameter name="sysnum">13</parameter>
			<parameter name="progid">AI_RUNTIME_DXI</parameter>
		</configuration>
	</server>
	<program type="message">
		<configuration>
			<parameter name="name">MM_Bestand</parameter>
			<parameter name="ns">urn://UPHANTIS/MasterClass_SAP_XI/Oefening5/Cursist2</parameter>
			<parameter name="swcv.id">c44659e04c6e11dbb747d355c0a80a32</parameter>
			
			<parameter name="name">MM_File_to_File</parameter>
			<parameter name="ns">urn://UPHANTIS/MasterClass_SAP_XI/Oefening7_cursist3</parameter>
			<parameter name="swcv.id">f9f55f904c6f11db9f27d355c0a80a32</parameter>

		</configuration>
	</program>
	<reporting>
		<testreport type="console">
			<configuration>
				<parameter name="dumpdir">dumpdir</parameter>
			</configuration>
		</testreport>
		<testreport type="xml">
			<configuration>
				<parameter name="file">testreport.xml</parameter>
				<parameter name="dumpdir">report_xml_dir</parameter>
			</configuration>
		</testreport>
		<testreport type="html">
			<configuration>
				<parameter name="file">testreport.html</parameter>
				<parameter name="dumpdir">report_html_dir</parameter>
			</configuration>
		</testreport>
	</reporting>
	<tests>
		<testcase>
			<inputdocument>testcase1.xml</inputdocument>
			<assertions>
				<content xpath="/*/Klantnaam != ''">Customer name is empty</content>
				<content xpath="count(/*/@Orderregel) != 1">There should be exactly one Orderregel element</content>
			</assertions>
		</testcase>
		
		<testcase>
			<inputdocument>testcase2.xml</inputdocument>
			<assertions>
				<content xpath="/*/FirstName = 'adsfasf'">FirstName does not match with adsfasf</content>
			</assertions>
		</testcase>		
		
	</tests>
</testsuite>

<b>Result</b>

When running Detroubulator with this test file, Detroubulator finished successfully the first test case. It also tries to execute the second test case but shows an error that it could not map the second test case with the first mapping program.

<i>An unexpected mapping exception occured (EXCEPTION_DURING_EXECUTE,E,204,0,com/sap/xi/tf/_MM_Bestand_,com.sap.aii.utilxi.misc.api.BaseRuntimeException,RuntimeException in Message-Mapping transformatio~,)</i>

The second test case should not try to map with the first message mapping but within the second so my question is if it is possible to test multiple message mappings within one test file and how to acknowledge this.

Hope that someone could help me out.