[infinispan-issues] [JBoss JIRA] (ISPN-4544) BaseWordCountMapReduceTest#testCombinerForDistributedReductionWithException doesn't actually test reduce exception
William Burns (JIRA)
issues at jboss.org
Fri Jul 18 10:58:29 EDT 2014
William Burns created ISPN-4544:
-----------------------------------
Summary: BaseWordCountMapReduceTest#testCombinerForDistributedReductionWithException doesn't actually test reduce exception
Key: ISPN-4544
URL: https://issues.jboss.org/browse/ISPN-4544
Project: Infinispan
Issue Type: Feature Request
Security Level: Public (Everyone can see)
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.2.6#6264)
More information about the infinispan-issues
mailing list