Re: Junit spark tests

2014-09-12 Thread Rajiv Abraham
Hi Sudershan, That's interesting. I don't have an answer to your question but considering the functional nature of Spark, I have hardly had to use mock objects(maybe you could inform us of your use case). Mock object 'expectations' are in 'most' cases implementation of 'Tell, Don't ask' principle

Junit spark tests

2014-09-09 Thread Sudershan Malpani
Hi all, I am calling an object which in turn is calling a method inside a map RDD in spark. While writing the tests how can I mock that object's call? Currently I did doNothing().when(class).method() is called but it is giving task not serializable exception. I tried making the class both spy

Re: Junit spark tests

2014-09-09 Thread Reynold Xin
Can you be a little bit more specific, maybe give a code snippet? On Tue, Sep 9, 2014 at 5:14 PM, Sudershan Malpani sudershan.malp...@gmail.com wrote: Hi all, I am calling an object which in turn is calling a method inside a map RDD in spark. While writing the tests how can I mock that

Re: Junit spark tests

2014-09-09 Thread Sudershan Malpani
Class1.java @Autowired Private ClassX cx; Public list method1(JavaPairRDD data){ List list1 = new ArrayList(); List list2 = new ArrayList(); JavaPairRDD computed = data.map( new FunctionTuple2object, list() { Public List call(object obj) throws