Running SCA Tests from Maven

In this post, let’s look at how we can run SCA test suites from Maven.

To get started, we are going to need a test.  Let’s set up our process to add two numbers.  Go ahead and open the XML Schema for the inputs and outputs and change it to take two int’s as input and return a single int as output, as shown below:


Now update the assign activity’s copy rule in the BPEL process to add the two numbers together.  The “from” part of the copy rule should look like this:

$inputVariable.payload/client:a + $inputVariable.payload/client:b

Now, let’s define a test.

Right click on the testsuites folder, and choose Create Test Suite.  Give it a name like test_suite1.  Then the Create Composite Test wizard will open.  Click on Next twice to get to the Input Message page.  Click on Generate Sample and set the values for a and b to 1 and 2, like this:

<process xmlns="">

Click on Next and then Generate Sample again and set the output to look like this:

<processResponse xmlns="">

Click on Finish.  Now we have a test.

Next, we need to create a file.  This file is required by sca-test – regardless of whether you run it from ANT or Maven, etc.

Create a new file in your project and set up the content like this:


We also need to update the POM to tell Maven where the is located.

Open the POM, uncomment the property and make sure it points to the right file.  If you called your file and put it in the root of your project, then the example provided in the POM is the right value for you.

<!-- these parameters are used by the test goal -->
<!-- if you are using the sca-test (test) goal, you need to uncomment the following
     line and point it to your file. -->
<!--  input is the name of the composite to run test suties against -->

Now you can run the tests by executing the Maven verify goal – either in JDeveloper or from the command line.

The output will look something like this:

