File tree Expand file tree Collapse file tree 2 files changed +34
-0
lines changed
language-adaptors/rxjava-scala/src Expand file tree Collapse file tree 2 files changed +34
-0
lines changed Original file line number Diff line number Diff line change @@ -34,6 +34,8 @@ object Subscriber extends ObserverFactoryMethods[Subscriber] {
34
34
35
35
private [scala] def apply [T ](subscriber : rx.Subscriber [T ]): Subscriber [T ] = new Subscriber [T ] {
36
36
override val asJavaSubscriber = subscriber
37
+ override val asJavaObserver : rx.Observer [_ >: T ] = asJavaSubscriber
38
+ override val asJavaSubscription : rx.Subscription = asJavaSubscriber
37
39
38
40
override def onNext (value : T ): Unit = asJavaSubscriber.onNext(value)
39
41
override def onError (error : Throwable ): Unit = asJavaSubscriber.onError(error)
Original file line number Diff line number Diff line change
1
+ /**
2
+ * Copyright 2013 Netflix, Inc.
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ package rx .lang .scala
17
+
18
+ import org .junit .Test
19
+ import org .junit .Assert .assertNotNull
20
+ import org .scalatest .junit .JUnitSuite
21
+
22
+ class SubscriberTests extends JUnitSuite {
23
+
24
+ @ Test def testIssue1173 () {
25
+ // https://github.com/Netflix/RxJava/issues/1173
26
+ val subscriber = Subscriber ((n : Int ) => println(n))
27
+ assertNotNull(subscriber.asJavaObserver)
28
+ assertNotNull(subscriber.asJavaSubscription)
29
+ assertNotNull(subscriber.asJavaSubscriber)
30
+ }
31
+
32
+ }
You can’t perform that action at this time.
0 commit comments