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
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()});
|
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()});
|