summaryrefslogtreecommitdiff
path: root/test/pending/jvm
diff options
context:
space:
mode:
authorPaul Phillips <paulp@improving.org>2009-02-10 23:46:39 +0000
committerPaul Phillips <paulp@improving.org>2009-02-10 23:46:39 +0000
commit64af689e6659ab170826508f37720ee6e54386fa (patch)
tree0e2e5100426d23f2a734a97863c4eadcc77c38d3 /test/pending/jvm
parentf4720669d6b4946653b5b419d85f5ec5a1e95bad (diff)
downloadscala-64af689e6659ab170826508f37720ee6e54386fa.tar.gz
scala-64af689e6659ab170826508f37720ee6e54386fa.tar.bz2
scala-64af689e6659ab170826508f37720ee6e54386fa.zip
moved most of the passing tests from pending to...
moved most of the passing tests from pending to files ; reunited inner.scala with inner.check
Diffstat (limited to 'test/pending/jvm')
-rw-r--r--test/pending/jvm/inner.scala126
-rw-r--r--test/pending/jvm/reactWithinZero.check2
-rw-r--r--test/pending/jvm/reactWithinZero.scala18
-rw-r--r--test/pending/jvm/receiveWithinZero.check2
-rw-r--r--test/pending/jvm/receiveWithinZero.scala18
-rw-r--r--test/pending/jvm/timeout.check1
-rw-r--r--test/pending/jvm/timeout.scala33
7 files changed, 0 insertions, 200 deletions
diff --git a/test/pending/jvm/inner.scala b/test/pending/jvm/inner.scala
deleted file mode 100644
index 4ad1f1e215..0000000000
--- a/test/pending/jvm/inner.scala
+++ /dev/null
@@ -1,126 +0,0 @@
-//############################################################################
-// Test Java interaction with scala inner classes
-//############################################################################
-// $Id$
-
-import java.io.{BufferedReader, File, FileWriter, InputStreamReader}
-
-class A {
- val abc = "A.abc"
-
- protected class B(x: Int, y: String) {
- println(abc); println(x)
- println(y)
- }
-
- trait Itf {
- def method1(x: Int): Int
-
- trait Itf2 extends Itf {
- def method2: Unit
- }
- }
-
- trait PlainTrait {
- def method1(x: Int): Int
- }
-
- class Impl(a: Int) extends Itf {
- def method1(x: Int) = {
- println(x)
- println(a)
- x + a
- }
- }
-
- class Impl2 extends Impl(1) with Itf#Itf2 {
- def method2 = {
- println(abc)
- }
- }
-
- def newImpl: Itf = new Impl(1)
- def newImpl2: Itf#Itf2 = new Impl2
-
- class Outer1(arg1: Int) {
- class Outer2(arg2: Int) {
- class Outer3(arg3: Int) {
- println("Outer3: " + arg1 + " " + arg2 + " " + arg3);
- }
- }
- }
-}
-
-object Scalatest {
- private val outputdir = System.getProperty("scalatest.output", "inner-jvm.obj")
- private val scalalib = System.getProperty("scalatest.lib", "")
- private val classpath = outputdir + File.pathSeparator + scalalib
- private val javabin = {
- val jhome = new File(System.getProperty("java.home"))
- if (jhome.getName == "jre")
- new File(jhome.getParent, "bin").getAbsolutePath
- else
- new File(jhome, "bin").getAbsolutePath
- }
- private val javacmd = javabin + File.separator + "java"
- private val javac = javabin + File.separator + "javac"
-
- def javac(src: String, fname: String) {
- val tmpfilename = outputdir + File.separator + fname
- val tmpfile = new FileWriter(tmpfilename)
- tmpfile.write(src)
- tmpfile.close
- exec(javac + " -d " + outputdir + " -classpath " + classpath + " " + tmpfilename)
- }
-
- def java(cname: String) =
- exec(javacmd + " -cp " + classpath + " " + cname)
-
- /** Execute cmd, wait for the process to end and pipe it's output to stdout */
- private def exec(cmd: String) {
- val proc = Runtime.getRuntime().exec(cmd)
- val inp = new BufferedReader(new InputStreamReader(proc.getInputStream))
- val errp = new BufferedReader(new InputStreamReader(proc.getErrorStream))
- proc.waitFor()
- while (inp.ready) println(inp.readLine())
- while (errp.ready) println(errp.readLine())
- }
-}
-
-object Test {
- def main(args: Array[String]) {
- val javaInteraction = """
-public class JavaInteraction {
- public static void main(String[] args) {
- A a = new A();
- A.B b = a.new B(1, "Hello");
-
- A.Itf itf = a.newImpl();
- itf.method1(1);
-
- A.Itf.Itf2 itf2 = a.newImpl2();
- itf2.method2();
-
- A.Outer1 o1 = a.new Outer1(1);
- A.Outer1.Outer2 o2 = o1.new Outer2(2);
- A.Outer1.Outer2.Outer3 or = o2.new Outer3(3);
- }
-}
-"""
- Scalatest.javac(javaInteraction, "JavaInteraction.java")
- Scalatest.java("JavaInteraction")
-
- val accessingScala = """
-public class AccessingScala {
- public static void main(String[] args) {
- A a = new A();
- System.out.println(a.abc());
- }
-}
-"""
- Scalatest.javac(accessingScala, "AccessingScala.java")
- Scalatest.java("AccessingScala")
- }
-}
-
-//############################################################################
diff --git a/test/pending/jvm/reactWithinZero.check b/test/pending/jvm/reactWithinZero.check
deleted file mode 100644
index cf2a2facf9..0000000000
--- a/test/pending/jvm/reactWithinZero.check
+++ /dev/null
@@ -1,2 +0,0 @@
-TIMEOUT
-'ack
diff --git a/test/pending/jvm/reactWithinZero.scala b/test/pending/jvm/reactWithinZero.scala
deleted file mode 100644
index 0786ce271d..0000000000
--- a/test/pending/jvm/reactWithinZero.scala
+++ /dev/null
@@ -1,18 +0,0 @@
-import scala.actors.{Actor, TIMEOUT}
-
-class A extends Actor {
- def act() = reactWithin(0) {
- case TIMEOUT =>
- println("TIMEOUT")
- reply('ack)
- act()
- case x => println(x)
- }
-}
-
-object Test {
- def main(args: Array[String]): Unit = {
- val a = new A
- a.start()
- }
-}
diff --git a/test/pending/jvm/receiveWithinZero.check b/test/pending/jvm/receiveWithinZero.check
deleted file mode 100644
index cf2a2facf9..0000000000
--- a/test/pending/jvm/receiveWithinZero.check
+++ /dev/null
@@ -1,2 +0,0 @@
-TIMEOUT
-'ack
diff --git a/test/pending/jvm/receiveWithinZero.scala b/test/pending/jvm/receiveWithinZero.scala
deleted file mode 100644
index 315dd9c86a..0000000000
--- a/test/pending/jvm/receiveWithinZero.scala
+++ /dev/null
@@ -1,18 +0,0 @@
-import scala.actors.{Actor, TIMEOUT}
-
-class A extends Actor {
- def act() = receiveWithin(0) {
- case TIMEOUT =>
- println("TIMEOUT")
- reply('ack)
- act()
- case x => println(x)
- }
-}
-
-object Test {
- def main(args: Array[String]): Unit = {
- val a = new A
- a.start()
- }
-}
diff --git a/test/pending/jvm/timeout.check b/test/pending/jvm/timeout.check
deleted file mode 100644
index d86bac9de5..0000000000
--- a/test/pending/jvm/timeout.check
+++ /dev/null
@@ -1 +0,0 @@
-OK
diff --git a/test/pending/jvm/timeout.scala b/test/pending/jvm/timeout.scala
deleted file mode 100644
index 12f1bd7bad..0000000000
--- a/test/pending/jvm/timeout.scala
+++ /dev/null
@@ -1,33 +0,0 @@
-
-import scala.actors.Actor._
-import scala.actors.TIMEOUT
-
-object Test extends Application {
- case class Timing(time: Long)
-
- actor {
- val a = actor {
- react {
- case 'doTiming =>
- val s = sender
- reactWithin(500) {
- case TIMEOUT =>
- s ! Timing(System.currentTimeMillis)
- }
- }
- }
-
- val start = System.currentTimeMillis
- (a !? 'doTiming) match {
- case Timing(end) =>
- val delay = end - start
-
- if (delay > 100 && delay < 900)
- println("OK")
- else {
- println("EXPECTED: 100 < x < 900")
- println("ACTUAL: "+delay)
- }
- }
- }
-}