hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bus...@apache.org
Subject hbase git commit: HBASE-19020 HBase Rest test for xml parsing external entities should not rely on implementation of java XML APIs.
Date Wed, 18 Oct 2017 15:07:21 GMT
Repository: hbase
Updated Branches:
  refs/heads/branch-1 9908edc88 -> 2dce7c172


HBASE-19020 HBase Rest test for xml parsing external entities should not rely on implementation
of java XML APIs.

Signed-off-by: Chia-Ping Tsai <chia7712@gmail.com>


Project: http://git-wip-us.apache.org/repos/asf/hbase/repo
Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/2dce7c17
Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/2dce7c17
Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/2dce7c17

Branch: refs/heads/branch-1
Commit: 2dce7c17294e9253a74cff0f902f810898fd738c
Parents: 9908edc
Author: Sean Busbey <busbey@apache.org>
Authored: Mon Oct 16 16:11:39 2017 -0500
Committer: Sean Busbey <busbey@apache.org>
Committed: Wed Oct 18 09:59:45 2017 -0500

----------------------------------------------------------------------
 .../apache/hadoop/hbase/rest/client/TestXmlParsing.java   | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/2dce7c17/hbase-rest/src/test/java/org/apache/hadoop/hbase/rest/client/TestXmlParsing.java
----------------------------------------------------------------------
diff --git a/hbase-rest/src/test/java/org/apache/hadoop/hbase/rest/client/TestXmlParsing.java
b/hbase-rest/src/test/java/org/apache/hadoop/hbase/rest/client/TestXmlParsing.java
index 5e259f2..586e33c 100644
--- a/hbase-rest/src/test/java/org/apache/hadoop/hbase/rest/client/TestXmlParsing.java
+++ b/hbase-rest/src/test/java/org/apache/hadoop/hbase/rest/client/TestXmlParsing.java
@@ -23,7 +23,10 @@ import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.when;
 
 import java.io.IOException;
+import javax.xml.bind.UnmarshalException;
 
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
 import org.apache.hadoop.hbase.HBaseConfiguration;
 import org.apache.hadoop.hbase.rest.Constants;
 import org.apache.hadoop.hbase.rest.model.StorageClusterVersionModel;
@@ -37,6 +40,7 @@ import org.junit.experimental.categories.Category;
  */
 @Category(SmallTests.class)
 public class TestXmlParsing {
+  private static final Log LOG = LogFactory.getLog(TestXmlParsing.class);
 
   @Test
   public void testParsingClusterVersion() throws Exception {
@@ -68,8 +72,12 @@ public class TestXmlParsing {
       admin.getClusterVersion();
       fail("Expected getClusterVersion() to throw an exception");
     } catch (IOException e) {
+      assertEquals("Cause of exception ought to be a failure to parse the stream due to our
" +
+          "invalid external entity. Make sure this isn't just a false positive due to " +
+          "implementation. see HBASE-19020.", UnmarshalException.class, e.getCause().getClass());
       final String exceptionText = StringUtils.stringifyException(e);
-      final String expectedText = "The entity \"xee\" was referenced, but not declared.";
+      final String expectedText = "\"xee\"";
+      LOG.debug("exception text: '" + exceptionText + "'", e);
       assertTrue("Exception does not contain expected text", exceptionText.contains(expectedText));
     }
   }


Mime
View raw message