Assert.assertFalse("After upload, the database must store the etag of the syncedFileState. But here it is empty",sfs_fromDBAfterUpload.getLastETAG().isEmpty());
assertFalse("After upload, the database must store the etag of the syncedFileState. But here it is empty",sfs_fromDBAfterUpload.getLastETAG().isEmpty());
}
@@ -193,7 +197,7 @@ public class UploadFileOperationTest {
Assert.assertEquals("Expected result code was FORBIDDEN but got: "+result.getCode().name(),RemoteOperationResult.ResultCode.FORBIDDEN,result.getCode());
assertEquals("Expected result code was FORBIDDEN but got: "+result.getCode().name(),RemoteOperationResult.ResultCode.FORBIDDEN,result.getCode());
}
@@ -207,16 +211,16 @@ public class UploadFileOperationTest {
Assert.assertEquals("Expected result code was FORBIDDEN but got: "+result.getCode().name(),RemoteOperationResult.ResultCode.FORBIDDEN,result.getCode());
assertEquals("Expected result code was FORBIDDEN but got: "+result.getCode().name(),RemoteOperationResult.ResultCode.FORBIDDEN,result.getCode());
}
@@ -226,11 +230,11 @@ public class UploadFileOperationTest {
@@ -43,12 +43,12 @@ public class InitializerServiceTest extends AbstractServiceIT<InitializerService
init_done=true;
registerSharedPref();
Assert.assertTrue("SharedPreferences.INITIALIZATION_HAS_BEEN_DONE expected to be true but was false",sharedPreferences.getBoolean(AppConstants.INITIALIZATION_HAS_BEEN_DONE,false));
assertTrue("SharedPreferences.INITIALIZATION_HAS_BEEN_DONE expected to be true but was false",sharedPreferences.getBoolean(AppConstants.INITIALIZATION_HAS_BEEN_DONE,false));
Assert.assertEquals("lastLog expected to be 'Initializer has already been run' but was "+lastLog,"Initializer has already been run",lastLog);
Assert.assertEquals("service should have schedule a job but pending job contains "+jobScheduler.getAllPendingJobs().size(),1,jobScheduler.getAllPendingJobs().size());
assertEquals("lastLog expected to be 'Initializer has already been run' but was "+lastLog,"Initializer has already been run",lastLog);
assertEquals("service should have schedule a job but pending job contains "+jobScheduler.getAllPendingJobs().size(),1,jobScheduler.getAllPendingJobs().size());
//Teardown
jobScheduler.cancelAll();
}
@@ -65,12 +65,12 @@ public class InitializerServiceTest extends AbstractServiceIT<InitializerService
Assert.assertEquals("lastLog expected to be 'Account's name not found. Neither in shared prefs nor in intent's extras' but was "+lastLog,"Account's name not found. Neither in shared prefs nor in intent's extras",lastLog);
assertEquals("lastLog expected to be 'Account's name not found. Neither in shared prefs nor in intent's extras' but was "+lastLog,"Account's name not found. Neither in shared prefs nor in intent's extras",lastLog);
}
@@ -99,7 +99,7 @@ public class InitializerServiceTest extends AbstractServiceIT<InitializerService
Stringmsg="CommonUtils.haveNetworkConnexion should return false but return "+haveNetworkConnexion;
Assert.assertFalse(msg,haveNetworkConnexion);
assertFalse(msg,haveNetworkConnexion);
mServiceController.create().startCommand(0,0);
List<ShadowLog.LogItem>logs=ShadowLog.getLogs();
ShadowLog.LogItemlastLog=logs.get(logs.size()-1);
Assert.assertEquals("Last log isn't the one expected","There is no Internet connexion.",lastLog.msg);
assertEquals("Last log isn't the one expected","There is no Internet connexion.",lastLog.msg);
}
@@ -192,7 +194,7 @@ public class ObserverServiceTest extends AbstractServiceIT<ObserverService> {
ShadowLog.LogItemlastLog=logs.get(logs.size()-1);
//Note: Checking log is the only way I've found to check that the service stopped as expected
Assert.assertEquals("Last log isn't the one expected","Delay between now and last call is too short",lastLog.msg);
assertEquals("Last log isn't the one expected","Delay between now and last call is too short",lastLog.msg);
}
@@ -214,7 +216,7 @@ public class ObserverServiceTest extends AbstractServiceIT<ObserverService> {
List<ShadowLog.LogItem>logs=ShadowLog.getLogs();
for(ShadowLog.LogItemlog:logs){
Assert.assertFalse("Log shouldn't contains 'delay between now and last call is too short' but it does",log.msg.equals("Delay between now and last call is too short"));//There isn't assertNotEquals
assertFalse("Log shouldn't contains 'delay between now and last call is too short' but it does",log.msg.equals("Delay between now and last call is too short"));//There isn't assertNotEquals
}
}
@@ -225,7 +227,7 @@ public class ObserverServiceTest extends AbstractServiceIT<ObserverService> {
@Test
publicvoidsyncAlreadyStarted_shouldStop(){
//@TODO need to find how to access the "isRunning" private field inside the ObserverService for this test
Assert.fail("Not yet implemented ");
fail("Not yet implemented ");
}
@@ -240,8 +242,8 @@ public class ObserverServiceTest extends AbstractServiceIT<ObserverService> {
assertTrue("jobScheduler expected to be have no pending job",jobScheduler.getAllPendingJobs().isEmpty());
}
/**
@@ -259,7 +261,7 @@ public class ObserverServiceTest extends AbstractServiceIT<ObserverService> {
registerSharedPref();
Assert.assertFalse("SharedPref doesn't contains the expected value for Initialization_has_been_done key",sharedPreferences.getBoolean(INITIALIZATION_HAS_BEEN_DONE,true));
assertFalse("SharedPref doesn't contains the expected value for Initialization_has_been_done key",sharedPreferences.getBoolean(INITIALIZATION_HAS_BEEN_DONE,true));
mServiceController.create().startCommand(0,0);
//How to assert this... ?
@@ -267,14 +269,14 @@ public class ObserverServiceTest extends AbstractServiceIT<ObserverService> {