spark-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From r...@apache.org
Subject spark git commit: [CORE][TESTS] minor fix of JavaSerializerSuite
Date Fri, 18 Dec 2015 08:50:00 GMT
Repository: spark
Updated Branches:
  refs/heads/master 0370abdfd -> 40e52a27c


[CORE][TESTS] minor fix of JavaSerializerSuite

Not jira is created.
The original test is passed because the class cast is lazy (only when the object's method
is invoked).

Author: Jeff Zhang <zjffdu@apache.org>

Closes #10371 from zjffdu/minor_fix.


Project: http://git-wip-us.apache.org/repos/asf/spark/repo
Commit: http://git-wip-us.apache.org/repos/asf/spark/commit/40e52a27
Tree: http://git-wip-us.apache.org/repos/asf/spark/tree/40e52a27
Diff: http://git-wip-us.apache.org/repos/asf/spark/diff/40e52a27

Branch: refs/heads/master
Commit: 40e52a27c74259237dd1906c0e8b54d2ae645dfb
Parents: 0370abd
Author: Jeff Zhang <zjffdu@apache.org>
Authored: Fri Dec 18 00:49:56 2015 -0800
Committer: Reynold Xin <rxin@databricks.com>
Committed: Fri Dec 18 00:49:56 2015 -0800

----------------------------------------------------------------------
 .../org/apache/spark/serializer/JavaSerializerSuite.scala   | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/spark/blob/40e52a27/core/src/test/scala/org/apache/spark/serializer/JavaSerializerSuite.scala
----------------------------------------------------------------------
diff --git a/core/src/test/scala/org/apache/spark/serializer/JavaSerializerSuite.scala b/core/src/test/scala/org/apache/spark/serializer/JavaSerializerSuite.scala
index 20f4567..6a6ea42 100644
--- a/core/src/test/scala/org/apache/spark/serializer/JavaSerializerSuite.scala
+++ b/core/src/test/scala/org/apache/spark/serializer/JavaSerializerSuite.scala
@@ -23,13 +23,18 @@ class JavaSerializerSuite extends SparkFunSuite {
   test("JavaSerializer instances are serializable") {
     val serializer = new JavaSerializer(new SparkConf())
     val instance = serializer.newInstance()
-    instance.deserialize[JavaSerializer](instance.serialize(serializer))
+    val obj = instance.deserialize[JavaSerializer](instance.serialize(serializer))
+    // enforce class cast
+    obj.getClass
   }
 
   test("Deserialize object containing a primitive Class as attribute") {
     val serializer = new JavaSerializer(new SparkConf())
     val instance = serializer.newInstance()
-    instance.deserialize[JavaSerializer](instance.serialize(new ContainsPrimitiveClass()))
+    val obj = instance.deserialize[ContainsPrimitiveClass](instance.serialize(
+      new ContainsPrimitiveClass()))
+    // enforce class cast
+    obj.getClass
   }
 }
 


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@spark.apache.org
For additional commands, e-mail: commits-help@spark.apache.org


Mime
View raw message