6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation.
8 *
9 * This code is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 */
23
24 package jdk.vm.ci.hotspot.test;
25
26 import static jdk.vm.ci.hotspot.test.TestHelper.ARRAYS_MAP;
27 import static jdk.vm.ci.hotspot.test.TestHelper.ARRAY_ARRAYS_MAP;
28 import static jdk.vm.ci.hotspot.test.TestHelper.CONSTANT_REFLECTION_PROVIDER;
29 import static jdk.vm.ci.hotspot.test.TestHelper.DUMMY_CLASS_CONSTANT;
30 import static jdk.vm.ci.hotspot.test.TestHelper.DUMMY_CLASS_INSTANCE;
31 import static jdk.vm.ci.hotspot.test.TestHelper.STABLE_ARRAYS_MAP;
32 import static jdk.vm.ci.hotspot.test.TestHelper.STABLE_ARRAY_ARRAYS_MAP;
33 import static jdk.vm.ci.hotspot.test.TestHelper.INSTANCE_STABLE_FIELDS_MAP;
34 import static jdk.vm.ci.hotspot.test.TestHelper.INSTANCE_FIELDS_MAP;
35 import static jdk.vm.ci.hotspot.test.TestHelper.STATIC_FIELDS_MAP;
36 import static jdk.vm.ci.hotspot.test.TestHelper.STATIC_STABLE_FIELDS_MAP;
37
38 import java.util.LinkedList;
39 import jdk.vm.ci.meta.JavaConstant;
40 import org.testng.annotations.DataProvider;
41
42 public class ReadFieldValueDataProvider {
43
44 @DataProvider(name = "readFieldValueDataProvider")
45 public static Object[][] readFieldValueDataProvider() {
46 LinkedList<Object[]> cfgSet = new LinkedList<>();
47 // Testing instance non-stable fields
48 INSTANCE_FIELDS_MAP.entrySet().stream().forEach((instanceField) -> {
49 cfgSet.add(new Object[]{instanceField.getKey(),
50 DUMMY_CLASS_CONSTANT,
51 instanceField.getValue()});
52 });
53 // Testing static non-stable fields with null as receiver
54 STATIC_FIELDS_MAP.entrySet().stream().forEach((staticField) -> {
55 cfgSet.add(new Object[]{staticField.getKey(), null, staticField.getValue()});
56 });
57 // Testing static non-stable fields with JavaConstant.NULL_POINTER as receiver
58 STATIC_FIELDS_MAP.entrySet().stream().forEach((staticField) -> {
59 cfgSet.add(new Object[]{staticField.getKey(),
60 JavaConstant.NULL_POINTER,
61 staticField.getValue()});
|
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation.
8 *
9 * This code is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 */
23
24 package jdk.vm.ci.hotspot.test;
25
26 import jdk.vm.ci.meta.JavaConstant;
27 import org.testng.annotations.DataProvider;
28
29 import java.util.LinkedList;
30
31 import static jdk.vm.ci.hotspot.test.TestHelper.ARRAYS_MAP;
32 import static jdk.vm.ci.hotspot.test.TestHelper.ARRAY_ARRAYS_MAP;
33 import static jdk.vm.ci.hotspot.test.TestHelper.CONSTANT_REFLECTION_PROVIDER;
34 import static jdk.vm.ci.hotspot.test.TestHelper.DUMMY_CLASS_CONSTANT;
35 import static jdk.vm.ci.hotspot.test.TestHelper.DUMMY_CLASS_INSTANCE;
36 import static jdk.vm.ci.hotspot.test.TestHelper.INSTANCE_FIELDS_MAP;
37 import static jdk.vm.ci.hotspot.test.TestHelper.INSTANCE_STABLE_FIELDS_MAP;
38 import static jdk.vm.ci.hotspot.test.TestHelper.STABLE_ARRAYS_MAP;
39 import static jdk.vm.ci.hotspot.test.TestHelper.STABLE_ARRAY_ARRAYS_MAP;
40 import static jdk.vm.ci.hotspot.test.TestHelper.STATIC_FIELDS_MAP;
41 import static jdk.vm.ci.hotspot.test.TestHelper.STATIC_STABLE_FIELDS_MAP;
42
43 public class ReadFieldValueDataProvider {
44
45 @DataProvider(name = "readFieldValueDataProvider")
46 public static Object[][] readFieldValueDataProvider() {
47 LinkedList<Object[]> cfgSet = new LinkedList<>();
48 // Testing instance non-stable fields
49 INSTANCE_FIELDS_MAP.entrySet().stream().forEach((instanceField) -> {
50 cfgSet.add(new Object[]{instanceField.getKey(),
51 DUMMY_CLASS_CONSTANT,
52 instanceField.getValue()});
53 });
54 // Testing static non-stable fields with null as receiver
55 STATIC_FIELDS_MAP.entrySet().stream().forEach((staticField) -> {
56 cfgSet.add(new Object[]{staticField.getKey(), null, staticField.getValue()});
57 });
58 // Testing static non-stable fields with JavaConstant.NULL_POINTER as receiver
59 STATIC_FIELDS_MAP.entrySet().stream().forEach((staticField) -> {
60 cfgSet.add(new Object[]{staticField.getKey(),
61 JavaConstant.NULL_POINTER,
62 staticField.getValue()});
|