Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 8a7b39dd authored by vince-bourgmayer's avatar vince-bourgmayer
Browse files

fix implementation in ObserverrServiceUnitTest for test cases 3 about remote change detection

parent b394d22a
Loading
Loading
Loading
Loading
Loading
+8 −5
Original line number Diff line number Diff line
@@ -86,7 +86,6 @@ public class ObserverServiceUnitTest {


        //Test with an empty new List

        System.out.println("\nTEST 4 :");
        pathListToIgnore.clear();
        newRemoteFileList.clear();
@@ -112,8 +111,12 @@ public class ObserverServiceUnitTest {
        //pathListToIgnore.add("/Photos/");
        if(previousRemoteFileList.get(0).getEtag().equals(newRemoteFileList.get(0).getEtag() )){
            System.out.println("Nothing has change");

            pathListToIgnore.add(previousRemoteFileList.get(0).getRemotePath());
            previousRemoteFileList.clear();
            newRemoteFileList.clear();
            return;
        }

        previousRemoteFileList.remove(0);
        newRemoteFileList.remove(0);

@@ -168,18 +171,18 @@ public class ObserverServiceUnitTest {
    }

    private void showResult(){
        System.out.println("File that hasn't changed: "+pathListToIgnore);
        System.out.println("Folder that hasn't changed: "+pathListToIgnore);
        String newListDisplay ="";
        for(RemoteFile o : newRemoteFileList){
            newListDisplay+=o.getRemotePath()+", ";
        }
        System.out.println("New or updated file : ["+newListDisplay+"]");
        System.out.println("New List / New or updated file : ["+newListDisplay+"]");

        String oldListDisplay ="";
        for(RemoteFile o : previousRemoteFileList){
            oldListDisplay+=o.getRemotePath()+", ";
        }
        System.out.println("File that have been removed : ["+oldListDisplay+"]");
        System.out.println("OldList / File that have been removed : ["+oldListDisplay+"]");
    }

    /**