summaryrefslogtreecommitdiff
path: root/test/osgi/src/ScalaOsgiHelper.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/ScalaOsgiHelper.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/ScalaOsgiHelper.scala')
-rw-r--r--test/osgi/src/ScalaOsgiHelper.scala28
1 files changed, 23 insertions, 5 deletions
diff --git a/test/osgi/src/ScalaOsgiHelper.scala b/test/osgi/src/ScalaOsgiHelper.scala
index b4c643ef60..bcdc5c0df1 100644
--- a/test/osgi/src/ScalaOsgiHelper.scala
+++ b/test/osgi/src/ScalaOsgiHelper.scala
@@ -5,13 +5,31 @@ import org.ops4j.pax.exam
import java.io.File
trait ScalaOsgiHelper {
- def scalaBundles: Array[exam.Option] = {
+
+ private def allBundleFiles = {
def bundleLocation = new File(sys.props.getOrElse("scala.bundle.dir", "build/osgi"))
- def bundleFiles = bundleLocation.listFiles filter (_.getName endsWith ".jar")
- def makeBundle(file: File): exam.Option =
+ bundleLocation.listFiles filter (_.getName endsWith ".jar")
+ }
+
+ private def filteredBundleFiles(names: String*): Array[exam.Option] =
+ for(bundle <- allBundleFiles; if names exists (bundle.getName contains))
+ yield makeBundle(bundle)
+
+ private def makeBundle(file: File): exam.Option =
bundle(file.toURI.toASCIIString)
- val bundles = (bundleFiles map makeBundle)
- System.out.println(bundles)
+
+ def standardOptions: Array[exam.Option] = {
+ val bundles = (allBundleFiles map makeBundle)
+ bundles ++ Array[exam.Option](felix(), equinox(), junitBundles())
+ }
+
+ def justReflectionOptions: Array[exam.Option] = {
+ val bundles = filteredBundleFiles("scala-library", "scala-reflect")
+ bundles ++ Array[exam.Option](felix(), equinox(), junitBundles())
+ }
+
+ def justCoreLibraryOptions: Array[exam.Option] = {
+ val bundles = filteredBundleFiles("scala-library")
bundles ++ Array[exam.Option](felix(), equinox(), junitBundles())
}