C:\src2\soaApp1>mvn verify
[INFO] Scanning for projects...
[WARNING] Some problems were encountered while building the effective model for com.redstack:soaProject1:sar:1.0-SNAPSHOT
[WARNING] The expression ${version} is deprecated. Please use ${project.version} instead.
[WARNING] It is highly recommended to fix these problems because they threaten the stability of your build.
[WARNING] For this reason, future Maven versions might no longer support building such malformed projects.
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Build Order:
[INFO] soaProject1
[INFO] soaApp1
[INFO] Using the builder org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder with a thread count of 1
[INFO] ------------------------------------------------------------------------
[INFO] Building soaProject1 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ soaProject1 ---
[WARNING] Using platform encoding (Cp1252 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] skip non existing resourceDirectory C:\src2\soaApp1\soaProject1\src\main\resources
[INFO] Copying 1 resource
[INFO] --- oracle-soa-plugin:12.1.3-0-0:compile (default-compile) @ soaProject1 ---
[INFO] ------------------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] ABOUT TO RUN oracle.soa.scac.ValidateComposite...
[INFO] The environment variable/property 'oracle.home' is not set.
[INFO] If you want to compile a composite with a component that depends
on MDS - like a Human Task or Business Rule - AND you want to use a file
based MDS repository, you will need to specify 'oracle.home' OR update
your .adf/META-INF/adf-config.xml to point to your file-based MDS.
If you specify oracle.home it must point to the SOA Quickstart or
JDeveloper install directory with '/soa' appended to it, unless you
update the adf-config.xml to remove the reference to oracle.home.
[INFO] compile: Executing: [cmd:[c:\java\jdk1.8.0_05\bin\java,|oracle.fabric.comm
on.classloaderurl.handler|oracle.fabric.common.uddiurl.handler, oracle.soa.scac.ValidateComposite, C:\src2\soaApp1\soaProject1/SOA//co
mposite.xml, -level=1]]
[INFO] Process being executed, waiting for completion.
[INFO] [exec] Jul 11, 2014 9:57:39 AM oracle.fabric.common.wsdl.SchemaManager isIncrementalBuildSupported
[INFO] [exec] INFO: XMLSchema incremental build enabled.
[INFO] [exec] >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
[INFO] [exec] >> modified xmlbean locale class in use
[INFO] [exec] >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
[INFO] compile: [cmd:[c:\java\jdk1.8.0_05\bin\java,|oracle.fabric.common.classloa
derurl.handler|oracle.fabric.common.uddiurl.handler, oracle.soa.scac.ValidateComposite, C:\src2\soaApp1\soaProject1/SOA//composite.xml
, -level=1]] exit code=0
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ soaProject1 ---
[WARNING] Using platform encoding (Cp1252 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] skip non existing resourceDirectory C:\src2\soaApp1\soaProject1\src\test\resources
[INFO] --- maven-compiler-plugin:3.1:testCompile (default-testCompile) @ soaProject1 ---
[INFO] No sources to compile
[INFO] --- maven-surefire-plugin:2.17:test (default-test) @ soaProject1 ---
[INFO] No tests to run.
[INFO] --- oracle-soa-plugin:12.1.3-0-0:sar (default-sar) @ soaProject1 ---
[INFO] Building sar: C:\src2\soaApp1\soaProject1\target\sca_soaProject1_rev1.0-SNAPSHOT.jar
[INFO] --- oracle-soa-plugin:12.1.3-0-0:deploy (default-deploy) @ soaProject1 ---
[INFO] ------------------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] setting user/password..., user=weblogic
Processing sar=C:\src2\soaApp1\soaProject1/target/sca_soaProject1_rev1.0-SNAPSHOT.jar
Adding sar file - C:\src2\soaApp1\soaProject1\target\sca_soaProject1_rev1.0-SNAPSHOT.jar
INFO: Creating HTTP connection to, port:7003
INFO: Received HTTP response from the server, response code=200
---->Deploying composite success.
[INFO] --- oracle-soa-plugin:12.1.3-0-0:test (default-test) @ soaProject1 ---
[INFO] native formatting
[INFO] native
[INFO] [<test:testRunResults compositeDN="default/soaProject1" errorCount="0" failureCount="0" testCount="1" passCount="1" inProgressC
ount="0" runId="25f6b51184bcfb61:-3d069c46:1471d21b49b:-7ffc" runName="oracle-soa-plugin-scatest" startDate="2014-07-10T16:58:02.423-0
7:00" endDate="2014-07-10T16:58:05.314-07:00" xmlns:test="<a href=";">"</a>><test:testSuite suiteName="test_suite
1"><test:testResult compositeDN="default/soaProject1!1.0-SNAPSHOT*soa_2d677f20-07e9-47bc-9448-7922926a37d5" flowId="10001" scaPartitio
nId="1" endDate="2014-07-10T16:58:05.314-07:00" startDate="2014-07-10T16:58:03.457-07:00" suiteName="test_suite1" testName="test1.xml"
testRunName="oracle-soa-plugin-scatest" testRunId="25f6b51184bcfb61:-3d069c46:1471d21b49b:-7ffc" outcome="passed" callHandlerClassNam
e=""><test:wireActionResults wireSource="bpelprocess1_client_ep"><test:assertionOutcome outcome="passed"><assertion comparisonMethod="
xml-similar" xmlns="<a href=";">"</a>>
<location key="output" callbackOperation="processResponse"/>
<part partName="payload">

<processResponse xmlns="<a href=";">"</a>>
</assertion><test:actual><test:message><test:part partName="payload"><test:content><bpel:processResponse xmlns:bpel="<a href="http://xmln">http://xmln</a>"><bpel:result>3</bpel:result></bpel:processResponse></test:content></test:part></test:me
ssage></test:actual></test:assertionOutcome></test:wireActionResults></test:testResult></test:testSuite><test:property propertyName="d
b.type" propertyValue="oracle"/><test:property propertyName="" propertyValue=""/><test:property pr
opertyName="" propertyValue="/scratch/marnelso/newsoa/final/server/soa"/></test:testRunResults>]
[INFO] C:\Users\Mark\AppData\Local\Temp\out\oracle-soa-plugin-scatest.xml
[INFO] ------------------------------------------------------------------------
[INFO] Building soaApp1 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO] soaProject1 ....................................... SUCCESS [01:31 min]
[INFO] soaApp1 ........................................... SUCCESS [  0.002 s]
[INFO] ------------------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 01:38 min
[INFO] Finished at: 2014-07-11T09:58:55+10:00
[INFO] Final Memory: 15M/91M
[INFO] ------------------------------------------------------------------------

Now, if you were running this build in a CI server, like Hudson, then you could have it collect the results and chart them for you.

In the next post, let’s add some more interesting things to our SOA Application.

About Mark Nelson

Mark Nelson is a Developer Evangelist at Oracle, focusing on microservices and messaging. Before this role, Mark was an Architect in the Enterprise Cloud-Native Java Team, the Verrazzano Enterprise Container Platform project, worked on Wercker, WebLogic and was a senior member of the A-Team since 2010, and worked in Sales Consulting at Oracle since 2006 and various roles at IBM since 1994.
This entry was posted in Uncategorized and tagged , , , , , . Bookmark the permalink.

2 Responses to Running SCA Tests from Maven

  1. Looks nice! keep up the good work 🙂

Leave a Reply

Please log in using one of these methods to post your comment: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s