Skip to content
This repository was archived by the owner on Nov 18, 2024. It is now read-only.

Commit bc7b9be

Browse files
committed
Linked to examples
1 parent e18023a commit bc7b9be

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

Part 4 - Concurrency/2. Testing Rx.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ System.out.println("Advancing to 40s");
4343
s.advanceTimeTo(40, TimeUnit.SECONDS);
4444
System.out.println("Virtual time: " + s.now());
4545
```
46-
Output
46+
[Output](/tests/java/itrx/chapter4/testing/TestSchedulerExample.java)
4747
```
4848
Advancing to 1ms
4949
Immediate
@@ -88,7 +88,7 @@ System.out.println("Advancing by 40s");
8888
s.advanceTimeBy(40, TimeUnit.SECONDS);
8989
System.out.println("Virtual time: " + s.now());
9090
```
91-
Output
91+
[Output](/tests/java/itrx/chapter4/testing/TestSchedulerExample.java)
9292
```
9393
Advancing by 1ms
9494
Immediate
@@ -117,7 +117,7 @@ s.createWorker().schedule(
117117
s.triggerActions();
118118
System.out.println("Virtual time: " + s.now());
119119
```
120-
Output
120+
[Output](/tests/java/itrx/chapter4/testing/TestSchedulerExample.java)
121121
```
122122
Immediate
123123
Virtual time: 0
@@ -142,7 +142,7 @@ s.createWorker().schedule(
142142

143143
s.advanceTimeTo(20, TimeUnit.SECONDS);
144144
```
145-
Output
145+
[Output](/tests/java/itrx/chapter4/testing/TestSchedulerExample.java)
146146
```
147147
First
148148
Second
@@ -153,7 +153,7 @@ Third
153153

154154
Rx operators which involve asynchronous actions schedule those actions using a scheduler. If you take a look at all the operators in [Observable](http://reactivex.io/RxJava/javadoc/rx/Observable.html), you will see that such operators have overloads that take a scheduler. This is the way that you can supplement their real-time schedulers for your `TestScheduler`.
155155

156-
Here is an example where we will test the output of `Observable.interval` against what we expect it to emit.
156+
Here is an [example](/tests/java/itrx/chapter4/testing/ExampleExample.java) where we will test the output of `Observable.interval` against what we expect it to emit.
157157

158158
```java
159159
@Test
@@ -176,7 +176,7 @@ This is useful for testing small, self-contained pieces of Rx code, such as cust
176176

177177
### TestSubscriber
178178

179-
In the test above, we manually collected the values emitted and compared them against what we expected. This process is common enough in tests that Rx comes packaged with `TestScubscriber`, which will do that for us. Its event handlers will collect every notification received and make them available for us to inspect. With `TestSubscriber` our previous test becomes:
179+
In the test above, we manually collected the values emitted and compared them against what we expected. This process is common enough in tests that Rx comes packaged with `TestScubscriber`, which will do that for us. Its event handlers will collect every notification received and make them available for us to inspect. With `TestSubscriber` our [previous test becomes](/tests/java/itrx/chapter4/testing/TestSubscriberExample.java):
180180

181181
```java
182182
@Test

0 commit comments

Comments
 (0)