Skip to content

Commit 7b1fc00

Browse files
committed
Create a base test class and have all unit tests extend it
This commit creates the `RxJavaTest` class defining a default timeout to 5 minutes. An ignored test announce itself for each running class extending it preventing Travis CI from killing the build. Have `Completable` tests extend from `RxJavaTest`. Have `Disposable` tests extend from `RxJavaTest`. Have `Exception` tests extend from `RxJavaTest` Closes: #6583
1 parent 028d33e commit 7b1fc00

13 files changed

+268
-965
lines changed
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
/**
2+
* Copyright (c) 2016-present, RxJava Contributors.
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 io.reactivex;
17+
18+
import org.junit.Ignore;
19+
import org.junit.Rule;
20+
import org.junit.Test;
21+
import org.junit.rules.Timeout;
22+
23+
import java.util.concurrent.TimeUnit;
24+
25+
public abstract class RxJavaTest {
26+
@Rule
27+
public Timeout globalTimeout = new Timeout(5, TimeUnit.MINUTES);
28+
29+
/**
30+
* Announce creates a log print preventing Travis CI from killing the build.
31+
*/
32+
@Test
33+
@Ignore
34+
public final void announce() {
35+
}
36+
}

src/test/java/io/reactivex/completable/CompletableRetryTest.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
package io.reactivex.completable;
1515

1616
import io.reactivex.Completable;
17+
import io.reactivex.RxJavaTest;
1718
import io.reactivex.functions.Action;
1819
import io.reactivex.functions.Predicate;
1920
import io.reactivex.internal.functions.Functions;
@@ -22,7 +23,7 @@
2223

2324
import static org.junit.Assert.assertEquals;
2425

25-
public class CompletableRetryTest {
26+
public class CompletableRetryTest extends RxJavaTest {
2627
@Test
2728
public void retryTimesPredicateWithMatchingPredicate() {
2829
final AtomicInteger atomicInteger = new AtomicInteger(3);

0 commit comments

Comments
 (0)