[infinispan-issues] [JBoss JIRA] (ISPN-4544) BaseWordCountMapReduceTest#testCombinerForDistributedReductionWithException doesn't actually test reduce exception
Dan Berindei (JIRA)
issues at jboss.org
Wed Oct 8 08:28:11 EDT 2014
[ https://issues.jboss.org/browse/ISPN-4544?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Dan Berindei updated ISPN-4544:
-------------------------------
Status: Pull Request Sent (was: Open)
Git Pull Request: https://github.com/infinispan/infinispan/pull/2750
> BaseWordCountMapReduceTest#testCombinerForDistributedReductionWithException doesn't actually test reduce exception
> ------------------------------------------------------------------------------------------------------------------
>
> Key: ISPN-4544
> URL: https://issues.jboss.org/browse/ISPN-4544
> Project: Infinispan
> Issue Type: Bug
> Components: Distributed Execution and Map/Reduce
> Affects Versions: 7.0.0.Alpha5
> Reporter: William Burns
> Assignee: Vladimir Blagojevic
>
> When looking into serialization issues I found that many map reduce failures occur due to not serializable exceptions. Looking closer it appears this was caused by the testCombinerForDistributedReductionWithException method because the anonymous inner class cannot be serialized and throws a CacheException causing the test to pass. However if I pass in a serializable class the test fails because the Divide By Zero exception is swallowed incorrectly.
> {code}
> @Test(expectedExceptions = CacheException.class)
> public void testCombinerForDistributedReductionWithException() throws Exception {
> MapReduceTask<String, String, String, Integer> task = invokeMapReduce(null);
> task.combinedWith(new DivideByZeroReducer());
> task.execute();
> }
> private static class DivideByZeroReducer implements Reducer<String, Integer>, Serializable {
> @Override
> public Integer reduce(String reducedKey, Iterator<Integer> iter) {
> //simulating exception
> int a = 4 / 0;
> return null;
> }
> }
> {code}
--
This message was sent by Atlassian JIRA
(v6.3.1#6329)
More information about the infinispan-issues
mailing list