{"id":921,"date":"2011-05-10T15:27:43","date_gmt":"2011-05-10T13:27:43","guid":{"rendered":"http:\/\/touk.pl\/blog\/?p=921"},"modified":"2022-08-02T12:41:58","modified_gmt":"2022-08-02T10:41:58","slug":"touk-on-github-part-1","status":"publish","type":"post","link":"https:\/\/touk.pl\/blog\/2011\/05\/10\/touk-on-github-part-1\/","title":{"rendered":"<!--:en-->TouK on GitHub Part 1<!--:-->"},"content":{"rendered":"<p><!--:en-->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.<\/p>\n<p>In this post I want to focus on projects associated with <a href=\"http:\/\/ode.apache.org\/\">Apache ODE<\/a>. 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.<\/p>\n<p><!--:--><!--more--><!--:en--><\/p>\n<p>Available projects:<\/p>\n<p><strong><a href=\"https:\/\/github.com\/TouK\/maven-ode-plugin\">maven-ode-plugin<\/a><\/strong><\/p>\n<p>This maven plugin allows you compile BPEL files with Apache ODE bpel compilator.<\/p>\n<p>Maven pom.xml configuration<\/p>\n<p>Following configuration will compile PrototypeCase.bpel file during maven compile phase:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">...\r\n           ...pl.touk.topmaven-ode-plugin1.3.0${project.build.directory}\/classes\/PrototypeCase.bpel${project.build.directory}\/classes\/\r\n            false\r\n\r\n                compile\r\n\r\n                            bpelc<\/pre>\n<p><strong><a href=\"https:\/\/github.com\/TouK\/odeUnitTests\">odeUnitTests<\/a><\/strong><\/p>\n<p>Quoting <a href=\"http:\/\/old.nabble.com\/Unit-tests-of-processes-in-ODE-td26405722.html#a26405722\">mail<\/a> of Maciek aka mpr on ode-dev mailing list:<\/p>\n<p>In our project at touk we ended up having quite large & complex<\/p>\n<p>processes. We found it difficult to do testing based e.g. on soapUI, as<\/p>\n<p>we had to make many mock requests, responses and so on. We didn\u2019t find<\/p>\n<p>any tool enabling testing single scopes, sequences or assigns, so I<\/p>\n<p>developed our own.<\/p>\n<p>How it works:<\/p>\n<p>Testing is based on processes compiled to .cbp format. The base class<\/p>\n<p>for tests is pl.touk.ode.scopeEvaluator.ActivityTest.<\/p>\n<p>The test looks more or less like this:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">@Test\r\npublic void testAssign2() throws Exception {\r\n     \/\/we set value of string variable a to 'first'\r\n     addVariable(\"a\", \"first\");\r\n     \/\/we run activity with name = 'sequence1'\r\n     runEngine(\"sequence1\");\r\n     \/\/we assert after running activity the variable a has expected value\r\n     assertEquals(\"firstsecondthird\", getSimpleVariable(\"a\"));\r\n }<\/pre>\n<p>Currently things like picks, invokes, receives, extVars (limited) are<\/p>\n<p>supported. The config (e.g. process properties) can be read from<\/p>\n<p>deploy.xml file (we use only jbi packaging). Simple examples are in<\/p>\n<p>src\/test.<\/p>\n<p>There is also simple expressionEvaluator, which enables quick testing of<\/p>\n<p>xpath\/xquery read from process, also using defined variables.<\/p>\n<p><strong><a href=\"https:\/\/github.com\/TouK\/ode-validator\">ode-validator<\/a><\/strong><\/p>\n<p>This is a command line tool for validating expressions inside bpel processes using Saxon SA (Schema Aware).<\/p>\n<p>Usage:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">ode-validator-1.0.0\/bpelc -od process-dir process-dir\/process.bpel<\/pre>\n<p>\u00a0<\/p>\n<p>FAQ<\/p>\n<p>\u2013 I get errors \u201cno schema imported for xsd namespace\u201d.<\/p>\n<p>This occurs if you declare variable in \u201celement=\u2019xsd:string'\u201d way. There\u2019s no element declaration in xsd namespace. So correct way is: \u201ctype=\u2019xsd:string'\u201d declaration.<\/p>\n<p>\u2013 How to assign value to a complex type variable?<\/p>\n<p>There\u2019s an extension for it, you should do: (ode is a standard ODE extensions namespace: xmlns:ode=\u201dhttp:\/\/www.apache.org\/ode\/type\/extension\u201d)<\/p>\n<p>\u00a0<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">  ...\r\n\r\n...<\/pre>\n<p>\u00a0<\/p>\n<p>\u2013 I\u2019ve got problem while using schemas from subdirectories. They do not get imported.<\/p>\n<p>In schema imports from inside subdirectory, currently there\u2019s no relative path resolution. So you need to provide full paths for schemas from subdirs.<\/p>\n<p><strong><a href=\"https:\/\/github.com\/TouK\/proxy-generator\">proxy-generator<\/a><\/strong><\/p>\n<p>Proxy-generator is an utility to generation of jbi service assemblies, which will work as a proxies beetwen apache ode processes and SoapUI tests.<\/p>\n<p>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.<\/p>\n<p>This generator can be run from command line and as a maven plugin goal.<\/p>\n<p>Generated service assembly has configurable uri of listening services and services which are invoke from process.<\/p>\n<p>Sample run:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">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\r\njava -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\r\njava -jar proxy-generator-console-0.1.0.jar --help<\/pre>\n<p><strong><a href=\"https:\/\/github.com\/TouK\/soapuii\">SoapUI Improved<\/a><\/strong><\/p>\n<p>Features<\/p>\n<p>\u2013 TestCase Generator to generate TestCases for current TestSuite from getCommunication.xml file with communication of BPEL process returned by ODE<\/p>\n<p>\u2013 Simple-in-use choosing mechanism of properties sets.<\/p>\n<p>\u2013 Mechanism of running a single TestCase using SetupScript started from TestSuite<\/p>\n<p>\u2013 Mechanism of running a single GroovyTestStep with the use of functions which are declared in SetupScripts in TestSuite and\/or TestCase.<!--:--><\/p>\n","protected":false},"excerpt":{"rendered":"Our company moving our Open Source projects from present top.touk.pl host on github. It is a good moment&hellip;\n","protected":false},"author":28,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[238],"tags":[296,105],"class_list":{"0":"post-921","1":"post","2":"type-post","3":"status-publish","4":"format-standard","6":"category-news-events","7":"tag-github","8":"tag-open-source"},"_links":{"self":[{"href":"https:\/\/touk.pl\/blog\/wp-json\/wp\/v2\/posts\/921","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/touk.pl\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/touk.pl\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/touk.pl\/blog\/wp-json\/wp\/v2\/users\/28"}],"replies":[{"embeddable":true,"href":"https:\/\/touk.pl\/blog\/wp-json\/wp\/v2\/comments?post=921"}],"version-history":[{"count":11,"href":"https:\/\/touk.pl\/blog\/wp-json\/wp\/v2\/posts\/921\/revisions"}],"predecessor-version":[{"id":14825,"href":"https:\/\/touk.pl\/blog\/wp-json\/wp\/v2\/posts\/921\/revisions\/14825"}],"wp:attachment":[{"href":"https:\/\/touk.pl\/blog\/wp-json\/wp\/v2\/media?parent=921"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/touk.pl\/blog\/wp-json\/wp\/v2\/categories?post=921"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/touk.pl\/blog\/wp-json\/wp\/v2\/tags?post=921"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}