Skip to content

Commit 7b1b312

Browse files
committed
Tweaking some datatype tests and adding -q flag to travis build to hide download messages
Signed-off-by: James Sutton <james.sutton@uk.ibm.com>
1 parent a3e259c commit 7b1b312

4 files changed

Lines changed: 14 additions & 16 deletions

File tree

.travis.yml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,13 @@ before_install:
1414
- ./start-broker.sh
1515

1616
script:
17-
- mvn -B clean
18-
- mvn -B --projects org.eclipse.paho.client.mqttv3,org.eclipse.paho.client.mqttv3.test test
19-
- mvn -B --projects org.eclipse.paho.mqttv5.common,org.eclipse.paho.mqttv5.client test
17+
- mvn -B clean -q
18+
- mvn -B --projects org.eclipse.paho.client.mqttv3,org.eclipse.paho.client.mqttv3.test test -q
19+
- mvn -B --projects org.eclipse.paho.mqttv5.common,org.eclipse.paho.mqttv5.client test -q
2020

21-
addons:
22-
apt:
23-
sources:
24-
- sourceline: 'ppa:mosquitto-dev/mosquitto-ppa'
25-
packages:
26-
- mosquitto
21+
#addons:
22+
# apt:
23+
# sources:
24+
# - sourceline: 'ppa:mosquitto-dev/mosquitto-ppa'
25+
# packages:
26+
# - mosquitto

org.eclipse.paho.mqttv5.common/src/main/java/org/eclipse/paho/mqttv5/common/packet/MqttDataTypes.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ private static void validateUTF8String(String input) throws IllegalArgumentExcep
171171
for (int i = 0; i < input.length(); i++) {
172172
char c = input.charAt(i);
173173
if (Character.getType(c) == Character.CONTROL || Character.getType(c) == Character.UNASSIGNED) {
174-
throw new IllegalArgumentException("Invalid UTF-8 character : " + c);
174+
throw new IllegalArgumentException(String.format("Invalid UTF-8 char: %s [%s]", c, (int) c));
175175
}
176176
}
177177
}

org.eclipse.paho.mqttv5.common/src/test/java/org/eclipse/paho/mqttv5/common/MqttDataTypesTest.java

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
import java.io.File;
99
import java.io.FileReader;
1010
import java.io.IOException;
11-
1211
import org.eclipse.paho.mqttv5.common.packet.MqttDataTypes;
1312
import org.junit.Assert;
1413
import org.junit.Test;
@@ -115,8 +114,9 @@ public void TestEncodeAndDecodeComplexUTF8String() throws MqttException {
115114
}
116115

117116
/**
118-
* Tests that a large number of complex UTF-8 strings can be encoded and decoded successfully.
119-
* Uses "i_can_eat_glass.txt" as a source of strings that are in the Language:testString format
117+
* Tests that a large number of complex UTF-8 strings can be encoded and decoded
118+
* successfully. Uses "i_can_eat_glass.txt" as a source of strings that are in
119+
* the Language:testString format
120120
*
121121
* @throws IOException
122122
* @throws MqttException
@@ -137,7 +137,5 @@ public void testICanEatGlass() throws IOException, MqttException {
137137

138138
}
139139
}
140-
141140
}
142-
143141
}

start-broker.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ if [ "$BROKER" == "MOSQUITTO" ]; then
3232
fi
3333
else
3434
echo "Installing and starting Python Interop Broker."
35-
sudo service mosquitto stop
35+
#sudo service mosquitto stop
3636
git clone https://github.com/eclipse/paho.mqtt.testing.git
3737
cp java_client_testing.conf paho.mqtt.testing/interoperability/.
3838
cd paho.mqtt.testing/interoperability

0 commit comments

Comments
 (0)