Commit 292d91d8 authored by René Schöne's avatar René Schöne
Browse files

towards releasing 0.3.1

- different mqtt port not testable using current CI setup (only port 1883 exposed in image)
- print compiler error messages in single log output statement
parent 6e2953a3
......@@ -34,9 +34,6 @@ test:
services:
- name: "eclipse-mosquitto:1.6"
alias: "mqtt"
- name: "eclipse-mosquitto:1.6"
alias: "mqtt_different_port"
command: ["mosquitto", "-p", "55883"]
needs:
- build
script:
......
......@@ -70,10 +70,11 @@ public class Compiler extends AbstractCompiler {
RagConnect ragConnect = parseProgram(getConfiguration().getFiles());
if (!ragConnect.errors().isEmpty()) {
LOGGER.severe("Errors:");
StringBuilder sb = new StringBuilder("Errors:\n");
for (ErrorMessage e : ragConnect.errors()) {
LOGGER.severe(e.toString());
sb.append(e).append("\n");
}
LOGGER.severe(sb::toString);
System.exit(1);
}
......
package org.jastadd.ragconnect.tests;
import example.ast.MqttHandler;
import org.assertj.core.api.Assertions;
import org.assertj.core.api.Assumptions;
import org.junit.jupiter.api.Tag;
import org.junit.jupiter.api.Test;
......@@ -21,7 +19,6 @@ import static org.junit.jupiter.api.Assertions.assertTrue;
*
* @author rschoene - Initial contribution
*/
@Tag("New")
@Tag("mqtt")
public class MqttHandlerTest {
......@@ -55,7 +52,6 @@ public class MqttHandlerTest {
assertEquals(1, receivedMessages.size());
}
@Test
public void testDontSendWelcomeMessage() throws Exception {
MqttHandler welcomeMessageSubscriber = new MqttHandler();
......@@ -73,24 +69,4 @@ public class MqttHandlerTest {
assertThat(receivedMessages).isEmpty();
}
@Test
public void testSecondHost() throws Exception {
// only run this if we have a second mqtt broker running
Assumptions.assumeThat(TestUtils.getSecondMqttHost()).isNotNull();
MqttHandler welcomeMessageSubscriber = new MqttHandler();
List<String> receivedMessages = new ArrayList<>();
welcomeMessageSubscriber.setHost(TestUtils.getSecondMqttHost());
assertTrue(welcomeMessageSubscriber.waitUntilReady(2, TimeUnit.SECONDS));
welcomeMessageSubscriber.newConnection("components", bytes -> receivedMessages.add(new String(bytes)));
assertThat(receivedMessages).isEmpty();
MqttHandler handler = new MqttHandler();
handler.setHost(TestUtils.getSecondMqttHost());
assertTrue(handler.waitUntilReady(2, TimeUnit.SECONDS));
TestUtils.waitForMqtt();
assertEquals(1, receivedMessages.size());
}
}
......@@ -29,16 +29,6 @@ public class TestUtils {
}
}
public static String getSecondMqttHost() {
if (System.getenv("GITLAB_CI") != null) {
// we are in the CI, so use "mqtt_different_port" as host and 55883 as port
return "mqtt_different_port:55883";
} {
// else no second local mqtt broker
return null;
}
}
public static String mqttUri(String path) {
return "mqtt://" + getMqttHost() + "/" + path;
}
......
Supports Markdown
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