aboutsummaryrefslogtreecommitdiff
path: root/test/org/traccar/ProtocolTest.java
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2019-02-18 13:18:28 -0800
committerGitHub <noreply@github.com>2019-02-18 13:18:28 -0800
commit0e209e80f03e72095e5b449679925066b01403d2 (patch)
tree881ab37ce5867fd8358d4bdf0195824c47e26be2 /test/org/traccar/ProtocolTest.java
parent774d560ecb5f8da9e64059a4d25622c4fba55bf2 (diff)
parentc82be0541481955a0832948574244f31757f7067 (diff)
downloadtrackermap-server-0e209e80f03e72095e5b449679925066b01403d2.tar.gz
trackermap-server-0e209e80f03e72095e5b449679925066b01403d2.tar.bz2
trackermap-server-0e209e80f03e72095e5b449679925066b01403d2.zip
Merge pull request #4221 from flocsy/8bit-voice-message
Fixed 8bit voice message
Diffstat (limited to 'test/org/traccar/ProtocolTest.java')
-rw-r--r--test/org/traccar/ProtocolTest.java12
1 files changed, 12 insertions, 0 deletions
diff --git a/test/org/traccar/ProtocolTest.java b/test/org/traccar/ProtocolTest.java
index 1b5c0ea00..377474556 100644
--- a/test/org/traccar/ProtocolTest.java
+++ b/test/org/traccar/ProtocolTest.java
@@ -52,6 +52,14 @@ public class ProtocolTest extends BaseTest {
return builder.toString();
}
+ protected ByteBuf concatenateBuffers(ByteBuf... buffers) {
+ ByteBuf result = Unpooled.buffer();
+ for (ByteBuf buf : buffers) {
+ result.writeBytes(buf);
+ }
+ return result;
+ }
+
protected ByteBuf binary(String... data) {
return Unpooled.wrappedBuffer(DataConverter.parseHex(concatenateStrings(data)));
}
@@ -60,6 +68,10 @@ public class ProtocolTest extends BaseTest {
return concatenateStrings(data);
}
+ protected String text(ByteBuf data) {
+ return data.toString(StandardCharsets.ISO_8859_1);
+ }
+
protected ByteBuf buffer(String... data) {
return Unpooled.copiedBuffer(concatenateStrings(data), StandardCharsets.ISO_8859_1);
}