Tuesday, March 19, 2013

ChTest is out

Writing automated tests for Coherence based application is quite challenging. Definitely, you can start single node cluster in your test JVM without too much hassle. Unfortunately, single node cluster will not allow you to replicate some important aspects of cluster (a thus, test wont be able to catch a number of nasty bugs).

Running Coherence cluster with several nodes is a bit trickier (Coherence is using singletons). Idea to use classloader to keep multiple Coherence nodes is not new. I’m using this approach for few years already, and …
Today I’m glad to announce availability of my test library for Coherence at Maven central repo.

ChTest is a third generation of my test framework for Oracle Coherence. Besides ability to run multiple Coherence nodes in different classloader, ChTest offers a bunch of extra features.
To name few:

  • System property isolation between “virtualized” nodes.
  • Console output of each “virtualized” node is prefixed by its name (helps to make sense out of logs).
  • Very convenient way to execute code in “virtualized” node context.
  • Option to start “virtualized” node as separate JVM (JVM start option could also be configured).
  • Coherence MBeans could be enabled in “virtualized” node; they will be exposed in separate domains and accessible via JConsole or VisualVM.
  • Specific classes could be shared between classloaders (useful to use static variable to share state between nodes).
  • Classpath could be tweaked per “virtualized” node (e.i. exclude some jar from cluster nodes).
  • Coherence “node” crash simulation (I’m using it to test disaster recover cases).
  • Utility to choose Coherence jar per “virtualized” node.
  • ... and this list is not full ?

    Below is slide deck outlining features of ChTest.

    Add following Maven dependency and you would be able to try ChTest yourself.

    <dependency>
        <groupId>org.gridkit.coherence-tools</groupId>
        <artifactId>chtest</artifactId>
        <version>0.2.6</version>
        <scope>test</scope>
    </dependency>
    

    No comments:

    Post a Comment