Skip to content
Snippets Groups Projects
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
No related branches found
No related tags found
4 merge requests!39Version 1.1.0,!35Version 1.0.0,!17Version 0.3.2,!8Version 0.3.1
...@@ -34,9 +34,6 @@ test: ...@@ -34,9 +34,6 @@ test:
services: services:
- name: "eclipse-mosquitto:1.6" - name: "eclipse-mosquitto:1.6"
alias: "mqtt" alias: "mqtt"
- name: "eclipse-mosquitto:1.6"
alias: "mqtt_different_port"
command: ["mosquitto", "-p", "55883"]
needs: needs:
- build - build
script: script:
......
...@@ -70,10 +70,11 @@ public class Compiler extends AbstractCompiler { ...@@ -70,10 +70,11 @@ public class Compiler extends AbstractCompiler {
RagConnect ragConnect = parseProgram(getConfiguration().getFiles()); RagConnect ragConnect = parseProgram(getConfiguration().getFiles());
if (!ragConnect.errors().isEmpty()) { if (!ragConnect.errors().isEmpty()) {
LOGGER.severe("Errors:"); StringBuilder sb = new StringBuilder("Errors:\n");
for (ErrorMessage e : ragConnect.errors()) { for (ErrorMessage e : ragConnect.errors()) {
LOGGER.severe(e.toString()); sb.append(e).append("\n");
} }
LOGGER.severe(sb::toString);
System.exit(1); System.exit(1);
} }
......
package org.jastadd.ragconnect.tests; package org.jastadd.ragconnect.tests;
import example.ast.MqttHandler; 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.Tag;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;
...@@ -21,7 +19,6 @@ import static org.junit.jupiter.api.Assertions.assertTrue; ...@@ -21,7 +19,6 @@ import static org.junit.jupiter.api.Assertions.assertTrue;
* *
* @author rschoene - Initial contribution * @author rschoene - Initial contribution
*/ */
@Tag("New")
@Tag("mqtt") @Tag("mqtt")
public class MqttHandlerTest { public class MqttHandlerTest {
...@@ -55,7 +52,6 @@ public class MqttHandlerTest { ...@@ -55,7 +52,6 @@ public class MqttHandlerTest {
assertEquals(1, receivedMessages.size()); assertEquals(1, receivedMessages.size());
} }
@Test @Test
public void testDontSendWelcomeMessage() throws Exception { public void testDontSendWelcomeMessage() throws Exception {
MqttHandler welcomeMessageSubscriber = new MqttHandler(); MqttHandler welcomeMessageSubscriber = new MqttHandler();
...@@ -73,24 +69,4 @@ public class MqttHandlerTest { ...@@ -73,24 +69,4 @@ public class MqttHandlerTest {
assertThat(receivedMessages).isEmpty(); 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 { ...@@ -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) { public static String mqttUri(String path) {
return "mqtt://" + getMqttHost() + "/" + path; return "mqtt://" + getMqttHost() + "/" + path;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment