Search in sources :

Example 1 with OldPendingCommand

use of com.fsck.k9.mailstore.migrations.MigrationTo60.OldPendingCommand in project k-9 by k9mail.

the class MigrationTo60Test method migrateExpunge.

@Test
public void migrateExpunge() {
    OldPendingCommand command = queueExpunge(SOURCE_FOLDER);
    PendingExpunge pendingCommand = (PendingExpunge) MigrationTo60.migratePendingCommand(command);
    assertEquals(SOURCE_FOLDER, pendingCommand.folder);
}
Also used : PendingExpunge(com.fsck.k9.controller.MessagingControllerCommands.PendingExpunge) OldPendingCommand(com.fsck.k9.mailstore.migrations.MigrationTo60.OldPendingCommand) Test(org.junit.Test)

Example 2 with OldPendingCommand

use of com.fsck.k9.mailstore.migrations.MigrationTo60.OldPendingCommand in project k-9 by k9mail.

the class MigrationTo60Test method queueMoveOrCopyOld.

OldPendingCommand queueMoveOrCopyOld(String srcFolder, String destFolder, boolean isCopy, String[] uids) {
    OldPendingCommand command = new OldPendingCommand();
    command.command = PENDING_COMMAND_MOVE_OR_COPY_BULK;
    int length = 3 + uids.length;
    command.arguments = new String[length];
    command.arguments[0] = srcFolder;
    command.arguments[1] = destFolder;
    command.arguments[2] = Boolean.toString(isCopy);
    System.arraycopy(uids, 0, command.arguments, 3, uids.length);
    return command;
}
Also used : OldPendingCommand(com.fsck.k9.mailstore.migrations.MigrationTo60.OldPendingCommand)

Example 3 with OldPendingCommand

use of com.fsck.k9.mailstore.migrations.MigrationTo60.OldPendingCommand in project k-9 by k9mail.

the class MigrationTo60Test method queueMoveOrCopyEvenOlder.

OldPendingCommand queueMoveOrCopyEvenOlder(String srcFolder, String destFolder, String uid, boolean isCopy) {
    OldPendingCommand command = new OldPendingCommand();
    command.command = PENDING_COMMAND_MOVE_OR_COPY;
    command.arguments = new String[4];
    command.arguments[0] = srcFolder;
    command.arguments[1] = uid;
    command.arguments[2] = destFolder;
    command.arguments[3] = Boolean.toString(isCopy);
    return command;
}
Also used : OldPendingCommand(com.fsck.k9.mailstore.migrations.MigrationTo60.OldPendingCommand)

Example 4 with OldPendingCommand

use of com.fsck.k9.mailstore.migrations.MigrationTo60.OldPendingCommand in project k-9 by k9mail.

the class MigrationTo60Test method queueExpunge.

OldPendingCommand queueExpunge(String folderName) {
    OldPendingCommand command = new OldPendingCommand();
    command.command = PENDING_COMMAND_EXPUNGE;
    command.arguments = new String[1];
    command.arguments[0] = folderName;
    return command;
}
Also used : OldPendingCommand(com.fsck.k9.mailstore.migrations.MigrationTo60.OldPendingCommand)

Example 5 with OldPendingCommand

use of com.fsck.k9.mailstore.migrations.MigrationTo60.OldPendingCommand in project k-9 by k9mail.

the class MigrationTo60Test method queueMarkAllMessagesRead.

OldPendingCommand queueMarkAllMessagesRead(final String folder) {
    OldPendingCommand command = new OldPendingCommand();
    command.command = PENDING_COMMAND_MARK_ALL_AS_READ;
    command.arguments = new String[] { folder };
    return command;
}
Also used : OldPendingCommand(com.fsck.k9.mailstore.migrations.MigrationTo60.OldPendingCommand)

Aggregations

OldPendingCommand (com.fsck.k9.mailstore.migrations.MigrationTo60.OldPendingCommand)20 Test (org.junit.Test)10 PendingMoveOrCopy (com.fsck.k9.controller.MessagingControllerCommands.PendingMoveOrCopy)4 PendingSetFlag (com.fsck.k9.controller.MessagingControllerCommands.PendingSetFlag)4 PendingCommand (com.fsck.k9.controller.MessagingControllerCommands.PendingCommand)2 Flag (com.fsck.k9.mail.Flag)2 ArrayList (java.util.ArrayList)2 ContentValues (android.content.ContentValues)1 PendingAppend (com.fsck.k9.controller.MessagingControllerCommands.PendingAppend)1 PendingEmptyTrash (com.fsck.k9.controller.MessagingControllerCommands.PendingEmptyTrash)1 PendingExpunge (com.fsck.k9.controller.MessagingControllerCommands.PendingExpunge)1 PendingMarkAllAsRead (com.fsck.k9.controller.MessagingControllerCommands.PendingMarkAllAsRead)1 PendingCommandSerializer (com.fsck.k9.controller.PendingCommandSerializer)1