Search in sources :

Example 21 with ServerSettings

use of com.fsck.k9.mail.ServerSettings in project k-9 by k9mail.

the class SmtpTransportUriTest method decodeUri_canDecodeAuthType.

@Test
public void decodeUri_canDecodeAuthType() {
    String storeUri = "smtp://user:password:PLAIN@server:123456";
    ServerSettings result = SmtpTransport.decodeUri(storeUri);
    assertEquals(AuthType.PLAIN, result.authenticationType);
}
Also used : ServerSettings(com.fsck.k9.mail.ServerSettings) Test(org.junit.Test)

Example 22 with ServerSettings

use of com.fsck.k9.mail.ServerSettings in project k-9 by k9mail.

the class SmtpTransportUriTest method decodeUri_canDecodeSSL.

@Test
public void decodeUri_canDecodeSSL() {
    String storeUri = "smtp+ssl+://user:password:PLAIN@server:123456";
    ServerSettings result = SmtpTransport.decodeUri(storeUri);
    assertEquals(ConnectionSecurity.SSL_TLS_REQUIRED, result.connectionSecurity);
}
Also used : ServerSettings(com.fsck.k9.mail.ServerSettings) Test(org.junit.Test)

Example 23 with ServerSettings

use of com.fsck.k9.mail.ServerSettings in project k-9 by k9mail.

the class SmtpTransportUriTest method decodeUri_canDecodeAuthType_withEmptyPassword.

@Test
public void decodeUri_canDecodeAuthType_withEmptyPassword() {
    String storeUri = "smtp://user::PLAIN@server:123456";
    ServerSettings result = SmtpTransport.decodeUri(storeUri);
    assertEquals(AuthType.PLAIN, result.authenticationType);
}
Also used : ServerSettings(com.fsck.k9.mail.ServerSettings) Test(org.junit.Test)

Example 24 with ServerSettings

use of com.fsck.k9.mail.ServerSettings in project k-9 by k9mail.

the class SmtpTransportUriTest method decodeUri_canDecodeHost.

@Test
public void decodeUri_canDecodeHost() {
    String storeUri = "smtp://user:password:PLAIN@server:123456";
    ServerSettings result = SmtpTransport.decodeUri(storeUri);
    assertEquals("server", result.host);
}
Also used : ServerSettings(com.fsck.k9.mail.ServerSettings) Test(org.junit.Test)

Example 25 with ServerSettings

use of com.fsck.k9.mail.ServerSettings in project k-9 by k9mail.

the class SmtpTransportUriTest method decodeUri_forUnknownSchema_throwsIllegalArgumentException.

@Test(expected = IllegalArgumentException.class)
public void decodeUri_forUnknownSchema_throwsIllegalArgumentException() {
    String storeUri = "unknown://user:clientCert:EXTERNAL@server:123456";
    ServerSettings result = SmtpTransport.decodeUri(storeUri);
}
Also used : ServerSettings(com.fsck.k9.mail.ServerSettings) Test(org.junit.Test)

Aggregations

ServerSettings (com.fsck.k9.mail.ServerSettings)45 Test (org.junit.Test)34 URISyntaxException (java.net.URISyntaxException)9 AuthType (com.fsck.k9.mail.AuthType)8 URI (java.net.URI)7 HashMap (java.util.HashMap)5 ConnectionSecurity (com.fsck.k9.mail.ConnectionSecurity)4 InvalidSettingValueException (com.fsck.k9.preferences.Settings.InvalidSettingValueException)2 Map (java.util.Map)2 SharedPreferences (android.content.SharedPreferences)1 OnCheckedChangeListener (android.widget.CompoundButton.OnCheckedChangeListener)1 Account (com.fsck.k9.Account)1 Preferences (com.fsck.k9.Preferences)1 Store (com.fsck.k9.mail.Store)1 RemoteStore (com.fsck.k9.mail.store.RemoteStore)1 StoreConfig (com.fsck.k9.mail.store.StoreConfig)1 ImapStoreSettings (com.fsck.k9.mail.store.imap.ImapStoreSettings)1 WebDavStoreSettings (com.fsck.k9.mail.store.webdav.WebDavStoreSettings)1 SettingsDescription (com.fsck.k9.preferences.Settings.SettingsDescription)1 ArrayList (java.util.ArrayList)1