Skip to content

Commit 068f547

Browse files
committed
Move examples to remove access to private rx.lang.scala
* Move examples * Fix small missing java conversion in scaladoc
1 parent b8beb0c commit 068f547

File tree

8 files changed

+12
-14
lines changed

8 files changed

+12
-14
lines changed

examples/src/test/java/rx/lang/scala/examples/MovieLibUsage.java renamed to examples/src/test/java/examples/MovieLibUsage.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,10 @@
1313
* See the License for the specific language governing permissions and
1414
* limitations under the License.
1515
*/
16-
package rx.lang.scala.examples;
16+
package examples;
1717

1818
import rx.Observable;
1919
import rx.functions.Action1;
20-
import rx.lang.scala.examples.Movie;
21-
import rx.lang.scala.examples.MovieLib;
2220
import static rx.lang.scala.JavaConversions.toScalaObservable;
2321

2422
public class MovieLibUsage {

examples/src/test/scala/rx/lang/scala/examples/APICoverage.scala renamed to examples/src/test/scala/examples/APICoverage.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
* See the License for the specific language governing permissions and
1414
* limitations under the License.
1515
*/
16-
package rx.lang.scala.examples
16+
package examples
1717

1818
import scala.collection.mutable
1919

examples/src/test/scala/rx/lang/scala/examples/ExperimentalAPIExamples.scala renamed to examples/src/test/scala/examples/ExperimentalAPIExamples.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
* See the License for the specific language governing permissions and
1414
* limitations under the License.
1515
*/
16-
package rx.lang.scala.examples
16+
package examples
1717

1818
import scala.concurrent.duration._
1919
import scala.language.postfixOps

examples/src/test/scala/rx/lang/scala/examples/MovieLib.scala renamed to examples/src/test/scala/examples/MovieLib.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
* See the License for the specific language governing permissions and
1414
* limitations under the License.
1515
*/
16-
package rx.lang.scala.examples
16+
package examples
1717

1818
import rx.lang.scala.Observable
1919

examples/src/test/scala/rx/lang/scala/examples/Olympics.scala renamed to examples/src/test/scala/examples/Olympics.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
* See the License for the specific language governing permissions and
1414
* limitations under the License.
1515
*/
16-
package rx.lang.scala.examples
16+
package examples
1717

1818
import rx.lang.scala.Observable
1919
import scala.concurrent.duration._

examples/src/test/scala/rx/lang/scala/examples/RxScalaDemo.scala renamed to examples/src/test/scala/examples/RxScalaDemo.scala

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
* See the License for the specific language governing permissions and
1414
* limitations under the License.
1515
*/
16-
package rx.lang.scala.examples
16+
package examples
1717

1818
import java.io.IOException
1919
import java.util.concurrent.CountDownLatch
@@ -708,8 +708,8 @@ class RxScalaDemo extends JUnitSuite {
708708
import Notification._
709709
val oc1: Notification[Nothing] = OnCompleted
710710
val oc2: Notification[Int] = OnCompleted
711-
val oc3: rx.Notification[_ <: Int] = oc2.asJavaNotification
712-
val oc4: rx.Notification[_ <: Any] = oc2.asJavaNotification
711+
val oc3: rx.Notification[_ <: Int] = JavaConversions.toJavaNotification(oc2)
712+
val oc4: rx.Notification[_ <: Any] = JavaConversions.toJavaNotification(oc2)
713713
}
714714

715715
@Test def takeWhileWithIndexAlternative {

examples/src/test/scala/rx/lang/scala/examples/TestSchedulerExample.scala renamed to examples/src/test/scala/examples/TestSchedulerExample.scala

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,6 @@
1313
* See the License for the specific language governing permissions and
1414
* limitations under the License.
1515
*/
16-
package rx.lang.scala.examples
17-
1816
import scala.concurrent.duration.DurationInt
1917
import scala.language.postfixOps
2018
import org.junit.Test
@@ -24,6 +22,7 @@ import org.scalatest.junit.JUnitSuite
2422
import rx.lang.scala._
2523
import rx.lang.scala.schedulers.TestScheduler
2624
import rx.observers.TestObserver
25+
import rx.lang.scala.JavaConversions._
2726

2827
class TestSchedulerExample extends JUnitSuite {
2928

@@ -35,7 +34,7 @@ class TestSchedulerExample extends JUnitSuite {
3534
val o = Observable.interval(1 second, scheduler)
3635

3736
// Wrap Java Observer in Scala Observer, then subscribe
38-
val sub = o.subscribe(Observer(new TestObserver(observer)))
37+
val sub = o.subscribe(toScalaObserver(new TestObserver(observer)))
3938

4039
verify(observer, never).onNext(0L)
4140
verify(observer, never).onCompleted()

src/main/scala/rx/lang/scala/schedulers/TestScheduler.scala

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,12 +37,13 @@ object TestScheduler {
3737
* @Test def testInterval() {
3838
* import org.mockito.Matchers._
3939
* import org.mockito.Mockito._
40+
* import rx.lang.scala.JavaConversions._
4041
*
4142
* val scheduler = TestScheduler()
4243
* val observer = mock(classOf[rx.Observer[Long]])
4344
*
4445
* val o = Observable.interval(1 second, scheduler)
45-
* val sub = o.subscribe(observer)
46+
* val sub = o.subscribe(toScalaObserver(new TestObserver(observer)))
4647
*
4748
* verify(observer, never).onNext(0L)
4849
* verify(observer, never).onCompleted()

0 commit comments

Comments
 (0)