blob: cd9944ada968037d2260f741a325951881cdc9b0 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
|
package org.traccar.protocol;
import java.util.HashMap;
import java.util.Map;
import org.junit.Assert;
import org.junit.Test;
import org.traccar.model.Command;
public class Gps103ProtocolEncoderTest {
@Test
public void testDecode() throws Exception {
Gps103ProtocolEncoder encoder = new Gps103ProtocolEncoder();
Command command = new Command();
command.setDeviceId(1);
command.setType(Command.TYPE_POSITION_FIX);
Map<String, Object> other = new HashMap<>();
other.put(Command.KEY_FREQUENCY, 300l);
command.setOther(other);
Assert.assertEquals("**,123456789012345,C,05m;", encoder.encodeCommand(command));
}
}
|