-
Notifications
You must be signed in to change notification settings - Fork 111
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refactor CompletenessTest to support adding completeness tests for other classes #174
Conversation
@@ -16,6 +16,8 @@ scalaVersion in ThisBuild := "2.11.6" | |||
|
|||
crossScalaVersions in ThisBuild := Seq("2.10.5", "2.11.6") | |||
|
|||
parallelExecution in Test := false |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Disabled parallel execution because I encounter some weird exception without this line, e.g.,
[info] - checkScalaMethodPresenceVerbose *** FAILED ***
[info] java.lang.ClassNotFoundException: o .lang.scala.Observ
[info] at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
[info] at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
[info] at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
[info] at java.lang.Class.forName0(Native Method)
[info] at java.lang.Class.forName(Class.java:348)
[info] at scala.reflect.runtime.JavaMirrors$JavaMirror.javaClass(JavaMirrors.scala:500)
[info] at scala.reflect.runtime.SymbolLoaders$TopClassCompleter.complete(SymbolLoaders.scala:32)
[info] at scala.reflect.internal.Symbols$Symbol.info(Symbols.scala:1231)
[info] at scala.reflect.internal.Types$TypeRef.thisInfo(Types.scala:2407)
[info] at scala.reflect.internal.Types$TypeRef.baseClasses(Types.scala:2412)
I guess some reflection APIs are not thread-safe (or a bug?). So if running multiple CompletenessKit
at the same time, it will crash.
However, since RxScala's unit tests are pretty fast, disabling it hurts nothing.
BTW, SBT 0.13.8 supports cross-version for Scala sources:
We can upgrade SBT to |
for ((javaM, scalaM) <- c) { | ||
println(s""" %-${len}s -> %s,""".format("\"" + javaM + "\"", "\"" + scalaM + "\"")) | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Several methods (including this one) are deleted here but not added to anywhere. I would like to keep them, because they might be useful for maintenance in the future.
sbt 0.13.8 + |
Nice re-design 👍 |
@samuelgruetter just sent more commits to address your comments. |
This reverts commit bdae1eb. Reason: It throws a ClassCastException for the following example (which is accepted by the compiler): class Fruit class Apple extends Fruit class Pear extends Fruit { def printMe: Unit = println(this) } val apples: Observable[Apple] = Observable.just(new Apple) ++ Observable.never apples.toBlocking.mostRecent(new Pear).take(1).foreach(_.printMe) println("done")
… upper-boundend type parameter
Completeness kit fix
Merged your fix. |
LGTM |
Refactor CompletenessTest to support adding completeness tests for other classes
Single
was added to RxJava recently. It would be better if we could also test its completeness when adding it to RxScala.This PR refactors CompletenessTest to support testing completeness of other classes easily, including:
CompletenessKit
as a basic trait for classes that we want to test completeness. Most of codes are from the oldCompletenessTest.scala
.CompletenessKit
.CompletenessKit
s. Runsbt 'test:run rx.lang.scala.completeness.CompletenessTest'
to see these tables.completeness
package.