changeset 8330:334ea703b2f0

8134248: Fix recently backported tests to work with OpenJDK 7u Reviewed-by: martin
author andrew
date Sat, 22 Aug 2015 01:24:45 +0100
parents f26dc1cb7deb
children 3bf99e4002e2
files test/javax/xml/ws/8046817/GenerateEnumSchema.java test/sun/security/jgss/spnego/MSOID.java
diffstat 2 files changed, 10 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/test/javax/xml/ws/8046817/GenerateEnumSchema.java	Wed Aug 19 20:15:08 2015 +0100
+++ b/test/javax/xml/ws/8046817/GenerateEnumSchema.java	Sat Aug 22 01:24:45 2015 +0100
@@ -32,9 +32,10 @@
 import java.io.File;
 import java.io.IOException;
 import java.io.InputStreamReader;
+import java.nio.charset.StandardCharsets;
 import java.nio.file.Files;
 import java.nio.file.Paths;
-import java.util.stream.Collectors;
+import java.util.List;
 
 public class GenerateEnumSchema {
 
@@ -74,7 +75,11 @@
 
     //Read schema content from file
     private static void readSchemaContent() throws Exception {
-        schemaContent = Files.lines(schemaOutputFile.toPath()).collect(Collectors.joining(""));
+        List<String> content = Files.readAllLines(schemaOutputFile.toPath(), StandardCharsets.UTF_8);
+        StringBuilder builder = new StringBuilder();
+        for (String line : content)
+            builder.append(line);
+        schemaContent = builder.toString();
     }
 
     // Check if schema file contains specific string
--- a/test/sun/security/jgss/spnego/MSOID.java	Wed Aug 19 20:15:08 2015 +0100
+++ b/test/sun/security/jgss/spnego/MSOID.java	Sat Aug 22 01:24:45 2015 +0100
@@ -27,6 +27,8 @@
  * @summary SPNEGO auth fails if client proposes MS krb5 OID
  */
 
+import com.sun.org.apache.xml.internal.security.utils.Base64;
+
 import org.ietf.jgss.GSSContext;
 import org.ietf.jgss.GSSCredential;
 import org.ietf.jgss.GSSException;
@@ -36,7 +38,6 @@
 import java.nio.file.Files;
 import java.nio.file.Paths;
 import java.util.Arrays;
-import java.util.Base64;
 
 public class MSOID {
     public static void main(String[] args) throws Exception {
@@ -45,7 +46,7 @@
         // IIS server on a test machine. No sensitive info included.
         byte[] header = Files.readAllBytes(
                 Paths.get(System.getProperty("test.src"), "msoid.txt"));
-        byte[] token = Base64.getMimeDecoder().decode(
+        byte[] token = Base64.decode(
                 Arrays.copyOfRange(header, 10, header.length));
 
         GSSCredential cred = null;