Skip to content

Commit

Permalink
Merge pull request #73 from zsxwing/rxjava-1.0.2
Browse files Browse the repository at this point in the history
Update RxJava to 1.0.2 and add an list of expermimental methods to exclude them
  • Loading branch information
zsxwing committed Dec 5, 2014
2 parents 18a3892 + e5a1807 commit 6a536b3
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
2 changes: 1 addition & 1 deletion build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ scalaVersion in ThisBuild := "2.11.2"
crossScalaVersions in ThisBuild := Seq("2.10.4", "2.11.2")

libraryDependencies ++= Seq(
"io.reactivex" % "rxjava" % "1.0.0",
"io.reactivex" % "rxjava" % "1.0.2",
"org.mockito" % "mockito-core" % "1.9.5" % "test",
"junit" % "junit" % "4.11" % "test",
"org.scalatest" %% "scalatest" % "2.2.2" % "test")
13 changes: 12 additions & 1 deletion src/test/scala/rx/lang/scala/CompletenessTest.scala
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,15 @@ class CompletenessTest extends JUnitSuite {
"a subtype of `Iterable`, there are two nice ways of creating range Observables: " +
"`(start to end).toObservable` or `Observable.from(start to end)`, and even more options are possible " +
"using `until` and `by`.]"
val commentForExperimental = "[Marked as `@Beta` or `@Experimental` in RxJava and thus not available in RxScala]"

// We should ignore unstable APIs in RxJava. However, the `@Beta` and `@Experimental` annotations
// have RetentionPolicy.CLASS retention, so even though they are present in the `.class` file, they
// are not exposed by the JVM to runtime reflection calls. So we need to maintain a list.
val rxjavaExperimentalMethods = Set(
"onBackpressureBlock()",
"onBackpressureBlock(Int)"
)

/**
* Maps each method from the Java Observable to its corresponding method in the Scala Observable
Expand Down Expand Up @@ -263,7 +272,9 @@ class CompletenessTest extends JUnitSuite {
}).toMap ++ List.iterate("Observable[_ <: T]", 9)(s => s + ", Observable[_ <: T]").map(
// amb 2-9
"amb(" + _ + ")" -> "[unnecessary because we can use `o1 amb o2` instead or `amb(List(o1, o2, o3, ...)`]"
).drop(1).toMap
).drop(1).toMap ++ rxjavaExperimentalMethods.map(method =>
method -> commentForExperimental
).toMap

def removePackage(s: String) = s.replaceAll("(\\w+\\.)+(\\w+)", "$2")

Expand Down

0 comments on commit 6a536b3

Please sign in to comment.