hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aajis...@apache.org
Subject hadoop git commit: HADOOP-14218. Replace assertThat with assertTrue in MetricsAsserts.
Date Tue, 28 Mar 2017 05:33:51 GMT
Repository: hadoop
Updated Branches:
  refs/heads/branch-2 b7b9d7452 -> 643298b28


HADOOP-14218. Replace assertThat with assertTrue in MetricsAsserts.

(cherry picked from commit 448ec81fd7133f413853570f116d5f6e16f68bd9)


Project: http://git-wip-us.apache.org/repos/asf/hadoop/repo
Commit: http://git-wip-us.apache.org/repos/asf/hadoop/commit/643298b2
Tree: http://git-wip-us.apache.org/repos/asf/hadoop/tree/643298b2
Diff: http://git-wip-us.apache.org/repos/asf/hadoop/diff/643298b2

Branch: refs/heads/branch-2
Commit: 643298b282894662c1a0a0ecd68c531c65d21a13
Parents: b7b9d74
Author: Akira Ajisaka <aajisaka@apache.org>
Authored: Tue Mar 28 14:32:40 2017 +0900
Committer: Akira Ajisaka <aajisaka@apache.org>
Committed: Tue Mar 28 14:33:36 2017 +0900

----------------------------------------------------------------------
 .../test/java/org/apache/hadoop/test/MetricsAsserts.java    | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hadoop/blob/643298b2/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/test/MetricsAsserts.java
----------------------------------------------------------------------
diff --git a/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/test/MetricsAsserts.java
b/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/test/MetricsAsserts.java
index 5d87b07..d84c9c8 100644
--- a/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/test/MetricsAsserts.java
+++ b/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/test/MetricsAsserts.java
@@ -27,7 +27,6 @@ import static org.mockito.AdditionalMatchers.geq;
 import static org.mockito.Mockito.*;
 
 import org.mockito.stubbing.Answer;
-import org.mockito.internal.matchers.GreaterThan;
 import org.mockito.invocation.InvocationOnMock;
 
 import org.mockito.ArgumentCaptor;
@@ -322,8 +321,8 @@ public class MetricsAsserts {
    */
   public static void assertCounterGt(String name, long greater,
                                      MetricsRecordBuilder rb) {
-    Assert.assertThat("Bad value for metric " + name, getLongCounter(name, rb),
-        new GreaterThan<Long>(greater));
+    Assert.assertTrue("Bad value for metric " + name,
+        getLongCounter(name, rb) > greater);
   }
 
   /**
@@ -345,8 +344,8 @@ public class MetricsAsserts {
    */
   public static void assertGaugeGt(String name, double greater,
                                    MetricsRecordBuilder rb) {
-    Assert.assertThat("Bad value for metric " + name, getDoubleGauge(name, rb),
-        new GreaterThan<Double>(greater));
+    Assert.assertTrue("Bad value for metric " + name,
+        getDoubleGauge(name, rb) > greater);
   }
 
   /**


---------------------------------------------------------------------
To unsubscribe, e-mail: common-commits-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-commits-help@hadoop.apache.org


Mime
View raw message