< prev index next >

test/compiler/jvmci/jdk.vm.ci.hotspot.test/src/jdk/vm/ci/hotspot/test/ReadConstantFieldValueDataProvider.java

Print this page




  22  */
  23 
  24 package jdk.vm.ci.hotspot.test;
  25 
  26 import static jdk.vm.ci.hotspot.test.TestHelper.DUMMY_CLASS_CONSTANT;
  27 import static jdk.vm.ci.hotspot.test.TestHelper.INSTANCE_STABLE_FIELDS_MAP;
  28 import static jdk.vm.ci.hotspot.test.TestHelper.INSTANCE_FINAL_DEFAULT_FIELDS_MAP;
  29 import static jdk.vm.ci.hotspot.test.TestHelper.INSTANCE_FINAL_FIELDS_MAP;
  30 import static jdk.vm.ci.hotspot.test.TestHelper.INSTANCE_FIELDS_MAP;
  31 import static jdk.vm.ci.hotspot.test.TestHelper.INSTANCE_STABLE_DEFAULT_FIELDS_MAP;
  32 import static jdk.vm.ci.hotspot.test.TestHelper.STATIC_FIELDS_MAP;
  33 import static jdk.vm.ci.hotspot.test.TestHelper.STATIC_FINAL_FIELDS_MAP;
  34 import static jdk.vm.ci.hotspot.test.TestHelper.STATIC_STABLE_FIELDS_MAP;
  35 import static jdk.vm.ci.hotspot.test.TestHelper.STATIC_STABLE_DEFAULT_FIELDS_MAP;
  36 
  37 import java.util.LinkedList;
  38 import jdk.vm.ci.hotspot.HotSpotJVMCIRuntime;
  39 import jdk.vm.ci.meta.JavaConstant;
  40 import org.testng.annotations.DataProvider;
  41 
  42 
  43 public class ReadConstantFieldValueDataProvider {
  44 
  45     @DataProvider(name = "readConstantFieldValueDataProvider")
  46     public static Object[][] readConstantFieldValueDataProvider() {
  47         LinkedList<Object[]> cfgSet = new LinkedList<>();
  48         // Testing static final fields
  49         STATIC_FINAL_FIELDS_MAP.entrySet().stream().forEach((field) -> {
  50             cfgSet.add(new Object[]{field.getKey(), null, field.getValue(), "static final field"});
  51         });
  52         // Testing static stable fields
  53         STATIC_STABLE_FIELDS_MAP.entrySet().stream().forEach((field) -> {
  54             cfgSet.add(new Object[]{field.getKey(), null, field.getValue(), "static stable field"});
  55         });
  56         // Testing instance final non-default fields
  57         INSTANCE_FINAL_FIELDS_MAP.entrySet().stream().forEach((field) -> {
  58             cfgSet.add(new Object[]{field.getKey(),
  59                     DUMMY_CLASS_CONSTANT,
  60                     field.getValue(),
  61                     "instance final field"});
  62         });




  22  */
  23 
  24 package jdk.vm.ci.hotspot.test;
  25 
  26 import static jdk.vm.ci.hotspot.test.TestHelper.DUMMY_CLASS_CONSTANT;
  27 import static jdk.vm.ci.hotspot.test.TestHelper.INSTANCE_STABLE_FIELDS_MAP;
  28 import static jdk.vm.ci.hotspot.test.TestHelper.INSTANCE_FINAL_DEFAULT_FIELDS_MAP;
  29 import static jdk.vm.ci.hotspot.test.TestHelper.INSTANCE_FINAL_FIELDS_MAP;
  30 import static jdk.vm.ci.hotspot.test.TestHelper.INSTANCE_FIELDS_MAP;
  31 import static jdk.vm.ci.hotspot.test.TestHelper.INSTANCE_STABLE_DEFAULT_FIELDS_MAP;
  32 import static jdk.vm.ci.hotspot.test.TestHelper.STATIC_FIELDS_MAP;
  33 import static jdk.vm.ci.hotspot.test.TestHelper.STATIC_FINAL_FIELDS_MAP;
  34 import static jdk.vm.ci.hotspot.test.TestHelper.STATIC_STABLE_FIELDS_MAP;
  35 import static jdk.vm.ci.hotspot.test.TestHelper.STATIC_STABLE_DEFAULT_FIELDS_MAP;
  36 
  37 import java.util.LinkedList;
  38 import jdk.vm.ci.hotspot.HotSpotJVMCIRuntime;
  39 import jdk.vm.ci.meta.JavaConstant;
  40 import org.testng.annotations.DataProvider;
  41 

  42 public class ReadConstantFieldValueDataProvider {
  43 
  44     @DataProvider(name = "readConstantFieldValueDataProvider")
  45     public static Object[][] readConstantFieldValueDataProvider() {
  46         LinkedList<Object[]> cfgSet = new LinkedList<>();
  47         // Testing static final fields
  48         STATIC_FINAL_FIELDS_MAP.entrySet().stream().forEach((field) -> {
  49             cfgSet.add(new Object[]{field.getKey(), null, field.getValue(), "static final field"});
  50         });
  51         // Testing static stable fields
  52         STATIC_STABLE_FIELDS_MAP.entrySet().stream().forEach((field) -> {
  53             cfgSet.add(new Object[]{field.getKey(), null, field.getValue(), "static stable field"});
  54         });
  55         // Testing instance final non-default fields
  56         INSTANCE_FINAL_FIELDS_MAP.entrySet().stream().forEach((field) -> {
  57             cfgSet.add(new Object[]{field.getKey(),
  58                             DUMMY_CLASS_CONSTANT,
  59                             field.getValue(),
  60                             "instance final field"});
  61         });


< prev index next >