Fix DefaultHostnameVerifierTest failure.
The failure was caused by me forgetting to update the tests when
merging in 14d4830f4048657722cbec1c4aaa8747a07c9495 which makes
DefaultHostnameVerifier reject wildcard domain name patterns
consisting of fewer than two labels (excluding root).
Bug: 17552202
Change-Id: Ibd1928621dbffb43830ff9d014eb1e3c50232172
diff --git a/luni/src/test/java/libcore/javax/net/ssl/DefaultHostnameVerifierTest.java b/luni/src/test/java/libcore/javax/net/ssl/DefaultHostnameVerifierTest.java
index 71ccea4..e890355 100644
--- a/luni/src/test/java/libcore/javax/net/ssl/DefaultHostnameVerifierTest.java
+++ b/luni/src/test/java/libcore/javax/net/ssl/DefaultHostnameVerifierTest.java
@@ -154,9 +154,11 @@
assertFalse(verifier.verifyHostName("imap.google.com", "ix*.google.com"));
assertTrue(verifier.verifyHostName("imap.google.com", "iMap.Google.Com"));
assertTrue(verifier.verifyHostName("weird", "weird"));
+ assertFalse(verifier.verifyHostName("weird", "weird."));
+
+ // Wildcards rejected for domain names consisting of fewer than two labels (excluding root).
assertFalse(verifier.verifyHostName("weird", "weird*"));
assertFalse(verifier.verifyHostName("weird", "*weird"));
- assertFalse(verifier.verifyHostName("weird", "weird."));
assertFalse(verifier.verifyHostName("weird", "weird*."));
assertFalse(verifier.verifyHostName("weird", "weird.*"));
}
@@ -175,10 +177,12 @@
assertFalse(verifier.verifyHostName("imap.google.com.", "ix*.google.com"));
assertTrue(verifier.verifyHostName("imap.google.com.", "iMap.Google.Com"));
assertTrue(verifier.verifyHostName("weird.", "weird"));
- assertTrue(verifier.verifyHostName("weird.", "weird*"));
- assertTrue(verifier.verifyHostName("weird.", "*weird"));
assertTrue(verifier.verifyHostName("weird.", "weird."));
- assertTrue(verifier.verifyHostName("weird.", "weird*."));
+
+ // Wildcards rejected for domain names consisting of fewer than two labels (excluding root).
+ assertFalse(verifier.verifyHostName("weird.", "*weird"));
+ assertFalse(verifier.verifyHostName("weird.", "weird*"));
+ assertFalse(verifier.verifyHostName("weird.", "weird*."));
assertFalse(verifier.verifyHostName("weird.", "weird.*"));
}