Repository: ambari Updated Branches: refs/heads/trunk 4a5b2f6f5 -> edce0b117
http://git-wip-us.apache.org/repos/asf/ambari/blob/edce0b11/ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog220Test.java ---------------------------------------------------------------------- diff --git a/ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog220Test.java b/ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog220Test.java index 20ec68b..e687b10 100644 --- a/ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog220Test.java +++ b/ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog220Test.java @@ -496,7 +496,7 @@ public class UpgradeCatalog220Test { UpgradeCatalog220 upgradeMock = createMockBuilder(UpgradeCatalog220.class).createMock(); - Capture<Map<String, Object>> updatedData = new Capture<Map<String, Object>>(); + Capture<Map<String, Object>> updatedData = EasyMock.newCapture(); ArtifactEntity artifactEntity = createNiceMock(ArtifactEntity.class); expect(artifactEntity.getArtifactData()) @@ -698,12 +698,12 @@ public class UpgradeCatalog220Test { .createNiceMock(); Injector injector2 = easyMockSupport.createNiceMock(Injector.class); - Capture<Map> propertiesCapture = EasyMock.newCapture(); + Capture<Map<String, String>> propertiesCapture = EasyMock.newCapture(); expect(injector2.getInstance(AmbariManagementController.class)).andReturn(controller).anyTimes(); expect(controller.getClusters()).andReturn(clusters).anyTimes(); expect(controller.createConfig(anyObject(Cluster.class), anyString(), capture(propertiesCapture), anyString(), - anyObject(Map.class))).andReturn(createNiceMock(Config.class)).once(); + EasyMock.<Map<String, Map<String, String>>>anyObject())).andReturn(createNiceMock(Config.class)).once(); replay(controller, injector2); new UpgradeCatalog220(injector2).updateAMSConfigs(); @@ -759,12 +759,12 @@ public class UpgradeCatalog220Test { .createNiceMock(); Injector injector2 = easyMockSupport.createNiceMock(Injector.class); - Capture<Map> propertiesCapture = EasyMock.newCapture(); + Capture<Map<String, String>> propertiesCapture = EasyMock.newCapture(); expect(injector2.getInstance(AmbariManagementController.class)).andReturn(controller).anyTimes(); expect(controller.getClusters()).andReturn(clusters).anyTimes(); expect(controller.createConfig(anyObject(Cluster.class), anyString(), capture(propertiesCapture), anyString(), - anyObject(Map.class))).andReturn(createNiceMock(Config.class)).once(); + EasyMock.<Map<String, Map<String, String>>>anyObject())).andReturn(createNiceMock(Config.class)).once(); replay(controller, injector2); new UpgradeCatalog220(injector2).updateAMSConfigs(); @@ -1128,8 +1128,8 @@ public class UpgradeCatalog220Test { */ class UpgradeSectionDDL implements SectionDDL { - Capture<DBAccessor.DBColumnInfo> upgradeTablePackageNameColumnCapture = new Capture<DBAccessor.DBColumnInfo>(); - Capture<DBAccessor.DBColumnInfo> upgradeTableUpgradeTypeColumnCapture = new Capture<DBAccessor.DBColumnInfo>(); + Capture<DBAccessor.DBColumnInfo> upgradeTablePackageNameColumnCapture = EasyMock.newCapture(); + Capture<DBAccessor.DBColumnInfo> upgradeTableUpgradeTypeColumnCapture = EasyMock.newCapture(); /** * {@inheritDoc} http://git-wip-us.apache.org/repos/asf/ambari/blob/edce0b11/ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog221Test.java ---------------------------------------------------------------------- diff --git a/ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog221Test.java b/ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog221Test.java index bbf696a..27b1174 100644 --- a/ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog221Test.java +++ b/ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog221Test.java @@ -451,12 +451,12 @@ public class UpgradeCatalog221Test { .createNiceMock(); Injector injector2 = easyMockSupport.createNiceMock(Injector.class); - Capture<Map> propertiesCapture = EasyMock.newCapture(); + Capture<Map<String, String>> propertiesCapture = EasyMock.newCapture(); expect(injector2.getInstance(AmbariManagementController.class)).andReturn(controller).anyTimes(); expect(controller.getClusters()).andReturn(clusters).anyTimes(); expect(controller.createConfig(anyObject(Cluster.class), anyString(), capture(propertiesCapture), anyString(), - anyObject(Map.class))).andReturn(createNiceMock(Config.class)).anyTimes(); + EasyMock.<Map<String, Map<String, String>>>anyObject())).andReturn(createNiceMock(Config.class)).anyTimes(); replay(controller, injector2); new UpgradeCatalog221(injector2).updateAMSConfigs(); @@ -510,12 +510,12 @@ public class UpgradeCatalog221Test { .createNiceMock(); Injector injector2 = easyMockSupport.createNiceMock(Injector.class); - Capture<Map> propertiesCapture = EasyMock.newCapture(); + Capture<Map<String, String>> propertiesCapture = EasyMock.newCapture(); expect(injector2.getInstance(AmbariManagementController.class)).andReturn(controller).anyTimes(); expect(controller.getClusters()).andReturn(clusters).anyTimes(); expect(controller.createConfig(anyObject(Cluster.class), anyString(), capture(propertiesCapture), anyString(), - anyObject(Map.class))).andReturn(createNiceMock(Config.class)).once(); + EasyMock.<Map<String, Map<String, String>>>anyObject())).andReturn(createNiceMock(Config.class)).once(); replay(controller, injector2); new UpgradeCatalog221(injector2).updateAMSConfigs(); http://git-wip-us.apache.org/repos/asf/ambari/blob/edce0b11/ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog222Test.java ---------------------------------------------------------------------- diff --git a/ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog222Test.java b/ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog222Test.java index 00a4215..9d4fb3e 100644 --- a/ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog222Test.java +++ b/ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog222Test.java @@ -523,12 +523,12 @@ public class UpgradeCatalog222Test { .createNiceMock(); Injector injector2 = easyMockSupport.createNiceMock(Injector.class); - Capture<Map> propertiesCapture = EasyMock.newCapture(); + Capture<Map<String, String>> propertiesCapture = EasyMock.newCapture(); expect(injector2.getInstance(AmbariManagementController.class)).andReturn(controller).anyTimes(); expect(controller.getClusters()).andReturn(clusters).anyTimes(); expect(controller.createConfig(anyObject(Cluster.class), anyString(), capture(propertiesCapture), anyString(), - anyObject(Map.class))).andReturn(createNiceMock(Config.class)).once(); + EasyMock.<Map<String, Map<String, String>>>anyObject())).andReturn(createNiceMock(Config.class)).once(); replay(controller, injector2); new UpgradeCatalog222(injector2).updateAMSConfigs(); @@ -582,12 +582,12 @@ public class UpgradeCatalog222Test { .createNiceMock(); Injector injector2 = easyMockSupport.createNiceMock(Injector.class); - Capture<Map> propertiesCapture = EasyMock.newCapture(); + Capture<Map<String, String>> propertiesCapture = EasyMock.newCapture(); expect(injector2.getInstance(AmbariManagementController.class)).andReturn(controller).anyTimes(); expect(controller.getClusters()).andReturn(clusters).anyTimes(); expect(controller.createConfig(anyObject(Cluster.class), anyString(), capture(propertiesCapture), anyString(), - anyObject(Map.class))).andReturn(createNiceMock(Config.class)).once(); + EasyMock.<Map<String, Map<String, String>>>anyObject())).andReturn(createNiceMock(Config.class)).once(); replay(controller, injector2); new UpgradeCatalog222(injector2).updateAMSConfigs(); http://git-wip-us.apache.org/repos/asf/ambari/blob/edce0b11/ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog240Test.java ---------------------------------------------------------------------- diff --git a/ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog240Test.java b/ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog240Test.java index 190a810..496a8ef 100644 --- a/ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog240Test.java +++ b/ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog240Test.java @@ -762,9 +762,9 @@ public class UpgradeCatalog240Test { Capture<Map<String, String>> oozieCapture = newCapture(); Capture<Map<String, String>> hiveCapture = newCapture(); expect(mockAmbariManagementController.createConfig(eq(mockClusterExpected), eq("oozie-env"), - capture(oozieCapture), anyString(), (Map<String, Map<String, String>>)anyObject())).andReturn(null).once(); + capture(oozieCapture), anyString(), EasyMock.<Map<String, Map<String, String>>>anyObject())).andReturn(null).once(); expect(mockAmbariManagementController.createConfig(eq(mockClusterExpected), eq("hive-env"), - capture(hiveCapture), anyString(), (Map<String, Map<String, String>>)anyObject())).andReturn(null).once(); + capture(hiveCapture), anyString(), EasyMock.<Map<String, Map<String, String>>>anyObject())).andReturn(null).once(); easyMockSupport.replayAll(); mockInjector.getInstance(UpgradeCatalog240.class).removeHiveOozieDBConnectionConfigs(); @@ -846,15 +846,15 @@ public class UpgradeCatalog240Test { Capture<Map<String, String>> falconCapture = newCapture(); expect(mockAmbariManagementController.createConfig(eq(mockClusterExpected), eq("falcon-env"), - capture(falconCapture), anyString(), (Map<String, Map<String, String>>) anyObject())).andReturn(null).once(); + capture(falconCapture), anyString(), EasyMock.<Map<String, Map<String, String>>>anyObject())).andReturn(null).once(); Capture<Map<String, String>> falconCapture2 = newCapture(); expect(mockAmbariManagementController.createConfig(eq(mockClusterExpected), eq("falcon-env"), - capture(falconCapture2), anyString(), (Map<String, Map<String, String>>) anyObject())).andReturn(null).once(); + capture(falconCapture2), anyString(), EasyMock.<Map<String, Map<String, String>>>anyObject())).andReturn(null).once(); Capture<Map<String, String>> falconStartupCapture = newCapture(); expect(mockAmbariManagementController.createConfig(eq(mockClusterExpected), eq("falcon-startup.properties"), - capture(falconStartupCapture), anyString(), (Map<String, Map<String, String>>)anyObject())).andReturn(null).once(); + capture(falconStartupCapture), anyString(), EasyMock.<Map<String, Map<String, String>>>anyObject())).andReturn(null).once(); easyMockSupport.replayAll(); mockInjector.getInstance(UpgradeCatalog240.class).updateFalconConfigs(); @@ -935,7 +935,7 @@ public class UpgradeCatalog240Test { Capture<Map<String, String>> hbaseCapture = newCapture(); expect(mockAmbariManagementController.createConfig(eq(mockCluster), eq("hbase-site"), - capture(hbaseCapture), anyString(), (Map<String, Map<String, String>>)anyObject())).andReturn(null).once(); + capture(hbaseCapture), anyString(), EasyMock.<Map<String, Map<String, String>>>anyObject())).andReturn(null).once(); easyMockSupport.replayAll(); mockInjector.getInstance(UpgradeCatalog240.class).updateHBaseConfigs(); @@ -1016,12 +1016,12 @@ public class UpgradeCatalog240Test { .createNiceMock(); Injector injector2 = easyMockSupport.createNiceMock(Injector.class); - Capture<Map> propertiesCapture = EasyMock.newCapture(); + Capture<Map<String, String>> propertiesCapture = EasyMock.newCapture(); expect(injector2.getInstance(AmbariManagementController.class)).andReturn(controller).anyTimes(); expect(controller.getClusters()).andReturn(clusters).anyTimes(); expect(controller.createConfig(anyObject(Cluster.class), anyString(), capture(propertiesCapture), anyString(), - anyObject(Map.class))).andReturn(createNiceMock(Config.class)).once(); + EasyMock.<Map<String, Map<String, String>>>anyObject())).andReturn(createNiceMock(Config.class)).once(); replay(controller, injector2); new UpgradeCatalog240(injector2).updateHDFSConfigs(); @@ -1091,15 +1091,15 @@ public class UpgradeCatalog240Test { .createNiceMock(); Injector injector2 = easyMockSupport.createNiceMock(Injector.class); - Capture<Map> propertiesCaptureHdfsSite = EasyMock.newCapture(); - Capture<Map> propertiesCaptureHadoopEnv = EasyMock.newCapture(); + Capture<Map<String, String>> propertiesCaptureHdfsSite = EasyMock.newCapture(); + Capture<Map<String, String>> propertiesCaptureHadoopEnv = EasyMock.newCapture(); expect(injector2.getInstance(AmbariManagementController.class)).andReturn(controller).anyTimes(); expect(controller.getClusters()).andReturn(clusters).anyTimes(); expect(controller.createConfig(anyObject(Cluster.class), eq("hdfs-site"), capture(propertiesCaptureHdfsSite), anyString(), - anyObject(Map.class))).andReturn(createNiceMock(Config.class)).once(); + EasyMock.<Map<String, Map<String, String>>>anyObject())).andReturn(createNiceMock(Config.class)).once(); expect(controller.createConfig(anyObject(Cluster.class), eq("hadoop-env"), capture(propertiesCaptureHadoopEnv), anyString(), - anyObject(Map.class))).andReturn(createNiceMock(Config.class)).once(); + EasyMock.<Map<String, Map<String, String>>>anyObject())).andReturn(createNiceMock(Config.class)).once(); replay(controller, injector2); new UpgradeCatalog240(injector2).updateHDFSConfigs(); @@ -1160,12 +1160,12 @@ public class UpgradeCatalog240Test { .createNiceMock(); Injector injector2 = easyMockSupport.createNiceMock(Injector.class); - Capture<Map> propertiesCapture = EasyMock.newCapture(); + Capture<Map<String, String>> propertiesCapture = EasyMock.newCapture(); expect(injector2.getInstance(AmbariManagementController.class)).andReturn(controller).anyTimes(); expect(controller.getClusters()).andReturn(clusters).anyTimes(); expect(controller.createConfig(anyObject(Cluster.class), anyString(), capture(propertiesCapture), anyString(), - anyObject(Map.class))).andReturn(createNiceMock(Config.class)).once(); + EasyMock.<Map<String, Map<String, String>>>anyObject())).andReturn(createNiceMock(Config.class)).once(); replay(controller, injector2); new UpgradeCatalog240(injector2).updateYarnEnv(); @@ -1291,15 +1291,15 @@ public class UpgradeCatalog240Test { .createNiceMock(); Injector injector2 = easyMockSupport.createNiceMock(Injector.class); - Capture<Map> propertiesSparkDefaultsCapture = EasyMock.newCapture(); - Capture<Map> propertiesSparkJavaOptsCapture = EasyMock.newCapture(); + Capture<Map<String, String>> propertiesSparkDefaultsCapture = EasyMock.newCapture(); + Capture<Map<String, String>> propertiesSparkJavaOptsCapture = EasyMock.newCapture(); expect(injector2.getInstance(AmbariManagementController.class)).andReturn(controller).anyTimes(); expect(controller.getClusters()).andReturn(clusters).anyTimes(); expect(controller.createConfig(anyObject(Cluster.class), eq("spark-defaults"), capture(propertiesSparkDefaultsCapture), anyString(), - anyObject(Map.class))).andReturn(createNiceMock(Config.class)).once(); + EasyMock.<Map<String, Map<String, String>>>anyObject())).andReturn(createNiceMock(Config.class)).once(); expect(controller.createConfig(anyObject(Cluster.class), eq("spark-javaopts-properties"), capture(propertiesSparkJavaOptsCapture), anyString(), - anyObject(Map.class))).andReturn(createNiceMock(Config.class)).once(); + EasyMock.<Map<String, Map<String, String>>>anyObject())).andReturn(createNiceMock(Config.class)).once(); replay(controller, injector2); new UpgradeCatalog240(injector2).updateSparkConfigs(); @@ -1353,12 +1353,12 @@ public class UpgradeCatalog240Test { .createNiceMock(); Injector injector2 = easyMockSupport.createNiceMock(Injector.class); - Capture<Map> propertiesCapture = EasyMock.newCapture(); + Capture<Map<String, String>> propertiesCapture = EasyMock.newCapture(); expect(injector2.getInstance(AmbariManagementController.class)).andReturn(controller).anyTimes(); expect(controller.getClusters()).andReturn(clusters).anyTimes(); expect(controller.createConfig(anyObject(Cluster.class), anyString(), capture(propertiesCapture), anyString(), - anyObject(Map.class))).andReturn(createNiceMock(Config.class)).once(); + EasyMock.<Map<String, Map<String, String>>>anyObject())).andReturn(createNiceMock(Config.class)).once(); replay(controller, injector2); new UpgradeCatalog240(injector2).updateAMSConfigs(); @@ -1412,12 +1412,12 @@ public class UpgradeCatalog240Test { .createNiceMock(); Injector injector2 = easyMockSupport.createNiceMock(Injector.class); - Capture<Map> propertiesCapture = EasyMock.newCapture(); + Capture<Map<String, String>> propertiesCapture = EasyMock.newCapture(); expect(injector2.getInstance(AmbariManagementController.class)).andReturn(controller).anyTimes(); expect(controller.getClusters()).andReturn(clusters).anyTimes(); expect(controller.createConfig(anyObject(Cluster.class), anyString(), capture(propertiesCapture), anyString(), - anyObject(Map.class))).andReturn(createNiceMock(Config.class)).once(); + EasyMock.<Map<String, Map<String, String>>>anyObject())).andReturn(createNiceMock(Config.class)).once(); replay(controller, injector2); new UpgradeCatalog240(injector2).updateAMSConfigs(); @@ -1469,12 +1469,12 @@ public class UpgradeCatalog240Test { .createNiceMock(); Injector injector2 = easyMockSupport.createNiceMock(Injector.class); - Capture<Map> propertiesCapture = EasyMock.newCapture(); + Capture<Map<String, String>> propertiesCapture = EasyMock.newCapture(); expect(injector2.getInstance(AmbariManagementController.class)).andReturn(controller).anyTimes(); expect(controller.getClusters()).andReturn(clusters).anyTimes(); expect(controller.createConfig(anyObject(Cluster.class), anyString(), capture(propertiesCapture), anyString(), - anyObject(Map.class))).andReturn(createNiceMock(Config.class)).once(); + EasyMock.<Map<String, Map<String, String>>>anyObject())).andReturn(createNiceMock(Config.class)).once(); replay(controller, injector2); new UpgradeCatalog240(injector2).updateAMSConfigs(); @@ -1568,9 +1568,9 @@ public class UpgradeCatalog240Test { Capture<Cluster> clusterCapture = newCapture(CaptureType.ALL); Capture<String> typeCapture = newCapture(CaptureType.ALL); - Capture<Map> propertiesCapture = newCapture(CaptureType.ALL); + Capture<Map<String, String>> propertiesCapture = newCapture(CaptureType.ALL); Capture<String> tagCapture = newCapture(CaptureType.ALL); - Capture<Map> attributesCapture = newCapture(CaptureType.ALL); + Capture<Map<String, Map<String, String>>> attributesCapture = newCapture(CaptureType.ALL); expect(controller.createConfig(capture(clusterCapture), capture(typeCapture), capture(propertiesCapture), capture(tagCapture), capture(attributesCapture) )) @@ -1615,7 +1615,7 @@ public class UpgradeCatalog240Test { Assert.assertEquals("kerberos-env", typeCaptureValues.get(0)); Assert.assertEquals("krb5-conf", typeCaptureValues.get(1)); - List<Map> propertiesCaptureValues = propertiesCapture.getValues(); + List<Map<String, String>> propertiesCaptureValues = propertiesCapture.getValues(); Assert.assertEquals(2, propertiesCaptureValues.size()); Map<String, String> capturedCRProperties; @@ -1719,9 +1719,9 @@ public class UpgradeCatalog240Test { Capture<Cluster> clusterCapture = newCapture(CaptureType.ALL); Capture<String> typeCapture = newCapture(CaptureType.ALL); - Capture<Map> propertiesCapture = newCapture(CaptureType.ALL); + Capture<Map<String, String>> propertiesCapture = newCapture(CaptureType.ALL); Capture<String> tagCapture = newCapture(CaptureType.ALL); - Capture<Map> attributesCapture = newCapture(CaptureType.ALL); + Capture<Map<String, Map<String, String>>> attributesCapture = newCapture(CaptureType.ALL); expect(controller.createConfig(capture(clusterCapture), capture(typeCapture), @@ -1752,7 +1752,7 @@ public class UpgradeCatalog240Test { Assert.assertEquals(1, typeCaptureValues.size()); Assert.assertEquals("kerberos-env", typeCaptureValues.get(0)); - List<Map> propertiesCaptureValues = propertiesCapture.getValues(); + List<Map<String, String>> propertiesCaptureValues = propertiesCapture.getValues(); Assert.assertEquals(1, propertiesCaptureValues.size()); Map<String, String> capturedCRProperties; @@ -2549,12 +2549,12 @@ public class UpgradeCatalog240Test { .createNiceMock(); Injector injector2 = easyMockSupport.createNiceMock(Injector.class); - Capture<Map> propertiesCapture = EasyMock.newCapture(); + Capture<Map<String, String>> propertiesCapture = EasyMock.newCapture(); expect(injector2.getInstance(AmbariManagementController.class)).andReturn(controller).anyTimes(); expect(controller.getClusters()).andReturn(clusters).anyTimes(); expect(controller.createConfig(anyObject(Cluster.class), anyString(), capture(propertiesCapture), anyString(), - anyObject(Map.class))).andReturn(createNiceMock(Config.class)).once(); + EasyMock.<Map<String, Map<String, String>>>anyObject())).andReturn(createNiceMock(Config.class)).once(); replay(controller, injector2); new UpgradeCatalog240(injector2).updateRangerHbasePluginProperties(); http://git-wip-us.apache.org/repos/asf/ambari/blob/edce0b11/ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog250Test.java ---------------------------------------------------------------------- diff --git a/ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog250Test.java b/ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog250Test.java index 1f3858f..5e89039 100644 --- a/ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog250Test.java +++ b/ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog250Test.java @@ -355,12 +355,12 @@ public class UpgradeCatalog250Test { .createNiceMock(); Injector injector2 = easyMockSupport.createNiceMock(Injector.class); - Capture<Map> propertiesCapture = EasyMock.newCapture(); + Capture<Map<String, String>> propertiesCapture = EasyMock.newCapture(); expect(injector2.getInstance(AmbariManagementController.class)).andReturn(controller).anyTimes(); expect(controller.getClusters()).andReturn(clusters).anyTimes(); expect(controller.createConfig(anyObject(Cluster.class), anyString(), capture(propertiesCapture), anyString(), - anyObject(Map.class))).andReturn(config).once(); + EasyMock.<Map<String, Map<String, String>>>anyObject())).andReturn(config).once(); replay(controller, injector2); new UpgradeCatalog250(injector2).updateAMSConfigs(); @@ -405,12 +405,12 @@ public class UpgradeCatalog250Test { .createNiceMock(); Injector injector2 = easyMockSupport.createNiceMock(Injector.class); - Capture<Map> propertiesCapture = EasyMock.newCapture(); + Capture<Map<String, String>> propertiesCapture = EasyMock.newCapture(); expect(injector2.getInstance(AmbariManagementController.class)).andReturn(controller).anyTimes(); expect(controller.getClusters()).andReturn(clusters).anyTimes(); expect(controller.createConfig(anyObject(Cluster.class), anyString(), capture(propertiesCapture), anyString(), - anyObject(Map.class))).andReturn(config).once(); + EasyMock.<Map<String, Map<String, String>>>anyObject())).andReturn(config).once(); replay(controller, injector2); new UpgradeCatalog250(injector2).updateKafkaConfigs(); @@ -484,12 +484,12 @@ public class UpgradeCatalog250Test { .createNiceMock(); Injector injector2 = easyMockSupport.createNiceMock(Injector.class); - Capture<Map> propertiesCapture = EasyMock.newCapture(); + Capture<Map<String, String>> propertiesCapture = EasyMock.newCapture(); expect(injector2.getInstance(AmbariManagementController.class)).andReturn(controller).anyTimes(); expect(controller.getClusters()).andReturn(clusters).anyTimes(); expect(controller.createConfig(anyObject(Cluster.class), anyString(), capture(propertiesCapture), anyString(), - anyObject(Map.class))).andReturn(config).once(); + EasyMock.<Map<String, Map<String, String>>>anyObject())).andReturn(config).once(); replay(controller, injector2); new UpgradeCatalog250(injector2).updateAtlasConfigs(); http://git-wip-us.apache.org/repos/asf/ambari/blob/edce0b11/ambari-server/src/test/java/org/apache/ambari/server/utils/SetUtilsTest.java ---------------------------------------------------------------------- diff --git a/ambari-server/src/test/java/org/apache/ambari/server/utils/SetUtilsTest.java b/ambari-server/src/test/java/org/apache/ambari/server/utils/SetUtilsTest.java index 698baf9..67bcf4b 100644 --- a/ambari-server/src/test/java/org/apache/ambari/server/utils/SetUtilsTest.java +++ b/ambari-server/src/test/java/org/apache/ambari/server/utils/SetUtilsTest.java @@ -45,7 +45,7 @@ public class SetUtilsTest { List<Set<Integer>> subsets = SetUtils.split(null, size); Assert.assertEquals(0, subsets.size()); - subsets = SetUtils.split(Collections.EMPTY_SET, size); + subsets = SetUtils.split(Collections.<Integer>emptySet(), size); Assert.assertEquals(0, subsets.size()); subsets = SetUtils.split(Collections.singleton(0), size); http://git-wip-us.apache.org/repos/asf/ambari/blob/edce0b11/ambari-server/src/test/java/org/apache/ambari/server/view/RemoteAmbariClusterTest.java ---------------------------------------------------------------------- diff --git a/ambari-server/src/test/java/org/apache/ambari/server/view/RemoteAmbariClusterTest.java b/ambari-server/src/test/java/org/apache/ambari/server/view/RemoteAmbariClusterTest.java index d61123f..029811b 100644 --- a/ambari-server/src/test/java/org/apache/ambari/server/view/RemoteAmbariClusterTest.java +++ b/ambari-server/src/test/java/org/apache/ambari/server/view/RemoteAmbariClusterTest.java @@ -18,7 +18,6 @@ package org.apache.ambari.server.view; -import static org.easymock.EasyMock.anyObject; import static org.easymock.EasyMock.createNiceMock; import static org.easymock.EasyMock.eq; import static org.easymock.EasyMock.expect; @@ -36,6 +35,7 @@ import java.util.Map; import org.apache.ambari.server.orm.entities.RemoteAmbariClusterEntity; import org.apache.ambari.view.AmbariHttpException; import org.apache.ambari.view.AmbariStreamProvider; +import org.easymock.EasyMock; import org.easymock.IAnswer; import org.junit.Assert; import org.junit.Rule; @@ -60,7 +60,7 @@ public class RemoteAmbariClusterTest { final String clusterPath = "/api/v1/clusters/Test"; expect(clusterStreamProvider.readFrom(eq( clusterPath + "?fields=services/ServiceInfo,hosts,Clusters"), - eq("GET"), (String) isNull(), (Map<String, String>) anyObject())).andAnswer(new IAnswer<InputStream>() { + eq("GET"), (String) isNull(), EasyMock.<Map<String, String>>anyObject())).andAnswer(new IAnswer<InputStream>() { @Override public InputStream answer() throws Throwable { desiredConfigPolls[0] += 1; @@ -69,7 +69,7 @@ public class RemoteAmbariClusterTest { }).anyTimes(); expect(clusterStreamProvider.readFrom(eq(clusterPath + "/configurations?(type=test-site&tag=TAG)"), - eq("GET"), (String)isNull(), (Map<String, String>) anyObject())).andAnswer(new IAnswer<InputStream>() { + eq("GET"), (String)isNull(), EasyMock.<Map<String, String>>anyObject())).andAnswer(new IAnswer<InputStream>() { @Override public InputStream answer() throws Throwable { testConfigPolls[0] += 1; @@ -113,7 +113,7 @@ public class RemoteAmbariClusterTest { expect(clusterStreamProvider.readFrom(eq(String.format("%s/services/%s/components/%s?" + "fields=host_components/HostRoles/host_name", clusterPath, service, component)), - eq("GET"), (String) isNull(), (Map<String, String>) anyObject())) + eq("GET"), (String) isNull(), EasyMock.<Map<String, String>>anyObject())) .andReturn(new ByteArrayInputStream(componentHostsString.getBytes())); RemoteAmbariClusterEntity entity = createNiceMock(RemoteAmbariClusterEntity.class); http://git-wip-us.apache.org/repos/asf/ambari/blob/edce0b11/ambari-server/src/test/java/org/apache/ambari/server/view/ViewDataMigrationContextImplTest.java ---------------------------------------------------------------------- diff --git a/ambari-server/src/test/java/org/apache/ambari/server/view/ViewDataMigrationContextImplTest.java b/ambari-server/src/test/java/org/apache/ambari/server/view/ViewDataMigrationContextImplTest.java index ef8eb14..4da5f39 100644 --- a/ambari-server/src/test/java/org/apache/ambari/server/view/ViewDataMigrationContextImplTest.java +++ b/ambari-server/src/test/java/org/apache/ambari/server/view/ViewDataMigrationContextImplTest.java @@ -295,8 +295,8 @@ public class ViewDataMigrationContextImplTest { ViewInstanceDataEntity dataEntity2User2 = new ViewInstanceDataEntity(); dataEntity2User2.setName("key2"); dataEntity2User2.setUser("user2"); - Collection data2 = Arrays.asList(dataEntityUser2, dataEntity2User2); - Collection data1 = Arrays.asList(dataEntityUser1, dataEntityUser2, dataEntity2User2); + Collection<ViewInstanceDataEntity> data2 = Arrays.asList(dataEntityUser2, dataEntity2User2); + Collection<ViewInstanceDataEntity> data1 = Arrays.asList(dataEntityUser1, dataEntityUser2, dataEntity2User2); ViewInstanceEntity instanceEntity1 = getViewInstanceEntityMock(entity1); expect(instanceEntity1.getData()).andReturn(data1); http://git-wip-us.apache.org/repos/asf/ambari/blob/edce0b11/ambari-server/src/test/java/org/apache/ambari/server/view/ViewRegistryTest.java ---------------------------------------------------------------------- diff --git a/ambari-server/src/test/java/org/apache/ambari/server/view/ViewRegistryTest.java b/ambari-server/src/test/java/org/apache/ambari/server/view/ViewRegistryTest.java index 351c513..132dd7e 100644 --- a/ambari-server/src/test/java/org/apache/ambari/server/view/ViewRegistryTest.java +++ b/ambari-server/src/test/java/org/apache/ambari/server/view/ViewRegistryTest.java @@ -96,6 +96,7 @@ import org.apache.ambari.view.events.Listener; import org.apache.ambari.view.validation.ValidationResult; import org.apache.ambari.view.validation.Validator; import org.easymock.Capture; +import org.easymock.EasyMock; import org.junit.After; import org.junit.Assert; import org.junit.Before; @@ -401,7 +402,7 @@ public class ViewRegistryTest { Cluster cluster = createNiceMock(Cluster.class); Service service = createNiceMock(Service.class); ViewInstanceEntity viewAutoInstanceEntity = createNiceMock(ViewInstanceEntity.class); - Capture<ViewInstanceEntity> viewAutoInstanceCapture = new Capture<ViewInstanceEntity>(); + Capture<ViewInstanceEntity> viewAutoInstanceCapture = EasyMock.newCapture(); ViewInstanceDataEntity autoInstanceDataEntity = createNiceMock(ViewInstanceDataEntity.class); expect(autoInstanceDataEntity.getName()).andReturn("p1").anyTimes(); @@ -1593,7 +1594,7 @@ public class ViewRegistryTest { expect(archiveDir.getAbsolutePath()).andReturn("/var/lib/ambari-server/resources/views/work/MY_VIEW{1.0.0}").anyTimes(); } - Capture<ViewEntity> viewEntityCapture = new Capture<ViewEntity>(); + Capture<ViewEntity> viewEntityCapture = EasyMock.newCapture(); if (System.getProperty("os.name").contains("Windows")) { expect(viewExtractor.ensureExtractedArchiveDirectory("\\var\\lib\\ambari-server\\resources\\views\\work")).andReturn(true); } @@ -1843,7 +1844,7 @@ public class ViewRegistryTest { expect(cluster.getCurrentStackVersion()).andReturn(stackId).anyTimes(); expect(cluster.getServices()).andReturn(serviceMap).anyTimes(); - Capture<ViewInstanceEntity> viewInstanceCapture = new Capture<ViewInstanceEntity>(); + Capture<ViewInstanceEntity> viewInstanceCapture = EasyMock.newCapture(); expect(viewInstanceDAO.merge(capture(viewInstanceCapture))).andReturn(viewInstanceEntity).anyTimes(); expect(viewInstanceDAO.findByName("MY_VIEW{1.0.0}", "AUTO-INSTANCE")).andReturn(viewInstanceEntity).anyTimes(); http://git-wip-us.apache.org/repos/asf/ambari/blob/edce0b11/ambari-server/src/test/java/org/apache/ambari/server/view/persistence/DataStoreImplTest.java ---------------------------------------------------------------------- diff --git a/ambari-server/src/test/java/org/apache/ambari/server/view/persistence/DataStoreImplTest.java b/ambari-server/src/test/java/org/apache/ambari/server/view/persistence/DataStoreImplTest.java index fb37e9d..60643b3 100644 --- a/ambari-server/src/test/java/org/apache/ambari/server/view/persistence/DataStoreImplTest.java +++ b/ambari-server/src/test/java/org/apache/ambari/server/view/persistence/DataStoreImplTest.java @@ -118,11 +118,11 @@ public class DataStoreImplTest { PowerMock.replay(JpaHelper.class); expect(jpaEntityManager.getServerSession()).andReturn(session).anyTimes(); expect(session.getLogin()).andReturn(databaseLogin).anyTimes(); - Capture<Sequence> sequenceCapture = new Capture<Sequence>(); + Capture<Sequence> sequenceCapture = EasyMock.newCapture(); databaseLogin.addSequence(capture(sequenceCapture)); EasyMock.expectLastCall().anyTimes(); - Capture<DynamicEntity> entityCapture = new Capture<DynamicEntity>(); + Capture<DynamicEntity> entityCapture = EasyMock.newCapture(); entityManager.persist(capture(entityCapture)); EasyMock.expectLastCall().andAnswer(new IAnswer<Object>() { @Override @@ -133,7 +133,7 @@ public class DataStoreImplTest { } }); - Capture<DynamicEntity> entityCapture2 = new Capture<DynamicEntity>(); + Capture<DynamicEntity> entityCapture2 = EasyMock.newCapture(); entityManager.persist(capture(entityCapture2)); EasyMock.expectLastCall().andAnswer(new IAnswer<Object>() { @Override @@ -144,8 +144,8 @@ public class DataStoreImplTest { } }); - Capture<DynamicType> typeCapture = new Capture<DynamicType>(); - Capture<DynamicType> typeCapture2 = new Capture<DynamicType>(); + Capture<DynamicType> typeCapture = EasyMock.newCapture(); + Capture<DynamicType> typeCapture2 = EasyMock.newCapture(); jpaDynamicHelper.addTypes(eq(true), eq(true), capture(typeCapture), capture(typeCapture2)); expect(entityManagerFactory.createEntityManager()).andReturn(entityManager).anyTimes(); @@ -193,12 +193,12 @@ public class DataStoreImplTest { PowerMock.replay(JpaHelper.class); expect(jpaEntityManager.getServerSession()).andReturn(session).anyTimes(); expect(session.getLogin()).andReturn(databaseLogin).anyTimes(); - Capture<Sequence> sequenceCapture = new Capture<Sequence>(); + Capture<Sequence> sequenceCapture = EasyMock.newCapture(); databaseLogin.addSequence(capture(sequenceCapture)); EasyMock.expectLastCall().anyTimes(); - Capture<DynamicType> typeCapture = new Capture<DynamicType>(); - Capture<DynamicType> typeCapture2 = new Capture<DynamicType>(); + Capture<DynamicType> typeCapture = EasyMock.newCapture(); + Capture<DynamicType> typeCapture2 = EasyMock.newCapture(); jpaDynamicHelper.addTypes(eq(true), eq(true), capture(typeCapture), capture(typeCapture2)); expect(entityManagerFactory.createEntityManager()).andReturn(entityManager).anyTimes(); @@ -252,12 +252,12 @@ public class DataStoreImplTest { PowerMock.replay(JpaHelper.class); expect(jpaEntityManager.getServerSession()).andReturn(session).anyTimes(); expect(session.getLogin()).andReturn(databaseLogin).anyTimes(); - Capture<Sequence> sequenceCapture = new Capture<Sequence>(); + Capture<Sequence> sequenceCapture = EasyMock.newCapture(); databaseLogin.addSequence(capture(sequenceCapture)); EasyMock.expectLastCall().anyTimes(); - Capture<DynamicType> typeCapture = new Capture<DynamicType>(); - Capture<DynamicType> typeCapture2 = new Capture<DynamicType>(); + Capture<DynamicType> typeCapture = EasyMock.newCapture(); + Capture<DynamicType> typeCapture2 = EasyMock.newCapture(); jpaDynamicHelper.addTypes(eq(true), eq(true), capture(typeCapture), capture(typeCapture2)); expect(entityManagerFactory.createEntityManager()).andReturn(entityManager).anyTimes(); @@ -306,21 +306,21 @@ public class DataStoreImplTest { PowerMock.replay(JpaHelper.class); expect(jpaEntityManager.getServerSession()).andReturn(session).anyTimes(); expect(session.getLogin()).andReturn(databaseLogin).anyTimes(); - Capture<Sequence> sequenceCapture = new Capture<Sequence>(); + Capture<Sequence> sequenceCapture = EasyMock.newCapture(); databaseLogin.addSequence(capture(sequenceCapture)); EasyMock.expectLastCall().anyTimes(); - Capture<DynamicType> typeCapture = new Capture<DynamicType>(); - Capture<DynamicType> typeCapture2 = new Capture<DynamicType>(); + Capture<DynamicType> typeCapture = EasyMock.newCapture(); + Capture<DynamicType> typeCapture2 = EasyMock.newCapture(); jpaDynamicHelper.addTypes(eq(true), eq(true), capture(typeCapture), capture(typeCapture2)); expect(entityManagerFactory.createEntityManager()).andReturn(entityManager).anyTimes(); expect(entityManager.getTransaction()).andReturn(transaction).anyTimes(); - Capture<Class> entityClassCapture = new Capture<Class>(); + Capture<Class> entityClassCapture = EasyMock.newCapture(); expect(entityManager.find(capture(entityClassCapture), eq(100))).andReturn(dynamicEntity); - Capture<Class> entityClassCapture2 = new Capture<Class>(); + Capture<Class> entityClassCapture2 = EasyMock.newCapture(); expect(entityManager.find(capture(entityClassCapture2), eq(99))).andReturn(dynamicSubEntity); entityManager.close(); @@ -331,7 +331,7 @@ public class DataStoreImplTest { expect(dynamicSubEntity.set("DS_id", 99)).andReturn(dynamicSubEntity); expect(dynamicSubEntity.set("DS_name", "bar")).andReturn(dynamicSubEntity); - Capture<DynamicEntity> subEntityCapture = new Capture<DynamicEntity>(); + Capture<DynamicEntity> subEntityCapture = EasyMock.newCapture(); expect(dynamicEntity.set(eq("DS_subEntity"), capture(subEntityCapture))).andReturn(dynamicSubEntity); expect(dynamicEntity.get("DS_id")).andReturn(100); @@ -380,18 +380,18 @@ public class DataStoreImplTest { PowerMock.replay(JpaHelper.class); expect(jpaEntityManager.getServerSession()).andReturn(session).anyTimes(); expect(session.getLogin()).andReturn(databaseLogin).anyTimes(); - Capture<Sequence> sequenceCapture = new Capture<Sequence>(); + Capture<Sequence> sequenceCapture = EasyMock.newCapture(); databaseLogin.addSequence(capture(sequenceCapture)); EasyMock.expectLastCall().anyTimes(); - Capture<DynamicType> typeCapture = new Capture<DynamicType>(); - Capture<DynamicType> typeCapture2 = new Capture<DynamicType>(); + Capture<DynamicType> typeCapture = EasyMock.newCapture(); + Capture<DynamicType> typeCapture2 = EasyMock.newCapture(); jpaDynamicHelper.addTypes(eq(true), eq(true), capture(typeCapture), capture(typeCapture2)); expect(entityManagerFactory.createEntityManager()).andReturn(entityManager).anyTimes(); expect(entityManager.getTransaction()).andReturn(transaction).anyTimes(); - Capture<Class> entityClassCapture2 = new Capture<Class>(); + Capture<Class> entityClassCapture2 = EasyMock.newCapture(); expect(entityManager.find(capture(entityClassCapture2), eq(99))).andReturn(dynamicEntity); entityManager.close(); @@ -445,17 +445,17 @@ public class DataStoreImplTest { PowerMock.replay(JpaHelper.class); expect(jpaEntityManager.getServerSession()).andReturn(session).anyTimes(); expect(session.getLogin()).andReturn(databaseLogin).anyTimes(); - Capture<Sequence> sequenceCapture = new Capture<Sequence>(); + Capture<Sequence> sequenceCapture = EasyMock.newCapture(); databaseLogin.addSequence(capture(sequenceCapture)); EasyMock.expectLastCall().anyTimes(); - Capture<DynamicType> typeCapture = new Capture<DynamicType>(); - Capture<DynamicType> typeCapture2 = new Capture<DynamicType>(); + Capture<DynamicType> typeCapture = EasyMock.newCapture(); + Capture<DynamicType> typeCapture2 = EasyMock.newCapture(); jpaDynamicHelper.addTypes(eq(true), eq(true), capture(typeCapture), capture(typeCapture2)); expect(entityManagerFactory.createEntityManager()).andReturn(entityManager).anyTimes(); expect(entityManager.getTransaction()).andReturn(transaction).anyTimes(); - Capture<Class> entityClassCapture = new Capture<Class>(); + Capture<Class> entityClassCapture = EasyMock.newCapture(); expect(entityManager.getReference(capture(entityClassCapture), eq(99))).andReturn(dynamicEntity); entityManager.remove(dynamicEntity); entityManager.close(); @@ -496,16 +496,16 @@ public class DataStoreImplTest { PowerMock.replay(JpaHelper.class); expect(jpaEntityManager.getServerSession()).andReturn(session).anyTimes(); expect(session.getLogin()).andReturn(databaseLogin).anyTimes(); - Capture<Sequence> sequenceCapture = new Capture<Sequence>(); + Capture<Sequence> sequenceCapture = EasyMock.newCapture(); databaseLogin.addSequence(capture(sequenceCapture)); EasyMock.expectLastCall().anyTimes(); - Capture<DynamicType> typeCapture = new Capture<DynamicType>(); - Capture<DynamicType> typeCapture2 = new Capture<DynamicType>(); + Capture<DynamicType> typeCapture = EasyMock.newCapture(); + Capture<DynamicType> typeCapture2 = EasyMock.newCapture(); jpaDynamicHelper.addTypes(eq(true), eq(true), capture(typeCapture), capture(typeCapture2)); expect(entityManagerFactory.createEntityManager()).andReturn(entityManager).anyTimes(); - Capture<Class> entityClassCapture = new Capture<Class>(); + Capture<Class> entityClassCapture = EasyMock.newCapture(); expect(entityManager.find(capture(entityClassCapture), eq(99))).andReturn(dynamicEntity); entityManager.close(); @@ -550,11 +550,11 @@ public class DataStoreImplTest { PowerMock.replay(JpaHelper.class); expect(jpaEntityManager.getServerSession()).andReturn(session).anyTimes(); expect(session.getLogin()).andReturn(databaseLogin).anyTimes(); - Capture<Sequence> sequenceCapture = new Capture<Sequence>(); + Capture<Sequence> sequenceCapture = EasyMock.newCapture(); databaseLogin.addSequence(capture(sequenceCapture)); EasyMock.expectLastCall().anyTimes(); - Capture<DynamicType> typeCapture = new Capture<DynamicType>(); - Capture<DynamicType> typeCapture2 = new Capture<DynamicType>(); + Capture<DynamicType> typeCapture = EasyMock.newCapture(); + Capture<DynamicType> typeCapture2 = EasyMock.newCapture(); jpaDynamicHelper.addTypes(eq(true), eq(true), capture(typeCapture), capture(typeCapture2)); expect(entityManagerFactory.createEntityManager()).andReturn(entityManager).anyTimes(); @@ -610,11 +610,11 @@ public class DataStoreImplTest { PowerMock.replay(JpaHelper.class); expect(jpaEntityManager.getServerSession()).andReturn(session).anyTimes(); expect(session.getLogin()).andReturn(databaseLogin).anyTimes(); - Capture<Sequence> sequenceCapture = new Capture<Sequence>(); + Capture<Sequence> sequenceCapture = EasyMock.newCapture(); databaseLogin.addSequence(capture(sequenceCapture)); EasyMock.expectLastCall().anyTimes(); - Capture<DynamicType> typeCapture = new Capture<DynamicType>(); - Capture<DynamicType> typeCapture2 = new Capture<DynamicType>(); + Capture<DynamicType> typeCapture = EasyMock.newCapture(); + Capture<DynamicType> typeCapture2 = EasyMock.newCapture(); jpaDynamicHelper.addTypes(eq(true), eq(true), capture(typeCapture), capture(typeCapture2)); expect(entityManagerFactory.createEntityManager()).andReturn(entityManager).anyTimes();
