Skip to content

Commit

Permalink
Dependencies update and replace deprecated method in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
wiryadev authored Aug 10, 2021
1 parent f1ddbcb commit 6ae7453
Show file tree
Hide file tree
Showing 8 changed files with 14 additions and 20 deletions.
4 changes: 2 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ buildscript {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:4.1.1'
classpath 'com.android.tools.build:gradle:4.2.2'
classpath 'com.github.dcendents:android-maven-gradle-plugin:2.1'
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.8.5'
classpath 'org.jfrog.buildinfo:build-info-extractor-gradle:4.7.5'
Expand All @@ -22,6 +22,6 @@ allprojects {

ext {
minSdkVersion = 9
compileSdkVersion = 30
compileSdkVersion = 31
sourceCompatibility = JavaVersion.VERSION_1_8
}
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.7.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-6.8.3-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
4 changes: 2 additions & 2 deletions rxandroid/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@ android {
}

dependencies {
api 'io.reactivex.rxjava3:rxjava:3.0.8'
api 'io.reactivex.rxjava3:rxjava:3.1.0'

testImplementation 'junit:junit:4.13.1'
testImplementation 'junit:junit:4.13.2'
testImplementation 'org.robolectric:robolectric:4.2.1'
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
*/
package io.reactivex.rxjava3.android;

import io.reactivex.rxjava3.android.MainThreadDisposable;
import io.reactivex.rxjava3.disposables.Disposable;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.atomic.AtomicBoolean;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@

import io.reactivex.rxjava3.android.plugins.RxAndroidPlugins;
import io.reactivex.rxjava3.android.testutil.EmptyScheduler;
import io.reactivex.rxjava3.android.schedulers.AndroidSchedulers;
import io.reactivex.rxjava3.core.Scheduler;
import io.reactivex.rxjava3.functions.Function;

Expand Down Expand Up @@ -96,7 +95,7 @@ public void fromReturnsUsableScheduler() {

@Test
public void mainThreadAsyncMessagesByDefault() {
ShadowLooper mainLooper = ShadowLooper.getShadowMainLooper();
ShadowLooper mainLooper = shadowOf(Looper.getMainLooper());
mainLooper.pause();
ShadowMessageQueue mainMessageQueue = shadowOf(Looper.getMainLooper().getQueue());

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

@Test
public void fromAsyncMessagesByDefault() {
ShadowLooper mainLooper = ShadowLooper.getShadowMainLooper();
ShadowLooper mainLooper = shadowOf(Looper.getMainLooper());
mainLooper.pause();
ShadowMessageQueue mainMessageQueue = shadowOf(Looper.getMainLooper().getQueue());

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

ShadowLooper mainLooper = ShadowLooper.getShadowMainLooper();
ShadowLooper mainLooper = shadowOf(Looper.getMainLooper());
mainLooper.pause();
ShadowMessageQueue mainMessageQueue = shadowOf(Looper.getMainLooper().getQueue());

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
import android.os.Message;

import io.reactivex.rxjava3.android.testutil.CountingRunnable;
import io.reactivex.rxjava3.android.schedulers.HandlerScheduler;
import io.reactivex.rxjava3.core.Scheduler;
import io.reactivex.rxjava3.core.Scheduler.Worker;
import io.reactivex.rxjava3.disposables.Disposable;
Expand Down Expand Up @@ -49,6 +48,7 @@
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
import static org.robolectric.Shadows.shadowOf;
import static org.robolectric.shadows.ShadowLooper.idleMainLooper;
import static org.robolectric.shadows.ShadowLooper.pauseMainLooper;
import static org.robolectric.shadows.ShadowLooper.runUiThreadTasks;
import static org.robolectric.shadows.ShadowLooper.runUiThreadTasksIncludingDelayedTasks;
Expand All @@ -66,8 +66,8 @@ public static Collection<Object[]> data() {
});
}

private Scheduler scheduler;
private boolean async;
private final Scheduler scheduler;
private final boolean async;

public HandlerSchedulerTest(boolean async) {
this.scheduler = new HandlerScheduler(new Handler(Looper.getMainLooper()), async);
Expand Down Expand Up @@ -822,9 +822,4 @@ public void workerSchedulePeriodicallySetAsync() {
Message message = mainMessageQueue.getHead();
assertEquals(async, message.isAsynchronous());
}

private static void idleMainLooper(long amount, TimeUnit unit) {
// TODO delete this when https://github.com/robolectric/robolectric/pull/2592 is released.
ShadowLooper.idleMainLooper(unit.toMillis(amount));
}
}
2 changes: 1 addition & 1 deletion sample-app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ android {

defaultConfig {
minSdkVersion 15
targetSdkVersion 30
targetSdkVersion 31
versionCode 1
versionName '1.0'
}
Expand Down
3 changes: 2 additions & 1 deletion sample-app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@

<activity
android:name=".MainActivity"
android:label="@string/app_name">
android:label="@string/app_name"
android:exported="true">

<intent-filter>
<category android:name="android.intent.category.LAUNCHER"/>
Expand Down

0 comments on commit 6ae7453

Please sign in to comment.