diff --git a/hbase-rest/src/main/java/org/apache/hadoop/hbase/rest/model/NamespacesInstanceModel.java b/hbase-rest/src/main/java/org/apache/hadoop/hbase/rest/model/NamespacesInstanceModel.java index 8b61b2c8ff6..b31ecf96807 100644 --- a/hbase-rest/src/main/java/org/apache/hadoop/hbase/rest/model/NamespacesInstanceModel.java +++ b/hbase-rest/src/main/java/org/apache/hadoop/hbase/rest/model/NamespacesInstanceModel.java @@ -25,10 +25,8 @@ import java.util.HashMap; import java.util.List; import java.util.Map; -import javax.xml.bind.annotation.XmlAccessOrder; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAccessorOrder; import javax.xml.bind.annotation.XmlRootElement; import javax.xml.bind.annotation.XmlTransient; @@ -51,7 +49,6 @@ import org.apache.hadoop.hbase.rest.protobuf */ @XmlRootElement(name="NamespaceProperties") @XmlAccessorType(XmlAccessType.FIELD) -@XmlAccessorOrder(XmlAccessOrder.ALPHABETICAL) @InterfaceAudience.Private public class NamespacesInstanceModel implements Serializable, ProtobufMessageHandler { diff --git a/hbase-rest/src/test/java/org/apache/hadoop/hbase/rest/model/TestModelBase.java b/hbase-rest/src/test/java/org/apache/hadoop/hbase/rest/model/TestModelBase.java index f8add0ac167..293110a63c6 100644 --- a/hbase-rest/src/test/java/org/apache/hadoop/hbase/rest/model/TestModelBase.java +++ b/hbase-rest/src/test/java/org/apache/hadoop/hbase/rest/model/TestModelBase.java @@ -111,11 +111,10 @@ public abstract class TestModelBase extends TestCase { checkModel(fromXML(AS_XML)); } - /** - * COMMENTED OUT FOR NOW. GIVES DIFFERENT RESULTS ON JDK7 vs JDK8 public void testToXML() throws Exception { - assertEquals(AS_XML, toXML(buildTestModel())); - }**/ + // Uses fromXML to check model because XML element ordering can be random. + checkModel(fromXML(toXML(buildTestModel()))); + } public void testToJSON() throws Exception { try { diff --git a/hbase-rest/src/test/java/org/apache/hadoop/hbase/rest/model/TestNamespacesInstanceModel.java b/hbase-rest/src/test/java/org/apache/hadoop/hbase/rest/model/TestNamespacesInstanceModel.java index a13895e936e..c1bf0c82913 100644 --- a/hbase-rest/src/test/java/org/apache/hadoop/hbase/rest/model/TestNamespacesInstanceModel.java +++ b/hbase-rest/src/test/java/org/apache/hadoop/hbase/rest/model/TestNamespacesInstanceModel.java @@ -85,7 +85,7 @@ public class TestNamespacesInstanceModel extends TestModelBase