summaryrefslogtreecommitdiff
path: root/test/files/jvm
diff options
context:
space:
mode:
authorAleksandar Pokopec <aleksandar.prokopec@epfl.ch>2010-12-09 10:08:24 +0000
committerAleksandar Pokopec <aleksandar.prokopec@epfl.ch>2010-12-09 10:08:24 +0000
commit11dfc5a64dd8bbcb7fca7d608a23b513316de6cc (patch)
treec951c2e3730ad2a88de39e9d5ca40303e22d2c91 /test/files/jvm
parentf2ecbd04691b1914e2f77c60afc2b296aa6826ae (diff)
downloadscala-11dfc5a64dd8bbcb7fca7d608a23b513316de6cc.tar.gz
scala-11dfc5a64dd8bbcb7fca7d608a23b513316de6cc.tar.bz2
scala-11dfc5a64dd8bbcb7fca7d608a23b513316de6cc.zip
Made parallel collections serializable.
No review.
Diffstat (limited to 'test/files/jvm')
-rw-r--r--test/files/jvm/serialization.check35
-rw-r--r--test/files/jvm/serialization.scala57
2 files changed, 91 insertions, 1 deletions
diff --git a/test/files/jvm/serialization.check b/test/files/jvm/serialization.check
index 7b2b8cc18f..0717de2a8e 100644
--- a/test/files/jvm/serialization.check
+++ b/test/files/jvm/serialization.check
@@ -270,4 +270,37 @@ x equals y: true, y equals x: true
1
2
1
-2 \ No newline at end of file
+2
+
+x = UnrolledBuffer(one, two)
+y = UnrolledBuffer(one, two)
+x equals y: true, y equals x: true
+
+x = ParArray(abc, def, etc)
+y = ParArray(abc, def, etc)
+x equals y: true, y equals x: true
+
+x = ParHashMap(1 -> 2, 2 -> 4)
+y = ParHashMap(1 -> 2, 2 -> 4)
+x equals y: true, y equals x: true
+
+x = ParHashSet(2, 1, 3)
+y = ParHashSet(2, 1, 3)
+x equals y: true, y equals x: true
+
+x = ParRange(0, 1, 2, 3, 4)
+y = ParRange(0, 1, 2, 3, 4)
+x equals y: true, y equals x: true
+
+x = ParRange(0, 1, 2, 3)
+y = ParRange(0, 1, 2, 3)
+x equals y: true, y equals x: true
+
+x = ParMap(5 -> 1, 10 -> 2)
+y = ParMap(5 -> 1, 10 -> 2)
+x equals y: true, y equals x: true
+
+x = ParSet(two, one)
+y = ParSet(two, one)
+x equals y: true, y equals x: true
+
diff --git a/test/files/jvm/serialization.scala b/test/files/jvm/serialization.scala
index 2e34079505..8c4df8fc37 100644
--- a/test/files/jvm/serialization.scala
+++ b/test/files/jvm/serialization.scala
@@ -397,6 +397,7 @@ object Test3_mutable {
}
}
+
//############################################################################
// Test classes in package "scala.xml"
@@ -587,8 +588,64 @@ object Test {
Test6
Test7
Test8
+ Test9_parallel
}
}
//############################################################################
+
+//############################################################################
+// Test classes in package "scala.collection.parallel" and subpackages
+object Test9_parallel {
+ import scala.collection.parallel._
+
+ try {
+ println()
+
+ // UnrolledBuffer
+ val ub = new UnrolledBuffer[String]
+ ub ++= List("one", "two")
+ val _ub: UnrolledBuffer[String] = read(write(ub))
+ check(ub, _ub)
+
+ // mutable.ParArray
+ val pa = mutable.ParArray("abc", "def", "etc")
+ val _pa: mutable.ParArray[String] = read(write(pa))
+ check(pa, _pa)
+
+ // mutable.ParHashMap
+ val mpm = mutable.ParHashMap(1 -> 2, 2 -> 4)
+ val _mpm: mutable.ParHashMap[Int, Int] = read(write(mpm))
+ check(mpm, _mpm)
+
+ // mutable.ParHashSet
+ val mps = mutable.ParHashSet(1, 2, 3)
+ val _mps: mutable.ParHashSet[Int] = read(write(mps))
+ check(mps, _mps)
+
+ // immutable.ParRange
+ val pr1 = immutable.ParRange(0, 4, 1, true)
+ val _pr1: immutable.ParRange = read(write(pr1))
+ check(pr1, _pr1)
+
+ val pr2 = immutable.ParRange(0, 4, 1, false)
+ val _pr2: immutable.ParRange = read(write(pr2))
+ check(pr2, _pr2)
+
+ // immutable.ParHashMap
+ val ipm = immutable.ParHashMap(5 -> 1, 10 -> 2)
+ val _ipm: immutable.ParHashMap[Int, Int] = read(write(ipm))
+ check(ipm, _ipm)
+
+ // immutable.ParHashSet
+ val ips = immutable.ParHashSet("one", "two")
+ val _ips: immutable.ParHashSet[String] = read(write(ips))
+ check(ips, _ips)
+
+ } catch {
+ case e: Exception =>
+ println("Error in Test5_parallel: " + e)
+ throw e
+ }
+}