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 testShowSendFailedNotification() throws Exception { Exception exception = new Exception(); sendFailedNotifications.showSendFailedNotification(account, exception); verify(notificationManager).notify(eq(notificationId), any(Notification.class)); verify(builder).setSmallIcon(R.drawable.notification_icon_... | public void showSendFailedNotification(Account account, Exception exception) { Context context = controller.getContext(); String title = context.getString(R.string.send_failure_subject); String text = ExceptionHelper.getRootCauseMessage(exception); int notificationId = NotificationIds.getSendFailedNotificationId(accoun... | SendFailedNotifications { public void showSendFailedNotification(Account account, Exception exception) { Context context = controller.getContext(); String title = context.getString(R.string.send_failure_subject); String text = ExceptionHelper.getRootCauseMessage(exception); int notificationId = NotificationIds.getSendF... | SendFailedNotifications { public void showSendFailedNotification(Account account, Exception exception) { Context context = controller.getContext(); String title = context.getString(R.string.send_failure_subject); String text = ExceptionHelper.getRootCauseMessage(exception); int notificationId = NotificationIds.getSendF... | SendFailedNotifications { public void showSendFailedNotification(Account account, Exception exception) { Context context = controller.getContext(); String title = context.getString(R.string.send_failure_subject); String text = ExceptionHelper.getRootCauseMessage(exception); int notificationId = NotificationIds.getSendF... | SendFailedNotifications { public void showSendFailedNotification(Account account, Exception exception) { Context context = controller.getContext(); String title = context.getString(R.string.send_failure_subject); String text = ExceptionHelper.getRootCauseMessage(exception); int notificationId = NotificationIds.getSendF... |
@Test public void testClearSendFailedNotification() throws Exception { sendFailedNotifications.clearSendFailedNotification(account); verify(notificationManager).cancel(notificationId); } | public void clearSendFailedNotification(Account account) { int notificationId = NotificationIds.getSendFailedNotificationId(account); getNotificationManager().cancel(notificationId); } | SendFailedNotifications { public void clearSendFailedNotification(Account account) { int notificationId = NotificationIds.getSendFailedNotificationId(account); getNotificationManager().cancel(notificationId); } } | SendFailedNotifications { public void clearSendFailedNotification(Account account) { int notificationId = NotificationIds.getSendFailedNotificationId(account); getNotificationManager().cancel(notificationId); } SendFailedNotifications(NotificationController controller, NotificationActionCreator actionBuilder); } | SendFailedNotifications { public void clearSendFailedNotification(Account account) { int notificationId = NotificationIds.getSendFailedNotificationId(account); getNotificationManager().cancel(notificationId); } SendFailedNotifications(NotificationController controller, NotificationActionCreator actionBuilder); void sho... | SendFailedNotifications { public void clearSendFailedNotification(Account account) { int notificationId = NotificationIds.getSendFailedNotificationId(account); getNotificationManager().cancel(notificationId); } SendFailedNotifications(NotificationController controller, NotificationActionCreator actionBuilder); void sho... |
@Test public void testAddNotificationContent() throws Exception { NotificationContent content = createNotificationContent("1"); AddNotificationResult result = notificationData.addNotificationContent(content); assertFalse(result.shouldCancelNotification()); NotificationHolder holder = result.getNotificationHolder(); ass... | public AddNotificationResult addNotificationContent(NotificationContent content) { int notificationId; boolean cancelNotificationIdBeforeReuse; if (isMaxNumberOfActiveNotificationsReached()) { NotificationHolder notificationHolder = activeNotifications.removeLast(); addToAdditionalNotifications(notificationHolder); not... | NotificationData { public AddNotificationResult addNotificationContent(NotificationContent content) { int notificationId; boolean cancelNotificationIdBeforeReuse; if (isMaxNumberOfActiveNotificationsReached()) { NotificationHolder notificationHolder = activeNotifications.removeLast(); addToAdditionalNotifications(notif... | NotificationData { public AddNotificationResult addNotificationContent(NotificationContent content) { int notificationId; boolean cancelNotificationIdBeforeReuse; if (isMaxNumberOfActiveNotificationsReached()) { NotificationHolder notificationHolder = activeNotifications.removeLast(); addToAdditionalNotifications(notif... | NotificationData { public AddNotificationResult addNotificationContent(NotificationContent content) { int notificationId; boolean cancelNotificationIdBeforeReuse; if (isMaxNumberOfActiveNotificationsReached()) { NotificationHolder notificationHolder = activeNotifications.removeLast(); addToAdditionalNotifications(notif... | NotificationData { public AddNotificationResult addNotificationContent(NotificationContent content) { int notificationId; boolean cancelNotificationIdBeforeReuse; if (isMaxNumberOfActiveNotificationsReached()) { NotificationHolder notificationHolder = activeNotifications.removeLast(); addToAdditionalNotifications(notif... |
@Test public void testAddNotificationContentWithReplacingNotification() throws Exception { notificationData.addNotificationContent(createNotificationContent("1")); notificationData.addNotificationContent(createNotificationContent("2")); notificationData.addNotificationContent(createNotificationContent("3")); notificati... | public AddNotificationResult addNotificationContent(NotificationContent content) { int notificationId; boolean cancelNotificationIdBeforeReuse; if (isMaxNumberOfActiveNotificationsReached()) { NotificationHolder notificationHolder = activeNotifications.removeLast(); addToAdditionalNotifications(notificationHolder); not... | NotificationData { public AddNotificationResult addNotificationContent(NotificationContent content) { int notificationId; boolean cancelNotificationIdBeforeReuse; if (isMaxNumberOfActiveNotificationsReached()) { NotificationHolder notificationHolder = activeNotifications.removeLast(); addToAdditionalNotifications(notif... | NotificationData { public AddNotificationResult addNotificationContent(NotificationContent content) { int notificationId; boolean cancelNotificationIdBeforeReuse; if (isMaxNumberOfActiveNotificationsReached()) { NotificationHolder notificationHolder = activeNotifications.removeLast(); addToAdditionalNotifications(notif... | NotificationData { public AddNotificationResult addNotificationContent(NotificationContent content) { int notificationId; boolean cancelNotificationIdBeforeReuse; if (isMaxNumberOfActiveNotificationsReached()) { NotificationHolder notificationHolder = activeNotifications.removeLast(); addToAdditionalNotifications(notif... | NotificationData { public AddNotificationResult addNotificationContent(NotificationContent content) { int notificationId; boolean cancelNotificationIdBeforeReuse; if (isMaxNumberOfActiveNotificationsReached()) { NotificationHolder notificationHolder = activeNotifications.removeLast(); addToAdditionalNotifications(notif... |
@Test public void findSigned__withEmptyProtocol__shouldReturnRoot() throws Exception { Message message = messageFromBody( multipart("signed", bodypart("text/plain", "content"), bodypart("application/pgp-signature") ) ); List<Part> signedParts = MessageCryptoStructureDetector .findMultipartSignedParts(message, messageCr... | public static List<Part> findMultipartSignedParts(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 (messageCryptoAn... | MessageCryptoStructureDetector { public static List<Part> findMultipartSignedParts(Part startPart, MessageCryptoAnnotations messageCryptoAnnotations) { List<Part> signedParts = new ArrayList<>(); Stack<Part> partsToCheck = new Stack<>(); partsToCheck.push(startPart); while (!partsToCheck.isEmpty()) { Part part = partsT... | MessageCryptoStructureDetector { public static List<Part> findMultipartSignedParts(Part startPart, MessageCryptoAnnotations messageCryptoAnnotations) { List<Part> signedParts = new ArrayList<>(); Stack<Part> partsToCheck = new Stack<>(); partsToCheck.push(startPart); while (!partsToCheck.isEmpty()) { Part part = partsT... | MessageCryptoStructureDetector { public static List<Part> findMultipartSignedParts(Part startPart, MessageCryptoAnnotations messageCryptoAnnotations) { List<Part> signedParts = new ArrayList<>(); Stack<Part> partsToCheck = new Stack<>(); partsToCheck.push(startPart); while (!partsToCheck.isEmpty()) { Part part = partsT... | MessageCryptoStructureDetector { public static List<Part> findMultipartSignedParts(Part startPart, MessageCryptoAnnotations messageCryptoAnnotations) { List<Part> signedParts = new ArrayList<>(); Stack<Part> partsToCheck = new Stack<>(); partsToCheck.push(startPart); while (!partsToCheck.isEmpty()) { Part part = partsT... |
@Test public void testRemoveNotificationForMessage() throws Exception { NotificationContent content = createNotificationContent("1"); notificationData.addNotificationContent(content); RemoveNotificationResult result = notificationData.removeNotificationForMessage(content.messageReference); assertFalse(result.isUnknownN... | public RemoveNotificationResult removeNotificationForMessage(MessageReference messageReference) { NotificationHolder holder = getNotificationHolderForMessage(messageReference); if (holder == null) { return RemoveNotificationResult.unknownNotification(); } activeNotifications.remove(holder); int notificationId = holder.... | NotificationData { public RemoveNotificationResult removeNotificationForMessage(MessageReference messageReference) { NotificationHolder holder = getNotificationHolderForMessage(messageReference); if (holder == null) { return RemoveNotificationResult.unknownNotification(); } activeNotifications.remove(holder); int notif... | NotificationData { public RemoveNotificationResult removeNotificationForMessage(MessageReference messageReference) { NotificationHolder holder = getNotificationHolderForMessage(messageReference); if (holder == null) { return RemoveNotificationResult.unknownNotification(); } activeNotifications.remove(holder); int notif... | NotificationData { public RemoveNotificationResult removeNotificationForMessage(MessageReference messageReference) { NotificationHolder holder = getNotificationHolderForMessage(messageReference); if (holder == null) { return RemoveNotificationResult.unknownNotification(); } activeNotifications.remove(holder); int notif... | NotificationData { public RemoveNotificationResult removeNotificationForMessage(MessageReference messageReference) { NotificationHolder holder = getNotificationHolderForMessage(messageReference); if (holder == null) { return RemoveNotificationResult.unknownNotification(); } activeNotifications.remove(holder); int notif... |
@Test public void testContainsStarredMessages() throws Exception { assertFalse(notificationData.containsStarredMessages()); notificationData.addNotificationContent(createNotificationContentForStarredMessage()); assertTrue(notificationData.containsStarredMessages()); } | public boolean containsStarredMessages() { for (NotificationHolder holder : activeNotifications) { if (holder.content.starred) { return true; } } for (NotificationContent content : additionalNotifications) { if (content.starred) { return true; } } return false; } | NotificationData { public boolean containsStarredMessages() { for (NotificationHolder holder : activeNotifications) { if (holder.content.starred) { return true; } } for (NotificationContent content : additionalNotifications) { if (content.starred) { return true; } } return false; } } | NotificationData { public boolean containsStarredMessages() { for (NotificationHolder holder : activeNotifications) { if (holder.content.starred) { return true; } } for (NotificationContent content : additionalNotifications) { if (content.starred) { return true; } } return false; } NotificationData(Account account); } | NotificationData { public boolean containsStarredMessages() { for (NotificationHolder holder : activeNotifications) { if (holder.content.starred) { return true; } } for (NotificationContent content : additionalNotifications) { if (content.starred) { return true; } } return false; } NotificationData(Account account); Ad... | NotificationData { public boolean containsStarredMessages() { for (NotificationHolder holder : activeNotifications) { if (holder.content.starred) { return true; } } for (NotificationContent content : additionalNotifications) { if (content.starred) { return true; } } return false; } NotificationData(Account account); Ad... |
@Test public void testIsSingleMessageNotification() throws Exception { assertFalse(notificationData.isSingleMessageNotification()); notificationData.addNotificationContent(createNotificationContent("1")); assertTrue(notificationData.isSingleMessageNotification()); notificationData.addNotificationContent(createNotificat... | public boolean isSingleMessageNotification() { return activeNotifications.size() == 1; } | NotificationData { public boolean isSingleMessageNotification() { return activeNotifications.size() == 1; } } | NotificationData { public boolean isSingleMessageNotification() { return activeNotifications.size() == 1; } NotificationData(Account account); } | NotificationData { public boolean isSingleMessageNotification() { return activeNotifications.size() == 1; } NotificationData(Account account); AddNotificationResult addNotificationContent(NotificationContent content); boolean containsStarredMessages(); boolean hasSummaryOverflowMessages(); int getSummaryOverflowMessage... | NotificationData { public boolean isSingleMessageNotification() { return activeNotifications.size() == 1; } NotificationData(Account account); AddNotificationResult addNotificationContent(NotificationContent content); boolean containsStarredMessages(); boolean hasSummaryOverflowMessages(); int getSummaryOverflowMessage... |
@Test public void testGetContentForSummaryNotification() throws Exception { notificationData.addNotificationContent(createNotificationContent("1")); NotificationContent content4 = createNotificationContent("2"); notificationData.addNotificationContent(content4); NotificationContent content3 = createNotificationContent(... | public List<NotificationContent> getContentForSummaryNotification() { int size = calculateNumberOfMessagesForSummaryNotification(); List<NotificationContent> result = new ArrayList<NotificationContent>(size); Iterator<NotificationHolder> iterator = activeNotifications.iterator(); int notificationCount = 0; while (itera... | NotificationData { public List<NotificationContent> getContentForSummaryNotification() { int size = calculateNumberOfMessagesForSummaryNotification(); List<NotificationContent> result = new ArrayList<NotificationContent>(size); Iterator<NotificationHolder> iterator = activeNotifications.iterator(); int notificationCoun... | NotificationData { public List<NotificationContent> getContentForSummaryNotification() { int size = calculateNumberOfMessagesForSummaryNotification(); List<NotificationContent> result = new ArrayList<NotificationContent>(size); Iterator<NotificationHolder> iterator = activeNotifications.iterator(); int notificationCoun... | NotificationData { public List<NotificationContent> getContentForSummaryNotification() { int size = calculateNumberOfMessagesForSummaryNotification(); List<NotificationContent> result = new ArrayList<NotificationContent>(size); Iterator<NotificationHolder> iterator = activeNotifications.iterator(); int notificationCoun... | NotificationData { public List<NotificationContent> getContentForSummaryNotification() { int size = calculateNumberOfMessagesForSummaryNotification(); List<NotificationContent> result = new ArrayList<NotificationContent>(size); Iterator<NotificationHolder> iterator = activeNotifications.iterator(); int notificationCoun... |
@Test public void testGetActiveNotificationIds() throws Exception { notificationData.addNotificationContent(createNotificationContent("1")); notificationData.addNotificationContent(createNotificationContent("2")); int[] notificationIds = notificationData.getActiveNotificationIds(); assertEquals(2, notificationIds.lengt... | public int[] getActiveNotificationIds() { int size = activeNotifications.size(); int[] notificationIds = new int[size]; for (int i = 0; i < size; i++) { NotificationHolder holder = activeNotifications.get(i); notificationIds[i] = holder.notificationId; } return notificationIds; } | NotificationData { public int[] getActiveNotificationIds() { int size = activeNotifications.size(); int[] notificationIds = new int[size]; for (int i = 0; i < size; i++) { NotificationHolder holder = activeNotifications.get(i); notificationIds[i] = holder.notificationId; } return notificationIds; } } | NotificationData { public int[] getActiveNotificationIds() { int size = activeNotifications.size(); int[] notificationIds = new int[size]; for (int i = 0; i < size; i++) { NotificationHolder holder = activeNotifications.get(i); notificationIds[i] = holder.notificationId; } return notificationIds; } NotificationData(Acc... | NotificationData { public int[] getActiveNotificationIds() { int size = activeNotifications.size(); int[] notificationIds = new int[size]; for (int i = 0; i < size; i++) { NotificationHolder holder = activeNotifications.get(i); notificationIds[i] = holder.notificationId; } return notificationIds; } NotificationData(Acc... | NotificationData { public int[] getActiveNotificationIds() { int size = activeNotifications.size(); int[] notificationIds = new int[size]; for (int i = 0; i < size; i++) { NotificationHolder holder = activeNotifications.get(i); notificationIds[i] = holder.notificationId; } return notificationIds; } NotificationData(Acc... |
@Test public void testGetAccount() throws Exception { assertEquals(account, notificationData.getAccount()); } | public Account getAccount() { return account; } | NotificationData { public Account getAccount() { return account; } } | NotificationData { public Account getAccount() { return account; } NotificationData(Account account); } | NotificationData { public Account getAccount() { return account; } NotificationData(Account account); AddNotificationResult addNotificationContent(NotificationContent content); boolean containsStarredMessages(); boolean hasSummaryOverflowMessages(); int getSummaryOverflowMessagesCount(); int getNewMessagesCount(); bool... | NotificationData { public Account getAccount() { return account; } NotificationData(Account account); AddNotificationResult addNotificationContent(NotificationContent content); boolean containsStarredMessages(); boolean hasSummaryOverflowMessages(); int getSummaryOverflowMessagesCount(); int getNewMessagesCount(); bool... |
@Test public void testGetAllMessageReferences() throws Exception { MessageReference messageReference0 = createMessageReference("1"); MessageReference messageReference1 = createMessageReference("2"); MessageReference messageReference2 = createMessageReference("3"); MessageReference messageReference3 = createMessageRefer... | public ArrayList<MessageReference> getAllMessageReferences() { int newSize = activeNotifications.size() + additionalNotifications.size(); ArrayList<MessageReference> messageReferences = new ArrayList<MessageReference>(newSize); for (NotificationHolder holder : activeNotifications) { messageReferences.add(holder.content... | NotificationData { public ArrayList<MessageReference> getAllMessageReferences() { int newSize = activeNotifications.size() + additionalNotifications.size(); ArrayList<MessageReference> messageReferences = new ArrayList<MessageReference>(newSize); for (NotificationHolder holder : activeNotifications) { messageReferences... | NotificationData { public ArrayList<MessageReference> getAllMessageReferences() { int newSize = activeNotifications.size() + additionalNotifications.size(); ArrayList<MessageReference> messageReferences = new ArrayList<MessageReference>(newSize); for (NotificationHolder holder : activeNotifications) { messageReferences... | NotificationData { public ArrayList<MessageReference> getAllMessageReferences() { int newSize = activeNotifications.size() + additionalNotifications.size(); ArrayList<MessageReference> messageReferences = new ArrayList<MessageReference>(newSize); for (NotificationHolder holder : activeNotifications) { messageReferences... | NotificationData { public ArrayList<MessageReference> getAllMessageReferences() { int newSize = activeNotifications.size() + additionalNotifications.size(); ArrayList<MessageReference> messageReferences = new ArrayList<MessageReference>(newSize); for (NotificationHolder holder : activeNotifications) { messageReferences... |
@Test public void testAddNewMailNotification() throws Exception { int notificationIndex = 0; LocalMessage message = createLocalMessage(); NotificationContent content = createNotificationContent(); NotificationHolder holder = createNotificationHolder(content, notificationIndex); addToNotificationContentCreator(message, ... | public void addNewMailNotification(Account account, LocalMessage message, int unreadMessageCount) { NotificationContent content = contentCreator.createFromMessage(account, message); synchronized (lock) { NotificationData notificationData = getOrCreateNotificationData(account, unreadMessageCount); AddNotificationResult ... | NewMailNotifications { public void addNewMailNotification(Account account, LocalMessage message, int unreadMessageCount) { NotificationContent content = contentCreator.createFromMessage(account, message); synchronized (lock) { NotificationData notificationData = getOrCreateNotificationData(account, unreadMessageCount);... | NewMailNotifications { public void addNewMailNotification(Account account, LocalMessage message, int unreadMessageCount) { NotificationContent content = contentCreator.createFromMessage(account, message); synchronized (lock) { NotificationData notificationData = getOrCreateNotificationData(account, unreadMessageCount);... | NewMailNotifications { public void addNewMailNotification(Account account, LocalMessage message, int unreadMessageCount) { NotificationContent content = contentCreator.createFromMessage(account, message); synchronized (lock) { NotificationData notificationData = getOrCreateNotificationData(account, unreadMessageCount);... | NewMailNotifications { public void addNewMailNotification(Account account, LocalMessage message, int unreadMessageCount) { NotificationContent content = contentCreator.createFromMessage(account, message); synchronized (lock) { NotificationData notificationData = getOrCreateNotificationData(account, unreadMessageCount);... |
@Test public void testAddNewMailNotificationWithCancelingExistingNotification() throws Exception { int notificationIndex = 0; LocalMessage message = createLocalMessage(); NotificationContent content = createNotificationContent(); NotificationHolder holder = createNotificationHolder(content, notificationIndex); addToNot... | public void addNewMailNotification(Account account, LocalMessage message, int unreadMessageCount) { NotificationContent content = contentCreator.createFromMessage(account, message); synchronized (lock) { NotificationData notificationData = getOrCreateNotificationData(account, unreadMessageCount); AddNotificationResult ... | NewMailNotifications { public void addNewMailNotification(Account account, LocalMessage message, int unreadMessageCount) { NotificationContent content = contentCreator.createFromMessage(account, message); synchronized (lock) { NotificationData notificationData = getOrCreateNotificationData(account, unreadMessageCount);... | NewMailNotifications { public void addNewMailNotification(Account account, LocalMessage message, int unreadMessageCount) { NotificationContent content = contentCreator.createFromMessage(account, message); synchronized (lock) { NotificationData notificationData = getOrCreateNotificationData(account, unreadMessageCount);... | NewMailNotifications { public void addNewMailNotification(Account account, LocalMessage message, int unreadMessageCount) { NotificationContent content = contentCreator.createFromMessage(account, message); synchronized (lock) { NotificationData notificationData = getOrCreateNotificationData(account, unreadMessageCount);... | NewMailNotifications { public void addNewMailNotification(Account account, LocalMessage message, int unreadMessageCount) { NotificationContent content = contentCreator.createFromMessage(account, message); synchronized (lock) { NotificationData notificationData = getOrCreateNotificationData(account, unreadMessageCount);... |
@Test public void testAddNewMailNotificationWithPrivacyModeEnabled() throws Exception { enablePrivacyMode(); int notificationIndex = 0; LocalMessage message = createLocalMessage(); NotificationContent content = createNotificationContent(); NotificationHolder holder = createNotificationHolder(content, notificationIndex)... | public void addNewMailNotification(Account account, LocalMessage message, int unreadMessageCount) { NotificationContent content = contentCreator.createFromMessage(account, message); synchronized (lock) { NotificationData notificationData = getOrCreateNotificationData(account, unreadMessageCount); AddNotificationResult ... | NewMailNotifications { public void addNewMailNotification(Account account, LocalMessage message, int unreadMessageCount) { NotificationContent content = contentCreator.createFromMessage(account, message); synchronized (lock) { NotificationData notificationData = getOrCreateNotificationData(account, unreadMessageCount);... | NewMailNotifications { public void addNewMailNotification(Account account, LocalMessage message, int unreadMessageCount) { NotificationContent content = contentCreator.createFromMessage(account, message); synchronized (lock) { NotificationData notificationData = getOrCreateNotificationData(account, unreadMessageCount);... | NewMailNotifications { public void addNewMailNotification(Account account, LocalMessage message, int unreadMessageCount) { NotificationContent content = contentCreator.createFromMessage(account, message); synchronized (lock) { NotificationData notificationData = getOrCreateNotificationData(account, unreadMessageCount);... | NewMailNotifications { public void addNewMailNotification(Account account, LocalMessage message, int unreadMessageCount) { NotificationContent content = contentCreator.createFromMessage(account, message); synchronized (lock) { NotificationData notificationData = getOrCreateNotificationData(account, unreadMessageCount);... |
@Test public void findSigned__withMissingSignature__shouldReturnEmpty() throws Exception { Message message = messageFromBody( multipart("signed", "protocol=\"application/pgp-signature\"", bodypart("text/plain") ) ); List<Part> signedParts = MessageCryptoStructureDetector .findMultipartSignedParts(message, messageCrypto... | public static List<Part> findMultipartSignedParts(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 (messageCryptoAn... | MessageCryptoStructureDetector { public static List<Part> findMultipartSignedParts(Part startPart, MessageCryptoAnnotations messageCryptoAnnotations) { List<Part> signedParts = new ArrayList<>(); Stack<Part> partsToCheck = new Stack<>(); partsToCheck.push(startPart); while (!partsToCheck.isEmpty()) { Part part = partsT... | MessageCryptoStructureDetector { public static List<Part> findMultipartSignedParts(Part startPart, MessageCryptoAnnotations messageCryptoAnnotations) { List<Part> signedParts = new ArrayList<>(); Stack<Part> partsToCheck = new Stack<>(); partsToCheck.push(startPart); while (!partsToCheck.isEmpty()) { Part part = partsT... | MessageCryptoStructureDetector { public static List<Part> findMultipartSignedParts(Part startPart, MessageCryptoAnnotations messageCryptoAnnotations) { List<Part> signedParts = new ArrayList<>(); Stack<Part> partsToCheck = new Stack<>(); partsToCheck.push(startPart); while (!partsToCheck.isEmpty()) { Part part = partsT... | MessageCryptoStructureDetector { public static List<Part> findMultipartSignedParts(Part startPart, MessageCryptoAnnotations messageCryptoAnnotations) { List<Part> signedParts = new ArrayList<>(); Stack<Part> partsToCheck = new Stack<>(); partsToCheck.push(startPart); while (!partsToCheck.isEmpty()) { Part part = partsT... |
@Test public void testAddNewMailNotificationTwice() throws Exception { int notificationIndexOne = 0; int notificationIndexTwo = 1; LocalMessage messageOne = createLocalMessage(); LocalMessage messageTwo = createLocalMessage(); NotificationContent contentOne = createNotificationContent(); NotificationContent contentTwo ... | public void addNewMailNotification(Account account, LocalMessage message, int unreadMessageCount) { NotificationContent content = contentCreator.createFromMessage(account, message); synchronized (lock) { NotificationData notificationData = getOrCreateNotificationData(account, unreadMessageCount); AddNotificationResult ... | NewMailNotifications { public void addNewMailNotification(Account account, LocalMessage message, int unreadMessageCount) { NotificationContent content = contentCreator.createFromMessage(account, message); synchronized (lock) { NotificationData notificationData = getOrCreateNotificationData(account, unreadMessageCount);... | NewMailNotifications { public void addNewMailNotification(Account account, LocalMessage message, int unreadMessageCount) { NotificationContent content = contentCreator.createFromMessage(account, message); synchronized (lock) { NotificationData notificationData = getOrCreateNotificationData(account, unreadMessageCount);... | NewMailNotifications { public void addNewMailNotification(Account account, LocalMessage message, int unreadMessageCount) { NotificationContent content = contentCreator.createFromMessage(account, message); synchronized (lock) { NotificationData notificationData = getOrCreateNotificationData(account, unreadMessageCount);... | NewMailNotifications { public void addNewMailNotification(Account account, LocalMessage message, int unreadMessageCount) { NotificationContent content = contentCreator.createFromMessage(account, message); synchronized (lock) { NotificationData notificationData = getOrCreateNotificationData(account, unreadMessageCount);... |
@Test public void testRemoveNewMailNotificationWithoutNotificationData() throws Exception { MessageReference messageReference = createMessageReference(1); newMailNotifications.removeNewMailNotification(account, messageReference); verify(notificationManager, never()).cancel(anyInt()); } | public void removeNewMailNotification(Account account, MessageReference messageReference) { synchronized (lock) { NotificationData notificationData = getNotificationData(account); if (notificationData == null) { return; } RemoveNotificationResult result = notificationData.removeNotificationForMessage(messageReference);... | NewMailNotifications { public void removeNewMailNotification(Account account, MessageReference messageReference) { synchronized (lock) { NotificationData notificationData = getNotificationData(account); if (notificationData == null) { return; } RemoveNotificationResult result = notificationData.removeNotificationForMes... | NewMailNotifications { public void removeNewMailNotification(Account account, MessageReference messageReference) { synchronized (lock) { NotificationData notificationData = getNotificationData(account); if (notificationData == null) { return; } RemoveNotificationResult result = notificationData.removeNotificationForMes... | NewMailNotifications { public void removeNewMailNotification(Account account, MessageReference messageReference) { synchronized (lock) { NotificationData notificationData = getNotificationData(account); if (notificationData == null) { return; } RemoveNotificationResult result = notificationData.removeNotificationForMes... | NewMailNotifications { public void removeNewMailNotification(Account account, MessageReference messageReference) { synchronized (lock) { NotificationData notificationData = getNotificationData(account); if (notificationData == null) { return; } RemoveNotificationResult result = notificationData.removeNotificationForMes... |
@Test public void testRemoveNewMailNotification() throws Exception { enablePrivacyMode(); MessageReference messageReference = createMessageReference(1); int notificationIndex = 0; int notificationId = NotificationIds.getNewMailStackedNotificationId(account, notificationIndex); LocalMessage message = createLocalMessage(... | public void removeNewMailNotification(Account account, MessageReference messageReference) { synchronized (lock) { NotificationData notificationData = getNotificationData(account); if (notificationData == null) { return; } RemoveNotificationResult result = notificationData.removeNotificationForMessage(messageReference);... | NewMailNotifications { public void removeNewMailNotification(Account account, MessageReference messageReference) { synchronized (lock) { NotificationData notificationData = getNotificationData(account); if (notificationData == null) { return; } RemoveNotificationResult result = notificationData.removeNotificationForMes... | NewMailNotifications { public void removeNewMailNotification(Account account, MessageReference messageReference) { synchronized (lock) { NotificationData notificationData = getNotificationData(account); if (notificationData == null) { return; } RemoveNotificationResult result = notificationData.removeNotificationForMes... | NewMailNotifications { public void removeNewMailNotification(Account account, MessageReference messageReference) { synchronized (lock) { NotificationData notificationData = getNotificationData(account); if (notificationData == null) { return; } RemoveNotificationResult result = notificationData.removeNotificationForMes... | NewMailNotifications { public void removeNewMailNotification(Account account, MessageReference messageReference) { synchronized (lock) { NotificationData notificationData = getNotificationData(account); if (notificationData == null) { return; } RemoveNotificationResult result = notificationData.removeNotificationForMes... |
@Test public void testClearNewMailNotificationsWithoutNotificationData() throws Exception { newMailNotifications.clearNewMailNotifications(account); verify(notificationManager, never()).cancel(anyInt()); } | public void clearNewMailNotifications(Account account) { NotificationData notificationData; synchronized (lock) { notificationData = removeNotificationData(account); } if (notificationData == null) { return; } for (int notificationId : notificationData.getActiveNotificationIds()) { cancelNotification(notificationId); }... | NewMailNotifications { public void clearNewMailNotifications(Account account) { NotificationData notificationData; synchronized (lock) { notificationData = removeNotificationData(account); } if (notificationData == null) { return; } for (int notificationId : notificationData.getActiveNotificationIds()) { cancelNotifica... | NewMailNotifications { public void clearNewMailNotifications(Account account) { NotificationData notificationData; synchronized (lock) { notificationData = removeNotificationData(account); } if (notificationData == null) { return; } for (int notificationId : notificationData.getActiveNotificationIds()) { cancelNotifica... | NewMailNotifications { public void clearNewMailNotifications(Account account) { NotificationData notificationData; synchronized (lock) { notificationData = removeNotificationData(account); } if (notificationData == null) { return; } for (int notificationId : notificationData.getActiveNotificationIds()) { cancelNotifica... | NewMailNotifications { public void clearNewMailNotifications(Account account) { NotificationData notificationData; synchronized (lock) { notificationData = removeNotificationData(account); } if (notificationData == null) { return; } for (int notificationId : notificationData.getActiveNotificationIds()) { cancelNotifica... |
@Test public void testClearNewMailNotifications() throws Exception { int notificationIndex = 0; int notificationId = NotificationIds.getNewMailStackedNotificationId(account, notificationIndex); LocalMessage message = createLocalMessage(); NotificationContent content = createNotificationContent(); NotificationHolder hol... | public void clearNewMailNotifications(Account account) { NotificationData notificationData; synchronized (lock) { notificationData = removeNotificationData(account); } if (notificationData == null) { return; } for (int notificationId : notificationData.getActiveNotificationIds()) { cancelNotification(notificationId); }... | NewMailNotifications { public void clearNewMailNotifications(Account account) { NotificationData notificationData; synchronized (lock) { notificationData = removeNotificationData(account); } if (notificationData == null) { return; } for (int notificationId : notificationData.getActiveNotificationIds()) { cancelNotifica... | NewMailNotifications { public void clearNewMailNotifications(Account account) { NotificationData notificationData; synchronized (lock) { notificationData = removeNotificationData(account); } if (notificationData == null) { return; } for (int notificationId : notificationData.getActiveNotificationIds()) { cancelNotifica... | NewMailNotifications { public void clearNewMailNotifications(Account account) { NotificationData notificationData; synchronized (lock) { notificationData = removeNotificationData(account); } if (notificationData == null) { return; } for (int notificationId : notificationData.getActiveNotificationIds()) { cancelNotifica... | NewMailNotifications { public void clearNewMailNotifications(Account account) { NotificationData notificationData; synchronized (lock) { notificationData = removeNotificationData(account); } if (notificationData == null) { return; } for (int notificationId : notificationData.getActiveNotificationIds()) { cancelNotifica... |
@Test public void testShowCertificateErrorNotificationForIncomingServer() throws Exception { int notificationId = NotificationIds.getCertificateErrorNotificationId(account, INCOMING); certificateErrorNotifications.showCertificateErrorNotification(account, INCOMING); verify(notificationManager).notify(eq(notificationId)... | public void showCertificateErrorNotification(Account account, boolean incoming) { int notificationId = NotificationIds.getCertificateErrorNotificationId(account, incoming); Context context = controller.getContext(); PendingIntent editServerSettingsPendingIntent = createContentIntent(context, account, incoming); String ... | CertificateErrorNotifications { public void showCertificateErrorNotification(Account account, boolean incoming) { int notificationId = NotificationIds.getCertificateErrorNotificationId(account, incoming); Context context = controller.getContext(); PendingIntent editServerSettingsPendingIntent = createContentIntent(cont... | CertificateErrorNotifications { public void showCertificateErrorNotification(Account account, boolean incoming) { int notificationId = NotificationIds.getCertificateErrorNotificationId(account, incoming); Context context = controller.getContext(); PendingIntent editServerSettingsPendingIntent = createContentIntent(cont... | CertificateErrorNotifications { public void showCertificateErrorNotification(Account account, boolean incoming) { int notificationId = NotificationIds.getCertificateErrorNotificationId(account, incoming); Context context = controller.getContext(); PendingIntent editServerSettingsPendingIntent = createContentIntent(cont... | CertificateErrorNotifications { public void showCertificateErrorNotification(Account account, boolean incoming) { int notificationId = NotificationIds.getCertificateErrorNotificationId(account, incoming); Context context = controller.getContext(); PendingIntent editServerSettingsPendingIntent = createContentIntent(cont... |
@Test public void testClearCertificateErrorNotificationsForIncomingServer() throws Exception { int notificationId = NotificationIds.getCertificateErrorNotificationId(account, INCOMING); certificateErrorNotifications.clearCertificateErrorNotifications(account, INCOMING); verify(notificationManager).cancel(notificationId... | public void clearCertificateErrorNotifications(Account account, boolean incoming) { int notificationId = NotificationIds.getCertificateErrorNotificationId(account, incoming); getNotificationManager().cancel(notificationId); } | CertificateErrorNotifications { public void clearCertificateErrorNotifications(Account account, boolean incoming) { int notificationId = NotificationIds.getCertificateErrorNotificationId(account, incoming); getNotificationManager().cancel(notificationId); } } | CertificateErrorNotifications { public void clearCertificateErrorNotifications(Account account, boolean incoming) { int notificationId = NotificationIds.getCertificateErrorNotificationId(account, incoming); getNotificationManager().cancel(notificationId); } CertificateErrorNotifications(NotificationController controlle... | CertificateErrorNotifications { public void clearCertificateErrorNotifications(Account account, boolean incoming) { int notificationId = NotificationIds.getCertificateErrorNotificationId(account, incoming); getNotificationManager().cancel(notificationId); } CertificateErrorNotifications(NotificationController controlle... | CertificateErrorNotifications { public void clearCertificateErrorNotifications(Account account, boolean incoming) { int notificationId = NotificationIds.getCertificateErrorNotificationId(account, incoming); getNotificationManager().cancel(notificationId); } CertificateErrorNotifications(NotificationController controlle... |
@Test public void testShowCertificateErrorNotificationForOutgoingServer() throws Exception { int notificationId = NotificationIds.getCertificateErrorNotificationId(account, OUTGOING); certificateErrorNotifications.showCertificateErrorNotification(account, OUTGOING); verify(notificationManager).notify(eq(notificationId)... | public void showCertificateErrorNotification(Account account, boolean incoming) { int notificationId = NotificationIds.getCertificateErrorNotificationId(account, incoming); Context context = controller.getContext(); PendingIntent editServerSettingsPendingIntent = createContentIntent(context, account, incoming); String ... | CertificateErrorNotifications { public void showCertificateErrorNotification(Account account, boolean incoming) { int notificationId = NotificationIds.getCertificateErrorNotificationId(account, incoming); Context context = controller.getContext(); PendingIntent editServerSettingsPendingIntent = createContentIntent(cont... | CertificateErrorNotifications { public void showCertificateErrorNotification(Account account, boolean incoming) { int notificationId = NotificationIds.getCertificateErrorNotificationId(account, incoming); Context context = controller.getContext(); PendingIntent editServerSettingsPendingIntent = createContentIntent(cont... | CertificateErrorNotifications { public void showCertificateErrorNotification(Account account, boolean incoming) { int notificationId = NotificationIds.getCertificateErrorNotificationId(account, incoming); Context context = controller.getContext(); PendingIntent editServerSettingsPendingIntent = createContentIntent(cont... | CertificateErrorNotifications { public void showCertificateErrorNotification(Account account, boolean incoming) { int notificationId = NotificationIds.getCertificateErrorNotificationId(account, incoming); Context context = controller.getContext(); PendingIntent editServerSettingsPendingIntent = createContentIntent(cont... |
@Test public void testClearCertificateErrorNotificationsForOutgoingServer() throws Exception { int notificationId = NotificationIds.getCertificateErrorNotificationId(account, OUTGOING); certificateErrorNotifications.clearCertificateErrorNotifications(account, OUTGOING); verify(notificationManager).cancel(notificationId... | public void clearCertificateErrorNotifications(Account account, boolean incoming) { int notificationId = NotificationIds.getCertificateErrorNotificationId(account, incoming); getNotificationManager().cancel(notificationId); } | CertificateErrorNotifications { public void clearCertificateErrorNotifications(Account account, boolean incoming) { int notificationId = NotificationIds.getCertificateErrorNotificationId(account, incoming); getNotificationManager().cancel(notificationId); } } | CertificateErrorNotifications { public void clearCertificateErrorNotifications(Account account, boolean incoming) { int notificationId = NotificationIds.getCertificateErrorNotificationId(account, incoming); getNotificationManager().cancel(notificationId); } CertificateErrorNotifications(NotificationController controlle... | CertificateErrorNotifications { public void clearCertificateErrorNotifications(Account account, boolean incoming) { int notificationId = NotificationIds.getCertificateErrorNotificationId(account, incoming); getNotificationManager().cancel(notificationId); } CertificateErrorNotifications(NotificationController controlle... | CertificateErrorNotifications { public void clearCertificateErrorNotifications(Account account, boolean incoming) { int notificationId = NotificationIds.getCertificateErrorNotificationId(account, incoming); getNotificationManager().cancel(notificationId); } CertificateErrorNotifications(NotificationController controlle... |
@Test public void suggestServerName_forImapServer() throws Exception { Type serverType = Type.IMAP; String domainPart = "example.org"; String result = serverNameSuggester.suggestServerName(serverType, domainPart); assertEquals("imap.example.org", result); } | public String suggestServerName(Type serverType, String domainPart) { switch (serverType) { case IMAP: { return "imap." + domainPart; } case SMTP: { return "smtp." + domainPart; } case EWS: return "outlook.office365.com"; case WebDAV: { return "exchange." + domainPart; } case POP3: { return "pop3." + domainPart; } } th... | ServerNameSuggester { public String suggestServerName(Type serverType, String domainPart) { switch (serverType) { case IMAP: { return "imap." + domainPart; } case SMTP: { return "smtp." + domainPart; } case EWS: return "outlook.office365.com"; case WebDAV: { return "exchange." + domainPart; } case POP3: { return "pop3.... | ServerNameSuggester { public String suggestServerName(Type serverType, String domainPart) { switch (serverType) { case IMAP: { return "imap." + domainPart; } case SMTP: { return "smtp." + domainPart; } case EWS: return "outlook.office365.com"; case WebDAV: { return "exchange." + domainPart; } case POP3: { return "pop3.... | ServerNameSuggester { public String suggestServerName(Type serverType, String domainPart) { switch (serverType) { case IMAP: { return "imap." + domainPart; } case SMTP: { return "smtp." + domainPart; } case EWS: return "outlook.office365.com"; case WebDAV: { return "exchange." + domainPart; } case POP3: { return "pop3.... | ServerNameSuggester { public String suggestServerName(Type serverType, String domainPart) { switch (serverType) { case IMAP: { return "imap." + domainPart; } case SMTP: { return "smtp." + domainPart; } case EWS: return "outlook.office365.com"; case WebDAV: { return "exchange." + domainPart; } case POP3: { return "pop3.... |
@Test public void findSigned__withComplexMultipartSigned__shouldReturnRoot() throws Exception { Message message = messageFromBody( multipart("signed", "protocol=\"application/pgp-signature\"", multipart("mixed", bodypart("text/plain"), bodypart("application/pdf") ), bodypart("application/pgp-signature") ) ); List<Part>... | public static List<Part> findMultipartSignedParts(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 (messageCryptoAn... | MessageCryptoStructureDetector { public static List<Part> findMultipartSignedParts(Part startPart, MessageCryptoAnnotations messageCryptoAnnotations) { List<Part> signedParts = new ArrayList<>(); Stack<Part> partsToCheck = new Stack<>(); partsToCheck.push(startPart); while (!partsToCheck.isEmpty()) { Part part = partsT... | MessageCryptoStructureDetector { public static List<Part> findMultipartSignedParts(Part startPart, MessageCryptoAnnotations messageCryptoAnnotations) { List<Part> signedParts = new ArrayList<>(); Stack<Part> partsToCheck = new Stack<>(); partsToCheck.push(startPart); while (!partsToCheck.isEmpty()) { Part part = partsT... | MessageCryptoStructureDetector { public static List<Part> findMultipartSignedParts(Part startPart, MessageCryptoAnnotations messageCryptoAnnotations) { List<Part> signedParts = new ArrayList<>(); Stack<Part> partsToCheck = new Stack<>(); partsToCheck.push(startPart); while (!partsToCheck.isEmpty()) { Part part = partsT... | MessageCryptoStructureDetector { public static List<Part> findMultipartSignedParts(Part startPart, MessageCryptoAnnotations messageCryptoAnnotations) { List<Part> signedParts = new ArrayList<>(); Stack<Part> partsToCheck = new Stack<>(); partsToCheck.push(startPart); while (!partsToCheck.isEmpty()) { Part part = partsT... |
@Test public void suggestServerName_forPop3Server() throws Exception { Type serverType = Type.POP3; String domainPart = "example.org"; String result = serverNameSuggester.suggestServerName(serverType, domainPart); assertEquals("pop3.example.org", result); } | public String suggestServerName(Type serverType, String domainPart) { switch (serverType) { case IMAP: { return "imap." + domainPart; } case SMTP: { return "smtp." + domainPart; } case EWS: return "outlook.office365.com"; case WebDAV: { return "exchange." + domainPart; } case POP3: { return "pop3." + domainPart; } } th... | ServerNameSuggester { public String suggestServerName(Type serverType, String domainPart) { switch (serverType) { case IMAP: { return "imap." + domainPart; } case SMTP: { return "smtp." + domainPart; } case EWS: return "outlook.office365.com"; case WebDAV: { return "exchange." + domainPart; } case POP3: { return "pop3.... | ServerNameSuggester { public String suggestServerName(Type serverType, String domainPart) { switch (serverType) { case IMAP: { return "imap." + domainPart; } case SMTP: { return "smtp." + domainPart; } case EWS: return "outlook.office365.com"; case WebDAV: { return "exchange." + domainPart; } case POP3: { return "pop3.... | ServerNameSuggester { public String suggestServerName(Type serverType, String domainPart) { switch (serverType) { case IMAP: { return "imap." + domainPart; } case SMTP: { return "smtp." + domainPart; } case EWS: return "outlook.office365.com"; case WebDAV: { return "exchange." + domainPart; } case POP3: { return "pop3.... | ServerNameSuggester { public String suggestServerName(Type serverType, String domainPart) { switch (serverType) { case IMAP: { return "imap." + domainPart; } case SMTP: { return "smtp." + domainPart; } case EWS: return "outlook.office365.com"; case WebDAV: { return "exchange." + domainPart; } case POP3: { return "pop3.... |
@Test public void suggestServerName_forWebDavServer() throws Exception { Type serverType = Type.WebDAV; String domainPart = "example.org"; String result = serverNameSuggester.suggestServerName(serverType, domainPart); assertEquals("exchange.example.org", result); } | public String suggestServerName(Type serverType, String domainPart) { switch (serverType) { case IMAP: { return "imap." + domainPart; } case SMTP: { return "smtp." + domainPart; } case EWS: return "outlook.office365.com"; case WebDAV: { return "exchange." + domainPart; } case POP3: { return "pop3." + domainPart; } } th... | ServerNameSuggester { public String suggestServerName(Type serverType, String domainPart) { switch (serverType) { case IMAP: { return "imap." + domainPart; } case SMTP: { return "smtp." + domainPart; } case EWS: return "outlook.office365.com"; case WebDAV: { return "exchange." + domainPart; } case POP3: { return "pop3.... | ServerNameSuggester { public String suggestServerName(Type serverType, String domainPart) { switch (serverType) { case IMAP: { return "imap." + domainPart; } case SMTP: { return "smtp." + domainPart; } case EWS: return "outlook.office365.com"; case WebDAV: { return "exchange." + domainPart; } case POP3: { return "pop3.... | ServerNameSuggester { public String suggestServerName(Type serverType, String domainPart) { switch (serverType) { case IMAP: { return "imap." + domainPart; } case SMTP: { return "smtp." + domainPart; } case EWS: return "outlook.office365.com"; case WebDAV: { return "exchange." + domainPart; } case POP3: { return "pop3.... | ServerNameSuggester { public String suggestServerName(Type serverType, String domainPart) { switch (serverType) { case IMAP: { return "imap." + domainPart; } case SMTP: { return "smtp." + domainPart; } case EWS: return "outlook.office365.com"; case WebDAV: { return "exchange." + domainPart; } case POP3: { return "pop3.... |
@Test public void suggestServerName_forSmtpServer() throws Exception { Type serverType = Type.SMTP; String domainPart = "example.org"; String result = serverNameSuggester.suggestServerName(serverType, domainPart); assertEquals("smtp.example.org", result); } | public String suggestServerName(Type serverType, String domainPart) { switch (serverType) { case IMAP: { return "imap." + domainPart; } case SMTP: { return "smtp." + domainPart; } case EWS: return "outlook.office365.com"; case WebDAV: { return "exchange." + domainPart; } case POP3: { return "pop3." + domainPart; } } th... | ServerNameSuggester { public String suggestServerName(Type serverType, String domainPart) { switch (serverType) { case IMAP: { return "imap." + domainPart; } case SMTP: { return "smtp." + domainPart; } case EWS: return "outlook.office365.com"; case WebDAV: { return "exchange." + domainPart; } case POP3: { return "pop3.... | ServerNameSuggester { public String suggestServerName(Type serverType, String domainPart) { switch (serverType) { case IMAP: { return "imap." + domainPart; } case SMTP: { return "smtp." + domainPart; } case EWS: return "outlook.office365.com"; case WebDAV: { return "exchange." + domainPart; } case POP3: { return "pop3.... | ServerNameSuggester { public String suggestServerName(Type serverType, String domainPart) { switch (serverType) { case IMAP: { return "imap." + domainPart; } case SMTP: { return "smtp." + domainPart; } case EWS: return "outlook.office365.com"; case WebDAV: { return "exchange." + domainPart; } case POP3: { return "pop3.... | ServerNameSuggester { public String suggestServerName(Type serverType, String domainPart) { switch (serverType) { case IMAP: { return "imap." + domainPart; } case SMTP: { return "smtp." + domainPart; } case EWS: return "outlook.office365.com"; case WebDAV: { return "exchange." + domainPart; } case POP3: { return "pop3.... |
@Test public void wasMessageTransmittedSecurely_withNoHeaders_shouldReturnUnknown() throws MessagingException { String[] noReceivedHeaders = new String[]{}; Message unknownMessage = mock(Message.class); when(unknownMessage.getHeader("Received")).thenReturn(noReceivedHeaders); assertEquals(SecureTransportError.UNKNOWN, ... | public static SecureTransportState wasMessageTransmittedSecurely(Message message) { String[] headers = message.getHeader(RECEIVED); Timber.d("Received headers: " + headers.length); for(String header: headers) { String fromAddress = "", toAddress = "", sslVersion = null, cipher, bits; header = header.trim(); Matcher mat... | ReceivedHeaders { public static SecureTransportState wasMessageTransmittedSecurely(Message message) { String[] headers = message.getHeader(RECEIVED); Timber.d("Received headers: " + headers.length); for(String header: headers) { String fromAddress = "", toAddress = "", sslVersion = null, cipher, bits; header = header.t... | ReceivedHeaders { public static SecureTransportState wasMessageTransmittedSecurely(Message message) { String[] headers = message.getHeader(RECEIVED); Timber.d("Received headers: " + headers.length); for(String header: headers) { String fromAddress = "", toAddress = "", sslVersion = null, cipher, bits; header = header.t... | ReceivedHeaders { public static SecureTransportState wasMessageTransmittedSecurely(Message message) { String[] headers = message.getHeader(RECEIVED); Timber.d("Received headers: " + headers.length); for(String header: headers) { String fromAddress = "", toAddress = "", sslVersion = null, cipher, bits; header = header.t... | ReceivedHeaders { public static SecureTransportState wasMessageTransmittedSecurely(Message message) { String[] headers = message.getHeader(RECEIVED); Timber.d("Received headers: " + headers.length); for(String header: headers) { String fromAddress = "", toAddress = "", sslVersion = null, cipher, bits; header = header.t... |
@Test public void wasMessageTransmittedSecurely_forInsecureMessage_shouldReturnFalse() throws MessagingException { String[] insecureReceivedHeaders = new String[]{ " from localhost (localhost [127.0.0.1])\n" + "by scarlet.richardwhiuk.com (Postfix)\n " + "with ESMTP id BB1057BA98\n " + "for <philip@whiuk.com>; Fri, 25 ... | public static SecureTransportState wasMessageTransmittedSecurely(Message message) { String[] headers = message.getHeader(RECEIVED); Timber.d("Received headers: " + headers.length); for(String header: headers) { String fromAddress = "", toAddress = "", sslVersion = null, cipher, bits; header = header.trim(); Matcher mat... | ReceivedHeaders { public static SecureTransportState wasMessageTransmittedSecurely(Message message) { String[] headers = message.getHeader(RECEIVED); Timber.d("Received headers: " + headers.length); for(String header: headers) { String fromAddress = "", toAddress = "", sslVersion = null, cipher, bits; header = header.t... | ReceivedHeaders { public static SecureTransportState wasMessageTransmittedSecurely(Message message) { String[] headers = message.getHeader(RECEIVED); Timber.d("Received headers: " + headers.length); for(String header: headers) { String fromAddress = "", toAddress = "", sslVersion = null, cipher, bits; header = header.t... | ReceivedHeaders { public static SecureTransportState wasMessageTransmittedSecurely(Message message) { String[] headers = message.getHeader(RECEIVED); Timber.d("Received headers: " + headers.length); for(String header: headers) { String fromAddress = "", toAddress = "", sslVersion = null, cipher, bits; header = header.t... | ReceivedHeaders { public static SecureTransportState wasMessageTransmittedSecurely(Message message) { String[] headers = message.getHeader(RECEIVED); Timber.d("Received headers: " + headers.length); for(String header: headers) { String fromAddress = "", toAddress = "", sslVersion = null, cipher, bits; header = header.t... |
@Test public void wasMessageTransmittedSecurely_forSecureMessage_shouldReturnTrue() throws MessagingException { String[] secureReceivedHeaders = new String[]{ " from localhost (localhost [127.0.0.1])\n" + "by scarlet.richardwhiuk.com (Postfix)\n " + "with ESMTP id BB1057BA98\n " + "for <philip@whiuk.com>; Fri, 25 Mar 2... | public static SecureTransportState wasMessageTransmittedSecurely(Message message) { String[] headers = message.getHeader(RECEIVED); Timber.d("Received headers: " + headers.length); for(String header: headers) { String fromAddress = "", toAddress = "", sslVersion = null, cipher, bits; header = header.trim(); Matcher mat... | ReceivedHeaders { public static SecureTransportState wasMessageTransmittedSecurely(Message message) { String[] headers = message.getHeader(RECEIVED); Timber.d("Received headers: " + headers.length); for(String header: headers) { String fromAddress = "", toAddress = "", sslVersion = null, cipher, bits; header = header.t... | ReceivedHeaders { public static SecureTransportState wasMessageTransmittedSecurely(Message message) { String[] headers = message.getHeader(RECEIVED); Timber.d("Received headers: " + headers.length); for(String header: headers) { String fromAddress = "", toAddress = "", sslVersion = null, cipher, bits; header = header.t... | ReceivedHeaders { public static SecureTransportState wasMessageTransmittedSecurely(Message message) { String[] headers = message.getHeader(RECEIVED); Timber.d("Received headers: " + headers.length); for(String header: headers) { String fromAddress = "", toAddress = "", sslVersion = null, cipher, bits; header = header.t... | ReceivedHeaders { public static SecureTransportState wasMessageTransmittedSecurely(Message message) { String[] headers = message.getHeader(RECEIVED); Timber.d("Received headers: " + headers.length); for(String header: headers) { String fromAddress = "", toAddress = "", sslVersion = null, cipher, bits; header = header.t... |
@Test public void exportPreferences_producesXML() throws Exception { Document document = exportPreferences(false, Collections.<String>emptySet()); assertEquals("k9settings", document.getRootElement().getName()); } | static void exportPreferences(Context context, OutputStream os, boolean includeGlobals, Set<String> accountUuids) throws SettingsImportExportException { try { XmlSerializer serializer = Xml.newSerializer(); serializer.setOutput(os, "UTF-8"); serializer.startDocument(null, Boolean.TRUE); serializer.setFeature("http: ser... | SettingsExporter { static void exportPreferences(Context context, OutputStream os, boolean includeGlobals, Set<String> accountUuids) throws SettingsImportExportException { try { XmlSerializer serializer = Xml.newSerializer(); serializer.setOutput(os, "UTF-8"); serializer.startDocument(null, Boolean.TRUE); serializer.se... | SettingsExporter { static void exportPreferences(Context context, OutputStream os, boolean includeGlobals, Set<String> accountUuids) throws SettingsImportExportException { try { XmlSerializer serializer = Xml.newSerializer(); serializer.setOutput(os, "UTF-8"); serializer.startDocument(null, Boolean.TRUE); serializer.se... | SettingsExporter { static void exportPreferences(Context context, OutputStream os, boolean includeGlobals, Set<String> accountUuids) throws SettingsImportExportException { try { XmlSerializer serializer = Xml.newSerializer(); serializer.setOutput(os, "UTF-8"); serializer.startDocument(null, Boolean.TRUE); serializer.se... | SettingsExporter { static void exportPreferences(Context context, OutputStream os, boolean includeGlobals, Set<String> accountUuids) throws SettingsImportExportException { try { XmlSerializer serializer = Xml.newSerializer(); serializer.setOutput(os, "UTF-8"); serializer.startDocument(null, Boolean.TRUE); serializer.se... |
@Test public void exportPreferences_setsVersionToLatest() throws Exception { Document document = exportPreferences(false, Collections.<String>emptySet()); assertEquals(Integer.toString(Settings.VERSION), document.getRootElement().getAttributeValue("version")); } | static void exportPreferences(Context context, OutputStream os, boolean includeGlobals, Set<String> accountUuids) throws SettingsImportExportException { try { XmlSerializer serializer = Xml.newSerializer(); serializer.setOutput(os, "UTF-8"); serializer.startDocument(null, Boolean.TRUE); serializer.setFeature("http: ser... | SettingsExporter { static void exportPreferences(Context context, OutputStream os, boolean includeGlobals, Set<String> accountUuids) throws SettingsImportExportException { try { XmlSerializer serializer = Xml.newSerializer(); serializer.setOutput(os, "UTF-8"); serializer.startDocument(null, Boolean.TRUE); serializer.se... | SettingsExporter { static void exportPreferences(Context context, OutputStream os, boolean includeGlobals, Set<String> accountUuids) throws SettingsImportExportException { try { XmlSerializer serializer = Xml.newSerializer(); serializer.setOutput(os, "UTF-8"); serializer.startDocument(null, Boolean.TRUE); serializer.se... | SettingsExporter { static void exportPreferences(Context context, OutputStream os, boolean includeGlobals, Set<String> accountUuids) throws SettingsImportExportException { try { XmlSerializer serializer = Xml.newSerializer(); serializer.setOutput(os, "UTF-8"); serializer.startDocument(null, Boolean.TRUE); serializer.se... | SettingsExporter { static void exportPreferences(Context context, OutputStream os, boolean includeGlobals, Set<String> accountUuids) throws SettingsImportExportException { try { XmlSerializer serializer = Xml.newSerializer(); serializer.setOutput(os, "UTF-8"); serializer.startDocument(null, Boolean.TRUE); serializer.se... |
@Test public void exportPreferences_setsFormatTo1() throws Exception { Document document = exportPreferences(false, Collections.<String>emptySet()); assertEquals("1", document.getRootElement().getAttributeValue("format")); } | static void exportPreferences(Context context, OutputStream os, boolean includeGlobals, Set<String> accountUuids) throws SettingsImportExportException { try { XmlSerializer serializer = Xml.newSerializer(); serializer.setOutput(os, "UTF-8"); serializer.startDocument(null, Boolean.TRUE); serializer.setFeature("http: ser... | SettingsExporter { static void exportPreferences(Context context, OutputStream os, boolean includeGlobals, Set<String> accountUuids) throws SettingsImportExportException { try { XmlSerializer serializer = Xml.newSerializer(); serializer.setOutput(os, "UTF-8"); serializer.startDocument(null, Boolean.TRUE); serializer.se... | SettingsExporter { static void exportPreferences(Context context, OutputStream os, boolean includeGlobals, Set<String> accountUuids) throws SettingsImportExportException { try { XmlSerializer serializer = Xml.newSerializer(); serializer.setOutput(os, "UTF-8"); serializer.startDocument(null, Boolean.TRUE); serializer.se... | SettingsExporter { static void exportPreferences(Context context, OutputStream os, boolean includeGlobals, Set<String> accountUuids) throws SettingsImportExportException { try { XmlSerializer serializer = Xml.newSerializer(); serializer.setOutput(os, "UTF-8"); serializer.startDocument(null, Boolean.TRUE); serializer.se... | SettingsExporter { static void exportPreferences(Context context, OutputStream os, boolean includeGlobals, Set<String> accountUuids) throws SettingsImportExportException { try { XmlSerializer serializer = Xml.newSerializer(); serializer.setOutput(os, "UTF-8"); serializer.startDocument(null, Boolean.TRUE); serializer.se... |
@Test public void exportPreferences_exportsGlobalSettingsWhenRequested() throws Exception { Document document = exportPreferences(true, Collections.<String>emptySet()); assertNotNull(document.getRootElement().getChild("global")); } | static void exportPreferences(Context context, OutputStream os, boolean includeGlobals, Set<String> accountUuids) throws SettingsImportExportException { try { XmlSerializer serializer = Xml.newSerializer(); serializer.setOutput(os, "UTF-8"); serializer.startDocument(null, Boolean.TRUE); serializer.setFeature("http: ser... | SettingsExporter { static void exportPreferences(Context context, OutputStream os, boolean includeGlobals, Set<String> accountUuids) throws SettingsImportExportException { try { XmlSerializer serializer = Xml.newSerializer(); serializer.setOutput(os, "UTF-8"); serializer.startDocument(null, Boolean.TRUE); serializer.se... | SettingsExporter { static void exportPreferences(Context context, OutputStream os, boolean includeGlobals, Set<String> accountUuids) throws SettingsImportExportException { try { XmlSerializer serializer = Xml.newSerializer(); serializer.setOutput(os, "UTF-8"); serializer.startDocument(null, Boolean.TRUE); serializer.se... | SettingsExporter { static void exportPreferences(Context context, OutputStream os, boolean includeGlobals, Set<String> accountUuids) throws SettingsImportExportException { try { XmlSerializer serializer = Xml.newSerializer(); serializer.setOutput(os, "UTF-8"); serializer.startDocument(null, Boolean.TRUE); serializer.se... | SettingsExporter { static void exportPreferences(Context context, OutputStream os, boolean includeGlobals, Set<String> accountUuids) throws SettingsImportExportException { try { XmlSerializer serializer = Xml.newSerializer(); serializer.setOutput(os, "UTF-8"); serializer.startDocument(null, Boolean.TRUE); serializer.se... |
@Test public void findEncrypted__withMultipartMixedSubSigned__shouldReturnSigned() throws Exception { Message message = messageFromBody( multipart("mixed", multipart("signed", "protocol=\"application/pgp-signature\"", bodypart("text/plain"), bodypart("application/pgp-signature") ) ) ); List<Part> signedParts = MessageC... | public static List<Part> findMultipartSignedParts(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 (messageCryptoAn... | MessageCryptoStructureDetector { public static List<Part> findMultipartSignedParts(Part startPart, MessageCryptoAnnotations messageCryptoAnnotations) { List<Part> signedParts = new ArrayList<>(); Stack<Part> partsToCheck = new Stack<>(); partsToCheck.push(startPart); while (!partsToCheck.isEmpty()) { Part part = partsT... | MessageCryptoStructureDetector { public static List<Part> findMultipartSignedParts(Part startPart, MessageCryptoAnnotations messageCryptoAnnotations) { List<Part> signedParts = new ArrayList<>(); Stack<Part> partsToCheck = new Stack<>(); partsToCheck.push(startPart); while (!partsToCheck.isEmpty()) { Part part = partsT... | MessageCryptoStructureDetector { public static List<Part> findMultipartSignedParts(Part startPart, MessageCryptoAnnotations messageCryptoAnnotations) { List<Part> signedParts = new ArrayList<>(); Stack<Part> partsToCheck = new Stack<>(); partsToCheck.push(startPart); while (!partsToCheck.isEmpty()) { Part part = partsT... | MessageCryptoStructureDetector { public static List<Part> findMultipartSignedParts(Part startPart, MessageCryptoAnnotations messageCryptoAnnotations) { List<Part> signedParts = new ArrayList<>(); Stack<Part> partsToCheck = new Stack<>(); partsToCheck.push(startPart); while (!partsToCheck.isEmpty()) { Part part = partsT... |
@Test public void findPrimaryCryptoPart_withEmptyMultipartAlternative_shouldReturnNull() throws Exception { List<Part> outputExtraParts = new ArrayList<>(); Message message = messageFromBody( multipart("alternative") ); Part cryptoPart = MessageDecryptVerifier.findPrimaryEncryptedOrSignedPart(message, outputExtraParts)... | 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 exportPreferences_ignoresGlobalSettingsWhenRequested() throws Exception { Document document = exportPreferences(false, Collections.<String>emptySet()); assertNull(document.getRootElement().getChild("global")); } | static void exportPreferences(Context context, OutputStream os, boolean includeGlobals, Set<String> accountUuids) throws SettingsImportExportException { try { XmlSerializer serializer = Xml.newSerializer(); serializer.setOutput(os, "UTF-8"); serializer.startDocument(null, Boolean.TRUE); serializer.setFeature("http: ser... | SettingsExporter { static void exportPreferences(Context context, OutputStream os, boolean includeGlobals, Set<String> accountUuids) throws SettingsImportExportException { try { XmlSerializer serializer = Xml.newSerializer(); serializer.setOutput(os, "UTF-8"); serializer.startDocument(null, Boolean.TRUE); serializer.se... | SettingsExporter { static void exportPreferences(Context context, OutputStream os, boolean includeGlobals, Set<String> accountUuids) throws SettingsImportExportException { try { XmlSerializer serializer = Xml.newSerializer(); serializer.setOutput(os, "UTF-8"); serializer.startDocument(null, Boolean.TRUE); serializer.se... | SettingsExporter { static void exportPreferences(Context context, OutputStream os, boolean includeGlobals, Set<String> accountUuids) throws SettingsImportExportException { try { XmlSerializer serializer = Xml.newSerializer(); serializer.setOutput(os, "UTF-8"); serializer.startDocument(null, Boolean.TRUE); serializer.se... | SettingsExporter { static void exportPreferences(Context context, OutputStream os, boolean includeGlobals, Set<String> accountUuids) throws SettingsImportExportException { try { XmlSerializer serializer = Xml.newSerializer(); serializer.setOutput(os, "UTF-8"); serializer.startDocument(null, Boolean.TRUE); serializer.se... |
@Test(expected = SettingsImportExportException.class) public void importSettings_throwsExceptionOnBlankFile() throws SettingsImportExportException { InputStream inputStream = new StringInputStream(""); List<String> accountUuids = new ArrayList<>(); SettingsImporter.importSettings(RuntimeEnvironment.application, inputSt... | public static ImportResults importSettings(Context context, InputStream inputStream, boolean globalSettings, List<String> accountUuids, boolean overwrite) throws SettingsImportExportException { try { boolean globalSettingsImported = false; List<AccountDescriptionPair> importedAccounts = new ArrayList<>(); List<AccountD... | SettingsImporter { public static ImportResults importSettings(Context context, InputStream inputStream, boolean globalSettings, List<String> accountUuids, boolean overwrite) throws SettingsImportExportException { try { boolean globalSettingsImported = false; List<AccountDescriptionPair> importedAccounts = new ArrayList... | SettingsImporter { public static ImportResults importSettings(Context context, InputStream inputStream, boolean globalSettings, List<String> accountUuids, boolean overwrite) throws SettingsImportExportException { try { boolean globalSettingsImported = false; List<AccountDescriptionPair> importedAccounts = new ArrayList... | SettingsImporter { public static ImportResults importSettings(Context context, InputStream inputStream, boolean globalSettings, List<String> accountUuids, boolean overwrite) throws SettingsImportExportException { try { boolean globalSettingsImported = false; List<AccountDescriptionPair> importedAccounts = new ArrayList... | SettingsImporter { public static ImportResults importSettings(Context context, InputStream inputStream, boolean globalSettings, List<String> accountUuids, boolean overwrite) throws SettingsImportExportException { try { boolean globalSettingsImported = false; List<AccountDescriptionPair> importedAccounts = new ArrayList... |
@Test(expected = SettingsImportExportException.class) public void importSettings_throwsExceptionOnMissingFormat() throws SettingsImportExportException { InputStream inputStream = new StringInputStream("<k9settings version=\"1\"></k9settings>"); List<String> accountUuids = new ArrayList<>(); SettingsImporter.importSetti... | public static ImportResults importSettings(Context context, InputStream inputStream, boolean globalSettings, List<String> accountUuids, boolean overwrite) throws SettingsImportExportException { try { boolean globalSettingsImported = false; List<AccountDescriptionPair> importedAccounts = new ArrayList<>(); List<AccountD... | SettingsImporter { public static ImportResults importSettings(Context context, InputStream inputStream, boolean globalSettings, List<String> accountUuids, boolean overwrite) throws SettingsImportExportException { try { boolean globalSettingsImported = false; List<AccountDescriptionPair> importedAccounts = new ArrayList... | SettingsImporter { public static ImportResults importSettings(Context context, InputStream inputStream, boolean globalSettings, List<String> accountUuids, boolean overwrite) throws SettingsImportExportException { try { boolean globalSettingsImported = false; List<AccountDescriptionPair> importedAccounts = new ArrayList... | SettingsImporter { public static ImportResults importSettings(Context context, InputStream inputStream, boolean globalSettings, List<String> accountUuids, boolean overwrite) throws SettingsImportExportException { try { boolean globalSettingsImported = false; List<AccountDescriptionPair> importedAccounts = new ArrayList... | SettingsImporter { public static ImportResults importSettings(Context context, InputStream inputStream, boolean globalSettings, List<String> accountUuids, boolean overwrite) throws SettingsImportExportException { try { boolean globalSettingsImported = false; List<AccountDescriptionPair> importedAccounts = new ArrayList... |
@Test(expected = SettingsImportExportException.class) public void importSettings_throwsExceptionOnInvalidFormat() throws SettingsImportExportException { InputStream inputStream = new StringInputStream("<k9settings version=\"1\" format=\"A\"></k9settings>"); List<String> accountUuids = new ArrayList<>(); SettingsImporte... | public static ImportResults importSettings(Context context, InputStream inputStream, boolean globalSettings, List<String> accountUuids, boolean overwrite) throws SettingsImportExportException { try { boolean globalSettingsImported = false; List<AccountDescriptionPair> importedAccounts = new ArrayList<>(); List<AccountD... | SettingsImporter { public static ImportResults importSettings(Context context, InputStream inputStream, boolean globalSettings, List<String> accountUuids, boolean overwrite) throws SettingsImportExportException { try { boolean globalSettingsImported = false; List<AccountDescriptionPair> importedAccounts = new ArrayList... | SettingsImporter { public static ImportResults importSettings(Context context, InputStream inputStream, boolean globalSettings, List<String> accountUuids, boolean overwrite) throws SettingsImportExportException { try { boolean globalSettingsImported = false; List<AccountDescriptionPair> importedAccounts = new ArrayList... | SettingsImporter { public static ImportResults importSettings(Context context, InputStream inputStream, boolean globalSettings, List<String> accountUuids, boolean overwrite) throws SettingsImportExportException { try { boolean globalSettingsImported = false; List<AccountDescriptionPair> importedAccounts = new ArrayList... | SettingsImporter { public static ImportResults importSettings(Context context, InputStream inputStream, boolean globalSettings, List<String> accountUuids, boolean overwrite) throws SettingsImportExportException { try { boolean globalSettingsImported = false; List<AccountDescriptionPair> importedAccounts = new ArrayList... |
@Test(expected = SettingsImportExportException.class) public void importSettings_throwsExceptionOnNonPositiveFormat() throws SettingsImportExportException { InputStream inputStream = new StringInputStream("<k9settings version=\"1\" format=\"0\"></k9settings>"); List<String> accountUuids = new ArrayList<>(); SettingsImp... | public static ImportResults importSettings(Context context, InputStream inputStream, boolean globalSettings, List<String> accountUuids, boolean overwrite) throws SettingsImportExportException { try { boolean globalSettingsImported = false; List<AccountDescriptionPair> importedAccounts = new ArrayList<>(); List<AccountD... | SettingsImporter { public static ImportResults importSettings(Context context, InputStream inputStream, boolean globalSettings, List<String> accountUuids, boolean overwrite) throws SettingsImportExportException { try { boolean globalSettingsImported = false; List<AccountDescriptionPair> importedAccounts = new ArrayList... | SettingsImporter { public static ImportResults importSettings(Context context, InputStream inputStream, boolean globalSettings, List<String> accountUuids, boolean overwrite) throws SettingsImportExportException { try { boolean globalSettingsImported = false; List<AccountDescriptionPair> importedAccounts = new ArrayList... | SettingsImporter { public static ImportResults importSettings(Context context, InputStream inputStream, boolean globalSettings, List<String> accountUuids, boolean overwrite) throws SettingsImportExportException { try { boolean globalSettingsImported = false; List<AccountDescriptionPair> importedAccounts = new ArrayList... | SettingsImporter { public static ImportResults importSettings(Context context, InputStream inputStream, boolean globalSettings, List<String> accountUuids, boolean overwrite) throws SettingsImportExportException { try { boolean globalSettingsImported = false; List<AccountDescriptionPair> importedAccounts = new ArrayList... |
@Test(expected = SettingsImportExportException.class) public void importSettings_throwsExceptionOnMissingVersion() throws SettingsImportExportException { InputStream inputStream = new StringInputStream("<k9settings format=\"1\"></k9settings>"); List<String> accountUuids = new ArrayList<>(); SettingsImporter.importSetti... | public static ImportResults importSettings(Context context, InputStream inputStream, boolean globalSettings, List<String> accountUuids, boolean overwrite) throws SettingsImportExportException { try { boolean globalSettingsImported = false; List<AccountDescriptionPair> importedAccounts = new ArrayList<>(); List<AccountD... | SettingsImporter { public static ImportResults importSettings(Context context, InputStream inputStream, boolean globalSettings, List<String> accountUuids, boolean overwrite) throws SettingsImportExportException { try { boolean globalSettingsImported = false; List<AccountDescriptionPair> importedAccounts = new ArrayList... | SettingsImporter { public static ImportResults importSettings(Context context, InputStream inputStream, boolean globalSettings, List<String> accountUuids, boolean overwrite) throws SettingsImportExportException { try { boolean globalSettingsImported = false; List<AccountDescriptionPair> importedAccounts = new ArrayList... | SettingsImporter { public static ImportResults importSettings(Context context, InputStream inputStream, boolean globalSettings, List<String> accountUuids, boolean overwrite) throws SettingsImportExportException { try { boolean globalSettingsImported = false; List<AccountDescriptionPair> importedAccounts = new ArrayList... | SettingsImporter { public static ImportResults importSettings(Context context, InputStream inputStream, boolean globalSettings, List<String> accountUuids, boolean overwrite) throws SettingsImportExportException { try { boolean globalSettingsImported = false; List<AccountDescriptionPair> importedAccounts = new ArrayList... |
@Test(expected = SettingsImportExportException.class) public void importSettings_throwsExceptionOnInvalidVersion() throws SettingsImportExportException { InputStream inputStream = new StringInputStream("<k9settings format=\"1\" version=\"A\"></k9settings>"); List<String> accountUuids = new ArrayList<>(); SettingsImport... | public static ImportResults importSettings(Context context, InputStream inputStream, boolean globalSettings, List<String> accountUuids, boolean overwrite) throws SettingsImportExportException { try { boolean globalSettingsImported = false; List<AccountDescriptionPair> importedAccounts = new ArrayList<>(); List<AccountD... | SettingsImporter { public static ImportResults importSettings(Context context, InputStream inputStream, boolean globalSettings, List<String> accountUuids, boolean overwrite) throws SettingsImportExportException { try { boolean globalSettingsImported = false; List<AccountDescriptionPair> importedAccounts = new ArrayList... | SettingsImporter { public static ImportResults importSettings(Context context, InputStream inputStream, boolean globalSettings, List<String> accountUuids, boolean overwrite) throws SettingsImportExportException { try { boolean globalSettingsImported = false; List<AccountDescriptionPair> importedAccounts = new ArrayList... | SettingsImporter { public static ImportResults importSettings(Context context, InputStream inputStream, boolean globalSettings, List<String> accountUuids, boolean overwrite) throws SettingsImportExportException { try { boolean globalSettingsImported = false; List<AccountDescriptionPair> importedAccounts = new ArrayList... | SettingsImporter { public static ImportResults importSettings(Context context, InputStream inputStream, boolean globalSettings, List<String> accountUuids, boolean overwrite) throws SettingsImportExportException { try { boolean globalSettingsImported = false; List<AccountDescriptionPair> importedAccounts = new ArrayList... |
@Test(expected = SettingsImportExportException.class) public void importSettings_throwsExceptionOnNonPositiveVersion() throws SettingsImportExportException { InputStream inputStream = new StringInputStream("<k9settings format=\"1\" version=\"0\"></k9settings>"); List<String> accountUuids = new ArrayList<>(); SettingsIm... | public static ImportResults importSettings(Context context, InputStream inputStream, boolean globalSettings, List<String> accountUuids, boolean overwrite) throws SettingsImportExportException { try { boolean globalSettingsImported = false; List<AccountDescriptionPair> importedAccounts = new ArrayList<>(); List<AccountD... | SettingsImporter { public static ImportResults importSettings(Context context, InputStream inputStream, boolean globalSettings, List<String> accountUuids, boolean overwrite) throws SettingsImportExportException { try { boolean globalSettingsImported = false; List<AccountDescriptionPair> importedAccounts = new ArrayList... | SettingsImporter { public static ImportResults importSettings(Context context, InputStream inputStream, boolean globalSettings, List<String> accountUuids, boolean overwrite) throws SettingsImportExportException { try { boolean globalSettingsImported = false; List<AccountDescriptionPair> importedAccounts = new ArrayList... | SettingsImporter { public static ImportResults importSettings(Context context, InputStream inputStream, boolean globalSettings, List<String> accountUuids, boolean overwrite) throws SettingsImportExportException { try { boolean globalSettingsImported = false; List<AccountDescriptionPair> importedAccounts = new ArrayList... | SettingsImporter { public static ImportResults importSettings(Context context, InputStream inputStream, boolean globalSettings, List<String> accountUuids, boolean overwrite) throws SettingsImportExportException { try { boolean globalSettingsImported = false; List<AccountDescriptionPair> importedAccounts = new ArrayList... |
@Test public void parseSettings_account() throws SettingsImportExportException { String validUUID = UUID.randomUUID().toString(); InputStream inputStream = new StringInputStream("<k9settings format=\"1\" version=\"1\">" + "<accounts><account uuid=\"" + validUUID + "\"><name>Account</name></account></accounts></k9settin... | @VisibleForTesting static Imported parseSettings(InputStream inputStream, boolean globalSettings, List<String> accountUuids, boolean overview) throws SettingsImportExportException { if (!overview && accountUuids == null) { throw new IllegalArgumentException("Argument 'accountUuids' must not be null."); } try { XmlPullP... | SettingsImporter { @VisibleForTesting static Imported parseSettings(InputStream inputStream, boolean globalSettings, List<String> accountUuids, boolean overview) throws SettingsImportExportException { if (!overview && accountUuids == null) { throw new IllegalArgumentException("Argument 'accountUuids' must not be null."... | SettingsImporter { @VisibleForTesting static Imported parseSettings(InputStream inputStream, boolean globalSettings, List<String> accountUuids, boolean overview) throws SettingsImportExportException { if (!overview && accountUuids == null) { throw new IllegalArgumentException("Argument 'accountUuids' must not be null."... | SettingsImporter { @VisibleForTesting static Imported parseSettings(InputStream inputStream, boolean globalSettings, List<String> accountUuids, boolean overview) throws SettingsImportExportException { if (!overview && accountUuids == null) { throw new IllegalArgumentException("Argument 'accountUuids' must not be null."... | SettingsImporter { @VisibleForTesting static Imported parseSettings(InputStream inputStream, boolean globalSettings, List<String> accountUuids, boolean overview) throws SettingsImportExportException { if (!overview && accountUuids == null) { throw new IllegalArgumentException("Argument 'accountUuids' must not be null."... |
@Test public void parseSettings_account_identities() throws SettingsImportExportException { String validUUID = UUID.randomUUID().toString(); InputStream inputStream = new StringInputStream("<k9settings format=\"1\" version=\"1\">" + "<accounts><account uuid=\"" + validUUID + "\"><name>Account</name>" + "<identities><id... | @VisibleForTesting static Imported parseSettings(InputStream inputStream, boolean globalSettings, List<String> accountUuids, boolean overview) throws SettingsImportExportException { if (!overview && accountUuids == null) { throw new IllegalArgumentException("Argument 'accountUuids' must not be null."); } try { XmlPullP... | SettingsImporter { @VisibleForTesting static Imported parseSettings(InputStream inputStream, boolean globalSettings, List<String> accountUuids, boolean overview) throws SettingsImportExportException { if (!overview && accountUuids == null) { throw new IllegalArgumentException("Argument 'accountUuids' must not be null."... | SettingsImporter { @VisibleForTesting static Imported parseSettings(InputStream inputStream, boolean globalSettings, List<String> accountUuids, boolean overview) throws SettingsImportExportException { if (!overview && accountUuids == null) { throw new IllegalArgumentException("Argument 'accountUuids' must not be null."... | SettingsImporter { @VisibleForTesting static Imported parseSettings(InputStream inputStream, boolean globalSettings, List<String> accountUuids, boolean overview) throws SettingsImportExportException { if (!overview && accountUuids == null) { throw new IllegalArgumentException("Argument 'accountUuids' must not be null."... | SettingsImporter { @VisibleForTesting static Imported parseSettings(InputStream inputStream, boolean globalSettings, List<String> accountUuids, boolean overview) throws SettingsImportExportException { if (!overview && accountUuids == null) { throw new IllegalArgumentException("Argument 'accountUuids' must not be null."... |
@Test public void findEncrypted__withMultipartMixedSubSignedAndText__shouldReturnSigned() throws Exception { Message message = messageFromBody( multipart("mixed", multipart("signed", "application/pgp-signature", bodypart("text/plain"), bodypart("application/pgp-signature") ), bodypart("text/plain") ) ); List<Part> sign... | public static List<Part> findMultipartSignedParts(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 (messageCryptoAn... | MessageCryptoStructureDetector { public static List<Part> findMultipartSignedParts(Part startPart, MessageCryptoAnnotations messageCryptoAnnotations) { List<Part> signedParts = new ArrayList<>(); Stack<Part> partsToCheck = new Stack<>(); partsToCheck.push(startPart); while (!partsToCheck.isEmpty()) { Part part = partsT... | MessageCryptoStructureDetector { public static List<Part> findMultipartSignedParts(Part startPart, MessageCryptoAnnotations messageCryptoAnnotations) { List<Part> signedParts = new ArrayList<>(); Stack<Part> partsToCheck = new Stack<>(); partsToCheck.push(startPart); while (!partsToCheck.isEmpty()) { Part part = partsT... | MessageCryptoStructureDetector { public static List<Part> findMultipartSignedParts(Part startPart, MessageCryptoAnnotations messageCryptoAnnotations) { List<Part> signedParts = new ArrayList<>(); Stack<Part> partsToCheck = new Stack<>(); partsToCheck.push(startPart); while (!partsToCheck.isEmpty()) { Part part = partsT... | MessageCryptoStructureDetector { public static List<Part> findMultipartSignedParts(Part startPart, MessageCryptoAnnotations messageCryptoAnnotations) { List<Part> signedParts = new ArrayList<>(); Stack<Part> partsToCheck = new Stack<>(); partsToCheck.push(startPart); while (!partsToCheck.isEmpty()) { Part part = partsT... |
@Test public void parseSettings_account_cram_md5() throws SettingsImportExportException { String validUUID = UUID.randomUUID().toString(); InputStream inputStream = new StringInputStream("<k9settings format=\"1\" version=\"1\">" + "<accounts><account uuid=\"" + validUUID + "\"><name>Account</name>" + "<incoming-server>... | @VisibleForTesting static Imported parseSettings(InputStream inputStream, boolean globalSettings, List<String> accountUuids, boolean overview) throws SettingsImportExportException { if (!overview && accountUuids == null) { throw new IllegalArgumentException("Argument 'accountUuids' must not be null."); } try { XmlPullP... | SettingsImporter { @VisibleForTesting static Imported parseSettings(InputStream inputStream, boolean globalSettings, List<String> accountUuids, boolean overview) throws SettingsImportExportException { if (!overview && accountUuids == null) { throw new IllegalArgumentException("Argument 'accountUuids' must not be null."... | SettingsImporter { @VisibleForTesting static Imported parseSettings(InputStream inputStream, boolean globalSettings, List<String> accountUuids, boolean overview) throws SettingsImportExportException { if (!overview && accountUuids == null) { throw new IllegalArgumentException("Argument 'accountUuids' must not be null."... | SettingsImporter { @VisibleForTesting static Imported parseSettings(InputStream inputStream, boolean globalSettings, List<String> accountUuids, boolean overview) throws SettingsImportExportException { if (!overview && accountUuids == null) { throw new IllegalArgumentException("Argument 'accountUuids' must not be null."... | SettingsImporter { @VisibleForTesting static Imported parseSettings(InputStream inputStream, boolean globalSettings, List<String> accountUuids, boolean overview) throws SettingsImportExportException { if (!overview && accountUuids == null) { throw new IllegalArgumentException("Argument 'accountUuids' must not be null."... |
@Test public void importSettings_disablesAccountsNeedingPasswords() throws SettingsImportExportException { String validUUID = UUID.randomUUID().toString(); InputStream inputStream = new StringInputStream("<k9settings format=\"1\" version=\"1\">" + "<accounts><account uuid=\"" + validUUID + "\"><name>Account</name>" + "... | public static ImportResults importSettings(Context context, InputStream inputStream, boolean globalSettings, List<String> accountUuids, boolean overwrite) throws SettingsImportExportException { try { boolean globalSettingsImported = false; List<AccountDescriptionPair> importedAccounts = new ArrayList<>(); List<AccountD... | SettingsImporter { public static ImportResults importSettings(Context context, InputStream inputStream, boolean globalSettings, List<String> accountUuids, boolean overwrite) throws SettingsImportExportException { try { boolean globalSettingsImported = false; List<AccountDescriptionPair> importedAccounts = new ArrayList... | SettingsImporter { public static ImportResults importSettings(Context context, InputStream inputStream, boolean globalSettings, List<String> accountUuids, boolean overwrite) throws SettingsImportExportException { try { boolean globalSettingsImported = false; List<AccountDescriptionPair> importedAccounts = new ArrayList... | SettingsImporter { public static ImportResults importSettings(Context context, InputStream inputStream, boolean globalSettings, List<String> accountUuids, boolean overwrite) throws SettingsImportExportException { try { boolean globalSettingsImported = false; List<AccountDescriptionPair> importedAccounts = new ArrayList... | SettingsImporter { public static ImportResults importSettings(Context context, InputStream inputStream, boolean globalSettings, List<String> accountUuids, boolean overwrite) throws SettingsImportExportException { try { boolean globalSettingsImported = false; List<AccountDescriptionPair> importedAccounts = new ArrayList... |
@Test public void getImportStreamContents_account() throws SettingsImportExportException { String validUUID = UUID.randomUUID().toString(); InputStream inputStream = new StringInputStream("<k9settings format=\"1\" version=\"1\">" + "<accounts>" + "<account uuid=\"" + validUUID + "\">" + "<name>Account</name>" + "<ident... | public static ImportContents getImportStreamContents(InputStream inputStream) throws SettingsImportExportException { try { Imported imported = parseSettings(inputStream, false, null, true); boolean globalSettings = (imported.globalSettings != null); final List<AccountDescription> accounts = new ArrayList<>(); if (impor... | SettingsImporter { public static ImportContents getImportStreamContents(InputStream inputStream) throws SettingsImportExportException { try { Imported imported = parseSettings(inputStream, false, null, true); boolean globalSettings = (imported.globalSettings != null); final List<AccountDescription> accounts = new Array... | SettingsImporter { public static ImportContents getImportStreamContents(InputStream inputStream) throws SettingsImportExportException { try { Imported imported = parseSettings(inputStream, false, null, true); boolean globalSettings = (imported.globalSettings != null); final List<AccountDescription> accounts = new Array... | SettingsImporter { public static ImportContents getImportStreamContents(InputStream inputStream) throws SettingsImportExportException { try { Imported imported = parseSettings(inputStream, false, null, true); boolean globalSettings = (imported.globalSettings != null); final List<AccountDescription> accounts = new Array... | SettingsImporter { public static ImportContents getImportStreamContents(InputStream inputStream) throws SettingsImportExportException { try { Imported imported = parseSettings(inputStream, false, null, true); boolean globalSettings = (imported.globalSettings != null); final List<AccountDescription> accounts = new Array... |
@Test public void getImportStreamContents_alternativeName() throws SettingsImportExportException { String validUUID = UUID.randomUUID().toString(); InputStream inputStream = new StringInputStream("<k9settings format=\"1\" version=\"1\">" + "<accounts>" + "<account uuid=\"" + validUUID + "\">" + "<name></name>" + "<iden... | public static ImportContents getImportStreamContents(InputStream inputStream) throws SettingsImportExportException { try { Imported imported = parseSettings(inputStream, false, null, true); boolean globalSettings = (imported.globalSettings != null); final List<AccountDescription> accounts = new ArrayList<>(); if (impor... | SettingsImporter { public static ImportContents getImportStreamContents(InputStream inputStream) throws SettingsImportExportException { try { Imported imported = parseSettings(inputStream, false, null, true); boolean globalSettings = (imported.globalSettings != null); final List<AccountDescription> accounts = new Array... | SettingsImporter { public static ImportContents getImportStreamContents(InputStream inputStream) throws SettingsImportExportException { try { Imported imported = parseSettings(inputStream, false, null, true); boolean globalSettings = (imported.globalSettings != null); final List<AccountDescription> accounts = new Array... | SettingsImporter { public static ImportContents getImportStreamContents(InputStream inputStream) throws SettingsImportExportException { try { Imported imported = parseSettings(inputStream, false, null, true); boolean globalSettings = (imported.globalSettings != null); final List<AccountDescription> accounts = new Array... | SettingsImporter { public static ImportContents getImportStreamContents(InputStream inputStream) throws SettingsImportExportException { try { Imported imported = parseSettings(inputStream, false, null, true); boolean globalSettings = (imported.globalSettings != null); final List<AccountDescription> accounts = new Array... |
@Test public void ICalendar_constructor_storedRequiredAttendeesFromEvent() { List<ICalendar> iCalendars = new ArrayList<>(); ICalendar iCalendar = new ICalendar(); VEvent event = new VEvent(); Attendee requiredAttendee = new Attendee("A", "a@b.com"); requiredAttendee.setParticipationLevel(ParticipationLevel.REQUIRED); ... | public List<ICalendarData> getCalendarData() { return calendarData; } | ICalData { public List<ICalendarData> getCalendarData() { return calendarData; } } | ICalData { public List<ICalendarData> getCalendarData() { return calendarData; } ICalData(List<ICalendar> iCalendars); } | ICalData { public List<ICalendarData> getCalendarData() { return calendarData; } ICalData(List<ICalendar> iCalendars); List<ICalendarData> getCalendarData(); } | ICalData { public List<ICalendarData> getCalendarData() { return calendarData; } ICalData(List<ICalendar> iCalendars); List<ICalendarData> getCalendarData(); static final String METHOD_PUBLISH; static final String METHOD_REPLY; static final String METHOD_REQUEST; static final String METHOD_COUNTER; } |
@Test public void ICalendar_constructor_storedOptionalAttendeesFromEvent() { List<ICalendar> iCalendars = new ArrayList<>(); ICalendar iCalendar = new ICalendar(); VEvent event = new VEvent(); Attendee requiredAttendee = new Attendee("A", "a@b.com"); requiredAttendee.setParticipationLevel(ParticipationLevel.OPTIONAL); ... | public List<ICalendarData> getCalendarData() { return calendarData; } | ICalData { public List<ICalendarData> getCalendarData() { return calendarData; } } | ICalData { public List<ICalendarData> getCalendarData() { return calendarData; } ICalData(List<ICalendar> iCalendars); } | ICalData { public List<ICalendarData> getCalendarData() { return calendarData; } ICalData(List<ICalendar> iCalendars); List<ICalendarData> getCalendarData(); } | ICalData { public List<ICalendarData> getCalendarData() { return calendarData; } ICalData(List<ICalendar> iCalendars); List<ICalendarData> getCalendarData(); static final String METHOD_PUBLISH; static final String METHOD_REPLY; static final String METHOD_REQUEST; static final String METHOD_COUNTER; } |
@Test public void ICalendar_constructor_storedFyiAttendeesFromEvent() { List<ICalendar> iCalendars = new ArrayList<>(); ICalendar iCalendar = new ICalendar(); VEvent event = new VEvent(); Attendee requiredAttendee = new Attendee("A", "a@b.com"); requiredAttendee.setParticipationLevel(ParticipationLevel.FYI); event.addA... | public List<ICalendarData> getCalendarData() { return calendarData; } | ICalData { public List<ICalendarData> getCalendarData() { return calendarData; } } | ICalData { public List<ICalendarData> getCalendarData() { return calendarData; } ICalData(List<ICalendar> iCalendars); } | ICalData { public List<ICalendarData> getCalendarData() { return calendarData; } ICalData(List<ICalendar> iCalendars); List<ICalendarData> getCalendarData(); } | ICalData { public List<ICalendarData> getCalendarData() { return calendarData; } ICalData(List<ICalendar> iCalendars); List<ICalendarData> getCalendarData(); static final String METHOD_PUBLISH; static final String METHOD_REPLY; static final String METHOD_REQUEST; static final String METHOD_COUNTER; } |
@Test public void ICalendar_constructor_storedAcceptedAttendeesFromEvent() { List<ICalendar> iCalendars = new ArrayList<>(); ICalendar iCalendar = new ICalendar(); VEvent event = new VEvent(); Attendee requiredAttendee = new Attendee("A", "a@b.com"); requiredAttendee.setParticipationStatus(ParticipationStatus.ACCEPTED)... | public List<ICalendarData> getCalendarData() { return calendarData; } | ICalData { public List<ICalendarData> getCalendarData() { return calendarData; } } | ICalData { public List<ICalendarData> getCalendarData() { return calendarData; } ICalData(List<ICalendar> iCalendars); } | ICalData { public List<ICalendarData> getCalendarData() { return calendarData; } ICalData(List<ICalendar> iCalendars); List<ICalendarData> getCalendarData(); } | ICalData { public List<ICalendarData> getCalendarData() { return calendarData; } ICalData(List<ICalendar> iCalendars); List<ICalendarData> getCalendarData(); static final String METHOD_PUBLISH; static final String METHOD_REPLY; static final String METHOD_REQUEST; static final String METHOD_COUNTER; } |
@Test public void ICalendar_constructor_storedTentativeAttendeesFromEvent() { List<ICalendar> iCalendars = new ArrayList<>(); ICalendar iCalendar = new ICalendar(); VEvent event = new VEvent(); Attendee requiredAttendee = new Attendee("A", "a@b.com"); requiredAttendee.setParticipationStatus(ParticipationStatus.TENTATIV... | public List<ICalendarData> getCalendarData() { return calendarData; } | ICalData { public List<ICalendarData> getCalendarData() { return calendarData; } } | ICalData { public List<ICalendarData> getCalendarData() { return calendarData; } ICalData(List<ICalendar> iCalendars); } | ICalData { public List<ICalendarData> getCalendarData() { return calendarData; } ICalData(List<ICalendar> iCalendars); List<ICalendarData> getCalendarData(); } | ICalData { public List<ICalendarData> getCalendarData() { return calendarData; } ICalData(List<ICalendar> iCalendars); List<ICalendarData> getCalendarData(); static final String METHOD_PUBLISH; static final String METHOD_REPLY; static final String METHOD_REQUEST; static final String METHOD_COUNTER; } |
@Test public void ICalendar_constructor_storedDeclinedAttendeesFromEvent() { List<ICalendar> iCalendars = new ArrayList<>(); ICalendar iCalendar = new ICalendar(); VEvent event = new VEvent(); Attendee requiredAttendee = new Attendee("A", "a@b.com"); requiredAttendee.setParticipationStatus(ParticipationStatus.DECLINED)... | public List<ICalendarData> getCalendarData() { return calendarData; } | ICalData { public List<ICalendarData> getCalendarData() { return calendarData; } } | ICalData { public List<ICalendarData> getCalendarData() { return calendarData; } ICalData(List<ICalendar> iCalendars); } | ICalData { public List<ICalendarData> getCalendarData() { return calendarData; } ICalData(List<ICalendar> iCalendars); List<ICalendarData> getCalendarData(); } | ICalData { public List<ICalendarData> getCalendarData() { return calendarData; } ICalData(List<ICalendar> iCalendars); List<ICalendarData> getCalendarData(); static final String METHOD_PUBLISH; static final String METHOD_REPLY; static final String METHOD_REQUEST; static final String METHOD_COUNTER; } |
@Test public void findEncrypted__withMultipartMixedSubTextAndSigned__shouldReturnSigned() throws Exception { Message message = messageFromBody( multipart("mixed", bodypart("text/plain"), multipart("signed", "application/pgp-signature", bodypart("text/plain"), bodypart("application/pgp-signature") ) ) ); List<Part> sign... | public static List<Part> findMultipartSignedParts(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 (messageCryptoAn... | MessageCryptoStructureDetector { public static List<Part> findMultipartSignedParts(Part startPart, MessageCryptoAnnotations messageCryptoAnnotations) { List<Part> signedParts = new ArrayList<>(); Stack<Part> partsToCheck = new Stack<>(); partsToCheck.push(startPart); while (!partsToCheck.isEmpty()) { Part part = partsT... | MessageCryptoStructureDetector { public static List<Part> findMultipartSignedParts(Part startPart, MessageCryptoAnnotations messageCryptoAnnotations) { List<Part> signedParts = new ArrayList<>(); Stack<Part> partsToCheck = new Stack<>(); partsToCheck.push(startPart); while (!partsToCheck.isEmpty()) { Part part = partsT... | MessageCryptoStructureDetector { public static List<Part> findMultipartSignedParts(Part startPart, MessageCryptoAnnotations messageCryptoAnnotations) { List<Part> signedParts = new ArrayList<>(); Stack<Part> partsToCheck = new Stack<>(); partsToCheck.push(startPart); while (!partsToCheck.isEmpty()) { Part part = partsT... | MessageCryptoStructureDetector { public static List<Part> findMultipartSignedParts(Part startPart, MessageCryptoAnnotations messageCryptoAnnotations) { List<Part> signedParts = new ArrayList<>(); Stack<Part> partsToCheck = new Stack<>(); partsToCheck.push(startPart); while (!partsToCheck.isEmpty()) { Part part = partsT... |
@Test public void ICalendar_constructor_storedDelegatedAttendeesFromEvent() { List<ICalendar> iCalendars = new ArrayList<>(); ICalendar iCalendar = new ICalendar(); VEvent event = new VEvent(); Attendee requiredAttendee = new Attendee("A", "a@b.com"); requiredAttendee.setParticipationStatus(ParticipationStatus.DELEGATE... | public List<ICalendarData> getCalendarData() { return calendarData; } | ICalData { public List<ICalendarData> getCalendarData() { return calendarData; } } | ICalData { public List<ICalendarData> getCalendarData() { return calendarData; } ICalData(List<ICalendar> iCalendars); } | ICalData { public List<ICalendarData> getCalendarData() { return calendarData; } ICalData(List<ICalendar> iCalendars); List<ICalendarData> getCalendarData(); } | ICalData { public List<ICalendarData> getCalendarData() { return calendarData; } ICalData(List<ICalendar> iCalendars); List<ICalendarData> getCalendarData(); static final String METHOD_PUBLISH; static final String METHOD_REPLY; static final String METHOD_REQUEST; static final String METHOD_COUNTER; } |
@Test public void parse_withNoText_returnsDataWithNoEvents() throws MessagingException { ICalPart part = new ICalPart(null); ICalData data = ICalParser.parse(part); assertEquals(0, data.getCalendarData().size()); } | public static ICalData parse(ICalPart part) { String iCalText = MessageExtractor.getTextFromPart(part.getPart()); if (iCalText == null) { return new ICalData(new ArrayList<ICalendar>()); } return new ICalData(Biweekly.parse(iCalText).all()); } | ICalParser { public static ICalData parse(ICalPart part) { String iCalText = MessageExtractor.getTextFromPart(part.getPart()); if (iCalText == null) { return new ICalData(new ArrayList<ICalendar>()); } return new ICalData(Biweekly.parse(iCalText).all()); } } | ICalParser { public static ICalData parse(ICalPart part) { String iCalText = MessageExtractor.getTextFromPart(part.getPart()); if (iCalText == null) { return new ICalData(new ArrayList<ICalendar>()); } return new ICalData(Biweekly.parse(iCalText).all()); } } | ICalParser { public static ICalData parse(ICalPart part) { String iCalText = MessageExtractor.getTextFromPart(part.getPart()); if (iCalText == null) { return new ICalData(new ArrayList<ICalendar>()); } return new ICalData(Biweekly.parse(iCalText).all()); } static ICalData parse(ICalPart part); } | ICalParser { public static ICalData parse(ICalPart part) { String iCalText = MessageExtractor.getTextFromPart(part.getPart()); if (iCalText == null) { return new ICalData(new ArrayList<ICalendar>()); } return new ICalData(Biweekly.parse(iCalText).all()); } static ICalData parse(ICalPart part); static final String MIME... |
@Test public void parse_returnsCorrectDataForMinimalPublishEvent() throws MessagingException { String calendar = "BEGIN:VCALENDAR\r\n" + "METHOD:PUBLISH\r\n" + "PRODID:-"VERSION:2.0\r\n" + "BEGIN:VEVENT\r\n" + "ORGANIZER:mailto:a@example.com\r\n" + "DTSTART:19970701T200000Z\r\n" + "DTSTAMP:19970611T190000Z\r\n" + "SUMM... | public static ICalData parse(ICalPart part) { String iCalText = MessageExtractor.getTextFromPart(part.getPart()); if (iCalText == null) { return new ICalData(new ArrayList<ICalendar>()); } return new ICalData(Biweekly.parse(iCalText).all()); } | ICalParser { public static ICalData parse(ICalPart part) { String iCalText = MessageExtractor.getTextFromPart(part.getPart()); if (iCalText == null) { return new ICalData(new ArrayList<ICalendar>()); } return new ICalData(Biweekly.parse(iCalText).all()); } } | ICalParser { public static ICalData parse(ICalPart part) { String iCalText = MessageExtractor.getTextFromPart(part.getPart()); if (iCalText == null) { return new ICalData(new ArrayList<ICalendar>()); } return new ICalData(Biweekly.parse(iCalText).all()); } } | ICalParser { public static ICalData parse(ICalPart part) { String iCalText = MessageExtractor.getTextFromPart(part.getPart()); if (iCalText == null) { return new ICalData(new ArrayList<ICalendar>()); } return new ICalData(Biweekly.parse(iCalText).all()); } static ICalData parse(ICalPart part); } | ICalParser { public static ICalData parse(ICalPart part) { String iCalText = MessageExtractor.getTextFromPart(part.getPart()); if (iCalText == null) { return new ICalData(new ArrayList<ICalendar>()); } return new ICalData(Biweekly.parse(iCalText).all()); } static ICalData parse(ICalPart part); static final String MIME... |
@Test public void decodeTransportUri_canDecodeAuthType() { String storeUri = "smtp: ServerSettings result = TransportUris.decodeTransportUri(storeUri); assertEquals(AuthType.PLAIN, result.authenticationType); } | public static ServerSettings decodeTransportUri(String uri) { if (uri.startsWith("smtp")) { return decodeSmtpUri(uri); } else if (uri.startsWith("webdav")) { return decodeWebDavUri(uri); } else if (uri.startsWith("ews")) { return decodeEwsUri(uri); } else { throw new IllegalArgumentException("Not a valid transport URI"... | TransportUris { public static ServerSettings decodeTransportUri(String uri) { if (uri.startsWith("smtp")) { return decodeSmtpUri(uri); } else if (uri.startsWith("webdav")) { return decodeWebDavUri(uri); } else if (uri.startsWith("ews")) { return decodeEwsUri(uri); } else { throw new IllegalArgumentException("Not a vali... | TransportUris { public static ServerSettings decodeTransportUri(String uri) { if (uri.startsWith("smtp")) { return decodeSmtpUri(uri); } else if (uri.startsWith("webdav")) { return decodeWebDavUri(uri); } else if (uri.startsWith("ews")) { return decodeEwsUri(uri); } else { throw new IllegalArgumentException("Not a vali... | TransportUris { public static ServerSettings decodeTransportUri(String uri) { if (uri.startsWith("smtp")) { return decodeSmtpUri(uri); } else if (uri.startsWith("webdav")) { return decodeWebDavUri(uri); } else if (uri.startsWith("ews")) { return decodeEwsUri(uri); } else { throw new IllegalArgumentException("Not a vali... | TransportUris { public static ServerSettings decodeTransportUri(String uri) { if (uri.startsWith("smtp")) { return decodeSmtpUri(uri); } else if (uri.startsWith("webdav")) { return decodeWebDavUri(uri); } else if (uri.startsWith("ews")) { return decodeEwsUri(uri); } else { throw new IllegalArgumentException("Not a vali... |
@Test public void decodeTransportUri_canDecodeUsername() { String storeUri = "smtp: ServerSettings result = TransportUris.decodeTransportUri(storeUri); assertEquals("user", result.username); } | public static ServerSettings decodeTransportUri(String uri) { if (uri.startsWith("smtp")) { return decodeSmtpUri(uri); } else if (uri.startsWith("webdav")) { return decodeWebDavUri(uri); } else if (uri.startsWith("ews")) { return decodeEwsUri(uri); } else { throw new IllegalArgumentException("Not a valid transport URI"... | TransportUris { public static ServerSettings decodeTransportUri(String uri) { if (uri.startsWith("smtp")) { return decodeSmtpUri(uri); } else if (uri.startsWith("webdav")) { return decodeWebDavUri(uri); } else if (uri.startsWith("ews")) { return decodeEwsUri(uri); } else { throw new IllegalArgumentException("Not a vali... | TransportUris { public static ServerSettings decodeTransportUri(String uri) { if (uri.startsWith("smtp")) { return decodeSmtpUri(uri); } else if (uri.startsWith("webdav")) { return decodeWebDavUri(uri); } else if (uri.startsWith("ews")) { return decodeEwsUri(uri); } else { throw new IllegalArgumentException("Not a vali... | TransportUris { public static ServerSettings decodeTransportUri(String uri) { if (uri.startsWith("smtp")) { return decodeSmtpUri(uri); } else if (uri.startsWith("webdav")) { return decodeWebDavUri(uri); } else if (uri.startsWith("ews")) { return decodeEwsUri(uri); } else { throw new IllegalArgumentException("Not a vali... | TransportUris { public static ServerSettings decodeTransportUri(String uri) { if (uri.startsWith("smtp")) { return decodeSmtpUri(uri); } else if (uri.startsWith("webdav")) { return decodeWebDavUri(uri); } else if (uri.startsWith("ews")) { return decodeEwsUri(uri); } else { throw new IllegalArgumentException("Not a vali... |
@Test public void decodeTransportUri_canDecodePassword() { String storeUri = "smtp: ServerSettings result = TransportUris.decodeTransportUri(storeUri); assertEquals("password", result.password); } | public static ServerSettings decodeTransportUri(String uri) { if (uri.startsWith("smtp")) { return decodeSmtpUri(uri); } else if (uri.startsWith("webdav")) { return decodeWebDavUri(uri); } else if (uri.startsWith("ews")) { return decodeEwsUri(uri); } else { throw new IllegalArgumentException("Not a valid transport URI"... | TransportUris { public static ServerSettings decodeTransportUri(String uri) { if (uri.startsWith("smtp")) { return decodeSmtpUri(uri); } else if (uri.startsWith("webdav")) { return decodeWebDavUri(uri); } else if (uri.startsWith("ews")) { return decodeEwsUri(uri); } else { throw new IllegalArgumentException("Not a vali... | TransportUris { public static ServerSettings decodeTransportUri(String uri) { if (uri.startsWith("smtp")) { return decodeSmtpUri(uri); } else if (uri.startsWith("webdav")) { return decodeWebDavUri(uri); } else if (uri.startsWith("ews")) { return decodeEwsUri(uri); } else { throw new IllegalArgumentException("Not a vali... | TransportUris { public static ServerSettings decodeTransportUri(String uri) { if (uri.startsWith("smtp")) { return decodeSmtpUri(uri); } else if (uri.startsWith("webdav")) { return decodeWebDavUri(uri); } else if (uri.startsWith("ews")) { return decodeEwsUri(uri); } else { throw new IllegalArgumentException("Not a vali... | TransportUris { public static ServerSettings decodeTransportUri(String uri) { if (uri.startsWith("smtp")) { return decodeSmtpUri(uri); } else if (uri.startsWith("webdav")) { return decodeWebDavUri(uri); } else if (uri.startsWith("ews")) { return decodeEwsUri(uri); } else { throw new IllegalArgumentException("Not a vali... |
@Test public void decodeTransportUri_canDecodeUsername_withNoAuthType() { String storeUri = "smtp: ServerSettings result = TransportUris.decodeTransportUri(storeUri); assertEquals("user", result.username); } | public static ServerSettings decodeTransportUri(String uri) { if (uri.startsWith("smtp")) { return decodeSmtpUri(uri); } else if (uri.startsWith("webdav")) { return decodeWebDavUri(uri); } else if (uri.startsWith("ews")) { return decodeEwsUri(uri); } else { throw new IllegalArgumentException("Not a valid transport URI"... | TransportUris { public static ServerSettings decodeTransportUri(String uri) { if (uri.startsWith("smtp")) { return decodeSmtpUri(uri); } else if (uri.startsWith("webdav")) { return decodeWebDavUri(uri); } else if (uri.startsWith("ews")) { return decodeEwsUri(uri); } else { throw new IllegalArgumentException("Not a vali... | TransportUris { public static ServerSettings decodeTransportUri(String uri) { if (uri.startsWith("smtp")) { return decodeSmtpUri(uri); } else if (uri.startsWith("webdav")) { return decodeWebDavUri(uri); } else if (uri.startsWith("ews")) { return decodeEwsUri(uri); } else { throw new IllegalArgumentException("Not a vali... | TransportUris { public static ServerSettings decodeTransportUri(String uri) { if (uri.startsWith("smtp")) { return decodeSmtpUri(uri); } else if (uri.startsWith("webdav")) { return decodeWebDavUri(uri); } else if (uri.startsWith("ews")) { return decodeEwsUri(uri); } else { throw new IllegalArgumentException("Not a vali... | TransportUris { public static ServerSettings decodeTransportUri(String uri) { if (uri.startsWith("smtp")) { return decodeSmtpUri(uri); } else if (uri.startsWith("webdav")) { return decodeWebDavUri(uri); } else if (uri.startsWith("ews")) { return decodeEwsUri(uri); } else { throw new IllegalArgumentException("Not a vali... |
@Test public void decodeTransportUri_canDecodeUsername_withNoPasswordOrAuthType() { String storeUri = "smtp: ServerSettings result = TransportUris.decodeTransportUri(storeUri); assertEquals("user", result.username); } | public static ServerSettings decodeTransportUri(String uri) { if (uri.startsWith("smtp")) { return decodeSmtpUri(uri); } else if (uri.startsWith("webdav")) { return decodeWebDavUri(uri); } else if (uri.startsWith("ews")) { return decodeEwsUri(uri); } else { throw new IllegalArgumentException("Not a valid transport URI"... | TransportUris { public static ServerSettings decodeTransportUri(String uri) { if (uri.startsWith("smtp")) { return decodeSmtpUri(uri); } else if (uri.startsWith("webdav")) { return decodeWebDavUri(uri); } else if (uri.startsWith("ews")) { return decodeEwsUri(uri); } else { throw new IllegalArgumentException("Not a vali... | TransportUris { public static ServerSettings decodeTransportUri(String uri) { if (uri.startsWith("smtp")) { return decodeSmtpUri(uri); } else if (uri.startsWith("webdav")) { return decodeWebDavUri(uri); } else if (uri.startsWith("ews")) { return decodeEwsUri(uri); } else { throw new IllegalArgumentException("Not a vali... | TransportUris { public static ServerSettings decodeTransportUri(String uri) { if (uri.startsWith("smtp")) { return decodeSmtpUri(uri); } else if (uri.startsWith("webdav")) { return decodeWebDavUri(uri); } else if (uri.startsWith("ews")) { return decodeEwsUri(uri); } else { throw new IllegalArgumentException("Not a vali... | TransportUris { public static ServerSettings decodeTransportUri(String uri) { if (uri.startsWith("smtp")) { return decodeSmtpUri(uri); } else if (uri.startsWith("webdav")) { return decodeWebDavUri(uri); } else if (uri.startsWith("ews")) { return decodeEwsUri(uri); } else { throw new IllegalArgumentException("Not a vali... |
@Test public void decodeTransportUri_canDecodeAuthType_withEmptyPassword() { String storeUri = "smtp: ServerSettings result = TransportUris.decodeTransportUri(storeUri); assertEquals(AuthType.PLAIN, result.authenticationType); } | public static ServerSettings decodeTransportUri(String uri) { if (uri.startsWith("smtp")) { return decodeSmtpUri(uri); } else if (uri.startsWith("webdav")) { return decodeWebDavUri(uri); } else if (uri.startsWith("ews")) { return decodeEwsUri(uri); } else { throw new IllegalArgumentException("Not a valid transport URI"... | TransportUris { public static ServerSettings decodeTransportUri(String uri) { if (uri.startsWith("smtp")) { return decodeSmtpUri(uri); } else if (uri.startsWith("webdav")) { return decodeWebDavUri(uri); } else if (uri.startsWith("ews")) { return decodeEwsUri(uri); } else { throw new IllegalArgumentException("Not a vali... | TransportUris { public static ServerSettings decodeTransportUri(String uri) { if (uri.startsWith("smtp")) { return decodeSmtpUri(uri); } else if (uri.startsWith("webdav")) { return decodeWebDavUri(uri); } else if (uri.startsWith("ews")) { return decodeEwsUri(uri); } else { throw new IllegalArgumentException("Not a vali... | TransportUris { public static ServerSettings decodeTransportUri(String uri) { if (uri.startsWith("smtp")) { return decodeSmtpUri(uri); } else if (uri.startsWith("webdav")) { return decodeWebDavUri(uri); } else if (uri.startsWith("ews")) { return decodeEwsUri(uri); } else { throw new IllegalArgumentException("Not a vali... | TransportUris { public static ServerSettings decodeTransportUri(String uri) { if (uri.startsWith("smtp")) { return decodeSmtpUri(uri); } else if (uri.startsWith("webdav")) { return decodeWebDavUri(uri); } else if (uri.startsWith("ews")) { return decodeEwsUri(uri); } else { throw new IllegalArgumentException("Not a vali... |
@Test public void decodeTransportUri_canDecodeHost() { String storeUri = "smtp: ServerSettings result = TransportUris.decodeTransportUri(storeUri); assertEquals("server", result.host); } | public static ServerSettings decodeTransportUri(String uri) { if (uri.startsWith("smtp")) { return decodeSmtpUri(uri); } else if (uri.startsWith("webdav")) { return decodeWebDavUri(uri); } else if (uri.startsWith("ews")) { return decodeEwsUri(uri); } else { throw new IllegalArgumentException("Not a valid transport URI"... | TransportUris { public static ServerSettings decodeTransportUri(String uri) { if (uri.startsWith("smtp")) { return decodeSmtpUri(uri); } else if (uri.startsWith("webdav")) { return decodeWebDavUri(uri); } else if (uri.startsWith("ews")) { return decodeEwsUri(uri); } else { throw new IllegalArgumentException("Not a vali... | TransportUris { public static ServerSettings decodeTransportUri(String uri) { if (uri.startsWith("smtp")) { return decodeSmtpUri(uri); } else if (uri.startsWith("webdav")) { return decodeWebDavUri(uri); } else if (uri.startsWith("ews")) { return decodeEwsUri(uri); } else { throw new IllegalArgumentException("Not a vali... | TransportUris { public static ServerSettings decodeTransportUri(String uri) { if (uri.startsWith("smtp")) { return decodeSmtpUri(uri); } else if (uri.startsWith("webdav")) { return decodeWebDavUri(uri); } else if (uri.startsWith("ews")) { return decodeEwsUri(uri); } else { throw new IllegalArgumentException("Not a vali... | TransportUris { public static ServerSettings decodeTransportUri(String uri) { if (uri.startsWith("smtp")) { return decodeSmtpUri(uri); } else if (uri.startsWith("webdav")) { return decodeWebDavUri(uri); } else if (uri.startsWith("ews")) { return decodeEwsUri(uri); } else { throw new IllegalArgumentException("Not a vali... |
@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... | MessageCryptoStructureDetector { 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 (Text... | MessageCryptoStructureDetector { 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 (Text... | MessageCryptoStructureDetector { 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 (Text... | MessageCryptoStructureDetector { 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 (Text... |
@Test public void decodeTransportUri_canDecodePort() { String storeUri = "smtp: ServerSettings result = TransportUris.decodeTransportUri(storeUri); assertEquals(123456, result.port); } | public static ServerSettings decodeTransportUri(String uri) { if (uri.startsWith("smtp")) { return decodeSmtpUri(uri); } else if (uri.startsWith("webdav")) { return decodeWebDavUri(uri); } else if (uri.startsWith("ews")) { return decodeEwsUri(uri); } else { throw new IllegalArgumentException("Not a valid transport URI"... | TransportUris { public static ServerSettings decodeTransportUri(String uri) { if (uri.startsWith("smtp")) { return decodeSmtpUri(uri); } else if (uri.startsWith("webdav")) { return decodeWebDavUri(uri); } else if (uri.startsWith("ews")) { return decodeEwsUri(uri); } else { throw new IllegalArgumentException("Not a vali... | TransportUris { public static ServerSettings decodeTransportUri(String uri) { if (uri.startsWith("smtp")) { return decodeSmtpUri(uri); } else if (uri.startsWith("webdav")) { return decodeWebDavUri(uri); } else if (uri.startsWith("ews")) { return decodeEwsUri(uri); } else { throw new IllegalArgumentException("Not a vali... | TransportUris { public static ServerSettings decodeTransportUri(String uri) { if (uri.startsWith("smtp")) { return decodeSmtpUri(uri); } else if (uri.startsWith("webdav")) { return decodeWebDavUri(uri); } else if (uri.startsWith("ews")) { return decodeEwsUri(uri); } else { throw new IllegalArgumentException("Not a vali... | TransportUris { public static ServerSettings decodeTransportUri(String uri) { if (uri.startsWith("smtp")) { return decodeSmtpUri(uri); } else if (uri.startsWith("webdav")) { return decodeWebDavUri(uri); } else if (uri.startsWith("ews")) { return decodeEwsUri(uri); } else { throw new IllegalArgumentException("Not a vali... |
@Test public void decodeTransportUri_canDecodeTLS() { String storeUri = "smtp+tls+: ServerSettings result = TransportUris.decodeTransportUri(storeUri); assertEquals(ConnectionSecurity.STARTTLS_REQUIRED, result.connectionSecurity); } | public static ServerSettings decodeTransportUri(String uri) { if (uri.startsWith("smtp")) { return decodeSmtpUri(uri); } else if (uri.startsWith("webdav")) { return decodeWebDavUri(uri); } else if (uri.startsWith("ews")) { return decodeEwsUri(uri); } else { throw new IllegalArgumentException("Not a valid transport URI"... | TransportUris { public static ServerSettings decodeTransportUri(String uri) { if (uri.startsWith("smtp")) { return decodeSmtpUri(uri); } else if (uri.startsWith("webdav")) { return decodeWebDavUri(uri); } else if (uri.startsWith("ews")) { return decodeEwsUri(uri); } else { throw new IllegalArgumentException("Not a vali... | TransportUris { public static ServerSettings decodeTransportUri(String uri) { if (uri.startsWith("smtp")) { return decodeSmtpUri(uri); } else if (uri.startsWith("webdav")) { return decodeWebDavUri(uri); } else if (uri.startsWith("ews")) { return decodeEwsUri(uri); } else { throw new IllegalArgumentException("Not a vali... | TransportUris { public static ServerSettings decodeTransportUri(String uri) { if (uri.startsWith("smtp")) { return decodeSmtpUri(uri); } else if (uri.startsWith("webdav")) { return decodeWebDavUri(uri); } else if (uri.startsWith("ews")) { return decodeEwsUri(uri); } else { throw new IllegalArgumentException("Not a vali... | TransportUris { public static ServerSettings decodeTransportUri(String uri) { if (uri.startsWith("smtp")) { return decodeSmtpUri(uri); } else if (uri.startsWith("webdav")) { return decodeWebDavUri(uri); } else if (uri.startsWith("ews")) { return decodeEwsUri(uri); } else { throw new IllegalArgumentException("Not a vali... |
@Test public void decodeTransportUri_canDecodeSSL() { String storeUri = "smtp+ssl+: ServerSettings result = TransportUris.decodeTransportUri(storeUri); assertEquals(ConnectionSecurity.SSL_TLS_REQUIRED, result.connectionSecurity); } | public static ServerSettings decodeTransportUri(String uri) { if (uri.startsWith("smtp")) { return decodeSmtpUri(uri); } else if (uri.startsWith("webdav")) { return decodeWebDavUri(uri); } else if (uri.startsWith("ews")) { return decodeEwsUri(uri); } else { throw new IllegalArgumentException("Not a valid transport URI"... | TransportUris { public static ServerSettings decodeTransportUri(String uri) { if (uri.startsWith("smtp")) { return decodeSmtpUri(uri); } else if (uri.startsWith("webdav")) { return decodeWebDavUri(uri); } else if (uri.startsWith("ews")) { return decodeEwsUri(uri); } else { throw new IllegalArgumentException("Not a vali... | TransportUris { public static ServerSettings decodeTransportUri(String uri) { if (uri.startsWith("smtp")) { return decodeSmtpUri(uri); } else if (uri.startsWith("webdav")) { return decodeWebDavUri(uri); } else if (uri.startsWith("ews")) { return decodeEwsUri(uri); } else { throw new IllegalArgumentException("Not a vali... | TransportUris { public static ServerSettings decodeTransportUri(String uri) { if (uri.startsWith("smtp")) { return decodeSmtpUri(uri); } else if (uri.startsWith("webdav")) { return decodeWebDavUri(uri); } else if (uri.startsWith("ews")) { return decodeEwsUri(uri); } else { throw new IllegalArgumentException("Not a vali... | TransportUris { public static ServerSettings decodeTransportUri(String uri) { if (uri.startsWith("smtp")) { return decodeSmtpUri(uri); } else if (uri.startsWith("webdav")) { return decodeWebDavUri(uri); } else if (uri.startsWith("ews")) { return decodeEwsUri(uri); } else { throw new IllegalArgumentException("Not a vali... |
@Test public void decodeTransportUri_canDecodeClientCert() { String storeUri = "smtp+ssl+: ServerSettings result = TransportUris.decodeTransportUri(storeUri); assertEquals("clientCert", result.clientCertificateAlias); } | public static ServerSettings decodeTransportUri(String uri) { if (uri.startsWith("smtp")) { return decodeSmtpUri(uri); } else if (uri.startsWith("webdav")) { return decodeWebDavUri(uri); } else if (uri.startsWith("ews")) { return decodeEwsUri(uri); } else { throw new IllegalArgumentException("Not a valid transport URI"... | TransportUris { public static ServerSettings decodeTransportUri(String uri) { if (uri.startsWith("smtp")) { return decodeSmtpUri(uri); } else if (uri.startsWith("webdav")) { return decodeWebDavUri(uri); } else if (uri.startsWith("ews")) { return decodeEwsUri(uri); } else { throw new IllegalArgumentException("Not a vali... | TransportUris { public static ServerSettings decodeTransportUri(String uri) { if (uri.startsWith("smtp")) { return decodeSmtpUri(uri); } else if (uri.startsWith("webdav")) { return decodeWebDavUri(uri); } else if (uri.startsWith("ews")) { return decodeEwsUri(uri); } else { throw new IllegalArgumentException("Not a vali... | TransportUris { public static ServerSettings decodeTransportUri(String uri) { if (uri.startsWith("smtp")) { return decodeSmtpUri(uri); } else if (uri.startsWith("webdav")) { return decodeWebDavUri(uri); } else if (uri.startsWith("ews")) { return decodeEwsUri(uri); } else { throw new IllegalArgumentException("Not a vali... | TransportUris { public static ServerSettings decodeTransportUri(String uri) { if (uri.startsWith("smtp")) { return decodeSmtpUri(uri); } else if (uri.startsWith("webdav")) { return decodeWebDavUri(uri); } else if (uri.startsWith("ews")) { return decodeEwsUri(uri); } else { throw new IllegalArgumentException("Not a vali... |
@Test(expected = IllegalArgumentException.class) public void decodeTransportUri_forUnknownSchema_throwsIllegalArgumentException() { String storeUri = "unknown: TransportUris.decodeTransportUri(storeUri); } | public static ServerSettings decodeTransportUri(String uri) { if (uri.startsWith("smtp")) { return decodeSmtpUri(uri); } else if (uri.startsWith("webdav")) { return decodeWebDavUri(uri); } else if (uri.startsWith("ews")) { return decodeEwsUri(uri); } else { throw new IllegalArgumentException("Not a valid transport URI"... | TransportUris { public static ServerSettings decodeTransportUri(String uri) { if (uri.startsWith("smtp")) { return decodeSmtpUri(uri); } else if (uri.startsWith("webdav")) { return decodeWebDavUri(uri); } else if (uri.startsWith("ews")) { return decodeEwsUri(uri); } else { throw new IllegalArgumentException("Not a vali... | TransportUris { public static ServerSettings decodeTransportUri(String uri) { if (uri.startsWith("smtp")) { return decodeSmtpUri(uri); } else if (uri.startsWith("webdav")) { return decodeWebDavUri(uri); } else if (uri.startsWith("ews")) { return decodeEwsUri(uri); } else { throw new IllegalArgumentException("Not a vali... | TransportUris { public static ServerSettings decodeTransportUri(String uri) { if (uri.startsWith("smtp")) { return decodeSmtpUri(uri); } else if (uri.startsWith("webdav")) { return decodeWebDavUri(uri); } else if (uri.startsWith("ews")) { return decodeEwsUri(uri); } else { throw new IllegalArgumentException("Not a vali... | TransportUris { public static ServerSettings decodeTransportUri(String uri) { if (uri.startsWith("smtp")) { return decodeSmtpUri(uri); } else if (uri.startsWith("webdav")) { return decodeWebDavUri(uri); } else if (uri.startsWith("ews")) { return decodeEwsUri(uri); } else { throw new IllegalArgumentException("Not a vali... |
@Test public void createTransportUri_canEncodeSmtpSslUri() { ServerSettings serverSettings = new ServerSettings( ServerSettings.Type.SMTP, "server", 123456, ConnectionSecurity.SSL_TLS_REQUIRED, AuthType.EXTERNAL, "user", "password", "clientCert"); String result = TransportUris.createTransportUri(serverSettings); assert... | public static String createTransportUri(ServerSettings server) { if (Type.SMTP == server.type) { return createSmtpUri(server); } else if (Type.WebDAV == server.type) { return createWebDavUri(server); } else if (Type.EWS == server.type) { return createEwsUri(server); } else { throw new IllegalArgumentException("Not a va... | TransportUris { public static String createTransportUri(ServerSettings server) { if (Type.SMTP == server.type) { return createSmtpUri(server); } else if (Type.WebDAV == server.type) { return createWebDavUri(server); } else if (Type.EWS == server.type) { return createEwsUri(server); } else { throw new IllegalArgumentExc... | TransportUris { public static String createTransportUri(ServerSettings server) { if (Type.SMTP == server.type) { return createSmtpUri(server); } else if (Type.WebDAV == server.type) { return createWebDavUri(server); } else if (Type.EWS == server.type) { return createEwsUri(server); } else { throw new IllegalArgumentExc... | TransportUris { public static String createTransportUri(ServerSettings server) { if (Type.SMTP == server.type) { return createSmtpUri(server); } else if (Type.WebDAV == server.type) { return createWebDavUri(server); } else if (Type.EWS == server.type) { return createEwsUri(server); } else { throw new IllegalArgumentExc... | TransportUris { public static String createTransportUri(ServerSettings server) { if (Type.SMTP == server.type) { return createSmtpUri(server); } else if (Type.WebDAV == server.type) { return createWebDavUri(server); } else if (Type.EWS == server.type) { return createEwsUri(server); } else { throw new IllegalArgumentExc... |
@Test public void createTransportUri_canEncodeSmtpTlsUri() { ServerSettings serverSettings = new ServerSettings( ServerSettings.Type.SMTP, "server", 123456, ConnectionSecurity.STARTTLS_REQUIRED, AuthType.PLAIN, "user", "password", "clientCert"); String result = TransportUris.createTransportUri(serverSettings); assertEq... | public static String createTransportUri(ServerSettings server) { if (Type.SMTP == server.type) { return createSmtpUri(server); } else if (Type.WebDAV == server.type) { return createWebDavUri(server); } else if (Type.EWS == server.type) { return createEwsUri(server); } else { throw new IllegalArgumentException("Not a va... | TransportUris { public static String createTransportUri(ServerSettings server) { if (Type.SMTP == server.type) { return createSmtpUri(server); } else if (Type.WebDAV == server.type) { return createWebDavUri(server); } else if (Type.EWS == server.type) { return createEwsUri(server); } else { throw new IllegalArgumentExc... | TransportUris { public static String createTransportUri(ServerSettings server) { if (Type.SMTP == server.type) { return createSmtpUri(server); } else if (Type.WebDAV == server.type) { return createWebDavUri(server); } else if (Type.EWS == server.type) { return createEwsUri(server); } else { throw new IllegalArgumentExc... | TransportUris { public static String createTransportUri(ServerSettings server) { if (Type.SMTP == server.type) { return createSmtpUri(server); } else if (Type.WebDAV == server.type) { return createWebDavUri(server); } else if (Type.EWS == server.type) { return createEwsUri(server); } else { throw new IllegalArgumentExc... | TransportUris { public static String createTransportUri(ServerSettings server) { if (Type.SMTP == server.type) { return createSmtpUri(server); } else if (Type.WebDAV == server.type) { return createWebDavUri(server); } else if (Type.EWS == server.type) { return createEwsUri(server); } else { throw new IllegalArgumentExc... |
@Test public void createTransportUri_canEncodeSmtpUri() { ServerSettings serverSettings = new ServerSettings( ServerSettings.Type.SMTP, "server", 123456, ConnectionSecurity.NONE, AuthType.CRAM_MD5, "user", "password", "clientCert"); String result = TransportUris.createTransportUri(serverSettings); assertEquals("smtp: } | public static String createTransportUri(ServerSettings server) { if (Type.SMTP == server.type) { return createSmtpUri(server); } else if (Type.WebDAV == server.type) { return createWebDavUri(server); } else if (Type.EWS == server.type) { return createEwsUri(server); } else { throw new IllegalArgumentException("Not a va... | TransportUris { public static String createTransportUri(ServerSettings server) { if (Type.SMTP == server.type) { return createSmtpUri(server); } else if (Type.WebDAV == server.type) { return createWebDavUri(server); } else if (Type.EWS == server.type) { return createEwsUri(server); } else { throw new IllegalArgumentExc... | TransportUris { public static String createTransportUri(ServerSettings server) { if (Type.SMTP == server.type) { return createSmtpUri(server); } else if (Type.WebDAV == server.type) { return createWebDavUri(server); } else if (Type.EWS == server.type) { return createEwsUri(server); } else { throw new IllegalArgumentExc... | TransportUris { public static String createTransportUri(ServerSettings server) { if (Type.SMTP == server.type) { return createSmtpUri(server); } else if (Type.WebDAV == server.type) { return createWebDavUri(server); } else if (Type.EWS == server.type) { return createEwsUri(server); } else { throw new IllegalArgumentExc... | TransportUris { public static String createTransportUri(ServerSettings server) { if (Type.SMTP == server.type) { return createSmtpUri(server); } else if (Type.WebDAV == server.type) { return createWebDavUri(server); } else if (Type.EWS == server.type) { return createEwsUri(server); } else { throw new IllegalArgumentExc... |
@Test public void open_withoutAuthLoginExtension_shouldConnectWithoutAuthentication() throws Exception { MockSmtpServer server = new MockSmtpServer(); server.output("220 localhost Simple Mail Transfer Service Ready"); server.expect("EHLO localhost"); server.output("250-localhost Hello client.localhost"); server.output(... | @Override public void open() throws MessagingException { try { boolean secureConnection = false; InetAddress[] addresses = InetAddress.getAllByName(host); for (int i = 0; i < addresses.length; i++) { try { SocketAddress socketAddress = new InetSocketAddress(addresses[i], port); if (connectionSecurity == ConnectionSecur... | SmtpTransport extends Transport { @Override public void open() throws MessagingException { try { boolean secureConnection = false; InetAddress[] addresses = InetAddress.getAllByName(host); for (int i = 0; i < addresses.length; i++) { try { SocketAddress socketAddress = new InetSocketAddress(addresses[i], port); if (con... | SmtpTransport extends Transport { @Override public void open() throws MessagingException { try { boolean secureConnection = false; InetAddress[] addresses = InetAddress.getAllByName(host); for (int i = 0; i < addresses.length; i++) { try { SocketAddress socketAddress = new InetSocketAddress(addresses[i], port); if (con... | SmtpTransport extends Transport { @Override public void open() throws MessagingException { try { boolean secureConnection = false; InetAddress[] addresses = InetAddress.getAllByName(host); for (int i = 0; i < addresses.length; i++) { try { SocketAddress socketAddress = new InetSocketAddress(addresses[i], port); if (con... | SmtpTransport extends Transport { @Override public void open() throws MessagingException { try { boolean secureConnection = false; InetAddress[] addresses = InetAddress.getAllByName(host); for (int i = 0; i < addresses.length; i++) { try { SocketAddress socketAddress = new InetSocketAddress(addresses[i], port); if (con... |
@Test public void open_withAuthPlainExtension() throws Exception { MockSmtpServer server = new MockSmtpServer(); server.output("220 localhost Simple Mail Transfer Service Ready"); server.expect("EHLO localhost"); server.output("250-localhost Hello client.localhost"); server.output("250 AUTH PLAIN LOGIN"); server.expect... | @Override public void open() throws MessagingException { try { boolean secureConnection = false; InetAddress[] addresses = InetAddress.getAllByName(host); for (int i = 0; i < addresses.length; i++) { try { SocketAddress socketAddress = new InetSocketAddress(addresses[i], port); if (connectionSecurity == ConnectionSecur... | SmtpTransport extends Transport { @Override public void open() throws MessagingException { try { boolean secureConnection = false; InetAddress[] addresses = InetAddress.getAllByName(host); for (int i = 0; i < addresses.length; i++) { try { SocketAddress socketAddress = new InetSocketAddress(addresses[i], port); if (con... | SmtpTransport extends Transport { @Override public void open() throws MessagingException { try { boolean secureConnection = false; InetAddress[] addresses = InetAddress.getAllByName(host); for (int i = 0; i < addresses.length; i++) { try { SocketAddress socketAddress = new InetSocketAddress(addresses[i], port); if (con... | SmtpTransport extends Transport { @Override public void open() throws MessagingException { try { boolean secureConnection = false; InetAddress[] addresses = InetAddress.getAllByName(host); for (int i = 0; i < addresses.length; i++) { try { SocketAddress socketAddress = new InetSocketAddress(addresses[i], port); if (con... | SmtpTransport extends Transport { @Override public void open() throws MessagingException { try { boolean secureConnection = false; InetAddress[] addresses = InetAddress.getAllByName(host); for (int i = 0; i < addresses.length; i++) { try { SocketAddress socketAddress = new InetSocketAddress(addresses[i], port); if (con... |
@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(); ... | MessageCryptoStructureDetector { @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)) { ret... | MessageCryptoStructureDetector { @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)) { ret... | MessageCryptoStructureDetector { @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)) { ret... | MessageCryptoStructureDetector { @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)) { ret... |
@Test public void open_withAuthLoginExtension() throws Exception { MockSmtpServer server = new MockSmtpServer(); server.output("220 localhost Simple Mail Transfer Service Ready"); server.expect("EHLO localhost"); server.output("250-localhost Hello client.localhost"); server.output("250 AUTH LOGIN"); server.expect("AUTH... | @Override public void open() throws MessagingException { try { boolean secureConnection = false; InetAddress[] addresses = InetAddress.getAllByName(host); for (int i = 0; i < addresses.length; i++) { try { SocketAddress socketAddress = new InetSocketAddress(addresses[i], port); if (connectionSecurity == ConnectionSecur... | SmtpTransport extends Transport { @Override public void open() throws MessagingException { try { boolean secureConnection = false; InetAddress[] addresses = InetAddress.getAllByName(host); for (int i = 0; i < addresses.length; i++) { try { SocketAddress socketAddress = new InetSocketAddress(addresses[i], port); if (con... | SmtpTransport extends Transport { @Override public void open() throws MessagingException { try { boolean secureConnection = false; InetAddress[] addresses = InetAddress.getAllByName(host); for (int i = 0; i < addresses.length; i++) { try { SocketAddress socketAddress = new InetSocketAddress(addresses[i], port); if (con... | SmtpTransport extends Transport { @Override public void open() throws MessagingException { try { boolean secureConnection = false; InetAddress[] addresses = InetAddress.getAllByName(host); for (int i = 0; i < addresses.length; i++) { try { SocketAddress socketAddress = new InetSocketAddress(addresses[i], port); if (con... | SmtpTransport extends Transport { @Override public void open() throws MessagingException { try { boolean secureConnection = false; InetAddress[] addresses = InetAddress.getAllByName(host); for (int i = 0; i < addresses.length; i++) { try { SocketAddress socketAddress = new InetSocketAddress(addresses[i], port); if (con... |
@Test public void open_withoutLoginAndPlainAuthExtensions_shouldThrow() throws Exception { MockSmtpServer server = new MockSmtpServer(); server.output("220 localhost Simple Mail Transfer Service Ready"); server.expect("EHLO localhost"); server.output("250-localhost Hello client.localhost"); server.output("250 AUTH"); s... | @Override public void open() throws MessagingException { try { boolean secureConnection = false; InetAddress[] addresses = InetAddress.getAllByName(host); for (int i = 0; i < addresses.length; i++) { try { SocketAddress socketAddress = new InetSocketAddress(addresses[i], port); if (connectionSecurity == ConnectionSecur... | SmtpTransport extends Transport { @Override public void open() throws MessagingException { try { boolean secureConnection = false; InetAddress[] addresses = InetAddress.getAllByName(host); for (int i = 0; i < addresses.length; i++) { try { SocketAddress socketAddress = new InetSocketAddress(addresses[i], port); if (con... | SmtpTransport extends Transport { @Override public void open() throws MessagingException { try { boolean secureConnection = false; InetAddress[] addresses = InetAddress.getAllByName(host); for (int i = 0; i < addresses.length; i++) { try { SocketAddress socketAddress = new InetSocketAddress(addresses[i], port); if (con... | SmtpTransport extends Transport { @Override public void open() throws MessagingException { try { boolean secureConnection = false; InetAddress[] addresses = InetAddress.getAllByName(host); for (int i = 0; i < addresses.length; i++) { try { SocketAddress socketAddress = new InetSocketAddress(addresses[i], port); if (con... | SmtpTransport extends Transport { @Override public void open() throws MessagingException { try { boolean secureConnection = false; InetAddress[] addresses = InetAddress.getAllByName(host); for (int i = 0; i < addresses.length; i++) { try { SocketAddress socketAddress = new InetSocketAddress(addresses[i], port); if (con... |
@Test public void open_withCramMd5AuthExtension() throws Exception { MockSmtpServer server = new MockSmtpServer(); server.output("220 localhost Simple Mail Transfer Service Ready"); server.expect("EHLO localhost"); server.output("250-localhost Hello client.localhost"); server.output("250 AUTH CRAM-MD5"); server.expect(... | @Override public void open() throws MessagingException { try { boolean secureConnection = false; InetAddress[] addresses = InetAddress.getAllByName(host); for (int i = 0; i < addresses.length; i++) { try { SocketAddress socketAddress = new InetSocketAddress(addresses[i], port); if (connectionSecurity == ConnectionSecur... | SmtpTransport extends Transport { @Override public void open() throws MessagingException { try { boolean secureConnection = false; InetAddress[] addresses = InetAddress.getAllByName(host); for (int i = 0; i < addresses.length; i++) { try { SocketAddress socketAddress = new InetSocketAddress(addresses[i], port); if (con... | SmtpTransport extends Transport { @Override public void open() throws MessagingException { try { boolean secureConnection = false; InetAddress[] addresses = InetAddress.getAllByName(host); for (int i = 0; i < addresses.length; i++) { try { SocketAddress socketAddress = new InetSocketAddress(addresses[i], port); if (con... | SmtpTransport extends Transport { @Override public void open() throws MessagingException { try { boolean secureConnection = false; InetAddress[] addresses = InetAddress.getAllByName(host); for (int i = 0; i < addresses.length; i++) { try { SocketAddress socketAddress = new InetSocketAddress(addresses[i], port); if (con... | SmtpTransport extends Transport { @Override public void open() throws MessagingException { try { boolean secureConnection = false; InetAddress[] addresses = InetAddress.getAllByName(host); for (int i = 0; i < addresses.length; i++) { try { SocketAddress socketAddress = new InetSocketAddress(addresses[i], port); if (con... |
@Test public void open_withoutCramMd5AuthExtension_shouldThrow() throws Exception { MockSmtpServer server = new MockSmtpServer(); server.output("220 localhost Simple Mail Transfer Service Ready"); server.expect("EHLO localhost"); server.output("250-localhost Hello client.localhost"); server.output("250 AUTH PLAIN LOGIN... | @Override public void open() throws MessagingException { try { boolean secureConnection = false; InetAddress[] addresses = InetAddress.getAllByName(host); for (int i = 0; i < addresses.length; i++) { try { SocketAddress socketAddress = new InetSocketAddress(addresses[i], port); if (connectionSecurity == ConnectionSecur... | SmtpTransport extends Transport { @Override public void open() throws MessagingException { try { boolean secureConnection = false; InetAddress[] addresses = InetAddress.getAllByName(host); for (int i = 0; i < addresses.length; i++) { try { SocketAddress socketAddress = new InetSocketAddress(addresses[i], port); if (con... | SmtpTransport extends Transport { @Override public void open() throws MessagingException { try { boolean secureConnection = false; InetAddress[] addresses = InetAddress.getAllByName(host); for (int i = 0; i < addresses.length; i++) { try { SocketAddress socketAddress = new InetSocketAddress(addresses[i], port); if (con... | SmtpTransport extends Transport { @Override public void open() throws MessagingException { try { boolean secureConnection = false; InetAddress[] addresses = InetAddress.getAllByName(host); for (int i = 0; i < addresses.length; i++) { try { SocketAddress socketAddress = new InetSocketAddress(addresses[i], port); if (con... | SmtpTransport extends Transport { @Override public void open() throws MessagingException { try { boolean secureConnection = false; InetAddress[] addresses = InetAddress.getAllByName(host); for (int i = 0; i < addresses.length; i++) { try { SocketAddress socketAddress = new InetSocketAddress(addresses[i], port); if (con... |
@Test public void open_withXoauth2Extension() throws Exception { MockSmtpServer server = new MockSmtpServer(); server.output("220 localhost Simple Mail Transfer Service Ready"); server.expect("EHLO localhost"); server.output("250-localhost Hello client.localhost"); server.output("250 AUTH XOAUTH2"); server.expect("AUTH... | @Override public void open() throws MessagingException { try { boolean secureConnection = false; InetAddress[] addresses = InetAddress.getAllByName(host); for (int i = 0; i < addresses.length; i++) { try { SocketAddress socketAddress = new InetSocketAddress(addresses[i], port); if (connectionSecurity == ConnectionSecur... | SmtpTransport extends Transport { @Override public void open() throws MessagingException { try { boolean secureConnection = false; InetAddress[] addresses = InetAddress.getAllByName(host); for (int i = 0; i < addresses.length; i++) { try { SocketAddress socketAddress = new InetSocketAddress(addresses[i], port); if (con... | SmtpTransport extends Transport { @Override public void open() throws MessagingException { try { boolean secureConnection = false; InetAddress[] addresses = InetAddress.getAllByName(host); for (int i = 0; i < addresses.length; i++) { try { SocketAddress socketAddress = new InetSocketAddress(addresses[i], port); if (con... | SmtpTransport extends Transport { @Override public void open() throws MessagingException { try { boolean secureConnection = false; InetAddress[] addresses = InetAddress.getAllByName(host); for (int i = 0; i < addresses.length; i++) { try { SocketAddress socketAddress = new InetSocketAddress(addresses[i], port); if (con... | SmtpTransport extends Transport { @Override public void open() throws MessagingException { try { boolean secureConnection = false; InetAddress[] addresses = InetAddress.getAllByName(host); for (int i = 0; i < addresses.length; i++) { try { SocketAddress socketAddress = new InetSocketAddress(addresses[i], port); if (con... |
@Test public void open_withXoauth2Extension_shouldThrowOn401Response() throws Exception { MockSmtpServer server = new MockSmtpServer(); server.output("220 localhost Simple Mail Transfer Service Ready"); server.expect("EHLO localhost"); server.output("250-localhost Hello client.localhost"); server.output("250 AUTH XOAUT... | @Override public void open() throws MessagingException { try { boolean secureConnection = false; InetAddress[] addresses = InetAddress.getAllByName(host); for (int i = 0; i < addresses.length; i++) { try { SocketAddress socketAddress = new InetSocketAddress(addresses[i], port); if (connectionSecurity == ConnectionSecur... | SmtpTransport extends Transport { @Override public void open() throws MessagingException { try { boolean secureConnection = false; InetAddress[] addresses = InetAddress.getAllByName(host); for (int i = 0; i < addresses.length; i++) { try { SocketAddress socketAddress = new InetSocketAddress(addresses[i], port); if (con... | SmtpTransport extends Transport { @Override public void open() throws MessagingException { try { boolean secureConnection = false; InetAddress[] addresses = InetAddress.getAllByName(host); for (int i = 0; i < addresses.length; i++) { try { SocketAddress socketAddress = new InetSocketAddress(addresses[i], port); if (con... | SmtpTransport extends Transport { @Override public void open() throws MessagingException { try { boolean secureConnection = false; InetAddress[] addresses = InetAddress.getAllByName(host); for (int i = 0; i < addresses.length; i++) { try { SocketAddress socketAddress = new InetSocketAddress(addresses[i], port); if (con... | SmtpTransport extends Transport { @Override public void open() throws MessagingException { try { boolean secureConnection = false; InetAddress[] addresses = InetAddress.getAllByName(host); for (int i = 0; i < addresses.length; i++) { try { SocketAddress socketAddress = new InetSocketAddress(addresses[i], port); if (con... |
@Test public void open_withXoauth2Extension_shouldInvalidateAndRetryOn400Response() throws Exception { MockSmtpServer server = new MockSmtpServer(); server.output("220 localhost Simple Mail Transfer Service Ready"); server.expect("EHLO localhost"); server.output("250-localhost Hello client.localhost"); server.output("2... | @Override public void open() throws MessagingException { try { boolean secureConnection = false; InetAddress[] addresses = InetAddress.getAllByName(host); for (int i = 0; i < addresses.length; i++) { try { SocketAddress socketAddress = new InetSocketAddress(addresses[i], port); if (connectionSecurity == ConnectionSecur... | SmtpTransport extends Transport { @Override public void open() throws MessagingException { try { boolean secureConnection = false; InetAddress[] addresses = InetAddress.getAllByName(host); for (int i = 0; i < addresses.length; i++) { try { SocketAddress socketAddress = new InetSocketAddress(addresses[i], port); if (con... | SmtpTransport extends Transport { @Override public void open() throws MessagingException { try { boolean secureConnection = false; InetAddress[] addresses = InetAddress.getAllByName(host); for (int i = 0; i < addresses.length; i++) { try { SocketAddress socketAddress = new InetSocketAddress(addresses[i], port); if (con... | SmtpTransport extends Transport { @Override public void open() throws MessagingException { try { boolean secureConnection = false; InetAddress[] addresses = InetAddress.getAllByName(host); for (int i = 0; i < addresses.length; i++) { try { SocketAddress socketAddress = new InetSocketAddress(addresses[i], port); if (con... | SmtpTransport extends Transport { @Override public void open() throws MessagingException { try { boolean secureConnection = false; InetAddress[] addresses = InetAddress.getAllByName(host); for (int i = 0; i < addresses.length; i++) { try { SocketAddress socketAddress = new InetSocketAddress(addresses[i], port); if (con... |
@Test public void open_withXoauth2Extension_shouldInvalidateAndRetryOnInvalidJsonResponse() throws Exception { MockSmtpServer server = new MockSmtpServer(); server.output("220 localhost Simple Mail Transfer Service Ready"); server.expect("EHLO localhost"); server.output("250-localhost Hello client.localhost"); server.o... | @Override public void open() throws MessagingException { try { boolean secureConnection = false; InetAddress[] addresses = InetAddress.getAllByName(host); for (int i = 0; i < addresses.length; i++) { try { SocketAddress socketAddress = new InetSocketAddress(addresses[i], port); if (connectionSecurity == ConnectionSecur... | SmtpTransport extends Transport { @Override public void open() throws MessagingException { try { boolean secureConnection = false; InetAddress[] addresses = InetAddress.getAllByName(host); for (int i = 0; i < addresses.length; i++) { try { SocketAddress socketAddress = new InetSocketAddress(addresses[i], port); if (con... | SmtpTransport extends Transport { @Override public void open() throws MessagingException { try { boolean secureConnection = false; InetAddress[] addresses = InetAddress.getAllByName(host); for (int i = 0; i < addresses.length; i++) { try { SocketAddress socketAddress = new InetSocketAddress(addresses[i], port); if (con... | SmtpTransport extends Transport { @Override public void open() throws MessagingException { try { boolean secureConnection = false; InetAddress[] addresses = InetAddress.getAllByName(host); for (int i = 0; i < addresses.length; i++) { try { SocketAddress socketAddress = new InetSocketAddress(addresses[i], port); if (con... | SmtpTransport extends Transport { @Override public void open() throws MessagingException { try { boolean secureConnection = false; InetAddress[] addresses = InetAddress.getAllByName(host); for (int i = 0; i < addresses.length; i++) { try { SocketAddress socketAddress = new InetSocketAddress(addresses[i], port); if (con... |
@Test public void open_withXoauth2Extension_shouldInvalidateAndRetryOnMissingStatusJsonResponse() throws Exception { MockSmtpServer server = new MockSmtpServer(); server.output("220 localhost Simple Mail Transfer Service Ready"); server.expect("EHLO localhost"); server.output("250-localhost Hello client.localhost"); se... | @Override public void open() throws MessagingException { try { boolean secureConnection = false; InetAddress[] addresses = InetAddress.getAllByName(host); for (int i = 0; i < addresses.length; i++) { try { SocketAddress socketAddress = new InetSocketAddress(addresses[i], port); if (connectionSecurity == ConnectionSecur... | SmtpTransport extends Transport { @Override public void open() throws MessagingException { try { boolean secureConnection = false; InetAddress[] addresses = InetAddress.getAllByName(host); for (int i = 0; i < addresses.length; i++) { try { SocketAddress socketAddress = new InetSocketAddress(addresses[i], port); if (con... | SmtpTransport extends Transport { @Override public void open() throws MessagingException { try { boolean secureConnection = false; InetAddress[] addresses = InetAddress.getAllByName(host); for (int i = 0; i < addresses.length; i++) { try { SocketAddress socketAddress = new InetSocketAddress(addresses[i], port); if (con... | SmtpTransport extends Transport { @Override public void open() throws MessagingException { try { boolean secureConnection = false; InetAddress[] addresses = InetAddress.getAllByName(host); for (int i = 0; i < addresses.length; i++) { try { SocketAddress socketAddress = new InetSocketAddress(addresses[i], port); if (con... | SmtpTransport extends Transport { @Override public void open() throws MessagingException { try { boolean secureConnection = false; InetAddress[] addresses = InetAddress.getAllByName(host); for (int i = 0; i < addresses.length; i++) { try { SocketAddress socketAddress = new InetSocketAddress(addresses[i], port); if (con... |
@Test public void open_withXoauth2Extension_shouldThrowOnMultipleFailure() throws Exception { MockSmtpServer server = new MockSmtpServer(); server.output("220 localhost Simple Mail Transfer Service Ready"); server.expect("EHLO localhost"); server.output("250-localhost Hello client.localhost"); server.output("250 AUTH X... | @Override public void open() throws MessagingException { try { boolean secureConnection = false; InetAddress[] addresses = InetAddress.getAllByName(host); for (int i = 0; i < addresses.length; i++) { try { SocketAddress socketAddress = new InetSocketAddress(addresses[i], port); if (connectionSecurity == ConnectionSecur... | SmtpTransport extends Transport { @Override public void open() throws MessagingException { try { boolean secureConnection = false; InetAddress[] addresses = InetAddress.getAllByName(host); for (int i = 0; i < addresses.length; i++) { try { SocketAddress socketAddress = new InetSocketAddress(addresses[i], port); if (con... | SmtpTransport extends Transport { @Override public void open() throws MessagingException { try { boolean secureConnection = false; InetAddress[] addresses = InetAddress.getAllByName(host); for (int i = 0; i < addresses.length; i++) { try { SocketAddress socketAddress = new InetSocketAddress(addresses[i], port); if (con... | SmtpTransport extends Transport { @Override public void open() throws MessagingException { try { boolean secureConnection = false; InetAddress[] addresses = InetAddress.getAllByName(host); for (int i = 0; i < addresses.length; i++) { try { SocketAddress socketAddress = new InetSocketAddress(addresses[i], port); if (con... | SmtpTransport extends Transport { @Override public void open() throws MessagingException { try { boolean secureConnection = false; InetAddress[] addresses = InetAddress.getAllByName(host); for (int i = 0; i < addresses.length; i++) { try { SocketAddress socketAddress = new InetSocketAddress(addresses[i], port); if (con... |
@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... | MessageCryptoStructureDetector { 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 (Text... | MessageCryptoStructureDetector { 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 (Text... | MessageCryptoStructureDetector { 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 (Text... | MessageCryptoStructureDetector { 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 (Text... |
@Test public void open_withXoauth2Extension_shouldThrowOnFailure_fetchingToken() throws Exception { MockSmtpServer server = new MockSmtpServer(); server.output("220 localhost Simple Mail Transfer Service Ready"); server.expect("EHLO localhost"); server.output("250-localhost Hello client.localhost"); server.output("250 ... | @Override public void open() throws MessagingException { try { boolean secureConnection = false; InetAddress[] addresses = InetAddress.getAllByName(host); for (int i = 0; i < addresses.length; i++) { try { SocketAddress socketAddress = new InetSocketAddress(addresses[i], port); if (connectionSecurity == ConnectionSecur... | SmtpTransport extends Transport { @Override public void open() throws MessagingException { try { boolean secureConnection = false; InetAddress[] addresses = InetAddress.getAllByName(host); for (int i = 0; i < addresses.length; i++) { try { SocketAddress socketAddress = new InetSocketAddress(addresses[i], port); if (con... | SmtpTransport extends Transport { @Override public void open() throws MessagingException { try { boolean secureConnection = false; InetAddress[] addresses = InetAddress.getAllByName(host); for (int i = 0; i < addresses.length; i++) { try { SocketAddress socketAddress = new InetSocketAddress(addresses[i], port); if (con... | SmtpTransport extends Transport { @Override public void open() throws MessagingException { try { boolean secureConnection = false; InetAddress[] addresses = InetAddress.getAllByName(host); for (int i = 0; i < addresses.length; i++) { try { SocketAddress socketAddress = new InetSocketAddress(addresses[i], port); if (con... | SmtpTransport extends Transport { @Override public void open() throws MessagingException { try { boolean secureConnection = false; InetAddress[] addresses = InetAddress.getAllByName(host); for (int i = 0; i < addresses.length; i++) { try { SocketAddress socketAddress = new InetSocketAddress(addresses[i], port); if (con... |
@Test public void open_withoutXoauth2Extension_shouldThrow() throws Exception { MockSmtpServer server = new MockSmtpServer(); server.output("220 localhost Simple Mail Transfer Service Ready"); server.expect("EHLO localhost"); server.output("250-localhost Hello client.localhost"); server.output("250 AUTH PLAIN LOGIN"); ... | @Override public void open() throws MessagingException { try { boolean secureConnection = false; InetAddress[] addresses = InetAddress.getAllByName(host); for (int i = 0; i < addresses.length; i++) { try { SocketAddress socketAddress = new InetSocketAddress(addresses[i], port); if (connectionSecurity == ConnectionSecur... | SmtpTransport extends Transport { @Override public void open() throws MessagingException { try { boolean secureConnection = false; InetAddress[] addresses = InetAddress.getAllByName(host); for (int i = 0; i < addresses.length; i++) { try { SocketAddress socketAddress = new InetSocketAddress(addresses[i], port); if (con... | SmtpTransport extends Transport { @Override public void open() throws MessagingException { try { boolean secureConnection = false; InetAddress[] addresses = InetAddress.getAllByName(host); for (int i = 0; i < addresses.length; i++) { try { SocketAddress socketAddress = new InetSocketAddress(addresses[i], port); if (con... | SmtpTransport extends Transport { @Override public void open() throws MessagingException { try { boolean secureConnection = false; InetAddress[] addresses = InetAddress.getAllByName(host); for (int i = 0; i < addresses.length; i++) { try { SocketAddress socketAddress = new InetSocketAddress(addresses[i], port); if (con... | SmtpTransport extends Transport { @Override public void open() throws MessagingException { try { boolean secureConnection = false; InetAddress[] addresses = InetAddress.getAllByName(host); for (int i = 0; i < addresses.length; i++) { try { SocketAddress socketAddress = new InetSocketAddress(addresses[i], port); if (con... |
@Test public void open_withAuthExternalExtension() throws Exception { MockSmtpServer server = new MockSmtpServer(); server.output("220 localhost Simple Mail Transfer Service Ready"); server.expect("EHLO localhost"); server.output("250-localhost Hello client.localhost"); server.output("250 AUTH EXTERNAL"); server.expect... | @Override public void open() throws MessagingException { try { boolean secureConnection = false; InetAddress[] addresses = InetAddress.getAllByName(host); for (int i = 0; i < addresses.length; i++) { try { SocketAddress socketAddress = new InetSocketAddress(addresses[i], port); if (connectionSecurity == ConnectionSecur... | SmtpTransport extends Transport { @Override public void open() throws MessagingException { try { boolean secureConnection = false; InetAddress[] addresses = InetAddress.getAllByName(host); for (int i = 0; i < addresses.length; i++) { try { SocketAddress socketAddress = new InetSocketAddress(addresses[i], port); if (con... | SmtpTransport extends Transport { @Override public void open() throws MessagingException { try { boolean secureConnection = false; InetAddress[] addresses = InetAddress.getAllByName(host); for (int i = 0; i < addresses.length; i++) { try { SocketAddress socketAddress = new InetSocketAddress(addresses[i], port); if (con... | SmtpTransport extends Transport { @Override public void open() throws MessagingException { try { boolean secureConnection = false; InetAddress[] addresses = InetAddress.getAllByName(host); for (int i = 0; i < addresses.length; i++) { try { SocketAddress socketAddress = new InetSocketAddress(addresses[i], port); if (con... | SmtpTransport extends Transport { @Override public void open() throws MessagingException { try { boolean secureConnection = false; InetAddress[] addresses = InetAddress.getAllByName(host); for (int i = 0; i < addresses.length; i++) { try { SocketAddress socketAddress = new InetSocketAddress(addresses[i], port); if (con... |
@Test public void open_withoutAuthExternalExtension_shouldThrow() throws Exception { MockSmtpServer server = new MockSmtpServer(); server.output("220 localhost Simple Mail Transfer Service Ready"); server.expect("EHLO localhost"); server.output("250-localhost Hello client.localhost"); server.output("250 AUTH"); server.... | @Override public void open() throws MessagingException { try { boolean secureConnection = false; InetAddress[] addresses = InetAddress.getAllByName(host); for (int i = 0; i < addresses.length; i++) { try { SocketAddress socketAddress = new InetSocketAddress(addresses[i], port); if (connectionSecurity == ConnectionSecur... | SmtpTransport extends Transport { @Override public void open() throws MessagingException { try { boolean secureConnection = false; InetAddress[] addresses = InetAddress.getAllByName(host); for (int i = 0; i < addresses.length; i++) { try { SocketAddress socketAddress = new InetSocketAddress(addresses[i], port); if (con... | SmtpTransport extends Transport { @Override public void open() throws MessagingException { try { boolean secureConnection = false; InetAddress[] addresses = InetAddress.getAllByName(host); for (int i = 0; i < addresses.length; i++) { try { SocketAddress socketAddress = new InetSocketAddress(addresses[i], port); if (con... | SmtpTransport extends Transport { @Override public void open() throws MessagingException { try { boolean secureConnection = false; InetAddress[] addresses = InetAddress.getAllByName(host); for (int i = 0; i < addresses.length; i++) { try { SocketAddress socketAddress = new InetSocketAddress(addresses[i], port); if (con... | SmtpTransport extends Transport { @Override public void open() throws MessagingException { try { boolean secureConnection = false; InetAddress[] addresses = InetAddress.getAllByName(host); for (int i = 0; i < addresses.length; i++) { try { SocketAddress socketAddress = new InetSocketAddress(addresses[i], port); if (con... |
@Test public void open_withAutomaticAuthAndNoTransportSecurityAndAuthCramMd5Extension_shouldUseAuthCramMd5() throws Exception { MockSmtpServer server = new MockSmtpServer(); server.output("220 localhost Simple Mail Transfer Service Ready"); server.expect("EHLO localhost"); server.output("250-localhost Hello client.loca... | @Override public void open() throws MessagingException { try { boolean secureConnection = false; InetAddress[] addresses = InetAddress.getAllByName(host); for (int i = 0; i < addresses.length; i++) { try { SocketAddress socketAddress = new InetSocketAddress(addresses[i], port); if (connectionSecurity == ConnectionSecur... | SmtpTransport extends Transport { @Override public void open() throws MessagingException { try { boolean secureConnection = false; InetAddress[] addresses = InetAddress.getAllByName(host); for (int i = 0; i < addresses.length; i++) { try { SocketAddress socketAddress = new InetSocketAddress(addresses[i], port); if (con... | SmtpTransport extends Transport { @Override public void open() throws MessagingException { try { boolean secureConnection = false; InetAddress[] addresses = InetAddress.getAllByName(host); for (int i = 0; i < addresses.length; i++) { try { SocketAddress socketAddress = new InetSocketAddress(addresses[i], port); if (con... | SmtpTransport extends Transport { @Override public void open() throws MessagingException { try { boolean secureConnection = false; InetAddress[] addresses = InetAddress.getAllByName(host); for (int i = 0; i < addresses.length; i++) { try { SocketAddress socketAddress = new InetSocketAddress(addresses[i], port); if (con... | SmtpTransport extends Transport { @Override public void open() throws MessagingException { try { boolean secureConnection = false; InetAddress[] addresses = InetAddress.getAllByName(host); for (int i = 0; i < addresses.length; i++) { try { SocketAddress socketAddress = new InetSocketAddress(addresses[i], port); if (con... |
@Test public void open_withAutomaticAuthAndNoTransportSecurityAndAuthPlainExtension_shouldThrow() throws Exception { MockSmtpServer server = new MockSmtpServer(); server.output("220 localhost Simple Mail Transfer Service Ready"); server.expect("EHLO localhost"); server.output("250-localhost Hello client.localhost"); se... | @Override public void open() throws MessagingException { try { boolean secureConnection = false; InetAddress[] addresses = InetAddress.getAllByName(host); for (int i = 0; i < addresses.length; i++) { try { SocketAddress socketAddress = new InetSocketAddress(addresses[i], port); if (connectionSecurity == ConnectionSecur... | SmtpTransport extends Transport { @Override public void open() throws MessagingException { try { boolean secureConnection = false; InetAddress[] addresses = InetAddress.getAllByName(host); for (int i = 0; i < addresses.length; i++) { try { SocketAddress socketAddress = new InetSocketAddress(addresses[i], port); if (con... | SmtpTransport extends Transport { @Override public void open() throws MessagingException { try { boolean secureConnection = false; InetAddress[] addresses = InetAddress.getAllByName(host); for (int i = 0; i < addresses.length; i++) { try { SocketAddress socketAddress = new InetSocketAddress(addresses[i], port); if (con... | SmtpTransport extends Transport { @Override public void open() throws MessagingException { try { boolean secureConnection = false; InetAddress[] addresses = InetAddress.getAllByName(host); for (int i = 0; i < addresses.length; i++) { try { SocketAddress socketAddress = new InetSocketAddress(addresses[i], port); if (con... | SmtpTransport extends Transport { @Override public void open() throws MessagingException { try { boolean secureConnection = false; InetAddress[] addresses = InetAddress.getAllByName(host); for (int i = 0; i < addresses.length; i++) { try { SocketAddress socketAddress = new InetSocketAddress(addresses[i], port); if (con... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.