use of com.vodafone360.people.engine.EngineManager 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