summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKenny Root <kroot@google.com>2014-04-22 11:30:22 -0700
committerKenny Root <kroot@google.com>2014-04-22 11:30:24 -0700
commita368cef707903c2adc7868ba48a95ccdac5f7625 (patch)
tree3eb2aa16d4b2fc42e6d8706928513630507b0a3e
parente2564f4aefc33a87d27bbdaa4239d7deb771dd63 (diff)
downloadlibcore-a368cef707903c2adc7868ba48a95ccdac5f7625.zip
libcore-a368cef707903c2adc7868ba48a95ccdac5f7625.tar.gz
libcore-a368cef707903c2adc7868ba48a95ccdac5f7625.tar.bz2
Fix SSLEngineTest for RI
The assymmetry between client and server with create sessions seems strange. It seems like a bug in the RI, so make sure Android does the right thing. Change-Id: I7b7ab501bd1963757b7f067c6ace8230a19a3e53
-rw-r--r--luni/src/test/java/libcore/javax/net/ssl/SSLEngineTest.java20
-rw-r--r--support/src/test/java/libcore/javax/net/ssl/TestSSLEnginePair.java2
2 files changed, 14 insertions, 8 deletions
diff --git a/luni/src/test/java/libcore/javax/net/ssl/SSLEngineTest.java b/luni/src/test/java/libcore/javax/net/ssl/SSLEngineTest.java
index a7d0df2..7adbdf5 100644
--- a/luni/src/test/java/libcore/javax/net/ssl/SSLEngineTest.java
+++ b/luni/src/test/java/libcore/javax/net/ssl/SSLEngineTest.java
@@ -578,13 +578,19 @@ public class SSLEngineTest extends TestCase {
}
public void test_SSLEngine_setEnableSessionCreation_server() throws Exception {
- TestSSLEnginePair p = TestSSLEnginePair.create(new TestSSLEnginePair.Hooks() {
- @Override
- void beforeBeginHandshake(SSLEngine client, SSLEngine server) {
- server.setEnableSessionCreation(false);
- }
- });
- assertNotConnected(p);
+ try {
+ TestSSLEnginePair p = TestSSLEnginePair.create(new TestSSLEnginePair.Hooks() {
+ @Override
+ void beforeBeginHandshake(SSLEngine client, SSLEngine server) {
+ server.setEnableSessionCreation(false);
+ }
+ });
+ // For some reason, the RI doesn't throw an SSLException.
+ assertTrue(StandardNames.IS_RI);
+ assertNotConnected(p);
+ } catch (SSLException maybeExpected) {
+ assertFalse(StandardNames.IS_RI);
+ }
}
public void test_SSLEngine_setEnableSessionCreation_client() throws Exception {
diff --git a/support/src/test/java/libcore/javax/net/ssl/TestSSLEnginePair.java b/support/src/test/java/libcore/javax/net/ssl/TestSSLEnginePair.java
index 79d5d00..709f568 100644
--- a/support/src/test/java/libcore/javax/net/ssl/TestSSLEnginePair.java
+++ b/support/src/test/java/libcore/javax/net/ssl/TestSSLEnginePair.java
@@ -125,7 +125,7 @@ public final class TestSSLEnginePair extends Assert {
if (finished != null) {
assertEquals(2, finished.length);
finished[0] = clientFinished[0];
- finished[1] = clientFinished[0];
+ finished[1] = serverFinished[0];
}
return new SSLEngine[] { server, client };
}