Weblog

Problem with composite tests in SOA Suite 11.1.1.2.0

Today i took a look at the test framework withing the 11g suite. I encountered a strange problem in the test framework of the SOA Suite but before i go into details i will explain the case.

I have made the following sca component that returns a greeting. The input is quite simple a name and a greeting type (‘Hello’ or ‘Bye’). The message is routed depending on the greeting type to a BPEL which response the greeting with a return greeting.

A quite simple component not useful but good for this example. I deployed this component by uploading the generated Jar file to the server. Then i tested it by manual sending to requests from the enterprise manager:

<ns1:process>
<ns1:input>Arnold</ns1:input>
<ns1:greeting>Hello</ns1:greeting>
</ns1:process>

ManualInvokeArnoldHello

I have also tested the Bye greeting by sending the following request from the enterprise manager:

<ns1:process>
<ns1:input>Arnold</ns1:input>
<ns1:greeting>Bye</ns1:greeting>
</ns1:process>

ManualInvokeArnoldBye

To automate the tests i created a test suite where i added the same test scenario’s an Hello Message and a Bye message. You see here the flow defined in JDeveloper for the ‘Bye’ case.
TestCaseTestFlow
The blue circle in the exposed service shows us that an initial message is defined. On the wire between the exposed service and the Mediator you see a document with a green arrow. This shows that there are actions defined on this wire. It could be an emulation but in our case an response assert to validate the response message from the Mediator to the exposed service.

Initiation message
TestCaseTestFlowInvoke

Response Assert
TestCaseTestFlowAssertOutput

To activate the test we have to redeploy the application.

After deployment go to the enterprise manager and loging
TestCaseInvokeStep1

Select the application that’s available in the soa-infra
TestCaseInvokeStep2
Select the tab UnitTest and check the items you want to test. I this case all of them.
TestCaseInvokeStep3
Start the test by giving it a name. You can also change some test parameters but in this case we leave them default.
TestCaseInvokeStep4
Refresh to see the results of the unit test.

After time i expected to have two successful completed unittests. But the test case that tests the bye path fails.

TestCaseInvokeStep5

You can see directly why this testcase failed. In the testcase we expect the value ‘Bye Theo’ but it found ‘Hello Theo’. To check out what went wrong you click on the link of the faulted testcase. In this case ID 1005.

TestCaseInvokeStep6
You get an overview of all the instances that are connected to the testcase that’s executed.

We see that for instance 1005 (the faulted instance initiated by the ‘bye’ test case). Looking closer to the flow we see that the BPELHelloWorld has been executed instead of the BPELByeWorld. So we click on the mediator that has routed the message to the wrong BPEL.

TestCaseInvokeStep7

We see now in detail the execution of the mediator. We see the evaluation of the different xpath expressions.
TestCaseInvokeStep8
The first evaluation results False but why? I have tested the same application in two way’s:

  1. I have executed only the bye testcase ( test fails result=’Hello Theo’)
  2. I have manual tested the webservice ( test passes result = ‘Bye Theo’ )

Making your SOA composites including their unit test goes rapidly but in this case there is still some work to do with the testframework.

This test has been preformed with the following components:

  1. Weblogic Server 11g rel 1. (10.3.2.0)
  2. Fusion Middleware 11g Rel 1 (11.1.1.2.0)

UPDATE (09-12-2009)

On request of Tom i have added this screen print with the requested information.

TestCaseInvokeAuditTrail

I have also put the project online to download

Share and Enjoy:
  • del.icio.us
  • Google Bookmarks
  • DZone
  • LinkedIn
  • SphereIt
  • StumbleUpon
  • Technorati

2 Responses to “Problem with composite tests in SOA Suite 11.1.1.2.0”

  1. Tom hofte Says:

    Strange..

    Can you add a screenshot in which the input payload element is unfolded. Just to make sure that the input really contains ‘Bye’ without any spaces or any other layout characters….:)

  2. Theo van Arem Says:

    Hi Tom,

    I have added an other screen print and have made the project files available for download.

    It’s strange that this validation goes wrong.

Leave a Reply

Technology