Search in sources :

Example 6 with PendingMoveOrCopy

use of com.fsck.k9.controller.MessagingControllerCommands.PendingMoveOrCopy 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);
}
Also used : PendingMoveOrCopy(com.fsck.k9.controller.MessagingControllerCommands.PendingMoveOrCopy) PendingCommand(com.fsck.k9.controller.MessagingControllerCommands.PendingCommand) Test(org.junit.Test)

Aggregations

PendingMoveOrCopy (com.fsck.k9.controller.MessagingControllerCommands.PendingMoveOrCopy)5 Test (org.junit.Test)5 OldPendingCommand (com.fsck.k9.mailstore.migrations.MigrationTo60.OldPendingCommand)4 PendingCommand (com.fsck.k9.controller.MessagingControllerCommands.PendingCommand)1 Folder (com.fsck.k9.mail.Folder)1 Message (com.fsck.k9.mail.Message)1 MessagingException (com.fsck.k9.mail.MessagingException)1 Store (com.fsck.k9.mail.Store)1 MimeMessage (com.fsck.k9.mail.internet.MimeMessage)1 Pop3Store (com.fsck.k9.mail.store.pop3.Pop3Store)1 LocalFolder (com.fsck.k9.mailstore.LocalFolder)1 LocalMessage (com.fsck.k9.mailstore.LocalMessage)1 LocalStore (com.fsck.k9.mailstore.LocalStore)1 ArrayList (java.util.ArrayList)1 HashMap (java.util.HashMap)1 Map (java.util.Map)1 ConcurrentHashMap (java.util.concurrent.ConcurrentHashMap)1