summaryrefslogtreecommitdiff
path: root/test/files/cldc
diff options
context:
space:
mode:
authormichelou <michelou@epfl.ch>2007-11-19 18:52:02 +0000
committermichelou <michelou@epfl.ch>2007-11-19 18:52:02 +0000
commit6590cc3936fc32505fef9ea970a33d2e7a7294f5 (patch)
treec51ad003d34a5beddbe626a7a696c53846830ea2 /test/files/cldc
parent7444097917bf2e71af8160de202795828a0086cb (diff)
downloadscala-6590cc3936fc32505fef9ea970a33d2e7a7294f5.tar.gz
scala-6590cc3936fc32505fef9ea970a33d2e7a7294f5.tar.bz2
scala-6590cc3936fc32505fef9ea970a33d2e7a7294f5.zip
added scalatest option "--cldc"
Diffstat (limited to 'test/files/cldc')
-rw-r--r--test/files/cldc/randoms.check1
-rw-r--r--test/files/cldc/randoms.scala29
2 files changed, 30 insertions, 0 deletions
diff --git a/test/files/cldc/randoms.check b/test/files/cldc/randoms.check
new file mode 100644
index 0000000000..e73fdf3e4f
--- /dev/null
+++ b/test/files/cldc/randoms.check
@@ -0,0 +1 @@
+Execution completed.
diff --git a/test/files/cldc/randoms.scala b/test/files/cldc/randoms.scala
new file mode 100644
index 0000000000..b9f46250c9
--- /dev/null
+++ b/test/files/cldc/randoms.scala
@@ -0,0 +1,29 @@
+import javax.microedition.lcdui._
+import javax.microedition.midlet.MIDlet
+
+class Test extends MIDlet with CommandListener {
+
+ def startApp {
+ val display = Display.getDisplay(this)
+
+ val mainForm = new Form("randoms")
+ mainForm append "Welcome to the world of MIDlets!"
+ mainForm append "(build with Scala)"
+ //val rnd = new Random
+ //for (i <- 0 until 10) mainForm append rnd.nextInt.toString
+
+ val exitCommand = new Command("Exit", Command.EXIT, 0)
+ mainForm addCommand exitCommand
+ mainForm setCommandListener this
+
+ display setCurrent mainForm
+ }
+ def pauseApp {}
+
+ def destroyApp(unconditional: Boolean) {}
+
+ def commandAction(c: Command, s: Displayable) {
+ if (c.getCommandType == Command.EXIT)
+ notifyDestroyed
+ }
+}