-
-
Notifications
You must be signed in to change notification settings - Fork 80
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #178 from sjrd/use-portable-scala-reflect
Use portable-scala-reflect instead of the deprecated TestUtils.
- Loading branch information
Showing
6 changed files
with
37 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,22 @@ | ||
package utest | ||
|
||
import scala.concurrent.{Await, Future} | ||
import scala.util.{Failure, Success} | ||
import concurrent.duration._ | ||
import java.io.{PrintWriter, StringWriter} | ||
import org.portablescala.reflect.Reflect | ||
|
||
/** | ||
* Platform specific stuff that differs between JVM and JS | ||
*/ | ||
object PlatformShims { | ||
def await[T](f: Future[T]): T = Await.result(f, 10.hours) | ||
|
||
type EnableReflectiveInstantiation = | ||
org.portablescala.reflect.annotation.EnableReflectiveInstantiation | ||
|
||
def loadModule(name: String, loader: ClassLoader): Any = { | ||
Reflect | ||
.lookupLoadableModuleClass(name + "$", loader) | ||
.getOrElse(throw new ClassNotFoundException(name)) | ||
.loadModule() | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters