hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cli...@apache.org
Subject hadoop git commit: HDFS-12758. Ozone: Correcting assertEquals argument order in test cases. Contributed by Bharat Viswanadham.
Date Thu, 09 Nov 2017 04:59:02 GMT
Repository: hadoop
Updated Branches:
  refs/heads/HDFS-7240 9fe644966 -> 6c62d74d5


HDFS-12758. Ozone: Correcting assertEquals argument order in test cases. Contributed by Bharat
Viswanadham.


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

Branch: refs/heads/HDFS-7240
Commit: 6c62d74d50e1e0b19c1816b1a9d9eeed162fe847
Parents: 9fe6449
Author: Chen Liang <cliang@apache.org>
Authored: Wed Nov 8 20:58:13 2017 -0800
Committer: Chen Liang <cliang@apache.org>
Committed: Wed Nov 8 20:58:13 2017 -0800

----------------------------------------------------------------------
 .../org/apache/hadoop/ozone/TestOzoneAcls.java  | 30 ++++++++++----------
 .../ozone/container/ContainerTestHelper.java    |  2 +-
 .../ozone/container/common/TestEndPoint.java    | 12 ++++----
 .../common/impl/TestContainerPersistence.java   | 24 ++++++++--------
 .../TestContainerReplicationManager.java        |  2 +-
 .../transport/server/TestContainerServer.java   |  2 +-
 .../hadoop/ozone/ksm/TestKeySpaceManager.java   | 12 ++++----
 .../ozone/scm/TestXceiverClientManager.java     | 22 +++++++-------
 .../ozone/web/TestDistributedOzoneVolumes.java  | 24 ++++++++--------
 .../hadoop/ozone/web/client/TestKeys.java       | 16 +++++------
 .../fs/ozone/TestOzoneFileInterfaces.java       | 10 +++----
 11 files changed, 78 insertions(+), 78 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hadoop/blob/6c62d74d/hadoop-hdfs-project/hadoop-hdfs-client/src/test/java/org/apache/hadoop/ozone/TestOzoneAcls.java
----------------------------------------------------------------------
diff --git a/hadoop-hdfs-project/hadoop-hdfs-client/src/test/java/org/apache/hadoop/ozone/TestOzoneAcls.java
b/hadoop-hdfs-project/hadoop-hdfs-client/src/test/java/org/apache/hadoop/ozone/TestOzoneAcls.java
index c70b75e..03c45c5 100644
--- a/hadoop-hdfs-project/hadoop-hdfs-client/src/test/java/org/apache/hadoop/ozone/TestOzoneAcls.java
+++ b/hadoop-hdfs-project/hadoop-hdfs-client/src/test/java/org/apache/hadoop/ozone/TestOzoneAcls.java
@@ -109,33 +109,33 @@ public class TestOzoneAcls {
   public void testAclValues() {
     OzoneAcl acl = OzoneAcl.parseAcl("user:bilbo:rw");
     assertEquals(acl.getName(), "bilbo");
-    assertEquals(acl.getRights(), OzoneAcl.OzoneACLRights.READ_WRITE);
-    assertEquals(acl.getType(), OzoneAcl.OzoneACLType.USER);
+    assertEquals(OzoneAcl.OzoneACLRights.READ_WRITE, acl.getRights());
+    assertEquals(OzoneAcl.OzoneACLType.USER, acl.getType());
 
     acl = OzoneAcl.parseAcl("user:bilbo:wr");
-    assertEquals(acl.getName(), "bilbo");
-    assertEquals(acl.getRights(), OzoneAcl.OzoneACLRights.READ_WRITE);
-    assertEquals(acl.getType(), OzoneAcl.OzoneACLType.USER);
+    assertEquals("bilbo", acl.getName());
+    assertEquals(OzoneAcl.OzoneACLRights.READ_WRITE, acl.getRights());
+    assertEquals(OzoneAcl.OzoneACLType.USER, acl.getType());
 
     acl = OzoneAcl.parseAcl("user:bilbo:r");
-    assertEquals(acl.getName(), "bilbo");
-    assertEquals(acl.getRights(), OzoneAcl.OzoneACLRights.READ);
-    assertEquals(acl.getType(), OzoneAcl.OzoneACLType.USER);
+    assertEquals("bilbo", acl.getName());
+    assertEquals(OzoneAcl.OzoneACLRights.READ, acl.getRights());
+    assertEquals(OzoneAcl.OzoneACLType.USER, acl.getType());
 
     acl = OzoneAcl.parseAcl("user:bilbo:w");
-    assertEquals(acl.getName(), "bilbo");
-    assertEquals(acl.getRights(), OzoneAcl.OzoneACLRights.WRITE);
-    assertEquals(acl.getType(), OzoneAcl.OzoneACLType.USER);
+    assertEquals("bilbo", acl.getName());
+    assertEquals(OzoneAcl.OzoneACLRights.WRITE, acl.getRights());
+    assertEquals(OzoneAcl.OzoneACLType.USER, acl.getType());
 
     acl = OzoneAcl.parseAcl("group:hobbit:wr");
     assertEquals(acl.getName(), "hobbit");
-    assertEquals(acl.getRights(), OzoneAcl.OzoneACLRights.READ_WRITE);
-    assertEquals(acl.getType(), OzoneAcl.OzoneACLType.GROUP);
+    assertEquals(OzoneAcl.OzoneACLRights.READ_WRITE, acl.getRights());
+    assertEquals(OzoneAcl.OzoneACLType.GROUP, acl.getType());
 
     acl = OzoneAcl.parseAcl("world::wr");
     assertEquals(acl.getName(), "");
-    assertEquals(acl.getRights(), OzoneAcl.OzoneACLRights.READ_WRITE);
-    assertEquals(acl.getType(), OzoneAcl.OzoneACLType.WORLD);
+    assertEquals(OzoneAcl.OzoneACLRights.READ_WRITE, acl.getRights());
+    assertEquals(OzoneAcl.OzoneACLType.WORLD, acl.getType());
   }
 
 }

