3939import static org .junit .Assert .fail ;
4040
4141@ RunWith (AndroidJUnit4 .class )
42- @ Ignore ("See https://github.com/realm/ros/issues/240" )
4342public class SSLConfigurationTests extends StandardIntegrationTest {
4443
4544 @ Rule
@@ -65,12 +64,12 @@ public void trustedRootCA() throws InterruptedException {
6564 SystemClock .sleep (TimeUnit .SECONDS .toMillis (2 )); // FIXME: Replace with Sync Progress Notifications once available.
6665 realm .close ();
6766 user .logout ();
68- Realm .deleteRealm (configOld );
6967
7068 // 2. Local state should now be completely reset. Open the Realm again with a new configuration which should
7169 // download the uploaded changes.
7270 user = SyncUser .login (SyncCredentials .usernamePassword (username , password ), Constants .AUTH_URL );
7371 SyncConfiguration config = configurationFactory .createSyncConfigurationBuilder (user , Constants .USER_REALM_SECURE )
72+ .name ("useSsl" )
7473 .schema (StringOnly .class )
7574 .waitForInitialRemoteData ()
7675 .trustedRootCA ("trusted_ca.pem" )
@@ -106,12 +105,12 @@ public void withoutSSLVerification() throws InterruptedException {
106105 SystemClock .sleep (TimeUnit .SECONDS .toMillis (2 )); // FIXME: Replace with Sync Progress Notifications once available.
107106 realm .close ();
108107 user .logout ();
109- Realm .deleteRealm (configOld );
110108
111109 // 2. Local state should now be completely reset. Open the Realm again with a new configuration which should
112110 // download the uploaded changes.
113111 user = SyncUser .login (SyncCredentials .usernamePassword (username , password ), Constants .AUTH_URL );
114112 SyncConfiguration config = configurationFactory .createSyncConfigurationBuilder (user , Constants .USER_REALM_SECURE )
113+ .name ("useSsl" )
115114 .schema (StringOnly .class )
116115 .waitForInitialRemoteData ()
117116 .disableSSLVerification ()
@@ -147,12 +146,12 @@ public void trustedRootCA_syncShouldFailWithoutTrustedCA() throws InterruptedExc
147146 SystemClock .sleep (TimeUnit .SECONDS .toMillis (2 )); // FIXME: Replace with Sync Progress Notifications once available.
148147 realm .close ();
149148 user .logout ();
150- Realm .deleteRealm (configOld );
151149
152150 // 2. Local state should now be completely reset. Open the Realm again with a new configuration which should
153151 // download the uploaded changes.
154152 user = SyncUser .login (SyncCredentials .usernamePassword (username , password ), Constants .AUTH_URL );
155153 SyncConfiguration config = configurationFactory .createSyncConfigurationBuilder (user , Constants .USER_REALM_SECURE )
154+ .name ("useSsl" )
156155 .schema (StringOnly .class )
157156 .build ();
158157 realm = Realm .getInstance (config );
@@ -170,6 +169,7 @@ public void combining_trustedRootCA_and_withoutSSLVerification_willThrow() {
170169 SyncUser user = SyncUser .login (SyncCredentials .usernamePassword (username , password , true ), Constants .AUTH_URL );
171170
172171 TestHelper .TestLogger testLogger = new TestHelper .TestLogger ();
172+ int originalLevel = RealmLog .getLevel ();
173173 RealmLog .add (testLogger );
174174 RealmLog .setLevel (LogLevel .WARN );
175175
@@ -181,6 +181,8 @@ public void combining_trustedRootCA_and_withoutSSLVerification_willThrow() {
181181
182182 assertEquals ("SSL Verification is disabled, the provided server certificate will not be used." ,
183183 testLogger .message );
184+ RealmLog .remove (testLogger );
185+ RealmLog .setLevel (originalLevel );
184186 }
185187
186188 @ Test
0 commit comments