diff options
Diffstat (limited to 'mllib-local/src/test/scala/org/apache/spark/ml/linalg/VectorsSuite.scala')
-rw-r--r-- | mllib-local/src/test/scala/org/apache/spark/ml/linalg/VectorsSuite.scala | 17 |
1 files changed, 0 insertions, 17 deletions
diff --git a/mllib-local/src/test/scala/org/apache/spark/ml/linalg/VectorsSuite.scala b/mllib-local/src/test/scala/org/apache/spark/ml/linalg/VectorsSuite.scala index 504be36413..887814b5e7 100644 --- a/mllib-local/src/test/scala/org/apache/spark/ml/linalg/VectorsSuite.scala +++ b/mllib-local/src/test/scala/org/apache/spark/ml/linalg/VectorsSuite.scala @@ -20,7 +20,6 @@ package org.apache.spark.ml.linalg import scala.util.Random import breeze.linalg.{squaredDistance => breezeSquaredDistance, DenseMatrix => BDM} -import org.json4s.jackson.JsonMethods.{parse => parseJson} import org.apache.spark.ml.SparkMLFunSuite import org.apache.spark.ml.util.TestingUtils._ @@ -339,20 +338,4 @@ class VectorsSuite extends SparkMLFunSuite { assert(v.slice(Array(2, 0)) === new SparseVector(2, Array(0), Array(2.2))) assert(v.slice(Array(2, 0, 3, 4)) === new SparseVector(4, Array(0, 3), Array(2.2, 4.4))) } - - test("toJson/fromJson") { - val sv0 = Vectors.sparse(0, Array.empty, Array.empty) - val sv1 = Vectors.sparse(1, Array.empty, Array.empty) - val sv2 = Vectors.sparse(2, Array(1), Array(2.0)) - val dv0 = Vectors.dense(Array.empty[Double]) - val dv1 = Vectors.dense(1.0) - val dv2 = Vectors.dense(0.0, 2.0) - for (v <- Seq(sv0, sv1, sv2, dv0, dv1, dv2)) { - val json = v.toJson - parseJson(json) // `json` should be a valid JSON string - val u = Vectors.fromJson(json) - assert(u.getClass === v.getClass, "toJson/fromJson should preserve vector types.") - assert(u === v, "toJson/fromJson should preserve vector values.") - } - } } |