Merge branch 'master' of github.com:redisson/redisson

pull/5937/head
Nikita Koksharov 8 months ago
commit fb0bf29078

@ -175,7 +175,7 @@
<dependency>
<groupId>org.testcontainers</groupId>
<artifactId>testcontainers-bom</artifactId>
<version>1.19.7</version>
<version>1.19.8</version>
<type>pom</type>
<scope>import</scope>
</dependency>

@ -479,7 +479,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-pmd-plugin</artifactId>
<version>3.20.0</version>
<version>3.22.0</version>
<executions>
<execution>
<phase>verify</phase>

@ -400,6 +400,35 @@ public class RedissonRemoteServiceTest extends RedisDockerTest {
assertThat(executor.awaitTermination(2, TimeUnit.SECONDS)).isTrue();
}
@Test
public void testCancelRxJava() throws InterruptedException {
RedissonRxClient r1 = Redisson.create(createConfig()).rxJava();
AtomicInteger iterations = new AtomicInteger();
ExecutorService executor = Executors.newSingleThreadExecutor();
r1.getKeys().flushall();
r1.getRemoteService().register(RemoteInterface.class, new RemoteImpl(iterations), 1, executor);
RedissonRxClient r2 = Redisson.create(createConfig()).rxJava();
RemoteInterfaceRx ri = r2.getRemoteService().get(RemoteInterfaceRx.class);
Completable f = ri.cancelMethod();
io.reactivex.rxjava3.disposables.Disposable t = f.subscribe();
Thread.sleep(500);
t.dispose();
Thread.sleep(500);
int disposedIterations = iterations.get();
Thread.sleep(500);
executor.shutdown();
r1.shutdown();
r2.shutdown();
assertThat(iterations.get()).isEqualTo(disposedIterations);
assertThat(executor.awaitTermination(2, TimeUnit.SECONDS)).isTrue();
}
@Test
public void testWrongMethodAsync() {
Assertions.assertThrows(IllegalArgumentException.class, () -> {

Loading…
Cancel
Save