use of com.vodafone360.people.service.utils.hessian.HessianDecoder in project 360-Engine-for-Android by 360.
the class HessianDecoderTest method testActivityListResponse.
@MediumTest
public void testActivityListResponse() {
// boolean testPassed = true;
List<BaseDataType> clist = new ArrayList<BaseDataType>();
HessianDecoder hess = new HessianDecoder();
try {
DecodedResponse resp = hess.decodeHessianByteArray(5, testActivityList, Type.COMMON, false, EngineId.UNDEFINED);
clist = resp.mDataTypes;
} catch (IOException e) {
e.printStackTrace();
assertTrue("IOException thrown", false);
}
int size = clist.size();
assertTrue(size == 2);
assertTrue(clist.get(0) instanceof ActivityItem);
}
use of com.vodafone360.people.service.utils.hessian.HessianDecoder in project 360-Engine-for-Android by 360.
the class HessianDecoderTest method testPushMessages.
/*
@MediumTest
public void testContactChangesResponse(){
}
*/
@MediumTest
public void testPushMessages() {
List<BaseDataType> clist = new ArrayList<BaseDataType>();
HessianDecoder hess = new HessianDecoder();
try {
DecodedResponse resp = hess.decodeHessianByteArray(7, testPcPushMsgData, Type.PUSH_MSG, false, EngineId.UNDEFINED);
clist = resp.mDataTypes;
} catch (IOException e) {
e.printStackTrace();
assertTrue("IOException thrown", false);
}
int size = clist.size();
assertTrue(size == 1);
assertTrue(clist.get(0) instanceof PushEvent);
try {
DecodedResponse resp = hess.decodeHessianByteArray(8, testCcPushMsgData, Type.PUSH_MSG, false, EngineId.UNDEFINED);
clist = resp.mDataTypes;
} catch (IOException e) {
e.printStackTrace();
assertTrue("IOException thrown", false);
}
size = clist.size();
assertTrue(size == 1);
assertTrue(clist.get(0) instanceof PushEvent);
try {
DecodedResponse resp = hess.decodeHessianByteArray(9, testSnPushMsgData, Type.PUSH_MSG, false, EngineId.UNDEFINED);
clist = resp.mDataTypes;
} catch (IOException e) {
e.printStackTrace();
assertTrue("IOException thrown", false);
}
size = clist.size();
assertTrue(size == 1);
assertTrue(clist.get(0) instanceof SystemNotification);
try {
DecodedResponse resp = hess.decodeHessianByteArray(10, testSnPushMsgData2, Type.PUSH_MSG, false, EngineId.UNDEFINED);
clist = resp.mDataTypes;
} catch (IOException e) {
e.printStackTrace();
assertTrue("IOException thrown", false);
}
size = clist.size();
assertTrue(size == 1);
assertTrue(clist.get(0) instanceof SystemNotification);
try {
DecodedResponse resp = hess.decodeHessianByteArray(11, testUnknownPushMsgData, Type.PUSH_MSG, false, EngineId.UNDEFINED);
clist = resp.mDataTypes;
} catch (IOException e) {
e.printStackTrace();
assertTrue("IOException thrown", false);
}
size = clist.size();
assertTrue(size == 0);
// assertTrue(clist.get(0) instanceof PushEvent);
}
use of com.vodafone360.people.service.utils.hessian.HessianDecoder in project 360-Engine-for-Android by 360.
the class HessianDecoderTest method testContactListResponse.
@MediumTest
public void testContactListResponse() {
// boolean testPassed = true;
List<BaseDataType> clist = new ArrayList<BaseDataType>();
HessianDecoder hess = new HessianDecoder();
try {
DecodedResponse resp = hess.decodeHessianByteArray(3, testContactListData, Type.COMMON, false, EngineId.UNDEFINED);
clist = resp.mDataTypes;
} catch (IOException e) {
e.printStackTrace();
assertTrue("IOException thrown", false);
}
int size = clist.size();
assertTrue(size == 3);
assertTrue(clist.get(0) instanceof Contact);
}
Aggregations