add ServerURL preference (replaces address, port, encryption)
Этот коммит содержится в:
@@ -22,10 +22,17 @@ public class ProtocolFormatterTest {
|
||||
Position position = new Position("123456789012345", new Location("gps"), 0);
|
||||
position.setTime(new Date(0));
|
||||
|
||||
String url = ProtocolFormatter.formatRequest("localhost", 5055, false, position);
|
||||
|
||||
assertEquals("http://localhost:5055?id=123456789012345×tamp=0&lat=0.0&lon=0.0&speed=0.0&bearing=0.0&altitude=0.0&batt=0.0", url);
|
||||
|
||||
String url = ProtocolFormatter.formatRequest("http://localhost:5055/path", position);
|
||||
assertEquals("http://localhost:5055/path?id=123456789012345×tamp=0&lat=0.0&lon=0.0&speed=0.0&bearing=0.0&altitude=0.0&batt=0.0", url);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testFormatAlarmRequest() throws Exception {
|
||||
|
||||
Position position = new Position("123456789012345", new Location("gps"), 0);
|
||||
position.setTime(new Date(0));
|
||||
|
||||
String url = ProtocolFormatter.formatRequest("http://localhost:5055/path", position, "alert message");
|
||||
assertEquals("http://localhost:5055/path?id=123456789012345×tamp=0&lat=0.0&lon=0.0&speed=0.0&bearing=0.0&altitude=0.0&batt=0.0&alarm=alert%20message", url);
|
||||
}
|
||||
}
|
||||
|
||||
Ссылка в новой задаче
Block a user