Commit 8e32458f authored by René Schöne's avatar René Schöne
Browse files

Renamed MqttUpdater to MqttHandler.

parent e3e8ea60
......@@ -27,11 +27,11 @@ aspect GenerationUtils {
aspect AttributesForMustache {
// --- MRos2Rag ---
eq MRos2Rag.getChild().mqttUpdaterAttribute() = mqttUpdaterAttribute();
eq MRos2Rag.getChild().mqttUpdaterField() = mqttUpdaterField();
eq MRos2Rag.getChild().mqttHandlerAttribute() = mqttHandlerAttribute();
eq MRos2Rag.getChild().mqttHandlerField() = mqttHandlerField();
syn String MRos2Rag.mqttUpdaterAttribute() = getRos2Rag().mqttUpdaterAttribute();
syn String MRos2Rag.mqttUpdaterField() = getRos2Rag().mqttUpdaterField();
syn String MRos2Rag.mqttHandlerAttribute() = getRos2Rag().mqttHandlerAttribute();
syn String MRos2Rag.mqttHandlerField() = getRos2Rag().mqttHandlerField();
syn String MRos2Rag.mqttSetHostMethod() = getRos2Rag().mqttSetHostMethod();
syn String MRos2Rag.mqttWaitUntilReadyMethod() = getRos2Rag().mqttWaitUntilReadyMethod();
syn String MRos2Rag.mqttCloseMethod() = getRos2Rag().mqttCloseMethod();
......@@ -46,7 +46,7 @@ aspect AttributesForMustache {
eq MUpdateDefinition.getInnerMappingDefinition().resultVarPrefix() = resultVarPrefix();
eq MUpdateDefinition.getInnerMappingDefinition(int i).inputVarName() = i == 0 ? firstInputVarName() : resultVarPrefix() + getInnerMappingDefinition(i - 1).getMappingDefinition().methodName();
inh String MUpdateDefinition.mqttUpdaterAttribute();
inh String MUpdateDefinition.mqttHandlerAttribute();
syn String MUpdateDefinition.connectMethod() = updateDef().connectMethod();
syn TokenComponent MUpdateDefinition.token() = updateDef().getToken();
......@@ -114,8 +114,8 @@ aspect AttributesForMustache {
// --- MTypeComponent ---
syn String MTypeComponent.name() = getTypeComponent().getName();
inh String MTypeComponent.mqttUpdaterAttribute();
inh String MTypeComponent.mqttUpdaterField();
inh String MTypeComponent.mqttHandlerAttribute();
inh String MTypeComponent.mqttHandlerField();
// --- MTokenComponent ---
syn String MTokenComponent.parentTypeName() = getTokenComponent().containingTypeDecl().getName();
......@@ -216,19 +216,19 @@ aspect AspectGeneration {
syn String DependencyDefinition.internalRelationPrefix() = "_internal_" + getID();
syn String DependencyDefinition.internalTokenName() = getSource().internalName();
syn String Ros2Rag.mqttUpdaterAttribute() = "_mqttUpdater";
syn String Ros2Rag.mqttUpdaterField() = "_mqttUpdater";
syn String Ros2Rag.mqttHandlerAttribute() = "_mqttHandler";
syn String Ros2Rag.mqttHandlerField() = "_mqttHandler";
syn String Ros2Rag.mqttSetHostMethod() = "MqttSetHost";
syn String Ros2Rag.mqttWaitUntilReadyMethod() = "MqttWaitUntilReady";
syn String Ros2Rag.mqttCloseMethod() = "MqttCloseConnections";
// naming copy attributes
// --- mqttUpdaterAttribute ---
inh String UpdateDefinition.mqttUpdaterAttribute();
inh String MappingDefinition.mqttUpdaterAttribute();
inh String DependencyDefinition.mqttUpdaterAttribute();
eq Ros2Rag.getChild().mqttUpdaterAttribute() = mqttUpdaterAttribute();
// --- mqttHandlerAttribute ---
inh String UpdateDefinition.mqttHandlerAttribute();
inh String MappingDefinition.mqttHandlerAttribute();
inh String DependencyDefinition.mqttHandlerAttribute();
eq Ros2Rag.getChild().mqttHandlerAttribute() = mqttHandlerAttribute();
// --- rootNodeName ---
syn String ASTNode.rootNodeName() = rootNode.getName();
......
......@@ -96,18 +96,18 @@ public class Compiler {
}
printMessage("Writing output files");
// copy MqttUpdater into outputDir
final String mqttUpdaterFileName = "MqttUpdater.jadd";
// copy MqttHandler into outputDir
final String mqttHandlerFileName = "MqttHandler.jadd";
try {
InputStream inputStream = Compiler.class.getClassLoader().getResourceAsStream(mqttUpdaterFileName);
InputStream inputStream = Compiler.class.getClassLoader().getResourceAsStream(mqttHandlerFileName);
if (inputStream == null) {
throw new CompilerException("Could not open " + mqttUpdaterFileName);
throw new CompilerException("Could not open " + mqttHandlerFileName);
}
Files.copy(inputStream,
Paths.get(outputDir, mqttUpdaterFileName),
Paths.get(outputDir, mqttHandlerFileName),
StandardCopyOption.REPLACE_EXISTING);
} catch (IOException e) {
throw new CompilerException("Could not copy " + mqttUpdaterFileName, e);
throw new CompilerException("Could not copy " + mqttHandlerFileName, e);
}
writeToFile(outputDir + "/Grammar.relast", ros2Rag.getProgram().generateAbstractGrammar());
writeToFile(outputDir + "/ROS2RAG.jadd", ros2Rag.generateAspect(optionRootNode.getValue()));
......
aspect MqttUpdater {
aspect MqttHandler {
/**
* Helper class to receive updates via MQTT and use callbacks to handle those messages.
*
* @author rschoene - Initial contribution
*/
public class MqttUpdater {
public class MqttHandler {
private static final int DEFAULT_PORT = 1883;
private final org.apache.logging.log4j.Logger logger;
......@@ -23,13 +23,13 @@ public class MqttUpdater {
/** Dispatch knowledge */
private final java.util.Map<String, java.util.function.Consumer<byte[]>> callbacks;
public MqttUpdater() {
public MqttHandler() {
this("Ros2Rag");
}
public MqttUpdater(String name) {
public MqttHandler(String name) {
this.name = java.util.Objects.requireNonNull(name, "Name must be set");
this.logger = org.apache.logging.log4j.LogManager.getLogger(MqttUpdater.class);
this.logger = org.apache.logging.log4j.LogManager.getLogger(MqttHandler.class);
this.callbacks = new java.util.HashMap<>();
this.readyLock = new java.util.concurrent.locks.ReentrantLock();
this.readyCondition = readyLock.newCondition();
......@@ -37,7 +37,7 @@ public class MqttUpdater {
this.qos = org.fusesource.mqtt.client.QoS.AT_LEAST_ONCE;
}
public MqttUpdater dontSendWelcomeMessage() {
public MqttHandler dontSendWelcomeMessage() {
this.sendWelcomeMessage = false;
return this;
}
......@@ -47,7 +47,7 @@ public class MqttUpdater {
* @throws IOException if could not connect, or could not subscribe to a topic
* @return self
*/
public MqttUpdater setHost(String host) throws java.io.IOException {
public MqttHandler setHost(String host) throws java.io.IOException {
return setHost(host, DEFAULT_PORT);
}
......@@ -56,7 +56,7 @@ public class MqttUpdater {
* @throws IOException if could not connect, or could not subscribe to a topic
* @return self
*/
public MqttUpdater setHost(String host, int port) throws java.io.IOException {
public MqttHandler setHost(String host, int port) throws java.io.IOException {
java.util.Objects.requireNonNull(host, "Host need to be set!");
this.host = java.net.URI.create("tcp://" + host + ":" + port);
......@@ -109,7 +109,7 @@ public class MqttUpdater {
connection.connect(new org.fusesource.mqtt.client.Callback<Void>() {
@Override
public void onSuccess(Void value) {
if (MqttUpdater.this.sendWelcomeMessage) {
if (MqttHandler.this.sendWelcomeMessage) {
connection.publish("components", (name + " is connected").getBytes(), org.fusesource.mqtt.client.QoS.AT_LEAST_ONCE, false, new org.fusesource.mqtt.client.Callback<Void>() {
@Override
public void onSuccess(Void value) {
......
aspect MQTT {
private MqttUpdater {{rootNodeName}}.{{mqttUpdaterField}} = new MqttUpdater();
private MqttHandler {{rootNodeName}}.{{mqttHandlerField}} = new MqttHandler();
public void {{rootNodeName}}.{{mqttSetHostMethod}}(String host) throws java.io.IOException {
{{mqttUpdaterField}}.setHost(host);
{{mqttHandlerField}}.setHost(host);
}
public void {{rootNodeName}}.{{mqttSetHostMethod}}(String host, int port) throws java.io.IOException {
{{mqttUpdaterField}}.setHost(host, port);
{{mqttHandlerField}}.setHost(host, port);
}
public boolean {{rootNodeName}}.{{mqttWaitUntilReadyMethod}}(long time, java.util.concurrent.TimeUnit unit) {
return {{mqttUpdaterField}}.waitUntilReady(time, unit);
return {{mqttHandlerField}}.waitUntilReady(time, unit);
}
public void {{rootNodeName}}.{{mqttCloseMethod}}() {
{{mqttUpdaterField}}.close();
{{mqttHandlerField}}.close();
}
inh MqttUpdater ASTNode.{{mqttUpdaterAttribute}}();
inh MqttHandler ASTNode.{{mqttHandlerAttribute}}();
{{#getRootTypeComponents}}
eq {{rootNodeName}}.get{{name}}().{{mqttUpdaterAttribute}}() = {{mqttUpdaterField}};
eq {{rootNodeName}}.get{{name}}().{{mqttHandlerAttribute}}() = {{mqttHandlerField}};
{{/getRootTypeComponents}}
}
public void {{parentTypeName}}.{{connectMethod}}(String topic) {
{{mqttUpdaterAttribute}}().newConnection(topic, message -> {
{{mqttHandlerAttribute}}().newConnection(topic, message -> {
{{> mappingApplication}}
{{#loggingEnabledForReads}}
System.out.println("[Read] " + topic + " -> {{tokenName}} = " + {{lastResult}});{{!lastResult has to be a new attribute}}
......
......@@ -20,5 +20,5 @@
{{#loggingEnabledForWrites}}
System.out.println("[Write] {{tokenName}} = " + get{{tokenName}}() + " -> " + {{writeTopic}});
{{/loggingEnabledForWrites}}
{{mqttUpdaterAttribute}}().publish({{writeTopic}}, {{lastValue}});
{{mqttHandlerAttribute}}().publish({{writeTopic}}, {{lastValue}});
}
......@@ -5,7 +5,7 @@ import com.google.protobuf.InvalidProtocolBufferException;
import config.Dataconfig.DataConfig;
import config.Robotconfig.RobotConfig;
import de.tudresden.inf.st.ros2rag.starter.Util;
import de.tudresden.inf.st.ros2rag.starter.ast.MqttUpdater;
import de.tudresden.inf.st.ros2rag.starter.ast.MqttHandler;
import de.tudresden.inf.st.ros2rag.starter.data.DataConfiguration;
import de.tudresden.inf.st.ros2rag.starter.data.DataConfiguration.ActualConfiguration;
import org.apache.logging.log4j.Level;
......@@ -37,7 +37,7 @@ public class Main {
final CountDownLatch finish = new CountDownLatch(1);
AtomicInteger topicMaxLength = new AtomicInteger();
MqttUpdater receiver = new MqttUpdater("receiver stub");
MqttHandler receiver = new MqttHandler("receiver stub");
Util.setMqttHost(receiver, config);
receiver.waitUntilReady(2, TimeUnit.SECONDS);
receiver.newConnection(config.topics.robotConfig, this::printRobotConfig);
......
package de.tudresden.inf.st.ros2rag.senderstub;
import de.tudresden.inf.st.ros2rag.starter.ast.MqttUpdater;
import de.tudresden.inf.st.ros2rag.starter.ast.MqttHandler;
import panda.Linkstate;
import java.util.concurrent.TimeUnit;
......@@ -23,7 +23,7 @@ public class Main {
.build();
final byte[] message = pls.toByteArray();
MqttUpdater sender = new MqttUpdater("sender stub").dontSendWelcomeMessage();
MqttHandler sender = new MqttHandler("sender stub").dontSendWelcomeMessage();
sender.setHost("localhost", 1883);
sender.waitUntilReady(2, TimeUnit.SECONDS);
sender.publish(topic, message);
......
......@@ -24,7 +24,7 @@ import java.util.concurrent.TimeUnit;
public class StarterMain {
private static final Logger logger = LogManager.getLogger(StarterMain.class);
private MqttUpdater mainHandler;
private MqttHandler mainHandler;
private Model model;
public void run(String[] args) throws IOException, InterruptedException {
......@@ -82,7 +82,7 @@ public class StarterMain {
logger.info("To print the current model states, send a message to the topic 'model'.");
logger.info("To exit the system cleanly, send a message to the topic 'exit', or use Ctrl+C.");
mainHandler = new MqttUpdater("mainHandler");
mainHandler = new MqttHandler("mainHandler");
Util.setMqttHost(mainHandler, config);
mainHandler.waitUntilReady(2, TimeUnit.SECONDS);
mainHandler.newConnection("exit", bytes -> exitCondition.countDown());
......@@ -97,7 +97,7 @@ public class StarterMain {
this.close();
}
private void sendInitialDataConfig(MqttUpdater mainHandler, String dataConfigTopic) {
private void sendInitialDataConfig(MqttHandler mainHandler, String dataConfigTopic) {
Dataconfig.DataConfig dataConfig = Dataconfig.DataConfig.newBuilder()
.setEnablePosition(true)
.setEnableOrientation(false)
......
package de.tudresden.inf.st.ros2rag.starter;
import de.tudresden.inf.st.ros2rag.starter.ast.Link;
import de.tudresden.inf.st.ros2rag.starter.ast.MqttUpdater;
import de.tudresden.inf.st.ros2rag.starter.ast.MqttHandler;
import de.tudresden.inf.st.ros2rag.starter.data.DataConfiguration;
import de.tudresden.inf.st.ros2rag.starter.data.DataConfiguration.ActualConfiguration;
......@@ -20,7 +20,7 @@ public class Util {
model.MqttSetHost(hostAndPort.host, hostAndPort.port);
}
public static void setMqttHost(MqttUpdater handler, ActualConfiguration config) throws IOException {
public static void setMqttHost(MqttHandler handler, ActualConfiguration config) throws IOException {
HostAndPort hostAndPort = split(config.server);
handler.setHost(hostAndPort.host, hostAndPort.port);
}
......
......@@ -13,4 +13,4 @@ The following things must be done:
- For debugging build problems, the `--verbose` flag in the preprocess-step can be helpful
- Create the test case itself in `src/test/java/` in the package `org.jastadd.ros2rag.tests` and import the AST files of your defined target generation package
- Extend the abstract base class `AbstractMqttTest` to have fail-fast-behaviour in case the MQTT-broker is not connected
- Remember to close all used MQTT-handling objects, like MqttUpdater and the model itself after each test
- Remember to close all used MQTT-handling objects, like MqttHandler and the model itself after each test
......@@ -70,7 +70,7 @@ protobuf {
task preprocessExampleTest(type: JavaExec, group: 'verification') {
doFirst {
delete 'src/test/02-after-ros2rag/example/Grammar.relast',
'src/test/02-after-ros2rag/example/MqttUpdater.java',
'src/test/02-after-ros2rag/example/MqttHandler.java',
'src/test/02-after-ros2rag/example/ROS2RAG.jadd'
}
......@@ -90,7 +90,7 @@ task compileExampleTest(type: RelastTest) {
grammarName = 'src/test/03-after-relast/example/example'
packageName = 'example.ast'
moreInputFiles 'src/test/01-input/example/Test.jadd',
'src/test/02-after-ros2rag/example/MqttUpdater.jadd',
'src/test/02-after-ros2rag/example/MqttHandler.jadd',
'src/test/02-after-ros2rag/example/ROS2RAG.jadd'
}
......@@ -101,7 +101,7 @@ compileExampleTest.dependsOn preprocessExampleTest
task preprocessDefaultOnlyReadTest(type: JavaExec, group: 'verification') {
doFirst {
delete 'src/test/02-after-ros2rag/defaultOnlyRead/Grammar.relast',
'src/test/02-after-ros2rag/defaultOnlyRead/MqttUpdater.java',
'src/test/02-after-ros2rag/defaultOnlyRead/MqttHandler.java',
'src/test/02-after-ros2rag/defaultOnlyRead/ROS2RAG.jadd'
}
......@@ -120,7 +120,7 @@ task compileDefaultOnlyReadTest(type: RelastTest) {
relastFiles 'src/test/02-after-ros2rag/defaultOnlyRead/Grammar.relast'
grammarName = 'src/test/03-after-relast/defaultOnlyRead/defaultOnlyRead'
packageName = 'defaultOnlyRead.ast'
moreInputFiles 'src/test/02-after-ros2rag/defaultOnlyRead/MqttUpdater.jadd',
moreInputFiles 'src/test/02-after-ros2rag/defaultOnlyRead/MqttHandler.jadd',
'src/test/02-after-ros2rag/defaultOnlyRead/ROS2RAG.jadd'
}
......@@ -131,7 +131,7 @@ compileDefaultOnlyReadTest.dependsOn preprocessDefaultOnlyReadTest
task preprocessDefaultOnlyWriteTest(type: JavaExec, group: 'verification') {
doFirst {
delete 'src/test/02-after-ros2rag/defaultOnlyWrite/Grammar.relast',
'src/test/02-after-ros2rag/defaultOnlyWrite/MqttUpdater.java',
'src/test/02-after-ros2rag/defaultOnlyWrite/MqttHandler.java',
'src/test/02-after-ros2rag/defaultOnlyWrite/ROS2RAG.jadd'
}
......@@ -151,7 +151,7 @@ task compileDefaultOnlyWriteTest(type: RelastTest) {
grammarName = 'src/test/03-after-relast/defaultOnlyWrite/defaultOnlyWrite'
packageName = 'defaultOnlyWrite.ast'
moreInputFiles 'src/test/01-input/defaultOnlyWrite/Test.jadd',
'src/test/02-after-ros2rag/defaultOnlyWrite/MqttUpdater.jadd',
'src/test/02-after-ros2rag/defaultOnlyWrite/MqttHandler.jadd',
'src/test/02-after-ros2rag/defaultOnlyWrite/ROS2RAG.jadd'
}
......@@ -162,7 +162,7 @@ compileDefaultOnlyWriteTest.dependsOn preprocessDefaultOnlyWriteTest
task preprocessRead1Write2Test(type: JavaExec, group: 'verification') {
doFirst {
delete 'src/test/02-after-ros2rag/read1write2/Grammar.relast',
'src/test/02-after-ros2rag/read1write2/MqttUpdater.java',
'src/test/02-after-ros2rag/read1write2/MqttHandler.java',
'src/test/02-after-ros2rag/read1write2/ROS2RAG.jadd'
}
......@@ -182,7 +182,7 @@ task compileRead1Write2Test(type: RelastTest) {
grammarName = 'src/test/03-after-relast/read1write2/read1write2'
packageName = 'read1write2.ast'
moreInputFiles 'src/test/01-input/read1write2/Test.jadd',
'src/test/02-after-ros2rag/read1write2/MqttUpdater.jadd',
'src/test/02-after-ros2rag/read1write2/MqttHandler.jadd',
'src/test/02-after-ros2rag/read1write2/ROS2RAG.jadd'
}
......@@ -193,7 +193,7 @@ compileRead1Write2Test.dependsOn preprocessRead1Write2Test
task preprocessRead2Write1Test(type: JavaExec, group: 'verification') {
doFirst {
delete 'src/test/02-after-ros2rag/read2write1/Grammar.relast',
'src/test/02-after-ros2rag/read2write1/MqttUpdater.java',
'src/test/02-after-ros2rag/read2write1/MqttHandler.java',
'src/test/02-after-ros2rag/read2write1/ROS2RAG.jadd'
}
......@@ -213,7 +213,7 @@ task compileRead2Write1Test(type: RelastTest) {
grammarName = 'src/test/03-after-relast/read2write1/read2write1'
packageName = 'read2write1.ast'
moreInputFiles 'src/test/01-input/read2write1/Test.jadd',
'src/test/02-after-ros2rag/read2write1/MqttUpdater.jadd',
'src/test/02-after-ros2rag/read2write1/MqttHandler.jadd',
'src/test/02-after-ros2rag/read2write1/ROS2RAG.jadd'
}
......
package org.jastadd.ros2rag.tests;
import defaultOnlyRead.ast.MqttUpdater;
import defaultOnlyRead.ast.MqttHandler;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Tag;
......@@ -22,7 +22,7 @@ public abstract class AbstractMqttTest {
if (!checkDone) {
checkDone = true;
try {
checkResult = new MqttUpdater()
checkResult = new MqttHandler()
.dontSendWelcomeMessage()
.setHost(TestUtils.getMqttHost())
.waitUntilReady(2, TimeUnit.SECONDS);
......
......@@ -2,7 +2,7 @@ package org.jastadd.ros2rag.tests;
import defaultOnlyRead.ast.A;
import defaultOnlyRead.ast.BoxedTypes;
import defaultOnlyRead.ast.MqttUpdater;
import defaultOnlyRead.ast.MqttHandler;
import defaultOnlyRead.ast.NativeTypes;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.Test;
......@@ -41,7 +41,7 @@ public class DefaultOnlyReadTest extends AbstractMqttTest {
private NativeTypes floats;
private NativeTypes chars;
private BoxedTypes allBoxed;
private MqttUpdater sender;
private MqttHandler sender;
@AfterEach
public void closeConnections() {
......@@ -80,7 +80,7 @@ public class DefaultOnlyReadTest extends AbstractMqttTest {
allBoxed.connectDoubleValue(TOPIC_BOXED_DOUBLE);
allBoxed.connectCharValue(TOPIC_BOXED_CHARACTER);
sender = new MqttUpdater().dontSendWelcomeMessage().setHost(TestUtils.getMqttHost());
sender = new MqttHandler().dontSendWelcomeMessage().setHost(TestUtils.getMqttHost());
assertTrue(sender.waitUntilReady(2, TimeUnit.SECONDS));
final int expectedIntValue = 1;
......
......@@ -2,7 +2,7 @@ package org.jastadd.ros2rag.tests;
import defaultOnlyWrite.ast.A;
import defaultOnlyWrite.ast.BoxedTypesSyn;
import defaultOnlyWrite.ast.MqttUpdater;
import defaultOnlyWrite.ast.MqttHandler;
import defaultOnlyWrite.ast.NativeTypesSyn;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.Test;
......@@ -41,7 +41,7 @@ public class DefaultOnlyWriteTest extends AbstractMqttTest {
private BoxedTypesSyn boxedIntegers;
private BoxedTypesSyn boxedFloats;
private BoxedTypesSyn boxedChars;
private MqttUpdater receiver;
private MqttHandler receiver;
private ReceiverData data;
@AfterEach
......@@ -132,7 +132,7 @@ public class DefaultOnlyWriteTest extends AbstractMqttTest {
model.MqttSetHost(TestUtils.getMqttHost());
assertTrue(model.MqttWaitUntilReady(2, TimeUnit.SECONDS));
receiver = new MqttUpdater().dontSendWelcomeMessage().setHost(TestUtils.getMqttHost());
receiver = new MqttHandler().dontSendWelcomeMessage().setHost(TestUtils.getMqttHost());
assertTrue(receiver.waitUntilReady(2, TimeUnit.SECONDS));
nativeIntegers.addNativeIntDependency(nativeIntegers);
......
......@@ -28,7 +28,7 @@ public class ExampleTest extends AbstractMqttTest {
private RobotArm robotArm;
private Joint joint1;
private Joint joint2;
private MqttUpdater handler;
private MqttHandler handler;
private ReceiverData data;
@BeforeEach
......@@ -217,7 +217,7 @@ public class ExampleTest extends AbstractMqttTest {
model.MqttSetHost(TestUtils.getMqttHost());
assertTrue(model.MqttWaitUntilReady(2, TimeUnit.SECONDS));
handler = new MqttUpdater().dontSendWelcomeMessage().setHost(TestUtils.getMqttHost());
handler = new MqttHandler().dontSendWelcomeMessage().setHost(TestUtils.getMqttHost());
assertTrue(handler.waitUntilReady(2, TimeUnit.SECONDS));
// add dependencies
......
......@@ -27,7 +27,7 @@ public class Read1Write2Test extends AbstractMqttTest {
private static final String TOPIC_DIFFERENT_WRITE2_STRING = "different/write2/string";
private static final String INITIAL_VALUE = "-1";
private MqttUpdater handler;
private MqttHandler handler;
private A model;
private OnSameNonterminal onSameNonterminal;
private OnDifferentNonterminal onDifferentNonterminal;
......@@ -140,7 +140,7 @@ public class Read1Write2Test extends AbstractMqttTest {
model.MqttSetHost(TestUtils.getMqttHost());
assertTrue(model.MqttWaitUntilReady(2, TimeUnit.SECONDS));
handler = new MqttUpdater().dontSendWelcomeMessage().setHost(TestUtils.getMqttHost());
handler = new MqttHandler().dontSendWelcomeMessage().setHost(TestUtils.getMqttHost());
assertTrue(handler.waitUntilReady(2, TimeUnit.SECONDS));
onSameNonterminal.addIntDependency(onSameNonterminal);
......
......@@ -26,7 +26,7 @@ public class Read2Write1Test extends AbstractMqttTest {
private static final String TOPIC_DIFFERENT_WRITE2_INT = "different/write2/int";
private static final String INITIAL_VALUE = "0";
private MqttUpdater handler;
private MqttHandler handler;
private A model;
private OnSameNonterminal onSameNonterminal;
private OnDifferentNonterminal onDifferentNonterminal;
......@@ -149,7 +149,7 @@ public class Read2Write1Test extends AbstractMqttTest {
model.MqttSetHost(TestUtils.getMqttHost());
assertTrue(model.MqttWaitUntilReady(2, TimeUnit.SECONDS));
handler = new MqttUpdater().dontSendWelcomeMessage().setHost(TestUtils.getMqttHost());
handler = new MqttHandler().dontSendWelcomeMessage().setHost(TestUtils.getMqttHost());
assertTrue(handler.waitUntilReady(2, TimeUnit.SECONDS));
onSameNonterminal.addInt1Dependency(onSameNonterminal);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment