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 open_authPlainWithAuthenticationFailure_shouldFallbackToLogin() throws Exception { settings.setAuthType(AuthType.PLAIN); MockImapServer server = new MockImapServer(); preAuthenticationDialog(server, "AUTH=PLAIN"); server.expect("2 AUTHENTICATE PLAIN"); server.output("+"); server.expect(ByteString.enco... | public void open() throws IOException, MessagingException { if (open) { return; } else if (stacktraceForClose != null) { throw new IllegalStateException("open() called after close(). " + "Check wrapped exception to see where close() was called.", stacktraceForClose); } open = true; boolean authSuccess = false; nextComm... | ImapConnection { public void open() throws IOException, MessagingException { if (open) { return; } else if (stacktraceForClose != null) { throw new IllegalStateException("open() called after close(). " + "Check wrapped exception to see where close() was called.", stacktraceForClose); } open = true; boolean authSuccess ... | ImapConnection { public void open() throws IOException, MessagingException { if (open) { return; } else if (stacktraceForClose != null) { throw new IllegalStateException("open() called after close(). " + "Check wrapped exception to see where close() was called.", stacktraceForClose); } open = true; boolean authSuccess ... | ImapConnection { public void open() throws IOException, MessagingException { if (open) { return; } else if (stacktraceForClose != null) { throw new IllegalStateException("open() called after close(). " + "Check wrapped exception to see where close() was called.", stacktraceForClose); } open = true; boolean authSuccess ... | ImapConnection { public void open() throws IOException, MessagingException { if (open) { return; } else if (stacktraceForClose != null) { throw new IllegalStateException("open() called after close(). " + "Check wrapped exception to see where close() was called.", stacktraceForClose); } open = true; boolean authSuccess ... |
@Test public void open_authPlainAndLoginFallbackWithAuthenticationFailure_shouldThrow() throws Exception { settings.setAuthType(AuthType.PLAIN); MockImapServer server = new MockImapServer(); preAuthenticationDialog(server, "AUTH=PLAIN"); server.expect("2 AUTHENTICATE PLAIN"); server.output("+"); server.expect(ByteStrin... | public void open() throws IOException, MessagingException { if (open) { return; } else if (stacktraceForClose != null) { throw new IllegalStateException("open() called after close(). " + "Check wrapped exception to see where close() was called.", stacktraceForClose); } open = true; boolean authSuccess = false; nextComm... | ImapConnection { public void open() throws IOException, MessagingException { if (open) { return; } else if (stacktraceForClose != null) { throw new IllegalStateException("open() called after close(). " + "Check wrapped exception to see where close() was called.", stacktraceForClose); } open = true; boolean authSuccess ... | ImapConnection { public void open() throws IOException, MessagingException { if (open) { return; } else if (stacktraceForClose != null) { throw new IllegalStateException("open() called after close(). " + "Check wrapped exception to see where close() was called.", stacktraceForClose); } open = true; boolean authSuccess ... | ImapConnection { public void open() throws IOException, MessagingException { if (open) { return; } else if (stacktraceForClose != null) { throw new IllegalStateException("open() called after close(). " + "Check wrapped exception to see where close() was called.", stacktraceForClose); } open = true; boolean authSuccess ... | ImapConnection { public void open() throws IOException, MessagingException { if (open) { return; } else if (stacktraceForClose != null) { throw new IllegalStateException("open() called after close(). " + "Check wrapped exception to see where close() was called.", stacktraceForClose); } open = true; boolean authSuccess ... |
@Test public void open_authPlainWithByeResponseAndConnectionClose_shouldThrowAuthenticationFailedException() throws Exception { settings.setAuthType(AuthType.PLAIN); MockImapServer server = new MockImapServer(); preAuthenticationDialog(server, "AUTH=PLAIN"); server.expect("2 AUTHENTICATE PLAIN"); server.output("+"); se... | public void open() throws IOException, MessagingException { if (open) { return; } else if (stacktraceForClose != null) { throw new IllegalStateException("open() called after close(). " + "Check wrapped exception to see where close() was called.", stacktraceForClose); } open = true; boolean authSuccess = false; nextComm... | ImapConnection { public void open() throws IOException, MessagingException { if (open) { return; } else if (stacktraceForClose != null) { throw new IllegalStateException("open() called after close(). " + "Check wrapped exception to see where close() was called.", stacktraceForClose); } open = true; boolean authSuccess ... | ImapConnection { public void open() throws IOException, MessagingException { if (open) { return; } else if (stacktraceForClose != null) { throw new IllegalStateException("open() called after close(). " + "Check wrapped exception to see where close() was called.", stacktraceForClose); } open = true; boolean authSuccess ... | ImapConnection { public void open() throws IOException, MessagingException { if (open) { return; } else if (stacktraceForClose != null) { throw new IllegalStateException("open() called after close(). " + "Check wrapped exception to see where close() was called.", stacktraceForClose); } open = true; boolean authSuccess ... | ImapConnection { public void open() throws IOException, MessagingException { if (open) { return; } else if (stacktraceForClose != null) { throw new IllegalStateException("open() called after close(). " + "Check wrapped exception to see where close() was called.", stacktraceForClose); } open = true; boolean authSuccess ... |
@Test public void open_authPlainWithoutAuthPlainCapability_shouldUseLoginMethod() throws Exception { settings.setAuthType(AuthType.PLAIN); MockImapServer server = new MockImapServer(); preAuthenticationDialog(server); server.expect("2 LOGIN \"" + USERNAME + "\" \"" + PASSWORD + "\""); server.output("2 OK LOGIN complete... | public void open() throws IOException, MessagingException { if (open) { return; } else if (stacktraceForClose != null) { throw new IllegalStateException("open() called after close(). " + "Check wrapped exception to see where close() was called.", stacktraceForClose); } open = true; boolean authSuccess = false; nextComm... | ImapConnection { public void open() throws IOException, MessagingException { if (open) { return; } else if (stacktraceForClose != null) { throw new IllegalStateException("open() called after close(). " + "Check wrapped exception to see where close() was called.", stacktraceForClose); } open = true; boolean authSuccess ... | ImapConnection { public void open() throws IOException, MessagingException { if (open) { return; } else if (stacktraceForClose != null) { throw new IllegalStateException("open() called after close(). " + "Check wrapped exception to see where close() was called.", stacktraceForClose); } open = true; boolean authSuccess ... | ImapConnection { public void open() throws IOException, MessagingException { if (open) { return; } else if (stacktraceForClose != null) { throw new IllegalStateException("open() called after close(). " + "Check wrapped exception to see where close() was called.", stacktraceForClose); } open = true; boolean authSuccess ... | ImapConnection { public void open() throws IOException, MessagingException { if (open) { return; } else if (stacktraceForClose != null) { throw new IllegalStateException("open() called after close(). " + "Check wrapped exception to see where close() was called.", stacktraceForClose); } open = true; boolean authSuccess ... |
@Test public void uriWithUppercaseScheme() { String uri = "HTTP: UriLinkifier.linkifyText(uri, outputBuffer); assertEquals("<a href=\"HTTP: } | public static void linkifyText(String text, StringBuffer outputBuffer) { int currentPos = 0; Matcher matcher = URI_SCHEME.matcher(text); while (matcher.find(currentPos)) { int startPos = matcher.start(1); String textBeforeMatch = text.substring(currentPos, startPos); outputBuffer.append(textBeforeMatch); String scheme ... | UriLinkifier { public static void linkifyText(String text, StringBuffer outputBuffer) { int currentPos = 0; Matcher matcher = URI_SCHEME.matcher(text); while (matcher.find(currentPos)) { int startPos = matcher.start(1); String textBeforeMatch = text.substring(currentPos, startPos); outputBuffer.append(textBeforeMatch);... | UriLinkifier { public static void linkifyText(String text, StringBuffer outputBuffer) { int currentPos = 0; Matcher matcher = URI_SCHEME.matcher(text); while (matcher.find(currentPos)) { int startPos = matcher.start(1); String textBeforeMatch = text.substring(currentPos, startPos); outputBuffer.append(textBeforeMatch);... | UriLinkifier { public static void linkifyText(String text, StringBuffer outputBuffer) { int currentPos = 0; Matcher matcher = URI_SCHEME.matcher(text); while (matcher.find(currentPos)) { int startPos = matcher.start(1); String textBeforeMatch = text.substring(currentPos, startPos); outputBuffer.append(textBeforeMatch);... | UriLinkifier { public static void linkifyText(String text, StringBuffer outputBuffer) { int currentPos = 0; Matcher matcher = URI_SCHEME.matcher(text); while (matcher.find(currentPos)) { int startPos = matcher.start(1); String textBeforeMatch = text.substring(currentPos, startPos); outputBuffer.append(textBeforeMatch);... |
@Test public void open_authCramMd5() throws Exception { settings.setAuthType(AuthType.CRAM_MD5); MockImapServer server = new MockImapServer(); preAuthenticationDialog(server, "AUTH=CRAM-MD5"); server.expect("2 AUTHENTICATE CRAM-MD5"); server.output("+ " + ByteString.encodeUtf8("<0000.000000000@example.org>").base64());... | public void open() throws IOException, MessagingException { if (open) { return; } else if (stacktraceForClose != null) { throw new IllegalStateException("open() called after close(). " + "Check wrapped exception to see where close() was called.", stacktraceForClose); } open = true; boolean authSuccess = false; nextComm... | ImapConnection { public void open() throws IOException, MessagingException { if (open) { return; } else if (stacktraceForClose != null) { throw new IllegalStateException("open() called after close(). " + "Check wrapped exception to see where close() was called.", stacktraceForClose); } open = true; boolean authSuccess ... | ImapConnection { public void open() throws IOException, MessagingException { if (open) { return; } else if (stacktraceForClose != null) { throw new IllegalStateException("open() called after close(). " + "Check wrapped exception to see where close() was called.", stacktraceForClose); } open = true; boolean authSuccess ... | ImapConnection { public void open() throws IOException, MessagingException { if (open) { return; } else if (stacktraceForClose != null) { throw new IllegalStateException("open() called after close(). " + "Check wrapped exception to see where close() was called.", stacktraceForClose); } open = true; boolean authSuccess ... | ImapConnection { public void open() throws IOException, MessagingException { if (open) { return; } else if (stacktraceForClose != null) { throw new IllegalStateException("open() called after close(). " + "Check wrapped exception to see where close() was called.", stacktraceForClose); } open = true; boolean authSuccess ... |
@Test public void open_authCramMd5WithAuthenticationFailure_shouldThrow() throws Exception { settings.setAuthType(AuthType.CRAM_MD5); MockImapServer server = new MockImapServer(); preAuthenticationDialog(server, "AUTH=CRAM-MD5"); server.expect("2 AUTHENTICATE CRAM-MD5"); server.output("+ " + ByteString.encodeUtf8("<000... | public void open() throws IOException, MessagingException { if (open) { return; } else if (stacktraceForClose != null) { throw new IllegalStateException("open() called after close(). " + "Check wrapped exception to see where close() was called.", stacktraceForClose); } open = true; boolean authSuccess = false; nextComm... | ImapConnection { public void open() throws IOException, MessagingException { if (open) { return; } else if (stacktraceForClose != null) { throw new IllegalStateException("open() called after close(). " + "Check wrapped exception to see where close() was called.", stacktraceForClose); } open = true; boolean authSuccess ... | ImapConnection { public void open() throws IOException, MessagingException { if (open) { return; } else if (stacktraceForClose != null) { throw new IllegalStateException("open() called after close(). " + "Check wrapped exception to see where close() was called.", stacktraceForClose); } open = true; boolean authSuccess ... | ImapConnection { public void open() throws IOException, MessagingException { if (open) { return; } else if (stacktraceForClose != null) { throw new IllegalStateException("open() called after close(). " + "Check wrapped exception to see where close() was called.", stacktraceForClose); } open = true; boolean authSuccess ... | ImapConnection { public void open() throws IOException, MessagingException { if (open) { return; } else if (stacktraceForClose != null) { throw new IllegalStateException("open() called after close(). " + "Check wrapped exception to see where close() was called.", stacktraceForClose); } open = true; boolean authSuccess ... |
@Test public void open_authCramMd5WithoutAuthCramMd5Capability_shouldThrow() throws Exception { settings.setAuthType(AuthType.CRAM_MD5); MockImapServer server = new MockImapServer(); preAuthenticationDialog(server, "AUTH=PLAIN"); ImapConnection imapConnection = startServerAndCreateImapConnection(server); try { imapConn... | public void open() throws IOException, MessagingException { if (open) { return; } else if (stacktraceForClose != null) { throw new IllegalStateException("open() called after close(). " + "Check wrapped exception to see where close() was called.", stacktraceForClose); } open = true; boolean authSuccess = false; nextComm... | ImapConnection { public void open() throws IOException, MessagingException { if (open) { return; } else if (stacktraceForClose != null) { throw new IllegalStateException("open() called after close(). " + "Check wrapped exception to see where close() was called.", stacktraceForClose); } open = true; boolean authSuccess ... | ImapConnection { public void open() throws IOException, MessagingException { if (open) { return; } else if (stacktraceForClose != null) { throw new IllegalStateException("open() called after close(). " + "Check wrapped exception to see where close() was called.", stacktraceForClose); } open = true; boolean authSuccess ... | ImapConnection { public void open() throws IOException, MessagingException { if (open) { return; } else if (stacktraceForClose != null) { throw new IllegalStateException("open() called after close(). " + "Check wrapped exception to see where close() was called.", stacktraceForClose); } open = true; boolean authSuccess ... | ImapConnection { public void open() throws IOException, MessagingException { if (open) { return; } else if (stacktraceForClose != null) { throw new IllegalStateException("open() called after close(). " + "Check wrapped exception to see where close() was called.", stacktraceForClose); } open = true; boolean authSuccess ... |
@Test public void open_authXoauthWithSaslIr() throws Exception { settings.setAuthType(AuthType.XOAUTH2); MockImapServer server = new MockImapServer(); preAuthenticationDialog(server, "SASL-IR AUTH=XOAUTH AUTH=XOAUTH2"); server.expect("2 AUTHENTICATE XOAUTH2 " + XOAUTH_STRING); server.output("2 OK Success"); postAuthent... | public void open() throws IOException, MessagingException { if (open) { return; } else if (stacktraceForClose != null) { throw new IllegalStateException("open() called after close(). " + "Check wrapped exception to see where close() was called.", stacktraceForClose); } open = true; boolean authSuccess = false; nextComm... | ImapConnection { public void open() throws IOException, MessagingException { if (open) { return; } else if (stacktraceForClose != null) { throw new IllegalStateException("open() called after close(). " + "Check wrapped exception to see where close() was called.", stacktraceForClose); } open = true; boolean authSuccess ... | ImapConnection { public void open() throws IOException, MessagingException { if (open) { return; } else if (stacktraceForClose != null) { throw new IllegalStateException("open() called after close(). " + "Check wrapped exception to see where close() was called.", stacktraceForClose); } open = true; boolean authSuccess ... | ImapConnection { public void open() throws IOException, MessagingException { if (open) { return; } else if (stacktraceForClose != null) { throw new IllegalStateException("open() called after close(). " + "Check wrapped exception to see where close() was called.", stacktraceForClose); } open = true; boolean authSuccess ... | ImapConnection { public void open() throws IOException, MessagingException { if (open) { return; } else if (stacktraceForClose != null) { throw new IllegalStateException("open() called after close(). " + "Check wrapped exception to see where close() was called.", stacktraceForClose); } open = true; boolean authSuccess ... |
@Test public void open_authXoauthWithSaslIrThrowsExeptionOn401Response() throws Exception { settings.setAuthType(AuthType.XOAUTH2); MockImapServer server = new MockImapServer(); preAuthenticationDialog(server, "SASL-IR AUTH=XOAUTH AUTH=XOAUTH2"); server.expect("2 AUTHENTICATE XOAUTH2 " + XOAUTH_STRING); server.output("... | public void open() throws IOException, MessagingException { if (open) { return; } else if (stacktraceForClose != null) { throw new IllegalStateException("open() called after close(). " + "Check wrapped exception to see where close() was called.", stacktraceForClose); } open = true; boolean authSuccess = false; nextComm... | ImapConnection { public void open() throws IOException, MessagingException { if (open) { return; } else if (stacktraceForClose != null) { throw new IllegalStateException("open() called after close(). " + "Check wrapped exception to see where close() was called.", stacktraceForClose); } open = true; boolean authSuccess ... | ImapConnection { public void open() throws IOException, MessagingException { if (open) { return; } else if (stacktraceForClose != null) { throw new IllegalStateException("open() called after close(). " + "Check wrapped exception to see where close() was called.", stacktraceForClose); } open = true; boolean authSuccess ... | ImapConnection { public void open() throws IOException, MessagingException { if (open) { return; } else if (stacktraceForClose != null) { throw new IllegalStateException("open() called after close(). " + "Check wrapped exception to see where close() was called.", stacktraceForClose); } open = true; boolean authSuccess ... | ImapConnection { public void open() throws IOException, MessagingException { if (open) { return; } else if (stacktraceForClose != null) { throw new IllegalStateException("open() called after close(). " + "Check wrapped exception to see where close() was called.", stacktraceForClose); } open = true; boolean authSuccess ... |
@Test public void open_authXoauthWithSaslIrInvalidatesAndRetriesNewTokenOn400Response() throws Exception { settings.setAuthType(AuthType.XOAUTH2); MockImapServer server = new MockImapServer(); preAuthenticationDialog(server, "SASL-IR AUTH=XOAUTH AUTH=XOAUTH2"); server.expect("2 AUTHENTICATE XOAUTH2 " + XOAUTH_STRING); ... | public void open() throws IOException, MessagingException { if (open) { return; } else if (stacktraceForClose != null) { throw new IllegalStateException("open() called after close(). " + "Check wrapped exception to see where close() was called.", stacktraceForClose); } open = true; boolean authSuccess = false; nextComm... | ImapConnection { public void open() throws IOException, MessagingException { if (open) { return; } else if (stacktraceForClose != null) { throw new IllegalStateException("open() called after close(). " + "Check wrapped exception to see where close() was called.", stacktraceForClose); } open = true; boolean authSuccess ... | ImapConnection { public void open() throws IOException, MessagingException { if (open) { return; } else if (stacktraceForClose != null) { throw new IllegalStateException("open() called after close(). " + "Check wrapped exception to see where close() was called.", stacktraceForClose); } open = true; boolean authSuccess ... | ImapConnection { public void open() throws IOException, MessagingException { if (open) { return; } else if (stacktraceForClose != null) { throw new IllegalStateException("open() called after close(). " + "Check wrapped exception to see where close() was called.", stacktraceForClose); } open = true; boolean authSuccess ... | ImapConnection { public void open() throws IOException, MessagingException { if (open) { return; } else if (stacktraceForClose != null) { throw new IllegalStateException("open() called after close(). " + "Check wrapped exception to see where close() was called.", stacktraceForClose); } open = true; boolean authSuccess ... |
@Test public void open_authXoauthWithSaslIrWithOldTokenThrowsExceptionIfRetryFails() throws Exception { settings.setAuthType(AuthType.XOAUTH2); MockImapServer server = new MockImapServer(); preAuthenticationDialog(server, "SASL-IR AUTH=XOAUTH AUTH=XOAUTH2"); server.expect("2 AUTHENTICATE XOAUTH2 " + XOAUTH_STRING); ser... | public void open() throws IOException, MessagingException { if (open) { return; } else if (stacktraceForClose != null) { throw new IllegalStateException("open() called after close(). " + "Check wrapped exception to see where close() was called.", stacktraceForClose); } open = true; boolean authSuccess = false; nextComm... | ImapConnection { public void open() throws IOException, MessagingException { if (open) { return; } else if (stacktraceForClose != null) { throw new IllegalStateException("open() called after close(). " + "Check wrapped exception to see where close() was called.", stacktraceForClose); } open = true; boolean authSuccess ... | ImapConnection { public void open() throws IOException, MessagingException { if (open) { return; } else if (stacktraceForClose != null) { throw new IllegalStateException("open() called after close(). " + "Check wrapped exception to see where close() was called.", stacktraceForClose); } open = true; boolean authSuccess ... | ImapConnection { public void open() throws IOException, MessagingException { if (open) { return; } else if (stacktraceForClose != null) { throw new IllegalStateException("open() called after close(). " + "Check wrapped exception to see where close() was called.", stacktraceForClose); } open = true; boolean authSuccess ... | ImapConnection { public void open() throws IOException, MessagingException { if (open) { return; } else if (stacktraceForClose != null) { throw new IllegalStateException("open() called after close(). " + "Check wrapped exception to see where close() was called.", stacktraceForClose); } open = true; boolean authSuccess ... |
@Test public void open_authExternal() throws Exception { settings.setAuthType(AuthType.EXTERNAL); MockImapServer server = new MockImapServer(); preAuthenticationDialog(server, "AUTH=EXTERNAL"); server.expect("2 AUTHENTICATE EXTERNAL " + ByteString.encodeUtf8(USERNAME).base64()); server.output("2 OK Success"); postAuthe... | public void open() throws IOException, MessagingException { if (open) { return; } else if (stacktraceForClose != null) { throw new IllegalStateException("open() called after close(). " + "Check wrapped exception to see where close() was called.", stacktraceForClose); } open = true; boolean authSuccess = false; nextComm... | ImapConnection { public void open() throws IOException, MessagingException { if (open) { return; } else if (stacktraceForClose != null) { throw new IllegalStateException("open() called after close(). " + "Check wrapped exception to see where close() was called.", stacktraceForClose); } open = true; boolean authSuccess ... | ImapConnection { public void open() throws IOException, MessagingException { if (open) { return; } else if (stacktraceForClose != null) { throw new IllegalStateException("open() called after close(). " + "Check wrapped exception to see where close() was called.", stacktraceForClose); } open = true; boolean authSuccess ... | ImapConnection { public void open() throws IOException, MessagingException { if (open) { return; } else if (stacktraceForClose != null) { throw new IllegalStateException("open() called after close(). " + "Check wrapped exception to see where close() was called.", stacktraceForClose); } open = true; boolean authSuccess ... | ImapConnection { public void open() throws IOException, MessagingException { if (open) { return; } else if (stacktraceForClose != null) { throw new IllegalStateException("open() called after close(). " + "Check wrapped exception to see where close() was called.", stacktraceForClose); } open = true; boolean authSuccess ... |
@Test public void open_authExternalWithAuthenticationFailure_shouldThrow() throws Exception { settings.setAuthType(AuthType.EXTERNAL); MockImapServer server = new MockImapServer(); preAuthenticationDialog(server, "AUTH=EXTERNAL"); server.expect("2 AUTHENTICATE EXTERNAL " + ByteString.encodeUtf8(USERNAME).base64()); ser... | public void open() throws IOException, MessagingException { if (open) { return; } else if (stacktraceForClose != null) { throw new IllegalStateException("open() called after close(). " + "Check wrapped exception to see where close() was called.", stacktraceForClose); } open = true; boolean authSuccess = false; nextComm... | ImapConnection { public void open() throws IOException, MessagingException { if (open) { return; } else if (stacktraceForClose != null) { throw new IllegalStateException("open() called after close(). " + "Check wrapped exception to see where close() was called.", stacktraceForClose); } open = true; boolean authSuccess ... | ImapConnection { public void open() throws IOException, MessagingException { if (open) { return; } else if (stacktraceForClose != null) { throw new IllegalStateException("open() called after close(). " + "Check wrapped exception to see where close() was called.", stacktraceForClose); } open = true; boolean authSuccess ... | ImapConnection { public void open() throws IOException, MessagingException { if (open) { return; } else if (stacktraceForClose != null) { throw new IllegalStateException("open() called after close(). " + "Check wrapped exception to see where close() was called.", stacktraceForClose); } open = true; boolean authSuccess ... | ImapConnection { public void open() throws IOException, MessagingException { if (open) { return; } else if (stacktraceForClose != null) { throw new IllegalStateException("open() called after close(). " + "Check wrapped exception to see where close() was called.", stacktraceForClose); } open = true; boolean authSuccess ... |
@Test public void open_authExternalWithoutAuthExternalCapability_shouldThrow() throws Exception { settings.setAuthType(AuthType.EXTERNAL); MockImapServer server = new MockImapServer(); preAuthenticationDialog(server, "AUTH=PLAIN"); ImapConnection imapConnection = startServerAndCreateImapConnection(server); try { imapCo... | public void open() throws IOException, MessagingException { if (open) { return; } else if (stacktraceForClose != null) { throw new IllegalStateException("open() called after close(). " + "Check wrapped exception to see where close() was called.", stacktraceForClose); } open = true; boolean authSuccess = false; nextComm... | ImapConnection { public void open() throws IOException, MessagingException { if (open) { return; } else if (stacktraceForClose != null) { throw new IllegalStateException("open() called after close(). " + "Check wrapped exception to see where close() was called.", stacktraceForClose); } open = true; boolean authSuccess ... | ImapConnection { public void open() throws IOException, MessagingException { if (open) { return; } else if (stacktraceForClose != null) { throw new IllegalStateException("open() called after close(). " + "Check wrapped exception to see where close() was called.", stacktraceForClose); } open = true; boolean authSuccess ... | ImapConnection { public void open() throws IOException, MessagingException { if (open) { return; } else if (stacktraceForClose != null) { throw new IllegalStateException("open() called after close(). " + "Check wrapped exception to see where close() was called.", stacktraceForClose); } open = true; boolean authSuccess ... | ImapConnection { public void open() throws IOException, MessagingException { if (open) { return; } else if (stacktraceForClose != null) { throw new IllegalStateException("open() called after close(). " + "Check wrapped exception to see where close() was called.", stacktraceForClose); } open = true; boolean authSuccess ... |
@Test public void uriNotPrecededByValidSeparator_shouldNotBeLinkified() { String text = "myhttp: UriLinkifier.linkifyText(text, outputBuffer); assertEquals(text, outputBuffer.toString()); } | public static void linkifyText(String text, StringBuffer outputBuffer) { int currentPos = 0; Matcher matcher = URI_SCHEME.matcher(text); while (matcher.find(currentPos)) { int startPos = matcher.start(1); String textBeforeMatch = text.substring(currentPos, startPos); outputBuffer.append(textBeforeMatch); String scheme ... | UriLinkifier { public static void linkifyText(String text, StringBuffer outputBuffer) { int currentPos = 0; Matcher matcher = URI_SCHEME.matcher(text); while (matcher.find(currentPos)) { int startPos = matcher.start(1); String textBeforeMatch = text.substring(currentPos, startPos); outputBuffer.append(textBeforeMatch);... | UriLinkifier { public static void linkifyText(String text, StringBuffer outputBuffer) { int currentPos = 0; Matcher matcher = URI_SCHEME.matcher(text); while (matcher.find(currentPos)) { int startPos = matcher.start(1); String textBeforeMatch = text.substring(currentPos, startPos); outputBuffer.append(textBeforeMatch);... | UriLinkifier { public static void linkifyText(String text, StringBuffer outputBuffer) { int currentPos = 0; Matcher matcher = URI_SCHEME.matcher(text); while (matcher.find(currentPos)) { int startPos = matcher.start(1); String textBeforeMatch = text.substring(currentPos, startPos); outputBuffer.append(textBeforeMatch);... | UriLinkifier { public static void linkifyText(String text, StringBuffer outputBuffer) { int currentPos = 0; Matcher matcher = URI_SCHEME.matcher(text); while (matcher.find(currentPos)) { int startPos = matcher.start(1); String textBeforeMatch = text.substring(currentPos, startPos); outputBuffer.append(textBeforeMatch);... |
@Test public void open_withNamespaceCapability_shouldIssueNamespaceCommand() throws Exception { MockImapServer server = new MockImapServer(); simplePreAuthAndLoginDialog(server, "NAMESPACE"); server.expect("3 NAMESPACE"); server.output("* NAMESPACE ((\"\" \"/\")) NIL NIL"); server.output("3 OK command completed"); Imap... | public void open() throws IOException, MessagingException { if (open) { return; } else if (stacktraceForClose != null) { throw new IllegalStateException("open() called after close(). " + "Check wrapped exception to see where close() was called.", stacktraceForClose); } open = true; boolean authSuccess = false; nextComm... | ImapConnection { public void open() throws IOException, MessagingException { if (open) { return; } else if (stacktraceForClose != null) { throw new IllegalStateException("open() called after close(). " + "Check wrapped exception to see where close() was called.", stacktraceForClose); } open = true; boolean authSuccess ... | ImapConnection { public void open() throws IOException, MessagingException { if (open) { return; } else if (stacktraceForClose != null) { throw new IllegalStateException("open() called after close(). " + "Check wrapped exception to see where close() was called.", stacktraceForClose); } open = true; boolean authSuccess ... | ImapConnection { public void open() throws IOException, MessagingException { if (open) { return; } else if (stacktraceForClose != null) { throw new IllegalStateException("open() called after close(). " + "Check wrapped exception to see where close() was called.", stacktraceForClose); } open = true; boolean authSuccess ... | ImapConnection { public void open() throws IOException, MessagingException { if (open) { return; } else if (stacktraceForClose != null) { throw new IllegalStateException("open() called after close(). " + "Check wrapped exception to see where close() was called.", stacktraceForClose); } open = true; boolean authSuccess ... |
@Test public void open_withConnectionError_shouldThrow() throws Exception { settings.setHost("127.1.2.3"); settings.setPort(143); ImapConnection imapConnection = createImapConnection( settings, socketFactory, connectivityManager, oAuth2TokenProvider); try { imapConnection.open(); fail("Expected exception"); } catch (Me... | public void open() throws IOException, MessagingException { if (open) { return; } else if (stacktraceForClose != null) { throw new IllegalStateException("open() called after close(). " + "Check wrapped exception to see where close() was called.", stacktraceForClose); } open = true; boolean authSuccess = false; nextComm... | ImapConnection { public void open() throws IOException, MessagingException { if (open) { return; } else if (stacktraceForClose != null) { throw new IllegalStateException("open() called after close(). " + "Check wrapped exception to see where close() was called.", stacktraceForClose); } open = true; boolean authSuccess ... | ImapConnection { public void open() throws IOException, MessagingException { if (open) { return; } else if (stacktraceForClose != null) { throw new IllegalStateException("open() called after close(). " + "Check wrapped exception to see where close() was called.", stacktraceForClose); } open = true; boolean authSuccess ... | ImapConnection { public void open() throws IOException, MessagingException { if (open) { return; } else if (stacktraceForClose != null) { throw new IllegalStateException("open() called after close(). " + "Check wrapped exception to see where close() was called.", stacktraceForClose); } open = true; boolean authSuccess ... | ImapConnection { public void open() throws IOException, MessagingException { if (open) { return; } else if (stacktraceForClose != null) { throw new IllegalStateException("open() called after close(). " + "Check wrapped exception to see where close() was called.", stacktraceForClose); } open = true; boolean authSuccess ... |
@Test public void open_withStartTlsButWithoutStartTlsCapability_shouldThrow() throws Exception { settings.setConnectionSecurity(ConnectionSecurity.STARTTLS_REQUIRED); MockImapServer server = new MockImapServer(); preAuthenticationDialog(server); ImapConnection imapConnection = startServerAndCreateImapConnection(server)... | public void open() throws IOException, MessagingException { if (open) { return; } else if (stacktraceForClose != null) { throw new IllegalStateException("open() called after close(). " + "Check wrapped exception to see where close() was called.", stacktraceForClose); } open = true; boolean authSuccess = false; nextComm... | ImapConnection { public void open() throws IOException, MessagingException { if (open) { return; } else if (stacktraceForClose != null) { throw new IllegalStateException("open() called after close(). " + "Check wrapped exception to see where close() was called.", stacktraceForClose); } open = true; boolean authSuccess ... | ImapConnection { public void open() throws IOException, MessagingException { if (open) { return; } else if (stacktraceForClose != null) { throw new IllegalStateException("open() called after close(). " + "Check wrapped exception to see where close() was called.", stacktraceForClose); } open = true; boolean authSuccess ... | ImapConnection { public void open() throws IOException, MessagingException { if (open) { return; } else if (stacktraceForClose != null) { throw new IllegalStateException("open() called after close(). " + "Check wrapped exception to see where close() was called.", stacktraceForClose); } open = true; boolean authSuccess ... | ImapConnection { public void open() throws IOException, MessagingException { if (open) { return; } else if (stacktraceForClose != null) { throw new IllegalStateException("open() called after close(). " + "Check wrapped exception to see where close() was called.", stacktraceForClose); } open = true; boolean authSuccess ... |
@Test public void open_withNegativeResponseToStartTlsCommand_shouldThrow() throws Exception { settings.setAuthType(AuthType.PLAIN); settings.setConnectionSecurity(ConnectionSecurity.STARTTLS_REQUIRED); MockImapServer server = new MockImapServer(); preAuthenticationDialog(server, "STARTTLS"); server.expect("2 STARTTLS")... | public void open() throws IOException, MessagingException { if (open) { return; } else if (stacktraceForClose != null) { throw new IllegalStateException("open() called after close(). " + "Check wrapped exception to see where close() was called.", stacktraceForClose); } open = true; boolean authSuccess = false; nextComm... | ImapConnection { public void open() throws IOException, MessagingException { if (open) { return; } else if (stacktraceForClose != null) { throw new IllegalStateException("open() called after close(). " + "Check wrapped exception to see where close() was called.", stacktraceForClose); } open = true; boolean authSuccess ... | ImapConnection { public void open() throws IOException, MessagingException { if (open) { return; } else if (stacktraceForClose != null) { throw new IllegalStateException("open() called after close(). " + "Check wrapped exception to see where close() was called.", stacktraceForClose); } open = true; boolean authSuccess ... | ImapConnection { public void open() throws IOException, MessagingException { if (open) { return; } else if (stacktraceForClose != null) { throw new IllegalStateException("open() called after close(). " + "Check wrapped exception to see where close() was called.", stacktraceForClose); } open = true; boolean authSuccess ... | ImapConnection { public void open() throws IOException, MessagingException { if (open) { return; } else if (stacktraceForClose != null) { throw new IllegalStateException("open() called after close(). " + "Check wrapped exception to see where close() was called.", stacktraceForClose); } open = true; boolean authSuccess ... |
@Test public void open_withNegativeResponseToCompressionCommand_shouldContinue() throws Exception { settings.setAuthType(AuthType.PLAIN); settings.setUseCompression(true); MockImapServer server = new MockImapServer(); simplePreAuthAndLoginDialog(server, "COMPRESS=DEFLATE"); server.expect("3 COMPRESS DEFLATE"); server.o... | public void open() throws IOException, MessagingException { if (open) { return; } else if (stacktraceForClose != null) { throw new IllegalStateException("open() called after close(). " + "Check wrapped exception to see where close() was called.", stacktraceForClose); } open = true; boolean authSuccess = false; nextComm... | ImapConnection { public void open() throws IOException, MessagingException { if (open) { return; } else if (stacktraceForClose != null) { throw new IllegalStateException("open() called after close(). " + "Check wrapped exception to see where close() was called.", stacktraceForClose); } open = true; boolean authSuccess ... | ImapConnection { public void open() throws IOException, MessagingException { if (open) { return; } else if (stacktraceForClose != null) { throw new IllegalStateException("open() called after close(). " + "Check wrapped exception to see where close() was called.", stacktraceForClose); } open = true; boolean authSuccess ... | ImapConnection { public void open() throws IOException, MessagingException { if (open) { return; } else if (stacktraceForClose != null) { throw new IllegalStateException("open() called after close(). " + "Check wrapped exception to see where close() was called.", stacktraceForClose); } open = true; boolean authSuccess ... | ImapConnection { public void open() throws IOException, MessagingException { if (open) { return; } else if (stacktraceForClose != null) { throw new IllegalStateException("open() called after close(). " + "Check wrapped exception to see where close() was called.", stacktraceForClose); } open = true; boolean authSuccess ... |
@Test public void open_withIoExceptionDuringCompressionCommand_shouldThrow() throws Exception { settings.setAuthType(AuthType.PLAIN); settings.setUseCompression(true); MockImapServer server = new MockImapServer(); simplePreAuthAndLoginDialog(server, "COMPRESS=DEFLATE"); server.expect("3 COMPRESS DEFLATE"); server.close... | public void open() throws IOException, MessagingException { if (open) { return; } else if (stacktraceForClose != null) { throw new IllegalStateException("open() called after close(). " + "Check wrapped exception to see where close() was called.", stacktraceForClose); } open = true; boolean authSuccess = false; nextComm... | ImapConnection { public void open() throws IOException, MessagingException { if (open) { return; } else if (stacktraceForClose != null) { throw new IllegalStateException("open() called after close(). " + "Check wrapped exception to see where close() was called.", stacktraceForClose); } open = true; boolean authSuccess ... | ImapConnection { public void open() throws IOException, MessagingException { if (open) { return; } else if (stacktraceForClose != null) { throw new IllegalStateException("open() called after close(). " + "Check wrapped exception to see where close() was called.", stacktraceForClose); } open = true; boolean authSuccess ... | ImapConnection { public void open() throws IOException, MessagingException { if (open) { return; } else if (stacktraceForClose != null) { throw new IllegalStateException("open() called after close(). " + "Check wrapped exception to see where close() was called.", stacktraceForClose); } open = true; boolean authSuccess ... | ImapConnection { public void open() throws IOException, MessagingException { if (open) { return; } else if (stacktraceForClose != null) { throw new IllegalStateException("open() called after close(). " + "Check wrapped exception to see where close() was called.", stacktraceForClose); } open = true; boolean authSuccess ... |
@Test public void open_withIoExceptionDuringListCommand_shouldThrow() throws Exception { settings.setAuthType(AuthType.PLAIN); MockImapServer server = new MockImapServer(); simplePreAuthAndLoginDialog(server, ""); server.expect("3 LIST \"\" \"\""); server.output("* Now what?"); ImapConnection imapConnection = startServ... | public void open() throws IOException, MessagingException { if (open) { return; } else if (stacktraceForClose != null) { throw new IllegalStateException("open() called after close(). " + "Check wrapped exception to see where close() was called.", stacktraceForClose); } open = true; boolean authSuccess = false; nextComm... | ImapConnection { public void open() throws IOException, MessagingException { if (open) { return; } else if (stacktraceForClose != null) { throw new IllegalStateException("open() called after close(). " + "Check wrapped exception to see where close() was called.", stacktraceForClose); } open = true; boolean authSuccess ... | ImapConnection { public void open() throws IOException, MessagingException { if (open) { return; } else if (stacktraceForClose != null) { throw new IllegalStateException("open() called after close(). " + "Check wrapped exception to see where close() was called.", stacktraceForClose); } open = true; boolean authSuccess ... | ImapConnection { public void open() throws IOException, MessagingException { if (open) { return; } else if (stacktraceForClose != null) { throw new IllegalStateException("open() called after close(). " + "Check wrapped exception to see where close() was called.", stacktraceForClose); } open = true; boolean authSuccess ... | ImapConnection { public void open() throws IOException, MessagingException { if (open) { return; } else if (stacktraceForClose != null) { throw new IllegalStateException("open() called after close(). " + "Check wrapped exception to see where close() was called.", stacktraceForClose); } open = true; boolean authSuccess ... |
@Test public void open_withNegativeResponseToListCommand() throws Exception { settings.setAuthType(AuthType.PLAIN); MockImapServer server = new MockImapServer(); simplePreAuthAndLoginDialog(server, ""); server.expect("3 LIST \"\" \"\""); server.output("3 NO"); ImapConnection imapConnection = startServerAndCreateImapCon... | public void open() throws IOException, MessagingException { if (open) { return; } else if (stacktraceForClose != null) { throw new IllegalStateException("open() called after close(). " + "Check wrapped exception to see where close() was called.", stacktraceForClose); } open = true; boolean authSuccess = false; nextComm... | ImapConnection { public void open() throws IOException, MessagingException { if (open) { return; } else if (stacktraceForClose != null) { throw new IllegalStateException("open() called after close(). " + "Check wrapped exception to see where close() was called.", stacktraceForClose); } open = true; boolean authSuccess ... | ImapConnection { public void open() throws IOException, MessagingException { if (open) { return; } else if (stacktraceForClose != null) { throw new IllegalStateException("open() called after close(). " + "Check wrapped exception to see where close() was called.", stacktraceForClose); } open = true; boolean authSuccess ... | ImapConnection { public void open() throws IOException, MessagingException { if (open) { return; } else if (stacktraceForClose != null) { throw new IllegalStateException("open() called after close(). " + "Check wrapped exception to see where close() was called.", stacktraceForClose); } open = true; boolean authSuccess ... | ImapConnection { public void open() throws IOException, MessagingException { if (open) { return; } else if (stacktraceForClose != null) { throw new IllegalStateException("open() called after close(). " + "Check wrapped exception to see where close() was called.", stacktraceForClose); } open = true; boolean authSuccess ... |
@Test public void isConnected_withoutPreviousOpen_shouldReturnFalse() throws Exception { ImapConnection imapConnection = createImapConnection( settings, socketFactory, connectivityManager, oAuth2TokenProvider); boolean result = imapConnection.isConnected(); assertFalse(result); } | public boolean isConnected() { return inputStream != null && outputStream != null && socket != null && socket.isConnected() && !socket.isClosed(); } | ImapConnection { public boolean isConnected() { return inputStream != null && outputStream != null && socket != null && socket.isConnected() && !socket.isClosed(); } } | ImapConnection { public boolean isConnected() { return inputStream != null && outputStream != null && socket != null && socket.isConnected() && !socket.isClosed(); } ImapConnection(ImapSettings settings, TrustedSocketFactory socketFactory,
ConnectivityManager connectivityManager, OAuth2TokenProvider oauthTo... | ImapConnection { public boolean isConnected() { return inputStream != null && outputStream != null && socket != null && socket.isConnected() && !socket.isClosed(); } ImapConnection(ImapSettings settings, TrustedSocketFactory socketFactory,
ConnectivityManager connectivityManager, OAuth2TokenProvider oauthTo... | ImapConnection { public boolean isConnected() { return inputStream != null && outputStream != null && socket != null && socket.isConnected() && !socket.isClosed(); } ImapConnection(ImapSettings settings, TrustedSocketFactory socketFactory,
ConnectivityManager connectivityManager, OAuth2TokenProvider oauthTo... |
@Test public void isConnected_afterOpen_shouldReturnTrue() throws Exception { MockImapServer server = new MockImapServer(); ImapConnection imapConnection = simpleOpen(server); boolean result = imapConnection.isConnected(); assertTrue(result); server.verifyConnectionStillOpen(); server.shutdown(); } | public boolean isConnected() { return inputStream != null && outputStream != null && socket != null && socket.isConnected() && !socket.isClosed(); } | ImapConnection { public boolean isConnected() { return inputStream != null && outputStream != null && socket != null && socket.isConnected() && !socket.isClosed(); } } | ImapConnection { public boolean isConnected() { return inputStream != null && outputStream != null && socket != null && socket.isConnected() && !socket.isClosed(); } ImapConnection(ImapSettings settings, TrustedSocketFactory socketFactory,
ConnectivityManager connectivityManager, OAuth2TokenProvider oauthTo... | ImapConnection { public boolean isConnected() { return inputStream != null && outputStream != null && socket != null && socket.isConnected() && !socket.isClosed(); } ImapConnection(ImapSettings settings, TrustedSocketFactory socketFactory,
ConnectivityManager connectivityManager, OAuth2TokenProvider oauthTo... | ImapConnection { public boolean isConnected() { return inputStream != null && outputStream != null && socket != null && socket.isConnected() && !socket.isClosed(); } ImapConnection(ImapSettings settings, TrustedSocketFactory socketFactory,
ConnectivityManager connectivityManager, OAuth2TokenProvider oauthTo... |
@Test public void uriNotPrecededByValidSeparatorFollowedByValidUri() { String text = "myhttp: http: UriLinkifier.linkifyText(text, outputBuffer); assertEquals("myhttp: <a href=\"http: } | public static void linkifyText(String text, StringBuffer outputBuffer) { int currentPos = 0; Matcher matcher = URI_SCHEME.matcher(text); while (matcher.find(currentPos)) { int startPos = matcher.start(1); String textBeforeMatch = text.substring(currentPos, startPos); outputBuffer.append(textBeforeMatch); String scheme ... | UriLinkifier { public static void linkifyText(String text, StringBuffer outputBuffer) { int currentPos = 0; Matcher matcher = URI_SCHEME.matcher(text); while (matcher.find(currentPos)) { int startPos = matcher.start(1); String textBeforeMatch = text.substring(currentPos, startPos); outputBuffer.append(textBeforeMatch);... | UriLinkifier { public static void linkifyText(String text, StringBuffer outputBuffer) { int currentPos = 0; Matcher matcher = URI_SCHEME.matcher(text); while (matcher.find(currentPos)) { int startPos = matcher.start(1); String textBeforeMatch = text.substring(currentPos, startPos); outputBuffer.append(textBeforeMatch);... | UriLinkifier { public static void linkifyText(String text, StringBuffer outputBuffer) { int currentPos = 0; Matcher matcher = URI_SCHEME.matcher(text); while (matcher.find(currentPos)) { int startPos = matcher.start(1); String textBeforeMatch = text.substring(currentPos, startPos); outputBuffer.append(textBeforeMatch);... | UriLinkifier { public static void linkifyText(String text, StringBuffer outputBuffer) { int currentPos = 0; Matcher matcher = URI_SCHEME.matcher(text); while (matcher.find(currentPos)) { int startPos = matcher.start(1); String textBeforeMatch = text.substring(currentPos, startPos); outputBuffer.append(textBeforeMatch);... |
@Test public void close_withoutOpen_shouldNotThrow() throws Exception { ImapConnection imapConnection = createImapConnection( settings, socketFactory, connectivityManager, oAuth2TokenProvider); imapConnection.close(); } | public void close() { open = false; stacktraceForClose = new Exception(); untagQuietly(socket); IOUtils.closeQuietly(inputStream); IOUtils.closeQuietly(outputStream); IOUtils.closeQuietly(socket); inputStream = null; outputStream = null; socket = null; } | ImapConnection { public void close() { open = false; stacktraceForClose = new Exception(); untagQuietly(socket); IOUtils.closeQuietly(inputStream); IOUtils.closeQuietly(outputStream); IOUtils.closeQuietly(socket); inputStream = null; outputStream = null; socket = null; } } | ImapConnection { public void close() { open = false; stacktraceForClose = new Exception(); untagQuietly(socket); IOUtils.closeQuietly(inputStream); IOUtils.closeQuietly(outputStream); IOUtils.closeQuietly(socket); inputStream = null; outputStream = null; socket = null; } ImapConnection(ImapSettings settings, TrustedSoc... | ImapConnection { public void close() { open = false; stacktraceForClose = new Exception(); untagQuietly(socket); IOUtils.closeQuietly(inputStream); IOUtils.closeQuietly(outputStream); IOUtils.closeQuietly(socket); inputStream = null; outputStream = null; socket = null; } ImapConnection(ImapSettings settings, TrustedSoc... | ImapConnection { public void close() { open = false; stacktraceForClose = new Exception(); untagQuietly(socket); IOUtils.closeQuietly(inputStream); IOUtils.closeQuietly(outputStream); IOUtils.closeQuietly(socket); inputStream = null; outputStream = null; socket = null; } ImapConnection(ImapSettings settings, TrustedSoc... |
@Test public void close_afterOpen_shouldCloseConnection() throws Exception { MockImapServer server = new MockImapServer(); ImapConnection imapConnection = simpleOpen(server); imapConnection.close(); server.verifyConnectionClosed(); server.shutdown(); } | public void close() { open = false; stacktraceForClose = new Exception(); untagQuietly(socket); IOUtils.closeQuietly(inputStream); IOUtils.closeQuietly(outputStream); IOUtils.closeQuietly(socket); inputStream = null; outputStream = null; socket = null; } | ImapConnection { public void close() { open = false; stacktraceForClose = new Exception(); untagQuietly(socket); IOUtils.closeQuietly(inputStream); IOUtils.closeQuietly(outputStream); IOUtils.closeQuietly(socket); inputStream = null; outputStream = null; socket = null; } } | ImapConnection { public void close() { open = false; stacktraceForClose = new Exception(); untagQuietly(socket); IOUtils.closeQuietly(inputStream); IOUtils.closeQuietly(outputStream); IOUtils.closeQuietly(socket); inputStream = null; outputStream = null; socket = null; } ImapConnection(ImapSettings settings, TrustedSoc... | ImapConnection { public void close() { open = false; stacktraceForClose = new Exception(); untagQuietly(socket); IOUtils.closeQuietly(inputStream); IOUtils.closeQuietly(outputStream); IOUtils.closeQuietly(socket); inputStream = null; outputStream = null; socket = null; } ImapConnection(ImapSettings settings, TrustedSoc... | ImapConnection { public void close() { open = false; stacktraceForClose = new Exception(); untagQuietly(socket); IOUtils.closeQuietly(inputStream); IOUtils.closeQuietly(outputStream); IOUtils.closeQuietly(socket); inputStream = null; outputStream = null; socket = null; } ImapConnection(ImapSettings settings, TrustedSoc... |
@Test public void isIdleCapable_withoutIdleCapability() throws Exception { MockImapServer server = new MockImapServer(); ImapConnection imapConnection = simpleOpen(server); boolean result = imapConnection.isIdleCapable(); assertFalse(result); server.shutdown(); } | protected boolean isIdleCapable() { if (K9MailLib.isDebug()) { Timber.v("Connection %s has %d capabilities", getLogId(), capabilities.size()); } return capabilities.contains(Capabilities.IDLE); } | ImapConnection { protected boolean isIdleCapable() { if (K9MailLib.isDebug()) { Timber.v("Connection %s has %d capabilities", getLogId(), capabilities.size()); } return capabilities.contains(Capabilities.IDLE); } } | ImapConnection { protected boolean isIdleCapable() { if (K9MailLib.isDebug()) { Timber.v("Connection %s has %d capabilities", getLogId(), capabilities.size()); } return capabilities.contains(Capabilities.IDLE); } ImapConnection(ImapSettings settings, TrustedSocketFactory socketFactory,
ConnectivityManager c... | ImapConnection { protected boolean isIdleCapable() { if (K9MailLib.isDebug()) { Timber.v("Connection %s has %d capabilities", getLogId(), capabilities.size()); } return capabilities.contains(Capabilities.IDLE); } ImapConnection(ImapSettings settings, TrustedSocketFactory socketFactory,
ConnectivityManager c... | ImapConnection { protected boolean isIdleCapable() { if (K9MailLib.isDebug()) { Timber.v("Connection %s has %d capabilities", getLogId(), capabilities.size()); } return capabilities.contains(Capabilities.IDLE); } ImapConnection(ImapSettings settings, TrustedSocketFactory socketFactory,
ConnectivityManager c... |
@Test public void isIdleCapable_withIdleCapability() throws Exception { MockImapServer server = new MockImapServer(); ImapConnection imapConnection = simpleOpenWithCapabilities(server, "IDLE"); boolean result = imapConnection.isIdleCapable(); assertTrue(result); server.shutdown(); } | protected boolean isIdleCapable() { if (K9MailLib.isDebug()) { Timber.v("Connection %s has %d capabilities", getLogId(), capabilities.size()); } return capabilities.contains(Capabilities.IDLE); } | ImapConnection { protected boolean isIdleCapable() { if (K9MailLib.isDebug()) { Timber.v("Connection %s has %d capabilities", getLogId(), capabilities.size()); } return capabilities.contains(Capabilities.IDLE); } } | ImapConnection { protected boolean isIdleCapable() { if (K9MailLib.isDebug()) { Timber.v("Connection %s has %d capabilities", getLogId(), capabilities.size()); } return capabilities.contains(Capabilities.IDLE); } ImapConnection(ImapSettings settings, TrustedSocketFactory socketFactory,
ConnectivityManager c... | ImapConnection { protected boolean isIdleCapable() { if (K9MailLib.isDebug()) { Timber.v("Connection %s has %d capabilities", getLogId(), capabilities.size()); } return capabilities.contains(Capabilities.IDLE); } ImapConnection(ImapSettings settings, TrustedSocketFactory socketFactory,
ConnectivityManager c... | ImapConnection { protected boolean isIdleCapable() { if (K9MailLib.isDebug()) { Timber.v("Connection %s has %d capabilities", getLogId(), capabilities.size()); } return capabilities.contains(Capabilities.IDLE); } ImapConnection(ImapSettings settings, TrustedSocketFactory socketFactory,
ConnectivityManager c... |
@Test public void sendContinuation() throws Exception { settings.setAuthType(AuthType.PLAIN); MockImapServer server = new MockImapServer(); simpleOpenDialog(server, "IDLE"); server.expect("4 IDLE"); server.output("+ idling"); server.expect("DONE"); ImapConnection imapConnection = startServerAndCreateImapConnection(serv... | public void sendContinuation(String continuation) throws IOException { outputStream.write(continuation.getBytes()); outputStream.write('\r'); outputStream.write('\n'); outputStream.flush(); if (K9MailLib.isDebug() && DEBUG_PROTOCOL_IMAP) { Timber.v("%s>>> %s", getLogId(), continuation); } } | ImapConnection { public void sendContinuation(String continuation) throws IOException { outputStream.write(continuation.getBytes()); outputStream.write('\r'); outputStream.write('\n'); outputStream.flush(); if (K9MailLib.isDebug() && DEBUG_PROTOCOL_IMAP) { Timber.v("%s>>> %s", getLogId(), continuation); } } } | ImapConnection { public void sendContinuation(String continuation) throws IOException { outputStream.write(continuation.getBytes()); outputStream.write('\r'); outputStream.write('\n'); outputStream.flush(); if (K9MailLib.isDebug() && DEBUG_PROTOCOL_IMAP) { Timber.v("%s>>> %s", getLogId(), continuation); } } ImapConnect... | ImapConnection { public void sendContinuation(String continuation) throws IOException { outputStream.write(continuation.getBytes()); outputStream.write('\r'); outputStream.write('\n'); outputStream.flush(); if (K9MailLib.isDebug() && DEBUG_PROTOCOL_IMAP) { Timber.v("%s>>> %s", getLogId(), continuation); } } ImapConnect... | ImapConnection { public void sendContinuation(String continuation) throws IOException { outputStream.write(continuation.getBytes()); outputStream.write('\r'); outputStream.write('\n'); outputStream.flush(); if (K9MailLib.isDebug() && DEBUG_PROTOCOL_IMAP) { Timber.v("%s>>> %s", getLogId(), continuation); } } ImapConnect... |
@Test public void executeSingleCommand_withOkResponse_shouldReturnResult() throws Exception { MockImapServer server = new MockImapServer(); simpleOpenDialog(server, ""); server.expect("4 CREATE Folder"); server.output("4 OK Folder created"); ImapConnection imapConnection = startServerAndCreateImapConnection(server); Li... | public List<ImapResponse> executeSimpleCommand(String command) throws IOException, MessagingException { return executeSimpleCommand(command, false); } | ImapConnection { public List<ImapResponse> executeSimpleCommand(String command) throws IOException, MessagingException { return executeSimpleCommand(command, false); } } | ImapConnection { public List<ImapResponse> executeSimpleCommand(String command) throws IOException, MessagingException { return executeSimpleCommand(command, false); } ImapConnection(ImapSettings settings, TrustedSocketFactory socketFactory,
ConnectivityManager connectivityManager, OAuth2TokenProvider oauth... | ImapConnection { public List<ImapResponse> executeSimpleCommand(String command) throws IOException, MessagingException { return executeSimpleCommand(command, false); } ImapConnection(ImapSettings settings, TrustedSocketFactory socketFactory,
ConnectivityManager connectivityManager, OAuth2TokenProvider oauth... | ImapConnection { public List<ImapResponse> executeSimpleCommand(String command) throws IOException, MessagingException { return executeSimpleCommand(command, false); } ImapConnection(ImapSettings settings, TrustedSocketFactory socketFactory,
ConnectivityManager connectivityManager, OAuth2TokenProvider oauth... |
@Test public void executeSingleCommand_withNoResponse_shouldThrowNegativeImapResponseException() throws Exception { MockImapServer server = new MockImapServer(); simpleOpenDialog(server, ""); server.expect("4 CREATE Folder"); server.output("4 NO Folder exists"); ImapConnection imapConnection = startServerAndCreateImapC... | public List<ImapResponse> executeSimpleCommand(String command) throws IOException, MessagingException { return executeSimpleCommand(command, false); } | ImapConnection { public List<ImapResponse> executeSimpleCommand(String command) throws IOException, MessagingException { return executeSimpleCommand(command, false); } } | ImapConnection { public List<ImapResponse> executeSimpleCommand(String command) throws IOException, MessagingException { return executeSimpleCommand(command, false); } ImapConnection(ImapSettings settings, TrustedSocketFactory socketFactory,
ConnectivityManager connectivityManager, OAuth2TokenProvider oauth... | ImapConnection { public List<ImapResponse> executeSimpleCommand(String command) throws IOException, MessagingException { return executeSimpleCommand(command, false); } ImapConnection(ImapSettings settings, TrustedSocketFactory socketFactory,
ConnectivityManager connectivityManager, OAuth2TokenProvider oauth... | ImapConnection { public List<ImapResponse> executeSimpleCommand(String command) throws IOException, MessagingException { return executeSimpleCommand(command, false); } ImapConnection(ImapSettings settings, TrustedSocketFactory socketFactory,
ConnectivityManager connectivityManager, OAuth2TokenProvider oauth... |
@Test public void encode_withAsciiArgument_shouldReturnInput() throws Exception { String folderName = "ASCII"; String result = folderNameCode.encode(folderName); assertEquals(folderName, result); } | public String encode(String folderName) { ByteBuffer byteBuffer = modifiedUtf7Charset.encode(folderName); byte[] bytes = new byte[byteBuffer.limit()]; byteBuffer.get(bytes); return new String(bytes, asciiCharset); } | FolderNameCodec { public String encode(String folderName) { ByteBuffer byteBuffer = modifiedUtf7Charset.encode(folderName); byte[] bytes = new byte[byteBuffer.limit()]; byteBuffer.get(bytes); return new String(bytes, asciiCharset); } } | FolderNameCodec { public String encode(String folderName) { ByteBuffer byteBuffer = modifiedUtf7Charset.encode(folderName); byte[] bytes = new byte[byteBuffer.limit()]; byteBuffer.get(bytes); return new String(bytes, asciiCharset); } private FolderNameCodec(); } | FolderNameCodec { public String encode(String folderName) { ByteBuffer byteBuffer = modifiedUtf7Charset.encode(folderName); byte[] bytes = new byte[byteBuffer.limit()]; byteBuffer.get(bytes); return new String(bytes, asciiCharset); } private FolderNameCodec(); static FolderNameCodec newInstance(); String encode(String... | FolderNameCodec { public String encode(String folderName) { ByteBuffer byteBuffer = modifiedUtf7Charset.encode(folderName); byte[] bytes = new byte[byteBuffer.limit()]; byteBuffer.get(bytes); return new String(bytes, asciiCharset); } private FolderNameCodec(); static FolderNameCodec newInstance(); String encode(String... |
@Test public void encode_withNonAsciiArgument_shouldReturnEncodedString() throws Exception { String folderName = "über"; String result = folderNameCode.encode(folderName); assertEquals("&APw-ber", result); } | public String encode(String folderName) { ByteBuffer byteBuffer = modifiedUtf7Charset.encode(folderName); byte[] bytes = new byte[byteBuffer.limit()]; byteBuffer.get(bytes); return new String(bytes, asciiCharset); } | FolderNameCodec { public String encode(String folderName) { ByteBuffer byteBuffer = modifiedUtf7Charset.encode(folderName); byte[] bytes = new byte[byteBuffer.limit()]; byteBuffer.get(bytes); return new String(bytes, asciiCharset); } } | FolderNameCodec { public String encode(String folderName) { ByteBuffer byteBuffer = modifiedUtf7Charset.encode(folderName); byte[] bytes = new byte[byteBuffer.limit()]; byteBuffer.get(bytes); return new String(bytes, asciiCharset); } private FolderNameCodec(); } | FolderNameCodec { public String encode(String folderName) { ByteBuffer byteBuffer = modifiedUtf7Charset.encode(folderName); byte[] bytes = new byte[byteBuffer.limit()]; byteBuffer.get(bytes); return new String(bytes, asciiCharset); } private FolderNameCodec(); static FolderNameCodec newInstance(); String encode(String... | FolderNameCodec { public String encode(String folderName) { ByteBuffer byteBuffer = modifiedUtf7Charset.encode(folderName); byte[] bytes = new byte[byteBuffer.limit()]; byteBuffer.get(bytes); return new String(bytes, asciiCharset); } private FolderNameCodec(); static FolderNameCodec newInstance(); String encode(String... |
@Test public void decode_withEncodedArgument_shouldReturnDecodedString() throws Exception { String encodedFolderName = "&ANw-bergr&APYA3w-entr&AOQ-ger"; String result = folderNameCode.decode(encodedFolderName); assertEquals("Übergrößenträger", result); } | public String decode(String encodedFolderName) throws CharacterCodingException { CharsetDecoder decoder = modifiedUtf7Charset.newDecoder().onMalformedInput(CodingErrorAction.REPORT); ByteBuffer byteBuffer = ByteBuffer.wrap(encodedFolderName.getBytes(asciiCharset)); CharBuffer charBuffer = decoder.decode(byteBuffer); re... | FolderNameCodec { public String decode(String encodedFolderName) throws CharacterCodingException { CharsetDecoder decoder = modifiedUtf7Charset.newDecoder().onMalformedInput(CodingErrorAction.REPORT); ByteBuffer byteBuffer = ByteBuffer.wrap(encodedFolderName.getBytes(asciiCharset)); CharBuffer charBuffer = decoder.deco... | FolderNameCodec { public String decode(String encodedFolderName) throws CharacterCodingException { CharsetDecoder decoder = modifiedUtf7Charset.newDecoder().onMalformedInput(CodingErrorAction.REPORT); ByteBuffer byteBuffer = ByteBuffer.wrap(encodedFolderName.getBytes(asciiCharset)); CharBuffer charBuffer = decoder.deco... | FolderNameCodec { public String decode(String encodedFolderName) throws CharacterCodingException { CharsetDecoder decoder = modifiedUtf7Charset.newDecoder().onMalformedInput(CodingErrorAction.REPORT); ByteBuffer byteBuffer = ByteBuffer.wrap(encodedFolderName.getBytes(asciiCharset)); CharBuffer charBuffer = decoder.deco... | FolderNameCodec { public String decode(String encodedFolderName) throws CharacterCodingException { CharsetDecoder decoder = modifiedUtf7Charset.newDecoder().onMalformedInput(CodingErrorAction.REPORT); ByteBuffer byteBuffer = ByteBuffer.wrap(encodedFolderName.getBytes(asciiCharset)); CharBuffer charBuffer = decoder.deco... |
@Test public void schemaMatchWithInvalidUriInMiddleOfTextFollowedByValidUri() { String text = "prefix http:42 http: UriLinkifier.linkifyText(text, outputBuffer); assertEquals("prefix http:42 <a href=\"http: } | public static void linkifyText(String text, StringBuffer outputBuffer) { int currentPos = 0; Matcher matcher = URI_SCHEME.matcher(text); while (matcher.find(currentPos)) { int startPos = matcher.start(1); String textBeforeMatch = text.substring(currentPos, startPos); outputBuffer.append(textBeforeMatch); String scheme ... | UriLinkifier { public static void linkifyText(String text, StringBuffer outputBuffer) { int currentPos = 0; Matcher matcher = URI_SCHEME.matcher(text); while (matcher.find(currentPos)) { int startPos = matcher.start(1); String textBeforeMatch = text.substring(currentPos, startPos); outputBuffer.append(textBeforeMatch);... | UriLinkifier { public static void linkifyText(String text, StringBuffer outputBuffer) { int currentPos = 0; Matcher matcher = URI_SCHEME.matcher(text); while (matcher.find(currentPos)) { int startPos = matcher.start(1); String textBeforeMatch = text.substring(currentPos, startPos); outputBuffer.append(textBeforeMatch);... | UriLinkifier { public static void linkifyText(String text, StringBuffer outputBuffer) { int currentPos = 0; Matcher matcher = URI_SCHEME.matcher(text); while (matcher.find(currentPos)) { int startPos = matcher.start(1); String textBeforeMatch = text.substring(currentPos, startPos); outputBuffer.append(textBeforeMatch);... | UriLinkifier { public static void linkifyText(String text, StringBuffer outputBuffer) { int currentPos = 0; Matcher matcher = URI_SCHEME.matcher(text); while (matcher.find(currentPos)) { int startPos = matcher.start(1); String textBeforeMatch = text.substring(currentPos, startPos); outputBuffer.append(textBeforeMatch);... |
@Test public void decode_withInvalidEncodedArgument_shouldThrow() throws Exception { String encodedFolderName = "&12-foo"; try { folderNameCode.decode(encodedFolderName); fail("Expected exception"); } catch (CharacterCodingException ignored) { } } | public String decode(String encodedFolderName) throws CharacterCodingException { CharsetDecoder decoder = modifiedUtf7Charset.newDecoder().onMalformedInput(CodingErrorAction.REPORT); ByteBuffer byteBuffer = ByteBuffer.wrap(encodedFolderName.getBytes(asciiCharset)); CharBuffer charBuffer = decoder.decode(byteBuffer); re... | FolderNameCodec { public String decode(String encodedFolderName) throws CharacterCodingException { CharsetDecoder decoder = modifiedUtf7Charset.newDecoder().onMalformedInput(CodingErrorAction.REPORT); ByteBuffer byteBuffer = ByteBuffer.wrap(encodedFolderName.getBytes(asciiCharset)); CharBuffer charBuffer = decoder.deco... | FolderNameCodec { public String decode(String encodedFolderName) throws CharacterCodingException { CharsetDecoder decoder = modifiedUtf7Charset.newDecoder().onMalformedInput(CodingErrorAction.REPORT); ByteBuffer byteBuffer = ByteBuffer.wrap(encodedFolderName.getBytes(asciiCharset)); CharBuffer charBuffer = decoder.deco... | FolderNameCodec { public String decode(String encodedFolderName) throws CharacterCodingException { CharsetDecoder decoder = modifiedUtf7Charset.newDecoder().onMalformedInput(CodingErrorAction.REPORT); ByteBuffer byteBuffer = ByteBuffer.wrap(encodedFolderName.getBytes(asciiCharset)); CharBuffer charBuffer = decoder.deco... | FolderNameCodec { public String decode(String encodedFolderName) throws CharacterCodingException { CharsetDecoder decoder = modifiedUtf7Charset.newDecoder().onMalformedInput(CodingErrorAction.REPORT); ByteBuffer byteBuffer = ByteBuffer.wrap(encodedFolderName.getBytes(asciiCharset)); CharBuffer charBuffer = decoder.deco... |
@Test public void getFolder_shouldReturnImapFolderInstance() throws Exception { Folder result = imapStore.getFolder("INBOX"); assertEquals(ImapFolder.class, result.getClass()); } | @Override @NonNull public ImapFolder getFolder(String folderId) { ImapFolder folder; synchronized (folderCache) { folder = folderCache.get(folderId); if (folder == null) { folder = new ImapFolder(this, folderId); folderCache.put(folderId, folder); } } return folder; } | ImapStore extends RemoteStore { @Override @NonNull public ImapFolder getFolder(String folderId) { ImapFolder folder; synchronized (folderCache) { folder = folderCache.get(folderId); if (folder == null) { folder = new ImapFolder(this, folderId); folderCache.put(folderId, folder); } } return folder; } } | ImapStore extends RemoteStore { @Override @NonNull public ImapFolder getFolder(String folderId) { ImapFolder folder; synchronized (folderCache) { folder = folderCache.get(folderId); if (folder == null) { folder = new ImapFolder(this, folderId); folderCache.put(folderId, folder); } } return folder; } ImapStore(StoreConf... | ImapStore extends RemoteStore { @Override @NonNull public ImapFolder getFolder(String folderId) { ImapFolder folder; synchronized (folderCache) { folder = folderCache.get(folderId); if (folder == null) { folder = new ImapFolder(this, folderId); folderCache.put(folderId, folder); } } return folder; } ImapStore(StoreConf... | ImapStore extends RemoteStore { @Override @NonNull public ImapFolder getFolder(String folderId) { ImapFolder folder; synchronized (folderCache) { folder = folderCache.get(folderId); if (folder == null) { folder = new ImapFolder(this, folderId); folderCache.put(folderId, folder); } } return folder; } ImapStore(StoreConf... |
@Test public void getFolder_calledTwice_shouldReturnFirstInstance() throws Exception { String folderName = "Trash"; Folder imapFolder = imapStore.getFolder(folderName); Folder result = imapStore.getFolder(folderName); assertEquals(imapFolder, result); } | @Override @NonNull public ImapFolder getFolder(String folderId) { ImapFolder folder; synchronized (folderCache) { folder = folderCache.get(folderId); if (folder == null) { folder = new ImapFolder(this, folderId); folderCache.put(folderId, folder); } } return folder; } | ImapStore extends RemoteStore { @Override @NonNull public ImapFolder getFolder(String folderId) { ImapFolder folder; synchronized (folderCache) { folder = folderCache.get(folderId); if (folder == null) { folder = new ImapFolder(this, folderId); folderCache.put(folderId, folder); } } return folder; } } | ImapStore extends RemoteStore { @Override @NonNull public ImapFolder getFolder(String folderId) { ImapFolder folder; synchronized (folderCache) { folder = folderCache.get(folderId); if (folder == null) { folder = new ImapFolder(this, folderId); folderCache.put(folderId, folder); } } return folder; } ImapStore(StoreConf... | ImapStore extends RemoteStore { @Override @NonNull public ImapFolder getFolder(String folderId) { ImapFolder folder; synchronized (folderCache) { folder = folderCache.get(folderId); if (folder == null) { folder = new ImapFolder(this, folderId); folderCache.put(folderId, folder); } } return folder; } ImapStore(StoreConf... | ImapStore extends RemoteStore { @Override @NonNull public ImapFolder getFolder(String folderId) { ImapFolder folder; synchronized (folderCache) { folder = folderCache.get(folderId); if (folder == null) { folder = new ImapFolder(this, folderId); folderCache.put(folderId, folder); } } return folder; } ImapStore(StoreConf... |
@Test public void checkSettings_shouldCreateImapConnectionAndCallOpen() throws Exception { ImapConnection imapConnection = mock(ImapConnection.class); imapStore.enqueueImapConnection(imapConnection); imapStore.checkSettings(); verify(imapConnection).open(); } | @Override public void checkSettings() throws MessagingException { try { ImapConnection connection = createImapConnection(); connection.open(); autoconfigureFolders(connection); connection.close(); } catch (IOException ioe) { throw new MessagingException("Unable to connect", ioe); } } | ImapStore extends RemoteStore { @Override public void checkSettings() throws MessagingException { try { ImapConnection connection = createImapConnection(); connection.open(); autoconfigureFolders(connection); connection.close(); } catch (IOException ioe) { throw new MessagingException("Unable to connect", ioe); } } } | ImapStore extends RemoteStore { @Override public void checkSettings() throws MessagingException { try { ImapConnection connection = createImapConnection(); connection.open(); autoconfigureFolders(connection); connection.close(); } catch (IOException ioe) { throw new MessagingException("Unable to connect", ioe); } } Ima... | ImapStore extends RemoteStore { @Override public void checkSettings() throws MessagingException { try { ImapConnection connection = createImapConnection(); connection.open(); autoconfigureFolders(connection); connection.close(); } catch (IOException ioe) { throw new MessagingException("Unable to connect", ioe); } } Ima... | ImapStore extends RemoteStore { @Override public void checkSettings() throws MessagingException { try { ImapConnection connection = createImapConnection(); connection.open(); autoconfigureFolders(connection); connection.close(); } catch (IOException ioe) { throw new MessagingException("Unable to connect", ioe); } } Ima... |
@Test public void checkSettings_withOpenThrowing_shouldThrowMessagingException() throws Exception { ImapConnection imapConnection = mock(ImapConnection.class); doThrow(IOException.class).when(imapConnection).open(); imapStore.enqueueImapConnection(imapConnection); try { imapStore.checkSettings(); fail("Expected excepti... | @Override public void checkSettings() throws MessagingException { try { ImapConnection connection = createImapConnection(); connection.open(); autoconfigureFolders(connection); connection.close(); } catch (IOException ioe) { throw new MessagingException("Unable to connect", ioe); } } | ImapStore extends RemoteStore { @Override public void checkSettings() throws MessagingException { try { ImapConnection connection = createImapConnection(); connection.open(); autoconfigureFolders(connection); connection.close(); } catch (IOException ioe) { throw new MessagingException("Unable to connect", ioe); } } } | ImapStore extends RemoteStore { @Override public void checkSettings() throws MessagingException { try { ImapConnection connection = createImapConnection(); connection.open(); autoconfigureFolders(connection); connection.close(); } catch (IOException ioe) { throw new MessagingException("Unable to connect", ioe); } } Ima... | ImapStore extends RemoteStore { @Override public void checkSettings() throws MessagingException { try { ImapConnection connection = createImapConnection(); connection.open(); autoconfigureFolders(connection); connection.close(); } catch (IOException ioe) { throw new MessagingException("Unable to connect", ioe); } } Ima... | ImapStore extends RemoteStore { @Override public void checkSettings() throws MessagingException { try { ImapConnection connection = createImapConnection(); connection.open(); autoconfigureFolders(connection); connection.close(); } catch (IOException ioe) { throw new MessagingException("Unable to connect", ioe); } } Ima... |
@Test public void autoconfigureFolders_withSpecialUseCapability_shouldSetSpecialFolders() throws Exception { ImapConnection imapConnection = mock(ImapConnection.class); when(imapConnection.hasCapability(Capabilities.SPECIAL_USE)).thenReturn(true); List<ImapResponse> imapResponses = Arrays.asList( createImapResponse("* ... | void autoconfigureFolders(final ImapConnection connection) throws IOException, MessagingException { if (!connection.hasCapability(Capabilities.SPECIAL_USE)) { if (K9MailLib.isDebug()) { Timber.d("No detected folder auto-configuration methods."); } return; } if (K9MailLib.isDebug()) { Timber.d("Folder auto-configuration... | ImapStore extends RemoteStore { void autoconfigureFolders(final ImapConnection connection) throws IOException, MessagingException { if (!connection.hasCapability(Capabilities.SPECIAL_USE)) { if (K9MailLib.isDebug()) { Timber.d("No detected folder auto-configuration methods."); } return; } if (K9MailLib.isDebug()) { Tim... | ImapStore extends RemoteStore { void autoconfigureFolders(final ImapConnection connection) throws IOException, MessagingException { if (!connection.hasCapability(Capabilities.SPECIAL_USE)) { if (K9MailLib.isDebug()) { Timber.d("No detected folder auto-configuration methods."); } return; } if (K9MailLib.isDebug()) { Tim... | ImapStore extends RemoteStore { void autoconfigureFolders(final ImapConnection connection) throws IOException, MessagingException { if (!connection.hasCapability(Capabilities.SPECIAL_USE)) { if (K9MailLib.isDebug()) { Timber.d("No detected folder auto-configuration methods."); } return; } if (K9MailLib.isDebug()) { Tim... | ImapStore extends RemoteStore { void autoconfigureFolders(final ImapConnection connection) throws IOException, MessagingException { if (!connection.hasCapability(Capabilities.SPECIAL_USE)) { if (K9MailLib.isDebug()) { Timber.d("No detected folder auto-configuration methods."); } return; } if (K9MailLib.isDebug()) { Tim... |
@Test public void autoconfigureFolders_withoutSpecialUseCapability_shouldNotIssueImapCommand() throws Exception { ImapConnection imapConnection = mock(ImapConnection.class); when(imapConnection.hasCapability(Capabilities.SPECIAL_USE)).thenReturn(false); imapStore.autoconfigureFolders(imapConnection); verify(imapConnect... | void autoconfigureFolders(final ImapConnection connection) throws IOException, MessagingException { if (!connection.hasCapability(Capabilities.SPECIAL_USE)) { if (K9MailLib.isDebug()) { Timber.d("No detected folder auto-configuration methods."); } return; } if (K9MailLib.isDebug()) { Timber.d("Folder auto-configuration... | ImapStore extends RemoteStore { void autoconfigureFolders(final ImapConnection connection) throws IOException, MessagingException { if (!connection.hasCapability(Capabilities.SPECIAL_USE)) { if (K9MailLib.isDebug()) { Timber.d("No detected folder auto-configuration methods."); } return; } if (K9MailLib.isDebug()) { Tim... | ImapStore extends RemoteStore { void autoconfigureFolders(final ImapConnection connection) throws IOException, MessagingException { if (!connection.hasCapability(Capabilities.SPECIAL_USE)) { if (K9MailLib.isDebug()) { Timber.d("No detected folder auto-configuration methods."); } return; } if (K9MailLib.isDebug()) { Tim... | ImapStore extends RemoteStore { void autoconfigureFolders(final ImapConnection connection) throws IOException, MessagingException { if (!connection.hasCapability(Capabilities.SPECIAL_USE)) { if (K9MailLib.isDebug()) { Timber.d("No detected folder auto-configuration methods."); } return; } if (K9MailLib.isDebug()) { Tim... | ImapStore extends RemoteStore { void autoconfigureFolders(final ImapConnection connection) throws IOException, MessagingException { if (!connection.hasCapability(Capabilities.SPECIAL_USE)) { if (K9MailLib.isDebug()) { Timber.d("No detected folder auto-configuration methods."); } return; } if (K9MailLib.isDebug()) { Tim... |
@Test public void getPersonalNamespaces_withForceListAll() throws Exception { when(storeConfig.subscribedFoldersOnly()).thenReturn(true); ImapConnection imapConnection = mock(ImapConnection.class); List<ImapResponse> imapResponses = Arrays.asList( createImapResponse("* LIST (\\HasNoChildren) \".\" \"INBOX\""), createIm... | @Override @NonNull public List<ImapFolder> getFolders(boolean forceListAll) throws MessagingException { return getPersonalNamespaces(forceListAll); } | ImapStore extends RemoteStore { @Override @NonNull public List<ImapFolder> getFolders(boolean forceListAll) throws MessagingException { return getPersonalNamespaces(forceListAll); } } | ImapStore extends RemoteStore { @Override @NonNull public List<ImapFolder> getFolders(boolean forceListAll) throws MessagingException { return getPersonalNamespaces(forceListAll); } ImapStore(StoreConfig storeConfig, TrustedSocketFactory trustedSocketFactory,
ConnectivityManager connectivityManager, OAuth2T... | ImapStore extends RemoteStore { @Override @NonNull public List<ImapFolder> getFolders(boolean forceListAll) throws MessagingException { return getPersonalNamespaces(forceListAll); } ImapStore(StoreConfig storeConfig, TrustedSocketFactory trustedSocketFactory,
ConnectivityManager connectivityManager, OAuth2T... | ImapStore extends RemoteStore { @Override @NonNull public List<ImapFolder> getFolders(boolean forceListAll) throws MessagingException { return getPersonalNamespaces(forceListAll); } ImapStore(StoreConfig storeConfig, TrustedSocketFactory trustedSocketFactory,
ConnectivityManager connectivityManager, OAuth2T... |
@Test public void getPersonalNamespaces_withPathPrefix() throws Exception { when(storeConfig.getStoreUri()).thenReturn("imap: imapStore = new TestImapStore(storeConfig, trustedSocketFactory, connectivityManager, oauth2TokenProvider); ImapConnection imapConnection = mock(ImapConnection.class); List<ImapResponse> imapRes... | @Override @NonNull public List<ImapFolder> getFolders(boolean forceListAll) throws MessagingException { return getPersonalNamespaces(forceListAll); } | ImapStore extends RemoteStore { @Override @NonNull public List<ImapFolder> getFolders(boolean forceListAll) throws MessagingException { return getPersonalNamespaces(forceListAll); } } | ImapStore extends RemoteStore { @Override @NonNull public List<ImapFolder> getFolders(boolean forceListAll) throws MessagingException { return getPersonalNamespaces(forceListAll); } ImapStore(StoreConfig storeConfig, TrustedSocketFactory trustedSocketFactory,
ConnectivityManager connectivityManager, OAuth2T... | ImapStore extends RemoteStore { @Override @NonNull public List<ImapFolder> getFolders(boolean forceListAll) throws MessagingException { return getPersonalNamespaces(forceListAll); } ImapStore(StoreConfig storeConfig, TrustedSocketFactory trustedSocketFactory,
ConnectivityManager connectivityManager, OAuth2T... | ImapStore extends RemoteStore { @Override @NonNull public List<ImapFolder> getFolders(boolean forceListAll) throws MessagingException { return getPersonalNamespaces(forceListAll); } ImapStore(StoreConfig storeConfig, TrustedSocketFactory trustedSocketFactory,
ConnectivityManager connectivityManager, OAuth2T... |
@Test public void getPersonalNamespaces_withoutForceListAllAndWithoutSubscribedFoldersOnly() throws Exception { when(storeConfig.subscribedFoldersOnly()).thenReturn(false); ImapConnection imapConnection = mock(ImapConnection.class); List<ImapResponse> imapResponses = Arrays.asList( createImapResponse("* LIST (\\HasNoCh... | @Override @NonNull public List<ImapFolder> getFolders(boolean forceListAll) throws MessagingException { return getPersonalNamespaces(forceListAll); } | ImapStore extends RemoteStore { @Override @NonNull public List<ImapFolder> getFolders(boolean forceListAll) throws MessagingException { return getPersonalNamespaces(forceListAll); } } | ImapStore extends RemoteStore { @Override @NonNull public List<ImapFolder> getFolders(boolean forceListAll) throws MessagingException { return getPersonalNamespaces(forceListAll); } ImapStore(StoreConfig storeConfig, TrustedSocketFactory trustedSocketFactory,
ConnectivityManager connectivityManager, OAuth2T... | ImapStore extends RemoteStore { @Override @NonNull public List<ImapFolder> getFolders(boolean forceListAll) throws MessagingException { return getPersonalNamespaces(forceListAll); } ImapStore(StoreConfig storeConfig, TrustedSocketFactory trustedSocketFactory,
ConnectivityManager connectivityManager, OAuth2T... | ImapStore extends RemoteStore { @Override @NonNull public List<ImapFolder> getFolders(boolean forceListAll) throws MessagingException { return getPersonalNamespaces(forceListAll); } ImapStore(StoreConfig storeConfig, TrustedSocketFactory trustedSocketFactory,
ConnectivityManager connectivityManager, OAuth2T... |
@Test public void multipleValidUrisInRow() { String text = "prefix http: UriLinkifier.linkifyText(text, outputBuffer); assertEquals( "prefix <a href=\"http: "<a href=\"http: outputBuffer.toString()); } | public static void linkifyText(String text, StringBuffer outputBuffer) { int currentPos = 0; Matcher matcher = URI_SCHEME.matcher(text); while (matcher.find(currentPos)) { int startPos = matcher.start(1); String textBeforeMatch = text.substring(currentPos, startPos); outputBuffer.append(textBeforeMatch); String scheme ... | UriLinkifier { public static void linkifyText(String text, StringBuffer outputBuffer) { int currentPos = 0; Matcher matcher = URI_SCHEME.matcher(text); while (matcher.find(currentPos)) { int startPos = matcher.start(1); String textBeforeMatch = text.substring(currentPos, startPos); outputBuffer.append(textBeforeMatch);... | UriLinkifier { public static void linkifyText(String text, StringBuffer outputBuffer) { int currentPos = 0; Matcher matcher = URI_SCHEME.matcher(text); while (matcher.find(currentPos)) { int startPos = matcher.start(1); String textBeforeMatch = text.substring(currentPos, startPos); outputBuffer.append(textBeforeMatch);... | UriLinkifier { public static void linkifyText(String text, StringBuffer outputBuffer) { int currentPos = 0; Matcher matcher = URI_SCHEME.matcher(text); while (matcher.find(currentPos)) { int startPos = matcher.start(1); String textBeforeMatch = text.substring(currentPos, startPos); outputBuffer.append(textBeforeMatch);... | UriLinkifier { public static void linkifyText(String text, StringBuffer outputBuffer) { int currentPos = 0; Matcher matcher = URI_SCHEME.matcher(text); while (matcher.find(currentPos)) { int startPos = matcher.start(1); String textBeforeMatch = text.substring(currentPos, startPos); outputBuffer.append(textBeforeMatch);... |
@Test public void getPersonalNamespaces_withSubscribedFoldersOnlyAndWithoutForceListAll_shouldOnlyReturnExistingSubscribedFolders() throws Exception { when(storeConfig.subscribedFoldersOnly()).thenReturn(true); ImapConnection imapConnection = mock(ImapConnection.class); List<ImapResponse> lsubResponses = Arrays.asList(... | @Override @NonNull public List<ImapFolder> getFolders(boolean forceListAll) throws MessagingException { return getPersonalNamespaces(forceListAll); } | ImapStore extends RemoteStore { @Override @NonNull public List<ImapFolder> getFolders(boolean forceListAll) throws MessagingException { return getPersonalNamespaces(forceListAll); } } | ImapStore extends RemoteStore { @Override @NonNull public List<ImapFolder> getFolders(boolean forceListAll) throws MessagingException { return getPersonalNamespaces(forceListAll); } ImapStore(StoreConfig storeConfig, TrustedSocketFactory trustedSocketFactory,
ConnectivityManager connectivityManager, OAuth2T... | ImapStore extends RemoteStore { @Override @NonNull public List<ImapFolder> getFolders(boolean forceListAll) throws MessagingException { return getPersonalNamespaces(forceListAll); } ImapStore(StoreConfig storeConfig, TrustedSocketFactory trustedSocketFactory,
ConnectivityManager connectivityManager, OAuth2T... | ImapStore extends RemoteStore { @Override @NonNull public List<ImapFolder> getFolders(boolean forceListAll) throws MessagingException { return getPersonalNamespaces(forceListAll); } ImapStore(StoreConfig storeConfig, TrustedSocketFactory trustedSocketFactory,
ConnectivityManager connectivityManager, OAuth2T... |
@Test public void getPersonalNamespaces_withoutException_shouldLeaveImapConnectionOpen() throws Exception { ImapConnection imapConnection = mock(ImapConnection.class); List<ImapResponse> imapResponses = Collections.singletonList(createImapResponse("5 OK Success")); when(imapConnection.executeSimpleCommand(anyString()))... | @Override @NonNull public List<ImapFolder> getFolders(boolean forceListAll) throws MessagingException { return getPersonalNamespaces(forceListAll); } | ImapStore extends RemoteStore { @Override @NonNull public List<ImapFolder> getFolders(boolean forceListAll) throws MessagingException { return getPersonalNamespaces(forceListAll); } } | ImapStore extends RemoteStore { @Override @NonNull public List<ImapFolder> getFolders(boolean forceListAll) throws MessagingException { return getPersonalNamespaces(forceListAll); } ImapStore(StoreConfig storeConfig, TrustedSocketFactory trustedSocketFactory,
ConnectivityManager connectivityManager, OAuth2T... | ImapStore extends RemoteStore { @Override @NonNull public List<ImapFolder> getFolders(boolean forceListAll) throws MessagingException { return getPersonalNamespaces(forceListAll); } ImapStore(StoreConfig storeConfig, TrustedSocketFactory trustedSocketFactory,
ConnectivityManager connectivityManager, OAuth2T... | ImapStore extends RemoteStore { @Override @NonNull public List<ImapFolder> getFolders(boolean forceListAll) throws MessagingException { return getPersonalNamespaces(forceListAll); } ImapStore(StoreConfig storeConfig, TrustedSocketFactory trustedSocketFactory,
ConnectivityManager connectivityManager, OAuth2T... |
@Test public void getPersonalNamespaces_withIoException_shouldCloseImapConnection() throws Exception { ImapConnection imapConnection = mock(ImapConnection.class); doThrow(IOException.class).when(imapConnection).executeSimpleCommand("LIST \"\" \"*\""); imapStore.enqueueImapConnection(imapConnection); try { imapStore.get... | @Override @NonNull public List<ImapFolder> getFolders(boolean forceListAll) throws MessagingException { return getPersonalNamespaces(forceListAll); } | ImapStore extends RemoteStore { @Override @NonNull public List<ImapFolder> getFolders(boolean forceListAll) throws MessagingException { return getPersonalNamespaces(forceListAll); } } | ImapStore extends RemoteStore { @Override @NonNull public List<ImapFolder> getFolders(boolean forceListAll) throws MessagingException { return getPersonalNamespaces(forceListAll); } ImapStore(StoreConfig storeConfig, TrustedSocketFactory trustedSocketFactory,
ConnectivityManager connectivityManager, OAuth2T... | ImapStore extends RemoteStore { @Override @NonNull public List<ImapFolder> getFolders(boolean forceListAll) throws MessagingException { return getPersonalNamespaces(forceListAll); } ImapStore(StoreConfig storeConfig, TrustedSocketFactory trustedSocketFactory,
ConnectivityManager connectivityManager, OAuth2T... | ImapStore extends RemoteStore { @Override @NonNull public List<ImapFolder> getFolders(boolean forceListAll) throws MessagingException { return getPersonalNamespaces(forceListAll); } ImapStore(StoreConfig storeConfig, TrustedSocketFactory trustedSocketFactory,
ConnectivityManager connectivityManager, OAuth2T... |
@Test public void getConnection_shouldCreateImapConnection() throws Exception { ImapConnection imapConnection = mock(ImapConnection.class); imapStore.enqueueImapConnection(imapConnection); ImapConnection result = imapStore.getConnection(); assertSame(imapConnection, result); } | ImapConnection getConnection() throws MessagingException { ImapConnection connection; while ((connection = pollConnection()) != null) { try { connection.executeSimpleCommand(Commands.NOOP); break; } catch (IOException ioe) { connection.close(); } } if (connection == null) { connection = createImapConnection(); } return... | ImapStore extends RemoteStore { ImapConnection getConnection() throws MessagingException { ImapConnection connection; while ((connection = pollConnection()) != null) { try { connection.executeSimpleCommand(Commands.NOOP); break; } catch (IOException ioe) { connection.close(); } } if (connection == null) { connection = ... | ImapStore extends RemoteStore { ImapConnection getConnection() throws MessagingException { ImapConnection connection; while ((connection = pollConnection()) != null) { try { connection.executeSimpleCommand(Commands.NOOP); break; } catch (IOException ioe) { connection.close(); } } if (connection == null) { connection = ... | ImapStore extends RemoteStore { ImapConnection getConnection() throws MessagingException { ImapConnection connection; while ((connection = pollConnection()) != null) { try { connection.executeSimpleCommand(Commands.NOOP); break; } catch (IOException ioe) { connection.close(); } } if (connection == null) { connection = ... | ImapStore extends RemoteStore { ImapConnection getConnection() throws MessagingException { ImapConnection connection; while ((connection = pollConnection()) != null) { try { connection.executeSimpleCommand(Commands.NOOP); break; } catch (IOException ioe) { connection.close(); } } if (connection == null) { connection = ... |
@Test public void getConnection_calledTwiceWithoutRelease_shouldCreateTwoImapConnection() throws Exception { ImapConnection imapConnectionOne = mock(ImapConnection.class); ImapConnection imapConnectionTwo = mock(ImapConnection.class); imapStore.enqueueImapConnection(imapConnectionOne); imapStore.enqueueImapConnection(i... | ImapConnection getConnection() throws MessagingException { ImapConnection connection; while ((connection = pollConnection()) != null) { try { connection.executeSimpleCommand(Commands.NOOP); break; } catch (IOException ioe) { connection.close(); } } if (connection == null) { connection = createImapConnection(); } return... | ImapStore extends RemoteStore { ImapConnection getConnection() throws MessagingException { ImapConnection connection; while ((connection = pollConnection()) != null) { try { connection.executeSimpleCommand(Commands.NOOP); break; } catch (IOException ioe) { connection.close(); } } if (connection == null) { connection = ... | ImapStore extends RemoteStore { ImapConnection getConnection() throws MessagingException { ImapConnection connection; while ((connection = pollConnection()) != null) { try { connection.executeSimpleCommand(Commands.NOOP); break; } catch (IOException ioe) { connection.close(); } } if (connection == null) { connection = ... | ImapStore extends RemoteStore { ImapConnection getConnection() throws MessagingException { ImapConnection connection; while ((connection = pollConnection()) != null) { try { connection.executeSimpleCommand(Commands.NOOP); break; } catch (IOException ioe) { connection.close(); } } if (connection == null) { connection = ... | ImapStore extends RemoteStore { ImapConnection getConnection() throws MessagingException { ImapConnection connection; while ((connection = pollConnection()) != null) { try { connection.executeSimpleCommand(Commands.NOOP); break; } catch (IOException ioe) { connection.close(); } } if (connection == null) { connection = ... |
@Test public void testGetImapSequenceValues() { String[] expected; List<String> actual; expected = new String[] {"1"}; actual = ImapUtility.getImapSequenceValues("1"); assertArrayEquals(expected, actual.toArray()); expected = new String[] {"2147483648"}; actual = ImapUtility.getImapSequenceValues("2147483648"); assertA... | public static List<String> getImapSequenceValues(String set) { List<String> list = new ArrayList<String>(); if (set != null) { String[] setItems = set.split(","); for (String item : setItems) { if (item.indexOf(':') == -1) { if (isNumberValid(item)) { list.add(item); } } else { list.addAll(getImapRangeValues(item)); } ... | ImapUtility { public static List<String> getImapSequenceValues(String set) { List<String> list = new ArrayList<String>(); if (set != null) { String[] setItems = set.split(","); for (String item : setItems) { if (item.indexOf(':') == -1) { if (isNumberValid(item)) { list.add(item); } } else { list.addAll(getImapRangeVal... | ImapUtility { public static List<String> getImapSequenceValues(String set) { List<String> list = new ArrayList<String>(); if (set != null) { String[] setItems = set.split(","); for (String item : setItems) { if (item.indexOf(':') == -1) { if (isNumberValid(item)) { list.add(item); } } else { list.addAll(getImapRangeVal... | ImapUtility { public static List<String> getImapSequenceValues(String set) { List<String> list = new ArrayList<String>(); if (set != null) { String[] setItems = set.split(","); for (String item : setItems) { if (item.indexOf(':') == -1) { if (isNumberValid(item)) { list.add(item); } } else { list.addAll(getImapRangeVal... | ImapUtility { public static List<String> getImapSequenceValues(String set) { List<String> list = new ArrayList<String>(); if (set != null) { String[] setItems = set.split(","); for (String item : setItems) { if (item.indexOf(':') == -1) { if (isNumberValid(item)) { list.add(item); } } else { list.addAll(getImapRangeVal... |
@Test public void testGetImapRangeValues() { String[] expected; List<String> actual; expected = new String[] {"1", "2", "3"}; actual = ImapUtility.getImapRangeValues("1:3"); assertArrayEquals(expected, actual.toArray()); expected = new String[] {"16", "15", "14"}; actual = ImapUtility.getImapRangeValues("16:14"); asser... | public static List<String> getImapRangeValues(String range) { List<String> list = new ArrayList<String>(); try { if (range != null) { int colonPos = range.indexOf(':'); if (colonPos > 0) { long first = Long.parseLong(range.substring(0, colonPos)); long second = Long.parseLong(range.substring(colonPos + 1)); if (is32bit... | ImapUtility { public static List<String> getImapRangeValues(String range) { List<String> list = new ArrayList<String>(); try { if (range != null) { int colonPos = range.indexOf(':'); if (colonPos > 0) { long first = Long.parseLong(range.substring(0, colonPos)); long second = Long.parseLong(range.substring(colonPos + 1)... | ImapUtility { public static List<String> getImapRangeValues(String range) { List<String> list = new ArrayList<String>(); try { if (range != null) { int colonPos = range.indexOf(':'); if (colonPos > 0) { long first = Long.parseLong(range.substring(0, colonPos)); long second = Long.parseLong(range.substring(colonPos + 1)... | ImapUtility { public static List<String> getImapRangeValues(String range) { List<String> list = new ArrayList<String>(); try { if (range != null) { int colonPos = range.indexOf(':'); if (colonPos > 0) { long first = Long.parseLong(range.substring(0, colonPos)); long second = Long.parseLong(range.substring(colonPos + 1)... | ImapUtility { public static List<String> getImapRangeValues(String range) { List<String> list = new ArrayList<String>(); try { if (range != null) { int colonPos = range.indexOf(':'); if (colonPos > 0) { long first = Long.parseLong(range.substring(0, colonPos)); long second = Long.parseLong(range.substring(colonPos + 1)... |
@Test public void parse_withValidArgument() throws Exception { ImapPushState result = ImapPushState.parse("uidNext=42"); assertNotNull(result); assertEquals(42L, result.uidNext); } | public static ImapPushState parse(String pushState) { if (pushState == null || !pushState.startsWith(PUSH_STATE_PREFIX)) { return createDefaultImapPushState(); } String value = pushState.substring(PUSH_STATE_PREFIX_LENGTH); try { long newUidNext = Long.parseLong(value); return new ImapPushState(newUidNext); } catch (Nu... | ImapPushState { public static ImapPushState parse(String pushState) { if (pushState == null || !pushState.startsWith(PUSH_STATE_PREFIX)) { return createDefaultImapPushState(); } String value = pushState.substring(PUSH_STATE_PREFIX_LENGTH); try { long newUidNext = Long.parseLong(value); return new ImapPushState(newUidNe... | ImapPushState { public static ImapPushState parse(String pushState) { if (pushState == null || !pushState.startsWith(PUSH_STATE_PREFIX)) { return createDefaultImapPushState(); } String value = pushState.substring(PUSH_STATE_PREFIX_LENGTH); try { long newUidNext = Long.parseLong(value); return new ImapPushState(newUidNe... | ImapPushState { public static ImapPushState parse(String pushState) { if (pushState == null || !pushState.startsWith(PUSH_STATE_PREFIX)) { return createDefaultImapPushState(); } String value = pushState.substring(PUSH_STATE_PREFIX_LENGTH); try { long newUidNext = Long.parseLong(value); return new ImapPushState(newUidNe... | ImapPushState { public static ImapPushState parse(String pushState) { if (pushState == null || !pushState.startsWith(PUSH_STATE_PREFIX)) { return createDefaultImapPushState(); } String value = pushState.substring(PUSH_STATE_PREFIX_LENGTH); try { long newUidNext = Long.parseLong(value); return new ImapPushState(newUidNe... |
@Test public void parse_withNullArgument_shouldReturnUidNextOfMinusOne() throws Exception { ImapPushState result = ImapPushState.parse(null); assertNotNull(result); assertEquals(-1L, result.uidNext); } | public static ImapPushState parse(String pushState) { if (pushState == null || !pushState.startsWith(PUSH_STATE_PREFIX)) { return createDefaultImapPushState(); } String value = pushState.substring(PUSH_STATE_PREFIX_LENGTH); try { long newUidNext = Long.parseLong(value); return new ImapPushState(newUidNext); } catch (Nu... | ImapPushState { public static ImapPushState parse(String pushState) { if (pushState == null || !pushState.startsWith(PUSH_STATE_PREFIX)) { return createDefaultImapPushState(); } String value = pushState.substring(PUSH_STATE_PREFIX_LENGTH); try { long newUidNext = Long.parseLong(value); return new ImapPushState(newUidNe... | ImapPushState { public static ImapPushState parse(String pushState) { if (pushState == null || !pushState.startsWith(PUSH_STATE_PREFIX)) { return createDefaultImapPushState(); } String value = pushState.substring(PUSH_STATE_PREFIX_LENGTH); try { long newUidNext = Long.parseLong(value); return new ImapPushState(newUidNe... | ImapPushState { public static ImapPushState parse(String pushState) { if (pushState == null || !pushState.startsWith(PUSH_STATE_PREFIX)) { return createDefaultImapPushState(); } String value = pushState.substring(PUSH_STATE_PREFIX_LENGTH); try { long newUidNext = Long.parseLong(value); return new ImapPushState(newUidNe... | ImapPushState { public static ImapPushState parse(String pushState) { if (pushState == null || !pushState.startsWith(PUSH_STATE_PREFIX)) { return createDefaultImapPushState(); } String value = pushState.substring(PUSH_STATE_PREFIX_LENGTH); try { long newUidNext = Long.parseLong(value); return new ImapPushState(newUidNe... |
@Test public void parse_withEmptyArgument_shouldReturnUidNextOfMinusOne() throws Exception { ImapPushState result = ImapPushState.parse(""); assertNotNull(result); assertEquals(-1L, result.uidNext); } | public static ImapPushState parse(String pushState) { if (pushState == null || !pushState.startsWith(PUSH_STATE_PREFIX)) { return createDefaultImapPushState(); } String value = pushState.substring(PUSH_STATE_PREFIX_LENGTH); try { long newUidNext = Long.parseLong(value); return new ImapPushState(newUidNext); } catch (Nu... | ImapPushState { public static ImapPushState parse(String pushState) { if (pushState == null || !pushState.startsWith(PUSH_STATE_PREFIX)) { return createDefaultImapPushState(); } String value = pushState.substring(PUSH_STATE_PREFIX_LENGTH); try { long newUidNext = Long.parseLong(value); return new ImapPushState(newUidNe... | ImapPushState { public static ImapPushState parse(String pushState) { if (pushState == null || !pushState.startsWith(PUSH_STATE_PREFIX)) { return createDefaultImapPushState(); } String value = pushState.substring(PUSH_STATE_PREFIX_LENGTH); try { long newUidNext = Long.parseLong(value); return new ImapPushState(newUidNe... | ImapPushState { public static ImapPushState parse(String pushState) { if (pushState == null || !pushState.startsWith(PUSH_STATE_PREFIX)) { return createDefaultImapPushState(); } String value = pushState.substring(PUSH_STATE_PREFIX_LENGTH); try { long newUidNext = Long.parseLong(value); return new ImapPushState(newUidNe... | ImapPushState { public static ImapPushState parse(String pushState) { if (pushState == null || !pushState.startsWith(PUSH_STATE_PREFIX)) { return createDefaultImapPushState(); } String value = pushState.substring(PUSH_STATE_PREFIX_LENGTH); try { long newUidNext = Long.parseLong(value); return new ImapPushState(newUidNe... |
@Test public void testTextQuoteToHtmlBlockquote() { String message = "Panama!\r\n" + "\r\n" + "Bob Barker <bob@aol.com> wrote:\r\n" + "> a canal\r\n" + ">\r\n" + "> Dorothy Jo Gideon <dorothy@aol.com> espoused:\r\n" + "> >A man, a plan...\r\n" + "> Too easy!\r\n" + "\r\n" + "Nice job :)\r\n" + ">> Guess!"; String resul... | public static String textToHtml(String text) { if (text.length() > MAX_SMART_HTMLIFY_MESSAGE_LENGTH) { return simpleTextToHtml(text); } StringBuilder buff = new StringBuilder(text.length() + TEXT_TO_HTML_EXTRA_BUFFER_LENGTH); boolean isStartOfLine = true; int spaces = 0; int quoteDepth = 0; int quotesThisLine = 0; for ... | HtmlConverter { public static String textToHtml(String text) { if (text.length() > MAX_SMART_HTMLIFY_MESSAGE_LENGTH) { return simpleTextToHtml(text); } StringBuilder buff = new StringBuilder(text.length() + TEXT_TO_HTML_EXTRA_BUFFER_LENGTH); boolean isStartOfLine = true; int spaces = 0; int quoteDepth = 0; int quotesTh... | HtmlConverter { public static String textToHtml(String text) { if (text.length() > MAX_SMART_HTMLIFY_MESSAGE_LENGTH) { return simpleTextToHtml(text); } StringBuilder buff = new StringBuilder(text.length() + TEXT_TO_HTML_EXTRA_BUFFER_LENGTH); boolean isStartOfLine = true; int spaces = 0; int quoteDepth = 0; int quotesTh... | HtmlConverter { public static String textToHtml(String text) { if (text.length() > MAX_SMART_HTMLIFY_MESSAGE_LENGTH) { return simpleTextToHtml(text); } StringBuilder buff = new StringBuilder(text.length() + TEXT_TO_HTML_EXTRA_BUFFER_LENGTH); boolean isStartOfLine = true; int spaces = 0; int quoteDepth = 0; int quotesTh... | HtmlConverter { public static String textToHtml(String text) { if (text.length() > MAX_SMART_HTMLIFY_MESSAGE_LENGTH) { return simpleTextToHtml(text); } StringBuilder buff = new StringBuilder(text.length() + TEXT_TO_HTML_EXTRA_BUFFER_LENGTH); boolean isStartOfLine = true; int spaces = 0; int quoteDepth = 0; int quotesTh... |
@Test public void parse_withInvalidArgument_shouldReturnUidNextOfMinusOne() throws Exception { ImapPushState result = ImapPushState.parse("xyz"); assertNotNull(result); assertEquals(-1L, result.uidNext); } | public static ImapPushState parse(String pushState) { if (pushState == null || !pushState.startsWith(PUSH_STATE_PREFIX)) { return createDefaultImapPushState(); } String value = pushState.substring(PUSH_STATE_PREFIX_LENGTH); try { long newUidNext = Long.parseLong(value); return new ImapPushState(newUidNext); } catch (Nu... | ImapPushState { public static ImapPushState parse(String pushState) { if (pushState == null || !pushState.startsWith(PUSH_STATE_PREFIX)) { return createDefaultImapPushState(); } String value = pushState.substring(PUSH_STATE_PREFIX_LENGTH); try { long newUidNext = Long.parseLong(value); return new ImapPushState(newUidNe... | ImapPushState { public static ImapPushState parse(String pushState) { if (pushState == null || !pushState.startsWith(PUSH_STATE_PREFIX)) { return createDefaultImapPushState(); } String value = pushState.substring(PUSH_STATE_PREFIX_LENGTH); try { long newUidNext = Long.parseLong(value); return new ImapPushState(newUidNe... | ImapPushState { public static ImapPushState parse(String pushState) { if (pushState == null || !pushState.startsWith(PUSH_STATE_PREFIX)) { return createDefaultImapPushState(); } String value = pushState.substring(PUSH_STATE_PREFIX_LENGTH); try { long newUidNext = Long.parseLong(value); return new ImapPushState(newUidNe... | ImapPushState { public static ImapPushState parse(String pushState) { if (pushState == null || !pushState.startsWith(PUSH_STATE_PREFIX)) { return createDefaultImapPushState(); } String value = pushState.substring(PUSH_STATE_PREFIX_LENGTH); try { long newUidNext = Long.parseLong(value); return new ImapPushState(newUidNe... |
@Test public void parse_withIncompleteArgument_shouldReturnUidNextOfMinusOne() throws Exception { ImapPushState result = ImapPushState.parse("uidNext="); assertNotNull(result); assertEquals(-1L, result.uidNext); } | public static ImapPushState parse(String pushState) { if (pushState == null || !pushState.startsWith(PUSH_STATE_PREFIX)) { return createDefaultImapPushState(); } String value = pushState.substring(PUSH_STATE_PREFIX_LENGTH); try { long newUidNext = Long.parseLong(value); return new ImapPushState(newUidNext); } catch (Nu... | ImapPushState { public static ImapPushState parse(String pushState) { if (pushState == null || !pushState.startsWith(PUSH_STATE_PREFIX)) { return createDefaultImapPushState(); } String value = pushState.substring(PUSH_STATE_PREFIX_LENGTH); try { long newUidNext = Long.parseLong(value); return new ImapPushState(newUidNe... | ImapPushState { public static ImapPushState parse(String pushState) { if (pushState == null || !pushState.startsWith(PUSH_STATE_PREFIX)) { return createDefaultImapPushState(); } String value = pushState.substring(PUSH_STATE_PREFIX_LENGTH); try { long newUidNext = Long.parseLong(value); return new ImapPushState(newUidNe... | ImapPushState { public static ImapPushState parse(String pushState) { if (pushState == null || !pushState.startsWith(PUSH_STATE_PREFIX)) { return createDefaultImapPushState(); } String value = pushState.substring(PUSH_STATE_PREFIX_LENGTH); try { long newUidNext = Long.parseLong(value); return new ImapPushState(newUidNe... | ImapPushState { public static ImapPushState parse(String pushState) { if (pushState == null || !pushState.startsWith(PUSH_STATE_PREFIX)) { return createDefaultImapPushState(); } String value = pushState.substring(PUSH_STATE_PREFIX_LENGTH); try { long newUidNext = Long.parseLong(value); return new ImapPushState(newUidNe... |
@Test public void parse_withoutIntegerAsUidNext_shouldReturnUidNextOfMinusOne() throws Exception { ImapPushState result = ImapPushState.parse("uidNext=xyz"); assertNotNull(result); assertEquals(-1L, result.uidNext); } | public static ImapPushState parse(String pushState) { if (pushState == null || !pushState.startsWith(PUSH_STATE_PREFIX)) { return createDefaultImapPushState(); } String value = pushState.substring(PUSH_STATE_PREFIX_LENGTH); try { long newUidNext = Long.parseLong(value); return new ImapPushState(newUidNext); } catch (Nu... | ImapPushState { public static ImapPushState parse(String pushState) { if (pushState == null || !pushState.startsWith(PUSH_STATE_PREFIX)) { return createDefaultImapPushState(); } String value = pushState.substring(PUSH_STATE_PREFIX_LENGTH); try { long newUidNext = Long.parseLong(value); return new ImapPushState(newUidNe... | ImapPushState { public static ImapPushState parse(String pushState) { if (pushState == null || !pushState.startsWith(PUSH_STATE_PREFIX)) { return createDefaultImapPushState(); } String value = pushState.substring(PUSH_STATE_PREFIX_LENGTH); try { long newUidNext = Long.parseLong(value); return new ImapPushState(newUidNe... | ImapPushState { public static ImapPushState parse(String pushState) { if (pushState == null || !pushState.startsWith(PUSH_STATE_PREFIX)) { return createDefaultImapPushState(); } String value = pushState.substring(PUSH_STATE_PREFIX_LENGTH); try { long newUidNext = Long.parseLong(value); return new ImapPushState(newUidNe... | ImapPushState { public static ImapPushState parse(String pushState) { if (pushState == null || !pushState.startsWith(PUSH_STATE_PREFIX)) { return createDefaultImapPushState(); } String value = pushState.substring(PUSH_STATE_PREFIX_LENGTH); try { long newUidNext = Long.parseLong(value); return new ImapPushState(newUidNe... |
@Test public void toString_shouldReturnExpectedResult() throws Exception { ImapPushState imapPushState = new ImapPushState(23L); String result = imapPushState.toString(); assertEquals("uidNext=23", result); } | @Override public String toString() { return "uidNext=" + uidNext; } | ImapPushState { @Override public String toString() { return "uidNext=" + uidNext; } } | ImapPushState { @Override public String toString() { return "uidNext=" + uidNext; } ImapPushState(long uidNext); } | ImapPushState { @Override public String toString() { return "uidNext=" + uidNext; } ImapPushState(long uidNext); static ImapPushState parse(String pushState); @Override String toString(); } | ImapPushState { @Override public String toString() { return "uidNext=" + uidNext; } ImapPushState(long uidNext); static ImapPushState parse(String pushState); @Override String toString(); final long uidNext; } |
@Test public void getAlertText_withProperAlertResponse() throws Exception { ImapResponse imapResponse = createImapResponse("x NO [ALERT] Please don't do that"); String result = AlertResponse.getAlertText(imapResponse); assertEquals("Please don't do that", result); } | public static String getAlertText(ImapResponse response) { if (response.size() < 3 || !response.isList(1)) { return null; } ImapList responseTextCode = response.getList(1); if (responseTextCode.size() != 1 || !equalsIgnoreCase(responseTextCode.get(0), ALERT_RESPONSE_CODE)) { return null; } return response.getString(2);... | AlertResponse { public static String getAlertText(ImapResponse response) { if (response.size() < 3 || !response.isList(1)) { return null; } ImapList responseTextCode = response.getList(1); if (responseTextCode.size() != 1 || !equalsIgnoreCase(responseTextCode.get(0), ALERT_RESPONSE_CODE)) { return null; } return respon... | AlertResponse { public static String getAlertText(ImapResponse response) { if (response.size() < 3 || !response.isList(1)) { return null; } ImapList responseTextCode = response.getList(1); if (responseTextCode.size() != 1 || !equalsIgnoreCase(responseTextCode.get(0), ALERT_RESPONSE_CODE)) { return null; } return respon... | AlertResponse { public static String getAlertText(ImapResponse response) { if (response.size() < 3 || !response.isList(1)) { return null; } ImapList responseTextCode = response.getList(1); if (responseTextCode.size() != 1 || !equalsIgnoreCase(responseTextCode.get(0), ALERT_RESPONSE_CODE)) { return null; } return respon... | AlertResponse { public static String getAlertText(ImapResponse response) { if (response.size() < 3 || !response.isList(1)) { return null; } ImapList responseTextCode = response.getList(1); if (responseTextCode.size() != 1 || !equalsIgnoreCase(responseTextCode.get(0), ALERT_RESPONSE_CODE)) { return null; } return respon... |
@Test public void getAlertText_withoutResponseCodeText_shouldReturnNull() throws Exception { ImapResponse imapResponse = createImapResponse("x NO"); String result = AlertResponse.getAlertText(imapResponse); assertNull(result); } | public static String getAlertText(ImapResponse response) { if (response.size() < 3 || !response.isList(1)) { return null; } ImapList responseTextCode = response.getList(1); if (responseTextCode.size() != 1 || !equalsIgnoreCase(responseTextCode.get(0), ALERT_RESPONSE_CODE)) { return null; } return response.getString(2);... | AlertResponse { public static String getAlertText(ImapResponse response) { if (response.size() < 3 || !response.isList(1)) { return null; } ImapList responseTextCode = response.getList(1); if (responseTextCode.size() != 1 || !equalsIgnoreCase(responseTextCode.get(0), ALERT_RESPONSE_CODE)) { return null; } return respon... | AlertResponse { public static String getAlertText(ImapResponse response) { if (response.size() < 3 || !response.isList(1)) { return null; } ImapList responseTextCode = response.getList(1); if (responseTextCode.size() != 1 || !equalsIgnoreCase(responseTextCode.get(0), ALERT_RESPONSE_CODE)) { return null; } return respon... | AlertResponse { public static String getAlertText(ImapResponse response) { if (response.size() < 3 || !response.isList(1)) { return null; } ImapList responseTextCode = response.getList(1); if (responseTextCode.size() != 1 || !equalsIgnoreCase(responseTextCode.get(0), ALERT_RESPONSE_CODE)) { return null; } return respon... | AlertResponse { public static String getAlertText(ImapResponse response) { if (response.size() < 3 || !response.isList(1)) { return null; } ImapList responseTextCode = response.getList(1); if (responseTextCode.size() != 1 || !equalsIgnoreCase(responseTextCode.get(0), ALERT_RESPONSE_CODE)) { return null; } return respon... |
@Test public void getAlertText_withoutAlertText_shouldReturnNull() throws Exception { ImapResponse imapResponse = createImapResponse("x NO [ALERT]"); String result = AlertResponse.getAlertText(imapResponse); assertNull(result); } | public static String getAlertText(ImapResponse response) { if (response.size() < 3 || !response.isList(1)) { return null; } ImapList responseTextCode = response.getList(1); if (responseTextCode.size() != 1 || !equalsIgnoreCase(responseTextCode.get(0), ALERT_RESPONSE_CODE)) { return null; } return response.getString(2);... | AlertResponse { public static String getAlertText(ImapResponse response) { if (response.size() < 3 || !response.isList(1)) { return null; } ImapList responseTextCode = response.getList(1); if (responseTextCode.size() != 1 || !equalsIgnoreCase(responseTextCode.get(0), ALERT_RESPONSE_CODE)) { return null; } return respon... | AlertResponse { public static String getAlertText(ImapResponse response) { if (response.size() < 3 || !response.isList(1)) { return null; } ImapList responseTextCode = response.getList(1); if (responseTextCode.size() != 1 || !equalsIgnoreCase(responseTextCode.get(0), ALERT_RESPONSE_CODE)) { return null; } return respon... | AlertResponse { public static String getAlertText(ImapResponse response) { if (response.size() < 3 || !response.isList(1)) { return null; } ImapList responseTextCode = response.getList(1); if (responseTextCode.size() != 1 || !equalsIgnoreCase(responseTextCode.get(0), ALERT_RESPONSE_CODE)) { return null; } return respon... | AlertResponse { public static String getAlertText(ImapResponse response) { if (response.size() < 3 || !response.isList(1)) { return null; } ImapList responseTextCode = response.getList(1); if (responseTextCode.size() != 1 || !equalsIgnoreCase(responseTextCode.get(0), ALERT_RESPONSE_CODE)) { return null; } return respon... |
@Test public void getAlertText_withoutResponseCodeTextList_shouldReturnNull() throws Exception { ImapResponse imapResponse = createImapResponse("x NO ALERT ALARM!"); String result = AlertResponse.getAlertText(imapResponse); assertNull(result); } | public static String getAlertText(ImapResponse response) { if (response.size() < 3 || !response.isList(1)) { return null; } ImapList responseTextCode = response.getList(1); if (responseTextCode.size() != 1 || !equalsIgnoreCase(responseTextCode.get(0), ALERT_RESPONSE_CODE)) { return null; } return response.getString(2);... | AlertResponse { public static String getAlertText(ImapResponse response) { if (response.size() < 3 || !response.isList(1)) { return null; } ImapList responseTextCode = response.getList(1); if (responseTextCode.size() != 1 || !equalsIgnoreCase(responseTextCode.get(0), ALERT_RESPONSE_CODE)) { return null; } return respon... | AlertResponse { public static String getAlertText(ImapResponse response) { if (response.size() < 3 || !response.isList(1)) { return null; } ImapList responseTextCode = response.getList(1); if (responseTextCode.size() != 1 || !equalsIgnoreCase(responseTextCode.get(0), ALERT_RESPONSE_CODE)) { return null; } return respon... | AlertResponse { public static String getAlertText(ImapResponse response) { if (response.size() < 3 || !response.isList(1)) { return null; } ImapList responseTextCode = response.getList(1); if (responseTextCode.size() != 1 || !equalsIgnoreCase(responseTextCode.get(0), ALERT_RESPONSE_CODE)) { return null; } return respon... | AlertResponse { public static String getAlertText(ImapResponse response) { if (response.size() < 3 || !response.isList(1)) { return null; } ImapList responseTextCode = response.getList(1); if (responseTextCode.size() != 1 || !equalsIgnoreCase(responseTextCode.get(0), ALERT_RESPONSE_CODE)) { return null; } return respon... |
@Test public void getAlertText_withResponseCodeTextContainingTooManyItems_shouldReturnNull() throws Exception { ImapResponse imapResponse = createImapResponse("x NO [ALERT SOMETHING] ALARM!"); String result = AlertResponse.getAlertText(imapResponse); assertNull(result); } | public static String getAlertText(ImapResponse response) { if (response.size() < 3 || !response.isList(1)) { return null; } ImapList responseTextCode = response.getList(1); if (responseTextCode.size() != 1 || !equalsIgnoreCase(responseTextCode.get(0), ALERT_RESPONSE_CODE)) { return null; } return response.getString(2);... | AlertResponse { public static String getAlertText(ImapResponse response) { if (response.size() < 3 || !response.isList(1)) { return null; } ImapList responseTextCode = response.getList(1); if (responseTextCode.size() != 1 || !equalsIgnoreCase(responseTextCode.get(0), ALERT_RESPONSE_CODE)) { return null; } return respon... | AlertResponse { public static String getAlertText(ImapResponse response) { if (response.size() < 3 || !response.isList(1)) { return null; } ImapList responseTextCode = response.getList(1); if (responseTextCode.size() != 1 || !equalsIgnoreCase(responseTextCode.get(0), ALERT_RESPONSE_CODE)) { return null; } return respon... | AlertResponse { public static String getAlertText(ImapResponse response) { if (response.size() < 3 || !response.isList(1)) { return null; } ImapList responseTextCode = response.getList(1); if (responseTextCode.size() != 1 || !equalsIgnoreCase(responseTextCode.get(0), ALERT_RESPONSE_CODE)) { return null; } return respon... | AlertResponse { public static String getAlertText(ImapResponse response) { if (response.size() < 3 || !response.isList(1)) { return null; } ImapList responseTextCode = response.getList(1); if (responseTextCode.size() != 1 || !equalsIgnoreCase(responseTextCode.get(0), ALERT_RESPONSE_CODE)) { return null; } return respon... |
@Test public void getAlertText_withWrongResponseCodeText_shouldReturnNull() throws Exception { ImapResponse imapResponse = createImapResponse("x NO [ALARM] ALERT!"); String result = AlertResponse.getAlertText(imapResponse); assertNull(result); } | public static String getAlertText(ImapResponse response) { if (response.size() < 3 || !response.isList(1)) { return null; } ImapList responseTextCode = response.getList(1); if (responseTextCode.size() != 1 || !equalsIgnoreCase(responseTextCode.get(0), ALERT_RESPONSE_CODE)) { return null; } return response.getString(2);... | AlertResponse { public static String getAlertText(ImapResponse response) { if (response.size() < 3 || !response.isList(1)) { return null; } ImapList responseTextCode = response.getList(1); if (responseTextCode.size() != 1 || !equalsIgnoreCase(responseTextCode.get(0), ALERT_RESPONSE_CODE)) { return null; } return respon... | AlertResponse { public static String getAlertText(ImapResponse response) { if (response.size() < 3 || !response.isList(1)) { return null; } ImapList responseTextCode = response.getList(1); if (responseTextCode.size() != 1 || !equalsIgnoreCase(responseTextCode.get(0), ALERT_RESPONSE_CODE)) { return null; } return respon... | AlertResponse { public static String getAlertText(ImapResponse response) { if (response.size() < 3 || !response.isList(1)) { return null; } ImapList responseTextCode = response.getList(1); if (responseTextCode.size() != 1 || !equalsIgnoreCase(responseTextCode.get(0), ALERT_RESPONSE_CODE)) { return null; } return respon... | AlertResponse { public static String getAlertText(ImapResponse response) { if (response.size() < 3 || !response.isList(1)) { return null; } ImapList responseTextCode = response.getList(1); if (responseTextCode.size() != 1 || !equalsIgnoreCase(responseTextCode.get(0), ALERT_RESPONSE_CODE)) { return null; } return respon... |
@Test public void testTextQuoteToHtmlBlockquoteIndented() { String message = "*facepalm*\r\n" + "\r\n" + "Bob Barker <bob@aol.com> wrote:\r\n" + "> A wise man once said...\r\n" + ">\r\n" + "> LOL F1RST!!!!!\r\n" + ">\r\n" + "> :)"; String result = HtmlConverter.textToHtml(message); writeToFile(result); assertEquals("<p... | public static String textToHtml(String text) { if (text.length() > MAX_SMART_HTMLIFY_MESSAGE_LENGTH) { return simpleTextToHtml(text); } StringBuilder buff = new StringBuilder(text.length() + TEXT_TO_HTML_EXTRA_BUFFER_LENGTH); boolean isStartOfLine = true; int spaces = 0; int quoteDepth = 0; int quotesThisLine = 0; for ... | HtmlConverter { public static String textToHtml(String text) { if (text.length() > MAX_SMART_HTMLIFY_MESSAGE_LENGTH) { return simpleTextToHtml(text); } StringBuilder buff = new StringBuilder(text.length() + TEXT_TO_HTML_EXTRA_BUFFER_LENGTH); boolean isStartOfLine = true; int spaces = 0; int quoteDepth = 0; int quotesTh... | HtmlConverter { public static String textToHtml(String text) { if (text.length() > MAX_SMART_HTMLIFY_MESSAGE_LENGTH) { return simpleTextToHtml(text); } StringBuilder buff = new StringBuilder(text.length() + TEXT_TO_HTML_EXTRA_BUFFER_LENGTH); boolean isStartOfLine = true; int spaces = 0; int quoteDepth = 0; int quotesTh... | HtmlConverter { public static String textToHtml(String text) { if (text.length() > MAX_SMART_HTMLIFY_MESSAGE_LENGTH) { return simpleTextToHtml(text); } StringBuilder buff = new StringBuilder(text.length() + TEXT_TO_HTML_EXTRA_BUFFER_LENGTH); boolean isStartOfLine = true; int spaces = 0; int quoteDepth = 0; int quotesTh... | HtmlConverter { public static String textToHtml(String text) { if (text.length() > MAX_SMART_HTMLIFY_MESSAGE_LENGTH) { return simpleTextToHtml(text); } StringBuilder buff = new StringBuilder(text.length() + TEXT_TO_HTML_EXTRA_BUFFER_LENGTH); boolean isStartOfLine = true; int spaces = 0; int quoteDepth = 0; int quotesTh... |
@Test public void findEncryptedPartsShouldReturnEmptyListForEmptyMessage() throws Exception { MimeMessage emptyMessage = new MimeMessage(); List<Part> encryptedParts = MessageDecryptVerifier.findEncryptedParts(emptyMessage); assertEquals(0, encryptedParts.size()); } | public static List<Part> findEncryptedParts(Part startPart) { List<Part> encryptedParts = new ArrayList<>(); Stack<Part> partsToCheck = new Stack<>(); partsToCheck.push(startPart); while (!partsToCheck.isEmpty()) { Part part = partsToCheck.pop(); Body body = part.getBody(); if (isPartMultipartEncrypted(part)) { encrypt... | MessageDecryptVerifier { public static List<Part> findEncryptedParts(Part startPart) { List<Part> encryptedParts = new ArrayList<>(); Stack<Part> partsToCheck = new Stack<>(); partsToCheck.push(startPart); while (!partsToCheck.isEmpty()) { Part part = partsToCheck.pop(); Body body = part.getBody(); if (isPartMultipartE... | MessageDecryptVerifier { public static List<Part> findEncryptedParts(Part startPart) { List<Part> encryptedParts = new ArrayList<>(); Stack<Part> partsToCheck = new Stack<>(); partsToCheck.push(startPart); while (!partsToCheck.isEmpty()) { Part part = partsToCheck.pop(); Body body = part.getBody(); if (isPartMultipartE... | MessageDecryptVerifier { public static List<Part> findEncryptedParts(Part startPart) { List<Part> encryptedParts = new ArrayList<>(); Stack<Part> partsToCheck = new Stack<>(); partsToCheck.push(startPart); while (!partsToCheck.isEmpty()) { Part part = partsToCheck.pop(); Body body = part.getBody(); if (isPartMultipartE... | MessageDecryptVerifier { public static List<Part> findEncryptedParts(Part startPart) { List<Part> encryptedParts = new ArrayList<>(); Stack<Part> partsToCheck = new Stack<>(); partsToCheck.push(startPart); while (!partsToCheck.isEmpty()) { Part part = partsToCheck.pop(); Body body = part.getBody(); if (isPartMultipartE... |
@Test public void parse_withTaggedResponse_shouldReturnNull() throws Exception { CapabilityResponse result = parse("1 OK"); assertNull(result); } | public static CapabilityResponse parse(List<ImapResponse> responses) { for (ImapResponse response : responses) { CapabilityResponse result; if (!response.isEmpty() && equalsIgnoreCase(response.get(0), Responses.OK) && response.isList(1)) { ImapList capabilityList = response.getList(1); result = parse(capabilityList); }... | CapabilityResponse { public static CapabilityResponse parse(List<ImapResponse> responses) { for (ImapResponse response : responses) { CapabilityResponse result; if (!response.isEmpty() && equalsIgnoreCase(response.get(0), Responses.OK) && response.isList(1)) { ImapList capabilityList = response.getList(1); result = par... | CapabilityResponse { public static CapabilityResponse parse(List<ImapResponse> responses) { for (ImapResponse response : responses) { CapabilityResponse result; if (!response.isEmpty() && equalsIgnoreCase(response.get(0), Responses.OK) && response.isList(1)) { ImapList capabilityList = response.getList(1); result = par... | CapabilityResponse { public static CapabilityResponse parse(List<ImapResponse> responses) { for (ImapResponse response : responses) { CapabilityResponse result; if (!response.isEmpty() && equalsIgnoreCase(response.get(0), Responses.OK) && response.isList(1)) { ImapList capabilityList = response.getList(1); result = par... | CapabilityResponse { public static CapabilityResponse parse(List<ImapResponse> responses) { for (ImapResponse response : responses) { CapabilityResponse result; if (!response.isEmpty() && equalsIgnoreCase(response.get(0), Responses.OK) && response.isList(1)) { ImapList capabilityList = response.getList(1); result = par... |
@Test public void parse_withoutOkResponse_shouldReturnNull() throws Exception { CapabilityResponse result = parse("* BAD Go Away"); assertNull(result); } | public static CapabilityResponse parse(List<ImapResponse> responses) { for (ImapResponse response : responses) { CapabilityResponse result; if (!response.isEmpty() && equalsIgnoreCase(response.get(0), Responses.OK) && response.isList(1)) { ImapList capabilityList = response.getList(1); result = parse(capabilityList); }... | CapabilityResponse { public static CapabilityResponse parse(List<ImapResponse> responses) { for (ImapResponse response : responses) { CapabilityResponse result; if (!response.isEmpty() && equalsIgnoreCase(response.get(0), Responses.OK) && response.isList(1)) { ImapList capabilityList = response.getList(1); result = par... | CapabilityResponse { public static CapabilityResponse parse(List<ImapResponse> responses) { for (ImapResponse response : responses) { CapabilityResponse result; if (!response.isEmpty() && equalsIgnoreCase(response.get(0), Responses.OK) && response.isList(1)) { ImapList capabilityList = response.getList(1); result = par... | CapabilityResponse { public static CapabilityResponse parse(List<ImapResponse> responses) { for (ImapResponse response : responses) { CapabilityResponse result; if (!response.isEmpty() && equalsIgnoreCase(response.get(0), Responses.OK) && response.isList(1)) { ImapList capabilityList = response.getList(1); result = par... | CapabilityResponse { public static CapabilityResponse parse(List<ImapResponse> responses) { for (ImapResponse response : responses) { CapabilityResponse result; if (!response.isEmpty() && equalsIgnoreCase(response.get(0), Responses.OK) && response.isList(1)) { ImapList capabilityList = response.getList(1); result = par... |
@Test public void parse_withOkResponseWithoutList_shouldReturnNull() throws Exception { CapabilityResponse result = parse("* OK Welcome"); assertNull(result); } | public static CapabilityResponse parse(List<ImapResponse> responses) { for (ImapResponse response : responses) { CapabilityResponse result; if (!response.isEmpty() && equalsIgnoreCase(response.get(0), Responses.OK) && response.isList(1)) { ImapList capabilityList = response.getList(1); result = parse(capabilityList); }... | CapabilityResponse { public static CapabilityResponse parse(List<ImapResponse> responses) { for (ImapResponse response : responses) { CapabilityResponse result; if (!response.isEmpty() && equalsIgnoreCase(response.get(0), Responses.OK) && response.isList(1)) { ImapList capabilityList = response.getList(1); result = par... | CapabilityResponse { public static CapabilityResponse parse(List<ImapResponse> responses) { for (ImapResponse response : responses) { CapabilityResponse result; if (!response.isEmpty() && equalsIgnoreCase(response.get(0), Responses.OK) && response.isList(1)) { ImapList capabilityList = response.getList(1); result = par... | CapabilityResponse { public static CapabilityResponse parse(List<ImapResponse> responses) { for (ImapResponse response : responses) { CapabilityResponse result; if (!response.isEmpty() && equalsIgnoreCase(response.get(0), Responses.OK) && response.isList(1)) { ImapList capabilityList = response.getList(1); result = par... | CapabilityResponse { public static CapabilityResponse parse(List<ImapResponse> responses) { for (ImapResponse response : responses) { CapabilityResponse result; if (!response.isEmpty() && equalsIgnoreCase(response.get(0), Responses.OK) && response.isList(1)) { ImapList capabilityList = response.getList(1); result = par... |
@Test public void parse_withListInCapabilityResponse_shouldReturnNull() throws Exception { ImapList list = createImapResponse("* CAPABILITY IMAP4rev1 []"); CapabilityResponse result = CapabilityResponse.parse(list); assertNull(result); } | public static CapabilityResponse parse(List<ImapResponse> responses) { for (ImapResponse response : responses) { CapabilityResponse result; if (!response.isEmpty() && equalsIgnoreCase(response.get(0), Responses.OK) && response.isList(1)) { ImapList capabilityList = response.getList(1); result = parse(capabilityList); }... | CapabilityResponse { public static CapabilityResponse parse(List<ImapResponse> responses) { for (ImapResponse response : responses) { CapabilityResponse result; if (!response.isEmpty() && equalsIgnoreCase(response.get(0), Responses.OK) && response.isList(1)) { ImapList capabilityList = response.getList(1); result = par... | CapabilityResponse { public static CapabilityResponse parse(List<ImapResponse> responses) { for (ImapResponse response : responses) { CapabilityResponse result; if (!response.isEmpty() && equalsIgnoreCase(response.get(0), Responses.OK) && response.isList(1)) { ImapList capabilityList = response.getList(1); result = par... | CapabilityResponse { public static CapabilityResponse parse(List<ImapResponse> responses) { for (ImapResponse response : responses) { CapabilityResponse result; if (!response.isEmpty() && equalsIgnoreCase(response.get(0), Responses.OK) && response.isList(1)) { ImapList capabilityList = response.getList(1); result = par... | CapabilityResponse { public static CapabilityResponse parse(List<ImapResponse> responses) { for (ImapResponse response : responses) { CapabilityResponse result; if (!response.isEmpty() && equalsIgnoreCase(response.get(0), Responses.OK) && response.isList(1)) { ImapList capabilityList = response.getList(1); result = par... |
@Test public void parse_withoutCapabilityResponse_shouldReturnNull() throws Exception { ImapList list = createImapResponse("* EXISTS 1"); CapabilityResponse result = CapabilityResponse.parse(list); assertNull(result); } | public static CapabilityResponse parse(List<ImapResponse> responses) { for (ImapResponse response : responses) { CapabilityResponse result; if (!response.isEmpty() && equalsIgnoreCase(response.get(0), Responses.OK) && response.isList(1)) { ImapList capabilityList = response.getList(1); result = parse(capabilityList); }... | CapabilityResponse { public static CapabilityResponse parse(List<ImapResponse> responses) { for (ImapResponse response : responses) { CapabilityResponse result; if (!response.isEmpty() && equalsIgnoreCase(response.get(0), Responses.OK) && response.isList(1)) { ImapList capabilityList = response.getList(1); result = par... | CapabilityResponse { public static CapabilityResponse parse(List<ImapResponse> responses) { for (ImapResponse response : responses) { CapabilityResponse result; if (!response.isEmpty() && equalsIgnoreCase(response.get(0), Responses.OK) && response.isList(1)) { ImapList capabilityList = response.getList(1); result = par... | CapabilityResponse { public static CapabilityResponse parse(List<ImapResponse> responses) { for (ImapResponse response : responses) { CapabilityResponse result; if (!response.isEmpty() && equalsIgnoreCase(response.get(0), Responses.OK) && response.isList(1)) { ImapList capabilityList = response.getList(1); result = par... | CapabilityResponse { public static CapabilityResponse parse(List<ImapResponse> responses) { for (ImapResponse response : responses) { CapabilityResponse result; if (!response.isEmpty() && equalsIgnoreCase(response.get(0), Responses.OK) && response.isList(1)) { ImapList capabilityList = response.getList(1); result = par... |
@Test public void parse_withEmptyResponseList_shouldReturnNull() throws Exception { List<ImapResponse> responses = Collections.emptyList(); CapabilityResponse result = CapabilityResponse.parse(responses); assertNull(result); } | public static CapabilityResponse parse(List<ImapResponse> responses) { for (ImapResponse response : responses) { CapabilityResponse result; if (!response.isEmpty() && equalsIgnoreCase(response.get(0), Responses.OK) && response.isList(1)) { ImapList capabilityList = response.getList(1); result = parse(capabilityList); }... | CapabilityResponse { public static CapabilityResponse parse(List<ImapResponse> responses) { for (ImapResponse response : responses) { CapabilityResponse result; if (!response.isEmpty() && equalsIgnoreCase(response.get(0), Responses.OK) && response.isList(1)) { ImapList capabilityList = response.getList(1); result = par... | CapabilityResponse { public static CapabilityResponse parse(List<ImapResponse> responses) { for (ImapResponse response : responses) { CapabilityResponse result; if (!response.isEmpty() && equalsIgnoreCase(response.get(0), Responses.OK) && response.isList(1)) { ImapList capabilityList = response.getList(1); result = par... | CapabilityResponse { public static CapabilityResponse parse(List<ImapResponse> responses) { for (ImapResponse response : responses) { CapabilityResponse result; if (!response.isEmpty() && equalsIgnoreCase(response.get(0), Responses.OK) && response.isList(1)) { ImapList capabilityList = response.getList(1); result = par... | CapabilityResponse { public static CapabilityResponse parse(List<ImapResponse> responses) { for (ImapResponse response : responses) { CapabilityResponse result; if (!response.isEmpty() && equalsIgnoreCase(response.get(0), Responses.OK) && response.isList(1)) { ImapList capabilityList = response.getList(1); result = par... |
@Test public void parse_withoutCapabilityResponseInResponseList_shouldReturnNull() throws Exception { List<ImapResponse> responses = Collections.singletonList(createImapResponse("* EXISTS 42")); CapabilityResponse result = CapabilityResponse.parse(responses); assertNull(result); } | public static CapabilityResponse parse(List<ImapResponse> responses) { for (ImapResponse response : responses) { CapabilityResponse result; if (!response.isEmpty() && equalsIgnoreCase(response.get(0), Responses.OK) && response.isList(1)) { ImapList capabilityList = response.getList(1); result = parse(capabilityList); }... | CapabilityResponse { public static CapabilityResponse parse(List<ImapResponse> responses) { for (ImapResponse response : responses) { CapabilityResponse result; if (!response.isEmpty() && equalsIgnoreCase(response.get(0), Responses.OK) && response.isList(1)) { ImapList capabilityList = response.getList(1); result = par... | CapabilityResponse { public static CapabilityResponse parse(List<ImapResponse> responses) { for (ImapResponse response : responses) { CapabilityResponse result; if (!response.isEmpty() && equalsIgnoreCase(response.get(0), Responses.OK) && response.isList(1)) { ImapList capabilityList = response.getList(1); result = par... | CapabilityResponse { public static CapabilityResponse parse(List<ImapResponse> responses) { for (ImapResponse response : responses) { CapabilityResponse result; if (!response.isEmpty() && equalsIgnoreCase(response.get(0), Responses.OK) && response.isList(1)) { ImapList capabilityList = response.getList(1); result = par... | CapabilityResponse { public static CapabilityResponse parse(List<ImapResponse> responses) { for (ImapResponse response : responses) { CapabilityResponse result; if (!response.isEmpty() && equalsIgnoreCase(response.get(0), Responses.OK) && response.isList(1)) { ImapList capabilityList = response.getList(1); result = par... |
@Test public void parse_withTaggedResponse_shouldReturnNull() throws Exception { ImapResponse response = createImapResponse("1 OK [PERMANENTFLAGS (\\Deleted \\Seen)] Flags permitted."); PermanentFlagsResponse result = PermanentFlagsResponse.parse(response); assertNull(result); } | public static PermanentFlagsResponse parse(ImapResponse response) { if (response.isTagged() || !equalsIgnoreCase(response.get(0), Responses.OK) || !response.isList(1)) { return null; } ImapList responseTextList = response.getList(1); if (responseTextList.size() < 2 || !equalsIgnoreCase(responseTextList.get(0), Response... | PermanentFlagsResponse { public static PermanentFlagsResponse parse(ImapResponse response) { if (response.isTagged() || !equalsIgnoreCase(response.get(0), Responses.OK) || !response.isList(1)) { return null; } ImapList responseTextList = response.getList(1); if (responseTextList.size() < 2 || !equalsIgnoreCase(response... | PermanentFlagsResponse { public static PermanentFlagsResponse parse(ImapResponse response) { if (response.isTagged() || !equalsIgnoreCase(response.get(0), Responses.OK) || !response.isList(1)) { return null; } ImapList responseTextList = response.getList(1); if (responseTextList.size() < 2 || !equalsIgnoreCase(response... | PermanentFlagsResponse { public static PermanentFlagsResponse parse(ImapResponse response) { if (response.isTagged() || !equalsIgnoreCase(response.get(0), Responses.OK) || !response.isList(1)) { return null; } ImapList responseTextList = response.getList(1); if (responseTextList.size() < 2 || !equalsIgnoreCase(response... | PermanentFlagsResponse { public static PermanentFlagsResponse parse(ImapResponse response) { if (response.isTagged() || !equalsIgnoreCase(response.get(0), Responses.OK) || !response.isList(1)) { return null; } ImapList responseTextList = response.getList(1); if (responseTextList.size() < 2 || !equalsIgnoreCase(response... |
@Test public void parse_withoutOkResponse_shouldReturnNull() throws Exception { ImapResponse response = createImapResponse("* BYE See you"); PermanentFlagsResponse result = PermanentFlagsResponse.parse(response); assertNull(result); } | public static PermanentFlagsResponse parse(ImapResponse response) { if (response.isTagged() || !equalsIgnoreCase(response.get(0), Responses.OK) || !response.isList(1)) { return null; } ImapList responseTextList = response.getList(1); if (responseTextList.size() < 2 || !equalsIgnoreCase(responseTextList.get(0), Response... | PermanentFlagsResponse { public static PermanentFlagsResponse parse(ImapResponse response) { if (response.isTagged() || !equalsIgnoreCase(response.get(0), Responses.OK) || !response.isList(1)) { return null; } ImapList responseTextList = response.getList(1); if (responseTextList.size() < 2 || !equalsIgnoreCase(response... | PermanentFlagsResponse { public static PermanentFlagsResponse parse(ImapResponse response) { if (response.isTagged() || !equalsIgnoreCase(response.get(0), Responses.OK) || !response.isList(1)) { return null; } ImapList responseTextList = response.getList(1); if (responseTextList.size() < 2 || !equalsIgnoreCase(response... | PermanentFlagsResponse { public static PermanentFlagsResponse parse(ImapResponse response) { if (response.isTagged() || !equalsIgnoreCase(response.get(0), Responses.OK) || !response.isList(1)) { return null; } ImapList responseTextList = response.getList(1); if (responseTextList.size() < 2 || !equalsIgnoreCase(response... | PermanentFlagsResponse { public static PermanentFlagsResponse parse(ImapResponse response) { if (response.isTagged() || !equalsIgnoreCase(response.get(0), Responses.OK) || !response.isList(1)) { return null; } ImapList responseTextList = response.getList(1); if (responseTextList.size() < 2 || !equalsIgnoreCase(response... |
@Test public void parse_withoutResponseText_shouldReturnNull() throws Exception { ImapResponse response = createImapResponse("* OK Success"); PermanentFlagsResponse result = PermanentFlagsResponse.parse(response); assertNull(result); } | public static PermanentFlagsResponse parse(ImapResponse response) { if (response.isTagged() || !equalsIgnoreCase(response.get(0), Responses.OK) || !response.isList(1)) { return null; } ImapList responseTextList = response.getList(1); if (responseTextList.size() < 2 || !equalsIgnoreCase(responseTextList.get(0), Response... | PermanentFlagsResponse { public static PermanentFlagsResponse parse(ImapResponse response) { if (response.isTagged() || !equalsIgnoreCase(response.get(0), Responses.OK) || !response.isList(1)) { return null; } ImapList responseTextList = response.getList(1); if (responseTextList.size() < 2 || !equalsIgnoreCase(response... | PermanentFlagsResponse { public static PermanentFlagsResponse parse(ImapResponse response) { if (response.isTagged() || !equalsIgnoreCase(response.get(0), Responses.OK) || !response.isList(1)) { return null; } ImapList responseTextList = response.getList(1); if (responseTextList.size() < 2 || !equalsIgnoreCase(response... | PermanentFlagsResponse { public static PermanentFlagsResponse parse(ImapResponse response) { if (response.isTagged() || !equalsIgnoreCase(response.get(0), Responses.OK) || !response.isList(1)) { return null; } ImapList responseTextList = response.getList(1); if (responseTextList.size() < 2 || !equalsIgnoreCase(response... | PermanentFlagsResponse { public static PermanentFlagsResponse parse(ImapResponse response) { if (response.isTagged() || !equalsIgnoreCase(response.get(0), Responses.OK) || !response.isList(1)) { return null; } ImapList responseTextList = response.getList(1); if (responseTextList.size() < 2 || !equalsIgnoreCase(response... |
@Test public void testPreserveSpacesAtFirst() { String message = "foo\r\n" + " bar\r\n" + " baz\r\n"; String result = HtmlConverter.textToHtml(message); writeToFile(result); assertEquals("<pre class=\"k9mail\">" + "foo<br />" + " bar<br />" + " baz<br />" + "</pre>", result); } | public static String textToHtml(String text) { if (text.length() > MAX_SMART_HTMLIFY_MESSAGE_LENGTH) { return simpleTextToHtml(text); } StringBuilder buff = new StringBuilder(text.length() + TEXT_TO_HTML_EXTRA_BUFFER_LENGTH); boolean isStartOfLine = true; int spaces = 0; int quoteDepth = 0; int quotesThisLine = 0; for ... | HtmlConverter { public static String textToHtml(String text) { if (text.length() > MAX_SMART_HTMLIFY_MESSAGE_LENGTH) { return simpleTextToHtml(text); } StringBuilder buff = new StringBuilder(text.length() + TEXT_TO_HTML_EXTRA_BUFFER_LENGTH); boolean isStartOfLine = true; int spaces = 0; int quoteDepth = 0; int quotesTh... | HtmlConverter { public static String textToHtml(String text) { if (text.length() > MAX_SMART_HTMLIFY_MESSAGE_LENGTH) { return simpleTextToHtml(text); } StringBuilder buff = new StringBuilder(text.length() + TEXT_TO_HTML_EXTRA_BUFFER_LENGTH); boolean isStartOfLine = true; int spaces = 0; int quoteDepth = 0; int quotesTh... | HtmlConverter { public static String textToHtml(String text) { if (text.length() > MAX_SMART_HTMLIFY_MESSAGE_LENGTH) { return simpleTextToHtml(text); } StringBuilder buff = new StringBuilder(text.length() + TEXT_TO_HTML_EXTRA_BUFFER_LENGTH); boolean isStartOfLine = true; int spaces = 0; int quoteDepth = 0; int quotesTh... | HtmlConverter { public static String textToHtml(String text) { if (text.length() > MAX_SMART_HTMLIFY_MESSAGE_LENGTH) { return simpleTextToHtml(text); } StringBuilder buff = new StringBuilder(text.length() + TEXT_TO_HTML_EXTRA_BUFFER_LENGTH); boolean isStartOfLine = true; int spaces = 0; int quoteDepth = 0; int quotesTh... |
@Test public void parse_withTooShortResponseText_shouldReturnNull() throws Exception { ImapResponse response = createImapResponse("* OK [PERMANENTFLAGS]"); PermanentFlagsResponse result = PermanentFlagsResponse.parse(response); assertNull(result); } | public static PermanentFlagsResponse parse(ImapResponse response) { if (response.isTagged() || !equalsIgnoreCase(response.get(0), Responses.OK) || !response.isList(1)) { return null; } ImapList responseTextList = response.getList(1); if (responseTextList.size() < 2 || !equalsIgnoreCase(responseTextList.get(0), Response... | PermanentFlagsResponse { public static PermanentFlagsResponse parse(ImapResponse response) { if (response.isTagged() || !equalsIgnoreCase(response.get(0), Responses.OK) || !response.isList(1)) { return null; } ImapList responseTextList = response.getList(1); if (responseTextList.size() < 2 || !equalsIgnoreCase(response... | PermanentFlagsResponse { public static PermanentFlagsResponse parse(ImapResponse response) { if (response.isTagged() || !equalsIgnoreCase(response.get(0), Responses.OK) || !response.isList(1)) { return null; } ImapList responseTextList = response.getList(1); if (responseTextList.size() < 2 || !equalsIgnoreCase(response... | PermanentFlagsResponse { public static PermanentFlagsResponse parse(ImapResponse response) { if (response.isTagged() || !equalsIgnoreCase(response.get(0), Responses.OK) || !response.isList(1)) { return null; } ImapList responseTextList = response.getList(1); if (responseTextList.size() < 2 || !equalsIgnoreCase(response... | PermanentFlagsResponse { public static PermanentFlagsResponse parse(ImapResponse response) { if (response.isTagged() || !equalsIgnoreCase(response.get(0), Responses.OK) || !response.isList(1)) { return null; } ImapList responseTextList = response.getList(1); if (responseTextList.size() < 2 || !equalsIgnoreCase(response... |
@Test public void parse_withoutPermanentFlagsResponse_shouldReturnNull() throws Exception { ImapResponse response = createImapResponse("* OK [UIDNEXT 1]"); PermanentFlagsResponse result = PermanentFlagsResponse.parse(response); assertNull(result); } | public static PermanentFlagsResponse parse(ImapResponse response) { if (response.isTagged() || !equalsIgnoreCase(response.get(0), Responses.OK) || !response.isList(1)) { return null; } ImapList responseTextList = response.getList(1); if (responseTextList.size() < 2 || !equalsIgnoreCase(responseTextList.get(0), Response... | PermanentFlagsResponse { public static PermanentFlagsResponse parse(ImapResponse response) { if (response.isTagged() || !equalsIgnoreCase(response.get(0), Responses.OK) || !response.isList(1)) { return null; } ImapList responseTextList = response.getList(1); if (responseTextList.size() < 2 || !equalsIgnoreCase(response... | PermanentFlagsResponse { public static PermanentFlagsResponse parse(ImapResponse response) { if (response.isTagged() || !equalsIgnoreCase(response.get(0), Responses.OK) || !response.isList(1)) { return null; } ImapList responseTextList = response.getList(1); if (responseTextList.size() < 2 || !equalsIgnoreCase(response... | PermanentFlagsResponse { public static PermanentFlagsResponse parse(ImapResponse response) { if (response.isTagged() || !equalsIgnoreCase(response.get(0), Responses.OK) || !response.isList(1)) { return null; } ImapList responseTextList = response.getList(1); if (responseTextList.size() < 2 || !equalsIgnoreCase(response... | PermanentFlagsResponse { public static PermanentFlagsResponse parse(ImapResponse response) { if (response.isTagged() || !equalsIgnoreCase(response.get(0), Responses.OK) || !response.isList(1)) { return null; } ImapList responseTextList = response.getList(1); if (responseTextList.size() < 2 || !equalsIgnoreCase(response... |
@Test public void parse_withoutPermanentFlagsList_shouldReturnNull() throws Exception { ImapResponse response = createImapResponse("* OK [PERMANENTFLAGS none]"); PermanentFlagsResponse result = PermanentFlagsResponse.parse(response); assertNull(result); } | public static PermanentFlagsResponse parse(ImapResponse response) { if (response.isTagged() || !equalsIgnoreCase(response.get(0), Responses.OK) || !response.isList(1)) { return null; } ImapList responseTextList = response.getList(1); if (responseTextList.size() < 2 || !equalsIgnoreCase(responseTextList.get(0), Response... | PermanentFlagsResponse { public static PermanentFlagsResponse parse(ImapResponse response) { if (response.isTagged() || !equalsIgnoreCase(response.get(0), Responses.OK) || !response.isList(1)) { return null; } ImapList responseTextList = response.getList(1); if (responseTextList.size() < 2 || !equalsIgnoreCase(response... | PermanentFlagsResponse { public static PermanentFlagsResponse parse(ImapResponse response) { if (response.isTagged() || !equalsIgnoreCase(response.get(0), Responses.OK) || !response.isList(1)) { return null; } ImapList responseTextList = response.getList(1); if (responseTextList.size() < 2 || !equalsIgnoreCase(response... | PermanentFlagsResponse { public static PermanentFlagsResponse parse(ImapResponse response) { if (response.isTagged() || !equalsIgnoreCase(response.get(0), Responses.OK) || !response.isList(1)) { return null; } ImapList responseTextList = response.getList(1); if (responseTextList.size() < 2 || !equalsIgnoreCase(response... | PermanentFlagsResponse { public static PermanentFlagsResponse parse(ImapResponse response) { if (response.isTagged() || !equalsIgnoreCase(response.get(0), Responses.OK) || !response.isList(1)) { return null; } ImapList responseTextList = response.getList(1); if (responseTextList.size() < 2 || !equalsIgnoreCase(response... |
@Test public void parse_withInvalidElementInPermanentFlagsList_shouldReturnNull() throws Exception { ImapResponse response = createImapResponse("* OK [PERMANENTFLAGS (\\Seen ())]"); PermanentFlagsResponse result = PermanentFlagsResponse.parse(response); assertNull(result); } | public static PermanentFlagsResponse parse(ImapResponse response) { if (response.isTagged() || !equalsIgnoreCase(response.get(0), Responses.OK) || !response.isList(1)) { return null; } ImapList responseTextList = response.getList(1); if (responseTextList.size() < 2 || !equalsIgnoreCase(responseTextList.get(0), Response... | PermanentFlagsResponse { public static PermanentFlagsResponse parse(ImapResponse response) { if (response.isTagged() || !equalsIgnoreCase(response.get(0), Responses.OK) || !response.isList(1)) { return null; } ImapList responseTextList = response.getList(1); if (responseTextList.size() < 2 || !equalsIgnoreCase(response... | PermanentFlagsResponse { public static PermanentFlagsResponse parse(ImapResponse response) { if (response.isTagged() || !equalsIgnoreCase(response.get(0), Responses.OK) || !response.isList(1)) { return null; } ImapList responseTextList = response.getList(1); if (responseTextList.size() < 2 || !equalsIgnoreCase(response... | PermanentFlagsResponse { public static PermanentFlagsResponse parse(ImapResponse response) { if (response.isTagged() || !equalsIgnoreCase(response.get(0), Responses.OK) || !response.isList(1)) { return null; } ImapList responseTextList = response.getList(1); if (responseTextList.size() < 2 || !equalsIgnoreCase(response... | PermanentFlagsResponse { public static PermanentFlagsResponse parse(ImapResponse response) { if (response.isTagged() || !equalsIgnoreCase(response.get(0), Responses.OK) || !response.isList(1)) { return null; } ImapList responseTextList = response.getList(1); if (responseTextList.size() < 2 || !equalsIgnoreCase(response... |
@Test public void testSimpleOkResponse() throws IOException { ImapResponseParser parser = createParser("* OK\r\n"); ImapResponse response = parser.readResponse(); assertNotNull(response); assertEquals(1, response.size()); assertEquals("OK", response.get(0)); } | public ImapResponse readResponse() throws IOException { return readResponse(null); } | ImapResponseParser { public ImapResponse readResponse() throws IOException { return readResponse(null); } } | ImapResponseParser { public ImapResponse readResponse() throws IOException { return readResponse(null); } ImapResponseParser(PeekableInputStream in); } | ImapResponseParser { public ImapResponse readResponse() throws IOException { return readResponse(null); } ImapResponseParser(PeekableInputStream in); ImapResponse readResponse(); ImapResponse readResponse(ImapResponseCallback callback); } | ImapResponseParser { public ImapResponse readResponse() throws IOException { return readResponse(null); } ImapResponseParser(PeekableInputStream in); ImapResponse readResponse(); ImapResponse readResponse(ImapResponseCallback callback); } |
@Test public void testOkResponseWithText() throws IOException { ImapResponseParser parser = createParser("* OK Some text here\r\n"); ImapResponse response = parser.readResponse(); assertNotNull(response); assertEquals(2, response.size()); assertEquals("OK", response.get(0)); assertEquals("Some text here", response.get(... | public ImapResponse readResponse() throws IOException { return readResponse(null); } | ImapResponseParser { public ImapResponse readResponse() throws IOException { return readResponse(null); } } | ImapResponseParser { public ImapResponse readResponse() throws IOException { return readResponse(null); } ImapResponseParser(PeekableInputStream in); } | ImapResponseParser { public ImapResponse readResponse() throws IOException { return readResponse(null); } ImapResponseParser(PeekableInputStream in); ImapResponse readResponse(); ImapResponse readResponse(ImapResponseCallback callback); } | ImapResponseParser { public ImapResponse readResponse() throws IOException { return readResponse(null); } ImapResponseParser(PeekableInputStream in); ImapResponse readResponse(); ImapResponse readResponse(ImapResponseCallback callback); } |
@Test public void testOkResponseWithRespTextCode() throws IOException { ImapResponseParser parser = createParser("* OK [UIDVALIDITY 3857529045]\r\n"); ImapResponse response = parser.readResponse(); assertNotNull(response); assertEquals(2, response.size()); assertEquals("OK", response.get(0)); assertTrue(response.get(1)... | public ImapResponse readResponse() throws IOException { return readResponse(null); } | ImapResponseParser { public ImapResponse readResponse() throws IOException { return readResponse(null); } } | ImapResponseParser { public ImapResponse readResponse() throws IOException { return readResponse(null); } ImapResponseParser(PeekableInputStream in); } | ImapResponseParser { public ImapResponse readResponse() throws IOException { return readResponse(null); } ImapResponseParser(PeekableInputStream in); ImapResponse readResponse(); ImapResponse readResponse(ImapResponseCallback callback); } | ImapResponseParser { public ImapResponse readResponse() throws IOException { return readResponse(null); } ImapResponseParser(PeekableInputStream in); ImapResponse readResponse(); ImapResponse readResponse(ImapResponseCallback callback); } |
@Test public void testOkResponseWithRespTextCodeAndText() throws IOException { ImapResponseParser parser = createParser("* OK [token1 token2] {x} test [...]\r\n"); ImapResponse response = parser.readResponse(); assertNotNull(response); assertEquals(3, response.size()); assertEquals("OK", response.get(0)); assertTrue(re... | public ImapResponse readResponse() throws IOException { return readResponse(null); } | ImapResponseParser { public ImapResponse readResponse() throws IOException { return readResponse(null); } } | ImapResponseParser { public ImapResponse readResponse() throws IOException { return readResponse(null); } ImapResponseParser(PeekableInputStream in); } | ImapResponseParser { public ImapResponse readResponse() throws IOException { return readResponse(null); } ImapResponseParser(PeekableInputStream in); ImapResponse readResponse(); ImapResponse readResponse(ImapResponseCallback callback); } | ImapResponseParser { public ImapResponse readResponse() throws IOException { return readResponse(null); } ImapResponseParser(PeekableInputStream in); ImapResponse readResponse(); ImapResponse readResponse(ImapResponseCallback callback); } |
@Test public void testReadStatusResponseWithOKResponse() throws Exception { ImapResponseParser parser = createParser("* COMMAND BAR\tBAZ\r\n" + "TAG OK COMMAND completed\r\n"); List<ImapResponse> responses = parser.readStatusResponse("TAG", null, null, null); assertEquals(2, responses.size()); assertEquals(asList("COMM... | List<ImapResponse> readStatusResponse(String tag, String commandToLog, String logId, UntaggedHandler untaggedHandler) throws IOException, NegativeImapResponseException { List<ImapResponse> responses = new ArrayList<ImapResponse>(); ImapResponse response; do { response = readResponse(); if (K9MailLib.isDebug() && DEBUG_... | ImapResponseParser { List<ImapResponse> readStatusResponse(String tag, String commandToLog, String logId, UntaggedHandler untaggedHandler) throws IOException, NegativeImapResponseException { List<ImapResponse> responses = new ArrayList<ImapResponse>(); ImapResponse response; do { response = readResponse(); if (K9MailLi... | ImapResponseParser { List<ImapResponse> readStatusResponse(String tag, String commandToLog, String logId, UntaggedHandler untaggedHandler) throws IOException, NegativeImapResponseException { List<ImapResponse> responses = new ArrayList<ImapResponse>(); ImapResponse response; do { response = readResponse(); if (K9MailLi... | ImapResponseParser { List<ImapResponse> readStatusResponse(String tag, String commandToLog, String logId, UntaggedHandler untaggedHandler) throws IOException, NegativeImapResponseException { List<ImapResponse> responses = new ArrayList<ImapResponse>(); ImapResponse response; do { response = readResponse(); if (K9MailLi... | ImapResponseParser { List<ImapResponse> readStatusResponse(String tag, String commandToLog, String logId, UntaggedHandler untaggedHandler) throws IOException, NegativeImapResponseException { List<ImapResponse> responses = new ArrayList<ImapResponse>(); ImapResponse response; do { response = readResponse(); if (K9MailLi... |
@Test public void testReadStatusResponseUntaggedHandlerGetsUntaggedOnly() throws Exception { ImapResponseParser parser = createParser( "* UNTAGGED\r\n" + "A2 OK COMMAND completed\r\n"); TestUntaggedHandler untaggedHandler = new TestUntaggedHandler(); parser.readStatusResponse("A2", null, null, untaggedHandler); assertE... | List<ImapResponse> readStatusResponse(String tag, String commandToLog, String logId, UntaggedHandler untaggedHandler) throws IOException, NegativeImapResponseException { List<ImapResponse> responses = new ArrayList<ImapResponse>(); ImapResponse response; do { response = readResponse(); if (K9MailLib.isDebug() && DEBUG_... | ImapResponseParser { List<ImapResponse> readStatusResponse(String tag, String commandToLog, String logId, UntaggedHandler untaggedHandler) throws IOException, NegativeImapResponseException { List<ImapResponse> responses = new ArrayList<ImapResponse>(); ImapResponse response; do { response = readResponse(); if (K9MailLi... | ImapResponseParser { List<ImapResponse> readStatusResponse(String tag, String commandToLog, String logId, UntaggedHandler untaggedHandler) throws IOException, NegativeImapResponseException { List<ImapResponse> responses = new ArrayList<ImapResponse>(); ImapResponse response; do { response = readResponse(); if (K9MailLi... | ImapResponseParser { List<ImapResponse> readStatusResponse(String tag, String commandToLog, String logId, UntaggedHandler untaggedHandler) throws IOException, NegativeImapResponseException { List<ImapResponse> responses = new ArrayList<ImapResponse>(); ImapResponse response; do { response = readResponse(); if (K9MailLi... | ImapResponseParser { List<ImapResponse> readStatusResponse(String tag, String commandToLog, String logId, UntaggedHandler untaggedHandler) throws IOException, NegativeImapResponseException { List<ImapResponse> responses = new ArrayList<ImapResponse>(); ImapResponse response; do { response = readResponse(); if (K9MailLi... |
@Test public void testPreserveSpacesAtFirstForSpecialCharacters() { String message = " \r\n" + " &\r\n" + " \n" + " <\r\n" + " > \r\n"; String result = HtmlConverter.textToHtml(message); writeToFile(result); assertEquals("<pre class=\"k9mail\">" + " <br />" + " &<br />" + " <br />" + " <<br />" + "<blockquote cl... | public static String textToHtml(String text) { if (text.length() > MAX_SMART_HTMLIFY_MESSAGE_LENGTH) { return simpleTextToHtml(text); } StringBuilder buff = new StringBuilder(text.length() + TEXT_TO_HTML_EXTRA_BUFFER_LENGTH); boolean isStartOfLine = true; int spaces = 0; int quoteDepth = 0; int quotesThisLine = 0; for ... | HtmlConverter { public static String textToHtml(String text) { if (text.length() > MAX_SMART_HTMLIFY_MESSAGE_LENGTH) { return simpleTextToHtml(text); } StringBuilder buff = new StringBuilder(text.length() + TEXT_TO_HTML_EXTRA_BUFFER_LENGTH); boolean isStartOfLine = true; int spaces = 0; int quoteDepth = 0; int quotesTh... | HtmlConverter { public static String textToHtml(String text) { if (text.length() > MAX_SMART_HTMLIFY_MESSAGE_LENGTH) { return simpleTextToHtml(text); } StringBuilder buff = new StringBuilder(text.length() + TEXT_TO_HTML_EXTRA_BUFFER_LENGTH); boolean isStartOfLine = true; int spaces = 0; int quoteDepth = 0; int quotesTh... | HtmlConverter { public static String textToHtml(String text) { if (text.length() > MAX_SMART_HTMLIFY_MESSAGE_LENGTH) { return simpleTextToHtml(text); } StringBuilder buff = new StringBuilder(text.length() + TEXT_TO_HTML_EXTRA_BUFFER_LENGTH); boolean isStartOfLine = true; int spaces = 0; int quoteDepth = 0; int quotesTh... | HtmlConverter { public static String textToHtml(String text) { if (text.length() > MAX_SMART_HTMLIFY_MESSAGE_LENGTH) { return simpleTextToHtml(text); } StringBuilder buff = new StringBuilder(text.length() + TEXT_TO_HTML_EXTRA_BUFFER_LENGTH); boolean isStartOfLine = true; int spaces = 0; int quoteDepth = 0; int quotesTh... |
@Test public void testReadStatusResponseSkippingWrongTag() throws Exception { ImapResponseParser parser = createParser("* UNTAGGED\r\n" + "* 0 EXPUNGE\r\n" + "* 42 EXISTS\r\n" + "A1 COMMAND BAR BAZ\r\n" + "A2 OK COMMAND completed\r\n"); TestUntaggedHandler untaggedHandler = new TestUntaggedHandler(); List<ImapResponse>... | List<ImapResponse> readStatusResponse(String tag, String commandToLog, String logId, UntaggedHandler untaggedHandler) throws IOException, NegativeImapResponseException { List<ImapResponse> responses = new ArrayList<ImapResponse>(); ImapResponse response; do { response = readResponse(); if (K9MailLib.isDebug() && DEBUG_... | ImapResponseParser { List<ImapResponse> readStatusResponse(String tag, String commandToLog, String logId, UntaggedHandler untaggedHandler) throws IOException, NegativeImapResponseException { List<ImapResponse> responses = new ArrayList<ImapResponse>(); ImapResponse response; do { response = readResponse(); if (K9MailLi... | ImapResponseParser { List<ImapResponse> readStatusResponse(String tag, String commandToLog, String logId, UntaggedHandler untaggedHandler) throws IOException, NegativeImapResponseException { List<ImapResponse> responses = new ArrayList<ImapResponse>(); ImapResponse response; do { response = readResponse(); if (K9MailLi... | ImapResponseParser { List<ImapResponse> readStatusResponse(String tag, String commandToLog, String logId, UntaggedHandler untaggedHandler) throws IOException, NegativeImapResponseException { List<ImapResponse> responses = new ArrayList<ImapResponse>(); ImapResponse response; do { response = readResponse(); if (K9MailLi... | ImapResponseParser { List<ImapResponse> readStatusResponse(String tag, String commandToLog, String logId, UntaggedHandler untaggedHandler) throws IOException, NegativeImapResponseException { List<ImapResponse> responses = new ArrayList<ImapResponse>(); ImapResponse response; do { response = readResponse(); if (K9MailLi... |
@Test public void testReadStatusResponseUntaggedHandlerStillCalledOnNegativeReply() throws Exception { ImapResponseParser parser = createParser( "+ text\r\n" + "A2 NO Bad response\r\n"); TestUntaggedHandler untaggedHandler = new TestUntaggedHandler(); try { List<ImapResponse> responses = parser.readStatusResponse("A2",... | List<ImapResponse> readStatusResponse(String tag, String commandToLog, String logId, UntaggedHandler untaggedHandler) throws IOException, NegativeImapResponseException { List<ImapResponse> responses = new ArrayList<ImapResponse>(); ImapResponse response; do { response = readResponse(); if (K9MailLib.isDebug() && DEBUG_... | ImapResponseParser { List<ImapResponse> readStatusResponse(String tag, String commandToLog, String logId, UntaggedHandler untaggedHandler) throws IOException, NegativeImapResponseException { List<ImapResponse> responses = new ArrayList<ImapResponse>(); ImapResponse response; do { response = readResponse(); if (K9MailLi... | ImapResponseParser { List<ImapResponse> readStatusResponse(String tag, String commandToLog, String logId, UntaggedHandler untaggedHandler) throws IOException, NegativeImapResponseException { List<ImapResponse> responses = new ArrayList<ImapResponse>(); ImapResponse response; do { response = readResponse(); if (K9MailLi... | ImapResponseParser { List<ImapResponse> readStatusResponse(String tag, String commandToLog, String logId, UntaggedHandler untaggedHandler) throws IOException, NegativeImapResponseException { List<ImapResponse> responses = new ArrayList<ImapResponse>(); ImapResponse response; do { response = readResponse(); if (K9MailLi... | ImapResponseParser { List<ImapResponse> readStatusResponse(String tag, String commandToLog, String logId, UntaggedHandler untaggedHandler) throws IOException, NegativeImapResponseException { List<ImapResponse> responses = new ArrayList<ImapResponse>(); ImapResponse response; do { response = readResponse(); if (K9MailLi... |
@Test(expected = NegativeImapResponseException.class) public void testReadStatusResponseWithErrorResponse() throws Exception { ImapResponseParser parser = createParser("* COMMAND BAR BAZ\r\nTAG ERROR COMMAND errored\r\n"); parser.readStatusResponse("TAG", null, null, null); } | List<ImapResponse> readStatusResponse(String tag, String commandToLog, String logId, UntaggedHandler untaggedHandler) throws IOException, NegativeImapResponseException { List<ImapResponse> responses = new ArrayList<ImapResponse>(); ImapResponse response; do { response = readResponse(); if (K9MailLib.isDebug() && DEBUG_... | ImapResponseParser { List<ImapResponse> readStatusResponse(String tag, String commandToLog, String logId, UntaggedHandler untaggedHandler) throws IOException, NegativeImapResponseException { List<ImapResponse> responses = new ArrayList<ImapResponse>(); ImapResponse response; do { response = readResponse(); if (K9MailLi... | ImapResponseParser { List<ImapResponse> readStatusResponse(String tag, String commandToLog, String logId, UntaggedHandler untaggedHandler) throws IOException, NegativeImapResponseException { List<ImapResponse> responses = new ArrayList<ImapResponse>(); ImapResponse response; do { response = readResponse(); if (K9MailLi... | ImapResponseParser { List<ImapResponse> readStatusResponse(String tag, String commandToLog, String logId, UntaggedHandler untaggedHandler) throws IOException, NegativeImapResponseException { List<ImapResponse> responses = new ArrayList<ImapResponse>(); ImapResponse response; do { response = readResponse(); if (K9MailLi... | ImapResponseParser { List<ImapResponse> readStatusResponse(String tag, String commandToLog, String logId, UntaggedHandler untaggedHandler) throws IOException, NegativeImapResponseException { List<ImapResponse> responses = new ArrayList<ImapResponse>(); ImapResponse response; do { response = readResponse(); if (K9MailLi... |
@Test public void testRespTextCodeWithList() throws Exception { ImapResponseParser parser = createParser("* OK [PERMANENTFLAGS (\\Answered \\Flagged \\Deleted \\Seen " + "\\Draft NonJunk $MDNSent \\*)] Flags permitted.\r\n"); ImapResponse response = parser.readResponse(); assertEquals(3, response.size()); assertTrue(re... | public ImapResponse readResponse() throws IOException { return readResponse(null); } | ImapResponseParser { public ImapResponse readResponse() throws IOException { return readResponse(null); } } | ImapResponseParser { public ImapResponse readResponse() throws IOException { return readResponse(null); } ImapResponseParser(PeekableInputStream in); } | ImapResponseParser { public ImapResponse readResponse() throws IOException { return readResponse(null); } ImapResponseParser(PeekableInputStream in); ImapResponse readResponse(); ImapResponse readResponse(ImapResponseCallback callback); } | ImapResponseParser { public ImapResponse readResponse() throws IOException { return readResponse(null); } ImapResponseParser(PeekableInputStream in); ImapResponse readResponse(); ImapResponse readResponse(ImapResponseCallback callback); } |
@Test public void testExistsResponse() throws Exception { ImapResponseParser parser = createParser("* 23 EXISTS\r\n"); ImapResponse response = parser.readResponse(); assertEquals(2, response.size()); assertEquals(23, response.getNumber(0)); assertEquals("EXISTS", response.getString(1)); } | public ImapResponse readResponse() throws IOException { return readResponse(null); } | ImapResponseParser { public ImapResponse readResponse() throws IOException { return readResponse(null); } } | ImapResponseParser { public ImapResponse readResponse() throws IOException { return readResponse(null); } ImapResponseParser(PeekableInputStream in); } | ImapResponseParser { public ImapResponse readResponse() throws IOException { return readResponse(null); } ImapResponseParser(PeekableInputStream in); ImapResponse readResponse(); ImapResponse readResponse(ImapResponseCallback callback); } | ImapResponseParser { public ImapResponse readResponse() throws IOException { return readResponse(null); } ImapResponseParser(PeekableInputStream in); ImapResponse readResponse(); ImapResponse readResponse(ImapResponseCallback callback); } |
@Test(expected = IOException.class) public void testReadStringUntilEndOfStream() throws IOException { ImapResponseParser parser = createParser("* OK Some text "); parser.readResponse(); } | public ImapResponse readResponse() throws IOException { return readResponse(null); } | ImapResponseParser { public ImapResponse readResponse() throws IOException { return readResponse(null); } } | ImapResponseParser { public ImapResponse readResponse() throws IOException { return readResponse(null); } ImapResponseParser(PeekableInputStream in); } | ImapResponseParser { public ImapResponse readResponse() throws IOException { return readResponse(null); } ImapResponseParser(PeekableInputStream in); ImapResponse readResponse(); ImapResponse readResponse(ImapResponseCallback callback); } | ImapResponseParser { public ImapResponse readResponse() throws IOException { return readResponse(null); } ImapResponseParser(PeekableInputStream in); ImapResponse readResponse(); ImapResponse readResponse(ImapResponseCallback callback); } |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.