Skip to main content

[jsr352-public] Re: ChunkTests#testChunkSkipMultipleExceptions question

  • From: Scott Kurz < >
  • To:
  • Subject: [jsr352-public] Re: ChunkTests#testChunkSkipMultipleExceptions question
  • Date: Fri, 20 Sep 2013 14:06:33 -0400


Michael,

It is NOT the case that this gets interpreted as: skip (include) all
MyParentException  except (exclude) all MyChildException except (include
now) all MyGrandchildException.
We realized this was confusing which is why we have this TCK test to
clarify.

This test is designed to enforce the spec implication that this:

<skippable-exception-classes>
  <include class="com.ibm.jbatch.tck.artifacts.reusable.MyParentException"
/>
  <include class=
"com.ibm.jbatch.tck.artifacts.reusable.MyGrandchildException"/>
  <exclude class="com.ibm.jbatch.tck.artifacts.reusable.MyChildException"/>
</skippable-exception-classes>


ends up equivalent to this:




<skippable-exception-classes>
  <include class="com.ibm.jbatch.tck.artifacts.reusable.MyParentException"
/>
  <exclude class="com.ibm.jbatch.tck.artifacts.reusable.MyChildException"/>
</skippable-exception-classes>

Ordering does not matter.   We can simply state:
1) skip an exception if is an instance of any include (or subclass)
   UNLESS
2) it is an instance of any exclude (or subclass), and then don't skip.

In the RI, see com.ibm.jbatch.container.impl.SkipHandler.

I believe this is how include/excludes work with Ant fileset(s), for
example.

Hope that clears things up,
------------------------------------------------------
Scott Kurz
WebSphere Batch / Compute Grid Development
T/L 295-5649;
External Phone 845-435-5649

--------------------------------------------------------



From:   Michael Minella 
< >
To:     
" "
 
< >,
Date:   09/20/2013 11:22 AM
Subject:        [jsr352-public] ChunkTests#testChunkSkipMultipleExceptions
            question



The test ChunkTests#testChunkSkipMultipleExceptions() executes a job that
is configured to skip exceptions as follows:

<skippable-exception-classes>
  <include class="com.ibm.jbatch.tck.artifacts.reusable.MyParentException"
/>
  <include class=
"com.ibm.jbatch.tck.artifacts.reusable.MyGrandchildException"/>
  <exclude class="com.ibm.jbatch.tck.artifacts.reusable.MyChildException"/>
</skippable-exception-classes>



When executed, the job throws a MyParentException and a
MyGrandchildException.  The test expects the first exception
(MyParentException) to be skipped but the MyGrandchildException to be not
be and the job to fail.  However, with the given configuration, I would
expect that it should complete.  I would expect that the above
configuration translates into "skip all MyParentExceptions and it's
children except MyChildException and it's children except
MyGrandchildException and it's children".  The spec doesn't state that
there is any precedence between include and exclude (from what I can tell)
and this interpretation allows for the exclusion of ranges of a class
hierarchy.  For example, I'd expect to be able to configure the following:

<skippable-exception-classes>
  <include class="java.lang.Exception"/>
  <include class="java.util.ConcurrentModificationException"/>
  <exclude class="java.lang.RuntimeException"/>
</skippable-exception-classes>



I would expect this configuration to skip all checked exceptions and
ConcurrentModificationException and fail for any others
(ConcurrentModificationException extends RuntimeException).  Am I missing
something?  Any insight is appreciated.

Thanks,
Michael Minella

http://www.michaelminella.com

GIF image



[jsr352-public] ChunkTests#testChunkSkipMultipleExceptions question

Michael Minella 09/20/2013

[jsr352-public] Re: ChunkTests#testChunkSkipMultipleExceptions question

Scott Kurz 09/20/2013

[jsr352-public] Re: ChunkTests#testChunkSkipMultipleExceptions question

Michael Minella 09/20/2013

[jsr352-public] Re: ChunkTests#testChunkSkipMultipleExceptions question

Scott Kurz 09/20/2013

[jsr352-public] Re: ChunkTests#testChunkSkipMultipleExceptions question

Michael Minella 09/20/2013

[jsr352-public] Re: ChunkTests#testChunkSkipMultipleExceptions question

Scott Kurz 09/20/2013

[jsr352-public] Re: ChunkTests#testChunkSkipMultipleExceptions question

Michael Minella 09/20/2013

[jsr352-public] Re: ChunkTests#testChunkSkipMultipleExceptions question

Scott Kurz 09/20/2013
 
 
Close
loading
Please Confirm
Close