changeset 2955:60cff062f66d

6984036: servicetag vendor rebranding issues Summary: Update product_vendor field to use java.vendor system property Reviewed-by: ohair
author mchung
date Wed, 22 Sep 2010 21:44:18 -0700
parents ca630e91d473
children 9a837f410672
files src/share/classes/com/sun/servicetag/Installer.java src/share/classes/com/sun/servicetag/RegistrationData.java src/share/classes/com/sun/servicetag/Registry.java src/share/classes/com/sun/servicetag/SolarisSystemEnvironment.java test/com/sun/servicetag/JavaServiceTagTest.java test/com/sun/servicetag/JavaServiceTagTest1.java test/com/sun/servicetag/Util.java test/com/sun/servicetag/environ.properties test/com/sun/servicetag/missing-environ-field.xml test/com/sun/servicetag/newer-registry-version.xml test/com/sun/servicetag/registration.xml test/com/sun/servicetag/servicetag1.properties test/com/sun/servicetag/servicetag2.properties test/com/sun/servicetag/servicetag3.properties test/com/sun/servicetag/servicetag4.properties test/com/sun/servicetag/servicetag5.properties
diffstat 16 files changed, 35 insertions(+), 27 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/classes/com/sun/servicetag/Installer.java	Thu Sep 23 10:46:03 2010 +0800
+++ b/src/share/classes/com/sun/servicetag/Installer.java	Wed Sep 22 21:44:18 2010 -0700
@@ -43,7 +43,8 @@
         "servicetag.dir.path";
     private static String SVCTAG_ENABLE_REGISTRATION =
         "servicetag.registration.enabled";
-    private final static String SUN_VENDOR = "Sun Microsystems";
+    private final static String ORACLE = "Oracle";
+    private final static String SUN = "Sun Microsystems";
     private final static String REGISTRATION_XML = "registration.xml";
     private final static String SERVICE_TAG_FILE = "servicetag";
     private final static String REGISTRATION_HTML_NAME = "register";
@@ -84,9 +85,10 @@
 
     // Implementation of ServiceTag.getJavaServiceTag(String) method
     static ServiceTag getJavaServiceTag(String source) throws IOException {
-        if (!System.getProperty("java.vendor").startsWith(SUN_VENDOR)) {
+        String vendor = System.getProperty("java.vendor", "");
+        if (!vendor.startsWith(SUN) && !vendor.startsWith(ORACLE)) {
             // Products bundling this implementation may run on
-            // Mac OS which is not a Sun JDK
+            // Mac OS which is not a Sun/Oracle JDK
             return null;
         }
         boolean cleanup = false;
@@ -365,7 +367,7 @@
                                       props.getProperty("servicetag.parent.name"),
                                       props.getProperty("servicetag.parent.urn"),
                                       getProductDefinedId(),
-                                      SUN_VENDOR,
+                                      System.getProperty("java.vendor"),
                                       System.getProperty("os.arch"),
                                       getZoneName(),
                                       svcTagSource);
--- a/src/share/classes/com/sun/servicetag/RegistrationData.java	Thu Sep 23 10:46:03 2010 +0800
+++ b/src/share/classes/com/sun/servicetag/RegistrationData.java	Wed Sep 22 21:44:18 2010 -0700
@@ -80,12 +80,12 @@
  *       <tr>
  *          <td><tt>systemManufacturer</tt></td>
  *          <td>System manufacturer</td>
- *          <td> e.g. Sun Microsystems</td>
+ *          <td> e.g. Oracle Corporation</td>
  *       </tr>
  *       <tr>
  *          <td><tt>cpuManufacturer</tt></td>
  *          <td>CPU manufacturer</td>
- *          <td> e.g. Sun Microsystems</td>
+ *          <td> e.g. Oracle Corporation</td>
  *       </tr>
  *       <tr>
  *          <td><tt>serialNumber</tt></td>
--- a/src/share/classes/com/sun/servicetag/Registry.java	Thu Sep 23 10:46:03 2010 +0800
+++ b/src/share/classes/com/sun/servicetag/Registry.java	Wed Sep 22 21:44:18 2010 -0700
@@ -90,7 +90,7 @@
                 stclient = getWindowsStClientFile();
             } else {
                 if (isVerbose()) {
-                    System.out.println("Running on non-Sun JDK");
+                    System.out.println("Running on unsupported platform");
                 }
             }
             initialized = true;
