Skip to content
Snippets Groups Projects
Commit df7c82ba authored by René Schöne's avatar René Schöne
Browse files

Continue working on incremental dependencies.

parent 91480e88
No related branches found
No related tags found
No related merge requests found
...@@ -49,6 +49,7 @@ public class MinimalMain { ...@@ -49,6 +49,7 @@ public class MinimalMain {
static MinimalReceiver receiver = null; static MinimalReceiver receiver = null;
public static void main(String[] args) throws Exception { public static void main(String[] args) throws Exception {
boolean success;
publisher = new MqttHandler("publisher").setHost("localhost"); publisher = new MqttHandler("publisher").setHost("localhost");
publisher.waitUntilReady(2, SECONDS); publisher.waitUntilReady(2, SECONDS);
publisher.publish("---", ("Start at " + Instant.now()).getBytes()); publisher.publish("---", ("Start at " + Instant.now()).getBytes());
...@@ -86,32 +87,59 @@ public class MinimalMain { ...@@ -86,32 +87,59 @@ public class MinimalMain {
describedWait(1, "Publish 2"); describedWait(1, "Publish 2");
publisher.publish(TOPIC_FOR_INPUT, "2".getBytes()); publisher.publish(TOPIC_FOR_INPUT, "2".getBytes());
// aWithNoDependency.getC(0).getOutputOnC(); describedWait(1, "Publish 21");
publisher.publish(TOPIC_FOR_INPUT, "21".getBytes());
describedWait(2, "Disconnect normalA"); describedWait(1, "Publish 22 and 23");
try { publisher.publish(TOPIC_FOR_INPUT, "22".getBytes());
boolean success = normalA.disconnectInput(TOPIC_URI_FOR_INPUT); publisher.publish(TOPIC_FOR_INPUT, "23".getBytes());
logger.info("disconnect success: " + success);
} catch (IOException e) {
e.printStackTrace();
}
// aWithNoDependency.getC(0).getOutputOnC(); // aWithNoDependency.getC(0).getOutputOnC();
describedWait(2, "Disconnect normalA");
success = normalA.disconnectInput(TOPIC_URI_FOR_INPUT);
logger.info("disconnect success: {}", success);
describedWait(2, "Publish 4"); describedWait(2, "Publish 4");
// receiver.reset(); // receiver.reset();
publisher.publish(TOPIC_FOR_INPUT, "4".getBytes()); publisher.publish(TOPIC_FOR_INPUT, "4".getBytes());
// aWithNoDependency.getC(0).getOutputOnC();
// describedWait(1, "Print latest attributes"); // describedWait(1, "Print latest attributes");
// logger.info("latest attributes = {}", receiver.latestAttributes); // logger.info("latest attributes = {}", receiver.latestAttributes);
describedWait(1, "Disconnect aNoDep");
success = aWithNoDependency.disconnectInput(TOPIC_URI_FOR_INPUT);
logger.info("disconnect success: {}", success);
describedWait(1, "Publish 6");
publisher.publish(TOPIC_FOR_INPUT, "6".getBytes());
describedWait(1, "Connect aNormal again");
success = normalA.connectInput(TOPIC_URI_FOR_INPUT);
logger.info("connect success: {}", success);
describedWait(1, "Publish 8");
publisher.publish(TOPIC_FOR_INPUT, "8".getBytes());
describedWait(1, "Publish 81");
publisher.publish(TOPIC_FOR_INPUT, "81".getBytes());
describedWait(1, "Connect aNoDep again");
success = aWithNoDependency.connectInput(TOPIC_URI_FOR_INPUT);
logger.info("connect success: {}", success);
describedWait(1, "Publish 10");
publisher.publish(TOPIC_FOR_INPUT, "10".getBytes());
describedWait(1, "Publish 101");
publisher.publish(TOPIC_FOR_INPUT, "101".getBytes());
// while (true) {} // while (true) {}
// System.out.println("[Enter] to exit"); // System.out.println("[Enter] to exit");
// Scanner scanner = new Scanner(System.in); // Scanner scanner = new Scanner(System.in);
// scanner.nextLine(); // scanner.nextLine();
// SECONDS.sleep(15); // SECONDS.sleep(15);
describedWait(0, "End");
} }
private static void describedWait(long seconds, String description) throws InterruptedException { private static void describedWait(long seconds, String description) throws InterruptedException {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment