Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update various dependencies and upgrade RxJava from 2 to 3 #205

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .idea/gradle.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 7 additions & 7 deletions example-client/build.gradle
Original file line number Diff line number Diff line change
@@ -20,13 +20,13 @@ repositories {
apply plugin: 'com.android.application'

android {
compileSdkVersion 28
compileSdkVersion 30
//buildToolsVersion '28.0.3'

defaultConfig {
applicationId "ua.naiksoftware.stompclientexample"
minSdkVersion 16
targetSdkVersion 28
targetSdkVersion 30
versionCode 1
versionName "1.0"
}
@@ -50,10 +50,10 @@ dependencies {
implementation 'com.squareup.okhttp3:okhttp:3.12.1'
implementation 'com.android.support:recyclerview-v7:28.0.0'
// RxJava
implementation 'io.reactivex.rxjava2:rxjava:2.2.5'
implementation 'io.reactivex.rxjava2:rxandroid:2.1.0'
implementation 'com.squareup.retrofit2:converter-gson:2.5.0'
implementation 'com.squareup.retrofit2:adapter-rxjava2:2.5.0'
implementation 'com.squareup.retrofit2:retrofit:2.5.0'
implementation 'io.reactivex.rxjava3:rxjava:3.0.13'
implementation 'io.reactivex.rxjava3:rxandroid:3.0.0'
implementation 'com.squareup.retrofit2:converter-gson:2.9.0'
implementation 'com.squareup.retrofit2:adapter-rxjava3:2.9.0'
implementation 'com.squareup.retrofit2:retrofit:2.9.0'
implementation project(':lib')
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package ua.naiksoftware.stompclientexample;

import io.reactivex.Completable;
import io.reactivex.Flowable;
import io.reactivex.rxjava3.core.Completable;
import retrofit2.http.POST;
import retrofit2.http.Query;

Original file line number Diff line number Diff line change
@@ -17,11 +17,12 @@
import androidx.appcompat.app.AppCompatActivity;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import io.reactivex.CompletableTransformer;
import io.reactivex.android.schedulers.AndroidSchedulers;
import io.reactivex.disposables.CompositeDisposable;
import io.reactivex.disposables.Disposable;
import io.reactivex.schedulers.Schedulers;

import io.reactivex.rxjava3.android.schedulers.AndroidSchedulers;
import io.reactivex.rxjava3.core.CompletableTransformer;
import io.reactivex.rxjava3.disposables.CompositeDisposable;
import io.reactivex.rxjava3.disposables.Disposable;
import io.reactivex.rxjava3.schedulers.Schedulers;
import ua.naiksoftware.stomp.Stomp;
import ua.naiksoftware.stomp.dto.StompHeader;
import ua.naiksoftware.stomp.StompClient;
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package ua.naiksoftware.stompclientexample;

import retrofit2.Retrofit;
import retrofit2.adapter.rxjava2.RxJava2CallAdapterFactory;
import retrofit2.adapter.rxjava3.RxJava3CallAdapterFactory;
import retrofit2.converter.gson.GsonConverterFactory;

/**
@@ -33,7 +33,7 @@ public static RestClient getInstance() {
private RestClient() {
Retrofit retrofit = new Retrofit.Builder().baseUrl("http://" + ANDROID_EMULATOR_LOCALHOST + ":" + SERVER_PORT + "/")
.addConverterFactory(GsonConverterFactory.create())
.addCallAdapterFactory(RxJava2CallAdapterFactory.create())
.addCallAdapterFactory(RxJava3CallAdapterFactory.create())
.build();
mExampleRepository = retrofit.create(ExampleRepository.class);
}
12 changes: 6 additions & 6 deletions lib/build.gradle
Original file line number Diff line number Diff line change
@@ -25,11 +25,11 @@ apply plugin: 'groovyx.android'
group='com.github.NaikSoftware'

android {
compileSdkVersion 28
compileSdkVersion 30

defaultConfig {
minSdkVersion 16
targetSdkVersion 25
targetSdkVersion 30
versionCode 1
versionName "1.0"
}
@@ -53,16 +53,16 @@ android {


dependencies {
implementation 'io.reactivex.rxjava2:rxjava:2.2.5'
implementation 'io.reactivex.rxjava3:rxjava:3.0.13'
// Supported transports
api 'org.java-websocket:Java-WebSocket:1.3.6'
api 'com.squareup.okhttp3:okhttp:3.12.1'
api 'com.squareup.okhttp3:okhttp:3.14.9'
implementation 'com.android.support:support-annotations:28.0.0'
testImplementation 'com.andrewreitz:spock-android:2.0.0'
testImplementation 'org.testcontainers:testcontainers:1.10.5'
testImplementation 'org.testcontainers:testcontainers:1.15.3'
testImplementation 'org.spockframework:spock-core:1.1-groovy-2.4'
testImplementation 'org.java-websocket:Java-WebSocket:1.3.6'
testImplementation 'com.squareup.okhttp3:okhttp:3.12.1'
testImplementation 'com.squareup.okhttp3:okhttp:3.14.9'
testImplementation 'ch.qos.logback:logback-classic:1.2.3'
}

6 changes: 3 additions & 3 deletions lib/src/main/java/ua/naiksoftware/stomp/HeartBeatTask.java
Original file line number Diff line number Diff line change
@@ -5,9 +5,9 @@

import java.util.concurrent.TimeUnit;

import io.reactivex.Scheduler;
import io.reactivex.disposables.Disposable;
import io.reactivex.schedulers.Schedulers;
import io.reactivex.rxjava3.core.Scheduler;
import io.reactivex.rxjava3.disposables.Disposable;
import io.reactivex.rxjava3.schedulers.Schedulers;
import ua.naiksoftware.stomp.dto.StompCommand;
import ua.naiksoftware.stomp.dto.StompHeader;
import ua.naiksoftware.stomp.dto.StompMessage;
14 changes: 7 additions & 7 deletions lib/src/main/java/ua/naiksoftware/stomp/StompClient.java
Original file line number Diff line number Diff line change
@@ -11,13 +11,13 @@
import java.util.UUID;
import java.util.concurrent.ConcurrentHashMap;

import io.reactivex.BackpressureStrategy;
import io.reactivex.Completable;
import io.reactivex.CompletableSource;
import io.reactivex.Flowable;
import io.reactivex.disposables.Disposable;
import io.reactivex.subjects.BehaviorSubject;
import io.reactivex.subjects.PublishSubject;
import io.reactivex.rxjava3.core.BackpressureStrategy;
import io.reactivex.rxjava3.core.Completable;
import io.reactivex.rxjava3.core.CompletableSource;
import io.reactivex.rxjava3.core.Flowable;
import io.reactivex.rxjava3.disposables.Disposable;
import io.reactivex.rxjava3.subjects.BehaviorSubject;
import io.reactivex.rxjava3.subjects.PublishSubject;
import ua.naiksoftware.stomp.dto.StompCommand;
import ua.naiksoftware.stomp.dto.StompMessage;
import ua.naiksoftware.stomp.pathmatcher.PathMatcher;
Original file line number Diff line number Diff line change
@@ -4,16 +4,10 @@
import android.support.annotation.Nullable;
import android.util.Log;

import java.util.concurrent.TimeUnit;

import io.reactivex.Completable;
import io.reactivex.Observable;
import io.reactivex.schedulers.Schedulers;
import io.reactivex.subjects.PublishSubject;
import io.reactivex.rxjava3.core.Completable;
import io.reactivex.rxjava3.core.Observable;
import io.reactivex.rxjava3.subjects.PublishSubject;
import ua.naiksoftware.stomp.dto.LifecycleEvent;
import ua.naiksoftware.stomp.dto.StompHeader;
import ua.naiksoftware.stomp.dto.StompCommand;
import ua.naiksoftware.stomp.dto.StompMessage;

/**
* Created by forresthopkinsa on 8/8/2017.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package ua.naiksoftware.stomp.provider;

import io.reactivex.Completable;
import io.reactivex.Observable;
import io.reactivex.rxjava3.core.Completable;
import io.reactivex.rxjava3.core.Observable;
import ua.naiksoftware.stomp.dto.LifecycleEvent;

/**
Original file line number Diff line number Diff line change
@@ -1,16 +1,9 @@
package ua.naiksoftware.stomp

import com.andrewreitz.spock.android.AndroidSpecification
import groovy.util.logging.Slf4j
import org.testcontainers.containers.BindMode
import org.testcontainers.containers.GenericContainer
import org.testcontainers.containers.output.OutputFrame
import org.testcontainers.containers.startupcheck.StartupCheckStrategy
import org.testcontainers.containers.wait.strategy.Wait
import spock.lang.Shared
import spock.lang.Specification

import java.util.function.Consumer

class Configuration extends AndroidSpecification {

Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
package ua.naiksoftware.stomp


import io.reactivex.functions.Predicate
import io.reactivex.subscribers.TestSubscriber
import io.reactivex.rxjava3.functions.Predicate
import io.reactivex.rxjava3.subscribers.TestSubscriber
import org.junit.Test
import ua.naiksoftware.stomp.dto.LifecycleEvent

class ConnectionTests extends Configuration {

@Test
def "connection must be opened"() {
given:
def client = Stomp.over(Stomp.ConnectionProvider.OKHTTP,
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
package ua.naiksoftware.stomp

import org.junit.Test
import ua.naiksoftware.stomp.dto.StompCommand
import ua.naiksoftware.stomp.dto.StompHeader
import ua.naiksoftware.stomp.dto.StompMessage
import ua.naiksoftware.stomp.pathmatcher.RabbitPathMatcher

class PathMatcherTests extends Configuration {

@Test
def "rmq-style matcher must return expected value"() {
given:
def matcher = new RabbitPathMatcher()
8 changes: 4 additions & 4 deletions test-server/build.gradle
Original file line number Diff line number Diff line change
@@ -28,10 +28,10 @@ repositories {
}

dependencies {
compile 'org.springframework.boot:spring-boot-starter-websocket'
compile 'org.springframework.boot:spring-boot-starter-web'
compile 'ch.qos.logback:logback-classic:1.2.3'
compile 'org.codehaus.groovy:groovy-all:2.4.15'
implementation 'org.springframework.boot:spring-boot-starter-websocket'
implementation 'org.springframework.boot:spring-boot-starter-web'
implementation 'ch.qos.logback:logback-classic:1.2.3'
implementation 'org.codehaus.groovy:groovy-all:2.4.15'
}

dependencyManagement {