Sunday, March 11, 2012

Using ZTL (Zkoss testing language) framework and Concordion for integration testing

To use ZTL for integration testing we have to inherit org.zkoss.ztl.ZKClientTestCase. We should initialize some variables for testcase (for example in constructor)
            target = "http://localhost:8080/ZK-demo";
            browsers = getBrowsers("iexplore");
To use Concordion we also have to inherit org.concordion.integration.junit3.ConcordionTestCase. But Java doesn’t allow us to use multiple inheritances. So we should replace one of inheritances to usage. I did it for ZKClientTestCase. All of the fields listed above are protected. I made class ZKIntegrationTestCase that inherits ZKClientTestCase. In that class I made public setters and getters for those fields. So we don’t need to use inheritance for ZTL
public class SpecTest extends ConcordionTestCase{
      private ZKIntegrationTestCase ZKFunctionalTestCase zk;

      public SpecTest() {
            zk = new ZKIntegrationTestCaseZKFunctionalTestCase();
You may find patched ZTL library (ztl), sample project(ZK-demo) and sample test project(ztl-demo) here:
Hope it help you make quick rampup.

All about Concordion you may find here:
Original ZTL you may also find at github:
And forum about ZTL issues is here:

No comments:

Post a Comment