cancel
Showing results for 
Search instead for 
Did you mean: 

Testing Detroubulator tool u0096 multiple message mapping within one test file

Former Member
0 Kudos

<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.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Luc

Thanks for trying out the tool!

The <program> element represents a single mapping program and can only occur once. In other words, it's not possible to test more than one mapping program using the same test file.

We are, however, thinking about ways to test several mapping programs at once. It's on the list of features we're considering for future versions

Thanks again,

Morten Wittrock

Answers (0)