SourceToSourceTranslationTest.java revision 3087:ed4c306ec942
1162911Ssimon/*
2162911Ssimon * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
3162911Ssimon * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4162911Ssimon *
5162911Ssimon * This code is free software; you can redistribute it and/or modify it
6162911Ssimon * under the terms of the GNU General Public License version 2 only, as
7162911Ssimon * published by the Free Software Foundation.
8162911Ssimon *
9162911Ssimon * This code is distributed in the hope that it will be useful, but WITHOUT
10296465Sdelphij * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11162911Ssimon * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
12162911Ssimon * version 2 for more details (a copy is included in the LICENSE file that
13162911Ssimon * accompanied this code).
14162911Ssimon *
15162911Ssimon * You should have received a copy of the GNU General Public License version
16162911Ssimon * 2 along with this work; if not, write to the Free Software Foundation,
17162911Ssimon * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18162911Ssimon *
19162911Ssimon * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20162911Ssimon * or visit www.oracle.com if you need additional information or have any
21162911Ssimon * questions.
22162911Ssimon */
23162911Ssimon
24162911Ssimon/*
25162911Ssimon * @test
26162911Ssimon * @bug 8129740 8133111
27162911Ssimon * @summary Incorrect class file created when passing lambda in inner class constructor
28162911Ssimon * @library /tools/lib
29162911Ssimon * @modules jdk.compiler/com.sun.tools.javac.api
30162911Ssimon *          jdk.compiler/com.sun.tools.javac.file
31162911Ssimon *          jdk.compiler/com.sun.tools.javac.main
32162911Ssimon * @build ToolBox
33162911Ssimon * @run compile -XD-printsource SourceForTranslation.java
34162911Ssimon * @run main SourceToSourceTranslationTest
35162911Ssimon */
36162911Ssimon
37162911Ssimonimport java.nio.file.Path;
38162911Ssimonimport java.nio.file.Paths;
39162911Ssimonimport java.util.List;
40162911Ssimon
41162911Ssimonpublic class SourceToSourceTranslationTest {
42162911Ssimon
43162911Ssimon    public static void main(String[] args) throws Exception {
44162911Ssimon        ToolBox tb = new ToolBox();
45162911Ssimon        Path path1 = Paths.get(ToolBox.testClasses, "Universe.java");
46162911Ssimon        List<String> file1 = tb.readAllLines(path1);
47162911Ssimon
48162911Ssimon        Path path2 = Paths.get(ToolBox.testSrc, "Universe.java.out");
49162911Ssimon        List<String> file2 = tb.readAllLines(path2);
50162911Ssimon        tb.checkEqual(file1, file2);
51162911Ssimon    }
52162911Ssimon
53296465Sdelphij}
54162911Ssimon