http://git-wip-us.apache.org/repos/asf/hadoop/blob/6c62d74d/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/ozone/container/ContainerTestHelper.java
----------------------------------------------------------------------
diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/ozone/container/ContainerTestHelper.java
b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/ozone/container/ContainerTestHelper.java
index 8fbdb20..b03021d 100644
--- a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/ozone/container/ContainerTestHelper.java
+++ b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/ozone/container/ContainerTestHelper.java
@@ -488,7 +488,7 @@ public final class ContainerTestHelper {
   public static void verifyGetKey(ContainerCommandRequestProto request,
       ContainerCommandResponseProto response) {
     Assert.assertEquals(request.getTraceID(), response.getTraceID());
-    Assert.assertEquals(response.getResult(), ContainerProtos.Result.SUCCESS);
+    Assert.assertEquals(ContainerProtos.Result.SUCCESS, response.getResult());
     ContainerProtos.PutKeyRequestProto putKey = request.getPutKey();
     ContainerProtos.GetKeyRequestProto getKey = request.getGetKey();
     Assert.assertEquals(putKey.getKeyData().getChunksCount(),

http://git-wip-us.apache.org/repos/asf/hadoop/blob/6c62d74d/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/ozone/container/common/TestEndPoint.java
----------------------------------------------------------------------
diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/ozone/container/common/TestEndPoint.java
b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/ozone/container/common/TestEndPoint.java
index 820d205..fc5f25f 100644
--- a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/ozone/container/common/TestEndPoint.java
+++ b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/ozone/container/common/TestEndPoint.java
@@ -119,10 +119,10 @@ public class TestEndPoint {
       SCMVersionResponseProto responseProto = rpcEndPoint.getEndPoint()
           .getVersion(null);
       Assert.assertNotNull(responseProto);
-      Assert.assertEquals(responseProto.getKeys(0).getKey(),
-          VersionInfo.DESCRIPTION_KEY);
-      Assert.assertEquals(responseProto.getKeys(0).getValue(),
-          VersionInfo.getLatestVersion().getDescription());
+      Assert.assertEquals(VersionInfo.DESCRIPTION_KEY,
+          responseProto.getKeys(0).getKey());
+      Assert.assertEquals(VersionInfo.getLatestVersion().getDescription(),
+          responseProto.getKeys(0).getValue());
     }
   }
 
@@ -212,8 +212,8 @@ public class TestEndPoint {
       SCMRegisteredCmdResponseProto responseProto = rpcEndPoint.getEndPoint()
           .register(nodeToRegister, scmAddressArray);
       Assert.assertNotNull(responseProto);
-      Assert.assertEquals(responseProto.getDatanodeUUID(),
-          nodeToRegister.getDatanodeUuid());
+      Assert.assertEquals(nodeToRegister.getDatanodeUuid(),
+          responseProto.getDatanodeUUID());
       Assert.assertNotNull(responseProto.getClusterID());
     }
   }

http://git-wip-us.apache.org/repos/asf/hadoop/blob/6c62d74d/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/ozone/container/common/impl/TestContainerPersistence.java
----------------------------------------------------------------------
diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/ozone/container/common/impl/TestContainerPersistence.java
b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/ozone/container/common/impl/TestContainerPersistence.java
index 5cfd3e5..16f6e68 100644
--- a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/ozone/container/common/impl/TestContainerPersistence.java
+++ b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/ozone/container/common/impl/TestContainerPersistence.java
@@ -773,10 +773,10 @@ public class TestContainerPersistence {
     // Verify in-memory map
     ContainerData actualNewData = containerManager.getContainerMap()
         .get(containerName).getContainer();
-    Assert.assertEquals(actualNewData.getAllMetadata().get("VOLUME"),
-        "shire_new");
-    Assert.assertEquals(actualNewData.getAllMetadata().get("owner"),
-        "bilbo_new");
+    Assert.assertEquals("shire_new",
+        actualNewData.getAllMetadata().get("VOLUME"));
+    Assert.assertEquals("bilbo_new",
+        actualNewData.getAllMetadata().get("owner"));
 
     // Verify container data on disk
     File newContainerFile = containerManager.getContainerFile(actualNewData);
@@ -791,10 +791,10 @@ public class TestContainerPersistence {
           ContainerProtos.ContainerData.parseDelimitedFrom(newIn);
       ContainerData actualContainerData = ContainerData
           .getFromProtBuf(actualContainerDataProto, conf);
-      Assert.assertEquals(actualContainerData.getAllMetadata().get("VOLUME"),
-          "shire_new");
-      Assert.assertEquals(actualContainerData.getAllMetadata().get("owner"),
-          "bilbo_new");
+      Assert.assertEquals("shire_new",
+          actualContainerData.getAllMetadata().get("VOLUME"));
+      Assert.assertEquals("bilbo_new",
+          actualContainerData.getAllMetadata().get("owner"));
     }
 
     // Test force update flag.
@@ -818,10 +818,10 @@ public class TestContainerPersistence {
     // Verify in-memory map
     actualNewData = containerManager.getContainerMap()
         .get(containerName).getContainer();
-    Assert.assertEquals(actualNewData.getAllMetadata().get("VOLUME"),
-        "shire_new_1");
-    Assert.assertEquals(actualNewData.getAllMetadata().get("owner"),
-        "bilbo_new_1");
+    Assert.assertEquals("shire_new_1",
+        actualNewData.getAllMetadata().get("VOLUME"));
+    Assert.assertEquals("bilbo_new_1",
+        actualNewData.getAllMetadata().get("owner"));
 
     // Update a non-existing container
     exception.expect(StorageContainerException.class);

http://git-wip-us.apache.org/repos/asf/hadoop/blob/6c62d74d/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/ozone/container/replication/TestContainerReplicationManager.java
----------------------------------------------------------------------
diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/ozone/container/replication/TestContainerReplicationManager.java
b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/ozone/container/replication/TestContainerReplicationManager.java
index 8394a2c..ab4b9b6 100644
--- a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/ozone/container/replication/TestContainerReplicationManager.java
+++ b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/ozone/container/replication/TestContainerReplicationManager.java
@@ -165,7 +165,7 @@ public class TestContainerReplicationManager {
         .getValue() == 1);
     Assert.assertEquals(singleNodeContainer, containers.get(0).getKey());
     int count = containers.get(0).getValue();
-    Assert.assertEquals(count, 1L);
+    Assert.assertEquals(1L, count);
   }
 
   @Test

http://git-wip-us.apache.org/repos/asf/hadoop/blob/6c62d74d/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/ozone/container/transport/server/TestContainerServer.java
----------------------------------------------------------------------
diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/ozone/container/transport/server/TestContainerServer.java
b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/ozone/container/transport/server/TestContainerServer.java
index 81ccf13..51f68ac 100644
--- a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/ozone/container/transport/server/TestContainerServer.java
+++ b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/ozone/container/transport/server/TestContainerServer.java
@@ -216,7 +216,7 @@ public class TestContainerServer {
           ContainerTestHelper.getCreateContainerRequest(containerName);
       ContainerCommandResponseProto response = client.sendCommand(request);
       Assert.assertTrue(request.getTraceID().equals(response.getTraceID()));
-      Assert.assertEquals(response.getResult(), ContainerProtos.Result.SUCCESS);
+      Assert.assertEquals(ContainerProtos.Result.SUCCESS, response.getResult());
       Assert.assertTrue(dispatcher.
                           getContainerMetrics().
                             getContainerOpsMetrics(

http://git-wip-us.apache.org/repos/asf/hadoop/blob/6c62d74d/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/ozone/ksm/TestKeySpaceManager.java
----------------------------------------------------------------------
diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/ozone/ksm/TestKeySpaceManager.java
b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/ozone/ksm/TestKeySpaceManager.java
index ba77de5..5598608 100644
--- a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/ozone/ksm/TestKeySpaceManager.java
+++ b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/ozone/ksm/TestKeySpaceManager.java
@@ -184,8 +184,8 @@ public class TestKeySpaceManager {
 
     VolumeArgs getVolumeArgs = new VolumeArgs(volumeName, userArgs);
     VolumeInfo retVolumeInfo = storageHandler.getVolumeInfo(getVolumeArgs);
-    Assert.assertEquals(retVolumeInfo.getQuota().sizeInBytes(),
-                                              createQuota.sizeInBytes());
+    Assert.assertEquals(createQuota.sizeInBytes(),
+        retVolumeInfo.getQuota().sizeInBytes());
 
     // Set a new quota and test it
     OzoneQuota setQuota =
@@ -194,15 +194,15 @@ public class TestKeySpaceManager {
     storageHandler.setVolumeQuota(createVolumeArgs, false);
     getVolumeArgs = new VolumeArgs(volumeName, userArgs);
     retVolumeInfo = storageHandler.getVolumeInfo(getVolumeArgs);
-    Assert.assertEquals(retVolumeInfo.getQuota().sizeInBytes(),
-                                                setQuota.sizeInBytes());
+    Assert.assertEquals(setQuota.sizeInBytes(),
+        retVolumeInfo.getQuota().sizeInBytes());
 
     // Remove the quota and test it again
     storageHandler.setVolumeQuota(createVolumeArgs, true);
     getVolumeArgs = new VolumeArgs(volumeName, userArgs);
     retVolumeInfo = storageHandler.getVolumeInfo(getVolumeArgs);
-    Assert.assertEquals(retVolumeInfo.getQuota().sizeInBytes(),
-        OzoneConsts.MAX_QUOTA_IN_BYTES);
+    Assert.assertEquals(OzoneConsts.MAX_QUOTA_IN_BYTES,
+        retVolumeInfo.getQuota().sizeInBytes());
     Assert.assertEquals(numVolumeCreateFail,
         ksmMetrics.getNumVolumeCreateFails());
     Assert.assertEquals(numVolumeInfoFail,

http://git-wip-us.apache.org/repos/asf/hadoop/blob/6c62d74d/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/ozone/scm/TestXceiverClientManager.java
----------------------------------------------------------------------
diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/ozone/scm/TestXceiverClientManager.java
b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/ozone/scm/TestXceiverClientManager.java
index 14c930f..97ff76f 100644
--- a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/ozone/scm/TestXceiverClientManager.java
+++ b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/ozone/scm/TestXceiverClientManager.java
@@ -79,7 +79,7 @@ public class TestXceiverClientManager {
         storageContainerLocationClient.allocateContainer(
             clientManager.getType(), clientManager.getFactor(), containerName1);
     XceiverClientSpi client1 = clientManager.acquireClient(pipeline1);
-    Assert.assertEquals(client1.getRefcount(), 1);
+    Assert.assertEquals(1, client1.getRefcount());
     Assert.assertEquals(containerName1,
         client1.getPipeline().getContainerName());
 
@@ -88,13 +88,13 @@ public class TestXceiverClientManager {
         storageContainerLocationClient.allocateContainer(
             clientManager.getType(), clientManager.getFactor(), containerName2);
     XceiverClientSpi client2 = clientManager.acquireClient(pipeline2);
-    Assert.assertEquals(client2.getRefcount(), 1);
+    Assert.assertEquals(1, client2.getRefcount());
     Assert.assertEquals(containerName2,
         client2.getPipeline().getContainerName());
 
     XceiverClientSpi client3 = clientManager.acquireClient(pipeline1);
-    Assert.assertEquals(client3.getRefcount(), 2);
-    Assert.assertEquals(client1.getRefcount(), 2);
+    Assert.assertEquals(2, client3.getRefcount());
+    Assert.assertEquals(2, client1.getRefcount());
     Assert.assertEquals(containerName1,
         client3.getPipeline().getContainerName());
     Assert.assertEquals(client1, client3);
@@ -117,7 +117,7 @@ public class TestXceiverClientManager {
             clientManager.getType(), OzoneProtos.ReplicationFactor.ONE,
             containerName1);
     XceiverClientSpi client1 = clientManager.acquireClient(pipeline1);
-    Assert.assertEquals(client1.getRefcount(), 1);
+    Assert.assertEquals(1, client1.getRefcount());
     Assert.assertEquals(containerName1,
         client1.getPipeline().getContainerName());
 
@@ -127,14 +127,14 @@ public class TestXceiverClientManager {
             clientManager.getType(),
             OzoneProtos.ReplicationFactor.ONE, containerName2);
     XceiverClientSpi client2 = clientManager.acquireClient(pipeline2);
-    Assert.assertEquals(client2.getRefcount(), 1);
+    Assert.assertEquals(1, client2.getRefcount());
     Assert.assertEquals(containerName2,
         client2.getPipeline().getContainerName());
     Assert.assertNotEquals(client1, client2);
 
     // least recent container (i.e containerName1) is evicted
     XceiverClientSpi nonExistent1 = cache.getIfPresent(containerName1);
-    Assert.assertEquals(nonExistent1, null);
+    Assert.assertEquals(null, nonExistent1);
     // However container call should succeed because of refcount on the client.
     String traceID1 = "trace" + RandomStringUtils.randomNumeric(4);
     ContainerProtocolCalls.createContainer(client1,  traceID1);
@@ -162,19 +162,19 @@ public class TestXceiverClientManager {
             clientManager.getType(),
             clientManager.getFactor(), containerName1);
     XceiverClientSpi client1 = clientManager.acquireClient(pipeline1);
-    Assert.assertEquals(client1.getRefcount(), 1);
+    Assert.assertEquals(1, client1.getRefcount());
     Assert.assertEquals(containerName1,
         client1.getPipeline().getContainerName());
 
     clientManager.releaseClient(client1);
-    Assert.assertEquals(client1.getRefcount(), 0);
+    Assert.assertEquals(0, client1.getRefcount());
 
     String containerName2 = "container" + RandomStringUtils.randomNumeric(10);
     Pipeline pipeline2 =
         storageContainerLocationClient.allocateContainer(
             clientManager.getType(), clientManager.getFactor(), containerName2);
     XceiverClientSpi client2 = clientManager.acquireClient(pipeline2);
-    Assert.assertEquals(client2.getRefcount(), 1);
+    Assert.assertEquals(1, client2.getRefcount());
     Assert.assertEquals(containerName2,
         client2.getPipeline().getContainerName());
     Assert.assertNotEquals(client1, client2);
@@ -182,7 +182,7 @@ public class TestXceiverClientManager {
 
     // now client 1 should be evicted
     XceiverClientSpi nonExistent = cache.getIfPresent(containerName1);
-    Assert.assertEquals(nonExistent, null);
+    Assert.assertEquals(null, nonExistent);
 
     // Any container operation should now fail
     String traceID2 = "trace" + RandomStringUtils.randomNumeric(4);

http://git-wip-us.apache.org/repos/asf/hadoop/blob/6c62d74d/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/ozone/web/TestDistributedOzoneVolumes.java
----------------------------------------------------------------------
diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/ozone/web/TestDistributedOzoneVolumes.java
b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/ozone/web/TestDistributedOzoneVolumes.java
index 7236277..655c7ad 100644
--- a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/ozone/web/TestDistributedOzoneVolumes.java
+++ b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/ozone/web/TestDistributedOzoneVolumes.java
@@ -88,8 +88,8 @@ public class TestDistributedOzoneVolumes extends TestOzoneHelper {
   @Test
   public void testCreateVolumes() throws IOException {
     super.testCreateVolumes(port);
-    Assert.assertEquals(cluster.getKeySpaceManager()
-        .getMetrics().getNumVolumeCreateFails(), 0);
+    Assert.assertEquals(0, cluster.getKeySpaceManager()
+        .getMetrics().getNumVolumeCreateFails());
   }
 
   /**
@@ -100,8 +100,8 @@ public class TestDistributedOzoneVolumes extends TestOzoneHelper {
   @Test
   public void testCreateVolumesWithQuota() throws IOException {
     super.testCreateVolumesWithQuota(port);
-    Assert.assertEquals(cluster.getKeySpaceManager()
-        .getMetrics().getNumVolumeCreateFails(), 0);
+    Assert.assertEquals(0, cluster.getKeySpaceManager()
+        .getMetrics().getNumVolumeCreateFails());
   }
 
   /**
@@ -112,8 +112,8 @@ public class TestDistributedOzoneVolumes extends TestOzoneHelper {
   @Test
   public void testCreateVolumesWithInvalidQuota() throws IOException {
     super.testCreateVolumesWithInvalidQuota(port);
-    Assert.assertEquals(cluster.getKeySpaceManager()
-        .getMetrics().getNumVolumeCreateFails(), 0);
+    Assert.assertEquals(0, cluster.getKeySpaceManager()
+        .getMetrics().getNumVolumeCreateFails());
   }
 
   /**
@@ -126,8 +126,8 @@ public class TestDistributedOzoneVolumes extends TestOzoneHelper {
   @Test
   public void testCreateVolumesWithInvalidUser() throws IOException {
     super.testCreateVolumesWithInvalidUser(port);
-    Assert.assertEquals(cluster.getKeySpaceManager()
-        .getMetrics().getNumVolumeCreateFails(), 0);
+    Assert.assertEquals(0, cluster.getKeySpaceManager()
+        .getMetrics().getNumVolumeCreateFails());
   }
 
   /**
@@ -141,8 +141,8 @@ public class TestDistributedOzoneVolumes extends TestOzoneHelper {
   @Test
   public void testCreateVolumesWithOutAdminRights() throws IOException {
     super.testCreateVolumesWithOutAdminRights(port);
-    Assert.assertEquals(cluster.getKeySpaceManager()
-        .getMetrics().getNumVolumeCreateFails(), 0);
+    Assert.assertEquals(0, cluster.getKeySpaceManager()
+        .getMetrics().getNumVolumeCreateFails());
   }
 
   /**
@@ -153,8 +153,8 @@ public class TestDistributedOzoneVolumes extends TestOzoneHelper {
   @Test
   public void testCreateVolumesInLoop() throws IOException {
     super.testCreateVolumesInLoop(port);
-    Assert.assertEquals(cluster.getKeySpaceManager()
-        .getMetrics().getNumVolumeCreateFails(), 0);
+    Assert.assertEquals(0, cluster.getKeySpaceManager()
+        .getMetrics().getNumVolumeCreateFails());
   }
   /**
    * Get volumes owned by the user.

http://git-wip-us.apache.org/repos/asf/hadoop/blob/6c62d74d/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/ozone/web/client/TestKeys.java
----------------------------------------------------------------------
diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/ozone/web/client/TestKeys.java
b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/ozone/web/client/TestKeys.java
index 52b0ab5..c3b2dcc 100644
--- a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/ozone/web/client/TestKeys.java
+++ b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/ozone/web/client/TestKeys.java
@@ -236,14 +236,14 @@ public class TestKeys {
     assertNotNull(helper.getBucket());
     assertNotNull(helper.getFile());
     List<OzoneKey> keyList = helper.getBucket().listKeys("100", null, null);
-    Assert.assertEquals(keyList.size(), 1);
+    Assert.assertEquals(1, keyList.size());
 
     // test list key using a more efficient call
     String newkeyName = OzoneUtils.getRequestID().toLowerCase();
     client.putKey(helper.getVol().getVolumeName(),
         helper.getBucket().getBucketName(), newkeyName, helper.getFile());
     keyList = helper.getBucket().listKeys("100", null, null);
-    Assert.assertEquals(keyList.size(), 2);
+    Assert.assertEquals(2, keyList.size());
 
     // test new put key with invalid volume/bucket name
     try{
@@ -425,8 +425,8 @@ public class TestKeys {
     List<OzoneKey> keyList2 = client.listKeys(helper.getVol().getVolumeName(),
         helper.getBucket().getBucketName(), "100", null, null);
 
-    Assert.assertEquals(keyList1.size(), 11);
-    Assert.assertEquals(keyList2.size(), 11);
+    Assert.assertEquals(11, keyList1.size());
+    Assert.assertEquals(11, keyList2.size());
     // Verify the key creation/modification time. Here we compare the time in
     // second unit since the date string reparsed to millisecond will
     // lose precision.
@@ -448,15 +448,15 @@ public class TestKeys {
     keyList1 = helper.getBucket().listKeys("1", null, null);
     keyList2 = client.listKeys(helper.getVol().getVolumeName(),
         helper.getBucket().getBucketName(), "1", null, null);
-    Assert.assertEquals(keyList1.size(), 1);
-    Assert.assertEquals(keyList2.size(), 1);
+    Assert.assertEquals(1, keyList1.size());
+    Assert.assertEquals(1, keyList2.size());
 
     // test startKey parameter of list keys
     keyList1 = helper.getBucket().listKeys("100", "list-key4", "list-key");
     keyList2 = client.listKeys(helper.getVol().getVolumeName(),
         helper.getBucket().getBucketName(), "100", "list-key4", "list-key");
-    Assert.assertEquals(keyList1.size(), 5);
-    Assert.assertEquals(keyList2.size(), 5);
+    Assert.assertEquals(5, keyList1.size());
+    Assert.assertEquals(5, keyList2.size());
 
     // test prefix parameter of list keys
     keyList1 = helper.getBucket().listKeys("100", null, "list-key2");

http://git-wip-us.apache.org/repos/asf/hadoop/blob/6c62d74d/hadoop-tools/hadoop-ozone/src/test/java/org/apache/hadoop/fs/ozone/TestOzoneFileInterfaces.java
----------------------------------------------------------------------
diff --git a/hadoop-tools/hadoop-ozone/src/test/java/org/apache/hadoop/fs/ozone/TestOzoneFileInterfaces.java
b/hadoop-tools/hadoop-ozone/src/test/java/org/apache/hadoop/fs/ozone/TestOzoneFileInterfaces.java
index 62e2f19..b1e0f10 100644
--- a/hadoop-tools/hadoop-ozone/src/test/java/org/apache/hadoop/fs/ozone/TestOzoneFileInterfaces.java
+++ b/hadoop-tools/hadoop-ozone/src/test/java/org/apache/hadoop/fs/ozone/TestOzoneFileInterfaces.java
@@ -99,7 +99,7 @@ public class TestOzoneFileInterfaces {
   @Test
   public void testFileSystemInit() throws IOException {
     Assert.assertTrue(fs instanceof OzoneFileSystem);
-    Assert.assertEquals(fs.getUri().getScheme(), Constants.OZONE_URI_SCHEME);
+    Assert.assertEquals(Constants.OZONE_URI_SCHEME, fs.getUri().getScheme());
   }
 
   @Test
@@ -120,7 +120,7 @@ public class TestOzoneFileInterfaces {
       byte[] buffer = new byte[stringLen];
       inputStream.readFully(0, buffer);
       String out = new String(buffer, 0, buffer.length);
-      Assert.assertEquals(out, data);
+      Assert.assertEquals(data, out);
     }
   }
 
@@ -132,10 +132,10 @@ public class TestOzoneFileInterfaces {
 
     FileStatus status = fs.getFileStatus(path);
     Assert.assertTrue(status.isDirectory());
-    Assert.assertEquals(status.getLen(), 0);
+    Assert.assertEquals(0, status.getLen());
 
     FileStatus[] statusList = fs.listStatus(new Path("/"));
-    Assert.assertEquals(statusList.length, 1);
-    Assert.assertEquals(statusList[0], status);
+    Assert.assertEquals(1, statusList.length);
+    Assert.assertEquals(status, statusList[0]);
   }
 }


---------------------------------------------------------------------
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