From 5a65086421c9c26a3d49b7e3cde08e47f49b170a Mon Sep 17 00:00:00 2001 From: Cavallium Date: Thu, 27 Sep 2018 19:23:46 +0200 Subject: [PATCH] Moved Flow library --- core/pom.xml | 5 ++ flow/.classpath | 32 ++++++++++++ flow/.gitignore | 1 + flow/.project | 23 ++++++++ flow/pom.xml | 52 +++++++++++++++++++ .../it/cavallium/warppi/flow/Action0.java | 0 .../it/cavallium/warppi/flow/Action1.java | 0 .../it/cavallium/warppi/flow/Action2.java | 0 .../warppi/flow/BehaviorSubject.java | 0 .../it/cavallium/warppi/flow/Consumer.java | 0 .../it/cavallium/warppi/flow/Disposable.java | 0 .../warppi/flow/IntervalsManager.java | 6 +-- .../it/cavallium/warppi/flow/Observable.java | 0 .../flow/ObservableCombinedChanged.java | 0 .../warppi/flow/ObservableCombinedLatest.java | 0 .../warppi/flow/ObservableInterval.java | 4 +- .../cavallium/warppi/flow/ObservableMap.java | 0 .../warppi/flow/ObservableMerged.java | 0 .../warppi/flow/ObservableSource.java | 0 .../warppi/flow/ObservableZipped.java | 0 .../it/cavallium/warppi/flow/Observer.java | 0 .../cavallium/warppi/flow/SimpleSubject.java | 0 .../it/cavallium/warppi/flow/Subject.java | 0 .../it/cavallium/warppi/flow/Subscriber.java | 0 .../cavallium/warppi/flow/Subscription.java | 0 .../it/cavallium/warppi/flow/TestFlow.java | 0 .../java/it/cavallium/warppi/AppTest.java | 35 +++++++++++++ pom.xml | 1 + 28 files changed, 152 insertions(+), 7 deletions(-) create mode 100644 flow/.classpath create mode 100644 flow/.gitignore create mode 100644 flow/.project create mode 100644 flow/pom.xml rename {core => flow}/src/main/java/it/cavallium/warppi/flow/Action0.java (100%) rename {core => flow}/src/main/java/it/cavallium/warppi/flow/Action1.java (100%) rename {core => flow}/src/main/java/it/cavallium/warppi/flow/Action2.java (100%) rename {core => flow}/src/main/java/it/cavallium/warppi/flow/BehaviorSubject.java (100%) rename {core => flow}/src/main/java/it/cavallium/warppi/flow/Consumer.java (100%) rename {core => flow}/src/main/java/it/cavallium/warppi/flow/Disposable.java (100%) rename {core => flow}/src/main/java/it/cavallium/warppi/flow/IntervalsManager.java (82%) rename {core => flow}/src/main/java/it/cavallium/warppi/flow/Observable.java (100%) rename {core => flow}/src/main/java/it/cavallium/warppi/flow/ObservableCombinedChanged.java (100%) rename {core => flow}/src/main/java/it/cavallium/warppi/flow/ObservableCombinedLatest.java (100%) rename {core => flow}/src/main/java/it/cavallium/warppi/flow/ObservableInterval.java (88%) rename {core => flow}/src/main/java/it/cavallium/warppi/flow/ObservableMap.java (100%) rename {core => flow}/src/main/java/it/cavallium/warppi/flow/ObservableMerged.java (100%) rename {core => flow}/src/main/java/it/cavallium/warppi/flow/ObservableSource.java (100%) rename {core => flow}/src/main/java/it/cavallium/warppi/flow/ObservableZipped.java (100%) rename {core => flow}/src/main/java/it/cavallium/warppi/flow/Observer.java (100%) rename {core => flow}/src/main/java/it/cavallium/warppi/flow/SimpleSubject.java (100%) rename {core => flow}/src/main/java/it/cavallium/warppi/flow/Subject.java (100%) rename {core => flow}/src/main/java/it/cavallium/warppi/flow/Subscriber.java (100%) rename {core => flow}/src/main/java/it/cavallium/warppi/flow/Subscription.java (100%) rename {core => flow}/src/main/java/it/cavallium/warppi/flow/TestFlow.java (100%) create mode 100644 flow/src/test/java/it/cavallium/warppi/AppTest.java diff --git a/core/pom.xml b/core/pom.xml index 0d247183..5eba8b56 100644 --- a/core/pom.xml +++ b/core/pom.xml @@ -15,6 +15,11 @@ WarpPI Calculator core project + + it.cavallium + warppi-flow + ${project.version} + it.unimi.dsi fastutil diff --git a/flow/.classpath b/flow/.classpath new file mode 100644 index 00000000..a5d95095 --- /dev/null +++ b/flow/.classpath @@ -0,0 +1,32 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/flow/.gitignore b/flow/.gitignore new file mode 100644 index 00000000..b83d2226 --- /dev/null +++ b/flow/.gitignore @@ -0,0 +1 @@ +/target/ diff --git a/flow/.project b/flow/.project new file mode 100644 index 00000000..fb453bc0 --- /dev/null +++ b/flow/.project @@ -0,0 +1,23 @@ + + + warppi-flow + + + + + + org.eclipse.jdt.core.javabuilder + + + + + org.eclipse.m2e.core.maven2Builder + + + + + + org.eclipse.jdt.core.javanature + org.eclipse.m2e.core.maven2Nature + + diff --git a/flow/pom.xml b/flow/pom.xml new file mode 100644 index 00000000..8f0b9c83 --- /dev/null +++ b/flow/pom.xml @@ -0,0 +1,52 @@ + + 4.0.0 + + + it.cavallium + warppi + ${project.version} + + warppi-flow + bundle + + WarpPI Flow Library + WarpPI Flow library project + + + + org.apache.commons + commons-lang3 + + + junit + junit + test + + + + + + + org.apache.felix + maven-bundle-plugin + true + + + it.cavallium.warppi.* + warppi-flow + + + + + org.apache.maven.plugins + maven-source-plugin + + + org.apache.maven.plugins + maven-javadoc-plugin + + + + diff --git a/core/src/main/java/it/cavallium/warppi/flow/Action0.java b/flow/src/main/java/it/cavallium/warppi/flow/Action0.java similarity index 100% rename from core/src/main/java/it/cavallium/warppi/flow/Action0.java rename to flow/src/main/java/it/cavallium/warppi/flow/Action0.java diff --git a/core/src/main/java/it/cavallium/warppi/flow/Action1.java b/flow/src/main/java/it/cavallium/warppi/flow/Action1.java similarity index 100% rename from core/src/main/java/it/cavallium/warppi/flow/Action1.java rename to flow/src/main/java/it/cavallium/warppi/flow/Action1.java diff --git a/core/src/main/java/it/cavallium/warppi/flow/Action2.java b/flow/src/main/java/it/cavallium/warppi/flow/Action2.java similarity index 100% rename from core/src/main/java/it/cavallium/warppi/flow/Action2.java rename to flow/src/main/java/it/cavallium/warppi/flow/Action2.java diff --git a/core/src/main/java/it/cavallium/warppi/flow/BehaviorSubject.java b/flow/src/main/java/it/cavallium/warppi/flow/BehaviorSubject.java similarity index 100% rename from core/src/main/java/it/cavallium/warppi/flow/BehaviorSubject.java rename to flow/src/main/java/it/cavallium/warppi/flow/BehaviorSubject.java diff --git a/core/src/main/java/it/cavallium/warppi/flow/Consumer.java b/flow/src/main/java/it/cavallium/warppi/flow/Consumer.java similarity index 100% rename from core/src/main/java/it/cavallium/warppi/flow/Consumer.java rename to flow/src/main/java/it/cavallium/warppi/flow/Consumer.java diff --git a/core/src/main/java/it/cavallium/warppi/flow/Disposable.java b/flow/src/main/java/it/cavallium/warppi/flow/Disposable.java similarity index 100% rename from core/src/main/java/it/cavallium/warppi/flow/Disposable.java rename to flow/src/main/java/it/cavallium/warppi/flow/Disposable.java diff --git a/core/src/main/java/it/cavallium/warppi/flow/IntervalsManager.java b/flow/src/main/java/it/cavallium/warppi/flow/IntervalsManager.java similarity index 82% rename from core/src/main/java/it/cavallium/warppi/flow/IntervalsManager.java rename to flow/src/main/java/it/cavallium/warppi/flow/IntervalsManager.java index 322ed66f..6e8d6a64 100644 --- a/core/src/main/java/it/cavallium/warppi/flow/IntervalsManager.java +++ b/flow/src/main/java/it/cavallium/warppi/flow/IntervalsManager.java @@ -3,8 +3,6 @@ package it.cavallium.warppi.flow; import java.util.LinkedList; import java.util.List; -import it.cavallium.warppi.Engine; - public class IntervalsManager { private static List intervals = new LinkedList<>(); @@ -37,8 +35,8 @@ public class IntervalsManager { e.printStackTrace(); } }); - Engine.getPlatform().setThreadDaemon(t); - Engine.getPlatform().setThreadName(t, "Intervals Manager"); + t.setDaemon(true); + t.setName("Intervals Manager"); t.start(); } } diff --git a/core/src/main/java/it/cavallium/warppi/flow/Observable.java b/flow/src/main/java/it/cavallium/warppi/flow/Observable.java similarity index 100% rename from core/src/main/java/it/cavallium/warppi/flow/Observable.java rename to flow/src/main/java/it/cavallium/warppi/flow/Observable.java diff --git a/core/src/main/java/it/cavallium/warppi/flow/ObservableCombinedChanged.java b/flow/src/main/java/it/cavallium/warppi/flow/ObservableCombinedChanged.java similarity index 100% rename from core/src/main/java/it/cavallium/warppi/flow/ObservableCombinedChanged.java rename to flow/src/main/java/it/cavallium/warppi/flow/ObservableCombinedChanged.java diff --git a/core/src/main/java/it/cavallium/warppi/flow/ObservableCombinedLatest.java b/flow/src/main/java/it/cavallium/warppi/flow/ObservableCombinedLatest.java similarity index 100% rename from core/src/main/java/it/cavallium/warppi/flow/ObservableCombinedLatest.java rename to flow/src/main/java/it/cavallium/warppi/flow/ObservableCombinedLatest.java diff --git a/core/src/main/java/it/cavallium/warppi/flow/ObservableInterval.java b/flow/src/main/java/it/cavallium/warppi/flow/ObservableInterval.java similarity index 88% rename from core/src/main/java/it/cavallium/warppi/flow/ObservableInterval.java rename to flow/src/main/java/it/cavallium/warppi/flow/ObservableInterval.java index 9c07a6a0..ccfa387b 100644 --- a/core/src/main/java/it/cavallium/warppi/flow/ObservableInterval.java +++ b/flow/src/main/java/it/cavallium/warppi/flow/ObservableInterval.java @@ -1,7 +1,5 @@ package it.cavallium.warppi.flow; -import it.cavallium.warppi.Engine; - public class ObservableInterval extends Observable { private final long interval; volatile boolean running; @@ -48,7 +46,7 @@ public class ObservableInterval extends Observable { } catch (final InterruptedException e) {} timeThread = null; }); - Engine.getPlatform().setThreadName(timeThread, "ObservableTimer"); + timeThread.setName("ObservableTimer"); timeThread.start(); running = true; } diff --git a/core/src/main/java/it/cavallium/warppi/flow/ObservableMap.java b/flow/src/main/java/it/cavallium/warppi/flow/ObservableMap.java similarity index 100% rename from core/src/main/java/it/cavallium/warppi/flow/ObservableMap.java rename to flow/src/main/java/it/cavallium/warppi/flow/ObservableMap.java diff --git a/core/src/main/java/it/cavallium/warppi/flow/ObservableMerged.java b/flow/src/main/java/it/cavallium/warppi/flow/ObservableMerged.java similarity index 100% rename from core/src/main/java/it/cavallium/warppi/flow/ObservableMerged.java rename to flow/src/main/java/it/cavallium/warppi/flow/ObservableMerged.java diff --git a/core/src/main/java/it/cavallium/warppi/flow/ObservableSource.java b/flow/src/main/java/it/cavallium/warppi/flow/ObservableSource.java similarity index 100% rename from core/src/main/java/it/cavallium/warppi/flow/ObservableSource.java rename to flow/src/main/java/it/cavallium/warppi/flow/ObservableSource.java diff --git a/core/src/main/java/it/cavallium/warppi/flow/ObservableZipped.java b/flow/src/main/java/it/cavallium/warppi/flow/ObservableZipped.java similarity index 100% rename from core/src/main/java/it/cavallium/warppi/flow/ObservableZipped.java rename to flow/src/main/java/it/cavallium/warppi/flow/ObservableZipped.java diff --git a/core/src/main/java/it/cavallium/warppi/flow/Observer.java b/flow/src/main/java/it/cavallium/warppi/flow/Observer.java similarity index 100% rename from core/src/main/java/it/cavallium/warppi/flow/Observer.java rename to flow/src/main/java/it/cavallium/warppi/flow/Observer.java diff --git a/core/src/main/java/it/cavallium/warppi/flow/SimpleSubject.java b/flow/src/main/java/it/cavallium/warppi/flow/SimpleSubject.java similarity index 100% rename from core/src/main/java/it/cavallium/warppi/flow/SimpleSubject.java rename to flow/src/main/java/it/cavallium/warppi/flow/SimpleSubject.java diff --git a/core/src/main/java/it/cavallium/warppi/flow/Subject.java b/flow/src/main/java/it/cavallium/warppi/flow/Subject.java similarity index 100% rename from core/src/main/java/it/cavallium/warppi/flow/Subject.java rename to flow/src/main/java/it/cavallium/warppi/flow/Subject.java diff --git a/core/src/main/java/it/cavallium/warppi/flow/Subscriber.java b/flow/src/main/java/it/cavallium/warppi/flow/Subscriber.java similarity index 100% rename from core/src/main/java/it/cavallium/warppi/flow/Subscriber.java rename to flow/src/main/java/it/cavallium/warppi/flow/Subscriber.java diff --git a/core/src/main/java/it/cavallium/warppi/flow/Subscription.java b/flow/src/main/java/it/cavallium/warppi/flow/Subscription.java similarity index 100% rename from core/src/main/java/it/cavallium/warppi/flow/Subscription.java rename to flow/src/main/java/it/cavallium/warppi/flow/Subscription.java diff --git a/core/src/main/java/it/cavallium/warppi/flow/TestFlow.java b/flow/src/main/java/it/cavallium/warppi/flow/TestFlow.java similarity index 100% rename from core/src/main/java/it/cavallium/warppi/flow/TestFlow.java rename to flow/src/main/java/it/cavallium/warppi/flow/TestFlow.java diff --git a/flow/src/test/java/it/cavallium/warppi/AppTest.java b/flow/src/test/java/it/cavallium/warppi/AppTest.java new file mode 100644 index 00000000..d8da2569 --- /dev/null +++ b/flow/src/test/java/it/cavallium/warppi/AppTest.java @@ -0,0 +1,35 @@ +package it.cavallium.warppi; + +import junit.framework.Assert; +import junit.framework.Test; +import junit.framework.TestCase; +import junit.framework.TestSuite; + +/** + * Unit test for simple App. + */ +public class AppTest extends TestCase { + /** + * Create the test case + * + * @param testName + * name of the test case + */ + public AppTest(final String testName) { + super(testName); + } + + /** + * @return the suite of tests being tested + */ + public static Test suite() { + return new TestSuite(AppTest.class); + } + + /** + * Rigourous Test :-) + */ + public void testApp() { + Assert.assertTrue(true); + } +} \ No newline at end of file diff --git a/pom.xml b/pom.xml index 5c1e5773..9f3ab623 100755 --- a/pom.xml +++ b/pom.xml @@ -39,6 +39,7 @@ core + flow rules hardware desktop