Results 1 to 3 of 3

Thread: Testing SkipListeners

  1. #1
    Join Date
    Jul 2008
    Posts
    21

    Default Testing SkipListeners

    Hello,

    Can anyone recommend a decent way to test Skip Listeners? I'd like to test my processors and writers and include skip logic as part of my testing.

    Thanks,

    Alejandro

  2. #2
    Join Date
    Jul 2008
    Posts
    21

    Default Bump...

    Just bumping this topic... If there is no real way to do this outside of the framework, I guess I could just call onSkipInXXX() inside of a try catch within a junit.

    But I'd like to hear if there is a better way.

  3. #3
    Join Date
    Feb 2008
    Posts
    488

    Default

    As a "component test", you should just call onSkipInX() directly within the test method. Then you can verify that the method does what you want.

    As a "functional test", to test the interaction between your components, you can set up a sort of dummy job or dummy step and inject the things you want to test. Then you can set up a condition that throws an exception from your processor/writer and check that the skiplistener is called. To get some ideas of ways to do this, you might want to take a look at the junit tests in spring-batch-core.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •