IBM BPM, V8.0.1, All platforms > Authoring services in Integration Designer > Testing modules > Component testing > Automating tests using Ant scripts > Use Ant scripts for testing in headless WebSphere BPM
Viewing the XML output file
When you finish your component testing, an XML output file is generated. You can view the XML output file to determine the results of your testing and see what tests cases passed or failed. The output file lists the tests that passed and failed and provides the start and stop times, which helps you spot performance problems. The start time and stop time of the entire test suite and each test case is listed in microseconds. These start and stop times are helpful in diagnosing applications with performance problems, such as a lengthy time period linked to a specific function that is a possible source of a bottleneck.
To view the XML output file:
Procedure
- Open the file. By default, it is generated into the local directory where the Ant script resides.
- Examine the XML output file for the following result statements:
- result="fail"
- result="passed"
Example
The following example code shows you some failed and passed results that are typically returned in an XML output file:
<?xml version="1.0" encoding="UTF-8"?> <resource name="OrderTest"> <testsuite end="1213022103171" name="OrderFVT" start="1213022101062" totalTests="7"> <testcase end="1213022101750" name="test_checkAvailability" result="fail" start="1213022101093"> <variation end="1213022101703" name="Passed" start="1213022101093"> <severity>pass</severity> <description>Passed pass</description> <resource>OrderTest</resource> </variation> <variation end="1213022101750" name="Failed" start="1213022101703"> <severity>fail</severity> <description> junit.framework.AssertionFailedError: Variation:[Failed] Variable:[quantity] FAIL( Input:[39] Not_EQ Expected:[29] ) at junit.framework.Assert.fail(Assert.java:47) at com.ibm.ccl.soa.test.ct.runtime.datatable.AbstractOutputDataEntry.fail(Unknown Source) at com.ibm.ccl.soa.test.ct.runtime.datatable.AbstractOutputDataEntry.processAssertEvent(Unknown Source) at com.ibm.ccl.soa.test.ct.runtime.datatable.AbstractOutputDataEntry.assertValue(Unknown Source) at com.ibm.ccl.soa.test.ct.runtime.datatable.AbstractOutputDataEntry.setVariableValueAndAssert(Unknown Source) at com.ibm.ccl.soa.test.ct.runtime.datatable.DataSet.setOutputVariableValueAndAssert(Unknown Source) at com.ibm.ccl.soa.test.ct.runtime.junit.TestCaseDelegate.setOutputVariableValueAndAssert(Unknown Source) at com.ibm.ccl.soa.test.ct.runtime.junit.DataDrivenTestCase.setOutputVariableValueAndAssert(Unknown Source) at test.OrderFVT.test_checkAvailability(OrderFVT.java:74) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:79) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:618) at com.ibm.ccl.soa.test.ct.runtime.junit.TestCaseDelegate.runTest(Unknown Source) at com.ibm.ccl.soa.test.ct.runtime.junit.TestCaseDelegate.runBare(Unknown Source) at com.ibm.ccl.soa.test.ct.runtime.junit.DataDrivenTestCase.runBare(Unknown Source) at junit.framework.TestResult$1.protect(TestResult.java:106) at junit.framework.TestResult.runProtected(TestResult.java:124) at junit.framework.TestResult.run(TestResult.java:109) at junit.framework.TestCase.run(TestCase.java:118) at com.ibm.wbit.comptest.ct.runtime.runner.CTJUnitRunner.test(Unknown Source) at com.ibm.wbit.comptest.ct.servlet.TestServlet.invokeTestBean(Unknown Source) at com.ibm.wbit.comptest.ct.servlet.TestServlet.doPost(Unknown Source) at com.ibm.wbit.comptest.ct.servlet.TestServlet.doGet(Unknown Source) at javax.servlet.http.HttpServlet.service(HttpServlet.java:743) at javax.servlet.http.HttpServlet.service(HttpServlet.java:856) at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1081) at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:550) at com.ibm.ws.wswebcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:478) at com.ibm.ws.webcontainer.webapp.WebApp.handleRequest(WebApp.java:3391) at com.ibm.ws.webcontainer.webapp.WebGroup.handleRequest(WebGroup.java:267) at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:811) at com.ibm.ws.wswebcontainer.WebContainer.handleRequest(WebContainer.java:1455) at com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:115) at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:458) at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewInformation(HttpInboundLink.java:387) at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.ready(HttpInboundLink.java:267) at com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.sendToDiscriminators(NewConnectionInitialReadCallback.java:214) at com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.complete(NewConnectionInitialReadCallback.java:113) at com.ibm.ws.tcp.channel.impl.AioReadCompletionListener.futureCompleted(AioReadCompletionListener.java:165) at com.ibm.io.async.AbstractAsyncFuture.invokeCallback(AbstractAsyncFuture.java:217) at com.ibm.io.async.AsyncChannelFuture.fireCompletionActions(AsyncChannelFuture.java:161) at com.ibm.io.async.AsyncFuture.completed(AsyncFuture.java:136) at com.ibm.io.async.ResultHandler.complete(ResultHandler.java:195) at com.ibm.io.async.ResultHandler.runEventProcessingLoop(ResultHandler.java:743) at com.ibm.io.async.ResultHandler$2.run(ResultHandler.java:873) at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1473) </description> <resource>OrderTest</resource> </variation> </testcase> <testcase end="1213022101828" name="test_checkPurchaseOrder" result="fail" start="1213022101750"> <variation end="1213022101781" name="Passed" start="1213022101750"> <severity>pass</severity> <description>Passed pass</description> <resource>OrderTest</resource> </variation> <variation end="1213022101828" name="Failed" start="1213022101781"> <severity>fail</severity> <description> junit.framework.AssertionFailedError: Variation:[Failed] Variable:[valid] FAIL( Input:[true] Not_NEQ Expected:[true] ) ... </description> <resource>OrderTest</resource> </variation> </testcase> <testcase end="1213022102281" name="test_takeOrder" result="fail" start="1213022101828"> <variation end="1213022102140" name="Passed" start="1213022101828"> <severity>pass</severity> <description>Passed pass</description> <resource>OrderTest</resource> </variation> <variation end="1213022102281" name="Failed" start="1213022102140"> <severity>fail</severity> <description> junit.framework.AssertionFailedError: Variation:[Failed] Variable:[Item_2] Path:[id] FAIL( Input:[rpc3453] Not_EQ Expected:[bpc3453] ) ... </description> <resource>OrderTest</resource> </variation> </testcase> <testcase end="1213022102734" name="test_components" result="pass" start="1213022102281"> <variation end="1213022102500" name="Passed" start="1213022102281"> <severity>pass</severity> <description>Passed pass</description> <resource>OrderTest</resource> </variation> <variation end="1213022102734" name="Failed" start="1213022102500"> <severity>pass</severity> <description>Failed pass</description> <resource>OrderTest</resource> </variation> </testcase> <testcase end="1213022103000" name="test_flowData" result="error" start="1213022102734"> <variation end="1213022103000" name="Passes" start="1213022102734"> <severity>fail</severity> <description> com.ibm.wbit.comptest.ct.service.CTRuntimeException: com.ibm.websphere.sca.ServiceRuntimeException: Fail to invoke [sca.component.java.impl.CheckAvailabilityImpl.public java.math.BigInteger sca.component.java.impl.CheckAvailabilityImpl.checkAvailability(commonj.sdo.DataObject) throws com.ibm.websphere.sca.ServiceBusinessException] for component [{OrderEntry}CheckAvailability]: caused by: java.lang.NullPointerException at com.ibm.wbit.comptest.ct.runtime.service.CTServiceProxy.doInvoke(Unknown Source) .... </description> <resource>OrderTest</resource> </variation> </testcase> <testcase end="1213022103093" name="test_async" result="fail" start="1213022103000"> <variation end="1213022103046" name="Passed" start="1213022103000"> <severity>pass</severity> <description>Passed pass</description> <resource>OrderTest</resource> </variation> <variation end="1213022103093" name="Failed" start="1213022103046"> <severity>fail</severity> <description> junit.framework.AssertionFailedError: Variation:[Failed] Variable:[quantity] FAIL( Input:[29] Not_GT Expected:[29] ) ... </description> <resource>OrderTest</resource> </variation> </testcase> <testcase end="1213022103171" name="test_error" result="pass" start="1213022103093"> <variation end="1213022103171" name="Default" start="1213022103093"> <severity>pass</severity> <description>Default pass</description> <resource>OrderTest</resource> </variation> </testcase> </testsuite> </resource>
Code fragment Description 1 Result of failed. 2 Result of passed.