target
stringlengths
20
113k
src_fm
stringlengths
11
86.3k
src_fm_fc
stringlengths
21
86.4k
src_fm_fc_co
stringlengths
30
86.4k
src_fm_fc_ms
stringlengths
42
86.8k
src_fm_fc_ms_ff
stringlengths
43
86.8k
@Test public void compare_withTwoMessagesWithInvalidUid_shouldReturnZero() throws Exception { Message messageLeft = createMessageWithInvalidUid(); Message messageRight = createMessageWithInvalidUid(); int result = comparator.compare(messageLeft, messageRight); assertEquals("result must be 0 when both arguments are a me...
@Override public int compare(Message messageLeft, Message messageRight) { Long uidLeft = getUidForMessage(messageLeft); Long uidRight = getUidForMessage(messageRight); if (uidLeft == null && uidRight == null) { return 0; } else if (uidLeft == null) { return 1; } else if (uidRight == null) { return -1; } return uidRight...
UidReverseComparator implements Comparator<Message> { @Override public int compare(Message messageLeft, Message messageRight) { Long uidLeft = getUidForMessage(messageLeft); Long uidRight = getUidForMessage(messageRight); if (uidLeft == null && uidRight == null) { return 0; } else if (uidLeft == null) { return 1; } els...
UidReverseComparator implements Comparator<Message> { @Override public int compare(Message messageLeft, Message messageRight) { Long uidLeft = getUidForMessage(messageLeft); Long uidRight = getUidForMessage(messageRight); if (uidLeft == null && uidRight == null) { return 0; } else if (uidLeft == null) { return 1; } els...
UidReverseComparator implements Comparator<Message> { @Override public int compare(Message messageLeft, Message messageRight) { Long uidLeft = getUidForMessage(messageLeft); Long uidRight = getUidForMessage(messageRight); if (uidLeft == null && uidRight == null) { return 0; } else if (uidLeft == null) { return 1; } els...
UidReverseComparator implements Comparator<Message> { @Override public int compare(Message messageLeft, Message messageRight) { Long uidLeft = getUidForMessage(messageLeft); Long uidRight = getUidForMessage(messageRight); if (uidLeft == null && uidRight == null) { return 0; } else if (uidLeft == null) { return 1; } els...
@Test public void compare_withMessageWithNullUidAndMessageWithInvalidUid_shouldReturnZero() throws Exception { Message messageLeft = createMessageWithNullUid(); Message messageRight = createMessageWithInvalidUid(); int result = comparator.compare(messageLeft, messageRight); assertEquals("result must be 0 when both argu...
@Override public int compare(Message messageLeft, Message messageRight) { Long uidLeft = getUidForMessage(messageLeft); Long uidRight = getUidForMessage(messageRight); if (uidLeft == null && uidRight == null) { return 0; } else if (uidLeft == null) { return 1; } else if (uidRight == null) { return -1; } return uidRight...
UidReverseComparator implements Comparator<Message> { @Override public int compare(Message messageLeft, Message messageRight) { Long uidLeft = getUidForMessage(messageLeft); Long uidRight = getUidForMessage(messageRight); if (uidLeft == null && uidRight == null) { return 0; } else if (uidLeft == null) { return 1; } els...
UidReverseComparator implements Comparator<Message> { @Override public int compare(Message messageLeft, Message messageRight) { Long uidLeft = getUidForMessage(messageLeft); Long uidRight = getUidForMessage(messageRight); if (uidLeft == null && uidRight == null) { return 0; } else if (uidLeft == null) { return 1; } els...
UidReverseComparator implements Comparator<Message> { @Override public int compare(Message messageLeft, Message messageRight) { Long uidLeft = getUidForMessage(messageLeft); Long uidRight = getUidForMessage(messageRight); if (uidLeft == null && uidRight == null) { return 0; } else if (uidLeft == null) { return 1; } els...
UidReverseComparator implements Comparator<Message> { @Override public int compare(Message messageLeft, Message messageRight) { Long uidLeft = getUidForMessage(messageLeft); Long uidRight = getUidForMessage(messageRight); if (uidLeft == null && uidRight == null) { return 0; } else if (uidLeft == null) { return 1; } els...
@Test public void compare_withMessageWithInvalidUidAndMessageWithNullUid_shouldReturnZero() throws Exception { Message messageLeft = createMessageWithInvalidUid(); Message messageRight = createMessageWithNullUid(); int result = comparator.compare(messageLeft, messageRight); assertEquals("result must be 0 when both argu...
@Override public int compare(Message messageLeft, Message messageRight) { Long uidLeft = getUidForMessage(messageLeft); Long uidRight = getUidForMessage(messageRight); if (uidLeft == null && uidRight == null) { return 0; } else if (uidLeft == null) { return 1; } else if (uidRight == null) { return -1; } return uidRight...
UidReverseComparator implements Comparator<Message> { @Override public int compare(Message messageLeft, Message messageRight) { Long uidLeft = getUidForMessage(messageLeft); Long uidRight = getUidForMessage(messageRight); if (uidLeft == null && uidRight == null) { return 0; } else if (uidLeft == null) { return 1; } els...
UidReverseComparator implements Comparator<Message> { @Override public int compare(Message messageLeft, Message messageRight) { Long uidLeft = getUidForMessage(messageLeft); Long uidRight = getUidForMessage(messageRight); if (uidLeft == null && uidRight == null) { return 0; } else if (uidLeft == null) { return 1; } els...
UidReverseComparator implements Comparator<Message> { @Override public int compare(Message messageLeft, Message messageRight) { Long uidLeft = getUidForMessage(messageLeft); Long uidRight = getUidForMessage(messageRight); if (uidLeft == null && uidRight == null) { return 0; } else if (uidLeft == null) { return 1; } els...
UidReverseComparator implements Comparator<Message> { @Override public int compare(Message messageLeft, Message messageRight) { Long uidLeft = getUidForMessage(messageLeft); Long uidRight = getUidForMessage(messageRight); if (uidLeft == null && uidRight == null) { return 0; } else if (uidLeft == null) { return 1; } els...
@Test public void compare_withLeftNullArgument_shouldReturnPositive() throws Exception { Message messageLeft = null; Message messageRight = createMessageWithUid(1); int result = comparator.compare(messageLeft, messageRight); assertTrue("result must be > 0 when left argument is null", result > 0); }
@Override public int compare(Message messageLeft, Message messageRight) { Long uidLeft = getUidForMessage(messageLeft); Long uidRight = getUidForMessage(messageRight); if (uidLeft == null && uidRight == null) { return 0; } else if (uidLeft == null) { return 1; } else if (uidRight == null) { return -1; } return uidRight...
UidReverseComparator implements Comparator<Message> { @Override public int compare(Message messageLeft, Message messageRight) { Long uidLeft = getUidForMessage(messageLeft); Long uidRight = getUidForMessage(messageRight); if (uidLeft == null && uidRight == null) { return 0; } else if (uidLeft == null) { return 1; } els...
UidReverseComparator implements Comparator<Message> { @Override public int compare(Message messageLeft, Message messageRight) { Long uidLeft = getUidForMessage(messageLeft); Long uidRight = getUidForMessage(messageRight); if (uidLeft == null && uidRight == null) { return 0; } else if (uidLeft == null) { return 1; } els...
UidReverseComparator implements Comparator<Message> { @Override public int compare(Message messageLeft, Message messageRight) { Long uidLeft = getUidForMessage(messageLeft); Long uidRight = getUidForMessage(messageRight); if (uidLeft == null && uidRight == null) { return 0; } else if (uidLeft == null) { return 1; } els...
UidReverseComparator implements Comparator<Message> { @Override public int compare(Message messageLeft, Message messageRight) { Long uidLeft = getUidForMessage(messageLeft); Long uidRight = getUidForMessage(messageRight); if (uidLeft == null && uidRight == null) { return 0; } else if (uidLeft == null) { return 1; } els...
@Test public void findEncrypted__withMultipartMixedSubSignedAndText__shouldReturnSigned() throws Exception { Message message = messageFromBody( multipart("mixed", multipart("signed", bodypart("text/plain"), bodypart("application/pgp-signature") ), bodypart("text/plain") ) ); List<Part> signedParts = MessageDecryptVerif...
public static List<Part> findSignedParts(Part startPart, MessageCryptoAnnotations messageCryptoAnnotations) { List<Part> signedParts = new ArrayList<>(); Stack<Part> partsToCheck = new Stack<>(); partsToCheck.push(startPart); while (!partsToCheck.isEmpty()) { Part part = partsToCheck.pop(); if (messageCryptoAnnotations...
MessageDecryptVerifier { public static List<Part> findSignedParts(Part startPart, MessageCryptoAnnotations messageCryptoAnnotations) { List<Part> signedParts = new ArrayList<>(); Stack<Part> partsToCheck = new Stack<>(); partsToCheck.push(startPart); while (!partsToCheck.isEmpty()) { Part part = partsToCheck.pop(); if ...
MessageDecryptVerifier { public static List<Part> findSignedParts(Part startPart, MessageCryptoAnnotations messageCryptoAnnotations) { List<Part> signedParts = new ArrayList<>(); Stack<Part> partsToCheck = new Stack<>(); partsToCheck.push(startPart); while (!partsToCheck.isEmpty()) { Part part = partsToCheck.pop(); if ...
MessageDecryptVerifier { public static List<Part> findSignedParts(Part startPart, MessageCryptoAnnotations messageCryptoAnnotations) { List<Part> signedParts = new ArrayList<>(); Stack<Part> partsToCheck = new Stack<>(); partsToCheck.push(startPart); while (!partsToCheck.isEmpty()) { Part part = partsToCheck.pop(); if ...
MessageDecryptVerifier { public static List<Part> findSignedParts(Part startPart, MessageCryptoAnnotations messageCryptoAnnotations) { List<Part> signedParts = new ArrayList<>(); Stack<Part> partsToCheck = new Stack<>(); partsToCheck.push(startPart); while (!partsToCheck.isEmpty()) { Part part = partsToCheck.pop(); if ...
@Test public void findPrimaryCryptoPart_withMultipartAlternativeContainingPgpInline() throws Exception { List<Part> outputExtraParts = new ArrayList<>(); BodyPart pgpInlinePart = bodypart("text/plain", PGP_INLINE_DATA); Message message = messageFromBody( multipart("alternative", pgpInlinePart, bodypart("text/html") ) )...
public static Part findPrimaryEncryptedOrSignedPart(Part part, List<Part> outputExtraParts) { if (isPartEncryptedOrSigned(part)) { return part; } Part foundPart; foundPart = findPrimaryPartInAlternative(part); if (foundPart != null) { return foundPart; } foundPart = findPrimaryPartInMixed(part, outputExtraParts); if (f...
MessageDecryptVerifier { public static Part findPrimaryEncryptedOrSignedPart(Part part, List<Part> outputExtraParts) { if (isPartEncryptedOrSigned(part)) { return part; } Part foundPart; foundPart = findPrimaryPartInAlternative(part); if (foundPart != null) { return foundPart; } foundPart = findPrimaryPartInMixed(part,...
MessageDecryptVerifier { public static Part findPrimaryEncryptedOrSignedPart(Part part, List<Part> outputExtraParts) { if (isPartEncryptedOrSigned(part)) { return part; } Part foundPart; foundPart = findPrimaryPartInAlternative(part); if (foundPart != null) { return foundPart; } foundPart = findPrimaryPartInMixed(part,...
MessageDecryptVerifier { public static Part findPrimaryEncryptedOrSignedPart(Part part, List<Part> outputExtraParts) { if (isPartEncryptedOrSigned(part)) { return part; } Part foundPart; foundPart = findPrimaryPartInAlternative(part); if (foundPart != null) { return foundPart; } foundPart = findPrimaryPartInMixed(part,...
MessageDecryptVerifier { public static Part findPrimaryEncryptedOrSignedPart(Part part, List<Part> outputExtraParts) { if (isPartEncryptedOrSigned(part)) { return part; } Part foundPart; foundPart = findPrimaryPartInAlternative(part); if (foundPart != null) { return foundPart; } foundPart = findPrimaryPartInMixed(part,...
@Test public void compare_withLeftMessageWithNullUid_shouldReturnPositive() throws Exception { Message messageLeft = createMessageWithNullUid(); Message messageRight = createMessageWithUid(1); int result = comparator.compare(messageLeft, messageRight); assertTrue("result must be > 0 when left argument is message with n...
@Override public int compare(Message messageLeft, Message messageRight) { Long uidLeft = getUidForMessage(messageLeft); Long uidRight = getUidForMessage(messageRight); if (uidLeft == null && uidRight == null) { return 0; } else if (uidLeft == null) { return 1; } else if (uidRight == null) { return -1; } return uidRight...
UidReverseComparator implements Comparator<Message> { @Override public int compare(Message messageLeft, Message messageRight) { Long uidLeft = getUidForMessage(messageLeft); Long uidRight = getUidForMessage(messageRight); if (uidLeft == null && uidRight == null) { return 0; } else if (uidLeft == null) { return 1; } els...
UidReverseComparator implements Comparator<Message> { @Override public int compare(Message messageLeft, Message messageRight) { Long uidLeft = getUidForMessage(messageLeft); Long uidRight = getUidForMessage(messageRight); if (uidLeft == null && uidRight == null) { return 0; } else if (uidLeft == null) { return 1; } els...
UidReverseComparator implements Comparator<Message> { @Override public int compare(Message messageLeft, Message messageRight) { Long uidLeft = getUidForMessage(messageLeft); Long uidRight = getUidForMessage(messageRight); if (uidLeft == null && uidRight == null) { return 0; } else if (uidLeft == null) { return 1; } els...
UidReverseComparator implements Comparator<Message> { @Override public int compare(Message messageLeft, Message messageRight) { Long uidLeft = getUidForMessage(messageLeft); Long uidRight = getUidForMessage(messageRight); if (uidLeft == null && uidRight == null) { return 0; } else if (uidLeft == null) { return 1; } els...
@Test public void compare_withLeftMessageWithInvalidUid_shouldReturnPositive() throws Exception { Message messageLeft = createMessageWithInvalidUid(); Message messageRight = createMessageWithUid(1); int result = comparator.compare(messageLeft, messageRight); assertTrue("result must be > 0 when left argument is message ...
@Override public int compare(Message messageLeft, Message messageRight) { Long uidLeft = getUidForMessage(messageLeft); Long uidRight = getUidForMessage(messageRight); if (uidLeft == null && uidRight == null) { return 0; } else if (uidLeft == null) { return 1; } else if (uidRight == null) { return -1; } return uidRight...
UidReverseComparator implements Comparator<Message> { @Override public int compare(Message messageLeft, Message messageRight) { Long uidLeft = getUidForMessage(messageLeft); Long uidRight = getUidForMessage(messageRight); if (uidLeft == null && uidRight == null) { return 0; } else if (uidLeft == null) { return 1; } els...
UidReverseComparator implements Comparator<Message> { @Override public int compare(Message messageLeft, Message messageRight) { Long uidLeft = getUidForMessage(messageLeft); Long uidRight = getUidForMessage(messageRight); if (uidLeft == null && uidRight == null) { return 0; } else if (uidLeft == null) { return 1; } els...
UidReverseComparator implements Comparator<Message> { @Override public int compare(Message messageLeft, Message messageRight) { Long uidLeft = getUidForMessage(messageLeft); Long uidRight = getUidForMessage(messageRight); if (uidLeft == null && uidRight == null) { return 0; } else if (uidLeft == null) { return 1; } els...
UidReverseComparator implements Comparator<Message> { @Override public int compare(Message messageLeft, Message messageRight) { Long uidLeft = getUidForMessage(messageLeft); Long uidRight = getUidForMessage(messageRight); if (uidLeft == null && uidRight == null) { return 0; } else if (uidLeft == null) { return 1; } els...
@Test public void compare_withRightNullArgument_shouldReturnNegative() throws Exception { Message messageLeft = createMessageWithUid(1); Message messageRight = null; int result = comparator.compare(messageLeft, messageRight); assertTrue("result must be < 0 when right argument is null", result < 0); }
@Override public int compare(Message messageLeft, Message messageRight) { Long uidLeft = getUidForMessage(messageLeft); Long uidRight = getUidForMessage(messageRight); if (uidLeft == null && uidRight == null) { return 0; } else if (uidLeft == null) { return 1; } else if (uidRight == null) { return -1; } return uidRight...
UidReverseComparator implements Comparator<Message> { @Override public int compare(Message messageLeft, Message messageRight) { Long uidLeft = getUidForMessage(messageLeft); Long uidRight = getUidForMessage(messageRight); if (uidLeft == null && uidRight == null) { return 0; } else if (uidLeft == null) { return 1; } els...
UidReverseComparator implements Comparator<Message> { @Override public int compare(Message messageLeft, Message messageRight) { Long uidLeft = getUidForMessage(messageLeft); Long uidRight = getUidForMessage(messageRight); if (uidLeft == null && uidRight == null) { return 0; } else if (uidLeft == null) { return 1; } els...
UidReverseComparator implements Comparator<Message> { @Override public int compare(Message messageLeft, Message messageRight) { Long uidLeft = getUidForMessage(messageLeft); Long uidRight = getUidForMessage(messageRight); if (uidLeft == null && uidRight == null) { return 0; } else if (uidLeft == null) { return 1; } els...
UidReverseComparator implements Comparator<Message> { @Override public int compare(Message messageLeft, Message messageRight) { Long uidLeft = getUidForMessage(messageLeft); Long uidRight = getUidForMessage(messageRight); if (uidLeft == null && uidRight == null) { return 0; } else if (uidLeft == null) { return 1; } els...
@Test public void compare_withRightMessageWithNullUid_shouldReturnNegative() throws Exception { Message messageLeft = createMessageWithUid(1); Message messageRight = createMessageWithNullUid(); int result = comparator.compare(messageLeft, messageRight); assertTrue("result must be < 0 when right argument is message with...
@Override public int compare(Message messageLeft, Message messageRight) { Long uidLeft = getUidForMessage(messageLeft); Long uidRight = getUidForMessage(messageRight); if (uidLeft == null && uidRight == null) { return 0; } else if (uidLeft == null) { return 1; } else if (uidRight == null) { return -1; } return uidRight...
UidReverseComparator implements Comparator<Message> { @Override public int compare(Message messageLeft, Message messageRight) { Long uidLeft = getUidForMessage(messageLeft); Long uidRight = getUidForMessage(messageRight); if (uidLeft == null && uidRight == null) { return 0; } else if (uidLeft == null) { return 1; } els...
UidReverseComparator implements Comparator<Message> { @Override public int compare(Message messageLeft, Message messageRight) { Long uidLeft = getUidForMessage(messageLeft); Long uidRight = getUidForMessage(messageRight); if (uidLeft == null && uidRight == null) { return 0; } else if (uidLeft == null) { return 1; } els...
UidReverseComparator implements Comparator<Message> { @Override public int compare(Message messageLeft, Message messageRight) { Long uidLeft = getUidForMessage(messageLeft); Long uidRight = getUidForMessage(messageRight); if (uidLeft == null && uidRight == null) { return 0; } else if (uidLeft == null) { return 1; } els...
UidReverseComparator implements Comparator<Message> { @Override public int compare(Message messageLeft, Message messageRight) { Long uidLeft = getUidForMessage(messageLeft); Long uidRight = getUidForMessage(messageRight); if (uidLeft == null && uidRight == null) { return 0; } else if (uidLeft == null) { return 1; } els...
@Test public void compare_withRightMessageWithInvalidUid_shouldReturnNegative() throws Exception { Message messageLeft = createMessageWithUid(1); Message messageRight = createMessageWithInvalidUid(); int result = comparator.compare(messageLeft, messageRight); assertTrue("result must be < 0 when right argument is messag...
@Override public int compare(Message messageLeft, Message messageRight) { Long uidLeft = getUidForMessage(messageLeft); Long uidRight = getUidForMessage(messageRight); if (uidLeft == null && uidRight == null) { return 0; } else if (uidLeft == null) { return 1; } else if (uidRight == null) { return -1; } return uidRight...
UidReverseComparator implements Comparator<Message> { @Override public int compare(Message messageLeft, Message messageRight) { Long uidLeft = getUidForMessage(messageLeft); Long uidRight = getUidForMessage(messageRight); if (uidLeft == null && uidRight == null) { return 0; } else if (uidLeft == null) { return 1; } els...
UidReverseComparator implements Comparator<Message> { @Override public int compare(Message messageLeft, Message messageRight) { Long uidLeft = getUidForMessage(messageLeft); Long uidRight = getUidForMessage(messageRight); if (uidLeft == null && uidRight == null) { return 0; } else if (uidLeft == null) { return 1; } els...
UidReverseComparator implements Comparator<Message> { @Override public int compare(Message messageLeft, Message messageRight) { Long uidLeft = getUidForMessage(messageLeft); Long uidRight = getUidForMessage(messageRight); if (uidLeft == null && uidRight == null) { return 0; } else if (uidLeft == null) { return 1; } els...
UidReverseComparator implements Comparator<Message> { @Override public int compare(Message messageLeft, Message messageRight) { Long uidLeft = getUidForMessage(messageLeft); Long uidRight = getUidForMessage(messageRight); if (uidLeft == null && uidRight == null) { return 0; } else if (uidLeft == null) { return 1; } els...
@Test public void compare_twoMessages_shouldReturnOrderByUid() throws Exception { Message messageSmall = createMessageWithUid(5); Message messageLarge = createMessageWithUid(15); int resultOne = comparator.compare(messageSmall, messageLarge); int resultTwo = comparator.compare(messageLarge, messageSmall); assertTrue("r...
@Override public int compare(Message messageLeft, Message messageRight) { Long uidLeft = getUidForMessage(messageLeft); Long uidRight = getUidForMessage(messageRight); if (uidLeft == null && uidRight == null) { return 0; } else if (uidLeft == null) { return 1; } else if (uidRight == null) { return -1; } return uidRight...
UidReverseComparator implements Comparator<Message> { @Override public int compare(Message messageLeft, Message messageRight) { Long uidLeft = getUidForMessage(messageLeft); Long uidRight = getUidForMessage(messageRight); if (uidLeft == null && uidRight == null) { return 0; } else if (uidLeft == null) { return 1; } els...
UidReverseComparator implements Comparator<Message> { @Override public int compare(Message messageLeft, Message messageRight) { Long uidLeft = getUidForMessage(messageLeft); Long uidRight = getUidForMessage(messageRight); if (uidLeft == null && uidRight == null) { return 0; } else if (uidLeft == null) { return 1; } els...
UidReverseComparator implements Comparator<Message> { @Override public int compare(Message messageLeft, Message messageRight) { Long uidLeft = getUidForMessage(messageLeft); Long uidRight = getUidForMessage(messageRight); if (uidLeft == null && uidRight == null) { return 0; } else if (uidLeft == null) { return 1; } els...
UidReverseComparator implements Comparator<Message> { @Override public int compare(Message messageLeft, Message messageRight) { Long uidLeft = getUidForMessage(messageLeft); Long uidRight = getUidForMessage(messageRight); if (uidLeft == null && uidRight == null) { return 0; } else if (uidLeft == null) { return 1; } els...
@Test public void clearFolderSynchronous_shouldOpenFolderForWriting() throws MessagingException { controller.clearFolderSynchronous(account, FOLDER_ID, listener); verify(localFolder).open(Folder.OPEN_MODE_RW); }
@VisibleForTesting protected void clearFolderSynchronous(Account account, String folderId, MessagingListener listener) { LocalFolder localFolder = null; try { localFolder = account.getLocalStore().getFolder(folderId); localFolder.open(Folder.OPEN_MODE_RW); localFolder.clearAllMessages(); } catch (UnavailableStorageExce...
MessagingController { @VisibleForTesting protected void clearFolderSynchronous(Account account, String folderId, MessagingListener listener) { LocalFolder localFolder = null; try { localFolder = account.getLocalStore().getFolder(folderId); localFolder.open(Folder.OPEN_MODE_RW); localFolder.clearAllMessages(); } catch (...
MessagingController { @VisibleForTesting protected void clearFolderSynchronous(Account account, String folderId, MessagingListener listener) { LocalFolder localFolder = null; try { localFolder = account.getLocalStore().getFolder(folderId); localFolder.open(Folder.OPEN_MODE_RW); localFolder.clearAllMessages(); } catch (...
MessagingController { @VisibleForTesting protected void clearFolderSynchronous(Account account, String folderId, MessagingListener listener) { LocalFolder localFolder = null; try { localFolder = account.getLocalStore().getFolder(folderId); localFolder.open(Folder.OPEN_MODE_RW); localFolder.clearAllMessages(); } catch (...
MessagingController { @VisibleForTesting protected void clearFolderSynchronous(Account account, String folderId, MessagingListener listener) { LocalFolder localFolder = null; try { localFolder = account.getLocalStore().getFolder(folderId); localFolder.open(Folder.OPEN_MODE_RW); localFolder.clearAllMessages(); } catch (...
@Test public void clearFolderSynchronous_shouldClearAllMessagesInTheFolder() throws MessagingException { controller.clearFolderSynchronous(account, FOLDER_ID, listener); verify(localFolder).clearAllMessages(); }
@VisibleForTesting protected void clearFolderSynchronous(Account account, String folderId, MessagingListener listener) { LocalFolder localFolder = null; try { localFolder = account.getLocalStore().getFolder(folderId); localFolder.open(Folder.OPEN_MODE_RW); localFolder.clearAllMessages(); } catch (UnavailableStorageExce...
MessagingController { @VisibleForTesting protected void clearFolderSynchronous(Account account, String folderId, MessagingListener listener) { LocalFolder localFolder = null; try { localFolder = account.getLocalStore().getFolder(folderId); localFolder.open(Folder.OPEN_MODE_RW); localFolder.clearAllMessages(); } catch (...
MessagingController { @VisibleForTesting protected void clearFolderSynchronous(Account account, String folderId, MessagingListener listener) { LocalFolder localFolder = null; try { localFolder = account.getLocalStore().getFolder(folderId); localFolder.open(Folder.OPEN_MODE_RW); localFolder.clearAllMessages(); } catch (...
MessagingController { @VisibleForTesting protected void clearFolderSynchronous(Account account, String folderId, MessagingListener listener) { LocalFolder localFolder = null; try { localFolder = account.getLocalStore().getFolder(folderId); localFolder.open(Folder.OPEN_MODE_RW); localFolder.clearAllMessages(); } catch (...
MessagingController { @VisibleForTesting protected void clearFolderSynchronous(Account account, String folderId, MessagingListener listener) { LocalFolder localFolder = null; try { localFolder = account.getLocalStore().getFolder(folderId); localFolder.open(Folder.OPEN_MODE_RW); localFolder.clearAllMessages(); } catch (...
@Test public void clearFolderSynchronous_shouldCloseTheFolder() throws MessagingException { controller.clearFolderSynchronous(account, FOLDER_ID, listener); verify(localFolder, atLeastOnce()).close(); }
@VisibleForTesting protected void clearFolderSynchronous(Account account, String folderId, MessagingListener listener) { LocalFolder localFolder = null; try { localFolder = account.getLocalStore().getFolder(folderId); localFolder.open(Folder.OPEN_MODE_RW); localFolder.clearAllMessages(); } catch (UnavailableStorageExce...
MessagingController { @VisibleForTesting protected void clearFolderSynchronous(Account account, String folderId, MessagingListener listener) { LocalFolder localFolder = null; try { localFolder = account.getLocalStore().getFolder(folderId); localFolder.open(Folder.OPEN_MODE_RW); localFolder.clearAllMessages(); } catch (...
MessagingController { @VisibleForTesting protected void clearFolderSynchronous(Account account, String folderId, MessagingListener listener) { LocalFolder localFolder = null; try { localFolder = account.getLocalStore().getFolder(folderId); localFolder.open(Folder.OPEN_MODE_RW); localFolder.clearAllMessages(); } catch (...
MessagingController { @VisibleForTesting protected void clearFolderSynchronous(Account account, String folderId, MessagingListener listener) { LocalFolder localFolder = null; try { localFolder = account.getLocalStore().getFolder(folderId); localFolder.open(Folder.OPEN_MODE_RW); localFolder.clearAllMessages(); } catch (...
MessagingController { @VisibleForTesting protected void clearFolderSynchronous(Account account, String folderId, MessagingListener listener) { LocalFolder localFolder = null; try { localFolder = account.getLocalStore().getFolder(folderId); localFolder.open(Folder.OPEN_MODE_RW); localFolder.clearAllMessages(); } catch (...
@Test(expected = UnavailableAccountException.class) public void clearFolderSynchronous_whenStorageUnavailable_shouldThrowUnavailableAccountException() throws MessagingException { doThrow(new UnavailableStorageException("Test")).when(localFolder).open(Folder.OPEN_MODE_RW); controller.clearFolderSynchronous(account, FOLD...
@VisibleForTesting protected void clearFolderSynchronous(Account account, String folderId, MessagingListener listener) { LocalFolder localFolder = null; try { localFolder = account.getLocalStore().getFolder(folderId); localFolder.open(Folder.OPEN_MODE_RW); localFolder.clearAllMessages(); } catch (UnavailableStorageExce...
MessagingController { @VisibleForTesting protected void clearFolderSynchronous(Account account, String folderId, MessagingListener listener) { LocalFolder localFolder = null; try { localFolder = account.getLocalStore().getFolder(folderId); localFolder.open(Folder.OPEN_MODE_RW); localFolder.clearAllMessages(); } catch (...
MessagingController { @VisibleForTesting protected void clearFolderSynchronous(Account account, String folderId, MessagingListener listener) { LocalFolder localFolder = null; try { localFolder = account.getLocalStore().getFolder(folderId); localFolder.open(Folder.OPEN_MODE_RW); localFolder.clearAllMessages(); } catch (...
MessagingController { @VisibleForTesting protected void clearFolderSynchronous(Account account, String folderId, MessagingListener listener) { LocalFolder localFolder = null; try { localFolder = account.getLocalStore().getFolder(folderId); localFolder.open(Folder.OPEN_MODE_RW); localFolder.clearAllMessages(); } catch (...
MessagingController { @VisibleForTesting protected void clearFolderSynchronous(Account account, String folderId, MessagingListener listener) { LocalFolder localFolder = null; try { localFolder = account.getLocalStore().getFolder(folderId); localFolder.open(Folder.OPEN_MODE_RW); localFolder.clearAllMessages(); } catch (...
@Test public void findEncrypted__withMultipartMixedSubTextAndSigned__shouldReturnSigned() throws Exception { Message message = messageFromBody( multipart("mixed", bodypart("text/plain"), multipart("signed", bodypart("text/plain"), bodypart("application/pgp-signature") ) ) ); List<Part> signedParts = MessageDecryptVerif...
public static List<Part> findSignedParts(Part startPart, MessageCryptoAnnotations messageCryptoAnnotations) { List<Part> signedParts = new ArrayList<>(); Stack<Part> partsToCheck = new Stack<>(); partsToCheck.push(startPart); while (!partsToCheck.isEmpty()) { Part part = partsToCheck.pop(); if (messageCryptoAnnotations...
MessageDecryptVerifier { public static List<Part> findSignedParts(Part startPart, MessageCryptoAnnotations messageCryptoAnnotations) { List<Part> signedParts = new ArrayList<>(); Stack<Part> partsToCheck = new Stack<>(); partsToCheck.push(startPart); while (!partsToCheck.isEmpty()) { Part part = partsToCheck.pop(); if ...
MessageDecryptVerifier { public static List<Part> findSignedParts(Part startPart, MessageCryptoAnnotations messageCryptoAnnotations) { List<Part> signedParts = new ArrayList<>(); Stack<Part> partsToCheck = new Stack<>(); partsToCheck.push(startPart); while (!partsToCheck.isEmpty()) { Part part = partsToCheck.pop(); if ...
MessageDecryptVerifier { public static List<Part> findSignedParts(Part startPart, MessageCryptoAnnotations messageCryptoAnnotations) { List<Part> signedParts = new ArrayList<>(); Stack<Part> partsToCheck = new Stack<>(); partsToCheck.push(startPart); while (!partsToCheck.isEmpty()) { Part part = partsToCheck.pop(); if ...
MessageDecryptVerifier { public static List<Part> findSignedParts(Part startPart, MessageCryptoAnnotations messageCryptoAnnotations) { List<Part> signedParts = new ArrayList<>(); Stack<Part> partsToCheck = new Stack<>(); partsToCheck.push(startPart); while (!partsToCheck.isEmpty()) { Part part = partsToCheck.pop(); if ...
@Test() public void clearFolderSynchronous_whenExceptionThrown_shouldStillCloseFolder() throws MessagingException { doThrow(new RuntimeException("Test")).when(localFolder).open(Folder.OPEN_MODE_RW); try { controller.clearFolderSynchronous(account, FOLDER_ID, listener); } catch (Exception ignored){ } verify(localFolder,...
@VisibleForTesting protected void clearFolderSynchronous(Account account, String folderId, MessagingListener listener) { LocalFolder localFolder = null; try { localFolder = account.getLocalStore().getFolder(folderId); localFolder.open(Folder.OPEN_MODE_RW); localFolder.clearAllMessages(); } catch (UnavailableStorageExce...
MessagingController { @VisibleForTesting protected void clearFolderSynchronous(Account account, String folderId, MessagingListener listener) { LocalFolder localFolder = null; try { localFolder = account.getLocalStore().getFolder(folderId); localFolder.open(Folder.OPEN_MODE_RW); localFolder.clearAllMessages(); } catch (...
MessagingController { @VisibleForTesting protected void clearFolderSynchronous(Account account, String folderId, MessagingListener listener) { LocalFolder localFolder = null; try { localFolder = account.getLocalStore().getFolder(folderId); localFolder.open(Folder.OPEN_MODE_RW); localFolder.clearAllMessages(); } catch (...
MessagingController { @VisibleForTesting protected void clearFolderSynchronous(Account account, String folderId, MessagingListener listener) { LocalFolder localFolder = null; try { localFolder = account.getLocalStore().getFolder(folderId); localFolder.open(Folder.OPEN_MODE_RW); localFolder.clearAllMessages(); } catch (...
MessagingController { @VisibleForTesting protected void clearFolderSynchronous(Account account, String folderId, MessagingListener listener) { LocalFolder localFolder = null; try { localFolder = account.getLocalStore().getFolder(folderId); localFolder.open(Folder.OPEN_MODE_RW); localFolder.clearAllMessages(); } catch (...
@Test() public void clearFolderSynchronous_shouldListFolders() throws MessagingException { controller.clearFolderSynchronous(account, FOLDER_ID, listener); verify(listener, atLeastOnce()).listFoldersStarted(account); }
@VisibleForTesting protected void clearFolderSynchronous(Account account, String folderId, MessagingListener listener) { LocalFolder localFolder = null; try { localFolder = account.getLocalStore().getFolder(folderId); localFolder.open(Folder.OPEN_MODE_RW); localFolder.clearAllMessages(); } catch (UnavailableStorageExce...
MessagingController { @VisibleForTesting protected void clearFolderSynchronous(Account account, String folderId, MessagingListener listener) { LocalFolder localFolder = null; try { localFolder = account.getLocalStore().getFolder(folderId); localFolder.open(Folder.OPEN_MODE_RW); localFolder.clearAllMessages(); } catch (...
MessagingController { @VisibleForTesting protected void clearFolderSynchronous(Account account, String folderId, MessagingListener listener) { LocalFolder localFolder = null; try { localFolder = account.getLocalStore().getFolder(folderId); localFolder.open(Folder.OPEN_MODE_RW); localFolder.clearAllMessages(); } catch (...
MessagingController { @VisibleForTesting protected void clearFolderSynchronous(Account account, String folderId, MessagingListener listener) { LocalFolder localFolder = null; try { localFolder = account.getLocalStore().getFolder(folderId); localFolder.open(Folder.OPEN_MODE_RW); localFolder.clearAllMessages(); } catch (...
MessagingController { @VisibleForTesting protected void clearFolderSynchronous(Account account, String folderId, MessagingListener listener) { LocalFolder localFolder = null; try { localFolder = account.getLocalStore().getFolder(folderId); localFolder.open(Folder.OPEN_MODE_RW); localFolder.clearAllMessages(); } catch (...
@Test public void listFoldersSynchronous_shouldNotifyTheListenerListingStarted() throws MessagingException { List<LocalFolder> folders = Collections.singletonList(localFolder); when(localStore.getFolders(false)).thenReturn(folders); controller.listFoldersSynchronous(account, false, listener); verify(listener).listFolde...
public void listFoldersSynchronous(final Account account, final boolean refreshRemote, final MessagingListener listener) { for (MessagingListener l : getListeners(listener)) { l.listFoldersStarted(account); } List<LocalFolder> localFolders = null; if (!account.isAvailable(context)) { Timber.i("not listing folders of un...
MessagingController { public void listFoldersSynchronous(final Account account, final boolean refreshRemote, final MessagingListener listener) { for (MessagingListener l : getListeners(listener)) { l.listFoldersStarted(account); } List<LocalFolder> localFolders = null; if (!account.isAvailable(context)) { Timber.i("not...
MessagingController { public void listFoldersSynchronous(final Account account, final boolean refreshRemote, final MessagingListener listener) { for (MessagingListener l : getListeners(listener)) { l.listFoldersStarted(account); } List<LocalFolder> localFolders = null; if (!account.isAvailable(context)) { Timber.i("not...
MessagingController { public void listFoldersSynchronous(final Account account, final boolean refreshRemote, final MessagingListener listener) { for (MessagingListener l : getListeners(listener)) { l.listFoldersStarted(account); } List<LocalFolder> localFolders = null; if (!account.isAvailable(context)) { Timber.i("not...
MessagingController { public void listFoldersSynchronous(final Account account, final boolean refreshRemote, final MessagingListener listener) { for (MessagingListener l : getListeners(listener)) { l.listFoldersStarted(account); } List<LocalFolder> localFolders = null; if (!account.isAvailable(context)) { Timber.i("not...
@Test public void listFoldersSynchronous_shouldNotifyFailureOnException() throws MessagingException { when(localStore.getFolders(false)).thenThrow(new MessagingException("Test")); controller.listFoldersSynchronous(account, true, listener); verify(listener).listFoldersFailed(account, "Test"); }
public void listFoldersSynchronous(final Account account, final boolean refreshRemote, final MessagingListener listener) { for (MessagingListener l : getListeners(listener)) { l.listFoldersStarted(account); } List<LocalFolder> localFolders = null; if (!account.isAvailable(context)) { Timber.i("not listing folders of un...
MessagingController { public void listFoldersSynchronous(final Account account, final boolean refreshRemote, final MessagingListener listener) { for (MessagingListener l : getListeners(listener)) { l.listFoldersStarted(account); } List<LocalFolder> localFolders = null; if (!account.isAvailable(context)) { Timber.i("not...
MessagingController { public void listFoldersSynchronous(final Account account, final boolean refreshRemote, final MessagingListener listener) { for (MessagingListener l : getListeners(listener)) { l.listFoldersStarted(account); } List<LocalFolder> localFolders = null; if (!account.isAvailable(context)) { Timber.i("not...
MessagingController { public void listFoldersSynchronous(final Account account, final boolean refreshRemote, final MessagingListener listener) { for (MessagingListener l : getListeners(listener)) { l.listFoldersStarted(account); } List<LocalFolder> localFolders = null; if (!account.isAvailable(context)) { Timber.i("not...
MessagingController { public void listFoldersSynchronous(final Account account, final boolean refreshRemote, final MessagingListener listener) { for (MessagingListener l : getListeners(listener)) { l.listFoldersStarted(account); } List<LocalFolder> localFolders = null; if (!account.isAvailable(context)) { Timber.i("not...
@Test public void listFoldersSynchronous_shouldNotNotifyFinishedAfterFailure() throws MessagingException { when(localStore.getFolders(false)).thenThrow(new MessagingException("Test")); controller.listFoldersSynchronous(account, true, listener); verify(listener, never()).listFoldersFinished(account); }
public void listFoldersSynchronous(final Account account, final boolean refreshRemote, final MessagingListener listener) { for (MessagingListener l : getListeners(listener)) { l.listFoldersStarted(account); } List<LocalFolder> localFolders = null; if (!account.isAvailable(context)) { Timber.i("not listing folders of un...
MessagingController { public void listFoldersSynchronous(final Account account, final boolean refreshRemote, final MessagingListener listener) { for (MessagingListener l : getListeners(listener)) { l.listFoldersStarted(account); } List<LocalFolder> localFolders = null; if (!account.isAvailable(context)) { Timber.i("not...
MessagingController { public void listFoldersSynchronous(final Account account, final boolean refreshRemote, final MessagingListener listener) { for (MessagingListener l : getListeners(listener)) { l.listFoldersStarted(account); } List<LocalFolder> localFolders = null; if (!account.isAvailable(context)) { Timber.i("not...
MessagingController { public void listFoldersSynchronous(final Account account, final boolean refreshRemote, final MessagingListener listener) { for (MessagingListener l : getListeners(listener)) { l.listFoldersStarted(account); } List<LocalFolder> localFolders = null; if (!account.isAvailable(context)) { Timber.i("not...
MessagingController { public void listFoldersSynchronous(final Account account, final boolean refreshRemote, final MessagingListener listener) { for (MessagingListener l : getListeners(listener)) { l.listFoldersStarted(account); } List<LocalFolder> localFolders = null; if (!account.isAvailable(context)) { Timber.i("not...
@Test public void listFoldersSynchronous_shouldNotifyFinishedAfterSuccess() throws MessagingException { List<LocalFolder> folders = Collections.singletonList(localFolder); when(localStore.getFolders(false)).thenReturn(folders); controller.listFoldersSynchronous(account, false, listener); verify(listener).listFoldersFin...
public void listFoldersSynchronous(final Account account, final boolean refreshRemote, final MessagingListener listener) { for (MessagingListener l : getListeners(listener)) { l.listFoldersStarted(account); } List<LocalFolder> localFolders = null; if (!account.isAvailable(context)) { Timber.i("not listing folders of un...
MessagingController { public void listFoldersSynchronous(final Account account, final boolean refreshRemote, final MessagingListener listener) { for (MessagingListener l : getListeners(listener)) { l.listFoldersStarted(account); } List<LocalFolder> localFolders = null; if (!account.isAvailable(context)) { Timber.i("not...
MessagingController { public void listFoldersSynchronous(final Account account, final boolean refreshRemote, final MessagingListener listener) { for (MessagingListener l : getListeners(listener)) { l.listFoldersStarted(account); } List<LocalFolder> localFolders = null; if (!account.isAvailable(context)) { Timber.i("not...
MessagingController { public void listFoldersSynchronous(final Account account, final boolean refreshRemote, final MessagingListener listener) { for (MessagingListener l : getListeners(listener)) { l.listFoldersStarted(account); } List<LocalFolder> localFolders = null; if (!account.isAvailable(context)) { Timber.i("not...
MessagingController { public void listFoldersSynchronous(final Account account, final boolean refreshRemote, final MessagingListener listener) { for (MessagingListener l : getListeners(listener)) { l.listFoldersStarted(account); } List<LocalFolder> localFolders = null; if (!account.isAvailable(context)) { Timber.i("not...
@Test public void refreshRemoteSynchronous_shouldNotDeleteFoldersOnRemote() throws MessagingException { configureRemoteStoreWithFolder(); when(localStore.getFolders(false)) .thenReturn(Collections.singletonList(localFolder)); List<Folder> folders = Collections.singletonList(remoteFolder); when(remoteStore.getFolders(fa...
@VisibleForTesting void refreshRemoteSynchronous(final Account account, final MessagingListener listener) { List<LocalFolder> localFolders = null; try { Store store = account.getRemoteStore(); List<? extends Folder> remoteFolders = store.getFolders(false); LocalStore localStore = account.getLocalStore(); Map<String, Fo...
MessagingController { @VisibleForTesting void refreshRemoteSynchronous(final Account account, final MessagingListener listener) { List<LocalFolder> localFolders = null; try { Store store = account.getRemoteStore(); List<? extends Folder> remoteFolders = store.getFolders(false); LocalStore localStore = account.getLocalS...
MessagingController { @VisibleForTesting void refreshRemoteSynchronous(final Account account, final MessagingListener listener) { List<LocalFolder> localFolders = null; try { Store store = account.getRemoteStore(); List<? extends Folder> remoteFolders = store.getFolders(false); LocalStore localStore = account.getLocalS...
MessagingController { @VisibleForTesting void refreshRemoteSynchronous(final Account account, final MessagingListener listener) { List<LocalFolder> localFolders = null; try { Store store = account.getRemoteStore(); List<? extends Folder> remoteFolders = store.getFolders(false); LocalStore localStore = account.getLocalS...
MessagingController { @VisibleForTesting void refreshRemoteSynchronous(final Account account, final MessagingListener listener) { List<LocalFolder> localFolders = null; try { Store store = account.getRemoteStore(); List<? extends Folder> remoteFolders = store.getFolders(false); LocalStore localStore = account.getLocalS...
@Test public void refreshRemoteSynchronous_shouldNotifyFinishedAfterSuccess() throws MessagingException { configureRemoteStoreWithFolder(); List<LocalFolder> folders = Collections.singletonList(localFolder); when(localStore.getFolders(false)).thenReturn(folders); controller.refreshRemoteSynchronous(account, listener); ...
@VisibleForTesting void refreshRemoteSynchronous(final Account account, final MessagingListener listener) { List<LocalFolder> localFolders = null; try { Store store = account.getRemoteStore(); List<? extends Folder> remoteFolders = store.getFolders(false); LocalStore localStore = account.getLocalStore(); Map<String, Fo...
MessagingController { @VisibleForTesting void refreshRemoteSynchronous(final Account account, final MessagingListener listener) { List<LocalFolder> localFolders = null; try { Store store = account.getRemoteStore(); List<? extends Folder> remoteFolders = store.getFolders(false); LocalStore localStore = account.getLocalS...
MessagingController { @VisibleForTesting void refreshRemoteSynchronous(final Account account, final MessagingListener listener) { List<LocalFolder> localFolders = null; try { Store store = account.getRemoteStore(); List<? extends Folder> remoteFolders = store.getFolders(false); LocalStore localStore = account.getLocalS...
MessagingController { @VisibleForTesting void refreshRemoteSynchronous(final Account account, final MessagingListener listener) { List<LocalFolder> localFolders = null; try { Store store = account.getRemoteStore(); List<? extends Folder> remoteFolders = store.getFolders(false); LocalStore localStore = account.getLocalS...
MessagingController { @VisibleForTesting void refreshRemoteSynchronous(final Account account, final MessagingListener listener) { List<LocalFolder> localFolders = null; try { Store store = account.getRemoteStore(); List<? extends Folder> remoteFolders = store.getFolders(false); LocalStore localStore = account.getLocalS...
@Test public void refreshRemoteSynchronous_shouldNotNotifyFinishedAfterFailure() throws MessagingException { configureRemoteStoreWithFolder(); when(localStore.getFolders(false)).thenThrow(new MessagingException("Test")); controller.refreshRemoteSynchronous(account, listener); verify(listener, never()).listFoldersFinish...
@VisibleForTesting void refreshRemoteSynchronous(final Account account, final MessagingListener listener) { List<LocalFolder> localFolders = null; try { Store store = account.getRemoteStore(); List<? extends Folder> remoteFolders = store.getFolders(false); LocalStore localStore = account.getLocalStore(); Map<String, Fo...
MessagingController { @VisibleForTesting void refreshRemoteSynchronous(final Account account, final MessagingListener listener) { List<LocalFolder> localFolders = null; try { Store store = account.getRemoteStore(); List<? extends Folder> remoteFolders = store.getFolders(false); LocalStore localStore = account.getLocalS...
MessagingController { @VisibleForTesting void refreshRemoteSynchronous(final Account account, final MessagingListener listener) { List<LocalFolder> localFolders = null; try { Store store = account.getRemoteStore(); List<? extends Folder> remoteFolders = store.getFolders(false); LocalStore localStore = account.getLocalS...
MessagingController { @VisibleForTesting void refreshRemoteSynchronous(final Account account, final MessagingListener listener) { List<LocalFolder> localFolders = null; try { Store store = account.getRemoteStore(); List<? extends Folder> remoteFolders = store.getFolders(false); LocalStore localStore = account.getLocalS...
MessagingController { @VisibleForTesting void refreshRemoteSynchronous(final Account account, final MessagingListener listener) { List<LocalFolder> localFolders = null; try { Store store = account.getRemoteStore(); List<? extends Folder> remoteFolders = store.getFolders(false); LocalStore localStore = account.getLocalS...
@Test public void searchLocalMessagesSynchronous_shouldCallSearchForMessagesOnLocalStore() throws Exception { setAccountsInPreferences(Collections.singletonMap("1", account)); when(search.getAccountUuids()).thenReturn(new String[]{"allAccounts"}); controller.searchLocalMessagesSynchronous(search, listener); verify(loca...
@VisibleForTesting void searchLocalMessagesSynchronous(final LocalSearch search, final MessagingListener listener) { final AccountStats stats = new AccountStats(); final Set<String> uuidSet = new HashSet<>(Arrays.asList(search.getAccountUuids())); List<Account> accounts = Preferences.getPreferences(context).getAccounts...
MessagingController { @VisibleForTesting void searchLocalMessagesSynchronous(final LocalSearch search, final MessagingListener listener) { final AccountStats stats = new AccountStats(); final Set<String> uuidSet = new HashSet<>(Arrays.asList(search.getAccountUuids())); List<Account> accounts = Preferences.getPreference...
MessagingController { @VisibleForTesting void searchLocalMessagesSynchronous(final LocalSearch search, final MessagingListener listener) { final AccountStats stats = new AccountStats(); final Set<String> uuidSet = new HashSet<>(Arrays.asList(search.getAccountUuids())); List<Account> accounts = Preferences.getPreference...
MessagingController { @VisibleForTesting void searchLocalMessagesSynchronous(final LocalSearch search, final MessagingListener listener) { final AccountStats stats = new AccountStats(); final Set<String> uuidSet = new HashSet<>(Arrays.asList(search.getAccountUuids())); List<Account> accounts = Preferences.getPreference...
MessagingController { @VisibleForTesting void searchLocalMessagesSynchronous(final LocalSearch search, final MessagingListener listener) { final AccountStats stats = new AccountStats(); final Set<String> uuidSet = new HashSet<>(Arrays.asList(search.getAccountUuids())); List<Account> accounts = Preferences.getPreference...
@Test public void isPgpInlineMethods__withPgpInlineData__shouldReturnTrue() throws Exception { String pgpInlineData = "-----BEGIN PGP MESSAGE-----\n" + "Header: Value\n" + "\n" + "base64base64base64base64\n" + "-----END PGP MESSAGE-----\n"; MimeMessage message = new MimeMessage(); message.setBody(new TextBody(pgpInline...
public static boolean isPartPgpInlineEncrypted(@Nullable Part part) { if (part == null) { return false; } if (!part.isMimeType(TEXT_PLAIN) && !part.isMimeType(APPLICATION_PGP)) { return false; } String text = MessageExtractor.getTextFromPart(part, TEXT_LENGTH_FOR_INLINE_CHECK); if (TextUtils.isEmpty(text)) { return fal...
MessageDecryptVerifier { public static boolean isPartPgpInlineEncrypted(@Nullable Part part) { if (part == null) { return false; } if (!part.isMimeType(TEXT_PLAIN) && !part.isMimeType(APPLICATION_PGP)) { return false; } String text = MessageExtractor.getTextFromPart(part, TEXT_LENGTH_FOR_INLINE_CHECK); if (TextUtils.is...
MessageDecryptVerifier { public static boolean isPartPgpInlineEncrypted(@Nullable Part part) { if (part == null) { return false; } if (!part.isMimeType(TEXT_PLAIN) && !part.isMimeType(APPLICATION_PGP)) { return false; } String text = MessageExtractor.getTextFromPart(part, TEXT_LENGTH_FOR_INLINE_CHECK); if (TextUtils.is...
MessageDecryptVerifier { public static boolean isPartPgpInlineEncrypted(@Nullable Part part) { if (part == null) { return false; } if (!part.isMimeType(TEXT_PLAIN) && !part.isMimeType(APPLICATION_PGP)) { return false; } String text = MessageExtractor.getTextFromPart(part, TEXT_LENGTH_FOR_INLINE_CHECK); if (TextUtils.is...
MessageDecryptVerifier { public static boolean isPartPgpInlineEncrypted(@Nullable Part part) { if (part == null) { return false; } if (!part.isMimeType(TEXT_PLAIN) && !part.isMimeType(APPLICATION_PGP)) { return false; } String text = MessageExtractor.getTextFromPart(part, TEXT_LENGTH_FOR_INLINE_CHECK); if (TextUtils.is...
@Test public void searchLocalMessagesSynchronous_shouldNotifyWhenStoreFinishesRetrievingAMessage() throws Exception { setAccountsInPreferences(Collections.singletonMap("1", account)); LocalMessage localMessage = mock(LocalMessage.class); when(localMessage.getFolder()).thenReturn(localFolder); when(search.getAccountUuid...
@VisibleForTesting void searchLocalMessagesSynchronous(final LocalSearch search, final MessagingListener listener) { final AccountStats stats = new AccountStats(); final Set<String> uuidSet = new HashSet<>(Arrays.asList(search.getAccountUuids())); List<Account> accounts = Preferences.getPreferences(context).getAccounts...
MessagingController { @VisibleForTesting void searchLocalMessagesSynchronous(final LocalSearch search, final MessagingListener listener) { final AccountStats stats = new AccountStats(); final Set<String> uuidSet = new HashSet<>(Arrays.asList(search.getAccountUuids())); List<Account> accounts = Preferences.getPreference...
MessagingController { @VisibleForTesting void searchLocalMessagesSynchronous(final LocalSearch search, final MessagingListener listener) { final AccountStats stats = new AccountStats(); final Set<String> uuidSet = new HashSet<>(Arrays.asList(search.getAccountUuids())); List<Account> accounts = Preferences.getPreference...
MessagingController { @VisibleForTesting void searchLocalMessagesSynchronous(final LocalSearch search, final MessagingListener listener) { final AccountStats stats = new AccountStats(); final Set<String> uuidSet = new HashSet<>(Arrays.asList(search.getAccountUuids())); List<Account> accounts = Preferences.getPreference...
MessagingController { @VisibleForTesting void searchLocalMessagesSynchronous(final LocalSearch search, final MessagingListener listener) { final AccountStats stats = new AccountStats(); final Set<String> uuidSet = new HashSet<>(Arrays.asList(search.getAccountUuids())); List<Account> accounts = Preferences.getPreference...
@Test public void searchRemoteMessagesSynchronous_shouldNotifyStartedListingRemoteMessages() throws Exception { setupRemoteSearch(); controller.searchRemoteMessagesSynchronous("1", FOLDER_ID, FOLDER_NAME, "query", reqFlags, forbiddenFlags, listener); verify(listener).remoteSearchStarted(FOLDER_ID, FOLDER_NAME); }
@VisibleForTesting void searchRemoteMessagesSynchronous(final String acctUuid, final String folderId, final String folderName, final String query, final Set<Flag> requiredFlags, final Set<Flag> forbiddenFlags, final MessagingListener listener) { final Account acct = Preferences.getPreferences(context).getAccount(acctUu...
MessagingController { @VisibleForTesting void searchRemoteMessagesSynchronous(final String acctUuid, final String folderId, final String folderName, final String query, final Set<Flag> requiredFlags, final Set<Flag> forbiddenFlags, final MessagingListener listener) { final Account acct = Preferences.getPreferences(cont...
MessagingController { @VisibleForTesting void searchRemoteMessagesSynchronous(final String acctUuid, final String folderId, final String folderName, final String query, final Set<Flag> requiredFlags, final Set<Flag> forbiddenFlags, final MessagingListener listener) { final Account acct = Preferences.getPreferences(cont...
MessagingController { @VisibleForTesting void searchRemoteMessagesSynchronous(final String acctUuid, final String folderId, final String folderName, final String query, final Set<Flag> requiredFlags, final Set<Flag> forbiddenFlags, final MessagingListener listener) { final Account acct = Preferences.getPreferences(cont...
MessagingController { @VisibleForTesting void searchRemoteMessagesSynchronous(final String acctUuid, final String folderId, final String folderName, final String query, final Set<Flag> requiredFlags, final Set<Flag> forbiddenFlags, final MessagingListener listener) { final Account acct = Preferences.getPreferences(cont...
@Test public void searchRemoteMessagesSynchronous_shouldQueryRemoteFolder() throws Exception { setupRemoteSearch(); controller.searchRemoteMessagesSynchronous("1", FOLDER_ID, FOLDER_NAME, "query", reqFlags, forbiddenFlags, listener); verify(remoteFolder).search("query", reqFlags, forbiddenFlags); }
@VisibleForTesting void searchRemoteMessagesSynchronous(final String acctUuid, final String folderId, final String folderName, final String query, final Set<Flag> requiredFlags, final Set<Flag> forbiddenFlags, final MessagingListener listener) { final Account acct = Preferences.getPreferences(context).getAccount(acctUu...
MessagingController { @VisibleForTesting void searchRemoteMessagesSynchronous(final String acctUuid, final String folderId, final String folderName, final String query, final Set<Flag> requiredFlags, final Set<Flag> forbiddenFlags, final MessagingListener listener) { final Account acct = Preferences.getPreferences(cont...
MessagingController { @VisibleForTesting void searchRemoteMessagesSynchronous(final String acctUuid, final String folderId, final String folderName, final String query, final Set<Flag> requiredFlags, final Set<Flag> forbiddenFlags, final MessagingListener listener) { final Account acct = Preferences.getPreferences(cont...
MessagingController { @VisibleForTesting void searchRemoteMessagesSynchronous(final String acctUuid, final String folderId, final String folderName, final String query, final Set<Flag> requiredFlags, final Set<Flag> forbiddenFlags, final MessagingListener listener) { final Account acct = Preferences.getPreferences(cont...
MessagingController { @VisibleForTesting void searchRemoteMessagesSynchronous(final String acctUuid, final String folderId, final String folderName, final String query, final Set<Flag> requiredFlags, final Set<Flag> forbiddenFlags, final MessagingListener listener) { final Account acct = Preferences.getPreferences(cont...
@Test public void searchRemoteMessagesSynchronous_shouldAskLocalFolderToDetermineNewMessages() throws Exception { setupRemoteSearch(); controller.searchRemoteMessagesSynchronous("1", FOLDER_ID, FOLDER_NAME, "query", reqFlags, forbiddenFlags, listener); verify(localFolder).extractNewMessages(remoteMessages); }
@VisibleForTesting void searchRemoteMessagesSynchronous(final String acctUuid, final String folderId, final String folderName, final String query, final Set<Flag> requiredFlags, final Set<Flag> forbiddenFlags, final MessagingListener listener) { final Account acct = Preferences.getPreferences(context).getAccount(acctUu...
MessagingController { @VisibleForTesting void searchRemoteMessagesSynchronous(final String acctUuid, final String folderId, final String folderName, final String query, final Set<Flag> requiredFlags, final Set<Flag> forbiddenFlags, final MessagingListener listener) { final Account acct = Preferences.getPreferences(cont...
MessagingController { @VisibleForTesting void searchRemoteMessagesSynchronous(final String acctUuid, final String folderId, final String folderName, final String query, final Set<Flag> requiredFlags, final Set<Flag> forbiddenFlags, final MessagingListener listener) { final Account acct = Preferences.getPreferences(cont...
MessagingController { @VisibleForTesting void searchRemoteMessagesSynchronous(final String acctUuid, final String folderId, final String folderName, final String query, final Set<Flag> requiredFlags, final Set<Flag> forbiddenFlags, final MessagingListener listener) { final Account acct = Preferences.getPreferences(cont...
MessagingController { @VisibleForTesting void searchRemoteMessagesSynchronous(final String acctUuid, final String folderId, final String folderName, final String query, final Set<Flag> requiredFlags, final Set<Flag> forbiddenFlags, final MessagingListener listener) { final Account acct = Preferences.getPreferences(cont...
@Test public void searchRemoteMessagesSynchronous_shouldTryAndGetNewMessages() throws Exception { setupRemoteSearch(); controller.searchRemoteMessagesSynchronous("1", FOLDER_ID, FOLDER_NAME, "query", reqFlags, forbiddenFlags, listener); verify(localFolder).getMessage("newMessageUid1"); }
@VisibleForTesting void searchRemoteMessagesSynchronous(final String acctUuid, final String folderId, final String folderName, final String query, final Set<Flag> requiredFlags, final Set<Flag> forbiddenFlags, final MessagingListener listener) { final Account acct = Preferences.getPreferences(context).getAccount(acctUu...
MessagingController { @VisibleForTesting void searchRemoteMessagesSynchronous(final String acctUuid, final String folderId, final String folderName, final String query, final Set<Flag> requiredFlags, final Set<Flag> forbiddenFlags, final MessagingListener listener) { final Account acct = Preferences.getPreferences(cont...
MessagingController { @VisibleForTesting void searchRemoteMessagesSynchronous(final String acctUuid, final String folderId, final String folderName, final String query, final Set<Flag> requiredFlags, final Set<Flag> forbiddenFlags, final MessagingListener listener) { final Account acct = Preferences.getPreferences(cont...
MessagingController { @VisibleForTesting void searchRemoteMessagesSynchronous(final String acctUuid, final String folderId, final String folderName, final String query, final Set<Flag> requiredFlags, final Set<Flag> forbiddenFlags, final MessagingListener listener) { final Account acct = Preferences.getPreferences(cont...
MessagingController { @VisibleForTesting void searchRemoteMessagesSynchronous(final String acctUuid, final String folderId, final String folderName, final String query, final Set<Flag> requiredFlags, final Set<Flag> forbiddenFlags, final MessagingListener listener) { final Account acct = Preferences.getPreferences(cont...
@Test public void searchRemoteMessagesSynchronous_shouldNotTryAndGetOldMessages() throws Exception { setupRemoteSearch(); controller.searchRemoteMessagesSynchronous("1", FOLDER_ID, FOLDER_NAME, "query", reqFlags, forbiddenFlags, listener); verify(localFolder, never()).getMessage("oldMessageUid"); }
@VisibleForTesting void searchRemoteMessagesSynchronous(final String acctUuid, final String folderId, final String folderName, final String query, final Set<Flag> requiredFlags, final Set<Flag> forbiddenFlags, final MessagingListener listener) { final Account acct = Preferences.getPreferences(context).getAccount(acctUu...
MessagingController { @VisibleForTesting void searchRemoteMessagesSynchronous(final String acctUuid, final String folderId, final String folderName, final String query, final Set<Flag> requiredFlags, final Set<Flag> forbiddenFlags, final MessagingListener listener) { final Account acct = Preferences.getPreferences(cont...
MessagingController { @VisibleForTesting void searchRemoteMessagesSynchronous(final String acctUuid, final String folderId, final String folderName, final String query, final Set<Flag> requiredFlags, final Set<Flag> forbiddenFlags, final MessagingListener listener) { final Account acct = Preferences.getPreferences(cont...
MessagingController { @VisibleForTesting void searchRemoteMessagesSynchronous(final String acctUuid, final String folderId, final String folderName, final String query, final Set<Flag> requiredFlags, final Set<Flag> forbiddenFlags, final MessagingListener listener) { final Account acct = Preferences.getPreferences(cont...
MessagingController { @VisibleForTesting void searchRemoteMessagesSynchronous(final String acctUuid, final String folderId, final String folderName, final String query, final Set<Flag> requiredFlags, final Set<Flag> forbiddenFlags, final MessagingListener listener) { final Account acct = Preferences.getPreferences(cont...
@Test public void searchRemoteMessagesSynchronous_shouldFetchNewMessages() throws Exception { setupRemoteSearch(); controller.searchRemoteMessagesSynchronous("1", FOLDER_ID, FOLDER_NAME, "query", reqFlags, forbiddenFlags, listener); verify(remoteFolder, times(2)).fetch(eq(Collections.singletonList(remoteNewMessage2)), ...
@VisibleForTesting void searchRemoteMessagesSynchronous(final String acctUuid, final String folderId, final String folderName, final String query, final Set<Flag> requiredFlags, final Set<Flag> forbiddenFlags, final MessagingListener listener) { final Account acct = Preferences.getPreferences(context).getAccount(acctUu...
MessagingController { @VisibleForTesting void searchRemoteMessagesSynchronous(final String acctUuid, final String folderId, final String folderName, final String query, final Set<Flag> requiredFlags, final Set<Flag> forbiddenFlags, final MessagingListener listener) { final Account acct = Preferences.getPreferences(cont...
MessagingController { @VisibleForTesting void searchRemoteMessagesSynchronous(final String acctUuid, final String folderId, final String folderName, final String query, final Set<Flag> requiredFlags, final Set<Flag> forbiddenFlags, final MessagingListener listener) { final Account acct = Preferences.getPreferences(cont...
MessagingController { @VisibleForTesting void searchRemoteMessagesSynchronous(final String acctUuid, final String folderId, final String folderName, final String query, final Set<Flag> requiredFlags, final Set<Flag> forbiddenFlags, final MessagingListener listener) { final Account acct = Preferences.getPreferences(cont...
MessagingController { @VisibleForTesting void searchRemoteMessagesSynchronous(final String acctUuid, final String folderId, final String folderName, final String query, final Set<Flag> requiredFlags, final Set<Flag> forbiddenFlags, final MessagingListener listener) { final Account acct = Preferences.getPreferences(cont...
@Test public void searchRemoteMessagesSynchronous_shouldNotFetchExistingMessages() throws Exception { setupRemoteSearch(); controller.searchRemoteMessagesSynchronous("1", FOLDER_ID, FOLDER_NAME, "query", reqFlags, forbiddenFlags, listener); verify(remoteFolder, never()).fetch(eq(Collections.singletonList(remoteNewMessa...
@VisibleForTesting void searchRemoteMessagesSynchronous(final String acctUuid, final String folderId, final String folderName, final String query, final Set<Flag> requiredFlags, final Set<Flag> forbiddenFlags, final MessagingListener listener) { final Account acct = Preferences.getPreferences(context).getAccount(acctUu...
MessagingController { @VisibleForTesting void searchRemoteMessagesSynchronous(final String acctUuid, final String folderId, final String folderName, final String query, final Set<Flag> requiredFlags, final Set<Flag> forbiddenFlags, final MessagingListener listener) { final Account acct = Preferences.getPreferences(cont...
MessagingController { @VisibleForTesting void searchRemoteMessagesSynchronous(final String acctUuid, final String folderId, final String folderName, final String query, final Set<Flag> requiredFlags, final Set<Flag> forbiddenFlags, final MessagingListener listener) { final Account acct = Preferences.getPreferences(cont...
MessagingController { @VisibleForTesting void searchRemoteMessagesSynchronous(final String acctUuid, final String folderId, final String folderName, final String query, final Set<Flag> requiredFlags, final Set<Flag> forbiddenFlags, final MessagingListener listener) { final Account acct = Preferences.getPreferences(cont...
MessagingController { @VisibleForTesting void searchRemoteMessagesSynchronous(final String acctUuid, final String folderId, final String folderName, final String query, final Set<Flag> requiredFlags, final Set<Flag> forbiddenFlags, final MessagingListener listener) { final Account acct = Preferences.getPreferences(cont...
@Test public void searchRemoteMessagesSynchronous_shouldNotifyOnFailure() throws Exception { setupRemoteSearch(); when(account.getRemoteStore()).thenThrow(new MessagingException("Test")); controller.searchRemoteMessagesSynchronous("1", FOLDER_ID, FOLDER_NAME, "query", reqFlags, forbiddenFlags, listener); verify(listene...
@VisibleForTesting void searchRemoteMessagesSynchronous(final String acctUuid, final String folderId, final String folderName, final String query, final Set<Flag> requiredFlags, final Set<Flag> forbiddenFlags, final MessagingListener listener) { final Account acct = Preferences.getPreferences(context).getAccount(acctUu...
MessagingController { @VisibleForTesting void searchRemoteMessagesSynchronous(final String acctUuid, final String folderId, final String folderName, final String query, final Set<Flag> requiredFlags, final Set<Flag> forbiddenFlags, final MessagingListener listener) { final Account acct = Preferences.getPreferences(cont...
MessagingController { @VisibleForTesting void searchRemoteMessagesSynchronous(final String acctUuid, final String folderId, final String folderName, final String query, final Set<Flag> requiredFlags, final Set<Flag> forbiddenFlags, final MessagingListener listener) { final Account acct = Preferences.getPreferences(cont...
MessagingController { @VisibleForTesting void searchRemoteMessagesSynchronous(final String acctUuid, final String folderId, final String folderName, final String query, final Set<Flag> requiredFlags, final Set<Flag> forbiddenFlags, final MessagingListener listener) { final Account acct = Preferences.getPreferences(cont...
MessagingController { @VisibleForTesting void searchRemoteMessagesSynchronous(final String acctUuid, final String folderId, final String folderName, final String query, final Set<Flag> requiredFlags, final Set<Flag> forbiddenFlags, final MessagingListener listener) { final Account acct = Preferences.getPreferences(cont...
@Test public void searchRemoteMessagesSynchronous_shouldNotifyOnFinish() throws Exception { setupRemoteSearch(); when(account.getRemoteStore()).thenThrow(new MessagingException("Test")); controller.searchRemoteMessagesSynchronous("1", FOLDER_ID, FOLDER_NAME, "query", reqFlags, forbiddenFlags, listener); verify(listener...
@VisibleForTesting void searchRemoteMessagesSynchronous(final String acctUuid, final String folderId, final String folderName, final String query, final Set<Flag> requiredFlags, final Set<Flag> forbiddenFlags, final MessagingListener listener) { final Account acct = Preferences.getPreferences(context).getAccount(acctUu...
MessagingController { @VisibleForTesting void searchRemoteMessagesSynchronous(final String acctUuid, final String folderId, final String folderName, final String query, final Set<Flag> requiredFlags, final Set<Flag> forbiddenFlags, final MessagingListener listener) { final Account acct = Preferences.getPreferences(cont...
MessagingController { @VisibleForTesting void searchRemoteMessagesSynchronous(final String acctUuid, final String folderId, final String folderName, final String query, final Set<Flag> requiredFlags, final Set<Flag> forbiddenFlags, final MessagingListener listener) { final Account acct = Preferences.getPreferences(cont...
MessagingController { @VisibleForTesting void searchRemoteMessagesSynchronous(final String acctUuid, final String folderId, final String folderName, final String query, final Set<Flag> requiredFlags, final Set<Flag> forbiddenFlags, final MessagingListener listener) { final Account acct = Preferences.getPreferences(cont...
MessagingController { @VisibleForTesting void searchRemoteMessagesSynchronous(final String acctUuid, final String folderId, final String folderName, final String query, final Set<Flag> requiredFlags, final Set<Flag> forbiddenFlags, final MessagingListener listener) { final Account acct = Preferences.getPreferences(cont...
@Test public void isPartPgpInlineEncryptedOrSigned__withSignedData__shouldReturnTrue() throws Exception { String pgpInlineData = "-----BEGIN PGP SIGNED MESSAGE-----\n" + "Header: Value\n" + "\n" + "-----BEGIN PGP SIGNATURE-----\n" + "Header: Value\n" + "\n" + "base64base64base64base64\n" + "-----END PGP SIGNED MESSAGE-...
@VisibleForTesting static boolean isPartPgpInlineEncryptedOrSigned(Part part) { if (!part.isMimeType(TEXT_PLAIN) && !part.isMimeType(APPLICATION_PGP)) { return false; } String text = MessageExtractor.getTextFromPart(part, TEXT_LENGTH_FOR_INLINE_CHECK); if (TextUtils.isEmpty(text)) { return false; } text = text.trim(); ...
MessageDecryptVerifier { @VisibleForTesting static boolean isPartPgpInlineEncryptedOrSigned(Part part) { if (!part.isMimeType(TEXT_PLAIN) && !part.isMimeType(APPLICATION_PGP)) { return false; } String text = MessageExtractor.getTextFromPart(part, TEXT_LENGTH_FOR_INLINE_CHECK); if (TextUtils.isEmpty(text)) { return fals...
MessageDecryptVerifier { @VisibleForTesting static boolean isPartPgpInlineEncryptedOrSigned(Part part) { if (!part.isMimeType(TEXT_PLAIN) && !part.isMimeType(APPLICATION_PGP)) { return false; } String text = MessageExtractor.getTextFromPart(part, TEXT_LENGTH_FOR_INLINE_CHECK); if (TextUtils.isEmpty(text)) { return fals...
MessageDecryptVerifier { @VisibleForTesting static boolean isPartPgpInlineEncryptedOrSigned(Part part) { if (!part.isMimeType(TEXT_PLAIN) && !part.isMimeType(APPLICATION_PGP)) { return false; } String text = MessageExtractor.getTextFromPart(part, TEXT_LENGTH_FOR_INLINE_CHECK); if (TextUtils.isEmpty(text)) { return fals...
MessageDecryptVerifier { @VisibleForTesting static boolean isPartPgpInlineEncryptedOrSigned(Part part) { if (!part.isMimeType(TEXT_PLAIN) && !part.isMimeType(APPLICATION_PGP)) { return false; } String text = MessageExtractor.getTextFromPart(part, TEXT_LENGTH_FOR_INLINE_CHECK); if (TextUtils.isEmpty(text)) { return fals...
@Test public void sendPendingMessagesSynchronous_shouldCallListenerOnStart() throws MessagingException { setupAccountWithMessageToSend(); controller.sendPendingMessagesSynchronous(account); verify(listener).sendPendingMessagesStarted(account); }
@VisibleForTesting protected void sendPendingMessagesSynchronous(final Account account) { LocalFolder localOutboxFolder = null; Exception lastFailure = null; boolean wasPermanentFailure = false; try { LocalStore localStore = account.getLocalStore(); localOutboxFolder = localStore.getFolder( account.getOutboxFolderId())...
MessagingController { @VisibleForTesting protected void sendPendingMessagesSynchronous(final Account account) { LocalFolder localOutboxFolder = null; Exception lastFailure = null; boolean wasPermanentFailure = false; try { LocalStore localStore = account.getLocalStore(); localOutboxFolder = localStore.getFolder( accoun...
MessagingController { @VisibleForTesting protected void sendPendingMessagesSynchronous(final Account account) { LocalFolder localOutboxFolder = null; Exception lastFailure = null; boolean wasPermanentFailure = false; try { LocalStore localStore = account.getLocalStore(); localOutboxFolder = localStore.getFolder( accoun...
MessagingController { @VisibleForTesting protected void sendPendingMessagesSynchronous(final Account account) { LocalFolder localOutboxFolder = null; Exception lastFailure = null; boolean wasPermanentFailure = false; try { LocalStore localStore = account.getLocalStore(); localOutboxFolder = localStore.getFolder( accoun...
MessagingController { @VisibleForTesting protected void sendPendingMessagesSynchronous(final Account account) { LocalFolder localOutboxFolder = null; Exception lastFailure = null; boolean wasPermanentFailure = false; try { LocalStore localStore = account.getLocalStore(); localOutboxFolder = localStore.getFolder( accoun...
@Test public void sendPendingMessagesSynchronous_shouldSetProgress() throws MessagingException { setupAccountWithMessageToSend(); controller.sendPendingMessagesSynchronous(account); verify(listener).synchronizeMailboxProgress(account, "SentID", "Sent", 0, 1); }
@VisibleForTesting protected void sendPendingMessagesSynchronous(final Account account) { LocalFolder localOutboxFolder = null; Exception lastFailure = null; boolean wasPermanentFailure = false; try { LocalStore localStore = account.getLocalStore(); localOutboxFolder = localStore.getFolder( account.getOutboxFolderId())...
MessagingController { @VisibleForTesting protected void sendPendingMessagesSynchronous(final Account account) { LocalFolder localOutboxFolder = null; Exception lastFailure = null; boolean wasPermanentFailure = false; try { LocalStore localStore = account.getLocalStore(); localOutboxFolder = localStore.getFolder( accoun...
MessagingController { @VisibleForTesting protected void sendPendingMessagesSynchronous(final Account account) { LocalFolder localOutboxFolder = null; Exception lastFailure = null; boolean wasPermanentFailure = false; try { LocalStore localStore = account.getLocalStore(); localOutboxFolder = localStore.getFolder( accoun...
MessagingController { @VisibleForTesting protected void sendPendingMessagesSynchronous(final Account account) { LocalFolder localOutboxFolder = null; Exception lastFailure = null; boolean wasPermanentFailure = false; try { LocalStore localStore = account.getLocalStore(); localOutboxFolder = localStore.getFolder( accoun...
MessagingController { @VisibleForTesting protected void sendPendingMessagesSynchronous(final Account account) { LocalFolder localOutboxFolder = null; Exception lastFailure = null; boolean wasPermanentFailure = false; try { LocalStore localStore = account.getLocalStore(); localOutboxFolder = localStore.getFolder( accoun...
@Test public void sendPendingMessagesSynchronous_whenMessageSentSuccesfully_shouldUpdateProgress() throws MessagingException { setupAccountWithMessageToSend(); controller.sendPendingMessagesSynchronous(account); verify(listener).synchronizeMailboxProgress(account, "SentID", "Sent", 1, 1); }
@VisibleForTesting protected void sendPendingMessagesSynchronous(final Account account) { LocalFolder localOutboxFolder = null; Exception lastFailure = null; boolean wasPermanentFailure = false; try { LocalStore localStore = account.getLocalStore(); localOutboxFolder = localStore.getFolder( account.getOutboxFolderId())...
MessagingController { @VisibleForTesting protected void sendPendingMessagesSynchronous(final Account account) { LocalFolder localOutboxFolder = null; Exception lastFailure = null; boolean wasPermanentFailure = false; try { LocalStore localStore = account.getLocalStore(); localOutboxFolder = localStore.getFolder( accoun...
MessagingController { @VisibleForTesting protected void sendPendingMessagesSynchronous(final Account account) { LocalFolder localOutboxFolder = null; Exception lastFailure = null; boolean wasPermanentFailure = false; try { LocalStore localStore = account.getLocalStore(); localOutboxFolder = localStore.getFolder( accoun...
MessagingController { @VisibleForTesting protected void sendPendingMessagesSynchronous(final Account account) { LocalFolder localOutboxFolder = null; Exception lastFailure = null; boolean wasPermanentFailure = false; try { LocalStore localStore = account.getLocalStore(); localOutboxFolder = localStore.getFolder( accoun...
MessagingController { @VisibleForTesting protected void sendPendingMessagesSynchronous(final Account account) { LocalFolder localOutboxFolder = null; Exception lastFailure = null; boolean wasPermanentFailure = false; try { LocalStore localStore = account.getLocalStore(); localOutboxFolder = localStore.getFolder( accoun...
@Test public void sendPendingMessagesSynchronous_shouldUpdateProgress() throws MessagingException { setupAccountWithMessageToSend(); controller.sendPendingMessagesSynchronous(account); verify(listener).synchronizeMailboxProgress(account, "SentID", "Sent", 1, 1); }
@VisibleForTesting protected void sendPendingMessagesSynchronous(final Account account) { LocalFolder localOutboxFolder = null; Exception lastFailure = null; boolean wasPermanentFailure = false; try { LocalStore localStore = account.getLocalStore(); localOutboxFolder = localStore.getFolder( account.getOutboxFolderId())...
MessagingController { @VisibleForTesting protected void sendPendingMessagesSynchronous(final Account account) { LocalFolder localOutboxFolder = null; Exception lastFailure = null; boolean wasPermanentFailure = false; try { LocalStore localStore = account.getLocalStore(); localOutboxFolder = localStore.getFolder( accoun...
MessagingController { @VisibleForTesting protected void sendPendingMessagesSynchronous(final Account account) { LocalFolder localOutboxFolder = null; Exception lastFailure = null; boolean wasPermanentFailure = false; try { LocalStore localStore = account.getLocalStore(); localOutboxFolder = localStore.getFolder( accoun...
MessagingController { @VisibleForTesting protected void sendPendingMessagesSynchronous(final Account account) { LocalFolder localOutboxFolder = null; Exception lastFailure = null; boolean wasPermanentFailure = false; try { LocalStore localStore = account.getLocalStore(); localOutboxFolder = localStore.getFolder( accoun...
MessagingController { @VisibleForTesting protected void sendPendingMessagesSynchronous(final Account account) { LocalFolder localOutboxFolder = null; Exception lastFailure = null; boolean wasPermanentFailure = false; try { LocalStore localStore = account.getLocalStore(); localOutboxFolder = localStore.getFolder( accoun...
@Test public void sendPendingMessagesSynchronous_shouldCallListenerOnCompletion() throws MessagingException { setupAccountWithMessageToSend(); controller.sendPendingMessagesSynchronous(account); verify(listener).sendPendingMessagesCompleted(account); }
@VisibleForTesting protected void sendPendingMessagesSynchronous(final Account account) { LocalFolder localOutboxFolder = null; Exception lastFailure = null; boolean wasPermanentFailure = false; try { LocalStore localStore = account.getLocalStore(); localOutboxFolder = localStore.getFolder( account.getOutboxFolderId())...
MessagingController { @VisibleForTesting protected void sendPendingMessagesSynchronous(final Account account) { LocalFolder localOutboxFolder = null; Exception lastFailure = null; boolean wasPermanentFailure = false; try { LocalStore localStore = account.getLocalStore(); localOutboxFolder = localStore.getFolder( accoun...
MessagingController { @VisibleForTesting protected void sendPendingMessagesSynchronous(final Account account) { LocalFolder localOutboxFolder = null; Exception lastFailure = null; boolean wasPermanentFailure = false; try { LocalStore localStore = account.getLocalStore(); localOutboxFolder = localStore.getFolder( accoun...
MessagingController { @VisibleForTesting protected void sendPendingMessagesSynchronous(final Account account) { LocalFolder localOutboxFolder = null; Exception lastFailure = null; boolean wasPermanentFailure = false; try { LocalStore localStore = account.getLocalStore(); localOutboxFolder = localStore.getFolder( accoun...
MessagingController { @VisibleForTesting protected void sendPendingMessagesSynchronous(final Account account) { LocalFolder localOutboxFolder = null; Exception lastFailure = null; boolean wasPermanentFailure = false; try { LocalStore localStore = account.getLocalStore(); localOutboxFolder = localStore.getFolder( accoun...
@Test public void synchronizeMailboxSynchronous_withOneMessageInRemoteFolder_shouldFinishWithoutError() throws Exception { messageCountInRemoteFolder(1); controller.synchronizeMailboxSynchronous(account, FOLDER_ID, FOLDER_NAME, listener, remoteFolder); verify(listener).synchronizeMailboxFinished(account, FOLDER_ID, FOL...
@VisibleForTesting void synchronizeMailboxSynchronous(final Account account, final String folderId, final String folderName, final MessagingListener listener, Folder providedRemoteFolder) { Folder remoteFolder = null; LocalFolder tLocalFolder = null; Timber.i("Synchronizing folder %s:%s", account.getDescription(), fold...
MessagingController { @VisibleForTesting void synchronizeMailboxSynchronous(final Account account, final String folderId, final String folderName, final MessagingListener listener, Folder providedRemoteFolder) { Folder remoteFolder = null; LocalFolder tLocalFolder = null; Timber.i("Synchronizing folder %s:%s", account....
MessagingController { @VisibleForTesting void synchronizeMailboxSynchronous(final Account account, final String folderId, final String folderName, final MessagingListener listener, Folder providedRemoteFolder) { Folder remoteFolder = null; LocalFolder tLocalFolder = null; Timber.i("Synchronizing folder %s:%s", account....
MessagingController { @VisibleForTesting void synchronizeMailboxSynchronous(final Account account, final String folderId, final String folderName, final MessagingListener listener, Folder providedRemoteFolder) { Folder remoteFolder = null; LocalFolder tLocalFolder = null; Timber.i("Synchronizing folder %s:%s", account....
MessagingController { @VisibleForTesting void synchronizeMailboxSynchronous(final Account account, final String folderId, final String folderName, final MessagingListener listener, Folder providedRemoteFolder) { Folder remoteFolder = null; LocalFolder tLocalFolder = null; Timber.i("Synchronizing folder %s:%s", account....
@Test public void synchronizeMailboxSynchronous_withEmptyRemoteFolder_shouldFinishWithoutError() throws Exception { messageCountInRemoteFolder(0); controller.synchronizeMailboxSynchronous(account, FOLDER_ID, FOLDER_NAME, listener, remoteFolder); verify(listener).synchronizeMailboxFinished(account, FOLDER_ID, FOLDER_NAM...
@VisibleForTesting void synchronizeMailboxSynchronous(final Account account, final String folderId, final String folderName, final MessagingListener listener, Folder providedRemoteFolder) { Folder remoteFolder = null; LocalFolder tLocalFolder = null; Timber.i("Synchronizing folder %s:%s", account.getDescription(), fold...
MessagingController { @VisibleForTesting void synchronizeMailboxSynchronous(final Account account, final String folderId, final String folderName, final MessagingListener listener, Folder providedRemoteFolder) { Folder remoteFolder = null; LocalFolder tLocalFolder = null; Timber.i("Synchronizing folder %s:%s", account....
MessagingController { @VisibleForTesting void synchronizeMailboxSynchronous(final Account account, final String folderId, final String folderName, final MessagingListener listener, Folder providedRemoteFolder) { Folder remoteFolder = null; LocalFolder tLocalFolder = null; Timber.i("Synchronizing folder %s:%s", account....
MessagingController { @VisibleForTesting void synchronizeMailboxSynchronous(final Account account, final String folderId, final String folderName, final MessagingListener listener, Folder providedRemoteFolder) { Folder remoteFolder = null; LocalFolder tLocalFolder = null; Timber.i("Synchronizing folder %s:%s", account....
MessagingController { @VisibleForTesting void synchronizeMailboxSynchronous(final Account account, final String folderId, final String folderName, final MessagingListener listener, Folder providedRemoteFolder) { Folder remoteFolder = null; LocalFolder tLocalFolder = null; Timber.i("Synchronizing folder %s:%s", account....
@Test public void synchronizeMailboxSynchronous_withNegativeMessageCountInRemoteFolder_shouldFinishWithError() throws Exception { messageCountInRemoteFolder(-1); controller.synchronizeMailboxSynchronous(account, FOLDER_ID, FOLDER_NAME, listener, remoteFolder); verify(listener).synchronizeMailboxFailed(account, FOLDER_I...
@VisibleForTesting void synchronizeMailboxSynchronous(final Account account, final String folderId, final String folderName, final MessagingListener listener, Folder providedRemoteFolder) { Folder remoteFolder = null; LocalFolder tLocalFolder = null; Timber.i("Synchronizing folder %s:%s", account.getDescription(), fold...
MessagingController { @VisibleForTesting void synchronizeMailboxSynchronous(final Account account, final String folderId, final String folderName, final MessagingListener listener, Folder providedRemoteFolder) { Folder remoteFolder = null; LocalFolder tLocalFolder = null; Timber.i("Synchronizing folder %s:%s", account....
MessagingController { @VisibleForTesting void synchronizeMailboxSynchronous(final Account account, final String folderId, final String folderName, final MessagingListener listener, Folder providedRemoteFolder) { Folder remoteFolder = null; LocalFolder tLocalFolder = null; Timber.i("Synchronizing folder %s:%s", account....
MessagingController { @VisibleForTesting void synchronizeMailboxSynchronous(final Account account, final String folderId, final String folderName, final MessagingListener listener, Folder providedRemoteFolder) { Folder remoteFolder = null; LocalFolder tLocalFolder = null; Timber.i("Synchronizing folder %s:%s", account....
MessagingController { @VisibleForTesting void synchronizeMailboxSynchronous(final Account account, final String folderId, final String folderName, final MessagingListener listener, Folder providedRemoteFolder) { Folder remoteFolder = null; LocalFolder tLocalFolder = null; Timber.i("Synchronizing folder %s:%s", account....
@Test public void synchronizeMailboxSynchronous_withRemoteFolderProvided_shouldNotOpenRemoteFolder() throws Exception { messageCountInRemoteFolder(1); controller.synchronizeMailboxSynchronous(account, FOLDER_ID, FOLDER_NAME, listener, remoteFolder); verify(remoteFolder, never()).open(Folder.OPEN_MODE_RW); }
@VisibleForTesting void synchronizeMailboxSynchronous(final Account account, final String folderId, final String folderName, final MessagingListener listener, Folder providedRemoteFolder) { Folder remoteFolder = null; LocalFolder tLocalFolder = null; Timber.i("Synchronizing folder %s:%s", account.getDescription(), fold...
MessagingController { @VisibleForTesting void synchronizeMailboxSynchronous(final Account account, final String folderId, final String folderName, final MessagingListener listener, Folder providedRemoteFolder) { Folder remoteFolder = null; LocalFolder tLocalFolder = null; Timber.i("Synchronizing folder %s:%s", account....
MessagingController { @VisibleForTesting void synchronizeMailboxSynchronous(final Account account, final String folderId, final String folderName, final MessagingListener listener, Folder providedRemoteFolder) { Folder remoteFolder = null; LocalFolder tLocalFolder = null; Timber.i("Synchronizing folder %s:%s", account....
MessagingController { @VisibleForTesting void synchronizeMailboxSynchronous(final Account account, final String folderId, final String folderName, final MessagingListener listener, Folder providedRemoteFolder) { Folder remoteFolder = null; LocalFolder tLocalFolder = null; Timber.i("Synchronizing folder %s:%s", account....
MessagingController { @VisibleForTesting void synchronizeMailboxSynchronous(final Account account, final String folderId, final String folderName, final MessagingListener listener, Folder providedRemoteFolder) { Folder remoteFolder = null; LocalFolder tLocalFolder = null; Timber.i("Synchronizing folder %s:%s", account....
@Test public void synchronizeMailboxSynchronous_withNoRemoteFolderProvided_shouldOpenRemoteFolderFromStore() throws Exception { messageCountInRemoteFolder(1); configureRemoteStoreWithFolder(); controller.synchronizeMailboxSynchronous(account, FOLDER_ID, FOLDER_NAME, listener, null); verify(remoteFolder).open(Folder.OPE...
@VisibleForTesting void synchronizeMailboxSynchronous(final Account account, final String folderId, final String folderName, final MessagingListener listener, Folder providedRemoteFolder) { Folder remoteFolder = null; LocalFolder tLocalFolder = null; Timber.i("Synchronizing folder %s:%s", account.getDescription(), fold...
MessagingController { @VisibleForTesting void synchronizeMailboxSynchronous(final Account account, final String folderId, final String folderName, final MessagingListener listener, Folder providedRemoteFolder) { Folder remoteFolder = null; LocalFolder tLocalFolder = null; Timber.i("Synchronizing folder %s:%s", account....
MessagingController { @VisibleForTesting void synchronizeMailboxSynchronous(final Account account, final String folderId, final String folderName, final MessagingListener listener, Folder providedRemoteFolder) { Folder remoteFolder = null; LocalFolder tLocalFolder = null; Timber.i("Synchronizing folder %s:%s", account....
MessagingController { @VisibleForTesting void synchronizeMailboxSynchronous(final Account account, final String folderId, final String folderName, final MessagingListener listener, Folder providedRemoteFolder) { Folder remoteFolder = null; LocalFolder tLocalFolder = null; Timber.i("Synchronizing folder %s:%s", account....
MessagingController { @VisibleForTesting void synchronizeMailboxSynchronous(final Account account, final String folderId, final String folderName, final MessagingListener listener, Folder providedRemoteFolder) { Folder remoteFolder = null; LocalFolder tLocalFolder = null; Timber.i("Synchronizing folder %s:%s", account....
@Test public void isPartPgpInlineEncrypted__withSignedData__shouldReturnFalse() throws Exception { String pgpInlineData = "-----BEGIN PGP SIGNED MESSAGE-----\n" + "Header: Value\n" + "\n" + "-----BEGIN PGP SIGNATURE-----\n" + "Header: Value\n" + "\n" + "base64base64base64base64\n" + "-----END PGP SIGNED MESSAGE-----\n"...
public static boolean isPartPgpInlineEncrypted(@Nullable Part part) { if (part == null) { return false; } if (!part.isMimeType(TEXT_PLAIN) && !part.isMimeType(APPLICATION_PGP)) { return false; } String text = MessageExtractor.getTextFromPart(part, TEXT_LENGTH_FOR_INLINE_CHECK); if (TextUtils.isEmpty(text)) { return fal...
MessageDecryptVerifier { public static boolean isPartPgpInlineEncrypted(@Nullable Part part) { if (part == null) { return false; } if (!part.isMimeType(TEXT_PLAIN) && !part.isMimeType(APPLICATION_PGP)) { return false; } String text = MessageExtractor.getTextFromPart(part, TEXT_LENGTH_FOR_INLINE_CHECK); if (TextUtils.is...
MessageDecryptVerifier { public static boolean isPartPgpInlineEncrypted(@Nullable Part part) { if (part == null) { return false; } if (!part.isMimeType(TEXT_PLAIN) && !part.isMimeType(APPLICATION_PGP)) { return false; } String text = MessageExtractor.getTextFromPart(part, TEXT_LENGTH_FOR_INLINE_CHECK); if (TextUtils.is...
MessageDecryptVerifier { public static boolean isPartPgpInlineEncrypted(@Nullable Part part) { if (part == null) { return false; } if (!part.isMimeType(TEXT_PLAIN) && !part.isMimeType(APPLICATION_PGP)) { return false; } String text = MessageExtractor.getTextFromPart(part, TEXT_LENGTH_FOR_INLINE_CHECK); if (TextUtils.is...
MessageDecryptVerifier { public static boolean isPartPgpInlineEncrypted(@Nullable Part part) { if (part == null) { return false; } if (!part.isMimeType(TEXT_PLAIN) && !part.isMimeType(APPLICATION_PGP)) { return false; } String text = MessageExtractor.getTextFromPart(part, TEXT_LENGTH_FOR_INLINE_CHECK); if (TextUtils.is...
@Test public void synchronizeMailboxSynchronous_withRemoteFolderProvided_shouldNotCloseRemoteFolder() throws Exception { messageCountInRemoteFolder(1); controller.synchronizeMailboxSynchronous(account, FOLDER_ID, FOLDER_NAME, listener, remoteFolder); verify(remoteFolder, never()).close(); }
@VisibleForTesting void synchronizeMailboxSynchronous(final Account account, final String folderId, final String folderName, final MessagingListener listener, Folder providedRemoteFolder) { Folder remoteFolder = null; LocalFolder tLocalFolder = null; Timber.i("Synchronizing folder %s:%s", account.getDescription(), fold...
MessagingController { @VisibleForTesting void synchronizeMailboxSynchronous(final Account account, final String folderId, final String folderName, final MessagingListener listener, Folder providedRemoteFolder) { Folder remoteFolder = null; LocalFolder tLocalFolder = null; Timber.i("Synchronizing folder %s:%s", account....
MessagingController { @VisibleForTesting void synchronizeMailboxSynchronous(final Account account, final String folderId, final String folderName, final MessagingListener listener, Folder providedRemoteFolder) { Folder remoteFolder = null; LocalFolder tLocalFolder = null; Timber.i("Synchronizing folder %s:%s", account....
MessagingController { @VisibleForTesting void synchronizeMailboxSynchronous(final Account account, final String folderId, final String folderName, final MessagingListener listener, Folder providedRemoteFolder) { Folder remoteFolder = null; LocalFolder tLocalFolder = null; Timber.i("Synchronizing folder %s:%s", account....
MessagingController { @VisibleForTesting void synchronizeMailboxSynchronous(final Account account, final String folderId, final String folderName, final MessagingListener listener, Folder providedRemoteFolder) { Folder remoteFolder = null; LocalFolder tLocalFolder = null; Timber.i("Synchronizing folder %s:%s", account....
@Test public void synchronizeMailboxSynchronous_withNoRemoteFolderProvided_shouldCloseRemoteFolderFromStore() throws Exception { messageCountInRemoteFolder(1); configureRemoteStoreWithFolder(); controller.synchronizeMailboxSynchronous(account, FOLDER_ID, FOLDER_NAME, listener, null); verify(remoteFolder).close(); }
@VisibleForTesting void synchronizeMailboxSynchronous(final Account account, final String folderId, final String folderName, final MessagingListener listener, Folder providedRemoteFolder) { Folder remoteFolder = null; LocalFolder tLocalFolder = null; Timber.i("Synchronizing folder %s:%s", account.getDescription(), fold...
MessagingController { @VisibleForTesting void synchronizeMailboxSynchronous(final Account account, final String folderId, final String folderName, final MessagingListener listener, Folder providedRemoteFolder) { Folder remoteFolder = null; LocalFolder tLocalFolder = null; Timber.i("Synchronizing folder %s:%s", account....
MessagingController { @VisibleForTesting void synchronizeMailboxSynchronous(final Account account, final String folderId, final String folderName, final MessagingListener listener, Folder providedRemoteFolder) { Folder remoteFolder = null; LocalFolder tLocalFolder = null; Timber.i("Synchronizing folder %s:%s", account....
MessagingController { @VisibleForTesting void synchronizeMailboxSynchronous(final Account account, final String folderId, final String folderName, final MessagingListener listener, Folder providedRemoteFolder) { Folder remoteFolder = null; LocalFolder tLocalFolder = null; Timber.i("Synchronizing folder %s:%s", account....
MessagingController { @VisibleForTesting void synchronizeMailboxSynchronous(final Account account, final String folderId, final String folderName, final MessagingListener listener, Folder providedRemoteFolder) { Folder remoteFolder = null; LocalFolder tLocalFolder = null; Timber.i("Synchronizing folder %s:%s", account....
@Test public void synchronizeMailboxSynchronous_withAccountSetToSyncRemoteDeletions_shouldDeleteLocalCopiesOfDeletedMessages() throws Exception { messageCountInRemoteFolder(0); LocalMessage localCopyOfRemoteDeletedMessage = mock(LocalMessage.class); when(account.syncRemoteDeletions()).thenReturn(true); when(localFolder...
@VisibleForTesting void synchronizeMailboxSynchronous(final Account account, final String folderId, final String folderName, final MessagingListener listener, Folder providedRemoteFolder) { Folder remoteFolder = null; LocalFolder tLocalFolder = null; Timber.i("Synchronizing folder %s:%s", account.getDescription(), fold...
MessagingController { @VisibleForTesting void synchronizeMailboxSynchronous(final Account account, final String folderId, final String folderName, final MessagingListener listener, Folder providedRemoteFolder) { Folder remoteFolder = null; LocalFolder tLocalFolder = null; Timber.i("Synchronizing folder %s:%s", account....
MessagingController { @VisibleForTesting void synchronizeMailboxSynchronous(final Account account, final String folderId, final String folderName, final MessagingListener listener, Folder providedRemoteFolder) { Folder remoteFolder = null; LocalFolder tLocalFolder = null; Timber.i("Synchronizing folder %s:%s", account....
MessagingController { @VisibleForTesting void synchronizeMailboxSynchronous(final Account account, final String folderId, final String folderName, final MessagingListener listener, Folder providedRemoteFolder) { Folder remoteFolder = null; LocalFolder tLocalFolder = null; Timber.i("Synchronizing folder %s:%s", account....
MessagingController { @VisibleForTesting void synchronizeMailboxSynchronous(final Account account, final String folderId, final String folderName, final MessagingListener listener, Folder providedRemoteFolder) { Folder remoteFolder = null; LocalFolder tLocalFolder = null; Timber.i("Synchronizing folder %s:%s", account....
@Test public void synchronizeMailboxSynchronous_withAccountSetToSyncRemoteDeletions_shouldNotDeleteLocalCopiesOfExistingMessagesAfterEarliestPollDate() throws Exception { messageCountInRemoteFolder(1); Date dateOfEarliestPoll = new Date(); LocalMessage localMessage = localMessageWithCopyOnServer(); when(account.syncRem...
@VisibleForTesting void synchronizeMailboxSynchronous(final Account account, final String folderId, final String folderName, final MessagingListener listener, Folder providedRemoteFolder) { Folder remoteFolder = null; LocalFolder tLocalFolder = null; Timber.i("Synchronizing folder %s:%s", account.getDescription(), fold...
MessagingController { @VisibleForTesting void synchronizeMailboxSynchronous(final Account account, final String folderId, final String folderName, final MessagingListener listener, Folder providedRemoteFolder) { Folder remoteFolder = null; LocalFolder tLocalFolder = null; Timber.i("Synchronizing folder %s:%s", account....
MessagingController { @VisibleForTesting void synchronizeMailboxSynchronous(final Account account, final String folderId, final String folderName, final MessagingListener listener, Folder providedRemoteFolder) { Folder remoteFolder = null; LocalFolder tLocalFolder = null; Timber.i("Synchronizing folder %s:%s", account....
MessagingController { @VisibleForTesting void synchronizeMailboxSynchronous(final Account account, final String folderId, final String folderName, final MessagingListener listener, Folder providedRemoteFolder) { Folder remoteFolder = null; LocalFolder tLocalFolder = null; Timber.i("Synchronizing folder %s:%s", account....
MessagingController { @VisibleForTesting void synchronizeMailboxSynchronous(final Account account, final String folderId, final String folderName, final MessagingListener listener, Folder providedRemoteFolder) { Folder remoteFolder = null; LocalFolder tLocalFolder = null; Timber.i("Synchronizing folder %s:%s", account....
@Test public void synchronizeMailboxSynchronous_withAccountSetToSyncRemoteDeletions_shouldDeleteLocalCopiesOfExistingMessagesBeforeEarliestPollDate() throws Exception { messageCountInRemoteFolder(1); LocalMessage localMessage = localMessageWithCopyOnServer(); Date dateOfEarliestPoll = new Date(); when(account.syncRemot...
@VisibleForTesting void synchronizeMailboxSynchronous(final Account account, final String folderId, final String folderName, final MessagingListener listener, Folder providedRemoteFolder) { Folder remoteFolder = null; LocalFolder tLocalFolder = null; Timber.i("Synchronizing folder %s:%s", account.getDescription(), fold...
MessagingController { @VisibleForTesting void synchronizeMailboxSynchronous(final Account account, final String folderId, final String folderName, final MessagingListener listener, Folder providedRemoteFolder) { Folder remoteFolder = null; LocalFolder tLocalFolder = null; Timber.i("Synchronizing folder %s:%s", account....
MessagingController { @VisibleForTesting void synchronizeMailboxSynchronous(final Account account, final String folderId, final String folderName, final MessagingListener listener, Folder providedRemoteFolder) { Folder remoteFolder = null; LocalFolder tLocalFolder = null; Timber.i("Synchronizing folder %s:%s", account....
MessagingController { @VisibleForTesting void synchronizeMailboxSynchronous(final Account account, final String folderId, final String folderName, final MessagingListener listener, Folder providedRemoteFolder) { Folder remoteFolder = null; LocalFolder tLocalFolder = null; Timber.i("Synchronizing folder %s:%s", account....
MessagingController { @VisibleForTesting void synchronizeMailboxSynchronous(final Account account, final String folderId, final String folderName, final MessagingListener listener, Folder providedRemoteFolder) { Folder remoteFolder = null; LocalFolder tLocalFolder = null; Timber.i("Synchronizing folder %s:%s", account....
@Test public void synchronizeMailboxSynchronous_withAccountSetNotToSyncRemoteDeletions_shouldNotDeleteLocalCopiesOfMessages() throws Exception { messageCountInRemoteFolder(0); LocalMessage remoteDeletedMessage = mock(LocalMessage.class); when(account.syncRemoteDeletions()).thenReturn(false); when(localFolder.getMessage...
@VisibleForTesting void synchronizeMailboxSynchronous(final Account account, final String folderId, final String folderName, final MessagingListener listener, Folder providedRemoteFolder) { Folder remoteFolder = null; LocalFolder tLocalFolder = null; Timber.i("Synchronizing folder %s:%s", account.getDescription(), fold...
MessagingController { @VisibleForTesting void synchronizeMailboxSynchronous(final Account account, final String folderId, final String folderName, final MessagingListener listener, Folder providedRemoteFolder) { Folder remoteFolder = null; LocalFolder tLocalFolder = null; Timber.i("Synchronizing folder %s:%s", account....
MessagingController { @VisibleForTesting void synchronizeMailboxSynchronous(final Account account, final String folderId, final String folderName, final MessagingListener listener, Folder providedRemoteFolder) { Folder remoteFolder = null; LocalFolder tLocalFolder = null; Timber.i("Synchronizing folder %s:%s", account....
MessagingController { @VisibleForTesting void synchronizeMailboxSynchronous(final Account account, final String folderId, final String folderName, final MessagingListener listener, Folder providedRemoteFolder) { Folder remoteFolder = null; LocalFolder tLocalFolder = null; Timber.i("Synchronizing folder %s:%s", account....
MessagingController { @VisibleForTesting void synchronizeMailboxSynchronous(final Account account, final String folderId, final String folderName, final MessagingListener listener, Folder providedRemoteFolder) { Folder remoteFolder = null; LocalFolder tLocalFolder = null; Timber.i("Synchronizing folder %s:%s", account....
@Test public void synchronizeMailboxSynchronous_withAccountSupportingFetchingFlags_shouldFetchUnsychronizedMessagesListAndFlags() throws Exception { messageCountInRemoteFolder(1); hasUnsyncedRemoteMessage(); when(remoteFolder.supportsFetchingFlags()).thenReturn(true); controller.synchronizeMailboxSynchronous(account, F...
@VisibleForTesting void synchronizeMailboxSynchronous(final Account account, final String folderId, final String folderName, final MessagingListener listener, Folder providedRemoteFolder) { Folder remoteFolder = null; LocalFolder tLocalFolder = null; Timber.i("Synchronizing folder %s:%s", account.getDescription(), fold...
MessagingController { @VisibleForTesting void synchronizeMailboxSynchronous(final Account account, final String folderId, final String folderName, final MessagingListener listener, Folder providedRemoteFolder) { Folder remoteFolder = null; LocalFolder tLocalFolder = null; Timber.i("Synchronizing folder %s:%s", account....
MessagingController { @VisibleForTesting void synchronizeMailboxSynchronous(final Account account, final String folderId, final String folderName, final MessagingListener listener, Folder providedRemoteFolder) { Folder remoteFolder = null; LocalFolder tLocalFolder = null; Timber.i("Synchronizing folder %s:%s", account....
MessagingController { @VisibleForTesting void synchronizeMailboxSynchronous(final Account account, final String folderId, final String folderName, final MessagingListener listener, Folder providedRemoteFolder) { Folder remoteFolder = null; LocalFolder tLocalFolder = null; Timber.i("Synchronizing folder %s:%s", account....
MessagingController { @VisibleForTesting void synchronizeMailboxSynchronous(final Account account, final String folderId, final String folderName, final MessagingListener listener, Folder providedRemoteFolder) { Folder remoteFolder = null; LocalFolder tLocalFolder = null; Timber.i("Synchronizing folder %s:%s", account....
@Test public void synchronizeMailboxSynchronous_withAccountNotSupportingFetchingFlags_shouldFetchUnsychronizedMessages() throws Exception { messageCountInRemoteFolder(1); hasUnsyncedRemoteMessage(); when(remoteFolder.supportsFetchingFlags()).thenReturn(false); controller.synchronizeMailboxSynchronous(account, FOLDER_ID...
@VisibleForTesting void synchronizeMailboxSynchronous(final Account account, final String folderId, final String folderName, final MessagingListener listener, Folder providedRemoteFolder) { Folder remoteFolder = null; LocalFolder tLocalFolder = null; Timber.i("Synchronizing folder %s:%s", account.getDescription(), fold...
MessagingController { @VisibleForTesting void synchronizeMailboxSynchronous(final Account account, final String folderId, final String folderName, final MessagingListener listener, Folder providedRemoteFolder) { Folder remoteFolder = null; LocalFolder tLocalFolder = null; Timber.i("Synchronizing folder %s:%s", account....
MessagingController { @VisibleForTesting void synchronizeMailboxSynchronous(final Account account, final String folderId, final String folderName, final MessagingListener listener, Folder providedRemoteFolder) { Folder remoteFolder = null; LocalFolder tLocalFolder = null; Timber.i("Synchronizing folder %s:%s", account....
MessagingController { @VisibleForTesting void synchronizeMailboxSynchronous(final Account account, final String folderId, final String folderName, final MessagingListener listener, Folder providedRemoteFolder) { Folder remoteFolder = null; LocalFolder tLocalFolder = null; Timber.i("Synchronizing folder %s:%s", account....
MessagingController { @VisibleForTesting void synchronizeMailboxSynchronous(final Account account, final String folderId, final String folderName, final MessagingListener listener, Folder providedRemoteFolder) { Folder remoteFolder = null; LocalFolder tLocalFolder = null; Timber.i("Synchronizing folder %s:%s", account....
@Test public void synchronizeMailboxSynchronous_withUnsyncedNewSmallMessage_shouldFetchBodyOfSmallMessage() throws Exception { Message smallMessage = buildSmallNewMessage(); messageCountInRemoteFolder(1); hasUnsyncedRemoteMessage(); when(remoteFolder.supportsFetchingFlags()).thenReturn(false); respondToFetchEnvelopesWi...
@VisibleForTesting void synchronizeMailboxSynchronous(final Account account, final String folderId, final String folderName, final MessagingListener listener, Folder providedRemoteFolder) { Folder remoteFolder = null; LocalFolder tLocalFolder = null; Timber.i("Synchronizing folder %s:%s", account.getDescription(), fold...
MessagingController { @VisibleForTesting void synchronizeMailboxSynchronous(final Account account, final String folderId, final String folderName, final MessagingListener listener, Folder providedRemoteFolder) { Folder remoteFolder = null; LocalFolder tLocalFolder = null; Timber.i("Synchronizing folder %s:%s", account....
MessagingController { @VisibleForTesting void synchronizeMailboxSynchronous(final Account account, final String folderId, final String folderName, final MessagingListener listener, Folder providedRemoteFolder) { Folder remoteFolder = null; LocalFolder tLocalFolder = null; Timber.i("Synchronizing folder %s:%s", account....
MessagingController { @VisibleForTesting void synchronizeMailboxSynchronous(final Account account, final String folderId, final String folderName, final MessagingListener listener, Folder providedRemoteFolder) { Folder remoteFolder = null; LocalFolder tLocalFolder = null; Timber.i("Synchronizing folder %s:%s", account....
MessagingController { @VisibleForTesting void synchronizeMailboxSynchronous(final Account account, final String folderId, final String folderName, final MessagingListener listener, Folder providedRemoteFolder) { Folder remoteFolder = null; LocalFolder tLocalFolder = null; Timber.i("Synchronizing folder %s:%s", account....
@Test public void synchronizeMailboxSynchronous_withUnsyncedNewSmallMessage_shouldFetchStructureAndLimitedBodyOfLargeMessage() throws Exception { Message largeMessage = buildLargeNewMessage(); messageCountInRemoteFolder(1); hasUnsyncedRemoteMessage(); when(remoteFolder.supportsFetchingFlags()).thenReturn(false); respon...
@VisibleForTesting void synchronizeMailboxSynchronous(final Account account, final String folderId, final String folderName, final MessagingListener listener, Folder providedRemoteFolder) { Folder remoteFolder = null; LocalFolder tLocalFolder = null; Timber.i("Synchronizing folder %s:%s", account.getDescription(), fold...
MessagingController { @VisibleForTesting void synchronizeMailboxSynchronous(final Account account, final String folderId, final String folderName, final MessagingListener listener, Folder providedRemoteFolder) { Folder remoteFolder = null; LocalFolder tLocalFolder = null; Timber.i("Synchronizing folder %s:%s", account....
MessagingController { @VisibleForTesting void synchronizeMailboxSynchronous(final Account account, final String folderId, final String folderName, final MessagingListener listener, Folder providedRemoteFolder) { Folder remoteFolder = null; LocalFolder tLocalFolder = null; Timber.i("Synchronizing folder %s:%s", account....
MessagingController { @VisibleForTesting void synchronizeMailboxSynchronous(final Account account, final String folderId, final String folderName, final MessagingListener listener, Folder providedRemoteFolder) { Folder remoteFolder = null; LocalFolder tLocalFolder = null; Timber.i("Synchronizing folder %s:%s", account....
MessagingController { @VisibleForTesting void synchronizeMailboxSynchronous(final Account account, final String folderId, final String folderName, final MessagingListener listener, Folder providedRemoteFolder) { Folder remoteFolder = null; LocalFolder tLocalFolder = null; Timber.i("Synchronizing folder %s:%s", account....
@Test public void findPrimaryCryptoPart_withSimplePgpInline() throws Exception { List<Part> outputExtraParts = new ArrayList<>(); Message message = new MimeMessage(); MimeMessageHelper.setBody(message, new TextBody(PGP_INLINE_DATA)); Part cryptoPart = MessageCryptoStructureDetector.findPrimaryEncryptedOrSignedPart(mess...
public static Part findPrimaryEncryptedOrSignedPart(Part part, List<Part> outputExtraParts) { if (isPartEncryptedOrSigned(part)) { return part; } Part foundPart; foundPart = findPrimaryPartInAlternative(part); if (foundPart != null) { return foundPart; } foundPart = findPrimaryPartInMixed(part, outputExtraParts); if (f...
MessageCryptoStructureDetector { public static Part findPrimaryEncryptedOrSignedPart(Part part, List<Part> outputExtraParts) { if (isPartEncryptedOrSigned(part)) { return part; } Part foundPart; foundPart = findPrimaryPartInAlternative(part); if (foundPart != null) { return foundPart; } foundPart = findPrimaryPartInMix...
MessageCryptoStructureDetector { public static Part findPrimaryEncryptedOrSignedPart(Part part, List<Part> outputExtraParts) { if (isPartEncryptedOrSigned(part)) { return part; } Part foundPart; foundPart = findPrimaryPartInAlternative(part); if (foundPart != null) { return foundPart; } foundPart = findPrimaryPartInMix...
MessageCryptoStructureDetector { public static Part findPrimaryEncryptedOrSignedPart(Part part, List<Part> outputExtraParts) { if (isPartEncryptedOrSigned(part)) { return part; } Part foundPart; foundPart = findPrimaryPartInAlternative(part); if (foundPart != null) { return foundPart; } foundPart = findPrimaryPartInMix...
MessageCryptoStructureDetector { public static Part findPrimaryEncryptedOrSignedPart(Part part, List<Part> outputExtraParts) { if (isPartEncryptedOrSigned(part)) { return part; } Part foundPart; foundPart = findPrimaryPartInAlternative(part); if (foundPart != null) { return foundPart; } foundPart = findPrimaryPartInMix...
@Test public void withShortData__getLength__shouldReturnWrittenLength() throws Exception { writeShortTestData(); assertNull(createdFile); assertEquals(TEST_DATA_SHORT.length, deferredFileBody.getSize()); }
@Override public long getSize() { if (file != null) { return file.length(); } if (data != null) { return data.length; } throw new IllegalStateException("Data must be fully written before it can be read!"); }
DeferredFileBody implements RawDataBody, SizeAware { @Override public long getSize() { if (file != null) { return file.length(); } if (data != null) { return data.length; } throw new IllegalStateException("Data must be fully written before it can be read!"); } }
DeferredFileBody implements RawDataBody, SizeAware { @Override public long getSize() { if (file != null) { return file.length(); } if (data != null) { return data.length; } throw new IllegalStateException("Data must be fully written before it can be read!"); } DeferredFileBody(FileFactory fileFactory, String transferEn...
DeferredFileBody implements RawDataBody, SizeAware { @Override public long getSize() { if (file != null) { return file.length(); } if (data != null) { return data.length; } throw new IllegalStateException("Data must be fully written before it can be read!"); } DeferredFileBody(FileFactory fileFactory, String transferEn...
DeferredFileBody implements RawDataBody, SizeAware { @Override public long getSize() { if (file != null) { return file.length(); } if (data != null) { return data.length; } throw new IllegalStateException("Data must be fully written before it can be read!"); } DeferredFileBody(FileFactory fileFactory, String transferEn...
@Test public void withLongData__getLength__shouldReturnWrittenLength() throws Exception { writeLongTestData(); assertNotNull(createdFile); assertEquals(TEST_DATA_LONG.length, deferredFileBody.getSize()); }
@Override public long getSize() { if (file != null) { return file.length(); } if (data != null) { return data.length; } throw new IllegalStateException("Data must be fully written before it can be read!"); }
DeferredFileBody implements RawDataBody, SizeAware { @Override public long getSize() { if (file != null) { return file.length(); } if (data != null) { return data.length; } throw new IllegalStateException("Data must be fully written before it can be read!"); } }
DeferredFileBody implements RawDataBody, SizeAware { @Override public long getSize() { if (file != null) { return file.length(); } if (data != null) { return data.length; } throw new IllegalStateException("Data must be fully written before it can be read!"); } DeferredFileBody(FileFactory fileFactory, String transferEn...
DeferredFileBody implements RawDataBody, SizeAware { @Override public long getSize() { if (file != null) { return file.length(); } if (data != null) { return data.length; } throw new IllegalStateException("Data must be fully written before it can be read!"); } DeferredFileBody(FileFactory fileFactory, String transferEn...
DeferredFileBody implements RawDataBody, SizeAware { @Override public long getSize() { if (file != null) { return file.length(); } if (data != null) { return data.length; } throw new IllegalStateException("Data must be fully written before it can be read!"); } DeferredFileBody(FileFactory fileFactory, String transferEn...
@Test public void withShortData__shouldReturnData() throws Exception { writeShortTestData(); InputStream inputStream = deferredFileBody.getInputStream(); byte[] data = IOUtils.toByteArray(inputStream); assertNull(createdFile); assertArrayEquals(TEST_DATA_SHORT, data); }
@Override public InputStream getInputStream() throws MessagingException { try { if (file != null) { Timber.d("Decrypted data is file-backed."); return new BufferedInputStream(new FileInputStream(file)); } if (data != null) { Timber.d("Decrypted data is memory-backed."); return new ByteArrayInputStream(data); } throw ne...
DeferredFileBody implements RawDataBody, SizeAware { @Override public InputStream getInputStream() throws MessagingException { try { if (file != null) { Timber.d("Decrypted data is file-backed."); return new BufferedInputStream(new FileInputStream(file)); } if (data != null) { Timber.d("Decrypted data is memory-backed....
DeferredFileBody implements RawDataBody, SizeAware { @Override public InputStream getInputStream() throws MessagingException { try { if (file != null) { Timber.d("Decrypted data is file-backed."); return new BufferedInputStream(new FileInputStream(file)); } if (data != null) { Timber.d("Decrypted data is memory-backed....
DeferredFileBody implements RawDataBody, SizeAware { @Override public InputStream getInputStream() throws MessagingException { try { if (file != null) { Timber.d("Decrypted data is file-backed."); return new BufferedInputStream(new FileInputStream(file)); } if (data != null) { Timber.d("Decrypted data is memory-backed....
DeferredFileBody implements RawDataBody, SizeAware { @Override public InputStream getInputStream() throws MessagingException { try { if (file != null) { Timber.d("Decrypted data is file-backed."); return new BufferedInputStream(new FileInputStream(file)); } if (data != null) { Timber.d("Decrypted data is memory-backed....
@Test public void withLongData__shouldReturnData() throws Exception { writeLongTestData(); InputStream inputStream = deferredFileBody.getInputStream(); byte[] data = IOUtils.toByteArray(inputStream); InputStream fileInputStream = new FileInputStream(createdFile); byte[] dataFromFile = IOUtils.toByteArray(fileInputStrea...
@Override public InputStream getInputStream() throws MessagingException { try { if (file != null) { Timber.d("Decrypted data is file-backed."); return new BufferedInputStream(new FileInputStream(file)); } if (data != null) { Timber.d("Decrypted data is memory-backed."); return new ByteArrayInputStream(data); } throw ne...
DeferredFileBody implements RawDataBody, SizeAware { @Override public InputStream getInputStream() throws MessagingException { try { if (file != null) { Timber.d("Decrypted data is file-backed."); return new BufferedInputStream(new FileInputStream(file)); } if (data != null) { Timber.d("Decrypted data is memory-backed....
DeferredFileBody implements RawDataBody, SizeAware { @Override public InputStream getInputStream() throws MessagingException { try { if (file != null) { Timber.d("Decrypted data is file-backed."); return new BufferedInputStream(new FileInputStream(file)); } if (data != null) { Timber.d("Decrypted data is memory-backed....
DeferredFileBody implements RawDataBody, SizeAware { @Override public InputStream getInputStream() throws MessagingException { try { if (file != null) { Timber.d("Decrypted data is file-backed."); return new BufferedInputStream(new FileInputStream(file)); } if (data != null) { Timber.d("Decrypted data is memory-backed....
DeferredFileBody implements RawDataBody, SizeAware { @Override public InputStream getInputStream() throws MessagingException { try { if (file != null) { Timber.d("Decrypted data is file-backed."); return new BufferedInputStream(new FileInputStream(file)); } if (data != null) { Timber.d("Decrypted data is memory-backed....
@Test public void withShortData__getFile__shouldWriteDataToFile() throws Exception { writeShortTestData(); File returnedFile = deferredFileBody.getFile(); InputStream fileInputStream = new FileInputStream(returnedFile); byte[] dataFromFile = IOUtils.toByteArray(fileInputStream); assertSame(createdFile, returnedFile); a...
public File getFile() throws IOException { if (file == null) { writeMemoryToFile(); } return file; }
DeferredFileBody implements RawDataBody, SizeAware { public File getFile() throws IOException { if (file == null) { writeMemoryToFile(); } return file; } }
DeferredFileBody implements RawDataBody, SizeAware { public File getFile() throws IOException { if (file == null) { writeMemoryToFile(); } return file; } DeferredFileBody(FileFactory fileFactory, String transferEncoding); @VisibleForTesting DeferredFileBody(int memoryBackedThreshold, FileFactory fileFactory, ...
DeferredFileBody implements RawDataBody, SizeAware { public File getFile() throws IOException { if (file == null) { writeMemoryToFile(); } return file; } DeferredFileBody(FileFactory fileFactory, String transferEncoding); @VisibleForTesting DeferredFileBody(int memoryBackedThreshold, FileFactory fileFactory, ...
DeferredFileBody implements RawDataBody, SizeAware { public File getFile() throws IOException { if (file == null) { writeMemoryToFile(); } return file; } DeferredFileBody(FileFactory fileFactory, String transferEncoding); @VisibleForTesting DeferredFileBody(int memoryBackedThreshold, FileFactory fileFactory, ...
@Test public void withLongData__getFile__shouldReturnCreatedFile() throws Exception { writeLongTestData(); File returnedFile = deferredFileBody.getFile(); assertSame(createdFile, returnedFile); }
public File getFile() throws IOException { if (file == null) { writeMemoryToFile(); } return file; }
DeferredFileBody implements RawDataBody, SizeAware { public File getFile() throws IOException { if (file == null) { writeMemoryToFile(); } return file; } }
DeferredFileBody implements RawDataBody, SizeAware { public File getFile() throws IOException { if (file == null) { writeMemoryToFile(); } return file; } DeferredFileBody(FileFactory fileFactory, String transferEncoding); @VisibleForTesting DeferredFileBody(int memoryBackedThreshold, FileFactory fileFactory, ...
DeferredFileBody implements RawDataBody, SizeAware { public File getFile() throws IOException { if (file == null) { writeMemoryToFile(); } return file; } DeferredFileBody(FileFactory fileFactory, String transferEncoding); @VisibleForTesting DeferredFileBody(int memoryBackedThreshold, FileFactory fileFactory, ...
DeferredFileBody implements RawDataBody, SizeAware { public File getFile() throws IOException { if (file == null) { writeMemoryToFile(); } return file; } DeferredFileBody(FileFactory fileFactory, String transferEncoding); @VisibleForTesting DeferredFileBody(int memoryBackedThreshold, FileFactory fileFactory, ...
@Test public void withShortData__writeTo__shouldWriteData() throws Exception { writeShortTestData(); ByteArrayOutputStream baos = new ByteArrayOutputStream(); deferredFileBody.writeTo(baos); assertArrayEquals(TEST_DATA_SHORT, baos.toByteArray()); }
@Override public void writeTo(OutputStream out) throws IOException, MessagingException { InputStream inputStream = getInputStream(); IOUtils.copy(inputStream, out); }
DeferredFileBody implements RawDataBody, SizeAware { @Override public void writeTo(OutputStream out) throws IOException, MessagingException { InputStream inputStream = getInputStream(); IOUtils.copy(inputStream, out); } }
DeferredFileBody implements RawDataBody, SizeAware { @Override public void writeTo(OutputStream out) throws IOException, MessagingException { InputStream inputStream = getInputStream(); IOUtils.copy(inputStream, out); } DeferredFileBody(FileFactory fileFactory, String transferEncoding); @VisibleForTesting DeferredFile...
DeferredFileBody implements RawDataBody, SizeAware { @Override public void writeTo(OutputStream out) throws IOException, MessagingException { InputStream inputStream = getInputStream(); IOUtils.copy(inputStream, out); } DeferredFileBody(FileFactory fileFactory, String transferEncoding); @VisibleForTesting DeferredFile...
DeferredFileBody implements RawDataBody, SizeAware { @Override public void writeTo(OutputStream out) throws IOException, MessagingException { InputStream inputStream = getInputStream(); IOUtils.copy(inputStream, out); } DeferredFileBody(FileFactory fileFactory, String transferEncoding); @VisibleForTesting DeferredFile...
@Test(expected = UnsupportedOperationException.class) public void setEncoding__shouldThrow() throws Exception { deferredFileBody.setEncoding("anything"); }
@Override public void setEncoding(String encoding) throws MessagingException { throw new UnsupportedOperationException("Cannot re-encode a DecryptedTempFileBody!"); }
DeferredFileBody implements RawDataBody, SizeAware { @Override public void setEncoding(String encoding) throws MessagingException { throw new UnsupportedOperationException("Cannot re-encode a DecryptedTempFileBody!"); } }
DeferredFileBody implements RawDataBody, SizeAware { @Override public void setEncoding(String encoding) throws MessagingException { throw new UnsupportedOperationException("Cannot re-encode a DecryptedTempFileBody!"); } DeferredFileBody(FileFactory fileFactory, String transferEncoding); @VisibleForTesting DeferredFile...
DeferredFileBody implements RawDataBody, SizeAware { @Override public void setEncoding(String encoding) throws MessagingException { throw new UnsupportedOperationException("Cannot re-encode a DecryptedTempFileBody!"); } DeferredFileBody(FileFactory fileFactory, String transferEncoding); @VisibleForTesting DeferredFile...
DeferredFileBody implements RawDataBody, SizeAware { @Override public void setEncoding(String encoding) throws MessagingException { throw new UnsupportedOperationException("Cannot re-encode a DecryptedTempFileBody!"); } DeferredFileBody(FileFactory fileFactory, String transferEncoding); @VisibleForTesting DeferredFile...
@Test public void getEncoding__shouldReturnEncoding() throws Exception { assertEquals(TEST_ENCODING, deferredFileBody.getEncoding()); }
@Override public String getEncoding() { return encoding; }
DeferredFileBody implements RawDataBody, SizeAware { @Override public String getEncoding() { return encoding; } }
DeferredFileBody implements RawDataBody, SizeAware { @Override public String getEncoding() { return encoding; } DeferredFileBody(FileFactory fileFactory, String transferEncoding); @VisibleForTesting DeferredFileBody(int memoryBackedThreshold, FileFactory fileFactory, String transferEncoding); }
DeferredFileBody implements RawDataBody, SizeAware { @Override public String getEncoding() { return encoding; } DeferredFileBody(FileFactory fileFactory, String transferEncoding); @VisibleForTesting DeferredFileBody(int memoryBackedThreshold, FileFactory fileFactory, String transferEncoding); OutputStream ...
DeferredFileBody implements RawDataBody, SizeAware { @Override public String getEncoding() { return encoding; } DeferredFileBody(FileFactory fileFactory, String transferEncoding); @VisibleForTesting DeferredFileBody(int memoryBackedThreshold, FileFactory fileFactory, String transferEncoding); OutputStream ...
@Test public void getVersion_shouldReturnCurrentDatabaseVersion() { int version = storeSchemaDefinition.getVersion(); assertEquals(LocalStore.DB_VERSION, version); }
@Override public int getVersion() { return LocalStore.DB_VERSION; }
StoreSchemaDefinition implements LockableDatabase.SchemaDefinition { @Override public int getVersion() { return LocalStore.DB_VERSION; } }
StoreSchemaDefinition implements LockableDatabase.SchemaDefinition { @Override public int getVersion() { return LocalStore.DB_VERSION; } StoreSchemaDefinition(LocalStore localStore); }
StoreSchemaDefinition implements LockableDatabase.SchemaDefinition { @Override public int getVersion() { return LocalStore.DB_VERSION; } StoreSchemaDefinition(LocalStore localStore); @Override int getVersion(); @Override void doDbUpgrade(final SQLiteDatabase db); }
StoreSchemaDefinition implements LockableDatabase.SchemaDefinition { @Override public int getVersion() { return LocalStore.DB_VERSION; } StoreSchemaDefinition(LocalStore localStore); @Override int getVersion(); @Override void doDbUpgrade(final SQLiteDatabase db); }
@Test public void findPrimaryCryptoPart_withMultipartAlternativeContainingPgpInline() throws Exception { List<Part> outputExtraParts = new ArrayList<>(); BodyPart pgpInlinePart = bodypart("text/plain", PGP_INLINE_DATA); Message message = messageFromBody( multipart("alternative", pgpInlinePart, bodypart("text/html") ) )...
public static Part findPrimaryEncryptedOrSignedPart(Part part, List<Part> outputExtraParts) { if (isPartEncryptedOrSigned(part)) { return part; } Part foundPart; foundPart = findPrimaryPartInAlternative(part); if (foundPart != null) { return foundPart; } foundPart = findPrimaryPartInMixed(part, outputExtraParts); if (f...
MessageCryptoStructureDetector { public static Part findPrimaryEncryptedOrSignedPart(Part part, List<Part> outputExtraParts) { if (isPartEncryptedOrSigned(part)) { return part; } Part foundPart; foundPart = findPrimaryPartInAlternative(part); if (foundPart != null) { return foundPart; } foundPart = findPrimaryPartInMix...
MessageCryptoStructureDetector { public static Part findPrimaryEncryptedOrSignedPart(Part part, List<Part> outputExtraParts) { if (isPartEncryptedOrSigned(part)) { return part; } Part foundPart; foundPart = findPrimaryPartInAlternative(part); if (foundPart != null) { return foundPart; } foundPart = findPrimaryPartInMix...
MessageCryptoStructureDetector { public static Part findPrimaryEncryptedOrSignedPart(Part part, List<Part> outputExtraParts) { if (isPartEncryptedOrSigned(part)) { return part; } Part foundPart; foundPart = findPrimaryPartInAlternative(part); if (foundPart != null) { return foundPart; } foundPart = findPrimaryPartInMix...
MessageCryptoStructureDetector { public static Part findPrimaryEncryptedOrSignedPart(Part part, List<Part> outputExtraParts) { if (isPartEncryptedOrSigned(part)) { return part; } Part foundPart; foundPart = findPrimaryPartInAlternative(part); if (foundPart != null) { return foundPart; } foundPart = findPrimaryPartInMix...
@Test public void doDbUpgrade_withBadDatabase_shouldThrowInDebugBuild() { if (BuildConfig.DEBUG) { SQLiteDatabase database = SQLiteDatabase.create(null); database.setVersion(29); try { storeSchemaDefinition.doDbUpgrade(database); fail("Expected Error"); } catch (Error e) { assertEquals("Exception while upgrading databa...
@Override public void doDbUpgrade(final SQLiteDatabase db) { try { upgradeDatabase(db); } catch (Exception e) { if (BuildConfig.DEBUG) { throw new Error("Exception while upgrading database", e); } Timber.e(e, "Exception while upgrading database. Resetting the DB to v0"); db.setVersion(0); upgradeDatabase(db); } }
StoreSchemaDefinition implements LockableDatabase.SchemaDefinition { @Override public void doDbUpgrade(final SQLiteDatabase db) { try { upgradeDatabase(db); } catch (Exception e) { if (BuildConfig.DEBUG) { throw new Error("Exception while upgrading database", e); } Timber.e(e, "Exception while upgrading database. Reset...
StoreSchemaDefinition implements LockableDatabase.SchemaDefinition { @Override public void doDbUpgrade(final SQLiteDatabase db) { try { upgradeDatabase(db); } catch (Exception e) { if (BuildConfig.DEBUG) { throw new Error("Exception while upgrading database", e); } Timber.e(e, "Exception while upgrading database. Reset...
StoreSchemaDefinition implements LockableDatabase.SchemaDefinition { @Override public void doDbUpgrade(final SQLiteDatabase db) { try { upgradeDatabase(db); } catch (Exception e) { if (BuildConfig.DEBUG) { throw new Error("Exception while upgrading database", e); } Timber.e(e, "Exception while upgrading database. Reset...
StoreSchemaDefinition implements LockableDatabase.SchemaDefinition { @Override public void doDbUpgrade(final SQLiteDatabase db) { try { upgradeDatabase(db); } catch (Exception e) { if (BuildConfig.DEBUG) { throw new Error("Exception while upgrading database", e); } Timber.e(e, "Exception while upgrading database. Reset...
@Test public void doDbUpgrade_withV29() { SQLiteDatabase database = createV29Database(); insertMessageWithSubject(database, "Test Email"); storeSchemaDefinition.doDbUpgrade(database); assertMessageWithSubjectExists(database, "Test Email"); }
@Override public void doDbUpgrade(final SQLiteDatabase db) { try { upgradeDatabase(db); } catch (Exception e) { if (BuildConfig.DEBUG) { throw new Error("Exception while upgrading database", e); } Timber.e(e, "Exception while upgrading database. Resetting the DB to v0"); db.setVersion(0); upgradeDatabase(db); } }
StoreSchemaDefinition implements LockableDatabase.SchemaDefinition { @Override public void doDbUpgrade(final SQLiteDatabase db) { try { upgradeDatabase(db); } catch (Exception e) { if (BuildConfig.DEBUG) { throw new Error("Exception while upgrading database", e); } Timber.e(e, "Exception while upgrading database. Reset...
StoreSchemaDefinition implements LockableDatabase.SchemaDefinition { @Override public void doDbUpgrade(final SQLiteDatabase db) { try { upgradeDatabase(db); } catch (Exception e) { if (BuildConfig.DEBUG) { throw new Error("Exception while upgrading database", e); } Timber.e(e, "Exception while upgrading database. Reset...
StoreSchemaDefinition implements LockableDatabase.SchemaDefinition { @Override public void doDbUpgrade(final SQLiteDatabase db) { try { upgradeDatabase(db); } catch (Exception e) { if (BuildConfig.DEBUG) { throw new Error("Exception while upgrading database", e); } Timber.e(e, "Exception while upgrading database. Reset...
StoreSchemaDefinition implements LockableDatabase.SchemaDefinition { @Override public void doDbUpgrade(final SQLiteDatabase db) { try { upgradeDatabase(db); } catch (Exception e) { if (BuildConfig.DEBUG) { throw new Error("Exception while upgrading database", e); } Timber.e(e, "Exception while upgrading database. Reset...
@Test public void doDbUpgrade_fromV29_shouldResultInSameTables() { SQLiteDatabase newDatabase = createNewDatabase(); SQLiteDatabase upgradedDatabase = createV29Database(); storeSchemaDefinition.doDbUpgrade(upgradedDatabase); assertDatabaseTablesEquals(newDatabase, upgradedDatabase); }
@Override public void doDbUpgrade(final SQLiteDatabase db) { try { upgradeDatabase(db); } catch (Exception e) { if (BuildConfig.DEBUG) { throw new Error("Exception while upgrading database", e); } Timber.e(e, "Exception while upgrading database. Resetting the DB to v0"); db.setVersion(0); upgradeDatabase(db); } }
StoreSchemaDefinition implements LockableDatabase.SchemaDefinition { @Override public void doDbUpgrade(final SQLiteDatabase db) { try { upgradeDatabase(db); } catch (Exception e) { if (BuildConfig.DEBUG) { throw new Error("Exception while upgrading database", e); } Timber.e(e, "Exception while upgrading database. Reset...
StoreSchemaDefinition implements LockableDatabase.SchemaDefinition { @Override public void doDbUpgrade(final SQLiteDatabase db) { try { upgradeDatabase(db); } catch (Exception e) { if (BuildConfig.DEBUG) { throw new Error("Exception while upgrading database", e); } Timber.e(e, "Exception while upgrading database. Reset...
StoreSchemaDefinition implements LockableDatabase.SchemaDefinition { @Override public void doDbUpgrade(final SQLiteDatabase db) { try { upgradeDatabase(db); } catch (Exception e) { if (BuildConfig.DEBUG) { throw new Error("Exception while upgrading database", e); } Timber.e(e, "Exception while upgrading database. Reset...
StoreSchemaDefinition implements LockableDatabase.SchemaDefinition { @Override public void doDbUpgrade(final SQLiteDatabase db) { try { upgradeDatabase(db); } catch (Exception e) { if (BuildConfig.DEBUG) { throw new Error("Exception while upgrading database", e); } Timber.e(e, "Exception while upgrading database. Reset...
@Test public void doDbUpgrade_fromV29_shouldResultInSameTriggers() { SQLiteDatabase newDatabase = createNewDatabase(); SQLiteDatabase upgradedDatabase = createV29Database(); storeSchemaDefinition.doDbUpgrade(upgradedDatabase); assertDatabaseTriggersEquals(newDatabase, upgradedDatabase); }
@Override public void doDbUpgrade(final SQLiteDatabase db) { try { upgradeDatabase(db); } catch (Exception e) { if (BuildConfig.DEBUG) { throw new Error("Exception while upgrading database", e); } Timber.e(e, "Exception while upgrading database. Resetting the DB to v0"); db.setVersion(0); upgradeDatabase(db); } }
StoreSchemaDefinition implements LockableDatabase.SchemaDefinition { @Override public void doDbUpgrade(final SQLiteDatabase db) { try { upgradeDatabase(db); } catch (Exception e) { if (BuildConfig.DEBUG) { throw new Error("Exception while upgrading database", e); } Timber.e(e, "Exception while upgrading database. Reset...
StoreSchemaDefinition implements LockableDatabase.SchemaDefinition { @Override public void doDbUpgrade(final SQLiteDatabase db) { try { upgradeDatabase(db); } catch (Exception e) { if (BuildConfig.DEBUG) { throw new Error("Exception while upgrading database", e); } Timber.e(e, "Exception while upgrading database. Reset...
StoreSchemaDefinition implements LockableDatabase.SchemaDefinition { @Override public void doDbUpgrade(final SQLiteDatabase db) { try { upgradeDatabase(db); } catch (Exception e) { if (BuildConfig.DEBUG) { throw new Error("Exception while upgrading database", e); } Timber.e(e, "Exception while upgrading database. Reset...
StoreSchemaDefinition implements LockableDatabase.SchemaDefinition { @Override public void doDbUpgrade(final SQLiteDatabase db) { try { upgradeDatabase(db); } catch (Exception e) { if (BuildConfig.DEBUG) { throw new Error("Exception while upgrading database", e); } Timber.e(e, "Exception while upgrading database. Reset...
@Test public void doDbUpgrade_fromV29_shouldResultInSameIndexes() { SQLiteDatabase newDatabase = createNewDatabase(); SQLiteDatabase upgradedDatabase = createV29Database(); storeSchemaDefinition.doDbUpgrade(upgradedDatabase); assertDatabaseIndexesEquals(newDatabase, upgradedDatabase); }
@Override public void doDbUpgrade(final SQLiteDatabase db) { try { upgradeDatabase(db); } catch (Exception e) { if (BuildConfig.DEBUG) { throw new Error("Exception while upgrading database", e); } Timber.e(e, "Exception while upgrading database. Resetting the DB to v0"); db.setVersion(0); upgradeDatabase(db); } }
StoreSchemaDefinition implements LockableDatabase.SchemaDefinition { @Override public void doDbUpgrade(final SQLiteDatabase db) { try { upgradeDatabase(db); } catch (Exception e) { if (BuildConfig.DEBUG) { throw new Error("Exception while upgrading database", e); } Timber.e(e, "Exception while upgrading database. Reset...
StoreSchemaDefinition implements LockableDatabase.SchemaDefinition { @Override public void doDbUpgrade(final SQLiteDatabase db) { try { upgradeDatabase(db); } catch (Exception e) { if (BuildConfig.DEBUG) { throw new Error("Exception while upgrading database", e); } Timber.e(e, "Exception while upgrading database. Reset...
StoreSchemaDefinition implements LockableDatabase.SchemaDefinition { @Override public void doDbUpgrade(final SQLiteDatabase db) { try { upgradeDatabase(db); } catch (Exception e) { if (BuildConfig.DEBUG) { throw new Error("Exception while upgrading database", e); } Timber.e(e, "Exception while upgrading database. Reset...
StoreSchemaDefinition implements LockableDatabase.SchemaDefinition { @Override public void doDbUpgrade(final SQLiteDatabase db) { try { upgradeDatabase(db); } catch (Exception e) { if (BuildConfig.DEBUG) { throw new Error("Exception while upgrading database", e); } Timber.e(e, "Exception while upgrading database. Reset...
@Test public void migratePendingCommands_shouldChangeTableStructure() { SQLiteDatabase database = createV59Table(); MigrationTo60.migratePendingCommands(database); List<String> columns = getColumnList(database, "pending_commands"); assertEquals(asList("id", "command", "data"), columns); }
static void migratePendingCommands(SQLiteDatabase db) { List<PendingCommand> pendingCommands = new ArrayList<>(); if (columnExists(db, "pending_commands", "arguments")) { for (OldPendingCommand oldPendingCommand : getPendingCommands(db)) { PendingCommand newPendingCommand = migratePendingCommand(oldPendingCommand); pen...
MigrationTo60 { static void migratePendingCommands(SQLiteDatabase db) { List<PendingCommand> pendingCommands = new ArrayList<>(); if (columnExists(db, "pending_commands", "arguments")) { for (OldPendingCommand oldPendingCommand : getPendingCommands(db)) { PendingCommand newPendingCommand = migratePendingCommand(oldPend...
MigrationTo60 { static void migratePendingCommands(SQLiteDatabase db) { List<PendingCommand> pendingCommands = new ArrayList<>(); if (columnExists(db, "pending_commands", "arguments")) { for (OldPendingCommand oldPendingCommand : getPendingCommands(db)) { PendingCommand newPendingCommand = migratePendingCommand(oldPend...
MigrationTo60 { static void migratePendingCommands(SQLiteDatabase db) { List<PendingCommand> pendingCommands = new ArrayList<>(); if (columnExists(db, "pending_commands", "arguments")) { for (OldPendingCommand oldPendingCommand : getPendingCommands(db)) { PendingCommand newPendingCommand = migratePendingCommand(oldPend...
MigrationTo60 { static void migratePendingCommands(SQLiteDatabase db) { List<PendingCommand> pendingCommands = new ArrayList<>(); if (columnExists(db, "pending_commands", "arguments")) { for (OldPendingCommand oldPendingCommand : getPendingCommands(db)) { PendingCommand newPendingCommand = migratePendingCommand(oldPend...
@Test public void migratePendingCommands_withMultipleRuns_shouldNotThrow() { SQLiteDatabase database = createV59Table(); MigrationTo60.migratePendingCommands(database); MigrationTo60.migratePendingCommands(database); }
static void migratePendingCommands(SQLiteDatabase db) { List<PendingCommand> pendingCommands = new ArrayList<>(); if (columnExists(db, "pending_commands", "arguments")) { for (OldPendingCommand oldPendingCommand : getPendingCommands(db)) { PendingCommand newPendingCommand = migratePendingCommand(oldPendingCommand); pen...
MigrationTo60 { static void migratePendingCommands(SQLiteDatabase db) { List<PendingCommand> pendingCommands = new ArrayList<>(); if (columnExists(db, "pending_commands", "arguments")) { for (OldPendingCommand oldPendingCommand : getPendingCommands(db)) { PendingCommand newPendingCommand = migratePendingCommand(oldPend...
MigrationTo60 { static void migratePendingCommands(SQLiteDatabase db) { List<PendingCommand> pendingCommands = new ArrayList<>(); if (columnExists(db, "pending_commands", "arguments")) { for (OldPendingCommand oldPendingCommand : getPendingCommands(db)) { PendingCommand newPendingCommand = migratePendingCommand(oldPend...
MigrationTo60 { static void migratePendingCommands(SQLiteDatabase db) { List<PendingCommand> pendingCommands = new ArrayList<>(); if (columnExists(db, "pending_commands", "arguments")) { for (OldPendingCommand oldPendingCommand : getPendingCommands(db)) { PendingCommand newPendingCommand = migratePendingCommand(oldPend...
MigrationTo60 { static void migratePendingCommands(SQLiteDatabase db) { List<PendingCommand> pendingCommands = new ArrayList<>(); if (columnExists(db, "pending_commands", "arguments")) { for (OldPendingCommand oldPendingCommand : getPendingCommands(db)) { PendingCommand newPendingCommand = migratePendingCommand(oldPend...
@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_...
@VisibleForTesting static PendingCommand migratePendingCommand(OldPendingCommand oldPendingCommand) { switch (oldPendingCommand.command) { case PENDING_COMMAND_APPEND: { return migrateCommandAppend(oldPendingCommand); } case PENDING_COMMAND_SET_FLAG_BULK: { return migrateCommandSetFlagBulk(oldPendingCommand); } case PE...
MigrationTo60 { @VisibleForTesting static PendingCommand migratePendingCommand(OldPendingCommand oldPendingCommand) { switch (oldPendingCommand.command) { case PENDING_COMMAND_APPEND: { return migrateCommandAppend(oldPendingCommand); } case PENDING_COMMAND_SET_FLAG_BULK: { return migrateCommandSetFlagBulk(oldPendingCom...
MigrationTo60 { @VisibleForTesting static PendingCommand migratePendingCommand(OldPendingCommand oldPendingCommand) { switch (oldPendingCommand.command) { case PENDING_COMMAND_APPEND: { return migrateCommandAppend(oldPendingCommand); } case PENDING_COMMAND_SET_FLAG_BULK: { return migrateCommandSetFlagBulk(oldPendingCom...
MigrationTo60 { @VisibleForTesting static PendingCommand migratePendingCommand(OldPendingCommand oldPendingCommand) { switch (oldPendingCommand.command) { case PENDING_COMMAND_APPEND: { return migrateCommandAppend(oldPendingCommand); } case PENDING_COMMAND_SET_FLAG_BULK: { return migrateCommandSetFlagBulk(oldPendingCom...
MigrationTo60 { @VisibleForTesting static PendingCommand migratePendingCommand(OldPendingCommand oldPendingCommand) { switch (oldPendingCommand.command) { case PENDING_COMMAND_APPEND: { return migrateCommandAppend(oldPendingCommand); } case PENDING_COMMAND_SET_FLAG_BULK: { return migrateCommandSetFlagBulk(oldPendingCom...
@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_FOLD...
@VisibleForTesting static PendingCommand migratePendingCommand(OldPendingCommand oldPendingCommand) { switch (oldPendingCommand.command) { case PENDING_COMMAND_APPEND: { return migrateCommandAppend(oldPendingCommand); } case PENDING_COMMAND_SET_FLAG_BULK: { return migrateCommandSetFlagBulk(oldPendingCommand); } case PE...
MigrationTo60 { @VisibleForTesting static PendingCommand migratePendingCommand(OldPendingCommand oldPendingCommand) { switch (oldPendingCommand.command) { case PENDING_COMMAND_APPEND: { return migrateCommandAppend(oldPendingCommand); } case PENDING_COMMAND_SET_FLAG_BULK: { return migrateCommandSetFlagBulk(oldPendingCom...
MigrationTo60 { @VisibleForTesting static PendingCommand migratePendingCommand(OldPendingCommand oldPendingCommand) { switch (oldPendingCommand.command) { case PENDING_COMMAND_APPEND: { return migrateCommandAppend(oldPendingCommand); } case PENDING_COMMAND_SET_FLAG_BULK: { return migrateCommandSetFlagBulk(oldPendingCom...
MigrationTo60 { @VisibleForTesting static PendingCommand migratePendingCommand(OldPendingCommand oldPendingCommand) { switch (oldPendingCommand.command) { case PENDING_COMMAND_APPEND: { return migrateCommandAppend(oldPendingCommand); } case PENDING_COMMAND_SET_FLAG_BULK: { return migrateCommandSetFlagBulk(oldPendingCom...
MigrationTo60 { @VisibleForTesting static PendingCommand migratePendingCommand(OldPendingCommand oldPendingCommand) { switch (oldPendingCommand.command) { case PENDING_COMMAND_APPEND: { return migrateCommandAppend(oldPendingCommand); } case PENDING_COMMAND_SET_FLAG_BULK: { return migrateCommandSetFlagBulk(oldPendingCom...
@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(D...
@VisibleForTesting static PendingCommand migratePendingCommand(OldPendingCommand oldPendingCommand) { switch (oldPendingCommand.command) { case PENDING_COMMAND_APPEND: { return migrateCommandAppend(oldPendingCommand); } case PENDING_COMMAND_SET_FLAG_BULK: { return migrateCommandSetFlagBulk(oldPendingCommand); } case PE...
MigrationTo60 { @VisibleForTesting static PendingCommand migratePendingCommand(OldPendingCommand oldPendingCommand) { switch (oldPendingCommand.command) { case PENDING_COMMAND_APPEND: { return migrateCommandAppend(oldPendingCommand); } case PENDING_COMMAND_SET_FLAG_BULK: { return migrateCommandSetFlagBulk(oldPendingCom...
MigrationTo60 { @VisibleForTesting static PendingCommand migratePendingCommand(OldPendingCommand oldPendingCommand) { switch (oldPendingCommand.command) { case PENDING_COMMAND_APPEND: { return migrateCommandAppend(oldPendingCommand); } case PENDING_COMMAND_SET_FLAG_BULK: { return migrateCommandSetFlagBulk(oldPendingCom...
MigrationTo60 { @VisibleForTesting static PendingCommand migratePendingCommand(OldPendingCommand oldPendingCommand) { switch (oldPendingCommand.command) { case PENDING_COMMAND_APPEND: { return migrateCommandAppend(oldPendingCommand); } case PENDING_COMMAND_SET_FLAG_BULK: { return migrateCommandSetFlagBulk(oldPendingCom...
MigrationTo60 { @VisibleForTesting static PendingCommand migratePendingCommand(OldPendingCommand oldPendingCommand) { switch (oldPendingCommand.command) { case PENDING_COMMAND_APPEND: { return migrateCommandAppend(oldPendingCommand); } case PENDING_COMMAND_SET_FLAG_BULK: { return migrateCommandSetFlagBulk(oldPendingCom...
@Test public void findPrimaryCryptoPart_withMultipartMixedContainingPgpInline() throws Exception { List<Part> outputExtraParts = new ArrayList<>(); BodyPart pgpInlinePart = bodypart("text/plain", PGP_INLINE_DATA); Message message = messageFromBody( multipart("mixed", pgpInlinePart, bodypart("application/octet-stream") ...
public static Part findPrimaryEncryptedOrSignedPart(Part part, List<Part> outputExtraParts) { if (isPartEncryptedOrSigned(part)) { return part; } Part foundPart; foundPart = findPrimaryPartInAlternative(part); if (foundPart != null) { return foundPart; } foundPart = findPrimaryPartInMixed(part, outputExtraParts); if (f...
MessageCryptoStructureDetector { public static Part findPrimaryEncryptedOrSignedPart(Part part, List<Part> outputExtraParts) { if (isPartEncryptedOrSigned(part)) { return part; } Part foundPart; foundPart = findPrimaryPartInAlternative(part); if (foundPart != null) { return foundPart; } foundPart = findPrimaryPartInMix...
MessageCryptoStructureDetector { public static Part findPrimaryEncryptedOrSignedPart(Part part, List<Part> outputExtraParts) { if (isPartEncryptedOrSigned(part)) { return part; } Part foundPart; foundPart = findPrimaryPartInAlternative(part); if (foundPart != null) { return foundPart; } foundPart = findPrimaryPartInMix...
MessageCryptoStructureDetector { public static Part findPrimaryEncryptedOrSignedPart(Part part, List<Part> outputExtraParts) { if (isPartEncryptedOrSigned(part)) { return part; } Part foundPart; foundPart = findPrimaryPartInAlternative(part); if (foundPart != null) { return foundPart; } foundPart = findPrimaryPartInMix...
MessageCryptoStructureDetector { public static Part findPrimaryEncryptedOrSignedPart(Part part, List<Part> outputExtraParts) { if (isPartEncryptedOrSigned(part)) { return part; } Part foundPart; foundPart = findPrimaryPartInAlternative(part); if (foundPart != null) { return foundPart; } foundPart = findPrimaryPartInMix...
@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); assertE...
@VisibleForTesting static PendingCommand migratePendingCommand(OldPendingCommand oldPendingCommand) { switch (oldPendingCommand.command) { case PENDING_COMMAND_APPEND: { return migrateCommandAppend(oldPendingCommand); } case PENDING_COMMAND_SET_FLAG_BULK: { return migrateCommandSetFlagBulk(oldPendingCommand); } case PE...
MigrationTo60 { @VisibleForTesting static PendingCommand migratePendingCommand(OldPendingCommand oldPendingCommand) { switch (oldPendingCommand.command) { case PENDING_COMMAND_APPEND: { return migrateCommandAppend(oldPendingCommand); } case PENDING_COMMAND_SET_FLAG_BULK: { return migrateCommandSetFlagBulk(oldPendingCom...
MigrationTo60 { @VisibleForTesting static PendingCommand migratePendingCommand(OldPendingCommand oldPendingCommand) { switch (oldPendingCommand.command) { case PENDING_COMMAND_APPEND: { return migrateCommandAppend(oldPendingCommand); } case PENDING_COMMAND_SET_FLAG_BULK: { return migrateCommandSetFlagBulk(oldPendingCom...
MigrationTo60 { @VisibleForTesting static PendingCommand migratePendingCommand(OldPendingCommand oldPendingCommand) { switch (oldPendingCommand.command) { case PENDING_COMMAND_APPEND: { return migrateCommandAppend(oldPendingCommand); } case PENDING_COMMAND_SET_FLAG_BULK: { return migrateCommandSetFlagBulk(oldPendingCom...
MigrationTo60 { @VisibleForTesting static PendingCommand migratePendingCommand(OldPendingCommand oldPendingCommand) { switch (oldPendingCommand.command) { case PENDING_COMMAND_APPEND: { return migrateCommandAppend(oldPendingCommand); } case PENDING_COMMAND_SET_FLAG_BULK: { return migrateCommandSetFlagBulk(oldPendingCom...
@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.newSta...
@VisibleForTesting static PendingCommand migratePendingCommand(OldPendingCommand oldPendingCommand) { switch (oldPendingCommand.command) { case PENDING_COMMAND_APPEND: { return migrateCommandAppend(oldPendingCommand); } case PENDING_COMMAND_SET_FLAG_BULK: { return migrateCommandSetFlagBulk(oldPendingCommand); } case PE...
MigrationTo60 { @VisibleForTesting static PendingCommand migratePendingCommand(OldPendingCommand oldPendingCommand) { switch (oldPendingCommand.command) { case PENDING_COMMAND_APPEND: { return migrateCommandAppend(oldPendingCommand); } case PENDING_COMMAND_SET_FLAG_BULK: { return migrateCommandSetFlagBulk(oldPendingCom...
MigrationTo60 { @VisibleForTesting static PendingCommand migratePendingCommand(OldPendingCommand oldPendingCommand) { switch (oldPendingCommand.command) { case PENDING_COMMAND_APPEND: { return migrateCommandAppend(oldPendingCommand); } case PENDING_COMMAND_SET_FLAG_BULK: { return migrateCommandSetFlagBulk(oldPendingCom...
MigrationTo60 { @VisibleForTesting static PendingCommand migratePendingCommand(OldPendingCommand oldPendingCommand) { switch (oldPendingCommand.command) { case PENDING_COMMAND_APPEND: { return migrateCommandAppend(oldPendingCommand); } case PENDING_COMMAND_SET_FLAG_BULK: { return migrateCommandSetFlagBulk(oldPendingCom...
MigrationTo60 { @VisibleForTesting static PendingCommand migratePendingCommand(OldPendingCommand oldPendingCommand) { switch (oldPendingCommand.command) { case PENDING_COMMAND_APPEND: { return migrateCommandAppend(oldPendingCommand); } case PENDING_COMMAND_SET_FLAG_BULK: { return migrateCommandSetFlagBulk(oldPendingCom...
@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.new...
@VisibleForTesting static PendingCommand migratePendingCommand(OldPendingCommand oldPendingCommand) { switch (oldPendingCommand.command) { case PENDING_COMMAND_APPEND: { return migrateCommandAppend(oldPendingCommand); } case PENDING_COMMAND_SET_FLAG_BULK: { return migrateCommandSetFlagBulk(oldPendingCommand); } case PE...
MigrationTo60 { @VisibleForTesting static PendingCommand migratePendingCommand(OldPendingCommand oldPendingCommand) { switch (oldPendingCommand.command) { case PENDING_COMMAND_APPEND: { return migrateCommandAppend(oldPendingCommand); } case PENDING_COMMAND_SET_FLAG_BULK: { return migrateCommandSetFlagBulk(oldPendingCom...
MigrationTo60 { @VisibleForTesting static PendingCommand migratePendingCommand(OldPendingCommand oldPendingCommand) { switch (oldPendingCommand.command) { case PENDING_COMMAND_APPEND: { return migrateCommandAppend(oldPendingCommand); } case PENDING_COMMAND_SET_FLAG_BULK: { return migrateCommandSetFlagBulk(oldPendingCom...
MigrationTo60 { @VisibleForTesting static PendingCommand migratePendingCommand(OldPendingCommand oldPendingCommand) { switch (oldPendingCommand.command) { case PENDING_COMMAND_APPEND: { return migrateCommandAppend(oldPendingCommand); } case PENDING_COMMAND_SET_FLAG_BULK: { return migrateCommandSetFlagBulk(oldPendingCom...
MigrationTo60 { @VisibleForTesting static PendingCommand migratePendingCommand(OldPendingCommand oldPendingCommand) { switch (oldPendingCommand.command) { case PENDING_COMMAND_APPEND: { return migrateCommandAppend(oldPendingCommand); } case PENDING_COMMAND_SET_FLAG_BULK: { return migrateCommandSetFlagBulk(oldPendingCom...
@Test public void migrateExpunge() { OldPendingCommand command = queueExpunge(SOURCE_FOLDER); PendingExpunge pendingCommand = (PendingExpunge) MigrationTo60.migratePendingCommand(command); assertEquals(SOURCE_FOLDER, pendingCommand.folder); }
@VisibleForTesting static PendingCommand migratePendingCommand(OldPendingCommand oldPendingCommand) { switch (oldPendingCommand.command) { case PENDING_COMMAND_APPEND: { return migrateCommandAppend(oldPendingCommand); } case PENDING_COMMAND_SET_FLAG_BULK: { return migrateCommandSetFlagBulk(oldPendingCommand); } case PE...
MigrationTo60 { @VisibleForTesting static PendingCommand migratePendingCommand(OldPendingCommand oldPendingCommand) { switch (oldPendingCommand.command) { case PENDING_COMMAND_APPEND: { return migrateCommandAppend(oldPendingCommand); } case PENDING_COMMAND_SET_FLAG_BULK: { return migrateCommandSetFlagBulk(oldPendingCom...
MigrationTo60 { @VisibleForTesting static PendingCommand migratePendingCommand(OldPendingCommand oldPendingCommand) { switch (oldPendingCommand.command) { case PENDING_COMMAND_APPEND: { return migrateCommandAppend(oldPendingCommand); } case PENDING_COMMAND_SET_FLAG_BULK: { return migrateCommandSetFlagBulk(oldPendingCom...
MigrationTo60 { @VisibleForTesting static PendingCommand migratePendingCommand(OldPendingCommand oldPendingCommand) { switch (oldPendingCommand.command) { case PENDING_COMMAND_APPEND: { return migrateCommandAppend(oldPendingCommand); } case PENDING_COMMAND_SET_FLAG_BULK: { return migrateCommandSetFlagBulk(oldPendingCom...
MigrationTo60 { @VisibleForTesting static PendingCommand migratePendingCommand(OldPendingCommand oldPendingCommand) { switch (oldPendingCommand.command) { case PENDING_COMMAND_APPEND: { return migrateCommandAppend(oldPendingCommand); } case PENDING_COMMAND_SET_FLAG_BULK: { return migrateCommandSetFlagBulk(oldPendingCom...
@Test public void migrateEmptyTrash() { OldPendingCommand command = queueEmptyTrash(); PendingCommand pendingCommand = MigrationTo60.migratePendingCommand(command); assertTrue(pendingCommand instanceof PendingEmptyTrash); }
@VisibleForTesting static PendingCommand migratePendingCommand(OldPendingCommand oldPendingCommand) { switch (oldPendingCommand.command) { case PENDING_COMMAND_APPEND: { return migrateCommandAppend(oldPendingCommand); } case PENDING_COMMAND_SET_FLAG_BULK: { return migrateCommandSetFlagBulk(oldPendingCommand); } case PE...
MigrationTo60 { @VisibleForTesting static PendingCommand migratePendingCommand(OldPendingCommand oldPendingCommand) { switch (oldPendingCommand.command) { case PENDING_COMMAND_APPEND: { return migrateCommandAppend(oldPendingCommand); } case PENDING_COMMAND_SET_FLAG_BULK: { return migrateCommandSetFlagBulk(oldPendingCom...
MigrationTo60 { @VisibleForTesting static PendingCommand migratePendingCommand(OldPendingCommand oldPendingCommand) { switch (oldPendingCommand.command) { case PENDING_COMMAND_APPEND: { return migrateCommandAppend(oldPendingCommand); } case PENDING_COMMAND_SET_FLAG_BULK: { return migrateCommandSetFlagBulk(oldPendingCom...
MigrationTo60 { @VisibleForTesting static PendingCommand migratePendingCommand(OldPendingCommand oldPendingCommand) { switch (oldPendingCommand.command) { case PENDING_COMMAND_APPEND: { return migrateCommandAppend(oldPendingCommand); } case PENDING_COMMAND_SET_FLAG_BULK: { return migrateCommandSetFlagBulk(oldPendingCom...
MigrationTo60 { @VisibleForTesting static PendingCommand migratePendingCommand(OldPendingCommand oldPendingCommand) { switch (oldPendingCommand.command) { case PENDING_COMMAND_APPEND: { return migrateCommandAppend(oldPendingCommand); } case PENDING_COMMAND_SET_FLAG_BULK: { return migrateCommandSetFlagBulk(oldPendingCom...
@Test public void migrateMarkAllMessagesRead() { OldPendingCommand command = queueMarkAllMessagesRead(SOURCE_FOLDER); PendingMarkAllAsRead pendingCommand = (PendingMarkAllAsRead) MigrationTo60.migratePendingCommand(command); assertEquals(SOURCE_FOLDER, pendingCommand.folder); }
@VisibleForTesting static PendingCommand migratePendingCommand(OldPendingCommand oldPendingCommand) { switch (oldPendingCommand.command) { case PENDING_COMMAND_APPEND: { return migrateCommandAppend(oldPendingCommand); } case PENDING_COMMAND_SET_FLAG_BULK: { return migrateCommandSetFlagBulk(oldPendingCommand); } case PE...
MigrationTo60 { @VisibleForTesting static PendingCommand migratePendingCommand(OldPendingCommand oldPendingCommand) { switch (oldPendingCommand.command) { case PENDING_COMMAND_APPEND: { return migrateCommandAppend(oldPendingCommand); } case PENDING_COMMAND_SET_FLAG_BULK: { return migrateCommandSetFlagBulk(oldPendingCom...
MigrationTo60 { @VisibleForTesting static PendingCommand migratePendingCommand(OldPendingCommand oldPendingCommand) { switch (oldPendingCommand.command) { case PENDING_COMMAND_APPEND: { return migrateCommandAppend(oldPendingCommand); } case PENDING_COMMAND_SET_FLAG_BULK: { return migrateCommandSetFlagBulk(oldPendingCom...
MigrationTo60 { @VisibleForTesting static PendingCommand migratePendingCommand(OldPendingCommand oldPendingCommand) { switch (oldPendingCommand.command) { case PENDING_COMMAND_APPEND: { return migrateCommandAppend(oldPendingCommand); } case PENDING_COMMAND_SET_FLAG_BULK: { return migrateCommandSetFlagBulk(oldPendingCom...
MigrationTo60 { @VisibleForTesting static PendingCommand migratePendingCommand(OldPendingCommand oldPendingCommand) { switch (oldPendingCommand.command) { case PENDING_COMMAND_APPEND: { return migrateCommandAppend(oldPendingCommand); } case PENDING_COMMAND_SET_FLAG_BULK: { return migrateCommandSetFlagBulk(oldPendingCom...
@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); }
@VisibleForTesting static PendingCommand migratePendingCommand(OldPendingCommand oldPendingCommand) { switch (oldPendingCommand.command) { case PENDING_COMMAND_APPEND: { return migrateCommandAppend(oldPendingCommand); } case PENDING_COMMAND_SET_FLAG_BULK: { return migrateCommandSetFlagBulk(oldPendingCommand); } case PE...
MigrationTo60 { @VisibleForTesting static PendingCommand migratePendingCommand(OldPendingCommand oldPendingCommand) { switch (oldPendingCommand.command) { case PENDING_COMMAND_APPEND: { return migrateCommandAppend(oldPendingCommand); } case PENDING_COMMAND_SET_FLAG_BULK: { return migrateCommandSetFlagBulk(oldPendingCom...
MigrationTo60 { @VisibleForTesting static PendingCommand migratePendingCommand(OldPendingCommand oldPendingCommand) { switch (oldPendingCommand.command) { case PENDING_COMMAND_APPEND: { return migrateCommandAppend(oldPendingCommand); } case PENDING_COMMAND_SET_FLAG_BULK: { return migrateCommandSetFlagBulk(oldPendingCom...
MigrationTo60 { @VisibleForTesting static PendingCommand migratePendingCommand(OldPendingCommand oldPendingCommand) { switch (oldPendingCommand.command) { case PENDING_COMMAND_APPEND: { return migrateCommandAppend(oldPendingCommand); } case PENDING_COMMAND_SET_FLAG_BULK: { return migrateCommandSetFlagBulk(oldPendingCom...
MigrationTo60 { @VisibleForTesting static PendingCommand migratePendingCommand(OldPendingCommand oldPendingCommand) { switch (oldPendingCommand.command) { case PENDING_COMMAND_APPEND: { return migrateCommandAppend(oldPendingCommand); } case PENDING_COMMAND_SET_FLAG_BULK: { return migrateCommandSetFlagBulk(oldPendingCom...
@Test public void testShouldSanitizeOutputHtml() throws MessagingException { TextBody body = new TextBody(BODY_TEXT); MimeMessage message = new MimeMessage(); MimeMessageHelper.setBody(message, body); message.setHeader(MimeHeader.HEADER_CONTENT_TYPE, "text/plain; format=flowed"); HtmlProcessor htmlProcessor = mock(Html...
@VisibleForTesting ViewableExtractedText extractTextFromViewables(List<Viewable> viewables) throws MessagingException { try { boolean hideDivider = true; StringBuilder text = new StringBuilder(); StringBuilder html = new StringBuilder(); for (Viewable viewable : viewables) { if (viewable instanceof Textual) { text.appe...
MessageViewInfoExtractor { @VisibleForTesting ViewableExtractedText extractTextFromViewables(List<Viewable> viewables) throws MessagingException { try { boolean hideDivider = true; StringBuilder text = new StringBuilder(); StringBuilder html = new StringBuilder(); for (Viewable viewable : viewables) { if (viewable inst...
MessageViewInfoExtractor { @VisibleForTesting ViewableExtractedText extractTextFromViewables(List<Viewable> viewables) throws MessagingException { try { boolean hideDivider = true; StringBuilder text = new StringBuilder(); StringBuilder html = new StringBuilder(); for (Viewable viewable : viewables) { if (viewable inst...
MessageViewInfoExtractor { @VisibleForTesting ViewableExtractedText extractTextFromViewables(List<Viewable> viewables) throws MessagingException { try { boolean hideDivider = true; StringBuilder text = new StringBuilder(); StringBuilder html = new StringBuilder(); for (Viewable viewable : viewables) { if (viewable inst...
MessageViewInfoExtractor { @VisibleForTesting ViewableExtractedText extractTextFromViewables(List<Viewable> viewables) throws MessagingException { try { boolean hideDivider = true; StringBuilder text = new StringBuilder(); StringBuilder html = new StringBuilder(); for (Viewable viewable : viewables) { if (viewable inst...
@Test public void testSimplePlainTextMessage() throws MessagingException { TextBody body = new TextBody(BODY_TEXT); MimeMessage message = new MimeMessage(); message.setHeader(MimeHeader.HEADER_CONTENT_TYPE, "text/plain"); MimeMessageHelper.setBody(message, body); List<Part> outputNonViewableParts = new ArrayList<>(); A...
@VisibleForTesting ViewableExtractedText extractTextFromViewables(List<Viewable> viewables) throws MessagingException { try { boolean hideDivider = true; StringBuilder text = new StringBuilder(); StringBuilder html = new StringBuilder(); for (Viewable viewable : viewables) { if (viewable instanceof Textual) { text.appe...
MessageViewInfoExtractor { @VisibleForTesting ViewableExtractedText extractTextFromViewables(List<Viewable> viewables) throws MessagingException { try { boolean hideDivider = true; StringBuilder text = new StringBuilder(); StringBuilder html = new StringBuilder(); for (Viewable viewable : viewables) { if (viewable inst...
MessageViewInfoExtractor { @VisibleForTesting ViewableExtractedText extractTextFromViewables(List<Viewable> viewables) throws MessagingException { try { boolean hideDivider = true; StringBuilder text = new StringBuilder(); StringBuilder html = new StringBuilder(); for (Viewable viewable : viewables) { if (viewable inst...
MessageViewInfoExtractor { @VisibleForTesting ViewableExtractedText extractTextFromViewables(List<Viewable> viewables) throws MessagingException { try { boolean hideDivider = true; StringBuilder text = new StringBuilder(); StringBuilder html = new StringBuilder(); for (Viewable viewable : viewables) { if (viewable inst...
MessageViewInfoExtractor { @VisibleForTesting ViewableExtractedText extractTextFromViewables(List<Viewable> viewables) throws MessagingException { try { boolean hideDivider = true; StringBuilder text = new StringBuilder(); StringBuilder html = new StringBuilder(); for (Viewable viewable : viewables) { if (viewable inst...
@Test public void testTextPlainFormatFlowed() throws MessagingException { TextBody body = new TextBody(BODY_TEXT_FLOWED); MimeMessage message = new MimeMessage(); MimeMessageHelper.setBody(message, body); message.setHeader(MimeHeader.HEADER_CONTENT_TYPE, "text/plain; format=flowed"); List<Part> outputNonViewableParts =...
@VisibleForTesting ViewableExtractedText extractTextFromViewables(List<Viewable> viewables) throws MessagingException { try { boolean hideDivider = true; StringBuilder text = new StringBuilder(); StringBuilder html = new StringBuilder(); for (Viewable viewable : viewables) { if (viewable instanceof Textual) { text.appe...
MessageViewInfoExtractor { @VisibleForTesting ViewableExtractedText extractTextFromViewables(List<Viewable> viewables) throws MessagingException { try { boolean hideDivider = true; StringBuilder text = new StringBuilder(); StringBuilder html = new StringBuilder(); for (Viewable viewable : viewables) { if (viewable inst...
MessageViewInfoExtractor { @VisibleForTesting ViewableExtractedText extractTextFromViewables(List<Viewable> viewables) throws MessagingException { try { boolean hideDivider = true; StringBuilder text = new StringBuilder(); StringBuilder html = new StringBuilder(); for (Viewable viewable : viewables) { if (viewable inst...
MessageViewInfoExtractor { @VisibleForTesting ViewableExtractedText extractTextFromViewables(List<Viewable> viewables) throws MessagingException { try { boolean hideDivider = true; StringBuilder text = new StringBuilder(); StringBuilder html = new StringBuilder(); for (Viewable viewable : viewables) { if (viewable inst...
MessageViewInfoExtractor { @VisibleForTesting ViewableExtractedText extractTextFromViewables(List<Viewable> viewables) throws MessagingException { try { boolean hideDivider = true; StringBuilder text = new StringBuilder(); StringBuilder html = new StringBuilder(); for (Viewable viewable : viewables) { if (viewable inst...
@Test public void findPrimaryCryptoPart_withMultipartMixedContainingMultipartAlternativeContainingPgpInline() throws Exception { List<Part> outputExtraParts = new ArrayList<>(); BodyPart pgpInlinePart = bodypart("text/plain", PGP_INLINE_DATA); Message message = messageFromBody( multipart("mixed", multipart("alternative...
public static Part findPrimaryEncryptedOrSignedPart(Part part, List<Part> outputExtraParts) { if (isPartEncryptedOrSigned(part)) { return part; } Part foundPart; foundPart = findPrimaryPartInAlternative(part); if (foundPart != null) { return foundPart; } foundPart = findPrimaryPartInMixed(part, outputExtraParts); if (f...
MessageCryptoStructureDetector { public static Part findPrimaryEncryptedOrSignedPart(Part part, List<Part> outputExtraParts) { if (isPartEncryptedOrSigned(part)) { return part; } Part foundPart; foundPart = findPrimaryPartInAlternative(part); if (foundPart != null) { return foundPart; } foundPart = findPrimaryPartInMix...
MessageCryptoStructureDetector { public static Part findPrimaryEncryptedOrSignedPart(Part part, List<Part> outputExtraParts) { if (isPartEncryptedOrSigned(part)) { return part; } Part foundPart; foundPart = findPrimaryPartInAlternative(part); if (foundPart != null) { return foundPart; } foundPart = findPrimaryPartInMix...
MessageCryptoStructureDetector { public static Part findPrimaryEncryptedOrSignedPart(Part part, List<Part> outputExtraParts) { if (isPartEncryptedOrSigned(part)) { return part; } Part foundPart; foundPart = findPrimaryPartInAlternative(part); if (foundPart != null) { return foundPart; } foundPart = findPrimaryPartInMix...
MessageCryptoStructureDetector { public static Part findPrimaryEncryptedOrSignedPart(Part part, List<Part> outputExtraParts) { if (isPartEncryptedOrSigned(part)) { return part; } Part foundPart; foundPart = findPrimaryPartInAlternative(part); if (foundPart != null) { return foundPart; } foundPart = findPrimaryPartInMix...
@Test public void testSimpleHtmlMessage() throws MessagingException { String bodyText = "<strong>K-9 Mail</strong> rocks :&gt;"; TextBody body = new TextBody(bodyText); MimeMessage message = new MimeMessage(); message.setHeader(MimeHeader.HEADER_CONTENT_TYPE, "text/html"); MimeMessageHelper.setBody(message, body); Arra...
@VisibleForTesting ViewableExtractedText extractTextFromViewables(List<Viewable> viewables) throws MessagingException { try { boolean hideDivider = true; StringBuilder text = new StringBuilder(); StringBuilder html = new StringBuilder(); for (Viewable viewable : viewables) { if (viewable instanceof Textual) { text.appe...
MessageViewInfoExtractor { @VisibleForTesting ViewableExtractedText extractTextFromViewables(List<Viewable> viewables) throws MessagingException { try { boolean hideDivider = true; StringBuilder text = new StringBuilder(); StringBuilder html = new StringBuilder(); for (Viewable viewable : viewables) { if (viewable inst...
MessageViewInfoExtractor { @VisibleForTesting ViewableExtractedText extractTextFromViewables(List<Viewable> viewables) throws MessagingException { try { boolean hideDivider = true; StringBuilder text = new StringBuilder(); StringBuilder html = new StringBuilder(); for (Viewable viewable : viewables) { if (viewable inst...
MessageViewInfoExtractor { @VisibleForTesting ViewableExtractedText extractTextFromViewables(List<Viewable> viewables) throws MessagingException { try { boolean hideDivider = true; StringBuilder text = new StringBuilder(); StringBuilder html = new StringBuilder(); for (Viewable viewable : viewables) { if (viewable inst...
MessageViewInfoExtractor { @VisibleForTesting ViewableExtractedText extractTextFromViewables(List<Viewable> viewables) throws MessagingException { try { boolean hideDivider = true; StringBuilder text = new StringBuilder(); StringBuilder html = new StringBuilder(); for (Viewable viewable : viewables) { if (viewable inst...
@Test public void testMultipartPlainTextMessage() throws MessagingException { String bodyText1 = "text body 1"; String bodyText2 = "text body 2"; TextBody body1 = new TextBody(bodyText1); TextBody body2 = new TextBody(bodyText2); MimeMultipart multipart = MimeMultipart.newInstance(); MimeBodyPart bodyPart1 = new MimeBo...
@VisibleForTesting ViewableExtractedText extractTextFromViewables(List<Viewable> viewables) throws MessagingException { try { boolean hideDivider = true; StringBuilder text = new StringBuilder(); StringBuilder html = new StringBuilder(); for (Viewable viewable : viewables) { if (viewable instanceof Textual) { text.appe...
MessageViewInfoExtractor { @VisibleForTesting ViewableExtractedText extractTextFromViewables(List<Viewable> viewables) throws MessagingException { try { boolean hideDivider = true; StringBuilder text = new StringBuilder(); StringBuilder html = new StringBuilder(); for (Viewable viewable : viewables) { if (viewable inst...
MessageViewInfoExtractor { @VisibleForTesting ViewableExtractedText extractTextFromViewables(List<Viewable> viewables) throws MessagingException { try { boolean hideDivider = true; StringBuilder text = new StringBuilder(); StringBuilder html = new StringBuilder(); for (Viewable viewable : viewables) { if (viewable inst...
MessageViewInfoExtractor { @VisibleForTesting ViewableExtractedText extractTextFromViewables(List<Viewable> viewables) throws MessagingException { try { boolean hideDivider = true; StringBuilder text = new StringBuilder(); StringBuilder html = new StringBuilder(); for (Viewable viewable : viewables) { if (viewable inst...
MessageViewInfoExtractor { @VisibleForTesting ViewableExtractedText extractTextFromViewables(List<Viewable> viewables) throws MessagingException { try { boolean hideDivider = true; StringBuilder text = new StringBuilder(); StringBuilder html = new StringBuilder(); for (Viewable viewable : viewables) { if (viewable inst...
@Test public void testTextPlusRfc822Message() throws MessagingException { K9ActivityCommon.setLanguage(context, "en"); Locale.setDefault(Locale.US); TimeZone.setDefault(TimeZone.getTimeZone("GMT+01:00")); String innerBodyText = "Hey there. I'm inside a message/rfc822 (inline) attachment."; TextBody textBody = new TextB...
@VisibleForTesting ViewableExtractedText extractTextFromViewables(List<Viewable> viewables) throws MessagingException { try { boolean hideDivider = true; StringBuilder text = new StringBuilder(); StringBuilder html = new StringBuilder(); for (Viewable viewable : viewables) { if (viewable instanceof Textual) { text.appe...
MessageViewInfoExtractor { @VisibleForTesting ViewableExtractedText extractTextFromViewables(List<Viewable> viewables) throws MessagingException { try { boolean hideDivider = true; StringBuilder text = new StringBuilder(); StringBuilder html = new StringBuilder(); for (Viewable viewable : viewables) { if (viewable inst...
MessageViewInfoExtractor { @VisibleForTesting ViewableExtractedText extractTextFromViewables(List<Viewable> viewables) throws MessagingException { try { boolean hideDivider = true; StringBuilder text = new StringBuilder(); StringBuilder html = new StringBuilder(); for (Viewable viewable : viewables) { if (viewable inst...
MessageViewInfoExtractor { @VisibleForTesting ViewableExtractedText extractTextFromViewables(List<Viewable> viewables) throws MessagingException { try { boolean hideDivider = true; StringBuilder text = new StringBuilder(); StringBuilder html = new StringBuilder(); for (Viewable viewable : viewables) { if (viewable inst...
MessageViewInfoExtractor { @VisibleForTesting ViewableExtractedText extractTextFromViewables(List<Viewable> viewables) throws MessagingException { try { boolean hideDivider = true; StringBuilder text = new StringBuilder(); StringBuilder html = new StringBuilder(); for (Viewable viewable : viewables) { if (viewable inst...
@Test public void testMultipartDigestWithMessages() throws Exception { String data = "Content-Type: multipart/digest; boundary=\"bndry\"\r\n" + "\r\n" + "--bndry\r\n" + "\r\n" + "Content-Type: text/plain\r\n" + "\r\n" + "text body of first message\r\n" + "\r\n" + "--bndry\r\n" + "\r\n" + "Subject: subject of second mes...
@VisibleForTesting ViewableExtractedText extractTextFromViewables(List<Viewable> viewables) throws MessagingException { try { boolean hideDivider = true; StringBuilder text = new StringBuilder(); StringBuilder html = new StringBuilder(); for (Viewable viewable : viewables) { if (viewable instanceof Textual) { text.appe...
MessageViewInfoExtractor { @VisibleForTesting ViewableExtractedText extractTextFromViewables(List<Viewable> viewables) throws MessagingException { try { boolean hideDivider = true; StringBuilder text = new StringBuilder(); StringBuilder html = new StringBuilder(); for (Viewable viewable : viewables) { if (viewable inst...
MessageViewInfoExtractor { @VisibleForTesting ViewableExtractedText extractTextFromViewables(List<Viewable> viewables) throws MessagingException { try { boolean hideDivider = true; StringBuilder text = new StringBuilder(); StringBuilder html = new StringBuilder(); for (Viewable viewable : viewables) { if (viewable inst...
MessageViewInfoExtractor { @VisibleForTesting ViewableExtractedText extractTextFromViewables(List<Viewable> viewables) throws MessagingException { try { boolean hideDivider = true; StringBuilder text = new StringBuilder(); StringBuilder html = new StringBuilder(); for (Viewable viewable : viewables) { if (viewable inst...
MessageViewInfoExtractor { @VisibleForTesting ViewableExtractedText extractTextFromViewables(List<Viewable> viewables) throws MessagingException { try { boolean hideDivider = true; StringBuilder text = new StringBuilder(); StringBuilder html = new StringBuilder(); for (Viewable viewable : viewables) { if (viewable inst...
@Test public void extractMessage_withAttachment() throws Exception { BodyPart attachmentPart = bodypart("application/octet-stream"); Message message = messageFromBody(multipart("mixed", bodypart("text/plain", "text"), attachmentPart )); AttachmentViewInfo attachmentViewInfo = mock(AttachmentViewInfo.class); setupAttach...
@WorkerThread public MessageViewInfo extractMessageForView(Message message, @Nullable MessageCryptoAnnotations cryptoAnnotations) throws MessagingException { ArrayList<Part> extraParts = new ArrayList<>(); Part cryptoContentPart = MessageCryptoStructureDetector.findPrimaryEncryptedOrSignedPart(message, extraParts); if ...
MessageViewInfoExtractor { @WorkerThread public MessageViewInfo extractMessageForView(Message message, @Nullable MessageCryptoAnnotations cryptoAnnotations) throws MessagingException { ArrayList<Part> extraParts = new ArrayList<>(); Part cryptoContentPart = MessageCryptoStructureDetector.findPrimaryEncryptedOrSignedPar...
MessageViewInfoExtractor { @WorkerThread public MessageViewInfo extractMessageForView(Message message, @Nullable MessageCryptoAnnotations cryptoAnnotations) throws MessagingException { ArrayList<Part> extraParts = new ArrayList<>(); Part cryptoContentPart = MessageCryptoStructureDetector.findPrimaryEncryptedOrSignedPar...
MessageViewInfoExtractor { @WorkerThread public MessageViewInfo extractMessageForView(Message message, @Nullable MessageCryptoAnnotations cryptoAnnotations) throws MessagingException { ArrayList<Part> extraParts = new ArrayList<>(); Part cryptoContentPart = MessageCryptoStructureDetector.findPrimaryEncryptedOrSignedPar...
MessageViewInfoExtractor { @WorkerThread public MessageViewInfo extractMessageForView(Message message, @Nullable MessageCryptoAnnotations cryptoAnnotations) throws MessagingException { ArrayList<Part> extraParts = new ArrayList<>(); Part cryptoContentPart = MessageCryptoStructureDetector.findPrimaryEncryptedOrSignedPar...
@Test public void extractMessage_withCryptoAnnotation() throws Exception { Message message = messageFromBody(multipart("signed", "protocol=\"application/pgp-signature\"", bodypart("text/plain", "text"), bodypart("application/pgp-signature") )); CryptoResultAnnotation annotation = CryptoResultAnnotation.createOpenPgpRes...
@WorkerThread public MessageViewInfo extractMessageForView(Message message, @Nullable MessageCryptoAnnotations cryptoAnnotations) throws MessagingException { ArrayList<Part> extraParts = new ArrayList<>(); Part cryptoContentPart = MessageCryptoStructureDetector.findPrimaryEncryptedOrSignedPart(message, extraParts); if ...
MessageViewInfoExtractor { @WorkerThread public MessageViewInfo extractMessageForView(Message message, @Nullable MessageCryptoAnnotations cryptoAnnotations) throws MessagingException { ArrayList<Part> extraParts = new ArrayList<>(); Part cryptoContentPart = MessageCryptoStructureDetector.findPrimaryEncryptedOrSignedPar...
MessageViewInfoExtractor { @WorkerThread public MessageViewInfo extractMessageForView(Message message, @Nullable MessageCryptoAnnotations cryptoAnnotations) throws MessagingException { ArrayList<Part> extraParts = new ArrayList<>(); Part cryptoContentPart = MessageCryptoStructureDetector.findPrimaryEncryptedOrSignedPar...
MessageViewInfoExtractor { @WorkerThread public MessageViewInfo extractMessageForView(Message message, @Nullable MessageCryptoAnnotations cryptoAnnotations) throws MessagingException { ArrayList<Part> extraParts = new ArrayList<>(); Part cryptoContentPart = MessageCryptoStructureDetector.findPrimaryEncryptedOrSignedPar...
MessageViewInfoExtractor { @WorkerThread public MessageViewInfo extractMessageForView(Message message, @Nullable MessageCryptoAnnotations cryptoAnnotations) throws MessagingException { ArrayList<Part> extraParts = new ArrayList<>(); Part cryptoContentPart = MessageCryptoStructureDetector.findPrimaryEncryptedOrSignedPar...