Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 11C73200C03 for ; Fri, 16 Dec 2016 23:02:14 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 106F1160B45; Fri, 16 Dec 2016 22:02:14 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 434EF160B39 for ; Fri, 16 Dec 2016 23:02:11 +0100 (CET) Received: (qmail 21575 invoked by uid 500); 16 Dec 2016 22:02:10 -0000 Mailing-List: contact commits-help@ambari.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: ambari-dev@ambari.apache.org Delivered-To: mailing list commits@ambari.apache.org Received: (qmail 21185 invoked by uid 99); 16 Dec 2016 22:02:10 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 16 Dec 2016 22:02:10 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 188D6DF9F8; Fri, 16 Dec 2016 22:02:10 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: ncole@apache.org To: commits@ambari.apache.org Date: Fri, 16 Dec 2016 22:02:17 -0000 Message-Id: <1c880dd1766c49b69ca1a4b3ba753884@git.apache.org> In-Reply-To: <596fb83c2e2f46969d6527f1ec2096d2@git.apache.org> References: <596fb83c2e2f46969d6527f1ec2096d2@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [09/51] [abbrv] ambari git commit: AMBARI-19149. Code cleanup: compiler warnings (Attila Doroszlai via ncole) archived-at: Fri, 16 Dec 2016 22:02:14 -0000 http://git-wip-us.apache.org/repos/asf/ambari/blob/edce0b11/ambari-server/src/test/java/org/apache/ambari/server/security/ldap/AmbariLdapDataPopulatorTest.java ---------------------------------------------------------------------- diff --git a/ambari-server/src/test/java/org/apache/ambari/server/security/ldap/AmbariLdapDataPopulatorTest.java b/ambari-server/src/test/java/org/apache/ambari/server/security/ldap/AmbariLdapDataPopulatorTest.java index d217456..6143cf8 100644 --- a/ambari-server/src/test/java/org/apache/ambari/server/security/ldap/AmbariLdapDataPopulatorTest.java +++ b/ambari-server/src/test/java/org/apache/ambari/server/security/ldap/AmbariLdapDataPopulatorTest.java @@ -259,7 +259,7 @@ public class AmbariLdapDataPopulatorTest { LdapTemplate ldapTemplate = createNiceMock(LdapTemplate.class); LdapServerProperties ldapServerProperties = createNiceMock(LdapServerProperties.class); expect(users.getAllGroups()).andReturn(groupList); - expect(users.getAllUsers()).andReturn(Collections.EMPTY_LIST); + expect(users.getAllUsers()).andReturn(Collections.emptyList()); replay(ldapTemplate, ldapServerProperties, users, configuration); replay(group1, group2, group3, group4, group5); @@ -270,13 +270,13 @@ public class AmbariLdapDataPopulatorTest { .withConstructor(configuration, users) .createNiceMock(); - expect(populator.getLdapGroups("group2")).andReturn(Collections.EMPTY_SET); + expect(populator.getLdapGroups("group2")).andReturn(Collections.emptySet()); LdapGroupDto externalGroup1 = createNiceMock(LdapGroupDto.class); LdapBatchDto batchInfo = new LdapBatchDto(); - populator.refreshGroupMembers(eq(batchInfo), eq(externalGroup1), anyObject(Map.class), anyObject(Map.class), anyObject(Set.class), anyBoolean()); + populator.refreshGroupMembers(eq(batchInfo), eq(externalGroup1), EasyMock.>anyObject(), EasyMock.>anyObject(), EasyMock.>anyObject(), anyBoolean()); expectLastCall(); expect(populator.getLdapGroups("group4")).andReturn(Collections.singleton(externalGroup1)); - expect(populator.getLdapGroups("group5")).andReturn(Collections.EMPTY_SET); + expect(populator.getLdapGroups("group5")).andReturn(Collections.emptySet()); replay(populator); populator.setLdapTemplate(ldapTemplate); @@ -313,7 +313,7 @@ public class AmbariLdapDataPopulatorTest { Configuration configuration = createNiceMock(Configuration.class); Users users = createNiceMock(Users.class); expect(users.getAllGroups()).andReturn(Arrays.asList(group1, group2)); - expect(users.getAllUsers()).andReturn(Collections.EMPTY_LIST); + expect(users.getAllUsers()).andReturn(Collections.emptyList()); expect(configuration.getLdapServerProperties()).andReturn(new LdapServerProperties()).anyTimes(); LdapGroupDto group1Dto = new LdapGroupDto(); @@ -324,7 +324,7 @@ public class AmbariLdapDataPopulatorTest { LdapGroupDto group2Dto = new LdapGroupDto(); group2Dto.setGroupName("group2"); - group2Dto.setMemberAttributes(Collections.EMPTY_SET); + group2Dto.setMemberAttributes(Collections.emptySet()); Set groupDtos2 = Sets.newHashSet(); groupDtos2.add(group2Dto); @@ -373,7 +373,7 @@ public class AmbariLdapDataPopulatorTest { LdapTemplate ldapTemplate = createNiceMock(LdapTemplate.class); LdapServerProperties ldapServerProperties = createNiceMock(LdapServerProperties.class); expect(users.getAllGroups()).andReturn(groupList); - expect(users.getAllUsers()).andReturn(Collections.EMPTY_LIST); + expect(users.getAllUsers()).andReturn(Collections.emptyList()); replay(ldapTemplate, ldapServerProperties, users, configuration); replay(group1, group2, group3, group4); @@ -398,14 +398,14 @@ public class AmbariLdapDataPopulatorTest { Set externalGroups = createSet(externalGroup3, externalGroup4); for (LdapGroupDto externalGroup : externalGroups) { populator.refreshGroupMembers(eq(batchInfo), eq(externalGroup), - anyObject(Map.class), anyObject(Map.class), anyObject(Set.class), anyBoolean()); + EasyMock.>anyObject(), EasyMock.>anyObject(), EasyMock.>anyObject(), anyBoolean()); expectLastCall(); } populator.refreshGroupMembers(eq(batchInfo), eq(externalGroup1), - anyObject(Map.class), anyObject(Map.class), anyObject(Set.class), anyBoolean()); + EasyMock.>anyObject(), EasyMock.>anyObject(), EasyMock.>anyObject(), anyBoolean()); expectLastCall(); - populator.refreshGroupMembers(eq(batchInfo), eq(externalGroup2), anyObject(Map.class), - anyObject(Map.class), anyObject(Set.class), anyBoolean()); + populator.refreshGroupMembers(eq(batchInfo), eq(externalGroup2), EasyMock.>anyObject(), + EasyMock.>anyObject(), EasyMock.>anyObject(), anyBoolean()); expectLastCall(); expect(populator.getLdapGroups("x*")).andReturn(externalGroups); expect(populator.getLdapGroups("group1")).andReturn(Collections.singleton(externalGroup1)); @@ -458,7 +458,7 @@ public class AmbariLdapDataPopulatorTest { LdapTemplate ldapTemplate = createNiceMock(LdapTemplate.class); LdapServerProperties ldapServerProperties = createNiceMock(LdapServerProperties.class); expect(users.getAllGroups()).andReturn(groupList); - expect(users.getAllUsers()).andReturn(Collections.EMPTY_LIST); + expect(users.getAllUsers()).andReturn(Collections.emptyList()); replay(ldapTemplate, ldapServerProperties, users, configuration); replay(group1, group2, group3, group4); @@ -483,12 +483,12 @@ public class AmbariLdapDataPopulatorTest { LdapBatchDto batchInfo = new LdapBatchDto(); Set externalGroups = createSet(externalGroup3, externalGroup4); for (LdapGroupDto externalGroup : externalGroups) { - populator.refreshGroupMembers(eq(batchInfo), eq(externalGroup), anyObject(Map.class), anyObject(Map.class), - anyObject(Set.class), anyBoolean()); + populator.refreshGroupMembers(eq(batchInfo), eq(externalGroup), EasyMock.>anyObject(), EasyMock.>anyObject(), + EasyMock.>anyObject(), anyBoolean()); expectLastCall(); } - populator.refreshGroupMembers(eq(batchInfo), eq(externalGroup2), anyObject(Map.class), - anyObject(Map.class), anyObject(Set.class), anyBoolean()); + populator.refreshGroupMembers(eq(batchInfo), eq(externalGroup2), EasyMock.>anyObject(), + EasyMock.>anyObject(), EasyMock.>anyObject(), anyBoolean()); expectLastCall(); expect(populator.getLdapGroups("x*")).andReturn(externalGroups); expect(populator.getLdapGroups("group2")).andReturn(Collections.singleton(externalGroup2)); @@ -535,7 +535,7 @@ public class AmbariLdapDataPopulatorTest { LdapTemplate ldapTemplate = createNiceMock(LdapTemplate.class); LdapServerProperties ldapServerProperties = createNiceMock(LdapServerProperties.class); expect(users.getAllGroups()).andReturn(groupList); - expect(users.getAllUsers()).andReturn(Collections.EMPTY_LIST); + expect(users.getAllUsers()).andReturn(Collections.emptyList()); replay(ldapTemplate, ldapServerProperties, users, configuration); replay(group1, group2, group3, group4); @@ -559,8 +559,8 @@ public class AmbariLdapDataPopulatorTest { LdapBatchDto batchInfo = new LdapBatchDto(); Set externalGroups = createSet(externalGroup1, externalGroup2, externalGroup3, externalGroup4); for (LdapGroupDto externalGroup : externalGroups) { - populator.refreshGroupMembers(eq(batchInfo), eq(externalGroup), anyObject(Map.class), - anyObject(Map.class), anyObject(Set.class), anyBoolean()); + populator.refreshGroupMembers(eq(batchInfo), eq(externalGroup), EasyMock.>anyObject(), + EasyMock.>anyObject(), EasyMock.>anyObject(), anyBoolean()); expectLastCall(); } expect(populator.getLdapGroups("group*")).andReturn(externalGroups); @@ -607,7 +607,7 @@ public class AmbariLdapDataPopulatorTest { LdapTemplate ldapTemplate = createNiceMock(LdapTemplate.class); LdapServerProperties ldapServerProperties = createNiceMock(LdapServerProperties.class); expect(users.getAllGroups()).andReturn(groupList); - expect(users.getAllUsers()).andReturn(Collections.EMPTY_LIST); + expect(users.getAllUsers()).andReturn(Collections.emptyList()); replay(ldapTemplate, ldapServerProperties, users, configuration); replay(group1, group2, group3, group4); @@ -631,7 +631,7 @@ public class AmbariLdapDataPopulatorTest { LdapBatchDto batchInfo = new LdapBatchDto(); Set externalGroups = createSet(externalGroup3, externalGroup4); expect(populator.getLdapGroups("x*")).andReturn(externalGroups); - expect(populator.getLdapGroups("group1")).andReturn(Collections.EMPTY_SET); + expect(populator.getLdapGroups("group1")).andReturn(Collections.emptySet()); expect(populator.getLdapGroups("group2")).andReturn(Collections.singleton(externalGroup2)); replay(populator); @@ -667,7 +667,7 @@ public class AmbariLdapDataPopulatorTest { LdapTemplate ldapTemplate = createNiceMock(LdapTemplate.class); LdapServerProperties ldapServerProperties = createNiceMock(LdapServerProperties.class); expect(users.getAllGroups()).andReturn(groupList); - expect(users.getAllUsers()).andReturn(Collections.EMPTY_LIST); + expect(users.getAllUsers()).andReturn(Collections.emptyList()); replay(ldapTemplate, ldapServerProperties, users, configuration); replay(group1, group2, group3, group4, group5); @@ -690,8 +690,8 @@ public class AmbariLdapDataPopulatorTest { LdapBatchDto batchInfo = new LdapBatchDto(); Set externalGroups = createSet(externalGroup1, externalGroup2, externalGroup3, externalGroup4); for (LdapGroupDto externalGroup : externalGroups) { - populator.refreshGroupMembers(eq(batchInfo), eq(externalGroup), anyObject(Map.class), - anyObject(Map.class), anyObject(Set.class), anyBoolean()); + populator.refreshGroupMembers(eq(batchInfo), eq(externalGroup), EasyMock.>anyObject(), + EasyMock.>anyObject(), EasyMock.>anyObject(), anyBoolean()); expectLastCall(); } @@ -734,7 +734,7 @@ public class AmbariLdapDataPopulatorTest { LdapTemplate ldapTemplate = createNiceMock(LdapTemplate.class); LdapServerProperties ldapServerProperties = createNiceMock(LdapServerProperties.class); expect(users.getAllGroups()).andReturn(Arrays.asList(group1, group2)); - expect(users.getAllUsers()).andReturn(Collections.EMPTY_LIST); + expect(users.getAllUsers()).andReturn(Collections.emptyList()); replay(ldapTemplate, ldapServerProperties, users, configuration); replay(group1, group2); @@ -752,8 +752,8 @@ public class AmbariLdapDataPopulatorTest { LdapBatchDto batchInfo = new LdapBatchDto(); Set externalGroups = createSet(externalGroup1, externalGroup2); for (LdapGroupDto externalGroup : externalGroups) { - populator.refreshGroupMembers(eq(batchInfo), eq(externalGroup), anyObject(Map.class), - anyObject(Map.class), anyObject(Set.class), anyBoolean()); + populator.refreshGroupMembers(eq(batchInfo), eq(externalGroup), EasyMock.>anyObject(), + EasyMock.>anyObject(), EasyMock.>anyObject(), anyBoolean()); expectLastCall(); } expect(populator.getExternalLdapGroupInfo()).andReturn(externalGroups); @@ -801,7 +801,7 @@ public class AmbariLdapDataPopulatorTest { LdapTemplate ldapTemplate = createNiceMock(LdapTemplate.class); LdapServerProperties ldapServerProperties = createNiceMock(LdapServerProperties.class); expect(users.getAllGroups()).andReturn(groupList); - expect(users.getAllUsers()).andReturn(Collections.EMPTY_LIST); + expect(users.getAllUsers()).andReturn(Collections.emptyList()); replay(ldapTemplate, ldapServerProperties, users, configuration); replay(group1, group2, group3, group4); @@ -817,8 +817,8 @@ public class AmbariLdapDataPopulatorTest { LdapBatchDto batchInfo = new LdapBatchDto(); Set externalGroups = createSet(externalGroup1); for (LdapGroupDto externalGroup : externalGroups) { - populator.refreshGroupMembers(eq(batchInfo), eq(externalGroup), anyObject(Map.class), - anyObject(Map.class), anyObject(Set.class), anyBoolean()); + populator.refreshGroupMembers(eq(batchInfo), eq(externalGroup), EasyMock.>anyObject(), + EasyMock.>anyObject(), EasyMock.>anyObject(), anyBoolean()); expectLastCall(); } expect(populator.getExternalLdapGroupInfo()).andReturn(externalGroups); @@ -863,7 +863,7 @@ public class AmbariLdapDataPopulatorTest { LdapTemplate ldapTemplate = createNiceMock(LdapTemplate.class); LdapServerProperties ldapServerProperties = createNiceMock(LdapServerProperties.class); expect(users.getAllGroups()).andReturn(groupList); - expect(users.getAllUsers()).andReturn(Collections.EMPTY_LIST); + expect(users.getAllUsers()).andReturn(Collections.emptyList()); replay(ldapTemplate, ldapServerProperties, users, configuration); replay(group1, group2, group3); @@ -881,8 +881,8 @@ public class AmbariLdapDataPopulatorTest { LdapBatchDto batchInfo = new LdapBatchDto(); Set externalGroups = createSet(externalGroup1, externalGroup2); for (LdapGroupDto externalGroup : externalGroups) { - populator.refreshGroupMembers(eq(batchInfo), eq(externalGroup), anyObject(Map.class), - anyObject(Map.class), anyObject(Set.class), anyBoolean()); + populator.refreshGroupMembers(eq(batchInfo), eq(externalGroup), EasyMock.>anyObject(), + EasyMock.>anyObject(), EasyMock.>anyObject(), anyBoolean()); expectLastCall(); } expect(populator.getExternalLdapGroupInfo()).andReturn(externalGroups); @@ -1115,7 +1115,7 @@ public class AmbariLdapDataPopulatorTest { .createNiceMock(); - expect(populator.getExternalLdapUserInfo()).andReturn(Collections.EMPTY_SET); + expect(populator.getExternalLdapUserInfo()).andReturn(Collections.emptySet()); replay(populator); populator.setLdapTemplate(ldapTemplate); @@ -1226,7 +1226,7 @@ public class AmbariLdapDataPopulatorTest { .withConstructor(configuration, users) .createNiceMock(); - expect(populator.getLdapUsers("synced_user1")).andReturn(Collections.EMPTY_SET); + expect(populator.getLdapUsers("synced_user1")).andReturn(Collections.emptySet()); expect(populator.getLdapUsers("synced_user2")).andReturn(Collections.singleton(createNiceMock(LdapUserDto.class))); replay(populator); @@ -1468,7 +1468,7 @@ public class AmbariLdapDataPopulatorTest { expect(populator.getLdapUsers("xuser*")).andReturn(createSet(externalUser3, externalUser4)); expect(populator.getLdapUsers("user1")).andReturn(Collections.singleton(externalUser1)); - expect(populator.getLdapUsers("user2")).andReturn(Collections.EMPTY_SET); + expect(populator.getLdapUsers("user2")).andReturn(Collections.emptySet()); replay(populator); populator.setLdapTemplate(ldapTemplate); @@ -1608,7 +1608,7 @@ public class AmbariLdapDataPopulatorTest { expect(users.getAllUsers()).andReturn(new ArrayList(allUsers)); final List removedUsers = new ArrayList(); - final Capture userCapture = new Capture(); + final Capture userCapture = EasyMock.newCapture(); users.removeUser(capture(userCapture)); expectLastCall().andAnswer(new IAnswer() { @Override @@ -1643,8 +1643,8 @@ public class AmbariLdapDataPopulatorTest { Users users = createNiceMock(Users.class); LdapTemplate ldapTemplate = createNiceMock(LdapTemplate.class); LdapServerProperties ldapServerProperties = createNiceMock(LdapServerProperties.class); - Capture contextMapperCapture = new Capture(); - Capture searchControlsCapture = new Capture(); + Capture contextMapperCapture = EasyMock.newCapture(); + Capture searchControlsCapture = EasyMock.newCapture(); PagedResultsDirContextProcessor processor = createNiceMock(PagedResultsDirContextProcessor.class); PagedResultsCookie cookie = createNiceMock(PagedResultsCookie.class); LdapUserDto dto = new LdapUserDto(); @@ -1682,8 +1682,8 @@ public class AmbariLdapDataPopulatorTest { Users users = createNiceMock(Users.class); LdapTemplate ldapTemplate = createNiceMock(LdapTemplate.class); LdapServerProperties ldapServerProperties = createNiceMock(LdapServerProperties.class); - Capture contextMapperCapture = new Capture(); - Capture searchControlsCapture = new Capture(); + Capture contextMapperCapture = EasyMock.newCapture(); + Capture searchControlsCapture = EasyMock.newCapture(); PagedResultsDirContextProcessor processor = createNiceMock(PagedResultsDirContextProcessor.class); PagedResultsCookie cookie = createNiceMock(PagedResultsCookie.class); LdapUserDto dto = new LdapUserDto(); http://git-wip-us.apache.org/repos/asf/ambari/blob/edce0b11/ambari-server/src/test/java/org/apache/ambari/server/serveraction/kerberos/MITKerberosOperationHandlerTest.java ---------------------------------------------------------------------- diff --git a/ambari-server/src/test/java/org/apache/ambari/server/serveraction/kerberos/MITKerberosOperationHandlerTest.java b/ambari-server/src/test/java/org/apache/ambari/server/serveraction/kerberos/MITKerberosOperationHandlerTest.java index 17b9535..14e06aa 100644 --- a/ambari-server/src/test/java/org/apache/ambari/server/serveraction/kerberos/MITKerberosOperationHandlerTest.java +++ b/ambari-server/src/test/java/org/apache/ambari/server/serveraction/kerberos/MITKerberosOperationHandlerTest.java @@ -135,7 +135,7 @@ public class MITKerberosOperationHandlerTest extends KerberosOperationHandlerTes .addMockedMethod(methodExecuteCommand) .createNiceMock(); injector.injectMembers(handler); - expect(handler.executeCommand(anyObject(String[].class), anyObject(Map.class), anyObject(MITKerberosOperationHandler.InteractivePasswordHandler.class))) + expect(handler.executeCommand(anyObject(String[].class), EasyMock.>anyObject(), anyObject(MITKerberosOperationHandler.InteractivePasswordHandler.class))) .andAnswer(new IAnswer() { @Override public ShellCommandUtil.Result answer() throws Throwable { @@ -198,7 +198,7 @@ public class MITKerberosOperationHandlerTest extends KerberosOperationHandlerTes public void testCreatePrincipalPrincipalAlreadyNotExists() throws Exception { MITKerberosOperationHandler handler = createMock(); - expect(handler.executeCommand(anyObject(String[].class), anyObject(Map.class), anyObject(MITKerberosOperationHandler.InteractivePasswordHandler.class))) + expect(handler.executeCommand(anyObject(String[].class), EasyMock.>anyObject(), anyObject(MITKerberosOperationHandler.InteractivePasswordHandler.class))) .andAnswer(new IAnswer() { @Override public ShellCommandUtil.Result answer() throws Throwable { @@ -263,7 +263,7 @@ public class MITKerberosOperationHandlerTest extends KerberosOperationHandlerTes public void testTestAdministratorCredentialsIncorrectAdminPassword() throws Exception { MITKerberosOperationHandler handler = createMock(); - expect(handler.executeCommand(anyObject(String[].class), anyObject(Map.class), anyObject(MITKerberosOperationHandler.InteractivePasswordHandler.class))) + expect(handler.executeCommand(anyObject(String[].class), EasyMock.>anyObject(), anyObject(MITKerberosOperationHandler.InteractivePasswordHandler.class))) .andAnswer(new IAnswer() { @Override public ShellCommandUtil.Result answer() throws Throwable { @@ -294,7 +294,7 @@ public class MITKerberosOperationHandlerTest extends KerberosOperationHandlerTes public void testTestAdministratorCredentialsIncorrectAdminPrincipal() throws Exception { MITKerberosOperationHandler handler = createMock(); - expect(handler.executeCommand(anyObject(String[].class), anyObject(Map.class), anyObject(MITKerberosOperationHandler.InteractivePasswordHandler.class))) + expect(handler.executeCommand(anyObject(String[].class), EasyMock.>anyObject(), anyObject(MITKerberosOperationHandler.InteractivePasswordHandler.class))) .andAnswer(new IAnswer() { @Override public ShellCommandUtil.Result answer() throws Throwable { @@ -325,7 +325,7 @@ public class MITKerberosOperationHandlerTest extends KerberosOperationHandlerTes public void testTestAdministratorCredentialsInvalidRealm() throws Exception { MITKerberosOperationHandler handler = createMock(); - expect(handler.executeCommand(anyObject(String[].class), anyObject(Map.class), anyObject(MITKerberosOperationHandler.InteractivePasswordHandler.class))) + expect(handler.executeCommand(anyObject(String[].class), EasyMock.>anyObject(), anyObject(MITKerberosOperationHandler.InteractivePasswordHandler.class))) .andAnswer(new IAnswer() { @Override public ShellCommandUtil.Result answer() throws Throwable { @@ -356,7 +356,7 @@ public class MITKerberosOperationHandlerTest extends KerberosOperationHandlerTes public void testTestAdministratorCredentialsInvalidRealm2() throws Exception { MITKerberosOperationHandler handler = createMock(); - expect(handler.executeCommand(anyObject(String[].class), anyObject(Map.class), anyObject(MITKerberosOperationHandler.InteractivePasswordHandler.class))) + expect(handler.executeCommand(anyObject(String[].class), EasyMock.>anyObject(), anyObject(MITKerberosOperationHandler.InteractivePasswordHandler.class))) .andAnswer(new IAnswer() { @Override public ShellCommandUtil.Result answer() throws Throwable { @@ -387,7 +387,7 @@ public class MITKerberosOperationHandlerTest extends KerberosOperationHandlerTes public void testTestAdministratorCredentialsKDCConnectionException() throws Exception { MITKerberosOperationHandler handler = createMock(); - expect(handler.executeCommand(anyObject(String[].class), anyObject(Map.class), anyObject(MITKerberosOperationHandler.InteractivePasswordHandler.class))) + expect(handler.executeCommand(anyObject(String[].class), EasyMock.>anyObject(), anyObject(MITKerberosOperationHandler.InteractivePasswordHandler.class))) .andAnswer(new IAnswer() { @Override public ShellCommandUtil.Result answer() throws Throwable { @@ -418,7 +418,7 @@ public class MITKerberosOperationHandlerTest extends KerberosOperationHandlerTes public void testTestAdministratorCredentialsKDCConnectionException2() throws Exception { MITKerberosOperationHandler handler = createMock(); - expect(handler.executeCommand(anyObject(String[].class), anyObject(Map.class), anyObject(MITKerberosOperationHandler.InteractivePasswordHandler.class))) + expect(handler.executeCommand(anyObject(String[].class), EasyMock.>anyObject(), anyObject(MITKerberosOperationHandler.InteractivePasswordHandler.class))) .andAnswer(new IAnswer() { @Override public ShellCommandUtil.Result answer() throws Throwable { @@ -449,7 +449,7 @@ public class MITKerberosOperationHandlerTest extends KerberosOperationHandlerTes public void testTestAdministratorCredentialsNotFound() throws Exception { MITKerberosOperationHandler handler = createMock(); - expect(handler.executeCommand(anyObject(String[].class), anyObject(Map.class), anyObject(MITKerberosOperationHandler.InteractivePasswordHandler.class))) + expect(handler.executeCommand(anyObject(String[].class), EasyMock.>anyObject(), anyObject(MITKerberosOperationHandler.InteractivePasswordHandler.class))) .andAnswer(new IAnswer() { @Override public ShellCommandUtil.Result answer() throws Throwable { @@ -480,7 +480,7 @@ public class MITKerberosOperationHandlerTest extends KerberosOperationHandlerTes public void testTestAdministratorCredentialsSuccess() throws Exception { MITKerberosOperationHandler handler = createMock(); - expect(handler.executeCommand(anyObject(String[].class), anyObject(Map.class), anyObject(MITKerberosOperationHandler.InteractivePasswordHandler.class))) + expect(handler.executeCommand(anyObject(String[].class), EasyMock.>anyObject(), anyObject(MITKerberosOperationHandler.InteractivePasswordHandler.class))) .andAnswer(new IAnswer() { @Override public ShellCommandUtil.Result answer() throws Throwable { http://git-wip-us.apache.org/repos/asf/ambari/blob/edce0b11/ambari-server/src/test/java/org/apache/ambari/server/serveraction/kerberos/UpdateKerberosConfigsServerActionTest.java ---------------------------------------------------------------------- diff --git a/ambari-server/src/test/java/org/apache/ambari/server/serveraction/kerberos/UpdateKerberosConfigsServerActionTest.java b/ambari-server/src/test/java/org/apache/ambari/server/serveraction/kerberos/UpdateKerberosConfigsServerActionTest.java index 1a38d87..fc9c857 100644 --- a/ambari-server/src/test/java/org/apache/ambari/server/serveraction/kerberos/UpdateKerberosConfigsServerActionTest.java +++ b/ambari-server/src/test/java/org/apache/ambari/server/serveraction/kerberos/UpdateKerberosConfigsServerActionTest.java @@ -34,6 +34,7 @@ import org.apache.ambari.server.state.Cluster; import org.apache.ambari.server.state.Clusters; import org.apache.ambari.server.state.ConfigHelper; import org.apache.ambari.server.state.stack.OsFamily; +import org.easymock.EasyMock; import org.easymock.EasyMockSupport; import org.junit.Before; import org.junit.Rule; @@ -100,7 +101,7 @@ public class UpdateKerberosConfigsServerActionTest extends EasyMockSupport{ ConfigHelper configHelper = injector.getInstance(ConfigHelper.class); configHelper.updateConfigType(anyObject(Cluster.class), anyObject(AmbariManagementController.class), - anyObject(String.class), anyObject(Map.class), anyObject(Collection.class), anyObject(String.class), anyObject(String.class)); + anyObject(String.class), EasyMock.>anyObject(), EasyMock.>anyObject(), anyObject(String.class), anyObject(String.class)); expectLastCall().atLeastOnce(); replayAll(); http://git-wip-us.apache.org/repos/asf/ambari/blob/edce0b11/ambari-server/src/test/java/org/apache/ambari/server/serveraction/upgrades/HiveZKQuorumConfigActionTest.java ---------------------------------------------------------------------- diff --git a/ambari-server/src/test/java/org/apache/ambari/server/serveraction/upgrades/HiveZKQuorumConfigActionTest.java b/ambari-server/src/test/java/org/apache/ambari/server/serveraction/upgrades/HiveZKQuorumConfigActionTest.java index cd5eb9d..fd61c57 100644 --- a/ambari-server/src/test/java/org/apache/ambari/server/serveraction/upgrades/HiveZKQuorumConfigActionTest.java +++ b/ambari-server/src/test/java/org/apache/ambari/server/serveraction/upgrades/HiveZKQuorumConfigActionTest.java @@ -88,7 +88,7 @@ public class HiveZKQuorumConfigActionTest { EasyMock.expect(m_hiveSiteConfig.getProperties()).andReturn(hiveSiteProperties).atLeastOnce(); - m_hiveSiteConfig.setProperties(EasyMock.anyObject(Map.class)); + m_hiveSiteConfig.setProperties(EasyMock.>anyObject()); EasyMock.expectLastCall().once(); m_hiveSiteConfig.save(); http://git-wip-us.apache.org/repos/asf/ambari/blob/edce0b11/ambari-server/src/test/java/org/apache/ambari/server/serveraction/users/PostUserCreationHookServerActionTest.java ---------------------------------------------------------------------- diff --git a/ambari-server/src/test/java/org/apache/ambari/server/serveraction/users/PostUserCreationHookServerActionTest.java b/ambari-server/src/test/java/org/apache/ambari/server/serveraction/users/PostUserCreationHookServerActionTest.java index f5cdf48..a4d50ef 100644 --- a/ambari-server/src/test/java/org/apache/ambari/server/serveraction/users/PostUserCreationHookServerActionTest.java +++ b/ambari-server/src/test/java/org/apache/ambari/server/serveraction/users/PostUserCreationHookServerActionTest.java @@ -128,7 +128,7 @@ public class PostUserCreationHookServerActionTest extends EasyMockSupport { customScriptServerAction.setExecutionCommand(executionCommand); EasyMock.expect(collectionPersisterServiceFactoryMock.createCsvFilePersisterService(EasyMock.anyString())).andReturn(collectionPersisterService); - EasyMock.expect(collectionPersisterService.persistMap(EasyMock.anyObject(Map.class))).andReturn(Boolean.TRUE); + EasyMock.expect(collectionPersisterService.persistMap(EasyMock.>>anyObject())).andReturn(Boolean.TRUE); replayAll(); http://git-wip-us.apache.org/repos/asf/ambari/blob/edce0b11/ambari-server/src/test/java/org/apache/ambari/server/stack/RepoUtilTest.java ---------------------------------------------------------------------- diff --git a/ambari-server/src/test/java/org/apache/ambari/server/stack/RepoUtilTest.java b/ambari-server/src/test/java/org/apache/ambari/server/stack/RepoUtilTest.java index 9e18cd0..f7cb524 100644 --- a/ambari-server/src/test/java/org/apache/ambari/server/stack/RepoUtilTest.java +++ b/ambari-server/src/test/java/org/apache/ambari/server/stack/RepoUtilTest.java @@ -150,7 +150,7 @@ public class RepoUtilTest { private static ListMultimap serviceRepos(List operatingSystems, String repoName, String repoId, String baseUrl) { - ArrayListMultimap multimap = ArrayListMultimap.create(); + ListMultimap multimap = ArrayListMultimap.create(); for (String os: operatingSystems) { RepositoryInfo repoInfo = new RepositoryInfo(); repoInfo.setOsType(os); http://git-wip-us.apache.org/repos/asf/ambari/blob/edce0b11/ambari-server/src/test/java/org/apache/ambari/server/stack/StackModuleTest.java ---------------------------------------------------------------------- diff --git a/ambari-server/src/test/java/org/apache/ambari/server/stack/StackModuleTest.java b/ambari-server/src/test/java/org/apache/ambari/server/stack/StackModuleTest.java index 4698178..43acb67 100644 --- a/ambari-server/src/test/java/org/apache/ambari/server/stack/StackModuleTest.java +++ b/ambari-server/src/test/java/org/apache/ambari/server/stack/StackModuleTest.java @@ -131,7 +131,8 @@ public class StackModuleTest { assertEquals(removedServices.size(), 0); } - private StackModule createStackModule(String stackName, String stackVersion, Optional> stackRepos, + @SafeVarargs + private static StackModule createStackModule(String stackName, String stackVersion, Optional> stackRepos, List... serviceRepoLists) throws AmbariException { StackDirectory sd = mock(StackDirectory.class); List serviceDirectories = Lists.newArrayList(); http://git-wip-us.apache.org/repos/asf/ambari/blob/edce0b11/ambari-server/src/test/java/org/apache/ambari/server/state/cluster/ClusterTest.java ---------------------------------------------------------------------- diff --git a/ambari-server/src/test/java/org/apache/ambari/server/state/cluster/ClusterTest.java b/ambari-server/src/test/java/org/apache/ambari/server/state/cluster/ClusterTest.java index daa3abc..6772a68 100644 --- a/ambari-server/src/test/java/org/apache/ambari/server/state/cluster/ClusterTest.java +++ b/ambari-server/src/test/java/org/apache/ambari/server/state/cluster/ClusterTest.java @@ -78,6 +78,7 @@ import org.apache.ambari.server.orm.entities.HostEntity; import org.apache.ambari.server.orm.entities.HostStateEntity; import org.apache.ambari.server.orm.entities.HostVersionEntity; import org.apache.ambari.server.orm.entities.RepositoryVersionEntity; +import org.apache.ambari.server.orm.entities.ServiceComponentDesiredStateEntity; import org.apache.ambari.server.orm.entities.ServiceDesiredStateEntity; import org.apache.ambari.server.orm.entities.StackEntity; import org.apache.ambari.server.state.AgentVersion; @@ -282,7 +283,7 @@ public class ClusterTest { hostEntities.add(host2); clusterEntity.setHostEntities(hostEntities); - clusterEntity.setClusterConfigEntities(Collections.EMPTY_LIST); + clusterEntity.setClusterConfigEntities(Collections.emptyList()); //both sides of relation should be set when modifying in runtime host1.setClusterEntities(Arrays.asList(clusterEntity)); host2.setClusterEntities(Arrays.asList(clusterEntity)); @@ -300,7 +301,7 @@ public class ClusterTest { clusterServiceEntity.setServiceName("HDFS"); clusterServiceEntity.setClusterEntity(clusterEntity); clusterServiceEntity.setServiceComponentDesiredStateEntities( - Collections.EMPTY_LIST); + Collections.emptyList()); ServiceDesiredStateEntity stateEntity = mock(ServiceDesiredStateEntity.class); http://git-wip-us.apache.org/repos/asf/ambari/blob/edce0b11/ambari-server/src/test/java/org/apache/ambari/server/state/scheduler/BatchRequestJobTest.java ---------------------------------------------------------------------- diff --git a/ambari-server/src/test/java/org/apache/ambari/server/state/scheduler/BatchRequestJobTest.java b/ambari-server/src/test/java/org/apache/ambari/server/state/scheduler/BatchRequestJobTest.java index 0d0e03c..2281785 100644 --- a/ambari-server/src/test/java/org/apache/ambari/server/state/scheduler/BatchRequestJobTest.java +++ b/ambari-server/src/test/java/org/apache/ambari/server/state/scheduler/BatchRequestJobTest.java @@ -36,6 +36,7 @@ import java.util.Map; import org.apache.ambari.server.actionmanager.HostRoleStatus; import org.apache.ambari.server.scheduler.ExecutionScheduleManager; import org.easymock.Capture; +import org.easymock.EasyMock; import org.junit.Assert; import org.junit.Test; import org.quartz.JobDataMap; @@ -72,9 +73,9 @@ public class BatchRequestJobTest { BatchRequestResponse completedResponse = new BatchRequestResponse(); completedResponse.setStatus(HostRoleStatus.COMPLETED.toString()); - Capture executionIdCapture = new Capture(); - Capture batchIdCapture = new Capture(); - Capture clusterNameCapture = new Capture(); + Capture executionIdCapture = EasyMock.newCapture(); + Capture batchIdCapture = EasyMock.newCapture(); + Capture clusterNameCapture = EasyMock.newCapture(); expect(scheduleManagerMock.executeBatchRequest(captureLong(executionIdCapture), @@ -127,7 +128,7 @@ public class BatchRequestJobTest { expect(jobDataMap.getWrappedMap()).andReturn(properties); expect(jobDataMap.getString((String) anyObject())).andReturn("testJob").anyTimes(); - Capture triggerCapture = new Capture(); + Capture triggerCapture = EasyMock.newCapture(); scheduleManagerMock.scheduleJob(capture(triggerCapture)); expectLastCall().once(); http://git-wip-us.apache.org/repos/asf/ambari/blob/edce0b11/ambari-server/src/test/java/org/apache/ambari/server/topology/AmbariContextTest.java ---------------------------------------------------------------------- diff --git a/ambari-server/src/test/java/org/apache/ambari/server/topology/AmbariContextTest.java b/ambari-server/src/test/java/org/apache/ambari/server/topology/AmbariContextTest.java index fac5185..b0c4729 100644 --- a/ambari-server/src/test/java/org/apache/ambari/server/topology/AmbariContextTest.java +++ b/ambari-server/src/test/java/org/apache/ambari/server/topology/AmbariContextTest.java @@ -121,7 +121,7 @@ public class AmbariContextTest { private Configuration group1Configuration = null; private static final Collection group1Hosts = Arrays.asList(HOST1, HOST2); - private Capture> configGroupRequestCapture = new Capture>(); + private Capture> configGroupRequestCapture = EasyMock.newCapture(); @Before public void setUp() throws Exception { @@ -266,23 +266,23 @@ public class AmbariContextTest { @Test public void testCreateAmbariResources() throws Exception { // expectations - Capture clusterRequestCapture = new Capture(); + Capture clusterRequestCapture = EasyMock.newCapture(); controller.createCluster(capture(clusterRequestCapture)); expectLastCall().once(); expect(cluster.getServices()).andReturn(clusterServices).anyTimes(); - Capture> serviceRequestCapture = new Capture>(); - Capture> serviceComponentRequestCapture = new Capture>(); + Capture> serviceRequestCapture = EasyMock.newCapture(); + Capture> serviceComponentRequestCapture = EasyMock.newCapture(); serviceResourceProvider.createServices(capture(serviceRequestCapture)); expectLastCall().once(); componentResourceProvider.createComponents(capture(serviceComponentRequestCapture)); expectLastCall().once(); - Capture serviceInstallRequestCapture = new Capture(); - Capture serviceStartRequestCapture = new Capture(); - Capture installPredicateCapture = new Capture(); - Capture startPredicateCapture = new Capture(); + Capture serviceInstallRequestCapture = EasyMock.newCapture(); + Capture serviceStartRequestCapture = EasyMock.newCapture(); + Capture installPredicateCapture = EasyMock.newCapture(); + Capture startPredicateCapture = EasyMock.newCapture(); expect(serviceResourceProvider.updateResources(capture(serviceInstallRequestCapture), capture(installPredicateCapture))).andReturn(null).once(); http://git-wip-us.apache.org/repos/asf/ambari/blob/edce0b11/ambari-server/src/test/java/org/apache/ambari/server/topology/AsyncCallableServiceTest.java ---------------------------------------------------------------------- diff --git a/ambari-server/src/test/java/org/apache/ambari/server/topology/AsyncCallableServiceTest.java b/ambari-server/src/test/java/org/apache/ambari/server/topology/AsyncCallableServiceTest.java index 0f795b6..60bb2ba 100644 --- a/ambari-server/src/test/java/org/apache/ambari/server/topology/AsyncCallableServiceTest.java +++ b/ambari-server/src/test/java/org/apache/ambari/server/topology/AsyncCallableServiceTest.java @@ -88,7 +88,7 @@ public class AsyncCallableServiceTest extends EasyMockSupport { replayAll(); - asyncCallableService = new AsyncCallableService(taskMock, timeout, delay, executorServiceMock); + asyncCallableService = new AsyncCallableService<>(taskMock, timeout, delay, executorServiceMock); // WHEN Boolean serviceResult = asyncCallableService.call(); @@ -111,7 +111,7 @@ public class AsyncCallableServiceTest extends EasyMockSupport { } }; - asyncCallableService = new AsyncCallableService(hangingTask, timeout, delay, Executors.newScheduledThreadPool(2)); + asyncCallableService = new AsyncCallableService<>(hangingTask, timeout, delay, Executors.newScheduledThreadPool(2)); // WHEN Boolean serviceResult = asyncCallableService.call(); @@ -128,7 +128,7 @@ public class AsyncCallableServiceTest extends EasyMockSupport { expect(taskMock.call()).andReturn(Boolean.TRUE).times(1); replayAll(); - asyncCallableService = new AsyncCallableService(taskMock, timeout, delay, Executors.newScheduledThreadPool(2)); + asyncCallableService = new AsyncCallableService<>(taskMock, timeout, delay, Executors.newScheduledThreadPool(2)); // WHEN Boolean serviceResult = asyncCallableService.call(); @@ -146,7 +146,7 @@ public class AsyncCallableServiceTest extends EasyMockSupport { // the task to be throws exception expect(taskMock.call()).andThrow(new IllegalStateException("****************** TESTING ****************")).times(2, 3); replayAll(); - asyncCallableService = new AsyncCallableService(taskMock, timeout, delay, Executors.newScheduledThreadPool(2)); + asyncCallableService = new AsyncCallableService<>(taskMock, timeout, delay, Executors.newScheduledThreadPool(2)); // WHEN Boolean serviceResult = asyncCallableService.call(); @@ -170,7 +170,7 @@ public class AsyncCallableServiceTest extends EasyMockSupport { } }; - asyncCallableService = new AsyncCallableService(hangingTask, timeout, delay, Executors.newScheduledThreadPool(2)); + asyncCallableService = new AsyncCallableService<>(hangingTask, timeout, delay, Executors.newScheduledThreadPool(2)); // WHEN Boolean serviceResult = asyncCallableService.call(); http://git-wip-us.apache.org/repos/asf/ambari/blob/edce0b11/ambari-server/src/test/java/org/apache/ambari/server/topology/BlueprintImplTest.java ---------------------------------------------------------------------- diff --git a/ambari-server/src/test/java/org/apache/ambari/server/topology/BlueprintImplTest.java b/ambari-server/src/test/java/org/apache/ambari/server/topology/BlueprintImplTest.java index 0efa94b..1ffd8f7 100644 --- a/ambari-server/src/test/java/org/apache/ambari/server/topology/BlueprintImplTest.java +++ b/ambari-server/src/test/java/org/apache/ambari/server/topology/BlueprintImplTest.java @@ -37,6 +37,7 @@ import java.util.Set; import org.apache.ambari.server.controller.internal.Stack; import org.apache.ambari.server.orm.entities.BlueprintEntity; import org.apache.ambari.server.state.SecurityType; +import org.easymock.EasyMock; import org.junit.Before; import org.junit.Test; @@ -408,10 +409,10 @@ public class BlueprintImplTest { // iter.remove(); // // AmbariManagementController managementController = createMock(AmbariManagementController.class); -// Capture> stackServiceRequestCapture = new Capture>(); -// Capture> serviceComponentRequestCapture = new Capture>(); -// Capture stackConfigurationRequestCapture = new Capture(); -// Capture stackLevelConfigurationRequestCapture = new Capture(); +// Capture> stackServiceRequestCapture = EasyMock.newCapture(); +// Capture> serviceComponentRequestCapture = EasyMock.newCapture(); +// Capture stackConfigurationRequestCapture = EasyMock.newCapture(); +// Capture stackLevelConfigurationRequestCapture = EasyMock.newCapture(); // Request request = createMock(Request.class); // StackServiceResponse stackServiceResponse = createMock(StackServiceResponse.class); // StackServiceComponentResponse stackServiceComponentResponse = createNiceMock(StackServiceComponentResponse.class); @@ -433,7 +434,7 @@ public class BlueprintImplTest { // serviceComponents.add(component1); // serviceComponents.add(component2); // -// Capture entityCapture = new Capture(); +// Capture entityCapture = EasyMock.newCapture(); // // // set expectations // expect(blueprintFactory.createBlueprint(setProperties.iterator().next())).andReturn(blueprint).once(); @@ -516,10 +517,10 @@ public class BlueprintImplTest { // setConfigurationProperties(setProperties); // // AmbariManagementController managementController = createMock(AmbariManagementController.class); -// Capture> stackServiceRequestCapture = new Capture>(); -// Capture> serviceComponentRequestCapture = new Capture>(); -// Capture stackConfigurationRequestCapture = new Capture(); -// Capture stackLevelConfigurationRequestCapture = new Capture(); +// Capture> stackServiceRequestCapture = EasyMock.newCapture(); +// Capture> serviceComponentRequestCapture = EasyMock.newCapture(); +// Capture stackConfigurationRequestCapture = EasyMock.newCapture(); +// Capture stackLevelConfigurationRequestCapture = EasyMock.newCapture(); // Request request = createMock(Request.class); // StackServiceResponse stackServiceResponse = createMock(StackServiceResponse.class); // StackServiceComponentResponse stackServiceComponentResponse = createNiceMock(StackServiceComponentResponse.class); @@ -548,7 +549,7 @@ public class BlueprintImplTest { // serviceComponents.add(component1); // serviceComponents.add(component2); // -// Capture entityCapture = new Capture(); +// Capture entityCapture = EasyMock.newCapture(); // // // set expectations // expect(managementController.getStackServices(capture(stackServiceRequestCapture))).andReturn( @@ -634,10 +635,10 @@ public class BlueprintImplTest { // iter.remove(); // // AmbariManagementController managementController = createMock(AmbariManagementController.class); -// Capture> stackServiceRequestCapture = new Capture>(); -// Capture> serviceComponentRequestCapture = new Capture>(); -// Capture stackConfigurationRequestCapture = new Capture(); -// Capture stackLevelConfigurationRequestCapture = new Capture(); +// Capture> stackServiceRequestCapture = EasyMock.newCapture(); +// Capture> serviceComponentRequestCapture = EasyMock.newCapture(); +// Capture stackConfigurationRequestCapture = EasyMock.newCapture(); +// Capture stackLevelConfigurationRequestCapture = EasyMock.newCapture(); // Request request = createMock(Request.class); // StackServiceResponse stackServiceResponse = createMock(StackServiceResponse.class); // StackServiceComponentResponse stackServiceComponentResponse = createNiceMock(StackServiceComponentResponse.class); @@ -667,7 +668,7 @@ public class BlueprintImplTest { // serviceComponents.add(component1); // serviceComponents.add(component2); // -// Capture entityCapture = new Capture(); +// Capture entityCapture = EasyMock.newCapture(); // // // set expectations // expect(managementController.getStackServices(capture(stackServiceRequestCapture))).andReturn( @@ -752,10 +753,10 @@ public class BlueprintImplTest { // iter.remove(); // // AmbariManagementController managementController = createMock(AmbariManagementController.class); -// Capture> stackServiceRequestCapture = new Capture>(); -// Capture> serviceComponentRequestCapture = new Capture>(); -// Capture stackConfigurationRequestCapture = new Capture(); -// Capture stackLevelConfigurationRequestCapture = new Capture(); +// Capture> stackServiceRequestCapture = EasyMock.newCapture(); +// Capture> serviceComponentRequestCapture = EasyMock.newCapture(); +// Capture stackConfigurationRequestCapture = EasyMock.newCapture(); +// Capture stackLevelConfigurationRequestCapture = EasyMock.newCapture(); // Request request = createMock(Request.class); // StackServiceResponse stackServiceResponse = createMock(StackServiceResponse.class); // StackServiceComponentResponse stackServiceComponentResponse = createNiceMock(StackServiceComponentResponse.class); @@ -849,7 +850,7 @@ public class BlueprintImplTest { // { // Request request = createMock(Request.class); // AmbariManagementController managementController = createMock(AmbariManagementController.class); -// Capture> stackServiceRequestCapture = new Capture>(); +// Capture> stackServiceRequestCapture = EasyMock.newCapture(); // // Map services = new HashMap(); // ServiceInfo service = new ServiceInfo(); @@ -870,7 +871,7 @@ public class BlueprintImplTest { // BlueprintResourceProvider.HOST_GROUP_PROPERTY_ID)).iterator().next().get("components")). // iterator().next().put("name", "AMBARI_SERVER"); // -// Capture entityCapture = new Capture(); +// Capture entityCapture = EasyMock.newCapture(); // // // set expectations // expect(managementController.getStackServices(capture(stackServiceRequestCapture))).andReturn( http://git-wip-us.apache.org/repos/asf/ambari/blob/edce0b11/ambari-server/src/test/java/org/apache/ambari/server/topology/BlueprintValidatorImplTest.java ---------------------------------------------------------------------- diff --git a/ambari-server/src/test/java/org/apache/ambari/server/topology/BlueprintValidatorImplTest.java b/ambari-server/src/test/java/org/apache/ambari/server/topology/BlueprintValidatorImplTest.java index 4ca5b5f..08b9889 100644 --- a/ambari-server/src/test/java/org/apache/ambari/server/topology/BlueprintValidatorImplTest.java +++ b/ambari-server/src/test/java/org/apache/ambari/server/topology/BlueprintValidatorImplTest.java @@ -228,7 +228,8 @@ public class BlueprintValidatorImplTest { services.addAll(Arrays.asList("HIVE")); - expect(group1.getConfiguration()).andReturn(new Configuration(new HashMap(), new HashMap())).anyTimes(); + Configuration config = new Configuration(new HashMap>(), new HashMap>>()); + expect(group1.getConfiguration()).andReturn(config).anyTimes(); expect(stack.getComponents("HIVE")).andReturn(Collections.singleton("HIVE_METASTORE")).anyTimes(); expect(stack.getVersion()).andReturn("2.2").once(); @@ -251,7 +252,8 @@ public class BlueprintValidatorImplTest { services.addAll(Arrays.asList("OOZIE")); - expect(group1.getConfiguration()).andReturn(new Configuration(new HashMap(), new HashMap())).anyTimes(); + Configuration config = new Configuration(new HashMap>(), new HashMap>>()); + expect(group1.getConfiguration()).andReturn(config).anyTimes(); expect(stack.getComponents("OOZIE")).andReturn(Collections.singleton("OOZIE_SERVER")).anyTimes(); expect(stack.getVersion()).andReturn("2.2").once(); @@ -398,8 +400,8 @@ public class BlueprintValidatorImplTest { expect(dependency2.getName()).andReturn("dependency-2").anyTimes(); expect(dependency2.hasDependencyConditions()).andReturn(false).anyTimes(); - expect(dependencyConditionInfo1.isResolved(EasyMock.anyObject(Map.class))).andReturn(true).anyTimes(); - expect(dependencyConditionInfo2.isResolved(EasyMock.anyObject(Map.class))).andReturn(false).anyTimes(); + expect(dependencyConditionInfo1.isResolved(EasyMock.>>anyObject())).andReturn(true).anyTimes(); + expect(dependencyConditionInfo2.isResolved(EasyMock.>>anyObject())).andReturn(false).anyTimes(); expect(dependencyComponentInfo.isClient()).andReturn(false).anyTimes(); http://git-wip-us.apache.org/repos/asf/ambari/blob/edce0b11/ambari-server/src/test/java/org/apache/ambari/server/topology/ClusterConfigurationRequestTest.java ---------------------------------------------------------------------- diff --git a/ambari-server/src/test/java/org/apache/ambari/server/topology/ClusterConfigurationRequestTest.java b/ambari-server/src/test/java/org/apache/ambari/server/topology/ClusterConfigurationRequestTest.java index 74f3115..c97c568 100644 --- a/ambari-server/src/test/java/org/apache/ambari/server/topology/ClusterConfigurationRequestTest.java +++ b/ambari-server/src/test/java/org/apache/ambari/server/topology/ClusterConfigurationRequestTest.java @@ -32,6 +32,7 @@ import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertTrue; import java.util.ArrayList; +import java.util.Collection; import java.util.Collections; import java.util.HashMap; import java.util.HashSet; @@ -254,7 +255,7 @@ public class ClusterConfigurationRequestTest { .anyTimes(); expect(ambariContext.getClusterName(Long.valueOf(1))).andReturn("testCluster").anyTimes(); - expect(ambariContext.createConfigurationRequests(anyObject(Map.class))).andReturn(Collections + expect(ambariContext.createConfigurationRequests(EasyMock.>anyObject())).andReturn(Collections .emptyList()).anyTimes(); if (kerberosConfig == null) { @@ -263,10 +264,10 @@ public class ClusterConfigurationRequestTest { properties.put("testProperty", "KERBEROStestValue"); kerberosConfig.put("testConfigType", properties); } - expect(kerberosHelper.ensureHeadlessIdentities(anyObject(Cluster.class), anyObject(Map.class), anyObject - (Set.class))).andReturn(true).once(); - expect(kerberosHelper.getServiceConfigurationUpdates(anyObject(Cluster.class), anyObject(Map.class), anyObject - (Map.class), anyObject(Map.class), anyObject(Set.class), anyBoolean(), eq(false))).andReturn(kerberosConfig).once(); + expect(kerberosHelper.ensureHeadlessIdentities(anyObject(Cluster.class), EasyMock.>>anyObject(), + EasyMock.>anyObject())).andReturn(true).once(); + expect(kerberosHelper.getServiceConfigurationUpdates(anyObject(Cluster.class), EasyMock.>>anyObject(), + EasyMock.>>anyObject(), EasyMock.>>anyObject(), EasyMock.>anyObject(), anyBoolean(), eq(false))).andReturn(kerberosConfig).once(); Capture captureClusterName = newCapture(CaptureType.ALL); Capture> captureUpdatedConfigTypes = newCapture(CaptureType.ALL); @@ -334,7 +335,7 @@ public class ClusterConfigurationRequestTest { expect(topology.getHostGroupInfo()).andReturn(Collections.emptyMap()).anyTimes(); expect(topology.getClusterId()).andReturn(Long.valueOf(1)).anyTimes(); expect(ambariContext.getClusterName(Long.valueOf(1))).andReturn("testCluster").anyTimes(); - expect(ambariContext.createConfigurationRequests(anyObject(Map.class))).andReturn(Collections + expect(ambariContext.createConfigurationRequests(EasyMock.>anyObject())).andReturn(Collections .emptyList()).anyTimes(); http://git-wip-us.apache.org/repos/asf/ambari/blob/edce0b11/ambari-server/src/test/java/org/apache/ambari/server/topology/ClusterDeployWithStartOnlyTest.java ---------------------------------------------------------------------- diff --git a/ambari-server/src/test/java/org/apache/ambari/server/topology/ClusterDeployWithStartOnlyTest.java b/ambari-server/src/test/java/org/apache/ambari/server/topology/ClusterDeployWithStartOnlyTest.java index dd9b703..c205e57 100644 --- a/ambari-server/src/test/java/org/apache/ambari/server/topology/ClusterDeployWithStartOnlyTest.java +++ b/ambari-server/src/test/java/org/apache/ambari/server/topology/ClusterDeployWithStartOnlyTest.java @@ -67,6 +67,7 @@ import org.apache.ambari.server.state.Clusters; import org.apache.ambari.server.state.ComponentInfo; import org.apache.ambari.server.state.SecurityType; import org.easymock.Capture; +import org.easymock.EasyMock; import org.easymock.EasyMockRule; import org.easymock.EasyMockSupport; import org.easymock.Mock; @@ -210,7 +211,7 @@ public class ClusterDeployWithStartOnlyTest { topoConfiguration.setProperty("service2-site", "s2-prop", "s2-prop-value"); topoConfiguration.setProperty("cluster-env", "g-prop", "g-prop-value"); - //clusterRequestCapture = new Capture(); + //clusterRequestCapture = EasyMock.newCapture(); // group 1 has fqdn specified group1Info.addHost("host1"); group1Info.setConfiguration(topoGroup1Config); http://git-wip-us.apache.org/repos/asf/ambari/blob/edce0b11/ambari-server/src/test/java/org/apache/ambari/server/topology/ClusterInstallWithoutStartOnComponentLevelTest.java ---------------------------------------------------------------------- diff --git a/ambari-server/src/test/java/org/apache/ambari/server/topology/ClusterInstallWithoutStartOnComponentLevelTest.java b/ambari-server/src/test/java/org/apache/ambari/server/topology/ClusterInstallWithoutStartOnComponentLevelTest.java index 8ba608b..b276ecf 100644 --- a/ambari-server/src/test/java/org/apache/ambari/server/topology/ClusterInstallWithoutStartOnComponentLevelTest.java +++ b/ambari-server/src/test/java/org/apache/ambari/server/topology/ClusterInstallWithoutStartOnComponentLevelTest.java @@ -68,6 +68,7 @@ import org.apache.ambari.server.state.Clusters; import org.apache.ambari.server.state.ComponentInfo; import org.apache.ambari.server.state.SecurityType; import org.easymock.Capture; +import org.easymock.EasyMock; import org.easymock.EasyMockRule; import org.easymock.EasyMockSupport; import org.easymock.Mock; @@ -206,7 +207,7 @@ public class ClusterInstallWithoutStartOnComponentLevelTest { topoConfiguration.setProperty("service2-site", "s2-prop", "s2-prop-value"); topoConfiguration.setProperty("cluster-env", "g-prop", "g-prop-value"); - //clusterRequestCapture = new Capture(); + //clusterRequestCapture = EasyMock.newCapture(); // group 1 has fqdn specified group1Info.addHost("host1"); group1Info.setConfiguration(topoGroup1Config); http://git-wip-us.apache.org/repos/asf/ambari/blob/edce0b11/ambari-server/src/test/java/org/apache/ambari/server/topology/ClusterInstallWithoutStartTest.java ---------------------------------------------------------------------- diff --git a/ambari-server/src/test/java/org/apache/ambari/server/topology/ClusterInstallWithoutStartTest.java b/ambari-server/src/test/java/org/apache/ambari/server/topology/ClusterInstallWithoutStartTest.java index 63dd0a0..58862f1 100644 --- a/ambari-server/src/test/java/org/apache/ambari/server/topology/ClusterInstallWithoutStartTest.java +++ b/ambari-server/src/test/java/org/apache/ambari/server/topology/ClusterInstallWithoutStartTest.java @@ -68,6 +68,7 @@ import org.apache.ambari.server.state.Clusters; import org.apache.ambari.server.state.ComponentInfo; import org.apache.ambari.server.state.SecurityType; import org.easymock.Capture; +import org.easymock.EasyMock; import org.easymock.EasyMockRule; import org.easymock.EasyMockSupport; import org.easymock.Mock; @@ -206,7 +207,7 @@ public class ClusterInstallWithoutStartTest { topoConfiguration.setProperty("service2-site", "s2-prop", "s2-prop-value"); topoConfiguration.setProperty("cluster-env", "g-prop", "g-prop-value"); - //clusterRequestCapture = new Capture(); + //clusterRequestCapture = EasyMock.newCapture(); // group 1 has fqdn specified group1Info.addHost("host1"); group1Info.setConfiguration(topoGroup1Config); http://git-wip-us.apache.org/repos/asf/ambari/blob/edce0b11/ambari-server/src/test/java/org/apache/ambari/server/topology/ConfigureClusterTaskTest.java ---------------------------------------------------------------------- diff --git a/ambari-server/src/test/java/org/apache/ambari/server/topology/ConfigureClusterTaskTest.java b/ambari-server/src/test/java/org/apache/ambari/server/topology/ConfigureClusterTaskTest.java index 53bcdc3..aa7ba0e 100644 --- a/ambari-server/src/test/java/org/apache/ambari/server/topology/ConfigureClusterTaskTest.java +++ b/ambari-server/src/test/java/org/apache/ambari/server/topology/ConfigureClusterTaskTest.java @@ -74,8 +74,8 @@ public class ConfigureClusterTaskTest { Exception { // GIVEN // is it OK to handle the non existence of hostgroups as a success?! - expect(clusterConfigurationRequest.getRequiredHostGroups()).andReturn(Collections.EMPTY_LIST); - expect(clusterTopology.getHostGroupInfo()).andReturn(Collections.EMPTY_MAP); + expect(clusterConfigurationRequest.getRequiredHostGroups()).andReturn(Collections.emptyList()); + expect(clusterTopology.getHostGroupInfo()).andReturn(Collections.emptyMap()); // this is only called if the "prerequisites" are satisfied clusterConfigurationRequest.process(); @@ -94,8 +94,8 @@ public class ConfigureClusterTaskTest { public void testsShouldConfigureClusterTaskExecuteWhenCalledFromAsyncCallableService() throws Exception { // GIVEN // is it OK to handle the non existence of hostgroups as a success?! - expect(clusterConfigurationRequest.getRequiredHostGroups()).andReturn(Collections.EMPTY_LIST); - expect(clusterTopology.getHostGroupInfo()).andReturn(Collections.EMPTY_MAP); + expect(clusterConfigurationRequest.getRequiredHostGroups()).andReturn(Collections.emptyList()); + expect(clusterTopology.getHostGroupInfo()).andReturn(Collections.emptyMap()); // this is only called if the "prerequisites" are satisfied clusterConfigurationRequest.process(); http://git-wip-us.apache.org/repos/asf/ambari/blob/edce0b11/ambari-server/src/test/java/org/apache/ambari/server/topology/HostGroupInfoTest.java ---------------------------------------------------------------------- diff --git a/ambari-server/src/test/java/org/apache/ambari/server/topology/HostGroupInfoTest.java b/ambari-server/src/test/java/org/apache/ambari/server/topology/HostGroupInfoTest.java index 0efa9ad..93015e2 100644 --- a/ambari-server/src/test/java/org/apache/ambari/server/topology/HostGroupInfoTest.java +++ b/ambari-server/src/test/java/org/apache/ambari/server/topology/HostGroupInfoTest.java @@ -112,7 +112,7 @@ public class HostGroupInfoTest { group.setPredicate("Hosts/host_name=awesome.host.com"); assertEquals("Hosts/host_name=awesome.host.com", group.getPredicateString()); - assertEquals(new EqualsPredicate("Hosts/host_name", "awesome.host.com"), group.getPredicate()); + assertEquals(new EqualsPredicate<>("Hosts/host_name", "awesome.host.com"), group.getPredicate()); } @Test(expected=InvalidQueryException.class) http://git-wip-us.apache.org/repos/asf/ambari/blob/edce0b11/ambari-server/src/test/java/org/apache/ambari/server/topology/TopologyManagerTest.java ---------------------------------------------------------------------- diff --git a/ambari-server/src/test/java/org/apache/ambari/server/topology/TopologyManagerTest.java b/ambari-server/src/test/java/org/apache/ambari/server/topology/TopologyManagerTest.java index dad660c..7e6e5a3 100644 --- a/ambari-server/src/test/java/org/apache/ambari/server/topology/TopologyManagerTest.java +++ b/ambari-server/src/test/java/org/apache/ambari/server/topology/TopologyManagerTest.java @@ -189,7 +189,7 @@ public class TopologyManagerTest { topoConfiguration.setProperty("service2-site", "s2-prop", "s2-prop-value"); topoConfiguration.setProperty("cluster-env", "g-prop", "g-prop-value"); - //clusterRequestCapture = new Capture(); + //clusterRequestCapture = EasyMock.newCapture(); // group 1 has fqdn specified group1Info.addHost("host1"); group1Info.setConfiguration(topoGroup1Config); http://git-wip-us.apache.org/repos/asf/ambari/blob/edce0b11/ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog200Test.java ---------------------------------------------------------------------- diff --git a/ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog200Test.java b/ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog200Test.java index b00f9f0..87cea1b 100644 --- a/ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog200Test.java +++ b/ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog200Test.java @@ -84,6 +84,7 @@ import org.apache.ambari.server.state.StackId; import org.apache.ambari.server.state.StackInfo; import org.apache.ambari.server.state.stack.OsFamily; import org.easymock.Capture; +import org.easymock.EasyMock; import org.easymock.EasyMockSupport; import org.junit.After; import org.junit.Assert; @@ -138,34 +139,34 @@ public class UpgradeCatalog200Test { expect(configuration.getDatabaseUrl()).andReturn(Configuration.JDBC_IN_MEMORY_URL).anyTimes(); - Capture alertDefinitionIgnoreColumnCapture = new Capture(); - Capture alertDefinitionDescriptionColumnCapture = new Capture(); - Capture alertTargetGlobalColumnCapture = new Capture(); - Capture hostComponentStateColumnCapture = new Capture(); - Capture hostComponentVersionColumnCapture = new Capture(); - Capture clustersSecurityTypeColumnCapture = new Capture(); - Capture hostComponentStateSecurityStateColumnCapture = new Capture(); - Capture hostComponentDesiredStateSecurityStateColumnCapture = new Capture(); - Capture hostRoleCommandRetryColumnCapture = new Capture(); - Capture stageSkippableColumnCapture = new Capture(); - - Capture viewparameterLabelColumnCapture = new Capture(); - Capture viewparameterPlaceholderColumnCapture = new Capture(); - Capture viewparameterDefaultValueColumnCapture = new Capture(); - - Capture serviceDesiredStateSecurityStateColumnCapture = new Capture(); - Capture> clusterVersionCapture = new Capture>(); - Capture> hostVersionCapture = new Capture>(); - Capture valueColumnCapture = new Capture(); - Capture dataValueColumnCapture = new Capture(); - Capture> alertTargetStatesCapture = new Capture>(); - Capture> artifactCapture = new Capture>(); - Capture> kerberosPrincipalCapture = new Capture>(); - Capture> kerberosPrincipalHostCapture = new Capture>(); - - Capture> upgradeCapture = new Capture>(); - Capture> upgradeGroupCapture = new Capture>(); - Capture> upgradeItemCapture = new Capture>(); + Capture alertDefinitionIgnoreColumnCapture = EasyMock.newCapture(); + Capture alertDefinitionDescriptionColumnCapture = EasyMock.newCapture(); + Capture alertTargetGlobalColumnCapture = EasyMock.newCapture(); + Capture hostComponentStateColumnCapture = EasyMock.newCapture(); + Capture hostComponentVersionColumnCapture = EasyMock.newCapture(); + Capture clustersSecurityTypeColumnCapture = EasyMock.newCapture(); + Capture hostComponentStateSecurityStateColumnCapture = EasyMock.newCapture(); + Capture hostComponentDesiredStateSecurityStateColumnCapture = EasyMock.newCapture(); + Capture hostRoleCommandRetryColumnCapture = EasyMock.newCapture(); + Capture stageSkippableColumnCapture = EasyMock.newCapture(); + + Capture viewparameterLabelColumnCapture = EasyMock.newCapture(); + Capture viewparameterPlaceholderColumnCapture = EasyMock.newCapture(); + Capture viewparameterDefaultValueColumnCapture = EasyMock.newCapture(); + + Capture serviceDesiredStateSecurityStateColumnCapture = EasyMock.newCapture(); + Capture> clusterVersionCapture = EasyMock.newCapture(); + Capture> hostVersionCapture = EasyMock.newCapture(); + Capture valueColumnCapture = EasyMock.newCapture(); + Capture dataValueColumnCapture = EasyMock.newCapture(); + Capture> alertTargetStatesCapture = EasyMock.newCapture(); + Capture> artifactCapture = EasyMock.newCapture(); + Capture> kerberosPrincipalCapture = EasyMock.newCapture(); + Capture> kerberosPrincipalHostCapture = EasyMock.newCapture(); + + Capture> upgradeCapture = EasyMock.newCapture(); + Capture> upgradeGroupCapture = EasyMock.newCapture(); + Capture> upgradeItemCapture = EasyMock.newCapture(); // Alert Definition dbAccessor.addColumn(eq("alert_definition"), http://git-wip-us.apache.org/repos/asf/ambari/blob/edce0b11/ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog210Test.java ---------------------------------------------------------------------- diff --git a/ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog210Test.java b/ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog210Test.java index 0835823..36f66c6 100644 --- a/ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog210Test.java +++ b/ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog210Test.java @@ -87,6 +87,7 @@ import org.apache.ambari.server.state.kerberos.KerberosServiceDescriptor; import org.apache.ambari.server.state.stack.OsFamily; import org.easymock.Capture; import org.easymock.CaptureType; +import org.easymock.EasyMock; import org.easymock.EasyMockSupport; import org.junit.Assert; import org.junit.Test; @@ -353,9 +354,9 @@ public class UpgradeCatalog210Test { put("normal", mockClusterExpected); }}).once(); - Capture configTypeEnv = new Capture(); - Capture configTypeSite = new Capture(); - Capture configTypeServerSite = new Capture(); + Capture configTypeEnv = EasyMock.newCapture(); + Capture configTypeSite = EasyMock.newCapture(); + Capture configTypeServerSite = EasyMock.newCapture(); expect(mockClusterExpected.getDesiredConfigByType("hive-env")).andReturn(mockHiveEnv).atLeastOnce(); expect(mockClusterExpected.getDesiredConfigByType("hiveserver2-site")).andReturn(mockHiveServerSite).atLeastOnce(); @@ -517,7 +518,7 @@ public class UpgradeCatalog210Test { anyString(), capture(configCreation), anyString(), - (Map>)anyObject())).andReturn(null).atLeastOnce(); + EasyMock.>>anyObject())).andReturn(null).atLeastOnce(); easyMockSupport.replayAll(); upgradeCatalog210.updateHiveConfigs(); @@ -602,7 +603,7 @@ public class UpgradeCatalog210Test { anyString(), capture(configCreation), anyString(), - (Map>) anyObject())).andReturn(null).atLeastOnce(); + EasyMock.>>anyObject())).andReturn(null).atLeastOnce(); easyMockSupport.replayAll(); upgradeCatalog210.updateHiveConfigs(); @@ -792,8 +793,8 @@ public class UpgradeCatalog210Test { expect(mockHBaseSite.getProperties()).andReturn(propertiesExpectedHBaseSite).anyTimes(); expect(mockHBaseEnv.getProperties()).andReturn(propertiesExpectedHBaseEnv).anyTimes(); - Capture configType = new Capture(); - Capture configTag = new Capture(); + Capture configType = EasyMock.newCapture(); + Capture configTag = EasyMock.newCapture(); expect(mockClusterExpected.getConfig(capture(configType), capture(configTag))). andReturn(mockHBaseSite).atLeastOnce(); @@ -977,7 +978,7 @@ public class UpgradeCatalog210Test { UpgradeCatalog210 upgradeMock = createMockBuilder(UpgradeCatalog210.class).createMock(); - Capture> updatedData = new Capture>(); + Capture> updatedData = EasyMock.newCapture(); ArtifactEntity artifactEntity = createNiceMock(ArtifactEntity.class); expect(artifactEntity.getArtifactData()) @@ -1029,7 +1030,7 @@ public class UpgradeCatalog210Test { UpgradeCatalog210 upgradeMock = createMockBuilder(UpgradeCatalog210.class).createMock(); - Capture> updatedData = new Capture>(); + Capture> updatedData = EasyMock.newCapture(); ArtifactEntity artifactEntity = createNiceMock(ArtifactEntity.class); expect(artifactEntity.getArtifactData()) @@ -1074,18 +1075,18 @@ public class UpgradeCatalog210Test { // Column Capture section // Hosts - Capture clusterHostMappingColumnCapture = new Capture(); - Capture configGroupHostMappingColumnCapture = new Capture(); - Capture hostConfigMappingColumnCapture = new Capture(); - Capture hostsColumnCapture = new Capture(); - Capture hostComponentStateColumnCapture = new Capture(); - Capture hostComponentDesiredStateColumnCapture = new Capture(); - Capture hostRoleCommandColumnCapture = new Capture(); - Capture hostStateColumnCapture = new Capture(); - Capture hostVersionColumnCapture = new Capture(); - Capture kerberosPrincipalHostColumnCapture = new Capture(); - Capture requestOperationLevelColumnCapture = new Capture(); - Capture serviceConfigHostsColumnCapture = new Capture(); + Capture clusterHostMappingColumnCapture = EasyMock.newCapture(); + Capture configGroupHostMappingColumnCapture = EasyMock.newCapture(); + Capture hostConfigMappingColumnCapture = EasyMock.newCapture(); + Capture hostsColumnCapture = EasyMock.newCapture(); + Capture hostComponentStateColumnCapture = EasyMock.newCapture(); + Capture hostComponentDesiredStateColumnCapture = EasyMock.newCapture(); + Capture hostRoleCommandColumnCapture = EasyMock.newCapture(); + Capture hostStateColumnCapture = EasyMock.newCapture(); + Capture hostVersionColumnCapture = EasyMock.newCapture(); + Capture kerberosPrincipalHostColumnCapture = EasyMock.newCapture(); + Capture requestOperationLevelColumnCapture = EasyMock.newCapture(); + Capture serviceConfigHostsColumnCapture = EasyMock.newCapture(); captures.put("ClusterHostMapping", clusterHostMappingColumnCapture); captures.put("configgrouphostmapping", configGroupHostMappingColumnCapture); @@ -1156,14 +1157,14 @@ public class UpgradeCatalog210Test { public WidgetSectionDDL() { captures = new HashMap>>(); - Capture> userWidgetColumnsCapture = new Capture>(); - Capture> widgetLayoutColumnsCapture = new Capture>(); - Capture> widgetLayoutUserWidgetColumnsCapture = new Capture>(); + Capture> userWidgetColumnsCapture = EasyMock.newCapture(); + Capture> widgetLayoutColumnsCapture = EasyMock.newCapture(); + Capture> widgetLayoutUserWidgetColumnsCapture = EasyMock.newCapture(); captures.put("widget", userWidgetColumnsCapture); captures.put("widget_layout", widgetLayoutColumnsCapture); captures.put("widget_layout_user_widget", widgetLayoutUserWidgetColumnsCapture); - userActiveLayoutsColumnCapture = new Capture(); + userActiveLayoutsColumnCapture = EasyMock.newCapture(); } /** @@ -1220,10 +1221,10 @@ public class UpgradeCatalog210Test { public ViewSectionDDL() { captures = new HashMap>(); - Capture viewInstanceColumnCapture = new Capture(); - Capture viewInstanceAlterNamesColumnCapture = new Capture(); - Capture viewParamColumnCapture = new Capture(); - Capture viewBuildColumnCapture = new Capture(); + Capture viewInstanceColumnCapture = EasyMock.newCapture(); + Capture viewInstanceAlterNamesColumnCapture = EasyMock.newCapture(); + Capture viewParamColumnCapture = EasyMock.newCapture(); + Capture viewBuildColumnCapture = EasyMock.newCapture(); captures.put("viewinstance", viewInstanceColumnCapture); captures.put("viewinstance_alter_names", viewInstanceAlterNamesColumnCapture); @@ -1295,12 +1296,12 @@ public class UpgradeCatalog210Test { stringCaptures = new HashMap>(); classCaptures = new HashMap>(); - Capture textCaptureC = new Capture(); - Capture textCaptureH = new Capture(); - Capture classFromC = new Capture(); - Capture classFromH = new Capture(); - Capture classToC = new Capture(); - Capture classToH = new Capture(); + Capture textCaptureC = EasyMock.newCapture(); + Capture textCaptureH = EasyMock.newCapture(); + Capture classFromC = EasyMock.newCapture(); + Capture classFromH = EasyMock.newCapture(); + Capture classToC = EasyMock.newCapture(); + Capture classToH = EasyMock.newCapture(); stringCaptures.put("textCaptureC", textCaptureC); stringCaptures.put("textCaptureH", textCaptureH); http://git-wip-us.apache.org/repos/asf/ambari/blob/edce0b11/ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog211Test.java ---------------------------------------------------------------------- diff --git a/ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog211Test.java b/ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog211Test.java index 094a2d9..c705d89 100644 --- a/ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog211Test.java +++ b/ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog211Test.java @@ -50,6 +50,7 @@ import org.apache.ambari.server.state.Clusters; import org.apache.ambari.server.state.Config; import org.apache.ambari.server.state.stack.OsFamily; import org.easymock.Capture; +import org.easymock.EasyMock; import org.easymock.EasyMockSupport; import org.junit.Assert; import org.junit.Test; @@ -96,7 +97,7 @@ public class UpgradeCatalog211Test extends EasyMockSupport { statement.executeQuery(anyObject(String.class)); expectLastCall().andReturn(rs1).anyTimes(); - Capture queryCapture = new Capture(); + Capture queryCapture = EasyMock.newCapture(); dbAccessor.executeQuery(capture(queryCapture)); expectLastCall().once(); @@ -259,12 +260,12 @@ public class UpgradeCatalog211Test extends EasyMockSupport { .andReturn(configKerberosEnv) .once(); - Capture captureCR = new Capture(); + Capture captureCR = EasyMock.newCapture(); Capture clusterCapture = newCapture(); Capture typeCapture = newCapture(); - Capture propertiesCapture = newCapture(); + Capture> propertiesCapture = newCapture(); Capture tagCapture = newCapture(); - Capture attributesCapture = newCapture(); + Capture>> attributesCapture = newCapture(); expect(controller.createConfig(capture(clusterCapture), capture(typeCapture), @@ -394,12 +395,12 @@ public class UpgradeCatalog211Test extends EasyMockSupport { stringCaptures = new HashMap>(); classCaptures = new HashMap>(); - Capture textCaptureC = new Capture(); - Capture textCaptureH = new Capture(); - Capture classFromC = new Capture(); - Capture classFromH = new Capture(); - Capture classToC = new Capture(); - Capture classToH = new Capture(); + Capture textCaptureC = EasyMock.newCapture(); + Capture textCaptureH = EasyMock.newCapture(); + Capture classFromC = EasyMock.newCapture(); + Capture classFromH = EasyMock.newCapture(); + Capture classToC = EasyMock.newCapture(); + Capture classToH = EasyMock.newCapture(); stringCaptures.put("textCaptureC", textCaptureC); stringCaptures.put("textCaptureH", textCaptureH); http://git-wip-us.apache.org/repos/asf/ambari/blob/edce0b11/ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog212Test.java ---------------------------------------------------------------------- diff --git a/ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog212Test.java b/ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog212Test.java index 90a2549..d15ca25 100644 --- a/ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog212Test.java +++ b/ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog212Test.java @@ -59,6 +59,7 @@ import org.apache.ambari.server.state.ConfigHelper; import org.apache.ambari.server.state.StackId; import org.apache.ambari.server.state.stack.OsFamily; import org.easymock.Capture; +import org.easymock.EasyMock; import org.easymock.EasyMockRule; import org.easymock.EasyMockSupport; import org.easymock.Mock; @@ -466,7 +467,7 @@ public class UpgradeCatalog212Test { public HostRoleCommandDDL() { captures = new HashMap>(); - Capture hostRoleCommandAutoSkipColumnCapture = new Capture(); + Capture hostRoleCommandAutoSkipColumnCapture = EasyMock.newCapture(); captures.put("host_role_command", hostRoleCommandAutoSkipColumnCapture); }