summaryrefslogtreecommitdiff
path: root/test/osgi/src/BasicLibrary.scala
diff options
context:
space:
mode:
authorJosh Suereth <joshua.suereth@gmail.com>2012-09-19 08:52:22 -0400
committerJosh Suereth <joshua.suereth@gmail.com>2012-09-19 08:52:22 -0400
commitac75cc4b50822988532754310d99b4c251ac2566 (patch)
tree43db206db68cdeef82845bd0e197d1bd48d51c8c /test/osgi/src/BasicLibrary.scala
parentfd4c197cf1c62236d2bd07f09e6866c149a10867 (diff)
downloadscala-ac75cc4b50822988532754310d99b4c251ac2566.tar.gz
scala-ac75cc4b50822988532754310d99b4c251ac2566.tar.bz2
scala-ac75cc4b50822988532754310d99b4c251ac2566.zip
Additional OSGi tests.
* Ensure scala-library can be resolved on its own, and with sun.misc.Unsafe usage. * Ensure reflection works without scala-compiler.jar * Ensure ToolBox's can see all classes necessary when evaluating expressions. * Cleanup test helper for filtering in/out bundles.
Diffstat (limited to 'test/osgi/src/BasicLibrary.scala')
-rw-r--r--test/osgi/src/BasicLibrary.scala37
1 files changed, 37 insertions, 0 deletions
diff --git a/test/osgi/src/BasicLibrary.scala b/test/osgi/src/BasicLibrary.scala
new file mode 100644
index 0000000000..38dea69e99
--- /dev/null
+++ b/test/osgi/src/BasicLibrary.scala
@@ -0,0 +1,37 @@
+package tools.test.osgi
+package libonly
+
+import org.junit.Assert._
+import org.ops4j.pax.exam.CoreOptions._
+
+import org.junit.Test
+import org.junit.runner.RunWith
+import org.ops4j.pax.exam
+import org.ops4j.pax.exam.junit.{
+ Configuration,
+ ExamReactorStrategy,
+ JUnit4TestRunner
+}
+import org.ops4j.pax.exam.spi.reactors.AllConfinedStagedReactorFactory
+import org.ops4j.pax.swissbox.framework.ServiceLookup
+import org.osgi.framework.BundleContext
+
+
+
+@RunWith(classOf[JUnit4TestRunner])
+@ExamReactorStrategy(Array(classOf[AllConfinedStagedReactorFactory]))
+class BasicLibraryTest extends ScalaOsgiHelper {
+ @Configuration
+ def config(): Array[exam.Option] =
+ justCoreLibraryOptions
+
+ @Test
+ def everythingLoads(): Unit = {
+ // Note - This tests sun.misc usage.
+ import scala.concurrent._
+ import scala.concurrent.util.Duration.Inf
+ import ExecutionContext.Implicits._
+ val x = Future(2) map (_ + 1)
+ assertEquals(3, Await.result(x, Inf))
+ }
+}