Skip to content

Batch TCK with JBeret

chengfang edited this page Aug 19, 2013 · 7 revisions

1, Download TCK zip and instruction guide from

https://java.net/projects/jbatch/downloads?field=date&order=desc


2, Follow the steps in TCK instruction guide to install and set up TCK. Edit jsr352-tck.properties file:

batch.impl.classes=/Users/cfang/jberet/lib/*  (points to all jars in JBeret standalone distro)
jvm.options=-Xmx1g

Batch TCK defines TCK SPI to allow TCK users to customize how a batch implementation signals the end of a job completion to tests. There is a default TCK SPI implementation in artifacts/jsr352-tck-SPI.jar. JBeret also provides its own TCK SPI implementation at https://github.com/jberet/jsr352/tree/master/tck-porting-impl . To use JBeret TCK SPI impl, copy target/tck-porting-impl...jar to tck.install.dir/lib, and it will be picked up by TCK runtime.


3, To run the TCK

cd tck.install.dir
ant

4, Test results and report are stored under tck.install.dir/results. The previous results will be overwritten by the next test run. So you may want to back up certain test results. To view it in browser:

file:///Users/cfang/batch-tck/results/index.html#


5, Batch TCK uses TestNG. You can configure it to run a subset of the tests, filtering by test package, test class, or test method, in artifacts/jsr352-tck-impl-suite.xml. For example,

<suite name="JSR352 TCK SE" verbose="2">
        <test name="JSR352 TCK SE">
      <!--
      <packages>
         <package name="com.ibm.jbatch.tck.tests.jslxml" />
      </packages>
      -->
    <classes>
      <class name="com.ibm.jbatch.tck.tests.jslxml.ExecutionTests">
        <methods>
          <include name="testInvokeJobUsingTCCL" />
        </methods>
    </class>
   </classes>
        </test>
</suite>

6, To debug tests, you just need to add debug options to tck.install.dir/build.xml:

<!-- add to the top of build.xml -->
<property environment="env" />
<property name="debug.options" value="${env.DEBUG_OPTIONS}" />
...
<!-- add above other jvmarg element inside run target -->
<jvmarg line="${debug.options}" />

To enable debugging:

setenv DEBUG_OPTIONS -agentlib:jdwp=transport=dt_socket,address=localhost:9009,server=y,suspend=y

To disable debugging:

setenv DEBUG_OPTIONS

7, To report TCK bug or issues, send to JSR 352 public mailing list, or enter a bug in jbatch project issue tracking.