-
Notifications
You must be signed in to change notification settings - Fork 7.6k
Commit
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
package rx.lang.scala | ||
|
||
class Observable[+T](val asJava: rx.Observable[_ <: T]) extends AnyVal { | ||
|
||
} | ||
|
||
object Observable { | ||
import scala.collection.JavaConverters._ | ||
import rx.{Observable => JObservable} | ||
|
||
def apply[T](args: T*): Observable[T] = { | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
samuelgruetter
Author
Contributor
|
||
new Observable(JObservable.from(args.toIterable.asJava)) | ||
} | ||
} | ||
|
||
import org.scalatest.junit.JUnitSuite | ||
|
||
class UnitTestSuite extends JUnitSuite { | ||
|
||
import org.junit.{ Before, Test } | ||
import org.junit.Assert._ | ||
import org.mockito.Matchers.any | ||
import org.mockito.Mockito._ | ||
import org.mockito.{ MockitoAnnotations, Mock } | ||
import rx.{ Notification, Observer, Subscription } | ||
import rx.observables.GroupedObservable | ||
import collection.JavaConverters._ | ||
|
||
@Test def testTest() = { | ||
println("testTest()") | ||
assertEquals(4, Observable(1, 2, 3, 4).asJava.toBlockingObservable().last()) | ||
} | ||
|
||
|
||
} |
@samuelgruetter This method is now overloaded with others, which robs all of the others of any type safety. You should rename this one to
fromXxx
or something.