use of com.fsck.k9.mailstore.migrations.MigrationTo60.OldPendingCommand in project k-9 by k9mail.
the class MigrationTo60Test method migrateMoveOrCopy__withEvenOlderFormat.
@Test
public void migrateMoveOrCopy__withEvenOlderFormat() {
OldPendingCommand command = queueMoveOrCopyEvenOlder(SOURCE_FOLDER, DEST_FOLDER, UID, IS_COPY);
PendingMoveOrCopy pendingCommand = (PendingMoveOrCopy) MigrationTo60.migratePendingCommand(command);
assertEquals(SOURCE_FOLDER, pendingCommand.srcFolder);
assertEquals(DEST_FOLDER, pendingCommand.destFolder);
assertEquals(IS_COPY, pendingCommand.isCopy);
assertEquals(Collections.singletonList(UID), pendingCommand.uids);
assertNull(pendingCommand.newUidMap);
}
use of com.fsck.k9.mailstore.migrations.MigrationTo60.OldPendingCommand in project k-9 by k9mail.
the class MigrationTo60Test method queueEmptyTrash.
OldPendingCommand queueEmptyTrash() {
OldPendingCommand command = new OldPendingCommand();
command.command = PENDING_COMMAND_EMPTY_TRASH;
command.arguments = new String[0];
return command;
}
use of com.fsck.k9.mailstore.migrations.MigrationTo60.OldPendingCommand in project k-9 by k9mail.
the class MigrationTo60Test method queueSetFlagOld.
OldPendingCommand queueSetFlagOld(String folderName, boolean newState, Flag flag, String uid) {
OldPendingCommand command = new OldPendingCommand();
command.command = PENDING_COMMAND_SET_FLAG;
command.arguments = new String[4];
command.arguments[0] = folderName;
command.arguments[1] = uid;
command.arguments[2] = Boolean.toString(newState);
command.arguments[3] = flag.toString();
return command;
}
use of com.fsck.k9.mailstore.migrations.MigrationTo60.OldPendingCommand in project k-9 by k9mail.
the class MigrationTo60Test method migrateAppend.
@Test
public void migrateAppend() {
OldPendingCommand command = queueAppend(SOURCE_FOLDER, UID);
PendingAppend pendingCommand = (PendingAppend) MigrationTo60.migratePendingCommand(command);
assertEquals(SOURCE_FOLDER, pendingCommand.folder);
assertEquals(UID, pendingCommand.uid);
}
use of com.fsck.k9.mailstore.migrations.MigrationTo60.OldPendingCommand in project k-9 by k9mail.
the class MigrationTo60Test method queueSetFlagBulk.
OldPendingCommand queueSetFlagBulk(String folderName, boolean newState, Flag flag, String[] uids) {
OldPendingCommand command = new OldPendingCommand();
command.command = PENDING_COMMAND_SET_FLAG_BULK;
int length = 3 + uids.length;
command.arguments = new String[length];
command.arguments[0] = folderName;
command.arguments[1] = Boolean.toString(newState);
command.arguments[2] = flag.toString();
System.arraycopy(uids, 0, command.arguments, 3, uids.length);
return command;
}
Aggregations