TouK on GitHub Part 1

Our company moving our Open Source projects from present top.touk.pl host on github. It is a good moment to refresh knowledge why they can be useful and how run them.

In this post I want to focus on projects associated with Apache ODE. For somebody who is not familiar with this project: it is Orchestration Engine using BPEL as language to describe Business Projects. It can be used as web application deployed on Java EE container or as a Servicemix 3.x component.

Available projects:

maven-ode-plugin

This maven plugin allows you compile BPEL files with Apache ODE bpel compilator.

Maven pom.xml configuration

Following configuration will compile PrototypeCase.bpel file during maven compile phase:

...
           ...pl.touk.topmaven-ode-plugin1.3.0${project.build.directory}/classes/PrototypeCase.bpel${project.build.directory}/classes/
            false

                compile

                            bpelc

odeUnitTests

Quoting mail of Maciek aka mpr on ode-dev mailing list:

In our project at touk we ended up having quite large & complex

processes. We found it difficult to do testing based e.g. on soapUI, as

we had to make many mock requests, responses and so on. We didn’t find

any tool enabling testing single scopes, sequences or assigns, so I

developed our own.

How it works:

Testing is based on processes compiled to .cbp format. The base class

for tests is pl.touk.ode.scopeEvaluator.ActivityTest.

The test looks more or less like this:

@Test
public void testAssign2() throws Exception {
     //we set value of string variable a to 'first'
     addVariable("a", "first");
     //we run activity with name = 'sequence1'
     runEngine("sequence1");
     //we assert after running activity the variable a has expected value
     assertEquals("firstsecondthird", getSimpleVariable("a"));
 }

Currently things like picks, invokes, receives, extVars (limited) are

supported. The config (e.g. process properties) can be read from

deploy.xml file (we use only jbi packaging). Simple examples are in

src/test.

There is also simple expressionEvaluator, which enables quick testing of

xpath/xquery read from process, also using defined variables.

ode-validator

This is a command line tool for validating expressions inside bpel processes using Saxon SA (Schema Aware).

Usage:

ode-validator-1.0.0/bpelc -od process-dir process-dir/process.bpel

 

FAQ

– I get errors “no schema imported for xsd namespace”.

This occurs if you declare variable in “element=’xsd:string'” way. There’s no element declaration in xsd namespace. So correct way is: “type=’xsd:string'” declaration.

– How to assign value to a complex type variable?

There’s an extension for it, you should do: (ode is a standard ODE extensions namespace: xmlns:ode=”http://www.apache.org/ode/type/extension”)

 

  ...

...

 

– I’ve got problem while using schemas from subdirectories. They do not get imported.

In schema imports from inside subdirectory, currently there’s no relative path resolution. So you need to provide full paths for schemas from subdirs.

proxy-generator

Proxy-generator is an utility to generation of jbi service assemblies, which will work as a proxies beetwen apache ode processes and SoapUI tests.

As an input, it takes apache ode project with bpel files, web service definitions and deploy.xml file. On output, it generates service assembly (zip file) with single http service unit which containts xbean.xml and necessary web service definitions.

This generator can be run from command line and as a maven plugin goal.

Generated service assembly has configurable uri of listening services and services which are invoke from process.

Sample run:

java -jar proxy-generator-console-0.1.0.jar path/to/sources -o output_name -luri http://0.0.0.0/abc -ouri http://0.0.0.0/cba
java -jar proxy-generator-console-0.1.0.jar sources_folder -o output_name -luri http://0.0.0.0:8089/abc -ouri http://1.2.3.4:8080/cba -p properties_file_name
java -jar proxy-generator-console-0.1.0.jar --help

SoapUI Improved

Features

– TestCase Generator to generate TestCases for current TestSuite from getCommunication.xml file with communication of BPEL process returned by ODE

– Simple-in-use choosing mechanism of properties sets.

– Mechanism of running a single TestCase using SetupScript started from TestSuite

– Mechanism of running a single GroovyTestStep with the use of functions which are declared in SetupScripts in TestSuite and/or TestCase.

You May Also Like