Commit 20e51258 authored by Georg Vinogradov's avatar Georg Vinogradov

More minor adjustments

parent c9f9f96a
Pipeline #161348 passed with stages
in 3 minutes and 15 seconds
......@@ -10,7 +10,6 @@ import java.util.List;
import org.junit.Test;
import de.monticore.lang.embeddedmontiarc.embeddedmontiarc._symboltable.instanceStructure.EMAComponentInstanceSymbol;
import de.monticore.lang.embeddedmontiarc.tagging.middleware.mqtt.MqttConnectionSymbol;
import de.monticore.lang.embeddedmontiarc.tagging.middleware.ros.RosToEmamTagSchema;
import de.monticore.lang.tagging._symboltable.TaggingResolver;
......@@ -31,9 +30,6 @@ public class CMakeGenerationTest extends AbstractSymtabTest {
GeneratorMqtt generatorMqtt = new GeneratorMqtt();
// Connect component's ports to topics
componentInstanceSymbol.getPortInstance("portA").orElse(null).setMiddlewareSymbol(new MqttConnectionSymbol("/clock"));
List<File> files = new ArrayList<>();
files.add(generatorMqtt.generateCMake(componentInstanceSymbol));
......
......@@ -32,6 +32,7 @@ public class PrettyPrintGenerationTest extends AbstractSymtabTest {
// Connect component's ports to topics
componentInstanceSymbol.getPortInstance("portA").orElse(null).setMiddlewareSymbol(new MqttConnectionSymbol("/clock"));
componentInstanceSymbol.getPortInstance("portC").orElse(null).setMiddlewareSymbol(new MqttConnectionSymbol("/clock"));
List<File> files = generatorMqtt.generatePrettyPrint(componentInstanceSymbol);
......
......@@ -5,5 +5,5 @@ Ports:
portA : incoming (mqtt, topic: /clock)
portB : incoming (unknown symbol)
portC : outgoing (unknown symbol)
portC : outgoing (mqtt, topic: /clock)
portD : outgoing (unknown symbol)
......@@ -21,7 +21,6 @@ void MqttAdapter_tests_a_compA::init(tests_a_compA *comp)
_callback_portA = new Callback(*_sub_portA, comp);
_pub_portC = new client(SERVER_ADDRESS, portC);
_pub_portD = new client(SERVER_ADDRESS, portD);
// Connect subscribers, publishers and subscribe to the topics
try {
......@@ -29,7 +28,6 @@ void MqttAdapter_tests_a_compA::init(tests_a_compA *comp)
_sub_portA->connect(connOpts);
_sub_portA->subscribe("/clock", 1)
_pub_portC->connect(connOpts);
_pub_portD->connect(connOpts);
} catch (const mqtt::exception& exc) {
cerr << exc.what() << endl;
......@@ -50,23 +48,9 @@ void MqttAdapter_tests_a_compA::publish_echo_portC()
cerr << exc.to_string() << endl;
}
}
void MqttAdapter_tests_a_compA::publish_echo_portD()
{
string value = to_string(component->mqttOut);
auto pubmsg = make_message("/clock2", value);
try {
_pub_portD->publish(pubmsg);
}
catch (const exception& exc) {
cerr << exc.to_string() << endl;
}
}
void MqttAdapter_tests_a_compA::tick()
{
publish_echo_portC();
publish_echo_portD();
}
......@@ -17,7 +17,6 @@ public:
void init(tests_a_compA* comp);
void publish_echo_portC();
void publish_echo_portD();
void tick();
......@@ -32,5 +31,4 @@ private:
client* _sub_portA = nullptr;
// Publishers
client* _pub_portC = nullptr;
client* _pub_portD = nullptr;
};
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