How to Run / Debug Java mapping using Testview
In this article we would show how to use Testview plugin for debugging Java mappings created for SAP PI. We are assuming you have already NWDS and Testview installed and know how to create Java mappings.
Simple mapping implemented
First of all, let’s create simple Java mapping that would just get payload, convert it to String and then output it with no actual transformation.
All our examples published on google code . Please contact us if you want to add some specific example featured by you.
Create Testview Configuration file.
Here’s something new that Testview brings into your project. Generally speaking Testview configuration is a XML file what contains input data, parameters and output of Java Mapping or UDF. Needless to say you could create several Tesview configuration files to test different test cases. To create new Configuration file select File > New.. > Other > New Testview Confuguration
In wizard specify configuration file name (it should end with .xml) and location.
Select name of Java mapping to run
That’s it, configuration file is created.
Configure Testview Configuration.
At next step we need to specify XML to run and if we actually want to save results. Open Tetsview configuration file, and select Input > InputFile . Here you can specify link to existing XML file or specify content stored in the Testview Configuration file. Also, click on tab Output and select checkbox if you want to save output XML. Again, you could specify file on disk or opt to store this XML internally.
Run / Debug Testview Configuration.
To run or debug original mapping using given configuration, right click on Testview Configuration file and select Run As / Debug as > Testview.
Finally, you will see output in console and if you are about to debug you could set up a breakpoint and see all you need in Debug perspective.