[BAEL-16658] Split rxjava (& rxjava-2) by subject

This commit is contained in:
Sjmillington
2019-11-02 12:38:21 +00:00
parent d47ea19834
commit 596809a9ce
65 changed files with 661 additions and 570 deletions
+8 -4
View File
@@ -603,8 +603,10 @@
<!-- <module>rmi</module> --> <!-- Not a maven project -->
<module>rule-engines</module>
<module>rsocket</module>
<module>rxjava</module>
<module>rxjava-2</module>
<module>rxjava-core</module>
<module>rxjava-observables</module>
<module>rxjava-operators</module>
<module>rxjava-libraries</module>
<module>software-security/sql-injection-samples</module>
<module>tensorflow-java</module>
@@ -1369,8 +1371,10 @@
<!-- <module>rmi</module> --> <!-- Not a maven project -->
<module>rule-engines</module>
<module>rsocket</module>
<module>rxjava</module>
<module>rxjava-2</module>
<module>rxjava-core</module>
<module>rxjava-observables</module>
<module>rxjava-operators</module>
<module>rxjava-libraries</module>
<module>oauth2-framework-impl</module>
<module>spf4j</module>
<module>spring-boot-performance</module>
-14
View File
@@ -1,14 +0,0 @@
## RxJava
This module contains articles about RxJava.
### Relevant articles:
- [RxJava and Error Handling](https://www.baeldung.com/rxjava-error-handling)
- [RxJava 2 – Flowable](https://www.baeldung.com/rxjava-2-flowable)
- [RxJava Maybe](https://www.baeldung.com/rxjava-maybe)
- [Introduction to RxRelay for RxJava](https://www.baeldung.com/rx-relay)
- [Combining RxJava Completables](https://www.baeldung.com/rxjava-completable)
- [Converting Synchronous and Asynchronous APIs to Observables using RxJava2](https://www.baeldung.com/rxjava-apis-to-observables)
- [RxJava Hooks](https://www.baeldung.com/rxjava-hooks)
- More articles: [[<-- prev]](/rxjava)
-53
View File
@@ -1,53 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<artifactId>rxjava-2</artifactId>
<name>rxjava-2</name>
<version>1.0-SNAPSHOT</version>
<parent>
<groupId>com.baeldung</groupId>
<artifactId>parent-java</artifactId>
<version>0.0.1-SNAPSHOT</version>
<relativePath>../parent-java</relativePath>
</parent>
<dependencies>
<dependency>
<groupId>io.reactivex.rxjava2</groupId>
<artifactId>rxjava</artifactId>
<version>${rx.java2.version}</version>
</dependency>
<dependency>
<groupId>com.jayway.awaitility</groupId>
<artifactId>awaitility</artifactId>
<version>${awaitility.version}</version>
</dependency>
<dependency>
<groupId>org.assertj</groupId>
<artifactId>assertj-core</artifactId>
<version>${assertj.version}</version>
</dependency>
<dependency>
<groupId>com.jakewharton.rxrelay2</groupId>
<artifactId>rxrelay</artifactId>
<version>${rxrelay.version}</version>
</dependency>
<!-- https://mvnrepository.com/artifact/com.github.akarnokd/rxjava2-extensions -->
<dependency>
<groupId>com.github.akarnokd</groupId>
<artifactId>rxjava2-extensions</artifactId>
<version>${rxjava2.ext.version}</version>
</dependency>
</dependencies>
<properties>
<assertj.version>3.8.0</assertj.version>
<rx.java2.version>2.2.2</rx.java2.version>
<awaitility.version>1.7.0</awaitility.version>
<rxrelay.version>2.0.0</rxrelay.version>
<rxjava2.ext.version>0.20.4</rxjava2.ext.version>
</properties>
</project>
+16
View File
@@ -0,0 +1,16 @@
## RxJava
This module contains articles about RxJava.
### Relevant articles:
- [Dealing with Backpressure with RxJava](https://www.baeldung.com/rxjava-backpressure)
- [How to Test RxJava?](https://www.baeldung.com/rxjava-testing)
- [Introduction to RxJava](https://www.baeldung.com/rx-java)
- [Schedulers in RxJava](https://www.baeldung.com/rxjava-schedulers)
- [Difference Between Flatmap and Switchmap in RxJava](https://www.baeldung.com/rxjava-flatmap-switchmap)
- [RxJava and Error Handling](https://www.baeldung.com/rxjava-error-handling)
- [RxJava Maybe](https://www.baeldung.com/rxjava-maybe)
- [Combining RxJava Completables](https://www.baeldung.com/rxjava-completable)
- [RxJava Hooks](https://www.baeldung.com/rxjava-hooks)
- More articles: [[next -->]](/rxjava-2)
+46
View File
@@ -0,0 +1,46 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<artifactId>rxjava-core</artifactId>
<version>1.0-SNAPSHOT</version>
<name>rxjava-core</name>
<parent>
<groupId>com.baeldung</groupId>
<artifactId>parent-java</artifactId>
<version>0.0.1-SNAPSHOT</version>
<relativePath>../parent-java</relativePath>
</parent>
<dependencies>
<dependency>
<groupId>io.reactivex</groupId>
<artifactId>rxjava</artifactId>
<version>${rx.java.version}</version>
</dependency>
<dependency>
<groupId>io.reactivex.rxjava2</groupId>
<artifactId>rxjava</artifactId>
<version>${rx.java2.version}</version>
</dependency>
<dependency>
<groupId>com.jayway.awaitility</groupId>
<artifactId>awaitility</artifactId>
<version>${awaitility.version}</version>
</dependency>
<dependency>
<groupId>org.assertj</groupId>
<artifactId>assertj-core</artifactId>
<version>${assertj.version}</version>
</dependency>
</dependencies>
<properties>
<assertj.version>3.8.0</assertj.version>
<rx.java.version>1.2.5</rx.java.version>
<awaitility.version>1.7.0</awaitility.version>
<rx.java2.version>2.2.2</rx.java2.version>
</properties>
</project>
@@ -1,84 +1,84 @@
package com.baeldung.rxjava;
import static org.junit.Assert.assertTrue;
import org.junit.After;
import org.junit.Test;
import io.reactivex.Observable;
import io.reactivex.plugins.RxJavaPlugins;
import io.reactivex.schedulers.Schedulers;
public class RxJavaHooksManualTest {
private boolean initHookCalled = false;
private boolean hookCalled = false;
@Test
public void givenIOScheduler_whenCalled_shouldExecuteTheHooks() {
RxJavaPlugins.setInitIoSchedulerHandler((scheduler) -> {
initHookCalled = true;
return scheduler.call();
});
RxJavaPlugins.setIoSchedulerHandler((scheduler) -> {
hookCalled = true;
return scheduler;
});
Observable.range(1, 10)
.map(v -> v * 2)
.subscribeOn(Schedulers.io())
.test();
assertTrue(hookCalled && initHookCalled);
}
@Test
public void givenNewThreadScheduler_whenCalled_shouldExecuteTheHook() {
RxJavaPlugins.setInitNewThreadSchedulerHandler((scheduler) -> {
initHookCalled = true;
return scheduler.call();
});
RxJavaPlugins.setNewThreadSchedulerHandler((scheduler) -> {
hookCalled = true;
return scheduler;
});
Observable.range(1, 15)
.map(v -> v * 2)
.subscribeOn(Schedulers.newThread())
.test();
assertTrue(hookCalled && initHookCalled);
}
@Test
public void givenSingleScheduler_whenCalled_shouldExecuteTheHooks() {
RxJavaPlugins.setInitSingleSchedulerHandler((scheduler) -> {
initHookCalled = true;
return scheduler.call();
});
RxJavaPlugins.setSingleSchedulerHandler((scheduler) -> {
hookCalled = true;
return scheduler;
});
Observable.range(1, 10)
.map(v -> v * 2)
.subscribeOn(Schedulers.single())
.test();
assertTrue(hookCalled && initHookCalled);
}
@After
public void reset() {
hookCalled = false;
initHookCalled = false;
RxJavaPlugins.reset();
}
}
package com.baeldung.rxjava;
import static org.junit.Assert.assertTrue;
import org.junit.After;
import org.junit.Test;
import io.reactivex.Observable;
import io.reactivex.plugins.RxJavaPlugins;
import io.reactivex.schedulers.Schedulers;
public class RxJavaHooksManualTest {
private boolean initHookCalled = false;
private boolean hookCalled = false;
@Test
public void givenIOScheduler_whenCalled_shouldExecuteTheHooks() {
RxJavaPlugins.setInitIoSchedulerHandler((scheduler) -> {
initHookCalled = true;
return scheduler.call();
});
RxJavaPlugins.setIoSchedulerHandler((scheduler) -> {
hookCalled = true;
return scheduler;
});
Observable.range(1, 10)
.map(v -> v * 2)
.subscribeOn(Schedulers.io())
.test();
assertTrue(hookCalled && initHookCalled);
}
@Test
public void givenNewThreadScheduler_whenCalled_shouldExecuteTheHook() {
RxJavaPlugins.setInitNewThreadSchedulerHandler((scheduler) -> {
initHookCalled = true;
return scheduler.call();
});
RxJavaPlugins.setNewThreadSchedulerHandler((scheduler) -> {
hookCalled = true;
return scheduler;
});
Observable.range(1, 15)
.map(v -> v * 2)
.subscribeOn(Schedulers.newThread())
.test();
assertTrue(hookCalled && initHookCalled);
}
@Test
public void givenSingleScheduler_whenCalled_shouldExecuteTheHooks() {
RxJavaPlugins.setInitSingleSchedulerHandler((scheduler) -> {
initHookCalled = true;
return scheduler.call();
});
RxJavaPlugins.setSingleSchedulerHandler((scheduler) -> {
hookCalled = true;
return scheduler;
});
Observable.range(1, 10)
.map(v -> v * 2)
.subscribeOn(Schedulers.single())
.test();
assertTrue(hookCalled && initHookCalled);
}
@After
public void reset() {
hookCalled = false;
initHookCalled = false;
RxJavaPlugins.reset();
}
}
+10
View File
@@ -0,0 +1,10 @@
## RxJava Libraries
This module contains articles about RxJava libraries
### Related Articles:
- [RxJava 2 – Flowable](https://www.baeldung.com/rxjava-2-flowable)
- [Introduction to RxRelay for RxJava](https://www.baeldung.com/rx-relay)
- [Introduction to rxjava-jdbc](https://www.baeldung.com/rxjava-jdbc)
+59
View File
@@ -0,0 +1,59 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<artifactId>rxjava-libraries</artifactId>
<version>1.0-SNAPSHOT</version>
<name>rxjava-libraries</name>
<parent>
<groupId>com.baeldung</groupId>
<artifactId>parent-java</artifactId>
<version>0.0.1-SNAPSHOT</version>
<relativePath>../parent-java</relativePath>
</parent>
<dependencies>
<dependency>
<groupId>io.reactivex</groupId>
<artifactId>rxjava</artifactId>
<version>${rx.java.version}</version>
</dependency>
<dependency>
<groupId>io.reactivex.rxjava2</groupId>
<artifactId>rxjava</artifactId>
<version>${rx.java2.version}</version>
</dependency>
<dependency>
<groupId>com.jakewharton.rxrelay2</groupId>
<artifactId>rxrelay</artifactId>
<version>${rxrelay.version}</version>
</dependency>
<dependency>
<groupId>com.github.davidmoten</groupId>
<artifactId>rxjava-jdbc</artifactId>
<version>${rx.java.jdbc.version}</version>
</dependency>
<dependency>
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
<version>${h2.version}</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.assertj</groupId>
<artifactId>assertj-core</artifactId>
<version>${assertj.version}</version>
</dependency>
</dependencies>
<properties>
<rx.java.jdbc.version>0.7.11</rx.java.jdbc.version>
<rx.java.version>1.2.5</rx.java.version>
<rxrelay.version>2.0.0</rxrelay.version>
<rx.java2.version>2.2.2</rx.java2.version>
<assertj.version>3.8.0</assertj.version>
</properties>
</project>

Some files were not shown because too many files have changed in this diff Show More