diff --git a/docker/joynr-java/scripts/build/java-clean-build b/docker/joynr-java/scripts/build/java-clean-build index 88fcb821e5..ae2dcbd52c 100755 --- a/docker/joynr-java/scripts/build/java-clean-build +++ b/docker/joynr-java/scripts/build/java-clean-build @@ -29,9 +29,48 @@ while [ "$1" != "" ]; do shift done +echo '####################################################' +echo '# start tests' +echo '####################################################' + +cd /data/src + +# 1st run; just build without tests to provide WAR files for payara mvn clean $GOAL -P no-license-and-notice,no-java-formatter,no-checkstyle \ +-DskipTests=true \ -Dmaven.test.failure.ignore=true \ +-Denforcer.skip=true -Dmaven.compile.fork=true \ +-Dmaven.junit.fork=true + +echo '####################################################' +echo '# start services' +echo '####################################################' +mosquitto -c /etc/mosquitto/mosquitto.conf -v & +MOSQUITTO_PID=$! + +DISCOVERY_DIRECTORY_WAR_FILE=$(find /data/src/java/backend-services/discovery-directory-jee/target -iregex ".*discovery-directory-jee-.*war") +DOMAIN_ACCESS_CONTROLLER_WAR_FILE=$(find /data/src/java/backend-services/domain-access-controller-jee/target -iregex ".*domain-access-controller-jee-.*war") + +/data/src/docker/joynr-base/scripts/start-payara.sh -w $DISCOVERY_DIRECTORY_WAR_FILE,$DOMAIN_ACCESS_CONTROLLER_WAR_FILE + +# Assume that mosquitto and payara have sufficient time to startup before reaching +# any test code that requires it; +# also assume that it is safe to remove and recreate WAR files once payara got +# started and WAR files have been deployed + +# 2nd run; now including test execution which requires mosquitto / payara +mvn clean $GOAL -P no-license-and-notice,no-java-formatter,no-checkstyle \ -DskipTests=$SKIPTESTS \ --Denforcer.skip=true \ --Dmaven.compile.fork=true \ +-Dmaven.test.failure.ignore=true \ +-Denforcer.skip=true -Dmaven.compile.fork=true \ -Dmaven.junit.fork=true + +echo '####################################################' +echo '# stop services' +echo '####################################################' + +/data/src/docker/joynr-base/scripts/stop-payara.sh + +kill -TERM $MOSQUITTO_PID +wait $MOSQUITTO_PID +exit 0 diff --git a/java/messaging/mqtt/joynr-mqtt-client/src/test/java/io/joynr/messaging/mqtt/paho/client/MqttPahoClientTest.java b/java/messaging/mqtt/joynr-mqtt-client/src/test/java/io/joynr/messaging/mqtt/paho/client/MqttPahoClientTest.java index 8df500ef83..6d78c62a97 100644 --- a/java/messaging/mqtt/joynr-mqtt-client/src/test/java/io/joynr/messaging/mqtt/paho/client/MqttPahoClientTest.java +++ b/java/messaging/mqtt/joynr-mqtt-client/src/test/java/io/joynr/messaging/mqtt/paho/client/MqttPahoClientTest.java @@ -175,6 +175,7 @@ public void setUp() { properties.put(LimitAndBackpressureSettings.PROPERTY_BACKPRESSURE_INCOMING_MQTT_REQUESTS_LOWER_THRESHOLD, "20"); properties.put(MqttModule.PROPERTY_MQTT_CLEAN_SESSION, "false"); properties.put(MqttModule.PROPERTY_KEY_MQTT_MAX_MESSAGE_SIZE_BYTES, "0"); + properties.put(MqttModule.PROPERTY_KEY_MQTT_BROKER_URI, "tcp://localhost:" + mqttBrokerPort); serializedMessage = new byte[10]; }