6885166: regression test for 6877357 (IPv6 address does not work) error (timed out)
authorweijun
Thu, 24 Sep 2009 21:35:34 +0800
changeset 3944 e098e010b520
parent 3943 11abf5578222
child 3945 391194a1b78a
child 3946 7ee79633ec36
6885166: regression test for 6877357 (IPv6 address does not work) error (timed out) Reviewed-by: xuelei
jdk/test/sun/security/krb5/IPv6.java
--- a/jdk/test/sun/security/krb5/IPv6.java	Tue Sep 22 18:30:58 2009 -0700
+++ b/jdk/test/sun/security/krb5/IPv6.java	Thu Sep 24 21:35:34 2009 +0800
@@ -23,7 +23,7 @@
 
 /*
  * @test
- * @bug 6877357
+ * @bug 6877357 6885166
  * @summary IPv6 address does not work
  */
 
@@ -57,6 +57,7 @@
         PrintStream out = new PrintStream(new FileOutputStream("ipv6.conf"));
         out.println("[libdefaults]");
         out.println("default_realm = V6");
+        out.println("kdc_timeout = 1");
         out.println("[realms]");
         out.println("V6 = {");
         for (String[] hp: kdcs) {
@@ -95,10 +96,12 @@
         po.flush();
 
         System.setOut(oldout);
-        String[] lines = new String(bo.toByteArray()).split("\n");
+        BufferedReader br = new BufferedReader(new StringReader(
+                new String(bo.toByteArray())));
         int cc = 0;
         Pattern r = Pattern.compile(".*KrbKdcReq send: kdc=(.*) UDP:(\\d+),.*");
-        for (String line: lines) {
+        String line;
+        while ((line = br.readLine()) != null) {
             Matcher m = r.matcher(line.subSequence(0, line.length()));
             if (m.matches()) {
                 System.out.println("------------------");