programming4us
programming4us
DATABASE

Oracle SOA Suite 11g R1 : Unit-testing the Composite Application - Automated unit testing (part 1) - Creating the unit test

- How To Install Windows Server 2012 On VirtualBox
- How To Bypass Torrent Connection Blocking By Your ISP
- How To Install Actual Facebook App On Kindle Fire
2/17/2015 3:45:29 AM

Introducing the built-in testing framework

Oracle SOA Suite 11g provides a testing framework that allows you to:

  • Define tests, assertions, and emulations using JDeveloper
  • Run these tests either from the EM console or on the command line using ANT
  • Review the test results from the EM console or as a JUnit report

There are three parts to a test case:

  1. An Initiation of a composite defines the service and operation invoked along with the test data.
  2. Emulation defines the message or fault returned from a reference or component invoked through a synchronous response or a callback without executing the component or referenced service.
  3. An Assertion compares the message or part of the message over an SCA wire against the expected data.

A single test includes definitions of the initiation, emulations, and assertions. The test suite is defined in the composite project and is deployed along with the composite to the server, so it can be initiated from the EM console.

Tutorial: Automated unit testing

The best way to learn how to build and execute a unit test is to try an example.

Modify POProcessing to add a unit test, which sets the inbound message, the simulation message, and two assertions. The inbound message is a valid order with a valid credit card and order total between 1000 and 5000. This triggers the approveLargeOrder process but not the human task.

The simulated message is the message returned from the credit validation service as a VALID response.

The first assertion is on the data being passed to the WriteFile service, checking that the value of status = 'approved', which is the expected value for this input data.

The second assertion is on the data being passed to FulfillmentProcess, checking that the customer ID is 9999—since the customer ID is actually 1111, this test will always fail. This last assertion shows what happens when the data being checked is not the expected value.

Creating the unit test

Use JDeveloper to create a unit test for POProcessing.

  1. Open the POProcessing project in JDeveloper. In the Application navigator expand the SOA Content folder and right-click on the test suites folder.
  2. Select Create Test Suite.
    Creating the unit test
  3. Name the test suite logicTest.
    Creating the unit test
  4. Click on OK.
  5. Name the test TestDelivery.
    Creating the unit test
  6. Click on OK.

Notice that the composite view changes slightly to show you are in Unit Test creation mode now. The swim lanes on the left and right are yellow. You can return to the normal composite editor by selecting the Return to SOA composite diagram button at the top of the window.

Other  
  •  SQL Server 2012 : Using SQLdiag Configuration Manager (part 4) - Adding Your Own Custom Collectors,Saving and Using a SQLdiag Configuration
  •  SQL Server 2012 : Using SQLdiag Configuration Manager (part 3) - Feature-Specific Custom Diagnostics, Capturing Extended Events
  •  SQL Server 2012 : Using SQLdiag Configuration Manager (part 2) - Backing Up Diagnostic Data Already Available, Analysis Services Custom Collectors
  •  SQL Server 2012 : Using SQLdiag Configuration Manager (part 1) - Configuring SQLdiag Data Collection Using Diag Manager
  •  SQL Server 2012 : Native File Streaming - Storing and Retrieving FILESTREAM Data
  •  SQL Server 2012 : Native File Streaming - Creating a FILESTREAM-Enabled Database
  •  SQL Server 2012 : Native File Streaming - Enabling FILESTREAM
  •  SQL Server 2012 : Native File Streaming - Traditional BLOB Strategies, Introducing FILESTREAM
  •  SQL Server 2012 : Consolidating Data Capture with SQLdiag - Getting Friendly with SQLdiag (part 2) - Using SQLdiag as a Service
  •  SQL Server 2012 : Consolidating Data Capture with SQLdiag - Getting Friendly with SQLdiag (part 1) - Using SQLdiag as a Command-line Application
  •  
    Top 10
    - Microsoft Visio 2013 : Adding Structure to Your Diagrams - Finding containers and lists in Visio (part 2) - Wireframes,Legends
    - Microsoft Visio 2013 : Adding Structure to Your Diagrams - Finding containers and lists in Visio (part 1) - Swimlanes
    - Microsoft Visio 2013 : Adding Structure to Your Diagrams - Formatting and sizing lists
    - Microsoft Visio 2013 : Adding Structure to Your Diagrams - Adding shapes to lists
    - Microsoft Visio 2013 : Adding Structure to Your Diagrams - Sizing containers
    - Microsoft Access 2010 : Control Properties and Why to Use Them (part 3) - The Other Properties of a Control
    - Microsoft Access 2010 : Control Properties and Why to Use Them (part 2) - The Data Properties of a Control
    - Microsoft Access 2010 : Control Properties and Why to Use Them (part 1) - The Format Properties of a Control
    - Microsoft Access 2010 : Form Properties and Why Should You Use Them - Working with the Properties Window
    - Microsoft Visio 2013 : Using the Organization Chart Wizard with new data
    REVIEW
    - First look: Apple Watch

    - 3 Tips for Maintaining Your Cell Phone Battery (part 1)

    - 3 Tips for Maintaining Your Cell Phone Battery (part 2)
    programming4us programming4us
    programming4us
     
     
    programming4us