6876753: javap tests fail on Windows

Thu, 27 Aug 2009 17:39:16 -0700

author
jjg
date
Thu, 27 Aug 2009 17:39:16 -0700
changeset 386
2c20f17c429c
parent 385
74760fd5197f
child 387
f29068bfeaed

6876753: javap tests fail on Windows
Reviewed-by: darcy

test/tools/javap/T4975569.java file | annotate | diff | comparison | revisions
test/tools/javap/T6729471.java file | annotate | diff | comparison | revisions
test/tools/javap/pathsep.sh file | annotate | diff | comparison | revisions
test/tools/javap/stackmap/T6271292.sh file | annotate | diff | comparison | revisions
     1.1 --- a/test/tools/javap/T4975569.java	Thu Aug 27 15:12:36 2009 -0700
     1.2 +++ b/test/tools/javap/T4975569.java	Thu Aug 27 17:39:16 2009 -0700
     1.3 @@ -65,6 +65,7 @@
     1.4      int errors;
     1.5  
     1.6      String javap(String className) {
     1.7 +        String newline = System.getProperty("line.separator");
     1.8          String testClasses = System.getProperty("test.classes", ".");
     1.9          StringWriter sw = new StringWriter();
    1.10          PrintWriter out = new PrintWriter(sw);
    1.11 @@ -73,7 +74,7 @@
    1.12          if (rc != 0)
    1.13              throw new Error("javap failed. rc=" + rc);
    1.14          out.close();
    1.15 -        String output = sw.toString();
    1.16 +        String output = sw.toString().replaceAll(newline, "\n");
    1.17          System.out.println("class " + className);
    1.18          System.out.println(output);
    1.19          return output;
     2.1 --- a/test/tools/javap/T6729471.java	Thu Aug 27 15:12:36 2009 -0700
     2.2 +++ b/test/tools/javap/T6729471.java	Thu Aug 27 17:39:16 2009 -0700
     2.3 @@ -29,6 +29,7 @@
     2.4   */
     2.5  
     2.6  import java.io.*;
     2.7 +import java.net.*;
     2.8  import java.util.*;
     2.9  
    2.10  public class T6729471
    2.11 @@ -59,14 +60,22 @@
    2.12          if (java_home.getName().equals("jre"))
    2.13              java_home = java_home.getParentFile();
    2.14          File rt_jar = new File(new File(new File(java_home, "jre"), "lib"), "rt.jar");
    2.15 -        verify("jar:file:" + rt_jar + "!/java/util/Map.class",
    2.16 +        try {
    2.17 +            verify("jar:" + rt_jar.toURL() + "!/java/util/Map.class",
    2.18                  "public abstract boolean containsKey(java.lang.Object)");
    2.19 +        } catch (MalformedURLException e) {
    2.20 +            error(e.toString());
    2.21 +        }
    2.22  
    2.23          // jar url: ct.sym, if it exists
    2.24          File ct_sym = new File(new File(java_home, "lib"), "ct.sym");
    2.25          if (ct_sym.exists()) {
    2.26 -            verify("jar:file:" + ct_sym + "!/META-INF/sym/rt.jar/java/util/Map.class",
    2.27 -                "public abstract boolean containsKey(java.lang.Object)");
    2.28 +            try {
    2.29 +                verify("jar:" + ct_sym.toURL() + "!/META-INF/sym/rt.jar/java/util/Map.class",
    2.30 +                    "public abstract boolean containsKey(java.lang.Object)");
    2.31 +            } catch (MalformedURLException e) {
    2.32 +                error(e.toString());
    2.33 +            }
    2.34          } else
    2.35              System.err.println("warning: ct.sym not found");
    2.36  
     3.1 --- a/test/tools/javap/pathsep.sh	Thu Aug 27 15:12:36 2009 -0700
     3.2 +++ b/test/tools/javap/pathsep.sh	Thu Aug 27 17:39:16 2009 -0700
     3.3 @@ -40,7 +40,7 @@
     3.4  # set platform-dependent variables
     3.5  OS=`uname -s`
     3.6  case "$OS" in
     3.7 -  SunOS | Linux )
     3.8 +  SunOS | Linux | CYGWIN* )
     3.9      FS="/"
    3.10      ;;
    3.11    Windows* )
     4.1 --- a/test/tools/javap/stackmap/T6271292.sh	Thu Aug 27 15:12:36 2009 -0700
     4.2 +++ b/test/tools/javap/stackmap/T6271292.sh	Thu Aug 27 17:39:16 2009 -0700
     4.3 @@ -53,7 +53,7 @@
     4.4  # set platform-dependent variables
     4.5  OS=`uname -s`
     4.6  case "$OS" in
     4.7 -  CYGWIN* | Windows* )
     4.8 +  Windows* )
     4.9      FS="\\"
    4.10      ;;
    4.11    * )

mercurial