hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aengin...@apache.org
Subject [03/50] [abbrv] hadoop git commit: HADOOP-14218. Replace assertThat with assertTrue in MetricsAsserts.
Date Tue, 04 Apr 2017 19:56:27 GMT
HADOOP-14218. Replace assertThat with assertTrue in MetricsAsserts.


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

Branch: refs/heads/HDFS-7240
Commit: 448ec81fd7133f413853570f116d5f6e16f68bd9
Parents: 9bae672
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:32:40 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/448ec81f/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 a7bbe84..b2f6054 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;
@@ -329,8 +328,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);
   }
 
   /**
@@ -352,8 +351,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