use of com.vodafone360.people.datatypes.AuthSessionHolder in project 360-Engine-for-Android by 360.
the class HessianDecoderTest method testSessionResponse.
/*
*
* r{1}{0}fS{0}{4}codeS{0}{14}INTERNAL_ERRORS{0}{7}
* messageS{0}hError occured while getting contacts. Message was: Object reference not set to an instance of an object.S{0}{7}detailsMt{0}{0}S{0}{5}classS{0}Dcom.vodafone.next.api.common.APIStructures$APIInternalErrorExceptionzzz
*/
@MediumTest
public void testSessionResponse() {
// boolean testPassed = true;
List<BaseDataType> slist = new ArrayList<BaseDataType>();
HessianDecoder hess = new HessianDecoder();
try {
DecodedResponse resp = hess.decodeHessianByteArray(1, testSessionData, Type.COMMON, false, EngineId.UNDEFINED);
slist = resp.mDataTypes;
} catch (IOException e) {
e.printStackTrace();
assertTrue("IOException thrown", false);
}
int size = slist.size();
assertTrue(size == 1);
assertTrue(slist.get(0) instanceof AuthSessionHolder);
}
use of com.vodafone360.people.datatypes.AuthSessionHolder in project 360-Engine-for-Android by 360.
the class PeopleServiceTest method testIdentities.
public void testIdentities() {
Log.i(LOG_TAG, "**** testIdentities ****\n");
assertTrue("Unable to create People service", lazyLoadPeopleService());
AuthSessionHolder ash = new AuthSessionHolder();
ash.sessionID = "adf32419086bc23";
ash.sessionSecret = "234789123678234";
ash.userID = 10;
ash.userName = "testUser";
EngineManager em = EngineManager.getInstance();
if (em != null) {
Log.i(LOG_TAG, "Creating login Engine");
em.getLoginEngine().setActivatedSession(ash);
} else {
Log.e(LOG_TAG, "Failed to get EngineManager");
assertTrue("Failed to get EngineManager", false);
}
if (LoginEngine.getSession() == null) {
Log.e(LOG_TAG, "Failed to set fake session");
assertTrue("Can't set fake session", false);
}
Bundle filter = new Bundle();
ArrayList<String> l = new ArrayList<String>();
l.add(IdentityCapability.CapabilityID.chat.name());
l.add(IdentityCapability.CapabilityID.get_own_status.name());
filter.putStringArrayList("capability", l);
mPeopleService.getAvailableThirdPartyIdentities();
ServiceStatus status = waitForEvent(WAIT_EVENT_TIMEOUT_MS, TEST_RESPONSE);
assertEquals("fetchAvailableIdentities() failed with status = " + status.name(), ServiceStatus.ERROR_INTERNAL_SERVER_ERROR, status);
mPeopleService.getMyThirdPartyIdentities();
status = waitForEvent(WAIT_EVENT_TIMEOUT_MS, TEST_RESPONSE);
assertEquals("fetchMyIdentities() failed with status = " + status.name(), ServiceStatus.ERROR_INTERNAL_SERVER_ERROR, status);
Log.i(LOG_TAG, "**** testIdentities (SUCCESS) ****\n");
}
Aggregations