Re: Unit Testing (JUnit) with Spark

2014-10-29 Thread touchdown
add these to your dependencies:

io.netty % netty % 3.6.6.Final
exclude(io.netty, netty-all) to the end of spark and hadoop dependencies

reference: https://spark-project.atlassian.net/browse/SPARK-1138

I am using Spark 1.1 so the akka issue is already fixed



--
View this message in context: 
http://apache-spark-user-list.1001560.n3.nabble.com/Unit-Testing-JUnit-with-Spark-tp10861p17652.html
Sent from the Apache Spark User List mailing list archive at Nabble.com.

-
To unsubscribe, e-mail: user-unsubscr...@spark.apache.org
For additional commands, e-mail: user-h...@spark.apache.org



Re: Unit Testing (JUnit) with Spark

2014-07-29 Thread jay vyas
I've been working some on building spark blueprints, and recently tried to
generalize one for easy blueprints of spark apps.

https://github.com/jayunit100/SparkBlueprint.git

It runs the spark app's main method in a unit test, and builds in SBT.

You can easily try it out and improve on it.

Obviously, calling a main method is the wrong kind of coupling for a unit
test, but it works pretty good in a simple CI environment.

I'll improve it eventually by injecting the SparkContext and validating the
RDD directly, in a next iteration.

Pull requests welcome :)





On Tue, Jul 29, 2014 at 11:29 AM, soumick86 sdasgu...@dstsystems.com
wrote:

 Is there any example out there for unit testing a Spark application in
 Java?
 Even a trivial application like word count will be very helpful. I am very
 new to this and I am struggling to understand how I can use JavaSpark
 Context for JUnit



 --
 View this message in context:
 http://apache-spark-user-list.1001560.n3.nabble.com/Unit-Testing-JUnit-with-Spark-tp10861.html
 Sent from the Apache Spark User List mailing list archive at Nabble.com.




-- 
jay vyas


Re: Unit Testing (JUnit) with Spark

2014-07-29 Thread Kostiantyn Kudriavtsev
Hi, 

try this one 
http://simpletoad.blogspot.com/2014/07/runing-spark-unit-test-on-windows-7.html

it’s more about fixing windows-specific issue, but code snippet gives general 
idea
just run etl and check output w/ Assert(s)

On Jul 29, 2014, at 6:29 PM, soumick86 sdasgu...@dstsystems.com wrote:

 Is there any example out there for unit testing a Spark application in Java?
 Even a trivial application like word count will be very helpful. I am very
 new to this and I am struggling to understand how I can use JavaSpark
 Context for JUnit
 
 
 
 --
 View this message in context: 
 http://apache-spark-user-list.1001560.n3.nabble.com/Unit-Testing-JUnit-with-Spark-tp10861.html
 Sent from the Apache Spark User List mailing list archive at Nabble.com.



Re: Unit Testing (JUnit) with Spark

2014-07-29 Thread Sonal Goyal
You can take a look at
https://github.com/apache/spark/blob/master/core/src/test/java/org/apache/spark/JavaAPISuite.java
and model your junits based on it.

Best Regards,
Sonal
Nube Technologies http://www.nubetech.co

http://in.linkedin.com/in/sonalgoyal




On Tue, Jul 29, 2014 at 10:10 PM, Kostiantyn Kudriavtsev 
kudryavtsev.konstan...@gmail.com wrote:

 Hi,

 try this one
 http://simpletoad.blogspot.com/2014/07/runing-spark-unit-test-on-windows-7.html

 it’s more about fixing windows-specific issue, but code snippet gives
 general idea
 just run etl and check output w/ Assert(s)

 On Jul 29, 2014, at 6:29 PM, soumick86 sdasgu...@dstsystems.com wrote:

  Is there any example out there for unit testing a Spark application in
 Java?
  Even a trivial application like word count will be very helpful. I am
 very
  new to this and I am struggling to understand how I can use JavaSpark
  Context for JUnit
 
 
 
  --
  View this message in context:
 http://apache-spark-user-list.1001560.n3.nabble.com/Unit-Testing-JUnit-with-Spark-tp10861.html
  Sent from the Apache Spark User List mailing list archive at Nabble.com.