langtools/test/tools/javac/generics/bridges/BridgeHarness.java
changeset 27319 030080f03e4f
parent 18731 38dd7ede2dfb
child 30730 d3ce7619db2c
equal deleted inserted replaced
27318:4660a5da7d90 27319:030080f03e4f
     1 /*
     1 /*
     2  * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     4  *
     4  *
     5  * This code is free software; you can redistribute it and/or modify it
     5  * This code is free software; you can redistribute it and/or modify it
     6  * under the terms of the GNU General Public License version 2 only, as
     6  * under the terms of the GNU General Public License version 2 only, as
     7  * published by the Free Software Foundation.
     7  * published by the Free Software Foundation.
    68 
    68 
    69     /** the (shared) file manager used by the compiler */
    69     /** the (shared) file manager used by the compiler */
    70     static final StandardJavaFileManager fm = comp.getStandardFileManager(null, null, null);
    70     static final StandardJavaFileManager fm = comp.getStandardFileManager(null, null, null);
    71 
    71 
    72     public static void main(String[] args) throws Exception {
    72     public static void main(String[] args) throws Exception {
    73         //set sourcepath
    73         try {
    74         fm.setLocation(SOURCE_PATH,
    74             //set sourcepath
    75                 Arrays.asList(new File(System.getProperty("test.src"), "tests")));
    75             fm.setLocation(SOURCE_PATH,
    76         //set output (-d)
    76                     Arrays.asList(new File(System.getProperty("test.src"), "tests")));
    77         fm.setLocation(javax.tools.StandardLocation.CLASS_OUTPUT,
    77             //set output (-d)
    78                 Arrays.asList(new File(System.getProperty("user.dir"))));
    78             fm.setLocation(javax.tools.StandardLocation.CLASS_OUTPUT,
    79         for (JavaFileObject jfo : fm.list(SOURCE_PATH, "", Collections.singleton(JavaFileObject.Kind.SOURCE), true)) {
    79                     Arrays.asList(new File(System.getProperty("user.dir"))));
    80             //for each source, compile and check against annotations
    80             for (JavaFileObject jfo : fm.list(SOURCE_PATH, "", Collections.singleton(JavaFileObject.Kind.SOURCE), true)) {
    81             new BridgeHarness(jfo).compileAndCheck();
    81                 //for each source, compile and check against annotations
    82         }
    82                 new BridgeHarness(jfo).compileAndCheck();
    83         //if there were errors, fail
    83             }
    84         if (nerrors > 0) {
    84             //if there were errors, fail
    85             throw new AssertionError("Errors were found");
    85             if (nerrors > 0) {
       
    86                 throw new AssertionError("Errors were found");
       
    87             }
       
    88         } finally {
       
    89             fm.close();
    86         }
    90         }
    87     }
    91     }
    88 
    92 
    89     /* utility methods */
    93     /* utility methods */
    90 
    94