Package: com.ibm.jbatch.tck.tests.jslxml
Class: ListenerOnErrorTests

testOnProcessErrorItems

Test introduced in TCK Version: 1.1.WORKING

Test Assertion(s)

Assertion(s)
ItemProcessListener#onProcessError is passed the item that ItemProcessor#processItem throws an exception for.

Jakarta Batch Reference(s)

Section Version Citation(s) Note(s)
9.1.1.2 1.0 ~ The processItem method is part of a chunk step. It accepts an input item from an item reader and returns an item that gets passed onto the item writer. ~ API for ItemProcessor
9.2.5 1.0 ~ The onProcessError method receives control after an item processor processItem throws an exception. The method receives the item sent to the item processor as input. ~ API for ItemProcessListener

API Reference(s)

Class Name Method Names Note(s)
javax.batch.api.chunk.ItemProcessor ~ processItem
javax.batch.api.chunk.listener.ItemProcessListener ~ onProcessError

Issue Reference(s)

Link(s)
https://java.net/bugzilla/show_bug.cgi?id=5431

Test Strategy

Strategy
Intentionally fail processor at a specific record number. Take the item passed as input parameter to onProcessError, and set a String representation of this item as the job's exit status. Check that this matches the expected value based on the input data and the failing record number. Also check that the job fails.

Additional Comments

Comment(s)