Brock Noland created MRUNIT-184: ----------------------------------- Summary: Context.write does not accept null key Key: MRUNIT-184 URL: https://issues.apache.org/jira/browse/MRUNIT-184 Project: MRUnit Issue Type: Improvement Reporter: Brock Noland
>From the cdh-user list. "just in case it provides some clue to the next person who stumbles across this problem - if you use 'null' for your key in context.write - you'll get a stack trace like this when using mrunit-0.9.0-incubating:hadoop2:" {noformat} java.lang.NullPointerException at org.apache.hadoop.mrunit.Serialization.copy(Serialization.java:52) at org.apache.hadoop.mrunit.Serialization.copy(Serialization.java:81) at org.apache.hadoop.mrunit.mapreduce.mock.MockContextWrapper$4.answer(MockContextWrapper.java:78) at org.mockito.internal.stubbing.StubbedInvocationMatcher.answer(StubbedInvocationMatcher.java:31) at org.mockito.internal.MockHandler.handle(MockHandler.java:97) at org.mockito.internal.creation.MethodInterceptorFilter.intercept(MethodInterceptorFilter.java:47) at org.apache.hadoop.mapreduce.Reducer$Context$$EnhancerByMockitoWithCGLIB$$368a159e.write(<generated>) at x.y.z.MyReducer.reduce(MyReducer.java:141) at x.y.z.MyReducer.reduce(MyReducer.java:1) at org.apache.hadoop.mapreduce.Reducer.run(Reducer.java:164) at org.apache.hadoop.mrunit.mapreduce.ReduceDriver.run(ReduceDriver.java:230) at org.apache.hadoop.mrunit.mapreduce.MapReduceDriver$ReducePhaseRunner.runReduce(MapReduceDriver.java:284) at org.apache.hadoop.mrunit.mapreduce.MapReduceDriver$ReducePhaseRunner.access$300(MapReduceDriver.java:269) at org.apache.hadoop.mrunit.mapreduce.MapReduceDriver.run(MapReduceDriver.java:325) at org.apache.hadoop.mrunit.MapReduceDriverBase.runTest(MapReduceDriverBase.java:141) at org.apache.hadoop.mrunit.TestDriver.runTest(TestDriver.java:137) at x.y.z.MyMapReduceTest.testAggregateKeys(MyMapReduceTest.java:250) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44) at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15) at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41) at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20) at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:76) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50) at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193) at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52) at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191) at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42) at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184) at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28) at org.junit.runners.ParentRunner.run(ParentRunner.java:236) at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50) at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197) {noformat} -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira