author | alundblad |
Wed, 26 Aug 2015 09:02:02 +0200 | |
changeset 32337 | c9d3ab9f601c |
parent 14554 | 4e29b285c723 |
permissions | -rw-r--r-- |
14554
4e29b285c723
8003639: convert lambda testng tests to jtreg and add them
rfield
parents:
diff
changeset
|
1 |
/* |
4e29b285c723
8003639: convert lambda testng tests to jtreg and add them
rfield
parents:
diff
changeset
|
2 |
* Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved. |
4e29b285c723
8003639: convert lambda testng tests to jtreg and add them
rfield
parents:
diff
changeset
|
3 |
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4e29b285c723
8003639: convert lambda testng tests to jtreg and add them
rfield
parents:
diff
changeset
|
4 |
* |
4e29b285c723
8003639: convert lambda testng tests to jtreg and add them
rfield
parents:
diff
changeset
|
5 |
* This code is free software; you can redistribute it and/or modify it |
4e29b285c723
8003639: convert lambda testng tests to jtreg and add them
rfield
parents:
diff
changeset
|
6 |
* under the terms of the GNU General Public License version 2 only, as |
32337 | 7 |
* published by the Free Software Foundation. |
14554
4e29b285c723
8003639: convert lambda testng tests to jtreg and add them
rfield
parents:
diff
changeset
|
8 |
* |
4e29b285c723
8003639: convert lambda testng tests to jtreg and add them
rfield
parents:
diff
changeset
|
9 |
* This code is distributed in the hope that it will be useful, but WITHOUT |
4e29b285c723
8003639: convert lambda testng tests to jtreg and add them
rfield
parents:
diff
changeset
|
10 |
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
4e29b285c723
8003639: convert lambda testng tests to jtreg and add them
rfield
parents:
diff
changeset
|
11 |
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
4e29b285c723
8003639: convert lambda testng tests to jtreg and add them
rfield
parents:
diff
changeset
|
12 |
* version 2 for more details (a copy is included in the LICENSE file that |
4e29b285c723
8003639: convert lambda testng tests to jtreg and add them
rfield
parents:
diff
changeset
|
13 |
* accompanied this code). |
4e29b285c723
8003639: convert lambda testng tests to jtreg and add them
rfield
parents:
diff
changeset
|
14 |
* |
4e29b285c723
8003639: convert lambda testng tests to jtreg and add them
rfield
parents:
diff
changeset
|
15 |
* You should have received a copy of the GNU General Public License version |
4e29b285c723
8003639: convert lambda testng tests to jtreg and add them
rfield
parents:
diff
changeset
|
16 |
* 2 along with this work; if not, write to the Free Software Foundation, |
4e29b285c723
8003639: convert lambda testng tests to jtreg and add them
rfield
parents:
diff
changeset
|
17 |
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
4e29b285c723
8003639: convert lambda testng tests to jtreg and add them
rfield
parents:
diff
changeset
|
18 |
* |
4e29b285c723
8003639: convert lambda testng tests to jtreg and add them
rfield
parents:
diff
changeset
|
19 |
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
4e29b285c723
8003639: convert lambda testng tests to jtreg and add them
rfield
parents:
diff
changeset
|
20 |
* or visit www.oracle.com if you need additional information or have any |
4e29b285c723
8003639: convert lambda testng tests to jtreg and add them
rfield
parents:
diff
changeset
|
21 |
* questions. |
4e29b285c723
8003639: convert lambda testng tests to jtreg and add them
rfield
parents:
diff
changeset
|
22 |
*/ |
4e29b285c723
8003639: convert lambda testng tests to jtreg and add them
rfield
parents:
diff
changeset
|
23 |
|
4e29b285c723
8003639: convert lambda testng tests to jtreg and add them
rfield
parents:
diff
changeset
|
24 |
package org.openjdk.tests.shapegen; |
4e29b285c723
8003639: convert lambda testng tests to jtreg and add them
rfield
parents:
diff
changeset
|
25 |
|
4e29b285c723
8003639: convert lambda testng tests to jtreg and add them
rfield
parents:
diff
changeset
|
26 |
import org.openjdk.tests.shapegen.ClassCase.Kind; |
4e29b285c723
8003639: convert lambda testng tests to jtreg and add them
rfield
parents:
diff
changeset
|
27 |
|
4e29b285c723
8003639: convert lambda testng tests to jtreg and add them
rfield
parents:
diff
changeset
|
28 |
import java.util.Collection; |
4e29b285c723
8003639: convert lambda testng tests to jtreg and add them
rfield
parents:
diff
changeset
|
29 |
import java.util.Set; |
4e29b285c723
8003639: convert lambda testng tests to jtreg and add them
rfield
parents:
diff
changeset
|
30 |
import java.util.HashSet; |
4e29b285c723
8003639: convert lambda testng tests to jtreg and add them
rfield
parents:
diff
changeset
|
31 |
import java.util.Collections; |
4e29b285c723
8003639: convert lambda testng tests to jtreg and add them
rfield
parents:
diff
changeset
|
32 |
import java.util.ArrayList; |
4e29b285c723
8003639: convert lambda testng tests to jtreg and add them
rfield
parents:
diff
changeset
|
33 |
import java.util.List; |
4e29b285c723
8003639: convert lambda testng tests to jtreg and add them
rfield
parents:
diff
changeset
|
34 |
|
4e29b285c723
8003639: convert lambda testng tests to jtreg and add them
rfield
parents:
diff
changeset
|
35 |
import static org.openjdk.tests.shapegen.ClassCase.Kind.*; |
4e29b285c723
8003639: convert lambda testng tests to jtreg and add them
rfield
parents:
diff
changeset
|
36 |
|
4e29b285c723
8003639: convert lambda testng tests to jtreg and add them
rfield
parents:
diff
changeset
|
37 |
import static java.lang.Math.pow; |
4e29b285c723
8003639: convert lambda testng tests to jtreg and add them
rfield
parents:
diff
changeset
|
38 |
|
4e29b285c723
8003639: convert lambda testng tests to jtreg and add them
rfield
parents:
diff
changeset
|
39 |
/** |
4e29b285c723
8003639: convert lambda testng tests to jtreg and add them
rfield
parents:
diff
changeset
|
40 |
* |
4e29b285c723
8003639: convert lambda testng tests to jtreg and add them
rfield
parents:
diff
changeset
|
41 |
* @author Robert Field |
4e29b285c723
8003639: convert lambda testng tests to jtreg and add them
rfield
parents:
diff
changeset
|
42 |
*/ |
4e29b285c723
8003639: convert lambda testng tests to jtreg and add them
rfield
parents:
diff
changeset
|
43 |
public final class HierarchyGenerator { |
4e29b285c723
8003639: convert lambda testng tests to jtreg and add them
rfield
parents:
diff
changeset
|
44 |
|
4e29b285c723
8003639: convert lambda testng tests to jtreg and add them
rfield
parents:
diff
changeset
|
45 |
private int okcnt = 0; |
4e29b285c723
8003639: convert lambda testng tests to jtreg and add them
rfield
parents:
diff
changeset
|
46 |
private int errcnt = 0; |
4e29b285c723
8003639: convert lambda testng tests to jtreg and add them
rfield
parents:
diff
changeset
|
47 |
private Set<Hierarchy> uniqueOK = new HashSet<>(); |
4e29b285c723
8003639: convert lambda testng tests to jtreg and add them
rfield
parents:
diff
changeset
|
48 |
private Set<Hierarchy> uniqueErr = new HashSet<>(); |
4e29b285c723
8003639: convert lambda testng tests to jtreg and add them
rfield
parents:
diff
changeset
|
49 |
|
4e29b285c723
8003639: convert lambda testng tests to jtreg and add them
rfield
parents:
diff
changeset
|
50 |
/** |
4e29b285c723
8003639: convert lambda testng tests to jtreg and add them
rfield
parents:
diff
changeset
|
51 |
* @param args the command line arguments |
4e29b285c723
8003639: convert lambda testng tests to jtreg and add them
rfield
parents:
diff
changeset
|
52 |
*/ |
4e29b285c723
8003639: convert lambda testng tests to jtreg and add them
rfield
parents:
diff
changeset
|
53 |
public HierarchyGenerator() { |
4e29b285c723
8003639: convert lambda testng tests to jtreg and add them
rfield
parents:
diff
changeset
|
54 |
organize("exhaustive interface", iExhaustive(2)); |
4e29b285c723
8003639: convert lambda testng tests to jtreg and add them
rfield
parents:
diff
changeset
|
55 |
organize("exhaustive class", cExhaustive()); |
4e29b285c723
8003639: convert lambda testng tests to jtreg and add them
rfield
parents:
diff
changeset
|
56 |
organize("shapes interface", iShapes()); |
4e29b285c723
8003639: convert lambda testng tests to jtreg and add them
rfield
parents:
diff
changeset
|
57 |
organize("shapes class/interface", ciShapes()); |
4e29b285c723
8003639: convert lambda testng tests to jtreg and add them
rfield
parents:
diff
changeset
|
58 |
|
4e29b285c723
8003639: convert lambda testng tests to jtreg and add them
rfield
parents:
diff
changeset
|
59 |
System.out.printf("\nExpect OK: %d -- unique %d", okcnt, uniqueOK.size()); |
4e29b285c723
8003639: convert lambda testng tests to jtreg and add them
rfield
parents:
diff
changeset
|
60 |
System.out.printf("\nExpect Error: %d -- unique %d\n", errcnt, uniqueErr.size()); |
4e29b285c723
8003639: convert lambda testng tests to jtreg and add them
rfield
parents:
diff
changeset
|
61 |
} |
4e29b285c723
8003639: convert lambda testng tests to jtreg and add them
rfield
parents:
diff
changeset
|
62 |
|
4e29b285c723
8003639: convert lambda testng tests to jtreg and add them
rfield
parents:
diff
changeset
|
63 |
public Collection<Hierarchy> getOK() { |
4e29b285c723
8003639: convert lambda testng tests to jtreg and add them
rfield
parents:
diff
changeset
|
64 |
return uniqueOK; |
4e29b285c723
8003639: convert lambda testng tests to jtreg and add them
rfield
parents:
diff
changeset
|
65 |
} |
4e29b285c723
8003639: convert lambda testng tests to jtreg and add them
rfield
parents:
diff
changeset
|
66 |
|
4e29b285c723
8003639: convert lambda testng tests to jtreg and add them
rfield
parents:
diff
changeset
|
67 |
public Collection<Hierarchy> getErr() { |
4e29b285c723
8003639: convert lambda testng tests to jtreg and add them
rfield
parents:
diff
changeset
|
68 |
return uniqueErr; |
4e29b285c723
8003639: convert lambda testng tests to jtreg and add them
rfield
parents:
diff
changeset
|
69 |
} |
4e29b285c723
8003639: convert lambda testng tests to jtreg and add them
rfield
parents:
diff
changeset
|
70 |
|
4e29b285c723
8003639: convert lambda testng tests to jtreg and add them
rfield
parents:
diff
changeset
|
71 |
private void organize(String tname, List<Hierarchy> totest) { |
4e29b285c723
8003639: convert lambda testng tests to jtreg and add them
rfield
parents:
diff
changeset
|
72 |
System.out.printf("\nGenerating %s....\n", tname); |
4e29b285c723
8003639: convert lambda testng tests to jtreg and add them
rfield
parents:
diff
changeset
|
73 |
int nodefault = 0; |
4e29b285c723
8003639: convert lambda testng tests to jtreg and add them
rfield
parents:
diff
changeset
|
74 |
List<Hierarchy> ok = new ArrayList<>(); |
4e29b285c723
8003639: convert lambda testng tests to jtreg and add them
rfield
parents:
diff
changeset
|
75 |
List<Hierarchy> err = new ArrayList<>(); |
4e29b285c723
8003639: convert lambda testng tests to jtreg and add them
rfield
parents:
diff
changeset
|
76 |
for (Hierarchy cc : totest) { |
4e29b285c723
8003639: convert lambda testng tests to jtreg and add them
rfield
parents:
diff
changeset
|
77 |
if (cc.anyDefaults()) { |
4e29b285c723
8003639: convert lambda testng tests to jtreg and add them
rfield
parents:
diff
changeset
|
78 |
//System.out.printf(" %s\n", cc); |
4e29b285c723
8003639: convert lambda testng tests to jtreg and add them
rfield
parents:
diff
changeset
|
79 |
if (cc.get_OK()) { |
4e29b285c723
8003639: convert lambda testng tests to jtreg and add them
rfield
parents:
diff
changeset
|
80 |
ok.add(cc); |
4e29b285c723
8003639: convert lambda testng tests to jtreg and add them
rfield
parents:
diff
changeset
|
81 |
} else { |
4e29b285c723
8003639: convert lambda testng tests to jtreg and add them
rfield
parents:
diff
changeset
|
82 |
err.add(cc); |
4e29b285c723
8003639: convert lambda testng tests to jtreg and add them
rfield
parents:
diff
changeset
|
83 |
} |
4e29b285c723
8003639: convert lambda testng tests to jtreg and add them
rfield
parents:
diff
changeset
|
84 |
} else { |
4e29b285c723
8003639: convert lambda testng tests to jtreg and add them
rfield
parents:
diff
changeset
|
85 |
++nodefault; |
4e29b285c723
8003639: convert lambda testng tests to jtreg and add them
rfield
parents:
diff
changeset
|
86 |
} |
4e29b285c723
8003639: convert lambda testng tests to jtreg and add them
rfield
parents:
diff
changeset
|
87 |
} |
4e29b285c723
8003639: convert lambda testng tests to jtreg and add them
rfield
parents:
diff
changeset
|
88 |
|
4e29b285c723
8003639: convert lambda testng tests to jtreg and add them
rfield
parents:
diff
changeset
|
89 |
errcnt += err.size(); |
4e29b285c723
8003639: convert lambda testng tests to jtreg and add them
rfield
parents:
diff
changeset
|
90 |
okcnt += ok.size(); |
4e29b285c723
8003639: convert lambda testng tests to jtreg and add them
rfield
parents:
diff
changeset
|
91 |
uniqueErr.addAll(err); |
4e29b285c723
8003639: convert lambda testng tests to jtreg and add them
rfield
parents:
diff
changeset
|
92 |
uniqueOK.addAll(ok); |
4e29b285c723
8003639: convert lambda testng tests to jtreg and add them
rfield
parents:
diff
changeset
|
93 |
|
4e29b285c723
8003639: convert lambda testng tests to jtreg and add them
rfield
parents:
diff
changeset
|
94 |
System.out.printf(" %5d No default\n %5d Error\n %5d OK\n %5d Total\n", |
4e29b285c723
8003639: convert lambda testng tests to jtreg and add them
rfield
parents:
diff
changeset
|
95 |
nodefault, err.size(), ok.size(), totest.size()); |
4e29b285c723
8003639: convert lambda testng tests to jtreg and add them
rfield
parents:
diff
changeset
|
96 |
} |
4e29b285c723
8003639: convert lambda testng tests to jtreg and add them
rfield
parents:
diff
changeset
|
97 |
|
4e29b285c723
8003639: convert lambda testng tests to jtreg and add them
rfield
parents:
diff
changeset
|
98 |
public List<Hierarchy> iExhaustive(int idepth) { |
4e29b285c723
8003639: convert lambda testng tests to jtreg and add them
rfield
parents:
diff
changeset
|
99 |
List<ClassCase> current = new ArrayList<>(); |
4e29b285c723
8003639: convert lambda testng tests to jtreg and add them
rfield
parents:
diff
changeset
|
100 |
for (int i = 0; i < idepth; ++i) { |
4e29b285c723
8003639: convert lambda testng tests to jtreg and add them
rfield
parents:
diff
changeset
|
101 |
current = ilayer(current); |
4e29b285c723
8003639: convert lambda testng tests to jtreg and add them
rfield
parents:
diff
changeset
|
102 |
} |
4e29b285c723
8003639: convert lambda testng tests to jtreg and add them
rfield
parents:
diff
changeset
|
103 |
return wrapInClassAndHierarchy(current); |
4e29b285c723
8003639: convert lambda testng tests to jtreg and add them
rfield
parents:
diff
changeset
|
104 |
} |
4e29b285c723
8003639: convert lambda testng tests to jtreg and add them
rfield
parents:
diff
changeset
|
105 |
|
4e29b285c723
8003639: convert lambda testng tests to jtreg and add them
rfield
parents:
diff
changeset
|
106 |
private List<ClassCase> ilayer(List<ClassCase> srcLayer) { |
4e29b285c723
8003639: convert lambda testng tests to jtreg and add them
rfield
parents:
diff
changeset
|
107 |
List<ClassCase> lay = new ArrayList<>(); |
4e29b285c723
8003639: convert lambda testng tests to jtreg and add them
rfield
parents:
diff
changeset
|
108 |
for (int i = (int) pow(2, srcLayer.size()) - 1; i >= 0; --i) { |
4e29b285c723
8003639: convert lambda testng tests to jtreg and add them
rfield
parents:
diff
changeset
|
109 |
List<ClassCase> itfs = new ArrayList<>(); |
4e29b285c723
8003639: convert lambda testng tests to jtreg and add them
rfield
parents:
diff
changeset
|
110 |
for (int b = srcLayer.size() - 1; b >= 0; --b) { |
4e29b285c723
8003639: convert lambda testng tests to jtreg and add them
rfield
parents:
diff
changeset
|
111 |
if ((i & (1<<b)) != 0) { |
4e29b285c723
8003639: convert lambda testng tests to jtreg and add them
rfield
parents:
diff
changeset
|
112 |
itfs.add(srcLayer.get(b)); |
4e29b285c723
8003639: convert lambda testng tests to jtreg and add them
rfield
parents:
diff
changeset
|
113 |
} |
4e29b285c723
8003639: convert lambda testng tests to jtreg and add them
rfield
parents:
diff
changeset
|
114 |
} |
4e29b285c723
8003639: convert lambda testng tests to jtreg and add them
rfield
parents:
diff
changeset
|
115 |
lay.add(new ClassCase(IVAC, null, itfs)); |
4e29b285c723
8003639: convert lambda testng tests to jtreg and add them
rfield
parents:
diff
changeset
|
116 |
lay.add(new ClassCase(IPRESENT, null, itfs)); |
4e29b285c723
8003639: convert lambda testng tests to jtreg and add them
rfield
parents:
diff
changeset
|
117 |
lay.add(new ClassCase(IDEFAULT, null, itfs)); |
4e29b285c723
8003639: convert lambda testng tests to jtreg and add them
rfield
parents:
diff
changeset
|
118 |
lay.add(new ClassCase(IDEFAULT, null, itfs)); |
4e29b285c723
8003639: convert lambda testng tests to jtreg and add them
rfield
parents:
diff
changeset
|
119 |
} |
4e29b285c723
8003639: convert lambda testng tests to jtreg and add them
rfield
parents:
diff
changeset
|
120 |
return lay; |
4e29b285c723
8003639: convert lambda testng tests to jtreg and add them
rfield
parents:
diff
changeset
|
121 |
} |
4e29b285c723
8003639: convert lambda testng tests to jtreg and add them
rfield
parents:
diff
changeset
|
122 |
|
4e29b285c723
8003639: convert lambda testng tests to jtreg and add them
rfield
parents:
diff
changeset
|
123 |
public List<Hierarchy> cExhaustive() { |
4e29b285c723
8003639: convert lambda testng tests to jtreg and add them
rfield
parents:
diff
changeset
|
124 |
final Kind[] iKinds = new Kind[]{IDEFAULT, IVAC, IPRESENT, null}; |
4e29b285c723
8003639: convert lambda testng tests to jtreg and add them
rfield
parents:
diff
changeset
|
125 |
final Kind[] cKinds = new Kind[]{CNONE, CABSTRACT, CCONCRETE}; |
4e29b285c723
8003639: convert lambda testng tests to jtreg and add them
rfield
parents:
diff
changeset
|
126 |
List<Hierarchy> totest = new ArrayList<>(); |
4e29b285c723
8003639: convert lambda testng tests to jtreg and add them
rfield
parents:
diff
changeset
|
127 |
for (int i1 = 0; i1 < iKinds.length; ++i1) { |
4e29b285c723
8003639: convert lambda testng tests to jtreg and add them
rfield
parents:
diff
changeset
|
128 |
for (int i2 = 0; i2 < iKinds.length; ++i2) { |
4e29b285c723
8003639: convert lambda testng tests to jtreg and add them
rfield
parents:
diff
changeset
|
129 |
for (int i3 = 0; i3 < iKinds.length; ++i3) { |
4e29b285c723
8003639: convert lambda testng tests to jtreg and add them
rfield
parents:
diff
changeset
|
130 |
for (int c1 = 0; c1 < cKinds.length; ++c1) { |
4e29b285c723
8003639: convert lambda testng tests to jtreg and add them
rfield
parents:
diff
changeset
|
131 |
for (int c2 = 0; c2 < cKinds.length; ++c2) { |
4e29b285c723
8003639: convert lambda testng tests to jtreg and add them
rfield
parents:
diff
changeset
|
132 |
for (int c3 = 0; c3 < cKinds.length; ++c3) { |
4e29b285c723
8003639: convert lambda testng tests to jtreg and add them
rfield
parents:
diff
changeset
|
133 |
totest.add( new Hierarchy( |
4e29b285c723
8003639: convert lambda testng tests to jtreg and add them
rfield
parents:
diff
changeset
|
134 |
new ClassCase(cKinds[c1], |
4e29b285c723
8003639: convert lambda testng tests to jtreg and add them
rfield
parents:
diff
changeset
|
135 |
new ClassCase(cKinds[c2], |
4e29b285c723
8003639: convert lambda testng tests to jtreg and add them
rfield
parents:
diff
changeset
|
136 |
new ClassCase(cKinds[c3], |
4e29b285c723
8003639: convert lambda testng tests to jtreg and add them
rfield
parents:
diff
changeset
|
137 |
null, |
4e29b285c723
8003639: convert lambda testng tests to jtreg and add them
rfield
parents:
diff
changeset
|
138 |
iList(iKinds[i1]) |
4e29b285c723
8003639: convert lambda testng tests to jtreg and add them
rfield
parents:
diff
changeset
|
139 |
), |
4e29b285c723
8003639: convert lambda testng tests to jtreg and add them
rfield
parents:
diff
changeset
|
140 |
iList(iKinds[i2]) |
4e29b285c723
8003639: convert lambda testng tests to jtreg and add them
rfield
parents:
diff
changeset
|
141 |
), |
4e29b285c723
8003639: convert lambda testng tests to jtreg and add them
rfield
parents:
diff
changeset
|
142 |
iList(iKinds[i3]) |
4e29b285c723
8003639: convert lambda testng tests to jtreg and add them
rfield
parents:
diff
changeset
|
143 |
))); |
4e29b285c723
8003639: convert lambda testng tests to jtreg and add them
rfield
parents:
diff
changeset
|
144 |
} |
4e29b285c723
8003639: convert lambda testng tests to jtreg and add them
rfield
parents:
diff
changeset
|
145 |
} |
4e29b285c723
8003639: convert lambda testng tests to jtreg and add them
rfield
parents:
diff
changeset
|
146 |
} |
4e29b285c723
8003639: convert lambda testng tests to jtreg and add them
rfield
parents:
diff
changeset
|
147 |
} |
4e29b285c723
8003639: convert lambda testng tests to jtreg and add them
rfield
parents:
diff
changeset
|
148 |
} |
4e29b285c723
8003639: convert lambda testng tests to jtreg and add them
rfield
parents:
diff
changeset
|
149 |
} |
4e29b285c723
8003639: convert lambda testng tests to jtreg and add them
rfield
parents:
diff
changeset
|
150 |
return totest; |
4e29b285c723
8003639: convert lambda testng tests to jtreg and add them
rfield
parents:
diff
changeset
|
151 |
} |
4e29b285c723
8003639: convert lambda testng tests to jtreg and add them
rfield
parents:
diff
changeset
|
152 |
|
4e29b285c723
8003639: convert lambda testng tests to jtreg and add them
rfield
parents:
diff
changeset
|
153 |
public static final List<ClassCase> EMPTY_LIST = new ArrayList<>(); |
4e29b285c723
8003639: convert lambda testng tests to jtreg and add them
rfield
parents:
diff
changeset
|
154 |
|
4e29b285c723
8003639: convert lambda testng tests to jtreg and add them
rfield
parents:
diff
changeset
|
155 |
private List<ClassCase> iList(Kind kind) { |
4e29b285c723
8003639: convert lambda testng tests to jtreg and add them
rfield
parents:
diff
changeset
|
156 |
if (kind == null) { |
4e29b285c723
8003639: convert lambda testng tests to jtreg and add them
rfield
parents:
diff
changeset
|
157 |
return EMPTY_LIST; |
4e29b285c723
8003639: convert lambda testng tests to jtreg and add them
rfield
parents:
diff
changeset
|
158 |
} else { |
4e29b285c723
8003639: convert lambda testng tests to jtreg and add them
rfield
parents:
diff
changeset
|
159 |
List<ClassCase> itfs = new ArrayList<>(); |
4e29b285c723
8003639: convert lambda testng tests to jtreg and add them
rfield
parents:
diff
changeset
|
160 |
itfs.add(new ClassCase(kind, null, EMPTY_LIST)); |
4e29b285c723
8003639: convert lambda testng tests to jtreg and add them
rfield
parents:
diff
changeset
|
161 |
return itfs; |
4e29b285c723
8003639: convert lambda testng tests to jtreg and add them
rfield
parents:
diff
changeset
|
162 |
} |
4e29b285c723
8003639: convert lambda testng tests to jtreg and add them
rfield
parents:
diff
changeset
|
163 |
} |
4e29b285c723
8003639: convert lambda testng tests to jtreg and add them
rfield
parents:
diff
changeset
|
164 |
|
4e29b285c723
8003639: convert lambda testng tests to jtreg and add them
rfield
parents:
diff
changeset
|
165 |
public List<Hierarchy> ciShapes() { |
4e29b285c723
8003639: convert lambda testng tests to jtreg and add them
rfield
parents:
diff
changeset
|
166 |
return wrapInHierarchy(TTShape.allCases(true)); |
4e29b285c723
8003639: convert lambda testng tests to jtreg and add them
rfield
parents:
diff
changeset
|
167 |
} |
4e29b285c723
8003639: convert lambda testng tests to jtreg and add them
rfield
parents:
diff
changeset
|
168 |
|
4e29b285c723
8003639: convert lambda testng tests to jtreg and add them
rfield
parents:
diff
changeset
|
169 |
public List<Hierarchy> iShapes() { |
4e29b285c723
8003639: convert lambda testng tests to jtreg and add them
rfield
parents:
diff
changeset
|
170 |
return wrapInClassAndHierarchy(TTShape.allCases(false)); |
4e29b285c723
8003639: convert lambda testng tests to jtreg and add them
rfield
parents:
diff
changeset
|
171 |
} |
4e29b285c723
8003639: convert lambda testng tests to jtreg and add them
rfield
parents:
diff
changeset
|
172 |
|
4e29b285c723
8003639: convert lambda testng tests to jtreg and add them
rfield
parents:
diff
changeset
|
173 |
public List<Hierarchy> wrapInClassAndHierarchy(List<ClassCase> ihs) { |
4e29b285c723
8003639: convert lambda testng tests to jtreg and add them
rfield
parents:
diff
changeset
|
174 |
List<Hierarchy> totest = new ArrayList<>(); |
4e29b285c723
8003639: convert lambda testng tests to jtreg and add them
rfield
parents:
diff
changeset
|
175 |
for (ClassCase cc : ihs) { |
4e29b285c723
8003639: convert lambda testng tests to jtreg and add them
rfield
parents:
diff
changeset
|
176 |
List<ClassCase> interfaces = new ArrayList<>(); |
4e29b285c723
8003639: convert lambda testng tests to jtreg and add them
rfield
parents:
diff
changeset
|
177 |
interfaces.add(cc); |
4e29b285c723
8003639: convert lambda testng tests to jtreg and add them
rfield
parents:
diff
changeset
|
178 |
totest.add(new Hierarchy(new ClassCase(CNONE, null, interfaces))); |
4e29b285c723
8003639: convert lambda testng tests to jtreg and add them
rfield
parents:
diff
changeset
|
179 |
} |
4e29b285c723
8003639: convert lambda testng tests to jtreg and add them
rfield
parents:
diff
changeset
|
180 |
return totest; |
4e29b285c723
8003639: convert lambda testng tests to jtreg and add them
rfield
parents:
diff
changeset
|
181 |
} |
4e29b285c723
8003639: convert lambda testng tests to jtreg and add them
rfield
parents:
diff
changeset
|
182 |
|
4e29b285c723
8003639: convert lambda testng tests to jtreg and add them
rfield
parents:
diff
changeset
|
183 |
public List<Hierarchy> wrapInHierarchy(List<ClassCase> ihs) { |
4e29b285c723
8003639: convert lambda testng tests to jtreg and add them
rfield
parents:
diff
changeset
|
184 |
List<Hierarchy> totest = new ArrayList<>(); |
4e29b285c723
8003639: convert lambda testng tests to jtreg and add them
rfield
parents:
diff
changeset
|
185 |
for (ClassCase cc : ihs) { |
4e29b285c723
8003639: convert lambda testng tests to jtreg and add them
rfield
parents:
diff
changeset
|
186 |
totest.add(new Hierarchy(cc)); |
4e29b285c723
8003639: convert lambda testng tests to jtreg and add them
rfield
parents:
diff
changeset
|
187 |
} |
4e29b285c723
8003639: convert lambda testng tests to jtreg and add them
rfield
parents:
diff
changeset
|
188 |
return totest; |
4e29b285c723
8003639: convert lambda testng tests to jtreg and add them
rfield
parents:
diff
changeset
|
189 |
} |
4e29b285c723
8003639: convert lambda testng tests to jtreg and add them
rfield
parents:
diff
changeset
|
190 |
} |