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 |
/** |
4e29b285c723
8003639: convert lambda testng tests to jtreg and add them
rfield
parents:
diff
changeset
|
25 |
* @test |
4e29b285c723
8003639: convert lambda testng tests to jtreg and add them
rfield
parents:
diff
changeset
|
26 |
* @bug 8003639 |
4e29b285c723
8003639: convert lambda testng tests to jtreg and add them
rfield
parents:
diff
changeset
|
27 |
* @summary convert lambda testng tests to jtreg and add them |
4e29b285c723
8003639: convert lambda testng tests to jtreg and add them
rfield
parents:
diff
changeset
|
28 |
* @run testng MethodReferenceTestVarArgs |
4e29b285c723
8003639: convert lambda testng tests to jtreg and add them
rfield
parents:
diff
changeset
|
29 |
*/ |
4e29b285c723
8003639: convert lambda testng tests to jtreg and add them
rfield
parents:
diff
changeset
|
30 |
|
4e29b285c723
8003639: convert lambda testng tests to jtreg and add them
rfield
parents:
diff
changeset
|
31 |
import org.testng.annotations.Test; |
4e29b285c723
8003639: convert lambda testng tests to jtreg and add them
rfield
parents:
diff
changeset
|
32 |
import java.lang.reflect.Array; |
4e29b285c723
8003639: convert lambda testng tests to jtreg and add them
rfield
parents:
diff
changeset
|
33 |
|
4e29b285c723
8003639: convert lambda testng tests to jtreg and add them
rfield
parents:
diff
changeset
|
34 |
import static org.testng.Assert.assertEquals; |
4e29b285c723
8003639: convert lambda testng tests to jtreg and add them
rfield
parents:
diff
changeset
|
35 |
|
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 |
* @author Robert Field |
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 |
@Test |
4e29b285c723
8003639: convert lambda testng tests to jtreg and add them
rfield
parents:
diff
changeset
|
41 |
public class MethodReferenceTestVarArgs { |
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 |
interface SII { |
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 |
String m(Integer a, Integer b); |
4e29b285c723
8003639: convert lambda testng tests to jtreg and add them
rfield
parents:
diff
changeset
|
46 |
} |
4e29b285c723
8003639: convert lambda testng tests to jtreg and add them
rfield
parents:
diff
changeset
|
47 |
|
4e29b285c723
8003639: convert lambda testng tests to jtreg and add them
rfield
parents:
diff
changeset
|
48 |
interface Siii { |
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 |
String m(int a, int b, int c); |
4e29b285c723
8003639: convert lambda testng tests to jtreg and add them
rfield
parents:
diff
changeset
|
51 |
} |
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 |
interface Si { |
4e29b285c723
8003639: convert lambda testng tests to jtreg and add them
rfield
parents:
diff
changeset
|
54 |
|
4e29b285c723
8003639: convert lambda testng tests to jtreg and add them
rfield
parents:
diff
changeset
|
55 |
String m(int a); |
4e29b285c723
8003639: convert lambda testng tests to jtreg and add them
rfield
parents:
diff
changeset
|
56 |
} |
4e29b285c723
8003639: convert lambda testng tests to jtreg and add them
rfield
parents:
diff
changeset
|
57 |
|
4e29b285c723
8003639: convert lambda testng tests to jtreg and add them
rfield
parents:
diff
changeset
|
58 |
interface SaO { |
4e29b285c723
8003639: convert lambda testng tests to jtreg and add them
rfield
parents:
diff
changeset
|
59 |
|
4e29b285c723
8003639: convert lambda testng tests to jtreg and add them
rfield
parents:
diff
changeset
|
60 |
String m(Object[] a); |
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 |
interface Sai { |
4e29b285c723
8003639: convert lambda testng tests to jtreg and add them
rfield
parents:
diff
changeset
|
64 |
|
4e29b285c723
8003639: convert lambda testng tests to jtreg and add them
rfield
parents:
diff
changeset
|
65 |
String m(int[] a); |
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 |
|
4e29b285c723
8003639: convert lambda testng tests to jtreg and add them
rfield
parents:
diff
changeset
|
68 |
interface Svi { |
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 |
String m(int... va); |
4e29b285c723
8003639: convert lambda testng tests to jtreg and add them
rfield
parents:
diff
changeset
|
71 |
} |
4e29b285c723
8003639: convert lambda testng tests to jtreg and add them
rfield
parents:
diff
changeset
|
72 |
|
4e29b285c723
8003639: convert lambda testng tests to jtreg and add them
rfield
parents:
diff
changeset
|
73 |
// These should be processed as var args |
4e29b285c723
8003639: convert lambda testng tests to jtreg and add them
rfield
parents:
diff
changeset
|
74 |
|
4e29b285c723
8003639: convert lambda testng tests to jtreg and add them
rfield
parents:
diff
changeset
|
75 |
static String xvI(Integer... vi) { |
4e29b285c723
8003639: convert lambda testng tests to jtreg and add them
rfield
parents:
diff
changeset
|
76 |
StringBuilder sb = new StringBuilder("xvI:"); |
4e29b285c723
8003639: convert lambda testng tests to jtreg and add them
rfield
parents:
diff
changeset
|
77 |
for (Integer i : vi) { |
4e29b285c723
8003639: convert lambda testng tests to jtreg and add them
rfield
parents:
diff
changeset
|
78 |
sb.append(i); |
4e29b285c723
8003639: convert lambda testng tests to jtreg and add them
rfield
parents:
diff
changeset
|
79 |
sb.append("-"); |
4e29b285c723
8003639: convert lambda testng tests to jtreg and add them
rfield
parents:
diff
changeset
|
80 |
} |
4e29b285c723
8003639: convert lambda testng tests to jtreg and add them
rfield
parents:
diff
changeset
|
81 |
return sb.toString(); |
4e29b285c723
8003639: convert lambda testng tests to jtreg and add them
rfield
parents:
diff
changeset
|
82 |
} |
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 |
static String xIvI(Integer f, Integer... vi) { |
4e29b285c723
8003639: convert lambda testng tests to jtreg and add them
rfield
parents:
diff
changeset
|
85 |
StringBuilder sb = new StringBuilder("xIvI:"); |
4e29b285c723
8003639: convert lambda testng tests to jtreg and add them
rfield
parents:
diff
changeset
|
86 |
sb.append(f); |
4e29b285c723
8003639: convert lambda testng tests to jtreg and add them
rfield
parents:
diff
changeset
|
87 |
for (Integer i : vi) { |
4e29b285c723
8003639: convert lambda testng tests to jtreg and add them
rfield
parents:
diff
changeset
|
88 |
sb.append(i); |
4e29b285c723
8003639: convert lambda testng tests to jtreg and add them
rfield
parents:
diff
changeset
|
89 |
sb.append("-"); |
4e29b285c723
8003639: convert lambda testng tests to jtreg and add them
rfield
parents:
diff
changeset
|
90 |
} |
4e29b285c723
8003639: convert lambda testng tests to jtreg and add them
rfield
parents:
diff
changeset
|
91 |
return sb.toString(); |
4e29b285c723
8003639: convert lambda testng tests to jtreg and add them
rfield
parents:
diff
changeset
|
92 |
} |
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 |
static String xvi(int... vi) { |
4e29b285c723
8003639: convert lambda testng tests to jtreg and add them
rfield
parents:
diff
changeset
|
95 |
int sum = 0; |
4e29b285c723
8003639: convert lambda testng tests to jtreg and add them
rfield
parents:
diff
changeset
|
96 |
for (int i : vi) { |
4e29b285c723
8003639: convert lambda testng tests to jtreg and add them
rfield
parents:
diff
changeset
|
97 |
sum += i; |
4e29b285c723
8003639: convert lambda testng tests to jtreg and add them
rfield
parents:
diff
changeset
|
98 |
} |
4e29b285c723
8003639: convert lambda testng tests to jtreg and add them
rfield
parents:
diff
changeset
|
99 |
return "xvi:" + sum; |
4e29b285c723
8003639: convert lambda testng tests to jtreg and add them
rfield
parents:
diff
changeset
|
100 |
} |
4e29b285c723
8003639: convert lambda testng tests to jtreg and add them
rfield
parents:
diff
changeset
|
101 |
|
4e29b285c723
8003639: convert lambda testng tests to jtreg and add them
rfield
parents:
diff
changeset
|
102 |
static String xIvi(Integer f, int... vi) { |
4e29b285c723
8003639: convert lambda testng tests to jtreg and add them
rfield
parents:
diff
changeset
|
103 |
int sum = 0; |
4e29b285c723
8003639: convert lambda testng tests to jtreg and add them
rfield
parents:
diff
changeset
|
104 |
for (int i : vi) { |
4e29b285c723
8003639: convert lambda testng tests to jtreg and add them
rfield
parents:
diff
changeset
|
105 |
sum += i; |
4e29b285c723
8003639: convert lambda testng tests to jtreg and add them
rfield
parents:
diff
changeset
|
106 |
} |
4e29b285c723
8003639: convert lambda testng tests to jtreg and add them
rfield
parents:
diff
changeset
|
107 |
return "xIvi:(" + f + ")" + sum; |
4e29b285c723
8003639: convert lambda testng tests to jtreg and add them
rfield
parents:
diff
changeset
|
108 |
} |
4e29b285c723
8003639: convert lambda testng tests to jtreg and add them
rfield
parents:
diff
changeset
|
109 |
|
4e29b285c723
8003639: convert lambda testng tests to jtreg and add them
rfield
parents:
diff
changeset
|
110 |
static String xvO(Object... vi) { |
4e29b285c723
8003639: convert lambda testng tests to jtreg and add them
rfield
parents:
diff
changeset
|
111 |
StringBuilder sb = new StringBuilder("xvO:"); |
4e29b285c723
8003639: convert lambda testng tests to jtreg and add them
rfield
parents:
diff
changeset
|
112 |
for (Object i : vi) { |
4e29b285c723
8003639: convert lambda testng tests to jtreg and add them
rfield
parents:
diff
changeset
|
113 |
if (i.getClass().isArray()) { |
4e29b285c723
8003639: convert lambda testng tests to jtreg and add them
rfield
parents:
diff
changeset
|
114 |
sb.append("["); |
4e29b285c723
8003639: convert lambda testng tests to jtreg and add them
rfield
parents:
diff
changeset
|
115 |
int len = Array.getLength(i); |
4e29b285c723
8003639: convert lambda testng tests to jtreg and add them
rfield
parents:
diff
changeset
|
116 |
for (int x = 0; x < len; ++x) { |
4e29b285c723
8003639: convert lambda testng tests to jtreg and add them
rfield
parents:
diff
changeset
|
117 |
sb.append(Array.get(i, x)); |
4e29b285c723
8003639: convert lambda testng tests to jtreg and add them
rfield
parents:
diff
changeset
|
118 |
sb.append(","); |
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 |
sb.append("]"); |
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 |
} else { |
4e29b285c723
8003639: convert lambda testng tests to jtreg and add them
rfield
parents:
diff
changeset
|
123 |
sb.append(i); |
4e29b285c723
8003639: convert lambda testng tests to jtreg and add them
rfield
parents:
diff
changeset
|
124 |
} |
4e29b285c723
8003639: convert lambda testng tests to jtreg and add them
rfield
parents:
diff
changeset
|
125 |
sb.append("*"); |
4e29b285c723
8003639: convert lambda testng tests to jtreg and add them
rfield
parents:
diff
changeset
|
126 |
} |
4e29b285c723
8003639: convert lambda testng tests to jtreg and add them
rfield
parents:
diff
changeset
|
127 |
return sb.toString(); |
4e29b285c723
8003639: convert lambda testng tests to jtreg and add them
rfield
parents:
diff
changeset
|
128 |
} |
4e29b285c723
8003639: convert lambda testng tests to jtreg and add them
rfield
parents:
diff
changeset
|
129 |
|
4e29b285c723
8003639: convert lambda testng tests to jtreg and add them
rfield
parents:
diff
changeset
|
130 |
public void testVarArgsSuperclass() { |
4e29b285c723
8003639: convert lambda testng tests to jtreg and add them
rfield
parents:
diff
changeset
|
131 |
SII q; |
4e29b285c723
8003639: convert lambda testng tests to jtreg and add them
rfield
parents:
diff
changeset
|
132 |
|
4e29b285c723
8003639: convert lambda testng tests to jtreg and add them
rfield
parents:
diff
changeset
|
133 |
q = MethodReferenceTestVarArgs::xvO; |
4e29b285c723
8003639: convert lambda testng tests to jtreg and add them
rfield
parents:
diff
changeset
|
134 |
assertEquals(q.m(55,66), "xvO:55*66*"); |
4e29b285c723
8003639: convert lambda testng tests to jtreg and add them
rfield
parents:
diff
changeset
|
135 |
} |
4e29b285c723
8003639: convert lambda testng tests to jtreg and add them
rfield
parents:
diff
changeset
|
136 |
|
4e29b285c723
8003639: convert lambda testng tests to jtreg and add them
rfield
parents:
diff
changeset
|
137 |
public void testVarArgsArray() { |
4e29b285c723
8003639: convert lambda testng tests to jtreg and add them
rfield
parents:
diff
changeset
|
138 |
Sai q; |
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 |
q = MethodReferenceTestVarArgs::xvO; |
4e29b285c723
8003639: convert lambda testng tests to jtreg and add them
rfield
parents:
diff
changeset
|
141 |
assertEquals(q.m(new int[] { 55,66 } ), "xvO:[55,66,]*"); |
4e29b285c723
8003639: convert lambda testng tests to jtreg and add them
rfield
parents:
diff
changeset
|
142 |
} |
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 |
public void testVarArgsII() { |
4e29b285c723
8003639: convert lambda testng tests to jtreg and add them
rfield
parents:
diff
changeset
|
145 |
SII q; |
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 |
q = MethodReferenceTestVarArgs::xvI; |
4e29b285c723
8003639: convert lambda testng tests to jtreg and add them
rfield
parents:
diff
changeset
|
148 |
assertEquals(q.m(33,7), "xvI:33-7-"); |
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 |
q = MethodReferenceTestVarArgs::xIvI; |
4e29b285c723
8003639: convert lambda testng tests to jtreg and add them
rfield
parents:
diff
changeset
|
151 |
assertEquals(q.m(50,40), "xIvI:5040-"); |
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 |
q = MethodReferenceTestVarArgs::xvi; |
4e29b285c723
8003639: convert lambda testng tests to jtreg and add them
rfield
parents:
diff
changeset
|
154 |
assertEquals(q.m(100,23), "xvi:123"); |
4e29b285c723
8003639: convert lambda testng tests to jtreg and add them
rfield
parents:
diff
changeset
|
155 |
|
4e29b285c723
8003639: convert lambda testng tests to jtreg and add them
rfield
parents:
diff
changeset
|
156 |
q = MethodReferenceTestVarArgs::xIvi; |
4e29b285c723
8003639: convert lambda testng tests to jtreg and add them
rfield
parents:
diff
changeset
|
157 |
assertEquals(q.m(9,21), "xIvi:(9)21"); |
4e29b285c723
8003639: convert lambda testng tests to jtreg and add them
rfield
parents:
diff
changeset
|
158 |
} |
4e29b285c723
8003639: convert lambda testng tests to jtreg and add them
rfield
parents:
diff
changeset
|
159 |
|
4e29b285c723
8003639: convert lambda testng tests to jtreg and add them
rfield
parents:
diff
changeset
|
160 |
public void testVarArgsiii() { |
4e29b285c723
8003639: convert lambda testng tests to jtreg and add them
rfield
parents:
diff
changeset
|
161 |
Siii q; |
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 |
q = MethodReferenceTestVarArgs::xvI; |
4e29b285c723
8003639: convert lambda testng tests to jtreg and add them
rfield
parents:
diff
changeset
|
164 |
assertEquals(q.m(3, 2, 1), "xvI:3-2-1-"); |
4e29b285c723
8003639: convert lambda testng tests to jtreg and add them
rfield
parents:
diff
changeset
|
165 |
|
4e29b285c723
8003639: convert lambda testng tests to jtreg and add them
rfield
parents:
diff
changeset
|
166 |
q = MethodReferenceTestVarArgs::xIvI; |
4e29b285c723
8003639: convert lambda testng tests to jtreg and add them
rfield
parents:
diff
changeset
|
167 |
assertEquals(q.m(888, 99, 2), "xIvI:88899-2-"); |
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 |
q = MethodReferenceTestVarArgs::xvi; |
4e29b285c723
8003639: convert lambda testng tests to jtreg and add them
rfield
parents:
diff
changeset
|
170 |
assertEquals(q.m(900,80,7), "xvi:987"); |
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 |
q = MethodReferenceTestVarArgs::xIvi; |
4e29b285c723
8003639: convert lambda testng tests to jtreg and add them
rfield
parents:
diff
changeset
|
173 |
assertEquals(q.m(333,27, 72), "xIvi:(333)99"); |
4e29b285c723
8003639: convert lambda testng tests to jtreg and add them
rfield
parents:
diff
changeset
|
174 |
} |
4e29b285c723
8003639: convert lambda testng tests to jtreg and add them
rfield
parents:
diff
changeset
|
175 |
|
4e29b285c723
8003639: convert lambda testng tests to jtreg and add them
rfield
parents:
diff
changeset
|
176 |
public void testVarArgsi() { |
4e29b285c723
8003639: convert lambda testng tests to jtreg and add them
rfield
parents:
diff
changeset
|
177 |
Si q; |
4e29b285c723
8003639: convert lambda testng tests to jtreg and add them
rfield
parents:
diff
changeset
|
178 |
|
4e29b285c723
8003639: convert lambda testng tests to jtreg and add them
rfield
parents:
diff
changeset
|
179 |
q = MethodReferenceTestVarArgs::xvI; |
4e29b285c723
8003639: convert lambda testng tests to jtreg and add them
rfield
parents:
diff
changeset
|
180 |
assertEquals(q.m(3), "xvI:3-"); |
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 |
q = MethodReferenceTestVarArgs::xIvI; |
4e29b285c723
8003639: convert lambda testng tests to jtreg and add them
rfield
parents:
diff
changeset
|
183 |
assertEquals(q.m(888), "xIvI:888"); |
4e29b285c723
8003639: convert lambda testng tests to jtreg and add them
rfield
parents:
diff
changeset
|
184 |
|
4e29b285c723
8003639: convert lambda testng tests to jtreg and add them
rfield
parents:
diff
changeset
|
185 |
q = MethodReferenceTestVarArgs::xvi; |
4e29b285c723
8003639: convert lambda testng tests to jtreg and add them
rfield
parents:
diff
changeset
|
186 |
assertEquals(q.m(900), "xvi:900"); |
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 |
q = MethodReferenceTestVarArgs::xIvi; |
4e29b285c723
8003639: convert lambda testng tests to jtreg and add them
rfield
parents:
diff
changeset
|
189 |
assertEquals(q.m(333), "xIvi:(333)0"); |
4e29b285c723
8003639: convert lambda testng tests to jtreg and add them
rfield
parents:
diff
changeset
|
190 |
} |
4e29b285c723
8003639: convert lambda testng tests to jtreg and add them
rfield
parents:
diff
changeset
|
191 |
|
4e29b285c723
8003639: convert lambda testng tests to jtreg and add them
rfield
parents:
diff
changeset
|
192 |
// These should NOT be processed as var args |
4e29b285c723
8003639: convert lambda testng tests to jtreg and add them
rfield
parents:
diff
changeset
|
193 |
|
4e29b285c723
8003639: convert lambda testng tests to jtreg and add them
rfield
parents:
diff
changeset
|
194 |
public void testVarArgsaO() { |
4e29b285c723
8003639: convert lambda testng tests to jtreg and add them
rfield
parents:
diff
changeset
|
195 |
SaO q; |
4e29b285c723
8003639: convert lambda testng tests to jtreg and add them
rfield
parents:
diff
changeset
|
196 |
|
4e29b285c723
8003639: convert lambda testng tests to jtreg and add them
rfield
parents:
diff
changeset
|
197 |
q = MethodReferenceTestVarArgs::xvO; |
4e29b285c723
8003639: convert lambda testng tests to jtreg and add them
rfield
parents:
diff
changeset
|
198 |
assertEquals(q.m(new String[] { "yo", "there", "dude" }), "xvO:yo*there*dude*"); |
4e29b285c723
8003639: convert lambda testng tests to jtreg and add them
rfield
parents:
diff
changeset
|
199 |
} |
4e29b285c723
8003639: convert lambda testng tests to jtreg and add them
rfield
parents:
diff
changeset
|
200 |
|
4e29b285c723
8003639: convert lambda testng tests to jtreg and add them
rfield
parents:
diff
changeset
|
201 |
|
4e29b285c723
8003639: convert lambda testng tests to jtreg and add them
rfield
parents:
diff
changeset
|
202 |
} |