--- a/src/share/classes/com/sun/servicetag/SolarisSystemEnvironment.java	Thu Sep 23 10:46:03 2010 +0800
+++ b/src/share/classes/com/sun/servicetag/SolarisSystemEnvironment.java	Wed Sep 22 21:44:18 2010 -0700
@@ -44,6 +44,7 @@
  * Solaris implementation of the SystemEnvironment class.
  */
 class SolarisSystemEnvironment extends SystemEnvironment {
+    private static final String ORACLE = "Oracle Corporation";
     SolarisSystemEnvironment() {
         setHostId(getCommandOutput("/usr/bin/hostid"));
         setSystemModel(getCommandOutput("/usr/bin/uname", "-i"));
@@ -59,7 +60,7 @@
     private String getSolarisCpuManufacturer() {
         // not fully accurate, this could be another manufacturer (fujitsu for example)
         if ("sparc".equalsIgnoreCase(System.getProperty("os.arch"))) {
-            return "Sun Microsystems, Inc";
+            return ORACLE;
         }
 
         // if we're here, then we'll try smbios (type 4)
@@ -73,7 +74,7 @@
     private String getSolarisSystemManufacturer() {
         // not fully accurate, this could be another manufacturer (fujitsu for example)
         if ("sparc".equalsIgnoreCase(System.getProperty("os.arch"))) {
-            return "Sun Microsystems, Inc";
+            return ORACLE;
         }
 
         // if we're here, then we'll try smbios (type 1)
@@ -117,7 +118,7 @@
     // ID    SIZE TYPE
     // 1     150  SMB_TYPE_SYSTEM (system information)
     //
-    //   Manufacturer: Sun Microsystems
+    //   Manufacturer: Oracle Corporation
     //   Product: Sun Fire X4600
     //   Version: To Be Filled By O.E.M.
     //   Serial Number: 00:14:4F:45:0C:2A
--- a/test/com/sun/servicetag/JavaServiceTagTest.java	Thu Sep 23 10:46:03 2010 +0800
+++ b/test/com/sun/servicetag/JavaServiceTagTest.java	Wed Sep 22 21:44:18 2010 -0700
@@ -124,8 +124,9 @@
             throw new RuntimeException("Unexpected platform_arch: " +
                 st.getPlatformArch());
         }
+        String vendor = System.getProperty("java.vendor");
         if (!st.getProductVendor().
-                equals("Sun Microsystems")) {
+                equals(vendor)) {
             throw new RuntimeException("Unexpected product_vendor: " +
                 st.getProductVendor());
         }
--- a/test/com/sun/servicetag/JavaServiceTagTest1.java	Thu Sep 23 10:46:03 2010 +0800
+++ b/test/com/sun/servicetag/JavaServiceTagTest1.java	Wed Sep 22 21:44:18 2010 -0700
@@ -196,8 +196,10 @@
             throw new RuntimeException("Unexpected platform_arch: " +
                 st.getPlatformArch());
         }
+
+        String vendor = System.getProperty("java.vendor");
         if (!st.getProductVendor().
-                equals("Sun Microsystems")) {
+                equals(vendor)) {
             throw new RuntimeException("Unexpected product_vendor: " +
                 st.getProductVendor());
         }
--- a/test/com/sun/servicetag/Util.java	Thu Sep 23 10:46:03 2010 +0800
+++ b/test/com/sun/servicetag/Util.java	Wed Sep 22 21:44:18 2010 -0700
@@ -162,6 +162,8 @@
         for (ServiceTag st : svcTags) {
             ServiceTag st1 = stMap.get(st.getInstanceURN());
             if (!matches(st, st1)) {
+                System.err.println(st);
+                System.err.println(st1);
                 throw new RuntimeException("ServiceTag in the registry " +
                     "does not match the one in the map");
             }
--- a/test/com/sun/servicetag/environ.properties	Thu Sep 23 10:46:03 2010 +0800
+++ b/test/com/sun/servicetag/environ.properties	Wed Sep 22 21:44:18 2010 -0700
@@ -4,6 +4,6 @@
 osVersion=5.10
 osArchitecture=sparc
 systemModel=Sun-Fire-V440
-systemManufacturer=Sun Microsystems
-cpuManufacturer=Sun Microsystems
+systemManufacturer=Oracle Corporation
+cpuManufacturer=Oracle Corporation
 serialNumber=BEL078932
--- a/test/com/sun/servicetag/missing-environ-field.xml	Thu Sep 23 10:46:03 2010 +0800
+++ b/test/com/sun/servicetag/missing-environ-field.xml	Wed Sep 22 21:44:18 2010 -0700
@@ -19,7 +19,7 @@
 <product_parent_urn>urn:uuid:fdc90b21-018d-4cab-b866-612c7c119ed3</product_parent_urn>
 <product_parent>Java Platform Standard Edition 6 (Java SE 6)</product_parent>
 <product_defined_inst_id>id=1.6.0-internal-b00 sparc,dir=/myjdk/solaris-sparc</product_defined_inst_id>
-<product_vendor>Sun Microsystems</product_vendor>
+<product_vendor>Oracle Corporation</product_vendor>
 <platform_arch>sparc</platform_arch>
 <timestamp>2007-11-12 06:15:11 GMT</timestamp>
 <container>global</container>
@@ -34,7 +34,7 @@
 <product_parent_urn>urn:uuid:fdc90b21-018d-4cab-b866-612c7c119ed3</product_parent_urn>
 <product_parent>Java Platform Standard Edition 6 (Java SE 6)</product_parent>
 <product_defined_inst_id>id=1.6.0_05-b01 sparc,dir=/myjdk/solaris-i586</product_defined_inst_id>
-<product_vendor>Sun Microsystems</product_vendor>
+<product_vendor>Oracle Corporation</product_vendor>
 <platform_arch>i386</platform_arch>
 <timestamp>2007-11-12 06:15:11 GMT</timestamp>
 <container>global</container>
--- a/test/com/sun/servicetag/newer-registry-version.xml	Thu Sep 23 10:46:03 2010 +0800
+++ b/test/com/sun/servicetag/newer-registry-version.xml	Wed Sep 22 21:44:18 2010 -0700
@@ -20,7 +20,7 @@
 <product_parent_urn>urn:uuid:fdc90b21-018d-4cab-b866-612c7c119ed3</product_parent_urn>
 <product_parent>Java Platform Standard Edition 6 (Java SE 6)</product_parent>
 <product_defined_inst_id>id=1.6.0-internal-b00 sparc,dir=/myjdk/solaris-sparc</product_defined_inst_id>
-<product_vendor>Sun Microsystems</product_vendor>
+<product_vendor>Oracle Corporation</product_vendor>
 <platform_arch>sparc</platform_arch>
 <timestamp>2007-11-13 00:49:01 GMT</timestamp>
 <container>global</container>
--- a/test/com/sun/servicetag/registration.xml	Thu Sep 23 10:46:03 2010 +0800
+++ b/test/com/sun/servicetag/registration.xml	Wed Sep 22 21:44:18 2010 -0700
@@ -7,8 +7,8 @@
 <osVersion>5.10</osVersion>
 <osArchitecture>sparc</osArchitecture>
 <systemModel>Sun-Fire-V440</systemModel>
-<systemManufacturer>Sun Microsystems</systemManufacturer>
-<cpuManufacturer>Sun Microsystems</cpuManufacturer>
+<systemManufacturer>Oracle Corporation</systemManufacturer>
+<cpuManufacturer>Oracle Corporation</cpuManufacturer>
 <serialNumber>BEL078932</serialNumber>
 </environment>
 <registry urn="urn:st:9543ffaa-a4f1-4f77-b2d1-f561922d4e4a" version="1.0">
@@ -20,7 +20,7 @@
 <product_parent_urn>urn:uuid:fdc90b21-018d-4cab-b866-612c7c119ed3</product_parent_urn>
 <product_parent>Java Platform Standard Edition 6 (Java SE 6)</product_parent>
 <product_defined_inst_id>id=1.6.0-internal-b00 sparc,dir=/myjdk/solaris-sparc</product_defined_inst_id>
-<product_vendor>Sun Microsystems</product_vendor>
+<product_vendor>Oracle Corporation</product_vendor>
 <platform_arch>sparc</platform_arch>
 <timestamp>2007-11-13 00:49:01 GMT</timestamp>
 <container>global</container>
@@ -35,7 +35,7 @@
 <product_parent_urn>urn:uuid:fdc90b21-018d-4cab-b866-612c7c119ed3</product_parent_urn>
 <product_parent>Java Platform Standard Edition 6 (Java SE 6)</product_parent>
 <product_defined_inst_id>id=1.6.0_05-b01 i386,dir=/myjdk/solaris-i586</product_defined_inst_id>
-<product_vendor>Sun Microsystems</product_vendor>
+<product_vendor>Oracle Corporation</product_vendor>
 <platform_arch>i386</platform_arch>
 <timestamp>2007-11-13 00:49:01 GMT</timestamp>
 <container>global</container>
@@ -50,7 +50,7 @@
 <product_parent_urn>urn:uuid:596ffcfa-63d5-11d7-9886-ac816a682f92</product_parent_urn>
 <product_parent>Solaris Operating System</product_parent>
 <product_defined_inst_id/>
-<product_vendor>Sun Microsystems</product_vendor>
+<product_vendor>Oracle Corporation</product_vendor>
 <platform_arch>sparc</platform_arch>
 <timestamp>2007-11-13 00:49:01 GMT</timestamp>
 <container>global</container>
--- a/test/com/sun/servicetag/servicetag1.properties	Thu Sep 23 10:46:03 2010 +0800
+++ b/test/com/sun/servicetag/servicetag1.properties	Wed Sep 22 21:44:18 2010 -0700
@@ -5,7 +5,7 @@
 product_parent_urn=urn:uuid:fdc90b21-018d-4cab-b866-612c7c119ed3
 product_parent=Java Platform Standard Edition 6 (Java SE 6)
 product_defined_inst_id=id=1.6.0-internal-b00 sparc,dir=/myjdk/solaris-sparc
-product_vendor=Sun Microsystems
+product_vendor=Oracle Corporation
 platform_arch=sparc
 timestamp=2007-11-12 05:19:40 GMT
 container=global
--- a/test/com/sun/servicetag/servicetag2.properties	Thu Sep 23 10:46:03 2010 +0800
+++ b/test/com/sun/servicetag/servicetag2.properties	Wed Sep 22 21:44:18 2010 -0700
@@ -5,7 +5,7 @@
 product_parent_urn=urn:uuid:fdc90b21-018d-4cab-b866-612c7c119ed3
 product_parent=Java Platform Standard Edition 6 (Java SE 6)
 product_defined_inst_id=id=1.6.0_05-b01 i386,dir=/myjdk/solaris-i586
-product_vendor=Sun Microsystems
+product_vendor=Oracle Corporation
 platform_arch=i386
 timestamp=2007-11-12 06:12:21 GMT
 container=global
--- a/test/com/sun/servicetag/servicetag3.properties	Thu Sep 23 10:46:03 2010 +0800
+++ b/test/com/sun/servicetag/servicetag3.properties	Wed Sep 22 21:44:18 2010 -0700
@@ -5,7 +5,7 @@
 product_parent_urn=urn:uuid:596ffcfa-63d5-11d7-9886-ac816a682f92
 product_parent=Solaris Operating System
 product_defined_inst_id=
-product_vendor=Sun Microsystems
+product_vendor=Oracle Corporation
 platform_arch=sparc
 timestamp=2007-06-20 22:07:11 GMT
 container=global
--- a/test/com/sun/servicetag/servicetag4.properties	Thu Sep 23 10:46:03 2010 +0800
+++ b/test/com/sun/servicetag/servicetag4.properties	Wed Sep 22 21:44:18 2010 -0700
@@ -5,7 +5,7 @@
 product_parent_urn=urn:uuid:fdc90b21-018d-4cab-b866-612c7c119ed3
 product_parent=Java Platform Standard Edition 6 (Java SE 6)
 product_defined_inst_id=id=1.6.0_05-b01 amd64,dir=/myjdk/linux-amd64
-product_vendor=Sun Microsystems
+product_vendor=Oracle Corporation
 platform_arch=x64
 timestamp=2007-12-12 05:19:40 GMT
 container=global
--- a/test/com/sun/servicetag/servicetag5.properties	Thu Sep 23 10:46:03 2010 +0800
+++ b/test/com/sun/servicetag/servicetag5.properties	Wed Sep 22 21:44:18 2010 -0700
@@ -5,7 +5,7 @@
 product_parent_urn=urn:uuid:fdc90b21-018d-4cab-b866-612c7c119ed3
 product_parent=Java Platform Standard Edition 6 (Java SE 6)
 product_defined_inst_id=id=1.6.0_06-b06 i386,dir=/w/mchung/bundles/jdk1.6.0_05/jre
-product_vendor=Sun Microsystems
+product_vendor=Oracle Corporation
 platform_arch=x86
 timestamp=2007-11-29 17:59:42 GMT
 container=global