Skip to content

Commit 448d778

Browse files
Merge pull request ReactiveX#274 from benjchristensen/0.9-cleanup
0.9 cleanup
2 parents 400bdf4 + cb0fc9d commit 448d778

File tree

6 files changed

+142
-77
lines changed

6 files changed

+142
-77
lines changed

language-adaptors/rxjava-groovy/src/test/groovy/rx/lang/groovy/ObservableTests.groovy

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,8 @@ def class ObservableTests {
7272

7373
@Test
7474
public void testMap1() {
75-
new TestFactory().getObservable().map({v -> 'say' + v}).subscribe({ result -> a.received(result)});
76-
verify(a, times(1)).received("sayhello_1");
75+
Observable.from(1).map({v -> 'hello_' + v}).subscribe({ result -> a.received(result)});
76+
verify(a, times(1)).received("hello_1");
7777
}
7878

7979
@Test

rxjava-core/build.gradle

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ sourceCompatibility = JavaVersion.VERSION_1_6
77
targetCompatibility = JavaVersion.VERSION_1_6
88

99
dependencies {
10-
compile 'org.slf4j:slf4j-api:1.7.0'
1110
provided 'junit:junit-dep:4.10'
1211
provided 'org.mockito:mockito-core:1.8.5'
1312
}
@@ -49,5 +48,7 @@ jar {
4948
instruction 'Bundle-DocURL', 'https://github.com/Netflix/RxJava'
5049
instruction 'Import-Package', '!org.junit,!junit.framework,!org.mockito.*,*'
5150
}
51+
// commenting out for now as it's breaking the rxjava-scala build and I can't figure out why
52+
// exclude('**/*$UnitTest*')
5253
}
5354

