< prev index next >

test/hotspot/jtreg/vmTestbase/PropertyResolvingWrapper.java

Print this page
rev 59189 : imported patch hotspot


  39  * If one of properties can't be resolved, {@link Error} will be thrown.
  40  */
  41 public class PropertyResolvingWrapper {
  42     private static final Properties properties;
  43     static {
  44         Properties p = System.getProperties();
  45         String name = p.getProperty("os.name");
  46         String arch = p.getProperty("os.arch");
  47         String family;
  48         String simple_arch;
  49 
  50         // copy from jtreg/src/share/classes/com/sun/javatest/regtest/config/OS.java
  51         if (name.startsWith("AIX"))
  52             family = "aix";
  53         else if (name.startsWith("Linux"))
  54             family = "linux";
  55         else if (name.startsWith("Mac") || name.startsWith("Darwin"))
  56             family = "mac";
  57         else if (name.startsWith("OS400") || name.startsWith("OS/400") )
  58             family = "os400";
  59         else if (name.startsWith("SunOS") || name.startsWith("Solaris"))
  60             family = "solaris";
  61         else if (name.startsWith("Windows"))
  62             family = "windows";
  63         else
  64             family = name.replaceFirst("^([^ ]+).*", "$1"); // use first word of name
  65 
  66         if (arch.contains("64")
  67                  && !arch.equals("ia64")
  68                  && !arch.equals("ppc64")
  69                  && !arch.equals("ppc64le")
  70                  && !arch.equals("zArch_64")
  71                  && !arch.equals("aarch64"))
  72              simple_arch = "x64";
  73         else if (arch.contains("86"))
  74             simple_arch = "i586";
  75         else if (arch.equals("ppc") || arch.equals("powerpc"))
  76             simple_arch = "ppc";
  77         else if (arch.equals("s390x") || arch.equals("zArch_64"))
  78             simple_arch = "s390x";
  79         else
  80             simple_arch = arch;




  39  * If one of properties can't be resolved, {@link Error} will be thrown.
  40  */
  41 public class PropertyResolvingWrapper {
  42     private static final Properties properties;
  43     static {
  44         Properties p = System.getProperties();
  45         String name = p.getProperty("os.name");
  46         String arch = p.getProperty("os.arch");
  47         String family;
  48         String simple_arch;
  49 
  50         // copy from jtreg/src/share/classes/com/sun/javatest/regtest/config/OS.java
  51         if (name.startsWith("AIX"))
  52             family = "aix";
  53         else if (name.startsWith("Linux"))
  54             family = "linux";
  55         else if (name.startsWith("Mac") || name.startsWith("Darwin"))
  56             family = "mac";
  57         else if (name.startsWith("OS400") || name.startsWith("OS/400") )
  58             family = "os400";


  59         else if (name.startsWith("Windows"))
  60             family = "windows";
  61         else
  62             family = name.replaceFirst("^([^ ]+).*", "$1"); // use first word of name
  63 
  64         if (arch.contains("64")
  65                  && !arch.equals("ia64")
  66                  && !arch.equals("ppc64")
  67                  && !arch.equals("ppc64le")
  68                  && !arch.equals("zArch_64")
  69                  && !arch.equals("aarch64"))
  70              simple_arch = "x64";
  71         else if (arch.contains("86"))
  72             simple_arch = "i586";
  73         else if (arch.equals("ppc") || arch.equals("powerpc"))
  74             simple_arch = "ppc";
  75         else if (arch.equals("s390x") || arch.equals("zArch_64"))
  76             simple_arch = "s390x";
  77         else
  78             simple_arch = arch;


< prev index next >