diff --git a/.idea/gradle.xml b/.idea/gradle.xml index 804e5a0..1de4d7f 100644 --- a/.idea/gradle.xml +++ b/.idea/gradle.xml @@ -1,8 +1,10 @@ + - + diff --git a/example-client/build.gradle b/example-client/build.gradle index 18d6a09..90ef813 100644 --- a/example-client/build.gradle +++ b/example-client/build.gradle @@ -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') } diff --git a/example-client/src/main/java/ua/naiksoftware/stompclientexample/ExampleRepository.java b/example-client/src/main/java/ua/naiksoftware/stompclientexample/ExampleRepository.java index 19aeab5..dfdb857 100644 --- a/example-client/src/main/java/ua/naiksoftware/stompclientexample/ExampleRepository.java +++ b/example-client/src/main/java/ua/naiksoftware/stompclientexample/ExampleRepository.java @@ -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; diff --git a/example-client/src/main/java/ua/naiksoftware/stompclientexample/MainActivity.java b/example-client/src/main/java/ua/naiksoftware/stompclientexample/MainActivity.java index fd35cde..ea8f8cb 100644 --- a/example-client/src/main/java/ua/naiksoftware/stompclientexample/MainActivity.java +++ b/example-client/src/main/java/ua/naiksoftware/stompclientexample/MainActivity.java @@ -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; diff --git a/example-client/src/main/java/ua/naiksoftware/stompclientexample/RestClient.java b/example-client/src/main/java/ua/naiksoftware/stompclientexample/RestClient.java index 209a497..e4ff854 100644 --- a/example-client/src/main/java/ua/naiksoftware/stompclientexample/RestClient.java +++ b/example-client/src/main/java/ua/naiksoftware/stompclientexample/RestClient.java @@ -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); } diff --git a/lib/build.gradle b/lib/build.gradle index be24a6c..ce17c5d 100644 --- a/lib/build.gradle +++ b/lib/build.gradle @@ -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' } diff --git a/lib/src/main/java/ua/naiksoftware/stomp/HeartBeatTask.java b/lib/src/main/java/ua/naiksoftware/stomp/HeartBeatTask.java index 0ce86a7..b4b87d5 100644 --- a/lib/src/main/java/ua/naiksoftware/stomp/HeartBeatTask.java +++ b/lib/src/main/java/ua/naiksoftware/stomp/HeartBeatTask.java @@ -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; diff --git a/lib/src/main/java/ua/naiksoftware/stomp/StompClient.java b/lib/src/main/java/ua/naiksoftware/stomp/StompClient.java index e4f73cc..3d17544 100644 --- a/lib/src/main/java/ua/naiksoftware/stomp/StompClient.java +++ b/lib/src/main/java/ua/naiksoftware/stomp/StompClient.java @@ -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; diff --git a/lib/src/main/java/ua/naiksoftware/stomp/provider/AbstractConnectionProvider.java b/lib/src/main/java/ua/naiksoftware/stomp/provider/AbstractConnectionProvider.java index c0f938e..92684b0 100644 --- a/lib/src/main/java/ua/naiksoftware/stomp/provider/AbstractConnectionProvider.java +++ b/lib/src/main/java/ua/naiksoftware/stomp/provider/AbstractConnectionProvider.java @@ -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. diff --git a/lib/src/main/java/ua/naiksoftware/stomp/provider/ConnectionProvider.java b/lib/src/main/java/ua/naiksoftware/stomp/provider/ConnectionProvider.java index bfac8ee..5d87b8b 100644 --- a/lib/src/main/java/ua/naiksoftware/stomp/provider/ConnectionProvider.java +++ b/lib/src/main/java/ua/naiksoftware/stomp/provider/ConnectionProvider.java @@ -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; /** diff --git a/lib/src/test/groovy/ua/naiksoftware/stomp/Configuration.groovy b/lib/src/test/groovy/ua/naiksoftware/stomp/Configuration.groovy index da6b5ee..524ff89 100644 --- a/lib/src/test/groovy/ua/naiksoftware/stomp/Configuration.groovy +++ b/lib/src/test/groovy/ua/naiksoftware/stomp/Configuration.groovy @@ -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 { diff --git a/lib/src/test/groovy/ua/naiksoftware/stomp/ConnectionTests.groovy b/lib/src/test/groovy/ua/naiksoftware/stomp/ConnectionTests.groovy index 6dfbe8f..08eb64f 100644 --- a/lib/src/test/groovy/ua/naiksoftware/stomp/ConnectionTests.groovy +++ b/lib/src/test/groovy/ua/naiksoftware/stomp/ConnectionTests.groovy @@ -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, diff --git a/lib/src/test/groovy/ua/naiksoftware/stomp/PathMatcherTests.groovy b/lib/src/test/groovy/ua/naiksoftware/stomp/PathMatcherTests.groovy index f37fa40..d6d6479 100644 --- a/lib/src/test/groovy/ua/naiksoftware/stomp/PathMatcherTests.groovy +++ b/lib/src/test/groovy/ua/naiksoftware/stomp/PathMatcherTests.groovy @@ -1,5 +1,6 @@ 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 @@ -7,6 +8,7 @@ import ua.naiksoftware.stomp.pathmatcher.RabbitPathMatcher class PathMatcherTests extends Configuration { + @Test def "rmq-style matcher must return expected value"() { given: def matcher = new RabbitPathMatcher() diff --git a/test-server/build.gradle b/test-server/build.gradle index ccfae21..4e7493b 100644 --- a/test-server/build.gradle +++ b/test-server/build.gradle @@ -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 {