6915497: test test/tools/javac/nio/compileTest/CompileTest.java fails under Hudson

Mon, 11 Jan 2010 14:17:01 -0800

author
jjg
date
Mon, 11 Jan 2010 14:17:01 -0800
changeset 467
14a4c45ef734
parent 466
ca6bc36b2305
child 468
51011e02c02f

6915497: test test/tools/javac/nio/compileTest/CompileTest.java fails under Hudson
Reviewed-by: darcy

test/tools/javac/nio/compileTest/CompileTest.java file | annotate | diff | comparison | revisions
     1.1 --- a/test/tools/javac/nio/compileTest/CompileTest.java	Mon Jan 11 14:12:10 2010 -0800
     1.2 +++ b/test/tools/javac/nio/compileTest/CompileTest.java	Mon Jan 11 14:17:01 2010 -0800
     1.3 @@ -23,9 +23,9 @@
     1.4  
     1.5  /**
     1.6   * @test
     1.7 - * @bug 6906175 6915476
     1.8 + * @bug 6906175 6915476 6915497
     1.9   * @summary Path-based JavaFileManager
    1.10 - * @compile HelloPathWorld.java
    1.11 + * @compile -g HelloPathWorld.java
    1.12   * @run main CompileTest
    1.13   */
    1.14  
    1.15 @@ -94,7 +94,8 @@
    1.16          options.addAll(Arrays.asList(opts));
    1.17          options.addAll(Arrays.asList(
    1.18                  "-verbose", "-XDverboseCompilePolicy",
    1.19 -                "-d", classes.toString()
    1.20 +                "-d", classes.toString(),
    1.21 +                "-g"
    1.22          ));
    1.23          Iterable<? extends JavaFileObject> compilationUnits =
    1.24                  fm.getJavaFileObjects(testSrcDir.resolve(className + ".java"));
    1.25 @@ -111,6 +112,8 @@
    1.26          File expect = new File("classes." + count + "/" + className + ".class");
    1.27          if (!expect.exists())
    1.28              throw new Exception("expected file not found: " + expect);
    1.29 +        // Note that we explicitly specify -g for compiling both the actual class and the expected class.
    1.30 +        // This isolates the expected class from javac options that might be given to jtreg.
    1.31          long expectedSize = new File(testClassesDir.toString(), className + ".class").length();
    1.32          long actualSize = expect.length();
    1.33          if (expectedSize != actualSize)

mercurial