ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From yzhda...@apache.org
Subject [05/50] [abbrv] incubator-ignite git commit: #Fixed ClusterMetricsSnapshotSerializeSelfTest test.
Date Thu, 29 Jan 2015 13:33:48 GMT
#Fixed ClusterMetricsSnapshotSerializeSelfTest test.


Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/be6686d8
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/be6686d8
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/be6686d8

Branch: refs/heads/ignite-117
Commit: be6686d8985386df2bb891337e41bfa42d646261
Parents: 6ce0449
Author: nikolay_tikhonov <ntikhonov@gridgain.com>
Authored: Wed Jan 28 18:26:06 2015 +0300
Committer: nikolay_tikhonov <ntikhonov@gridgain.com>
Committed: Wed Jan 28 18:27:14 2015 +0300

----------------------------------------------------------------------
 ...ClusterMetricsSnapshotSerializeSelfTest.java | 52 ++++++++++++++++++--
 1 file changed, 48 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/be6686d8/modules/core/src/test/java/org/apache/ignite/spi/discovery/ClusterMetricsSnapshotSerializeSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/spi/discovery/ClusterMetricsSnapshotSerializeSelfTest.java
b/modules/core/src/test/java/org/apache/ignite/spi/discovery/ClusterMetricsSnapshotSerializeSelfTest.java
index a737a91..5eca33f 100644
--- a/modules/core/src/test/java/org/apache/ignite/spi/discovery/ClusterMetricsSnapshotSerializeSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/spi/discovery/ClusterMetricsSnapshotSerializeSelfTest.java
@@ -21,9 +21,6 @@ import org.apache.ignite.cluster.*;
 import org.apache.ignite.internal.*;
 import org.apache.ignite.testframework.junits.common.*;
 
-import java.io.*;
-import java.util.*;
-
 /**
  * Grid discovery metrics test.
  */
@@ -65,7 +62,7 @@ public class ClusterMetricsSnapshotSerializeSelfTest extends GridCommonAbstractT
 
         assert metrics2 != null;
 
-        assert metrics1.equals(metrics2);
+        assert isMetricsEquals(metrics1, metrics2);
     }
 
     /**
@@ -123,4 +120,51 @@ public class ClusterMetricsSnapshotSerializeSelfTest extends GridCommonAbstractT
 
         return metrics;
     }
+
+    private boolean isMetricsEquals(ClusterMetrics obj, ClusterMetrics obj1) {
+        return
+            obj.getAverageActiveJobs() == obj1.getAverageActiveJobs() &&
+            obj.getAverageCancelledJobs() == obj1.getAverageCancelledJobs() &&
+            obj.getAverageJobExecuteTime() == obj1.getAverageJobExecuteTime() &&
+            obj.getAverageJobWaitTime() == obj1.getAverageJobWaitTime() &&
+            obj.getAverageRejectedJobs() == obj1.getAverageRejectedJobs() &&
+            obj.getAverageWaitingJobs() == obj1.getAverageWaitingJobs() &&
+            obj.getCurrentActiveJobs() == obj1.getCurrentActiveJobs() &&
+            obj.getCurrentCancelledJobs() == obj1.getCurrentCancelledJobs() &&
+            obj.getCurrentIdleTime() == obj1.getCurrentIdleTime() &&
+            obj.getCurrentJobExecuteTime() == obj1.getCurrentJobExecuteTime() &&
+            obj.getCurrentJobWaitTime() == obj1.getCurrentJobWaitTime() &&
+            obj.getCurrentRejectedJobs() == obj1.getCurrentRejectedJobs() &&
+            obj.getCurrentWaitingJobs() == obj1.getCurrentWaitingJobs() &&
+            obj.getCurrentDaemonThreadCount() == obj1.getCurrentDaemonThreadCount() &&
+            obj.getHeapMemoryCommitted() == obj1.getHeapMemoryCommitted() &&
+            obj.getHeapMemoryInitialized() == obj1.getHeapMemoryInitialized() &&
+            obj.getHeapMemoryMaximum() == obj1.getHeapMemoryMaximum() &&
+            obj.getHeapMemoryUsed() == obj1.getHeapMemoryUsed() &&
+            obj.getMaximumActiveJobs() == obj1.getMaximumActiveJobs() &&
+            obj.getMaximumCancelledJobs() == obj1.getMaximumCancelledJobs() &&
+            obj.getMaximumJobExecuteTime() == obj1.getMaximumJobExecuteTime() &&
+            obj.getMaximumJobWaitTime() == obj1.getMaximumJobWaitTime() &&
+            obj.getMaximumRejectedJobs() == obj1.getMaximumRejectedJobs() &&
+            obj.getMaximumWaitingJobs() == obj1.getMaximumWaitingJobs() &&
+            obj.getNonHeapMemoryCommitted() == obj1.getNonHeapMemoryCommitted() &&
+            obj.getNonHeapMemoryInitialized() == obj1.getNonHeapMemoryInitialized() &&
+            obj.getNonHeapMemoryMaximum() == obj1.getNonHeapMemoryMaximum() &&
+            obj.getNonHeapMemoryUsed() == obj1.getNonHeapMemoryUsed() &&
+            obj.getMaximumThreadCount() == obj1.getMaximumThreadCount() &&
+            obj.getStartTime() == obj1.getStartTime() &&
+            obj.getCurrentCpuLoad() == obj1.getCurrentCpuLoad() &&
+            obj.getCurrentThreadCount() == obj1.getCurrentThreadCount() &&
+            obj.getTotalCancelledJobs() == obj1.getTotalCancelledJobs() &&
+            obj.getTotalExecutedJobs() == obj1.getTotalExecutedJobs() &&
+            obj.getTotalIdleTime() == obj1.getTotalIdleTime() &&
+            obj.getTotalRejectedJobs() == obj1.getTotalRejectedJobs() &&
+            obj.getTotalStartedThreadCount() == obj1.getTotalStartedThreadCount() &&
+            obj.getUpTime() == obj1.getUpTime() &&
+            obj.getSentMessagesCount() == obj1.getSentMessagesCount() &&
+            obj.getSentBytesCount() == obj1.getSentBytesCount() &&
+            obj.getReceivedMessagesCount() == obj1.getReceivedMessagesCount() &&
+            obj.getReceivedBytesCount() == obj1.getReceivedBytesCount() &&
+            obj.getOutboundMessagesQueueSize() == obj1.getOutboundMessagesQueueSize();
+    }
 }


Mime
View raw message