Этот коммит содержится в:
Anton Tananaev
2015-08-12 13:42:08 +12:00
родитель 06c741e6b5
Коммит ac6f648062
3 изменённых файлов: 61 добавлений и 0 удалений
+1
Просмотреть файл
@@ -33,4 +33,5 @@ android {
}
dependencies {
testCompile 'junit:junit:4.12'
}
+31
Просмотреть файл
@@ -0,0 +1,31 @@
/*
* Copyright 2015 Anton Tananaev (anton.tananaev@gmail.com)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.traccar.client;
public class RequestManager {
public interface RequestHandler {
void onSuccess();
void onFailure();
}
public static void sendRequest(String request, RequestHandler handler) {
handler.onSuccess();
}
}
+29
Просмотреть файл
@@ -0,0 +1,29 @@
package org.traccar.client;
import org.junit.Test;
import static org.junit.Assert.assertNull;
public class RequestManagerTest {
@Test
public void testSendRequest() throws Exception {
assertNull(null);
//ApelProtocolDecoder decoder = new ApelProtocolDecoder(new ApelProtocol());
/*byte[] buf1 = {0x40,0x4E,0x54,0x43,0x01,0x00,0x00,0x00,0x7B,0x00,0x00,0x00,0x13,0x00,0x44,0x34,0x2A,0x3E,0x53,0x3A,0x38,0x36,0x31,0x37,0x38,0x35,0x30,0x30,0x35,0x32,0x30,0x35,0x30,0x37,0x39};
assertNull(decoder.decode(null, null, ChannelBuffers.wrappedBuffer(ByteOrder.LITTLE_ENDIAN, buf1)));*/
//0c002900f12a00000f003235303032363533343135313036340f0033353638393530333632373938313101002000000000
//5c00380046e6a95136b693277f11b41a00172709f2ff03160002b9bc630007000000000000000000000000000000c31071090000880500000000000000000000
//5c00380072e7a95136b693277f11b41a00172709f2ff03160002b9bc630007000000000000000000000000000000c31071090000880500000000000000000000
//7900040069ea030000000000
//8300c20003006aea03005c003800223aab5107a393276617b41a0030d506e3000414010250bf630007000000000000000000000000000000c3107209000089050000000000006bea03005c003800403aab5107a393276617b41a0030d506e3000414010250bf630007000000000000000000000000000000c3107209000089050000000000006cea03005c0038005e3aab5107a393276617b41a0030d506e3000414010250bf630007000000000000000000000000000000c31072090000890500000000000000000000
}
}