rxjava-core/src/main/java/rx/observables/BlockingObservable.java

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ public Subscription call(Observer<T> observer) {
4444
/**
4545
* Returns an iterator that iterates all values of the observable.
4646
*
47-
* @param that
47+
* @param source
4848
* an observable sequence to get an iterator for.
4949
* @param <T>
5050
* the type of source.
@@ -57,7 +57,7 @@ public static <T> Iterator<T> toIterator(Observable<T> source) {
5757
/**
5858
* Returns the last element of an observable sequence with a specified source.
5959
*
60-
* @param that
60+
* @param source
6161
* the source Observable
6262
* @return the last element in the observable sequence.
6363
*/
@@ -68,7 +68,7 @@ public static <T> T last(final Observable<T> source) {
6868
/**
6969
* Returns the last element of an observable sequence that matches the predicate.
7070
*
71-
* @param that
71+
* @param source
7272
* the source Observable
7373
* @param predicate
7474
* a predicate function to evaluate for elements in the sequence.
@@ -81,7 +81,7 @@ public static <T> T last(final Observable<T> source, final Func1<T, Boolean> pre
8181
/**
8282
* Returns the last element of an observable sequence that matches the predicate.
8383
*
84-
* @param that
84+
* @param source
8585
* the source Observable
8686
* @param predicate
8787
* a predicate function to evaluate for elements in the sequence.
@@ -198,7 +198,7 @@ private static <T> T _singleOrDefault(BlockingObservable<T> source, boolean hasD
198198
/**
199199
* Returns the only element of an observable sequence and throws an exception if there is not exactly one element in the observable sequence.
200200
*
201-
* @param that
201+
* @param source
202202
* the source Observable
203203
* @return The single element in the observable sequence.
204204
* @throws IllegalStateException
@@ -211,7 +211,7 @@ public static <T> T single(Observable<T> source) {
211211
/**
212212
* Returns the only element of an observable sequence that matches the predicate and throws an exception if there is not exactly one element in the observable sequence.
213213
*
214-
* @param that
214+
* @param source
215215
* the source Observable
216216
* @param predicate
217217
* A predicate function to evaluate for elements in the sequence.
@@ -226,7 +226,7 @@ public static <T> T single(Observable<T> source, Func1<T, Boolean> predicate) {
226226
/**
227227
* Returns the only element of an observable sequence that matches the predicate and throws an exception if there is not exactly one element in the observable sequence.
228228
*
229-
* @param that
229+
* @param source
230230
* the source Observable
231231
* @param predicate
232232
* A predicate function to evaluate for elements in the sequence.
@@ -241,7 +241,7 @@ public static <T> T single(Observable<T> source, Object predicate) {
241241
/**
242242
* Returns the only element of an observable sequence, or a default value if the observable sequence is empty.
243243
*
244-
* @param that
244+
* @param source
245245
* the source Observable
246246
* @param defaultValue
247247
* default value for a sequence.
@@ -254,7 +254,7 @@ public static <T> T singleOrDefault(Observable<T> source, T defaultValue) {
254254
/**
255255
* Returns the only element of an observable sequence that matches the predicate, or a default value if no value is found.
256256
*
257-
* @param that
257+
* @param source
258258
* the source Observable
259259
* @param defaultValue
260260
* default value for a sequence.
@@ -269,7 +269,7 @@ public static <T> T singleOrDefault(Observable<T> source, T defaultValue, Func1<
269269
/**
270270
* Returns the only element of an observable sequence that matches the predicate, or a default value if no value is found.
271271
*
272-
* @param that
272+
* @param source
273273
* the source Observable
274274
* @param defaultValue
275275
* default value for a sequence.
@@ -286,7 +286,7 @@ public static <T> T singleOrDefault(Observable<T> source, T defaultValue, Object
286286
* <p>
287287
* This will throw an exception if the Observable emits more than 1 value. If more than 1 are expected then use <code>toList().toFuture()</code>.
288288
*
289-
* @param that
289+
* @param source
290290
* the source Observable
291291
* @return a Future that expects a single item emitted by the source Observable
292292
*/
@@ -297,7 +297,7 @@ public static <T> Future<T> toFuture(final Observable<T> source) {
297297
/**
298298
* Converts an observable sequence to an Iterable.
299299
*
300-
* @param that
300+
* @param source
301301
* the source Observable
302302
* @return Observable converted to Iterable.
303303
*/
@@ -565,7 +565,7 @@ public void testLastEmptyObservable() {
565565

566566
@Test
567567
public void testLastOrDefault() {
568-
BlockingObservable<Integer> observable = BlockingObservable.from(toObservable(1, 0, -1));
568+
BlockingObservable<Integer> observable = BlockingObservable.from(from(1, 0, -1));
569569
int last = observable.lastOrDefault(-100, new Func1<Integer, Boolean>() {
570570
@Override
571571
public Boolean call(Integer args) {
@@ -577,19 +577,19 @@ public Boolean call(Integer args) {
577577

578578
@Test
579579
public void testLastOrDefault1() {
580-
BlockingObservable<String> observable = BlockingObservable.from(toObservable("one", "two", "three"));
580+
BlockingObservable<String> observable = BlockingObservable.from(from("one", "two", "three"));
581581
assertEquals("three", observable.lastOrDefault("default"));
582582
}
583583

584584
@Test
585585
public void testLastOrDefault2() {
586-
BlockingObservable<Object> observable = BlockingObservable.from(toObservable());
586+
BlockingObservable<Object> observable = BlockingObservable.from(from());
587587
assertEquals("default", observable.lastOrDefault("default"));
588588
}
589589

590590
@Test
591591
public void testLastOrDefaultWithPredicate() {
592-
BlockingObservable<Integer> observable = BlockingObservable.from(toObservable(1, 0, -1));
592+
BlockingObservable<Integer> observable = BlockingObservable.from(from(1, 0, -1));
593593
int last = observable.lastOrDefault(0, new Func1<Integer, Boolean>() {
594594
@Override
595595
public Boolean call(Integer args) {
@@ -602,7 +602,7 @@ public Boolean call(Integer args) {
602602

603603
@Test
604604
public void testLastOrDefaultWrongPredicate() {
605-
BlockingObservable<Integer> observable = BlockingObservable.from(toObservable(-1, -2, -3));
605+
BlockingObservable<Integer> observable = BlockingObservable.from(from(-1, -2, -3));
606606
int last = observable.lastOrDefault(0, new Func1<Integer, Boolean>() {
607607
@Override
608608
public Boolean call(Integer args) {
@@ -625,19 +625,19 @@ public Boolean call(String s) {
625625
}
626626

627627
public void testSingle() {
628-
BlockingObservable<String> observable = BlockingObservable.from(toObservable("one"));
628+
BlockingObservable<String> observable = BlockingObservable.from(from("one"));
629629
assertEquals("one", observable.single());
630630
}
631631

632632
@Test
633633
public void testSingleDefault() {
634-
BlockingObservable<Object> observable = BlockingObservable.from(toObservable());
634+
BlockingObservable<Object> observable = BlockingObservable.from(from());
635635
assertEquals("default", observable.singleOrDefault("default"));
636636
}
637637

638638
@Test(expected = IllegalStateException.class)
639639
public void testSingleDefaultPredicateMatchesMoreThanOne() {
640-
BlockingObservable.from(toObservable("one", "two")).singleOrDefault("default", new Func1<String, Boolean>() {
640+
BlockingObservable.from(from("one", "two")).singleOrDefault("default", new Func1<String, Boolean>() {
641641
@Override
642642
public Boolean call(String args) {
643643
return args.length() == 3;
@@ -647,7 +647,7 @@ public Boolean call(String args) {
647647

648648
@Test
649649
public void testSingleDefaultPredicateMatchesNothing() {
650-
BlockingObservable<String> observable = BlockingObservable.from(toObservable("one", "two"));
650+
BlockingObservable<String> observable = BlockingObservable.from(from("one", "two"));
651651
String result = observable.singleOrDefault("default", new Func1<String, Boolean>() {
652652
@Override
653653
public Boolean call(String args) {
@@ -659,13 +659,13 @@ public Boolean call(String args) {
659659

660660
@Test(expected = IllegalStateException.class)
661661
public void testSingleDefaultWithMoreThanOne() {
662-
BlockingObservable<String> observable = BlockingObservable.from(toObservable("one", "two", "three"));
662+
BlockingObservable<String> observable = BlockingObservable.from(from("one", "two", "three"));
663663
observable.singleOrDefault("default");
664664
}
665665

666666
@Test
667667
public void testSingleWithPredicateDefault() {
668-
BlockingObservable<String> observable = BlockingObservable.from(toObservable("one", "two", "four"));
668+
BlockingObservable<String> observable = BlockingObservable.from(from("one", "two", "four"));
669669
assertEquals("four", observable.single(new Func1<String, Boolean>() {
670670
@Override
671671
public Boolean call(String s) {
@@ -676,13 +676,13 @@ public Boolean call(String s) {
676676

677677
@Test(expected = IllegalStateException.class)
678678
public void testSingleWrong() {
679-
BlockingObservable<Integer> observable = BlockingObservable.from(toObservable(1, 2));
679+
BlockingObservable<Integer> observable = BlockingObservable.from(from(1, 2));
680680
observable.single();
681681
}
682682

683683
@Test(expected = IllegalStateException.class)
684684
public void testSingleWrongPredicate() {
685-
BlockingObservable<Integer> observable = BlockingObservable.from(toObservable(-1));
685+
BlockingObservable<Integer> observable = BlockingObservable.from(from(-1));
686686
observable.single(new Func1<Integer, Boolean>() {
687687
@Override
688688
public Boolean call(Integer args) {
@@ -693,7 +693,7 @@ public Boolean call(Integer args) {
693693

694694
@Test
695695
public void testToIterable() {
696-
BlockingObservable<String> obs = BlockingObservable.from(toObservable("one", "two", "three"));
696+
BlockingObservable<String> obs = BlockingObservable.from(from("one", "two", "three"));
697697

698698
Iterator<String> it = obs.toIterable().iterator();
699699

0 commit comments

Comments
 (0)