use of com.fsck.k9.mailstore.migrations.MigrationTo60.OldPendingCommand in project k-9 by k9mail.
the class MigrationTo60Test method migrateSetFlag_oldFormat.
@Test
public void migrateSetFlag_oldFormat() {
OldPendingCommand command = queueSetFlagOld(SOURCE_FOLDER, FLAG_STATE, FLAG, UID);
PendingSetFlag pendingCommand = (PendingSetFlag) MigrationTo60.migratePendingCommand(command);
assertEquals(SOURCE_FOLDER, pendingCommand.folder);
assertEquals(FLAG_STATE, pendingCommand.newState);
assertEquals(FLAG, pendingCommand.flag);
assertEquals(Collections.singletonList(UID), pendingCommand.uids);
}
use of com.fsck.k9.mailstore.migrations.MigrationTo60.OldPendingCommand in project k-9 by k9mail.
the class MigrationTo60Test method migrateMoveOrCopy_withUidArray.
@Test
public void migrateMoveOrCopy_withUidArray() {
OldPendingCommand command = queueMoveOrCopy(SOURCE_FOLDER, DEST_FOLDER, IS_COPY, UID_ARRAY);
PendingMoveOrCopy pendingCommand = (PendingMoveOrCopy) MigrationTo60.migratePendingCommand(command);
assertEquals(SOURCE_FOLDER, pendingCommand.srcFolder);
assertEquals(DEST_FOLDER, pendingCommand.destFolder);
assertEquals(IS_COPY, pendingCommand.isCopy);
assertEquals(asList(UID_ARRAY), pendingCommand.uids);
assertNull(pendingCommand.newUidMap);
}
use of com.fsck.k9.mailstore.migrations.MigrationTo60.OldPendingCommand in project k-9 by k9mail.
the class MigrationTo60Test method queueAppend.
OldPendingCommand queueAppend(String srcFolder, String uid) {
OldPendingCommand command = new OldPendingCommand();
command.command = PENDING_COMMAND_APPEND;
command.arguments = new String[] { srcFolder, uid };
return command;
}
use of com.fsck.k9.mailstore.migrations.MigrationTo60.OldPendingCommand in project k-9 by k9mail.
the class MigrationTo60Test method migrateEmptyTrash.
@Test
public void migrateEmptyTrash() {
OldPendingCommand command = queueEmptyTrash();
PendingCommand pendingCommand = MigrationTo60.migratePendingCommand(command);
assertTrue(pendingCommand instanceof PendingEmptyTrash);
}
use of com.fsck.k9.mailstore.migrations.MigrationTo60.OldPendingCommand in project k-9 by k9mail.
the class MigrationTo60Test method queueMoveOrCopy.
OldPendingCommand queueMoveOrCopy(String srcFolder, String destFolder, boolean isCopy, String[] uids) {
OldPendingCommand command = new OldPendingCommand();
command.command = PENDING_COMMAND_MOVE_OR_COPY_BULK_NEW;
int length = 4 + uids.length;
command.arguments = new String[length];
command.arguments[0] = srcFolder;
command.arguments[1] = destFolder;
command.arguments[2] = Boolean.toString(isCopy);
command.arguments[3] = Boolean.toString(false);
System.arraycopy(uids, 0, command.arguments, 4, uids.length);
return command;
}
Aggregations