use of com.fsck.k9.controller.MessagingControllerCommands.PendingCommand in project k-9 by k9mail.
the class MigrationTo60Test method migrateMoveOrCopy_withOldFormat.
@Test
public void migrateMoveOrCopy_withOldFormat() {
OldPendingCommand command = queueMoveOrCopyOld(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.controller.MessagingControllerCommands.PendingCommand in project k-9 by k9mail.
the class MigrationTo60Test method migrateSetFlag.
@Test
public void migrateSetFlag() {
OldPendingCommand command = queueSetFlagBulk(SOURCE_FOLDER, FLAG_STATE, FLAG, UID_ARRAY);
PendingSetFlag pendingCommand = (PendingSetFlag) MigrationTo60.migratePendingCommand(command);
assertEquals(SOURCE_FOLDER, pendingCommand.folder);
assertEquals(FLAG_STATE, pendingCommand.newState);
assertEquals(FLAG, pendingCommand.flag);
assertEquals(asList(UID_ARRAY), pendingCommand.uids);
}
use of com.fsck.k9.controller.MessagingControllerCommands.PendingCommand in project k-9 by k9mail.
the class MigrationTo60Test method migrateMoveOrCopy_withUidMap.
@Test
public void migrateMoveOrCopy_withUidMap() {
OldPendingCommand command = queueMoveOrCopy(SOURCE_FOLDER, DEST_FOLDER, IS_COPY, UID_MAP);
PendingMoveOrCopy pendingCommand = (PendingMoveOrCopy) MigrationTo60.migratePendingCommand(command);
assertEquals(SOURCE_FOLDER, pendingCommand.srcFolder);
assertEquals(DEST_FOLDER, pendingCommand.destFolder);
assertEquals(IS_COPY, pendingCommand.isCopy);
assertEquals(UID_MAP, pendingCommand.newUidMap);
assertNull(pendingCommand.uids);
}
use of com.fsck.k9.controller.MessagingControllerCommands.PendingCommand in project k-9 by k9mail.
the class PendingCommandSerializerTest method testSerializeDeserialize__withArguments.
@Test
public void testSerializeDeserialize__withArguments() {
PendingCommand pendingCommand = PendingAppend.create(SOURCE_FOLDER, UID);
String serializedCommand = pendingCommandSerializer.serialize(pendingCommand);
PendingAppend unserializedCommand = (PendingAppend) pendingCommandSerializer.unserialize(DATABASE_ID, pendingCommand.getCommandName(), serializedCommand);
assertEquals(DATABASE_ID, unserializedCommand.databaseId);
assertEquals(SOURCE_FOLDER, unserializedCommand.folder);
assertEquals(UID, unserializedCommand.uid);
}
use of com.fsck.k9.controller.MessagingControllerCommands.PendingCommand in project k-9 by k9mail.
the class PendingCommandSerializerTest method testSerializeDeserialize__withComplexArguments.
@Test
public void testSerializeDeserialize__withComplexArguments() {
PendingCommand pendingCommand = PendingMoveOrCopy.create(SOURCE_FOLDER, DEST_FOLDER, IS_COPY, UID_MAP);
String serializedCommand = pendingCommandSerializer.serialize(pendingCommand);
PendingMoveOrCopy unserializedCommand = (PendingMoveOrCopy) pendingCommandSerializer.unserialize(DATABASE_ID, pendingCommand.getCommandName(), serializedCommand);
assertEquals(DATABASE_ID, unserializedCommand.databaseId);
assertEquals(SOURCE_FOLDER, unserializedCommand.srcFolder);
assertEquals(DEST_FOLDER, unserializedCommand.destFolder);
assertEquals(UID_MAP, unserializedCommand.newUidMap);
}
Aggregations