Skip to content

Commit 6ae7453

Browse files
authored
Dependencies update and replace deprecated method in tests
1 parent f1ddbcb commit 6ae7453

File tree

8 files changed

+14
-20
lines changed

8 files changed

+14
-20
lines changed

build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ buildscript {
55
jcenter()
66
}
77
dependencies {
8-
classpath 'com.android.tools.build:gradle:4.1.1'
8+
classpath 'com.android.tools.build:gradle:4.2.2'
99
classpath 'com.github.dcendents:android-maven-gradle-plugin:2.1'
1010
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.8.5'
1111
classpath 'org.jfrog.buildinfo:build-info-extractor-gradle:4.7.5'
@@ -22,6 +22,6 @@ allprojects {
2222

2323
ext {
2424
minSdkVersion = 9
25-
compileSdkVersion = 30
25+
compileSdkVersion = 31
2626
sourceCompatibility = JavaVersion.VERSION_1_8
2727
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-6.7.1-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-6.8.3-bin.zip
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists

rxandroid/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,9 @@ android {
3636
}
3737

3838
dependencies {
39-
api 'io.reactivex.rxjava3:rxjava:3.0.8'
39+
api 'io.reactivex.rxjava3:rxjava:3.1.0'
4040

41-
testImplementation 'junit:junit:4.13.1'
41+
testImplementation 'junit:junit:4.13.2'
4242
testImplementation 'org.robolectric:robolectric:4.2.1'
4343
}
4444

rxandroid/src/test/java/io/reactivex/rxjava3/android/MainThreadDisposableTest.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
*/
1414
package io.reactivex.rxjava3.android;
1515

16-
import io.reactivex.rxjava3.android.MainThreadDisposable;
1716
import io.reactivex.rxjava3.disposables.Disposable;
1817
import java.util.concurrent.CountDownLatch;
1918
import java.util.concurrent.atomic.AtomicBoolean;

rxandroid/src/test/java/io/reactivex/rxjava3/android/schedulers/AndroidSchedulersTest.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919

2020
import io.reactivex.rxjava3.android.plugins.RxAndroidPlugins;
2121
import io.reactivex.rxjava3.android.testutil.EmptyScheduler;
22-
import io.reactivex.rxjava3.android.schedulers.AndroidSchedulers;
2322
import io.reactivex.rxjava3.core.Scheduler;
2423
import io.reactivex.rxjava3.functions.Function;
2524

@@ -96,7 +95,7 @@ public void fromReturnsUsableScheduler() {
9695

9796
@Test
9897
public void mainThreadAsyncMessagesByDefault() {
99-
ShadowLooper mainLooper = ShadowLooper.getShadowMainLooper();
98+
ShadowLooper mainLooper = shadowOf(Looper.getMainLooper());
10099
mainLooper.pause();
101100
ShadowMessageQueue mainMessageQueue = shadowOf(Looper.getMainLooper().getQueue());
102101

@@ -112,7 +111,7 @@ public void mainThreadAsyncMessagesByDefault() {
112111

113112
@Test
114113
public void fromAsyncMessagesByDefault() {
115-
ShadowLooper mainLooper = ShadowLooper.getShadowMainLooper();
114+
ShadowLooper mainLooper = shadowOf(Looper.getMainLooper());
116115
mainLooper.pause();
117116
ShadowMessageQueue mainMessageQueue = shadowOf(Looper.getMainLooper().getQueue());
118117

@@ -130,7 +129,7 @@ public void fromAsyncMessagesByDefault() {
130129
public void asyncIgnoredPre16() {
131130
ReflectionHelpers.setStaticField(Build.VERSION.class, "SDK_INT", 14);
132131

133-
ShadowLooper mainLooper = ShadowLooper.getShadowMainLooper();
132+
ShadowLooper mainLooper = shadowOf(Looper.getMainLooper());
134133
mainLooper.pause();
135134
ShadowMessageQueue mainMessageQueue = shadowOf(Looper.getMainLooper().getQueue());
136135

rxandroid/src/test/java/io/reactivex/rxjava3/android/schedulers/HandlerSchedulerTest.java

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
import android.os.Message;
1919

2020
import io.reactivex.rxjava3.android.testutil.CountingRunnable;
21-
import io.reactivex.rxjava3.android.schedulers.HandlerScheduler;
2221
import io.reactivex.rxjava3.core.Scheduler;
2322
import io.reactivex.rxjava3.core.Scheduler.Worker;
2423
import io.reactivex.rxjava3.disposables.Disposable;
@@ -49,6 +48,7 @@
4948
import static org.junit.Assert.assertTrue;
5049
import static org.junit.Assert.fail;
5150
import static org.robolectric.Shadows.shadowOf;
51+
import static org.robolectric.shadows.ShadowLooper.idleMainLooper;
5252
import static org.robolectric.shadows.ShadowLooper.pauseMainLooper;
5353
import static org.robolectric.shadows.ShadowLooper.runUiThreadTasks;
5454
import static org.robolectric.shadows.ShadowLooper.runUiThreadTasksIncludingDelayedTasks;
@@ -66,8 +66,8 @@ public static Collection<Object[]> data() {
6666
});
6767
}
6868

69-
private Scheduler scheduler;
70-
private boolean async;
69+
private final Scheduler scheduler;
70+
private final boolean async;
7171

7272
public HandlerSchedulerTest(boolean async) {
7373
this.scheduler = new HandlerScheduler(new Handler(Looper.getMainLooper()), async);
@@ -822,9 +822,4 @@ public void workerSchedulePeriodicallySetAsync() {
822822
Message message = mainMessageQueue.getHead();
823823
assertEquals(async, message.isAsynchronous());
824824
}
825-
826-
private static void idleMainLooper(long amount, TimeUnit unit) {
827-
// TODO delete this when https://github.com/robolectric/robolectric/pull/2592 is released.
828-
ShadowLooper.idleMainLooper(unit.toMillis(amount));
829-
}
830825
}

sample-app/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ android {
55

66
defaultConfig {
77
minSdkVersion 15
8-
targetSdkVersion 30
8+
targetSdkVersion 31
99
versionCode 1
1010
versionName '1.0'
1111
}

sample-app/src/main/AndroidManifest.xml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@
1414

1515
<activity
1616
android:name=".MainActivity"
17-
android:label="@string/app_name">
17+
android:label="@string/app_name"
18+
android:exported="true">
1819

1920
<intent-filter>
2021
<category android:name="android.intent.category.LAUNCHER"/>

0 commit comments

Comments
 (0)