use of com.vodafone360.people.service.ServiceStatus in project 360-Engine-for-Android by 360.
the class IdentityEngineTest method testFetchIdentitiesPopulated.
@MediumTest
// Breaks tests.
@Suppress
public void testFetchIdentitiesPopulated() {
mState = IdentityTestState.FETCH_IDENTITIES_POPULATED;
NetworkAgent.setAgentState(NetworkAgent.AgentState.CONNECTED);
mEng.getAvailableThirdPartyIdentities();
// mEng.run();
ServiceStatus status = mEngineTester.waitForEvent();
assertEquals(ServiceStatus.SUCCESS, status);
Object data = mEngineTester.data();
assertTrue(data != null);
}
use of com.vodafone360.people.service.ServiceStatus in project 360-Engine-for-Android by 360.
the class IdentityEngineTest method testFetchIdentitiesFail.
@MediumTest
// Takes to long
@Suppress
public void testFetchIdentitiesFail() {
mState = IdentityTestState.FETCH_IDENTITIES_FAIL;
NetworkAgent.setAgentState(NetworkAgent.AgentState.CONNECTED);
mEng.getAvailableThirdPartyIdentities();
// mEng.run();
ServiceStatus status = mEngineTester.waitForEvent();
assertFalse(ServiceStatus.SUCCESS == status);
Object data = mEngineTester.data();
assertNull(data);
}
use of com.vodafone360.people.service.ServiceStatus in project 360-Engine-for-Android by 360.
the class LoginEngineTest method testFetchPrivacy.
@MediumTest
// Breaks tests.
@Suppress
public void testFetchPrivacy() {
boolean testPassed = true;
mState = LoginTestState.FETCH_PRIVACY;
NetworkAgent.setAgentState(NetworkAgent.AgentState.DISCONNECTED);
try {
synchronized (mEngineTester) {
mEng.addUiFetchPrivacyStatementRequest();
ServiceStatus status = mEngineTester.waitForEvent();
if (status != ServiceStatus.SUCCESS) {
throw (new RuntimeException("Expected SUCCESS"));
}
}
} catch (Exception e) {
testPassed = false;
}
NetworkAgent.setAgentState(NetworkAgent.AgentState.CONNECTED);
try {
synchronized (mEngineTester) {
mEng.addUiFetchPrivacyStatementRequest();
ServiceStatus status = mEngineTester.waitForEvent();
if (status != ServiceStatus.SUCCESS) {
throw (new RuntimeException("Expected SUCCESS"));
}
}
} catch (Exception e) {
testPassed = false;
}
assertTrue(testPassed == true);
}
use of com.vodafone360.people.service.ServiceStatus in project 360-Engine-for-Android by 360.
the class ActivitiesEngineTest method testGetActivitiesServerErr.
@MediumTest
// Takes too long.
@Suppress
public void testGetActivitiesServerErr() {
boolean testPass = true;
mState = ActivityTestState.GET_ACTIVITIES_SERVER_ERR;
NetworkAgent.setAgentState(NetworkAgent.AgentState.CONNECTED);
mEng.addStatusesSyncRequest();
ServiceStatus status = mEngineTester.waitForEvent();
if (status == ServiceStatus.SUCCESS) {
throw (new RuntimeException("Did not expect SUCCESS"));
}
Object data = mEngineTester.data();
assertTrue(data == null);
assertTrue("testGetActivitiesServerErr() failed", testPass);
Log.i(LOG_TAG, "**** testGetActivitiesServerErr (SUCCESS) ****\n");
}
use of com.vodafone360.people.service.ServiceStatus in project 360-Engine-for-Android by 360.
the class LoginEngineTest method testRemoveUserData.
@MediumTest
public void testRemoveUserData() {
boolean testPassed = true;
mState = LoginTestState.REMOVE_USER_DATA_REQ;
try {
synchronized (mEngineTester) {
mEng.addUiRemoveUserDataRequest();
ServiceStatus status = mEngineTester.waitForEvent();
if (status != ServiceStatus.SUCCESS) {
throw (new RuntimeException("SUCCESS"));
}
}
// test actually receiving the SMS
} catch (Exception e) {
testPassed = false;
}
try {
synchronized (mEngineTester) {
mEng.onReset();
ServiceStatus status = mEngineTester.waitForEvent();
if (status != ServiceStatus.SUCCESS) {
throw (new RuntimeException("SUCCESS"));
}
}
// test actually receiving the SMS
} catch (Exception e) {
testPassed = false;
}
assertTrue(testPassed == true);
}
Aggregations