Skip to content

Commit 99a1d03

Browse files
Pulled in changes from Samuel.
Fixed tests, all working without warnings
1 parent ea3894a commit 99a1d03

File tree

3 files changed

+62
-2
lines changed

3 files changed

+62
-2
lines changed

gradlew

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ DEFAULT_JVM_OPTS=""
1212
APP_NAME="Gradle"
1313
APP_BASE_NAME=`basename "$0"`
1414

15+
JAVA_HOME="/Library/Java/JavaVirtualMachines/jdk1.7.0_40.jdk/Contents/Home"
16+
1517
# Use the maximum available, or set MAX_FD != -1 to use that value.
1618
MAX_FD="maximum"
1719

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
import org.junit.Assert._
2+
import org.junit.Test
3+
import rx.lang.scala.subjects._
4+
import org.mockito.InOrder
5+
import rx.lang.scala._
6+
import org.mockito.Matchers._;
7+
import org.mockito.Mockito._;
8+
9+
import org.junit.Assert._
10+
import org.junit.Test
11+
import org.scalatest.junit.JUnitSuite
12+
13+
class SubjectTests extends JUnitSuite {
14+
15+
// @Test def PublishSubjectIsAChannel() {
16+
//
17+
// val channel: BehaviorSubject[Integer] = BehaviorSubject(2013)
18+
// val observerA: Observer[Integer] = mock(classOf[Observer[Integer]])
19+
// val observerB: Observer[Integer] = mock(classOf[Observer[Integer]])
20+
// val observerC: Observer[Integer] = mock(classOf[Observer[Integer]])
21+
//
22+
// val x = inOrder(observerA, observerB, observerC)
23+
//
24+
// val a = channel.subscribe(observerA)
25+
// val b = channel.subscribe(observerB)
26+
//
27+
// x.verify(observerA).onNext(2013)
28+
// x.verify(observerB).onNext(2013)
29+
//
30+
// channel.onNext(42)
31+
//
32+
// x.verify(observerA).onNext(42)
33+
// x.verify(observerB).onNext(42)
34+
//
35+
// a.unsubscribe()
36+
//
37+
// channel.onNext(4711)
38+
//
39+
// x.verify(observerA, never()).onNext(any())
40+
// x.verify(observerB).onNext(4711)
41+
//
42+
// channel.onCompleted()
43+
//
44+
// x.verify(observerA, never()).onCompleted()
45+
// x.verify(observerB).onCompleted()
46+
//
47+
// val c = channel.subscribe(observerC)
48+
//
49+
// x.verify(observerC).onCompleted()
50+
//
51+
// channel.onNext(13)
52+
//
53+
// x.verifyNoMoreInteractions()
54+
//
55+
// }
56+
57+
}

language-adaptors/rxjava-scala/src/test/scala/rx/lang/scala/subscriptions/SubscriptionTests.scala

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,9 @@ package rx.lang.scala.subscriptions
33
import org.junit.Assert._
44
import org.junit.Test
55
import org.scalatest.junit.JUnitSuite
6+
import rx.lang.scala._
7+
68

7-
import rx.lang.scala.Subscription
89

910
class SubscriptionTests extends JUnitSuite {
1011

@@ -46,7 +47,7 @@ class SubscriptionTests extends JUnitSuite {
4647
val s0 = BooleanSubscription{ u0 = true }
4748

4849
var u1 = false
49-
val s1 = Subscription{ u1 = true }
50+
val s1 = rx.lang.scala.Subscription{ u1 = true }
5051

5152
val composite = CompositeSubscription()
5253

0 commit comments

Comments
 (0)