diff options
author | Jeff Zhang <zjffdu@apache.org> | 2015-12-18 00:49:56 -0800 |
---|---|---|
committer | Reynold Xin <rxin@databricks.com> | 2015-12-18 00:49:56 -0800 |
commit | 40e52a27c74259237dd1906c0e8b54d2ae645dfb (patch) | |
tree | cca6f2d5206fc598d3c17b883209381a4a6ee61c /core/src/test/scala/org/apache | |
parent | 0370abdfd636566cd8df954c6f9ea5a794d275ef (diff) | |
download | spark-40e52a27c74259237dd1906c0e8b54d2ae645dfb.tar.gz spark-40e52a27c74259237dd1906c0e8b54d2ae645dfb.tar.bz2 spark-40e52a27c74259237dd1906c0e8b54d2ae645dfb.zip |
[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.
Diffstat (limited to 'core/src/test/scala/org/apache')
-rw-r--r-- | core/src/test/scala/org/apache/spark/serializer/JavaSerializerSuite.scala | 9 |
1 files changed, 7 insertions, 2 deletions
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 20f45670bc..6a6ea42797 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 } } |