equal
deleted
inserted
replaced
1 /* |
1 /* |
2 * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved. |
2 * Copyright (c) 2012, 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. |
26 import org.openjdk.tests.shapegen.*; |
26 import org.openjdk.tests.shapegen.*; |
27 |
27 |
28 import com.sun.source.util.JavacTask; |
28 import com.sun.source.util.JavacTask; |
29 import com.sun.tools.javac.util.Pair; |
29 import com.sun.tools.javac.util.Pair; |
30 |
30 |
|
31 import java.io.IOException; |
31 import java.net.URI; |
32 import java.net.URI; |
32 import java.util.Arrays; |
33 import java.util.Arrays; |
33 import java.util.ArrayList; |
34 import java.util.ArrayList; |
34 import java.util.Collection; |
35 import java.util.Collection; |
35 import java.util.List; |
36 import java.util.List; |
39 import javax.tools.JavaFileObject; |
40 import javax.tools.JavaFileObject; |
40 import javax.tools.SimpleJavaFileObject; |
41 import javax.tools.SimpleJavaFileObject; |
41 import javax.tools.StandardJavaFileManager; |
42 import javax.tools.StandardJavaFileManager; |
42 import javax.tools.ToolProvider; |
43 import javax.tools.ToolProvider; |
43 |
44 |
|
45 import org.testng.annotations.AfterSuite; |
44 import org.testng.annotations.Test; |
46 import org.testng.annotations.Test; |
45 import org.testng.annotations.BeforeSuite; |
47 import org.testng.annotations.BeforeSuite; |
46 import org.testng.annotations.DataProvider; |
48 import org.testng.annotations.DataProvider; |
47 import static org.testng.Assert.*; |
49 import static org.testng.Assert.*; |
48 |
50 |
68 |
70 |
69 comp = ToolProvider.getSystemJavaCompiler(); |
71 comp = ToolProvider.getSystemJavaCompiler(); |
70 fm = comp.getStandardFileManager(null, null, null); |
72 fm = comp.getStandardFileManager(null, null, null); |
71 } |
73 } |
72 |
74 |
|
75 @AfterSuite |
|
76 static void teardown() throws IOException { |
|
77 fm.close(); |
|
78 } |
|
79 |
73 public static void main(String[] args) throws Exception { |
80 public static void main(String[] args) throws Exception { |
74 init(); |
81 init(); |
75 |
82 |
76 for (Pair<TestKind,Hierarchy> fdtest : generateCases()) { |
83 for (Pair<TestKind,Hierarchy> fdtest : generateCases()) { |
77 runTest(fdtest.fst, fdtest.snd, comp, fm); |
84 runTest(fdtest.fst, fdtest.snd, comp, fm); |
78 } |
85 } |
|
86 |
|
87 teardown(); |
79 } |
88 } |
80 |
89 |
81 @Test(dataProvider = "fdCases") |
90 @Test(dataProvider = "fdCases") |
82 public void testOneCase(TestKind tk, Hierarchy hs) |
91 public void testOneCase(TestKind tk, Hierarchy hs) |
83 throws Exception { |
92 throws Exception { |