http://git-wip-us.apache.org/repos/asf/ambari/blob/edbb5492/ambari-server/src/test/java/org/apache/ambari/server/api/predicate/operators/InOperatorTest.java ---------------------------------------------------------------------- diff --git a/ambari-server/src/test/java/org/apache/ambari/server/api/predicate/operators/InOperatorTest.java b/ambari-server/src/test/java/org/apache/ambari/server/api/predicate/operators/InOperatorTest.java index 256fecb..414d2c9 100644 --- a/ambari-server/src/test/java/org/apache/ambari/server/api/predicate/operators/InOperatorTest.java +++ b/ambari-server/src/test/java/org/apache/ambari/server/api/predicate/operators/InOperatorTest.java @@ -40,9 +40,9 @@ public class InOperatorTest { public void testToPredicate() throws Exception { String prop = "prop"; String val = "one,2,three"; - EqualsPredicate p1 = new EqualsPredicate<String>(prop, "one"); - EqualsPredicate p2 = new EqualsPredicate<String>(prop, "2"); - EqualsPredicate p3 = new EqualsPredicate<String>(prop, "three"); + EqualsPredicate p1 = new EqualsPredicate<>(prop, "one"); + EqualsPredicate p2 = new EqualsPredicate<>(prop, "2"); + EqualsPredicate p3 = new EqualsPredicate<>(prop, "three"); OrPredicate orPredicate = new OrPredicate(p1, p2, p3); assertEquals(orPredicate, new InOperator().toPredicate(prop, val));
http://git-wip-us.apache.org/repos/asf/ambari/blob/edbb5492/ambari-server/src/test/java/org/apache/ambari/server/api/predicate/operators/LessEqualsOperatorTest.java ---------------------------------------------------------------------- diff --git a/ambari-server/src/test/java/org/apache/ambari/server/api/predicate/operators/LessEqualsOperatorTest.java b/ambari-server/src/test/java/org/apache/ambari/server/api/predicate/operators/LessEqualsOperatorTest.java index 6e017b9..1702e33 100644 --- a/ambari-server/src/test/java/org/apache/ambari/server/api/predicate/operators/LessEqualsOperatorTest.java +++ b/ambari-server/src/test/java/org/apache/ambari/server/api/predicate/operators/LessEqualsOperatorTest.java @@ -38,7 +38,7 @@ public class LessEqualsOperatorTest { @Test public void testToPredicate() { - assertEquals(new LessEqualsPredicate<String>("1", "2"), + assertEquals(new LessEqualsPredicate<>("1", "2"), new LessEqualsOperator().toPredicate("1", "2")); } http://git-wip-us.apache.org/repos/asf/ambari/blob/edbb5492/ambari-server/src/test/java/org/apache/ambari/server/api/predicate/operators/LessOperatorTest.java ---------------------------------------------------------------------- diff --git a/ambari-server/src/test/java/org/apache/ambari/server/api/predicate/operators/LessOperatorTest.java b/ambari-server/src/test/java/org/apache/ambari/server/api/predicate/operators/LessOperatorTest.java index 5311ea7..0f14055 100644 --- a/ambari-server/src/test/java/org/apache/ambari/server/api/predicate/operators/LessOperatorTest.java +++ b/ambari-server/src/test/java/org/apache/ambari/server/api/predicate/operators/LessOperatorTest.java @@ -38,7 +38,7 @@ public class LessOperatorTest { @Test public void testToPredicate() { - assertEquals(new LessPredicate<String>("1", "2"), + assertEquals(new LessPredicate<>("1", "2"), new LessOperator().toPredicate("1", "2")); } http://git-wip-us.apache.org/repos/asf/ambari/blob/edbb5492/ambari-server/src/test/java/org/apache/ambari/server/api/predicate/operators/NotEqualsOperatorTest.java ---------------------------------------------------------------------- diff --git a/ambari-server/src/test/java/org/apache/ambari/server/api/predicate/operators/NotEqualsOperatorTest.java b/ambari-server/src/test/java/org/apache/ambari/server/api/predicate/operators/NotEqualsOperatorTest.java index d8e1f6a..4a28203 100644 --- a/ambari-server/src/test/java/org/apache/ambari/server/api/predicate/operators/NotEqualsOperatorTest.java +++ b/ambari-server/src/test/java/org/apache/ambari/server/api/predicate/operators/NotEqualsOperatorTest.java @@ -39,7 +39,7 @@ public class NotEqualsOperatorTest { @Test public void testToPredicate() { - assertEquals(new NotPredicate(new EqualsPredicate<String>("prop", "val")), + assertEquals(new NotPredicate(new EqualsPredicate<>("prop", "val")), new NotEqualsOperator().toPredicate("prop", "val")); } http://git-wip-us.apache.org/repos/asf/ambari/blob/edbb5492/ambari-server/src/test/java/org/apache/ambari/server/api/predicate/operators/NotOperatorTest.java ---------------------------------------------------------------------- diff --git a/ambari-server/src/test/java/org/apache/ambari/server/api/predicate/operators/NotOperatorTest.java b/ambari-server/src/test/java/org/apache/ambari/server/api/predicate/operators/NotOperatorTest.java index c23bc3a..ce7c256 100644 --- a/ambari-server/src/test/java/org/apache/ambari/server/api/predicate/operators/NotOperatorTest.java +++ b/ambari-server/src/test/java/org/apache/ambari/server/api/predicate/operators/NotOperatorTest.java @@ -39,7 +39,7 @@ public class NotOperatorTest { @Test public void testToPredicate() { - EqualsPredicate p = new EqualsPredicate<String>("prop", "val"); + EqualsPredicate p = new EqualsPredicate<>("prop", "val"); NotPredicate notPredicate = new NotPredicate(p); assertEquals(notPredicate, new NotOperator(1).toPredicate(null, p)); http://git-wip-us.apache.org/repos/asf/ambari/blob/edbb5492/ambari-server/src/test/java/org/apache/ambari/server/api/predicate/operators/OrOperatorTest.java ---------------------------------------------------------------------- diff --git a/ambari-server/src/test/java/org/apache/ambari/server/api/predicate/operators/OrOperatorTest.java b/ambari-server/src/test/java/org/apache/ambari/server/api/predicate/operators/OrOperatorTest.java index 74ec171..dae6dab 100644 --- a/ambari-server/src/test/java/org/apache/ambari/server/api/predicate/operators/OrOperatorTest.java +++ b/ambari-server/src/test/java/org/apache/ambari/server/api/predicate/operators/OrOperatorTest.java @@ -39,8 +39,8 @@ public class OrOperatorTest { @Test public void testToPredicate() { - EqualsPredicate p1 = new EqualsPredicate<String>("p1", "one"); - EqualsPredicate p2 = new EqualsPredicate<String>("p2", "two"); + EqualsPredicate p1 = new EqualsPredicate<>("p1", "one"); + EqualsPredicate p2 = new EqualsPredicate<>("p2", "two"); OrPredicate orPRedicate = new OrPredicate(p1, p2); assertEquals(orPRedicate, new OrOperator(1).toPredicate(p1, p2)); http://git-wip-us.apache.org/repos/asf/ambari/blob/edbb5492/ambari-server/src/test/java/org/apache/ambari/server/api/query/ExtendedResourcePredicateVisitorTest.java ---------------------------------------------------------------------- diff --git a/ambari-server/src/test/java/org/apache/ambari/server/api/query/ExtendedResourcePredicateVisitorTest.java b/ambari-server/src/test/java/org/apache/ambari/server/api/query/ExtendedResourcePredicateVisitorTest.java index 4127806..93df18f 100644 --- a/ambari-server/src/test/java/org/apache/ambari/server/api/query/ExtendedResourcePredicateVisitorTest.java +++ b/ambari-server/src/test/java/org/apache/ambari/server/api/query/ExtendedResourcePredicateVisitorTest.java @@ -42,49 +42,49 @@ public class ExtendedResourcePredicateVisitorTest { Resource resource2 = new ResourceImpl(Resource.Type.Service); resource2.setProperty("name", "service2"); - Map<String, Object> resource1SubProperties1 = new HashMap<String, Object>(); + Map<String, Object> resource1SubProperties1 = new HashMap<>(); resource1SubProperties1.put("sub1/category/p1", 1); resource1SubProperties1.put("sub1/category/p2", 2); resource1SubProperties1.put("sub1/category/p3", 3); - Map<String, Object> resource1SubProperties2 = new HashMap<String, Object>(); + Map<String, Object> resource1SubProperties2 = new HashMap<>(); resource1SubProperties2.put("sub1/category/p1", 1); resource1SubProperties2.put("sub1/category/p2", 4); resource1SubProperties2.put("sub1/category/p3", 6); - Map<String, Object> resource1SubProperties3 = new HashMap<String, Object>(); + Map<String, Object> resource1SubProperties3 = new HashMap<>(); resource1SubProperties3.put("sub1/category/p1", 1); resource1SubProperties3.put("sub1/category/p2", 8); resource1SubProperties3.put("sub1/category/p3", 12); - Set<Map<String, Object>> resource1SubPropertiesSet = new HashSet<Map<String, Object>>(); + Set<Map<String, Object>> resource1SubPropertiesSet = new HashSet<>(); resource1SubPropertiesSet.add(resource1SubProperties1); resource1SubPropertiesSet.add(resource1SubProperties2); resource1SubPropertiesSet.add(resource1SubProperties3); - Map<String, Object> resource2SubProperties1 = new HashMap<String, Object>(); + Map<String, Object> resource2SubProperties1 = new HashMap<>(); resource2SubProperties1.put("sub1/category/p1", 2); resource2SubProperties1.put("sub1/category/p2", 2); resource2SubProperties1.put("sub1/category/p3", 3); - Map<String, Object> resource2SubProperties2 = new HashMap<String, Object>(); + Map<String, Object> resource2SubProperties2 = new HashMap<>(); resource2SubProperties2.put("sub1/category/p1", 2); resource2SubProperties2.put("sub1/category/p2", 4); resource2SubProperties2.put("sub1/category/p3", 6); - Map<String, Object> resource2SubProperties3 = new HashMap<String, Object>(); + Map<String, Object> resource2SubProperties3 = new HashMap<>(); resource2SubProperties3.put("sub1/category/p1", 2); resource2SubProperties3.put("sub1/category/p2", 8); resource2SubProperties3.put("sub1/category/p3", 12); - Set<Map<String, Object>> resource2SubPropertiesSet = new HashSet<Map<String, Object>>(); + Set<Map<String, Object>> resource2SubPropertiesSet = new HashSet<>(); resource2SubPropertiesSet.add(resource2SubProperties1); resource2SubPropertiesSet.add(resource2SubProperties2); resource2SubPropertiesSet.add(resource2SubProperties3); - Map<Resource, Set<Map<String, Object>>> extendedPropertyMap = new HashMap<Resource, Set<Map<String, Object>>>(); + Map<Resource, Set<Map<String, Object>>> extendedPropertyMap = new HashMap<>(); extendedPropertyMap.put(resource1, resource1SubPropertiesSet); extendedPropertyMap.put(resource2, resource2SubPropertiesSet); http://git-wip-us.apache.org/repos/asf/ambari/blob/edbb5492/ambari-server/src/test/java/org/apache/ambari/server/api/query/JpaSortBuilderTest.java ---------------------------------------------------------------------- diff --git a/ambari-server/src/test/java/org/apache/ambari/server/api/query/JpaSortBuilderTest.java b/ambari-server/src/test/java/org/apache/ambari/server/api/query/JpaSortBuilderTest.java index adbcd32..394de9f 100644 --- a/ambari-server/src/test/java/org/apache/ambari/server/api/query/JpaSortBuilderTest.java +++ b/ambari-server/src/test/java/org/apache/ambari/server/api/query/JpaSortBuilderTest.java @@ -114,7 +114,7 @@ public class JpaSortBuilderTest { MockAlertHistoryredicateVisitor visitor = new MockAlertHistoryredicateVisitor(); PredicateHelper.visit(predicate, visitor); - JpaSortBuilder<AlertHistoryEntity> sortBuilder = new JpaSortBuilder<AlertHistoryEntity>(); + JpaSortBuilder<AlertHistoryEntity> sortBuilder = new JpaSortBuilder<>(); List<Order> sortOrders = sortBuilder.buildSortOrders(sortRequest, visitor); Assert.assertEquals(sortOrders.size(), 1); http://git-wip-us.apache.org/repos/asf/ambari/blob/edbb5492/ambari-server/src/test/java/org/apache/ambari/server/api/query/ProcessingPredicateVisitorTest.java ---------------------------------------------------------------------- diff --git a/ambari-server/src/test/java/org/apache/ambari/server/api/query/ProcessingPredicateVisitorTest.java b/ambari-server/src/test/java/org/apache/ambari/server/api/query/ProcessingPredicateVisitorTest.java index 045f172..0bd83b5 100644 --- a/ambari-server/src/test/java/org/apache/ambari/server/api/query/ProcessingPredicateVisitorTest.java +++ b/ambari-server/src/test/java/org/apache/ambari/server/api/query/ProcessingPredicateVisitorTest.java @@ -41,7 +41,7 @@ public class ProcessingPredicateVisitorTest { public void testGetProcessedPredicate() throws Exception { ResourceDefinition resourceDefinition = new StackResourceDefinition(); - Map<Resource.Type, String> mapIds = new HashMap<Resource.Type, String>(); + Map<Resource.Type, String> mapIds = new HashMap<>(); mapIds.put(Resource.Type.Stack, "HDP"); //test @@ -65,7 +65,7 @@ public class ProcessingPredicateVisitorTest { public void testGetSubResourceForNotPredicate() throws Exception { ResourceDefinition resourceDefinition = new HostResourceDefinition(); - Map<Resource.Type, String> mapIds = new HashMap<Resource.Type, String>(); + Map<Resource.Type, String> mapIds = new HashMap<>(); mapIds.put(Resource.Type.Host, null); //test @@ -90,7 +90,7 @@ public class ProcessingPredicateVisitorTest { public void testGetSubResourceCategories() throws Exception { ResourceDefinition resourceDefinition = new StackResourceDefinition(); - Map<Resource.Type, String> mapIds = new HashMap<Resource.Type, String>(); + Map<Resource.Type, String> mapIds = new HashMap<>(); mapIds.put(Resource.Type.Stack, "HDP"); //test @@ -105,7 +105,7 @@ public class ProcessingPredicateVisitorTest { Set<String> categories = visitor.getSubResourceCategories(); - Set<String> expected = new HashSet<String>(); + Set<String> expected = new HashSet<>(); expected.add("versions"); Assert.assertEquals(expected, categories); @@ -115,7 +115,7 @@ public class ProcessingPredicateVisitorTest { public void testGetSubResourceProperties() throws Exception { ResourceDefinition resourceDefinition = new StackResourceDefinition(); - Map<Resource.Type, String> mapIds = new HashMap<Resource.Type, String>(); + Map<Resource.Type, String> mapIds = new HashMap<>(); mapIds.put(Resource.Type.Stack, "HDP"); //test @@ -130,7 +130,7 @@ public class ProcessingPredicateVisitorTest { Set<String> properties = visitor.getSubResourceProperties(); - Set<String> expected = new HashSet<String>(); + Set<String> expected = new HashSet<>(); expected.add("versions/stackServices/StackServices/service_name"); expected.add("versions/operatingSystems/OperatingSystems/os_type"); http://git-wip-us.apache.org/repos/asf/ambari/blob/edbb5492/ambari-server/src/test/java/org/apache/ambari/server/api/query/QueryImplTest.java ---------------------------------------------------------------------- diff --git a/ambari-server/src/test/java/org/apache/ambari/server/api/query/QueryImplTest.java b/ambari-server/src/test/java/org/apache/ambari/server/api/query/QueryImplTest.java index fe3b773..397b101 100644 --- a/ambari-server/src/test/java/org/apache/ambari/server/api/query/QueryImplTest.java +++ b/ambari-server/src/test/java/org/apache/ambari/server/api/query/QueryImplTest.java @@ -89,7 +89,7 @@ public class QueryImplTest { public void testIsCollection__True() { ResourceDefinition resourceDefinition = createNiceMock(ResourceDefinition.class); - Map<Resource.Type, String> mapIds = new HashMap<Resource.Type, String>(); + Map<Resource.Type, String> mapIds = new HashMap<>(); mapIds.put(Resource.Type.Cluster, "cluster"); mapIds.put(Resource.Type.Service, null); @@ -110,7 +110,7 @@ public class QueryImplTest { public void testIsCollection__False() { ResourceDefinition resourceDefinition = createNiceMock(ResourceDefinition.class); - Map<Resource.Type, String> mapIds = new HashMap<Resource.Type, String>(); + Map<Resource.Type, String> mapIds = new HashMap<>(); mapIds.put(Resource.Type.Cluster, "cluster"); mapIds.put(Resource.Type.Service, "service"); @@ -131,12 +131,12 @@ public class QueryImplTest { public void testExecute__Cluster_instance_noSpecifiedProps() throws Exception { ResourceDefinition resourceDefinition = createNiceMock(ResourceDefinition.class); - Map<Resource.Type, String> mapIds = new HashMap<Resource.Type, String>(); + Map<Resource.Type, String> mapIds = new HashMap<>(); mapIds.put(Resource.Type.Cluster, "cluster"); // expectations expect(resourceDefinition.getType()).andReturn(Resource.Type.Cluster).anyTimes(); - Set<SubResourceDefinition> setChildren = new HashSet<SubResourceDefinition>(); + Set<SubResourceDefinition> setChildren = new HashSet<>(); setChildren.add(new SubResourceDefinition(Resource.Type.Host)); expect(resourceDefinition.getSubResourceDefinitions()).andReturn(setChildren).anyTimes(); @@ -164,7 +164,7 @@ public class QueryImplTest { public void testExecute__Stack_instance_noSpecifiedProps() throws Exception { ResourceDefinition resourceDefinition = new StackResourceDefinition(); - Map<Resource.Type, String> mapIds = new HashMap<Resource.Type, String>(); + Map<Resource.Type, String> mapIds = new HashMap<>(); mapIds.put(Resource.Type.Stack, "HDP"); //test @@ -188,7 +188,7 @@ public class QueryImplTest { public void testGetJoinedResourceProperties() throws Exception { ResourceDefinition resourceDefinition = new StackResourceDefinition(); - Map<Resource.Type, String> mapIds = new HashMap<Resource.Type, String>(); + Map<Resource.Type, String> mapIds = new HashMap<>(); mapIds.put(Resource.Type.Stack, "HDP"); //test @@ -200,7 +200,7 @@ public class QueryImplTest { instance.execute(); - Set<String> propertyIds = new HashSet<String>(); + Set<String> propertyIds = new HashSet<>(); propertyIds.add("versions/operating_systems/repositories/Repositories/repo_id"); propertyIds.add("versions/operating_systems/OperatingSystems/os_type"); @@ -229,7 +229,7 @@ public class QueryImplTest { public void testExecute_subResourcePredicate() throws Exception { ResourceDefinition resourceDefinition = new StackResourceDefinition(); - Map<Resource.Type, String> mapIds = new HashMap<Resource.Type, String>(); + Map<Resource.Type, String> mapIds = new HashMap<>(); mapIds.put(Resource.Type.Stack, "HDP"); //test @@ -272,7 +272,7 @@ public class QueryImplTest { public void testExecute_NoSuchResourceException() throws Exception { ResourceDefinition resourceDefinition = new ClusterResourceDefinition(); - Map<Resource.Type, String> mapIds = new HashMap<Resource.Type, String>(); + Map<Resource.Type, String> mapIds = new HashMap<>(); mapIds.put(Resource.Type.Cluster, "c1"); ClusterController clusterController = createNiceMock(ClusterController.class); @@ -314,7 +314,7 @@ public class QueryImplTest { public void testExecute_SubResourcePropertyPredicate() throws Exception { ResourceDefinition resourceDefinition = new ClusterResourceDefinition(); - Map<Resource.Type, String> mapIds = new HashMap<Resource.Type, String>(); + Map<Resource.Type, String> mapIds = new HashMap<>(); mapIds.put(Resource.Type.Cluster, "c1"); mapIds.put(Resource.Type.Host, "h1"); @@ -412,7 +412,7 @@ public class QueryImplTest { expect(schema.getKeyPropertyId(Resource.Type.Cluster)).andReturn("Clusters/cluster_name").anyTimes(); - TreeNode<Set<String>> treeNode = new TreeNodeImpl<Set<String>>(null, Collections.<String>emptySet(), null); + TreeNode<Set<String>> treeNode = new TreeNodeImpl<>(null, Collections.<String>emptySet(), null); expect(renderer.finalizeProperties(EasyMock.<TreeNode<QueryInfo>>anyObject(), anyBoolean())).andReturn(treeNode).anyTimes(); Capture<Result> resultCapture = EasyMock.newCapture(); @@ -437,7 +437,7 @@ public class QueryImplTest { public void testExecute__Stack_instance_specifiedSubResources() throws Exception { ResourceDefinition resourceDefinition = new StackResourceDefinition(); - Map<Resource.Type, String> mapIds = new HashMap<Resource.Type, String>(); + Map<Resource.Type, String> mapIds = new HashMap<>(); mapIds.put(Resource.Type.Stack, "HDP"); //test @@ -501,7 +501,7 @@ public class QueryImplTest { ResourceDefinition resourceDefinition = new StackVersionResourceDefinition(); - Map<Resource.Type, String> mapIds = new HashMap<Resource.Type, String>(); + Map<Resource.Type, String> mapIds = new HashMap<>(); //test QueryImpl instance = new TestQuery(mapIds, resourceDefinition); @@ -544,7 +544,7 @@ public class QueryImplTest { ResourceDefinition resourceDefinition = new StackVersionResourceDefinition(); - Map<Resource.Type, String> mapIds = new HashMap<Resource.Type, String>(); + Map<Resource.Type, String> mapIds = new HashMap<>(); QueryImpl instance = new TestQuery(mapIds, resourceDefinition); instance.addProperty("operating_systems/*", null); @@ -610,11 +610,11 @@ public class QueryImplTest { public void testExecute__Host_collection_noSpecifiedProps() throws Exception { ResourceDefinition resourceDefinition = createNiceMock(ResourceDefinition.class); - Map<Resource.Type, String> mapIds = new HashMap<Resource.Type, String>(); + Map<Resource.Type, String> mapIds = new HashMap<>(); // expectations expect(resourceDefinition.getType()).andReturn(Resource.Type.Host).anyTimes(); - Set<SubResourceDefinition> setChildren = new HashSet<SubResourceDefinition>(); + Set<SubResourceDefinition> setChildren = new HashSet<>(); expect(resourceDefinition.getSubResourceDefinitions()).andReturn(setChildren).anyTimes(); @@ -650,7 +650,7 @@ public class QueryImplTest { @Test public void testExecute__Host_collection_AlertsSummary() throws Exception { ResourceDefinition resourceDefinition = new HostResourceDefinition(); - Map<Resource.Type, String> mapIds = new HashMap<Resource.Type, String>(); + Map<Resource.Type, String> mapIds = new HashMap<>(); final AtomicInteger pageCallCount = new AtomicInteger(0); ClusterControllerImpl clusterControllerImpl = new ClusterControllerImpl(new ClusterControllerImplTest.TestProviderModule()) { @Override @@ -722,11 +722,11 @@ public class QueryImplTest { public void testExecute__collection_nullInternalPredicate_nullUserPredicate() throws Exception { ResourceDefinition resourceDefinition = createNiceMock(ResourceDefinition.class); - Map<Resource.Type, String> mapIds = new HashMap<Resource.Type, String>(); + Map<Resource.Type, String> mapIds = new HashMap<>(); // expectations expect(resourceDefinition.getType()).andReturn(Resource.Type.Cluster).anyTimes(); - Set<SubResourceDefinition> setChildren = new HashSet<SubResourceDefinition>(); + Set<SubResourceDefinition> setChildren = new HashSet<>(); setChildren.add(new SubResourceDefinition(Resource.Type.Host)); expect(resourceDefinition.getSubResourceDefinitions()).andReturn(setChildren).anyTimes(); @@ -753,12 +753,12 @@ public class QueryImplTest { public void testExecute__collection_nullInternalPredicate_nonNullUserPredicate() throws Exception { ResourceDefinition resourceDefinition = createNiceMock(ResourceDefinition.class); - Map<Resource.Type, String> mapIds = new HashMap<Resource.Type, String>(); + Map<Resource.Type, String> mapIds = new HashMap<>(); mapIds.put(Resource.Type.Cluster, "cluster"); // expectations expect(resourceDefinition.getType()).andReturn(Resource.Type.Host).anyTimes(); - Set<SubResourceDefinition> setChildren = new HashSet<SubResourceDefinition>(); + Set<SubResourceDefinition> setChildren = new HashSet<>(); expect(resourceDefinition.getSubResourceDefinitions()).andReturn(setChildren).anyTimes(); @@ -789,11 +789,11 @@ public class QueryImplTest { public void testExecute__collection_nonNullInternalPredicate_nonNullUserPredicate() throws Exception { ResourceDefinition resourceDefinition = createNiceMock(ResourceDefinition.class); - Map<Resource.Type, String> mapIds = new HashMap<Resource.Type, String>(); + Map<Resource.Type, String> mapIds = new HashMap<>(); // expectations expect(resourceDefinition.getType()).andReturn(Resource.Type.Host).anyTimes(); - Set<SubResourceDefinition> setChildren = new HashSet<SubResourceDefinition>(); + Set<SubResourceDefinition> setChildren = new HashSet<>(); expect(resourceDefinition.getSubResourceDefinitions()).andReturn(setChildren).anyTimes(); @@ -824,11 +824,11 @@ public class QueryImplTest { public void testAddProperty__localProperty() throws Exception { ResourceDefinition resourceDefinition = createNiceMock(ResourceDefinition.class); - Map<Resource.Type, String> mapIds = new HashMap<Resource.Type, String>(); + Map<Resource.Type, String> mapIds = new HashMap<>(); // expectations expect(resourceDefinition.getType()).andReturn(Resource.Type.Host).anyTimes(); - Set<SubResourceDefinition> setChildren = new HashSet<SubResourceDefinition>(); + Set<SubResourceDefinition> setChildren = new HashSet<>(); expect(resourceDefinition.getSubResourceDefinitions()).andReturn(setChildren).anyTimes(); @@ -871,11 +871,11 @@ public class QueryImplTest { public void testAddProperty__allCategoryProperties() throws Exception { ResourceDefinition resourceDefinition = createNiceMock(ResourceDefinition.class); - Map<Resource.Type, String> mapIds = new HashMap<Resource.Type, String>(); + Map<Resource.Type, String> mapIds = new HashMap<>(); // expectations expect(resourceDefinition.getType()).andReturn(Resource.Type.Host).anyTimes(); - Set<SubResourceDefinition> setChildren = new HashSet<SubResourceDefinition>(); + Set<SubResourceDefinition> setChildren = new HashSet<>(); expect(resourceDefinition.getSubResourceDefinitions()).andReturn(setChildren).anyTimes(); @@ -966,7 +966,7 @@ public class QueryImplTest { // simulate the case of a renderer that does not need the property providers to execute // this method should be called twice: once each resource (1 resource, 1 sub-resource in this test) expect(mockRenderer.requiresPropertyProviderInput()).andReturn(false).times(2); - expect(mockRenderer.finalizeProperties(isA(TreeNode.class), eq(true))).andReturn(new TreeNodeImpl<Set<String>>(null, Collections.<String>emptySet(), "test-node")); + expect(mockRenderer.finalizeProperties(isA(TreeNode.class), eq(true))).andReturn(new TreeNodeImpl<>(null, Collections.<String>emptySet(), "test-node")); expect(mockRenderer.finalizeResult(isA(Result.class))).andReturn(null); // note: the expectations for the ClusterController mock are significant to this test. @@ -984,7 +984,7 @@ public class QueryImplTest { expect(mockResource.getType()).andReturn(Resource.Type.Host).atLeastOnce(); - Map<Resource.Type, String> mapIds = new HashMap<Resource.Type, String>(); + Map<Resource.Type, String> mapIds = new HashMap<>(); mockSupport.replayAll(); @@ -1044,7 +1044,7 @@ public class QueryImplTest { // simulate the case of a renderer that requires the property providers to execute // this method should be called twice: once for each resource (1 resource, 1 sub-resource in this test) expect(mockRenderer.requiresPropertyProviderInput()).andReturn(true).times(2); - expect(mockRenderer.finalizeProperties(isA(TreeNode.class), eq(true))).andReturn(new TreeNodeImpl<Set<String>>(null, Collections.<String>emptySet(), "test-node")); + expect(mockRenderer.finalizeProperties(isA(TreeNode.class), eq(true))).andReturn(new TreeNodeImpl<>(null, Collections.<String>emptySet(), "test-node")); expect(mockRenderer.finalizeResult(isA(Result.class))).andReturn(null); // note: the expectations for the ClusterController mock are significant to this test. @@ -1064,7 +1064,7 @@ public class QueryImplTest { expect(mockResource.getType()).andReturn(Resource.Type.Host).atLeastOnce(); - Map<Resource.Type, String> mapIds = new HashMap<Resource.Type, String>(); + Map<Resource.Type, String> mapIds = new HashMap<>(); mockSupport.replayAll(); http://git-wip-us.apache.org/repos/asf/ambari/blob/edbb5492/ambari-server/src/test/java/org/apache/ambari/server/api/query/QueryInfoTest.java ---------------------------------------------------------------------- diff --git a/ambari-server/src/test/java/org/apache/ambari/server/api/query/QueryInfoTest.java b/ambari-server/src/test/java/org/apache/ambari/server/api/query/QueryInfoTest.java index 15b798b..2a0ac85 100644 --- a/ambari-server/src/test/java/org/apache/ambari/server/api/query/QueryInfoTest.java +++ b/ambari-server/src/test/java/org/apache/ambari/server/api/query/QueryInfoTest.java @@ -34,7 +34,7 @@ import org.junit.Test; public class QueryInfoTest { @Test public void testGetProperties() { - Set<String> properties = new HashSet<String>(); + Set<String> properties = new HashSet<>(); QueryInfo info = new QueryInfo(new ClusterResourceDefinition(), properties); assertEquals(properties, info.getProperties()); http://git-wip-us.apache.org/repos/asf/ambari/blob/edbb5492/ambari-server/src/test/java/org/apache/ambari/server/api/query/render/ClusterBlueprintRendererTest.java ---------------------------------------------------------------------- diff --git a/ambari-server/src/test/java/org/apache/ambari/server/api/query/render/ClusterBlueprintRendererTest.java b/ambari-server/src/test/java/org/apache/ambari/server/api/query/render/ClusterBlueprintRendererTest.java index 75ffd31..13db5f8 100644 --- a/ambari-server/src/test/java/org/apache/ambari/server/api/query/render/ClusterBlueprintRendererTest.java +++ b/ambari-server/src/test/java/org/apache/ambari/server/api/query/render/ClusterBlueprintRendererTest.java @@ -99,21 +99,21 @@ public class ClusterBlueprintRendererTest { private static final Configuration emptyConfiguration = new Configuration(new HashMap<String, Map<String, String>>(), new HashMap<String, Map<String, Map<String, String>>>()); - private static final Map<String, Map<String, String>> clusterProps = new HashMap<String, Map<String, String>>(); + private static final Map<String, Map<String, String>> clusterProps = new HashMap<>(); private static final Map<String, Map<String, Map<String, String>>> clusterAttributes = - new HashMap<String, Map<String, Map<String, String>>>(); + new HashMap<>(); private static final Configuration clusterConfig = new Configuration(clusterProps, clusterAttributes); @Before public void setup() throws Exception { - Map<String, String> clusterTypeProps = new HashMap<String, String>(); + Map<String, String> clusterTypeProps = new HashMap<>(); clusterProps.put("test-type-one", clusterTypeProps); clusterTypeProps.put("propertyOne", "valueOne"); - Map<String, Map<String, String>> clusterTypeAttributes = new HashMap<String, Map<String, String>>(); + Map<String, Map<String, String>> clusterTypeAttributes = new HashMap<>(); clusterAttributes.put("test-type-one", clusterTypeAttributes); - Map<String, String> clusterAttributeProps = new HashMap<String, String>(); + Map<String, String> clusterAttributeProps = new HashMap<>(); clusterAttributeProps.put("propertyOne", "true"); clusterTypeAttributes.put("final", clusterAttributeProps); @@ -122,11 +122,11 @@ public class ClusterBlueprintRendererTest { Collection<Component> group2Components = Arrays.asList(new Component("TASKTRACKER"), new Component("DATANODE")); - Map<String, Configuration> hostGroupConfigs = new HashMap<String, Configuration>(); + Map<String, Configuration> hostGroupConfigs = new HashMap<>(); hostGroupConfigs.put("host_group_1", emptyConfiguration); hostGroupConfigs.put("host_group_2", emptyConfiguration); - Map<String, HostGroup> hostGroups = new HashMap<String, HostGroup>(); + Map<String, HostGroup> hostGroups = new HashMap<>(); hostGroups.put("host_group_1", group1); hostGroups.put("host_group_2", group2); @@ -134,7 +134,7 @@ public class ClusterBlueprintRendererTest { group1Info.addHost("host1"); group1Info.setConfiguration(emptyConfiguration); HostGroupInfo group2Info = new HostGroupInfo("host_group_2"); - Map<String, HostGroupInfo> groupInfoMap = new HashMap<String, HostGroupInfo>(); + Map<String, HostGroupInfo> groupInfoMap = new HashMap<>(); group2Info.addHosts(Arrays.asList("host2", "host3")); group2Info.setConfiguration(emptyConfiguration); groupInfoMap.put("host_group_1", group1Info); @@ -172,7 +172,7 @@ public class ClusterBlueprintRendererTest { group1Info.addHost("host1"); group1Info.setConfiguration(emptyConfiguration); HostGroupInfo group2Info = new HostGroupInfo("host_group_2"); - Map<String, HostGroupInfo> groupInfoMap = new HashMap<String, HostGroupInfo>(); + Map<String, HostGroupInfo> groupInfoMap = new HashMap<>(); group2Info.addHosts(Arrays.asList("host2", "host3")); group2Info.setConfiguration(emptyConfiguration); groupInfoMap.put("host_group_1", group1Info); @@ -217,7 +217,7 @@ public class ClusterBlueprintRendererTest { @Test public void testFinalizeProperties__instance() { QueryInfo rootQuery = new QueryInfo(new ClusterResourceDefinition(), new HashSet<String>()); - TreeNode<QueryInfo> queryTree = new TreeNodeImpl<QueryInfo>(null, rootQuery, "Cluster"); + TreeNode<QueryInfo> queryTree = new TreeNodeImpl<>(null, rootQuery, "Cluster"); rootQuery.getProperties().add("foo/bar"); rootQuery.getProperties().add("prop1"); @@ -384,7 +384,7 @@ public class ClusterBlueprintRendererTest { @Test public void testFinalizeProperties__instance_noComponentNode() { QueryInfo rootQuery = new QueryInfo(new ClusterResourceDefinition(), new HashSet<String>()); - TreeNode<QueryInfo> queryTree = new TreeNodeImpl<QueryInfo>(null, rootQuery, "Cluster"); + TreeNode<QueryInfo> queryTree = new TreeNodeImpl<>(null, rootQuery, "Cluster"); rootQuery.getProperties().add("foo/bar"); rootQuery.getProperties().add("prop1"); @@ -461,10 +461,10 @@ public class ClusterBlueprintRendererTest { // 4 specified components and ambari server assertEquals(5, components.size()); - Set<String> expectedValues = new HashSet<String>( - Arrays.asList("JOBTRACKER", "TASKTRACKER", "NAMENODE", "DATANODE", "AMBARI_SERVER")); + Set<String> expectedValues = new HashSet<>( + Arrays.asList("JOBTRACKER", "TASKTRACKER", "NAMENODE", "DATANODE", "AMBARI_SERVER")); - Set<String> actualValues = new HashSet<String>(); + Set<String> actualValues = new HashSet<>(); for (Map<String, String> componentProperties : components) { @@ -479,10 +479,10 @@ public class ClusterBlueprintRendererTest { Collection<Map<String, String>> components = (Collection<Map<String, String>>) hostGroupProperties.get("components"); assertEquals(2, components.size()); - Set<String> expectedValues = new HashSet<String>( - Arrays.asList("TASKTRACKER", "DATANODE")); + Set<String> expectedValues = new HashSet<>( + Arrays.asList("TASKTRACKER", "DATANODE")); - Set<String> actualValues = new HashSet<String>(); + Set<String> actualValues = new HashSet<>(); for (Map<String, String> componentProperties : components) { @@ -503,7 +503,7 @@ public class ClusterBlueprintRendererTest { Result result = new ResultImpl(true); Map<String, Object> testDesiredConfigMap = - new HashMap<String, Object>(); + new HashMap<>(); DesiredConfig testDesiredConfig = new DesiredConfig(); @@ -540,10 +540,10 @@ public class ClusterBlueprintRendererTest { // 4 specified components and ambari server assertEquals(5, components.size()); - Set<String> expectedValues = new HashSet<String>( + Set<String> expectedValues = new HashSet<>( Arrays.asList("JOBTRACKER", "TASKTRACKER", "NAMENODE", "DATANODE", "AMBARI_SERVER")); - Set<String> actualValues = new HashSet<String>(); + Set<String> actualValues = new HashSet<>(); for (Map<String, String> componentProperties : components) { @@ -558,10 +558,10 @@ public class ClusterBlueprintRendererTest { Collection<Map<String, String>> components = (Collection<Map<String, String>>) hostGroupProperties.get("components"); assertEquals(2, components.size()); - Set<String> expectedValues = new HashSet<String>( + Set<String> expectedValues = new HashSet<>( Arrays.asList("TASKTRACKER", "DATANODE")); - Set<String> actualValues = new HashSet<String>(); + Set<String> actualValues = new HashSet<>(); for (Map<String, String> componentProperties : components) { http://git-wip-us.apache.org/repos/asf/ambari/blob/edbb5492/ambari-server/src/test/java/org/apache/ambari/server/api/query/render/DefaultRendererTest.java ---------------------------------------------------------------------- diff --git a/ambari-server/src/test/java/org/apache/ambari/server/api/query/render/DefaultRendererTest.java b/ambari-server/src/test/java/org/apache/ambari/server/api/query/render/DefaultRendererTest.java index add1919..1ede9f5 100644 --- a/ambari-server/src/test/java/org/apache/ambari/server/api/query/render/DefaultRendererTest.java +++ b/ambari-server/src/test/java/org/apache/ambari/server/api/query/render/DefaultRendererTest.java @@ -61,7 +61,7 @@ public class DefaultRendererTest { replay(schemaFactory, schema); QueryInfo rootQuery = new QueryInfo(new ServiceResourceDefinition(), new HashSet<String>()); - TreeNode<QueryInfo> queryTree = new TreeNodeImpl<QueryInfo>(null, rootQuery, "Service"); + TreeNode<QueryInfo> queryTree = new TreeNodeImpl<>(null, rootQuery, "Service"); DefaultRenderer renderer = new DefaultRenderer(); renderer.init(schemaFactory); @@ -90,10 +90,10 @@ public class DefaultRendererTest { replay(schemaFactory, schema); - HashSet<String> serviceProperties = new HashSet<String>(); + HashSet<String> serviceProperties = new HashSet<>(); serviceProperties.add("foo/bar"); QueryInfo rootQuery = new QueryInfo(new ServiceResourceDefinition(), serviceProperties); - TreeNode<QueryInfo> queryTree = new TreeNodeImpl<QueryInfo>(null, rootQuery, "Service"); + TreeNode<QueryInfo> queryTree = new TreeNodeImpl<>(null, rootQuery, "Service"); DefaultRenderer renderer = new DefaultRenderer(); renderer.init(schemaFactory); @@ -121,9 +121,9 @@ public class DefaultRendererTest { replay(schemaFactory, schema); - HashSet<String> serviceProperties = new HashSet<String>(); + HashSet<String> serviceProperties = new HashSet<>(); QueryInfo rootQuery = new QueryInfo(new ServiceResourceDefinition(), serviceProperties); - TreeNode<QueryInfo> queryTree = new TreeNodeImpl<QueryInfo>(null, rootQuery, "Service"); + TreeNode<QueryInfo> queryTree = new TreeNodeImpl<>(null, rootQuery, "Service"); DefaultRenderer renderer = new DefaultRenderer(); renderer.init(schemaFactory); @@ -150,10 +150,10 @@ public class DefaultRendererTest { replay(schemaFactory, schema); - HashSet<String> serviceProperties = new HashSet<String>(); + HashSet<String> serviceProperties = new HashSet<>(); serviceProperties.add("foo/bar"); QueryInfo rootQuery = new QueryInfo(new ServiceResourceDefinition(), serviceProperties); - TreeNode<QueryInfo> queryTree = new TreeNodeImpl<QueryInfo>(null, rootQuery, "Service"); + TreeNode<QueryInfo> queryTree = new TreeNodeImpl<>(null, rootQuery, "Service"); DefaultRenderer renderer = new DefaultRenderer(); renderer.init(schemaFactory); @@ -185,9 +185,9 @@ public class DefaultRendererTest { replay(schemaFactory, serviceSchema, componentSchema); - HashSet<String> serviceProperties = new HashSet<String>(); + HashSet<String> serviceProperties = new HashSet<>(); QueryInfo rootQuery = new QueryInfo(new ServiceResourceDefinition(), serviceProperties); - TreeNode<QueryInfo> queryTree = new TreeNodeImpl<QueryInfo>(null, rootQuery, "Service"); + TreeNode<QueryInfo> queryTree = new TreeNodeImpl<>(null, rootQuery, "Service"); queryTree.addChild(new QueryInfo(new ComponentResourceDefinition(), new HashSet<String>()), "Component"); DefaultRenderer renderer = new DefaultRenderer(); @@ -225,11 +225,11 @@ public class DefaultRendererTest { replay(schemaFactory, serviceSchema, componentSchema); - HashSet<String> serviceProperties = new HashSet<String>(); + HashSet<String> serviceProperties = new HashSet<>(); serviceProperties.add("foo/bar"); QueryInfo rootQuery = new QueryInfo(new ServiceResourceDefinition(), serviceProperties); - TreeNode<QueryInfo> queryTree = new TreeNodeImpl<QueryInfo>(null, rootQuery, "Service"); - HashSet<String> componentProperties = new HashSet<String>(); + TreeNode<QueryInfo> queryTree = new TreeNodeImpl<>(null, rootQuery, "Service"); + HashSet<String> componentProperties = new HashSet<>(); componentProperties.add("goo/car"); queryTree.addChild(new QueryInfo(new ComponentResourceDefinition(), componentProperties), "Component"); @@ -270,9 +270,9 @@ public class DefaultRendererTest { replay(schemaFactory, serviceSchema, componentSchema); - HashSet<String> serviceProperties = new HashSet<String>(); + HashSet<String> serviceProperties = new HashSet<>(); QueryInfo rootQuery = new QueryInfo(new ServiceResourceDefinition(), serviceProperties); - TreeNode<QueryInfo> queryTree = new TreeNodeImpl<QueryInfo>(null, rootQuery, "Service"); + TreeNode<QueryInfo> queryTree = new TreeNodeImpl<>(null, rootQuery, "Service"); queryTree.addChild(new QueryInfo(new ComponentResourceDefinition(), new HashSet<String>()), "Component"); DefaultRenderer renderer = new DefaultRenderer(); @@ -310,10 +310,10 @@ public class DefaultRendererTest { replay(schemaFactory, serviceSchema, componentSchema); - HashSet<String> serviceProperties = new HashSet<String>(); + HashSet<String> serviceProperties = new HashSet<>(); serviceProperties.add("foo/bar"); QueryInfo rootQuery = new QueryInfo(new ServiceResourceDefinition(), serviceProperties); - TreeNode<QueryInfo> queryTree = new TreeNodeImpl<QueryInfo>(null, rootQuery, "Service"); + TreeNode<QueryInfo> queryTree = new TreeNodeImpl<>(null, rootQuery, "Service"); queryTree.addChild(new QueryInfo(new ComponentResourceDefinition(), new HashSet<String>()), "Component"); DefaultRenderer renderer = new DefaultRenderer(); http://git-wip-us.apache.org/repos/asf/ambari/blob/edbb5492/ambari-server/src/test/java/org/apache/ambari/server/api/query/render/MetricsPaddingRendererTest.java ---------------------------------------------------------------------- diff --git a/ambari-server/src/test/java/org/apache/ambari/server/api/query/render/MetricsPaddingRendererTest.java b/ambari-server/src/test/java/org/apache/ambari/server/api/query/render/MetricsPaddingRendererTest.java index e99271e..b872bb8 100644 --- a/ambari-server/src/test/java/org/apache/ambari/server/api/query/render/MetricsPaddingRendererTest.java +++ b/ambari-server/src/test/java/org/apache/ambari/server/api/query/render/MetricsPaddingRendererTest.java @@ -49,10 +49,10 @@ public class MetricsPaddingRendererTest { replay(schemaFactory, schema); - HashSet<String> serviceProperties = new HashSet<String>(); + HashSet<String> serviceProperties = new HashSet<>(); serviceProperties.add("foo/bar"); QueryInfo rootQuery = new QueryInfo(new ServiceResourceDefinition(), serviceProperties); - TreeNode<QueryInfo> queryTree = new TreeNodeImpl<QueryInfo>(null, rootQuery, "Service"); + TreeNode<QueryInfo> queryTree = new TreeNodeImpl<>(null, rootQuery, "Service"); MetricsPaddingRenderer renderer = new MetricsPaddingRenderer("null_padding"); renderer.init(schemaFactory); http://git-wip-us.apache.org/repos/asf/ambari/blob/edbb5492/ambari-server/src/test/java/org/apache/ambari/server/api/query/render/MinimalRendererTest.java ---------------------------------------------------------------------- diff --git a/ambari-server/src/test/java/org/apache/ambari/server/api/query/render/MinimalRendererTest.java b/ambari-server/src/test/java/org/apache/ambari/server/api/query/render/MinimalRendererTest.java index 687dcbb..31aa3ad 100644 --- a/ambari-server/src/test/java/org/apache/ambari/server/api/query/render/MinimalRendererTest.java +++ b/ambari-server/src/test/java/org/apache/ambari/server/api/query/render/MinimalRendererTest.java @@ -64,7 +64,7 @@ public class MinimalRendererTest { replay(schemaFactory, schema); QueryInfo rootQuery = new QueryInfo(new ServiceResourceDefinition(), new HashSet<String>()); - TreeNode<QueryInfo> queryTree = new TreeNodeImpl<QueryInfo>(null, rootQuery, "Service"); + TreeNode<QueryInfo> queryTree = new TreeNodeImpl<>(null, rootQuery, "Service"); MinimalRenderer renderer = new MinimalRenderer(); renderer.init(schemaFactory); @@ -91,10 +91,10 @@ public class MinimalRendererTest { replay(schemaFactory, schema); - HashSet<String> serviceProperties = new HashSet<String>(); + HashSet<String> serviceProperties = new HashSet<>(); serviceProperties.add("foo/bar"); QueryInfo rootQuery = new QueryInfo(new ServiceResourceDefinition(), serviceProperties); - TreeNode<QueryInfo> queryTree = new TreeNodeImpl<QueryInfo>(null, rootQuery, "Service"); + TreeNode<QueryInfo> queryTree = new TreeNodeImpl<>(null, rootQuery, "Service"); MinimalRenderer renderer = new MinimalRenderer(); renderer.init(schemaFactory); @@ -120,9 +120,9 @@ public class MinimalRendererTest { replay(schemaFactory, schema); - HashSet<String> serviceProperties = new HashSet<String>(); + HashSet<String> serviceProperties = new HashSet<>(); QueryInfo rootQuery = new QueryInfo(new ServiceResourceDefinition(), serviceProperties); - TreeNode<QueryInfo> queryTree = new TreeNodeImpl<QueryInfo>(null, rootQuery, "Service"); + TreeNode<QueryInfo> queryTree = new TreeNodeImpl<>(null, rootQuery, "Service"); MinimalRenderer renderer = new MinimalRenderer(); renderer.init(schemaFactory); @@ -147,10 +147,10 @@ public class MinimalRendererTest { replay(schemaFactory, schema); - HashSet<String> serviceProperties = new HashSet<String>(); + HashSet<String> serviceProperties = new HashSet<>(); serviceProperties.add("foo/bar"); QueryInfo rootQuery = new QueryInfo(new ServiceResourceDefinition(), serviceProperties); - TreeNode<QueryInfo> queryTree = new TreeNodeImpl<QueryInfo>(null, rootQuery, "Service"); + TreeNode<QueryInfo> queryTree = new TreeNodeImpl<>(null, rootQuery, "Service"); MinimalRenderer renderer = new MinimalRenderer(); renderer.init(schemaFactory); @@ -179,9 +179,9 @@ public class MinimalRendererTest { replay(schemaFactory, serviceSchema, componentSchema); - HashSet<String> serviceProperties = new HashSet<String>(); + HashSet<String> serviceProperties = new HashSet<>(); QueryInfo rootQuery = new QueryInfo(new ServiceResourceDefinition(), serviceProperties); - TreeNode<QueryInfo> queryTree = new TreeNodeImpl<QueryInfo>(null, rootQuery, "Service"); + TreeNode<QueryInfo> queryTree = new TreeNodeImpl<>(null, rootQuery, "Service"); queryTree.addChild(new QueryInfo(new ComponentResourceDefinition(), new HashSet<String>()), "Component"); MinimalRenderer renderer = new MinimalRenderer(); @@ -216,11 +216,11 @@ public class MinimalRendererTest { replay(schemaFactory, serviceSchema, componentSchema); - HashSet<String> serviceProperties = new HashSet<String>(); + HashSet<String> serviceProperties = new HashSet<>(); serviceProperties.add("foo/bar"); QueryInfo rootQuery = new QueryInfo(new ServiceResourceDefinition(), serviceProperties); - TreeNode<QueryInfo> queryTree = new TreeNodeImpl<QueryInfo>(null, rootQuery, "Service"); - HashSet<String> componentProperties = new HashSet<String>(); + TreeNode<QueryInfo> queryTree = new TreeNodeImpl<>(null, rootQuery, "Service"); + HashSet<String> componentProperties = new HashSet<>(); componentProperties.add("goo/car"); queryTree.addChild(new QueryInfo(new ComponentResourceDefinition(), componentProperties), "Component"); @@ -256,9 +256,9 @@ public class MinimalRendererTest { replay(schemaFactory, serviceSchema, componentSchema); - HashSet<String> serviceProperties = new HashSet<String>(); + HashSet<String> serviceProperties = new HashSet<>(); QueryInfo rootQuery = new QueryInfo(new ServiceResourceDefinition(), serviceProperties); - TreeNode<QueryInfo> queryTree = new TreeNodeImpl<QueryInfo>(null, rootQuery, "Service"); + TreeNode<QueryInfo> queryTree = new TreeNodeImpl<>(null, rootQuery, "Service"); queryTree.addChild(new QueryInfo(new ComponentResourceDefinition(), new HashSet<String>()), "Component"); MinimalRenderer renderer = new MinimalRenderer(); @@ -292,10 +292,10 @@ public class MinimalRendererTest { replay(schemaFactory, serviceSchema, componentSchema); - HashSet<String> serviceProperties = new HashSet<String>(); + HashSet<String> serviceProperties = new HashSet<>(); serviceProperties.add("foo/bar"); QueryInfo rootQuery = new QueryInfo(new ServiceResourceDefinition(), serviceProperties); - TreeNode<QueryInfo> queryTree = new TreeNodeImpl<QueryInfo>(null, rootQuery, "Service"); + TreeNode<QueryInfo> queryTree = new TreeNodeImpl<>(null, rootQuery, "Service"); queryTree.addChild(new QueryInfo(new ComponentResourceDefinition(), new HashSet<String>()), "Component"); MinimalRenderer renderer = new MinimalRenderer(); @@ -456,8 +456,8 @@ public class MinimalRendererTest { private TreeNode<QueryInfo> createPropertyTree() { - TreeNode<QueryInfo> propertyTree = new TreeNodeImpl<QueryInfo>(null, new QueryInfo( - new ClusterResourceDefinition(), new HashSet<String>()), "Cluster"); + TreeNode<QueryInfo> propertyTree = new TreeNodeImpl<>(null, new QueryInfo( + new ClusterResourceDefinition(), new HashSet<String>()), "Cluster"); Set<String> clusterProperties = propertyTree.getObject().getProperties(); clusterProperties.add("Clusters/cluster_name"); clusterProperties.add("Clusters/version"); @@ -468,8 +468,8 @@ public class MinimalRendererTest { } private TreeNode<QueryInfo> createPropertyTreeWithSubProps() { - TreeNode<QueryInfo> propertyTree = new TreeNodeImpl<QueryInfo>(null, new QueryInfo( - new ClusterResourceDefinition(), new HashSet<String>()), "Cluster"); + TreeNode<QueryInfo> propertyTree = new TreeNodeImpl<>(null, new QueryInfo( + new ClusterResourceDefinition(), new HashSet<String>()), "Cluster"); Set<String> clusterProperties = propertyTree.getObject().getProperties(); clusterProperties.add("Clusters/cluster_name"); clusterProperties.add("Clusters/version"); http://git-wip-us.apache.org/repos/asf/ambari/blob/edbb5492/ambari-server/src/test/java/org/apache/ambari/server/api/resources/BaseResourceDefinitionTest.java ---------------------------------------------------------------------- diff --git a/ambari-server/src/test/java/org/apache/ambari/server/api/resources/BaseResourceDefinitionTest.java b/ambari-server/src/test/java/org/apache/ambari/server/api/resources/BaseResourceDefinitionTest.java index 83aca19..e076268 100644 --- a/ambari-server/src/test/java/org/apache/ambari/server/api/resources/BaseResourceDefinitionTest.java +++ b/ambari-server/src/test/java/org/apache/ambari/server/api/resources/BaseResourceDefinitionTest.java @@ -84,8 +84,8 @@ public class BaseResourceDefinitionTest { Resource service = new ResourceImpl(Resource.Type.Service); service.setProperty("ServiceInfo/service_name", "Service1"); - TreeNode<Resource> parentNode = new TreeNodeImpl<Resource>(null, null, "services"); - TreeNode<Resource> serviceNode = new TreeNodeImpl<Resource>(parentNode, service, "service1"); + TreeNode<Resource> parentNode = new TreeNodeImpl<>(null, null, "services"); + TreeNode<Resource> serviceNode = new TreeNodeImpl<>(parentNode, service, "service1"); parentNode.setProperty("isCollection", "true"); @@ -117,8 +117,8 @@ public class BaseResourceDefinitionTest { Resource configGroup = new ResourceImpl(Resource.Type.ConfigGroup); configGroup.setProperty("ConfigGroup/id", "2"); - TreeNode<Resource> resourcesNode = new TreeNodeImpl<Resource>(null, null, BaseManagementHandler.RESOURCES_NODE_NAME); - TreeNode<Resource> configGroupNode = new TreeNodeImpl<Resource>(resourcesNode, configGroup, "configGroup1"); + TreeNode<Resource> resourcesNode = new TreeNodeImpl<>(null, null, BaseManagementHandler.RESOURCES_NODE_NAME); + TreeNode<Resource> configGroupNode = new TreeNodeImpl<>(resourcesNode, configGroup, "configGroup1"); resourcesNode.setProperty("isCollection", "true"); @@ -151,7 +151,7 @@ public class BaseResourceDefinitionTest { assertEquals(Collections.emptySet(), resource.getReadDirectives()); - Map<BaseResourceDefinition.DirectiveType, List<String>> directives = new HashMap<BaseResourceDefinition.DirectiveType, List<String>>(); + Map<BaseResourceDefinition.DirectiveType, List<String>> directives = new HashMap<>(); directives.put(BaseResourceDefinition.DirectiveType.DELETE, Arrays.asList("do_something_delete", "do_something_else_delete")); directives.put(BaseResourceDefinition.DirectiveType.READ, Arrays.asList("do_something_get", "do_something_else_get")); directives.put(BaseResourceDefinition.DirectiveType.CREATE, Arrays.asList("do_something_post", "do_something_else_post")); http://git-wip-us.apache.org/repos/asf/ambari/blob/edbb5492/ambari-server/src/test/java/org/apache/ambari/server/api/resources/PermissionResourceDefinitionTest.java ---------------------------------------------------------------------- diff --git a/ambari-server/src/test/java/org/apache/ambari/server/api/resources/PermissionResourceDefinitionTest.java b/ambari-server/src/test/java/org/apache/ambari/server/api/resources/PermissionResourceDefinitionTest.java index d2da5a1..8158cb6 100644 --- a/ambari-server/src/test/java/org/apache/ambari/server/api/resources/PermissionResourceDefinitionTest.java +++ b/ambari-server/src/test/java/org/apache/ambari/server/api/resources/PermissionResourceDefinitionTest.java @@ -45,7 +45,7 @@ public class PermissionResourceDefinitionTest { public void testGetSubResourceDefinitions() throws Exception { PermissionResourceDefinition permissionResourceDefinition = new PermissionResourceDefinition(); Set<SubResourceDefinition> subResourceDefinitions = permissionResourceDefinition.getSubResourceDefinitions (); - Set<Resource.Type> expectedSubTypes = new HashSet<Resource.Type>(); + Set<Resource.Type> expectedSubTypes = new HashSet<>(); expectedSubTypes.add(Resource.Type.RoleAuthorization); Assert.assertEquals(1, subResourceDefinitions.size()); http://git-wip-us.apache.org/repos/asf/ambari/blob/edbb5492/ambari-server/src/test/java/org/apache/ambari/server/api/resources/SimpleResourceDefinitionTest.java ---------------------------------------------------------------------- diff --git a/ambari-server/src/test/java/org/apache/ambari/server/api/resources/SimpleResourceDefinitionTest.java b/ambari-server/src/test/java/org/apache/ambari/server/api/resources/SimpleResourceDefinitionTest.java index d246479..9d8fb04 100644 --- a/ambari-server/src/test/java/org/apache/ambari/server/api/resources/SimpleResourceDefinitionTest.java +++ b/ambari-server/src/test/java/org/apache/ambari/server/api/resources/SimpleResourceDefinitionTest.java @@ -61,7 +61,7 @@ public class SimpleResourceDefinitionTest { validateDirectives(Collections.<String>emptySet(), resourceDefinition.getUpdateDirectives()); validateDirectives(Collections.<String>emptySet(), resourceDefinition.getDeleteDirectives()); - HashMap<BaseResourceDefinition.DirectiveType, Collection<String>> directives = new HashMap<BaseResourceDefinition.DirectiveType, Collection<String>>(); + HashMap<BaseResourceDefinition.DirectiveType, Collection<String>> directives = new HashMap<>(); directives.put(BaseResourceDefinition.DirectiveType.CREATE, Arrays.asList("POST1", "POST2")); directives.put(BaseResourceDefinition.DirectiveType.READ, Arrays.asList("GET1", "GET2")); directives.put(BaseResourceDefinition.DirectiveType.UPDATE, Arrays.asList("PUT1", "PUT2")); http://git-wip-us.apache.org/repos/asf/ambari/blob/edbb5492/ambari-server/src/test/java/org/apache/ambari/server/api/resources/ViewInstanceResourceDefinitionTest.java ---------------------------------------------------------------------- diff --git a/ambari-server/src/test/java/org/apache/ambari/server/api/resources/ViewInstanceResourceDefinitionTest.java b/ambari-server/src/test/java/org/apache/ambari/server/api/resources/ViewInstanceResourceDefinitionTest.java index 22639f6..2ed9403 100644 --- a/ambari-server/src/test/java/org/apache/ambari/server/api/resources/ViewInstanceResourceDefinitionTest.java +++ b/ambari-server/src/test/java/org/apache/ambari/server/api/resources/ViewInstanceResourceDefinitionTest.java @@ -55,7 +55,7 @@ public class ViewInstanceResourceDefinitionTest { } public static ViewInstanceResourceDefinition getViewInstanceResourceDefinition() { - Set<SubResourceDefinition> subResourceDefinitions = new HashSet<SubResourceDefinition>(); + Set<SubResourceDefinition> subResourceDefinitions = new HashSet<>(); subResourceDefinitions.add(new SubResourceDefinition(new Resource.Type("sub1"))); subResourceDefinitions.add(new SubResourceDefinition(new Resource.Type("sub2"))); http://git-wip-us.apache.org/repos/asf/ambari/blob/edbb5492/ambari-server/src/test/java/org/apache/ambari/server/api/services/ActionServiceTest.java ---------------------------------------------------------------------- diff --git a/ambari-server/src/test/java/org/apache/ambari/server/api/services/ActionServiceTest.java b/ambari-server/src/test/java/org/apache/ambari/server/api/services/ActionServiceTest.java index 04e63ca..b5fb6f8 100644 --- a/ambari-server/src/test/java/org/apache/ambari/server/api/services/ActionServiceTest.java +++ b/ambari-server/src/test/java/org/apache/ambari/server/api/services/ActionServiceTest.java @@ -37,7 +37,7 @@ import org.apache.ambari.server.api.services.serializers.ResultSerializer; public class ActionServiceTest extends BaseServiceTest { public List<ServiceTestInvocation> getTestInvocations() throws Exception { - List<ServiceTestInvocation> listInvocations = new ArrayList<ServiceTestInvocation>(); + List<ServiceTestInvocation> listInvocations = new ArrayList<>(); //getActionDefinition ActionService service = new TestActionDefinitionService("actionName"); http://git-wip-us.apache.org/repos/asf/ambari/blob/edbb5492/ambari-server/src/test/java/org/apache/ambari/server/api/services/AmbariMetaInfoTest.java ---------------------------------------------------------------------- diff --git a/ambari-server/src/test/java/org/apache/ambari/server/api/services/AmbariMetaInfoTest.java b/ambari-server/src/test/java/org/apache/ambari/server/api/services/AmbariMetaInfoTest.java index 9ff7def..b80e39c 100644 --- a/ambari-server/src/test/java/org/apache/ambari/server/api/services/AmbariMetaInfoTest.java +++ b/ambari-server/src/test/java/org/apache/ambari/server/api/services/AmbariMetaInfoTest.java @@ -572,10 +572,10 @@ public class AmbariMetaInfoTest { public void testGetRepos() throws Exception { Map<String, List<RepositoryInfo>> repos = metaInfo.getRepository( STACK_NAME_HDP, STACK_VERSION_HDP); - Set<String> centos5Cnt = new HashSet<String>(); - Set<String> centos6Cnt = new HashSet<String>(); - Set<String> redhat6cnt = new HashSet<String>(); - Set<String> redhat5cnt = new HashSet<String>(); + Set<String> centos5Cnt = new HashSet<>(); + Set<String> centos6Cnt = new HashSet<>(); + Set<String> redhat6cnt = new HashSet<>(); + Set<String> redhat5cnt = new HashSet<>(); for (List<RepositoryInfo> vals : repos.values()) { for (RepositoryInfo repo : vals) { @@ -1047,7 +1047,7 @@ public class AmbariMetaInfoTest { } } } - LinkedList<String> failedMetrics = new LinkedList<String>(); + LinkedList<String> failedMetrics = new LinkedList<>(); for (MetricDefinition metricDefinition : list) { if ("ganglia".equals(metricDefinition.getType())) { //all ams metrics should be temporal http://git-wip-us.apache.org/repos/asf/ambari/blob/edbb5492/ambari-server/src/test/java/org/apache/ambari/server/api/services/BaseServiceTest.java ---------------------------------------------------------------------- diff --git a/ambari-server/src/test/java/org/apache/ambari/server/api/services/BaseServiceTest.java b/ambari-server/src/test/java/org/apache/ambari/server/api/services/BaseServiceTest.java index fe28735..52e9b77 100644 --- a/ambari-server/src/test/java/org/apache/ambari/server/api/services/BaseServiceTest.java +++ b/ambari-server/src/test/java/org/apache/ambari/server/api/services/BaseServiceTest.java @@ -210,7 +210,7 @@ public abstract class BaseServiceTest { private Object[] m_args; private String m_body; - private static final Map<Request.Type, Integer> mapStatusCodes = new HashMap<Request.Type, Integer>(); + private static final Map<Request.Type, Integer> mapStatusCodes = new HashMap<>(); static { mapStatusCodes.put(Request.Type.GET, 200); http://git-wip-us.apache.org/repos/asf/ambari/blob/edbb5492/ambari-server/src/test/java/org/apache/ambari/server/api/services/BlueprintServiceTest.java ---------------------------------------------------------------------- diff --git a/ambari-server/src/test/java/org/apache/ambari/server/api/services/BlueprintServiceTest.java b/ambari-server/src/test/java/org/apache/ambari/server/api/services/BlueprintServiceTest.java index 26eb91f..165dd6c 100644 --- a/ambari-server/src/test/java/org/apache/ambari/server/api/services/BlueprintServiceTest.java +++ b/ambari-server/src/test/java/org/apache/ambari/server/api/services/BlueprintServiceTest.java @@ -38,7 +38,7 @@ public class BlueprintServiceTest extends BaseServiceTest { public List<ServiceTestInvocation> getTestInvocations() throws Exception { - List<ServiceTestInvocation> listInvocations = new ArrayList<ServiceTestInvocation>(); + List<ServiceTestInvocation> listInvocations = new ArrayList<>(); //getBlueprint BlueprintService BlueprintService = new TestBlueprintService("blueprintName"); http://git-wip-us.apache.org/repos/asf/ambari/blob/edbb5492/ambari-server/src/test/java/org/apache/ambari/server/api/services/ClusterKerberosDescriptorServiceTest.java ---------------------------------------------------------------------- diff --git a/ambari-server/src/test/java/org/apache/ambari/server/api/services/ClusterKerberosDescriptorServiceTest.java b/ambari-server/src/test/java/org/apache/ambari/server/api/services/ClusterKerberosDescriptorServiceTest.java index 554e950..ab83dfd 100644 --- a/ambari-server/src/test/java/org/apache/ambari/server/api/services/ClusterKerberosDescriptorServiceTest.java +++ b/ambari-server/src/test/java/org/apache/ambari/server/api/services/ClusterKerberosDescriptorServiceTest.java @@ -38,7 +38,7 @@ public class ClusterKerberosDescriptorServiceTest extends BaseServiceTest { public List<ServiceTestInvocation> getTestInvocations() throws Exception { - List<ServiceTestInvocation> listInvocations = new ArrayList<ServiceTestInvocation>(); + List<ServiceTestInvocation> listInvocations = new ArrayList<>(); ClusterKerberosDescriptorService service; Method m; http://git-wip-us.apache.org/repos/asf/ambari/blob/edbb5492/ambari-server/src/test/java/org/apache/ambari/server/api/services/ClusterPrivilegeServiceTest.java ---------------------------------------------------------------------- diff --git a/ambari-server/src/test/java/org/apache/ambari/server/api/services/ClusterPrivilegeServiceTest.java b/ambari-server/src/test/java/org/apache/ambari/server/api/services/ClusterPrivilegeServiceTest.java index f05a580..a1c8d6c 100644 --- a/ambari-server/src/test/java/org/apache/ambari/server/api/services/ClusterPrivilegeServiceTest.java +++ b/ambari-server/src/test/java/org/apache/ambari/server/api/services/ClusterPrivilegeServiceTest.java @@ -36,7 +36,7 @@ public class ClusterPrivilegeServiceTest extends BaseServiceTest { public List<ServiceTestInvocation> getTestInvocations() throws Exception { - List<ServiceTestInvocation> listInvocations = new ArrayList<ServiceTestInvocation>(); + List<ServiceTestInvocation> listInvocations = new ArrayList<>(); //getPrivilege ClusterPrivilegeService privilegeService = new TestClusterPrivilegeService("c1"); http://git-wip-us.apache.org/repos/asf/ambari/blob/edbb5492/ambari-server/src/test/java/org/apache/ambari/server/api/services/ClusterServiceTest.java ---------------------------------------------------------------------- diff --git a/ambari-server/src/test/java/org/apache/ambari/server/api/services/ClusterServiceTest.java b/ambari-server/src/test/java/org/apache/ambari/server/api/services/ClusterServiceTest.java index 7e564a1..cfc43f5 100644 --- a/ambari-server/src/test/java/org/apache/ambari/server/api/services/ClusterServiceTest.java +++ b/ambari-server/src/test/java/org/apache/ambari/server/api/services/ClusterServiceTest.java @@ -48,7 +48,7 @@ public class ClusterServiceTest extends BaseServiceTest { @Override public List<ServiceTestInvocation> getTestInvocations() throws Exception { - List<ServiceTestInvocation> listInvocations = new ArrayList<ServiceTestInvocation>(); + List<ServiceTestInvocation> listInvocations = new ArrayList<>(); ClusterDAO clusterDAO = EasyMock.createNiceMock(ClusterDAO.class); HostDAO hostDAO = EasyMock.createNiceMock(HostDAO.class); http://git-wip-us.apache.org/repos/asf/ambari/blob/edbb5492/ambari-server/src/test/java/org/apache/ambari/server/api/services/ClusterStackVersionServiceTest.java ---------------------------------------------------------------------- diff --git a/ambari-server/src/test/java/org/apache/ambari/server/api/services/ClusterStackVersionServiceTest.java b/ambari-server/src/test/java/org/apache/ambari/server/api/services/ClusterStackVersionServiceTest.java index 782a142..ac607fb 100644 --- a/ambari-server/src/test/java/org/apache/ambari/server/api/services/ClusterStackVersionServiceTest.java +++ b/ambari-server/src/test/java/org/apache/ambari/server/api/services/ClusterStackVersionServiceTest.java @@ -41,7 +41,7 @@ import junit.framework.TestCase; public class ClusterStackVersionServiceTest extends BaseServiceTest { public List<ServiceTestInvocation> getTestInvocations() throws Exception { - List<ServiceTestInvocation> listInvocations = new ArrayList<ServiceTestInvocation>(); + List<ServiceTestInvocation> listInvocations = new ArrayList<>(); ClusterStackVersionService clusterStackVersionService; Method m; http://git-wip-us.apache.org/repos/asf/ambari/blob/edbb5492/ambari-server/src/test/java/org/apache/ambari/server/api/services/ComponentServiceTest.java ---------------------------------------------------------------------- diff --git a/ambari-server/src/test/java/org/apache/ambari/server/api/services/ComponentServiceTest.java b/ambari-server/src/test/java/org/apache/ambari/server/api/services/ComponentServiceTest.java index c658165..9ced9b3 100644 --- a/ambari-server/src/test/java/org/apache/ambari/server/api/services/ComponentServiceTest.java +++ b/ambari-server/src/test/java/org/apache/ambari/server/api/services/ComponentServiceTest.java @@ -39,7 +39,7 @@ import org.apache.ambari.server.api.services.serializers.ResultSerializer; public class ComponentServiceTest extends BaseServiceTest { public List<ServiceTestInvocation> getTestInvocations() throws Exception { - List<ServiceTestInvocation> listInvocations = new ArrayList<ServiceTestInvocation>(); + List<ServiceTestInvocation> listInvocations = new ArrayList<>(); //getComponent ComponentService service = new TestComponentService("clusterName", "serviceName", "componentName"); http://git-wip-us.apache.org/repos/asf/ambari/blob/edbb5492/ambari-server/src/test/java/org/apache/ambari/server/api/services/ConfigGroupServiceTest.java ---------------------------------------------------------------------- diff --git a/ambari-server/src/test/java/org/apache/ambari/server/api/services/ConfigGroupServiceTest.java b/ambari-server/src/test/java/org/apache/ambari/server/api/services/ConfigGroupServiceTest.java index 4c2e975..88ee500 100644 --- a/ambari-server/src/test/java/org/apache/ambari/server/api/services/ConfigGroupServiceTest.java +++ b/ambari-server/src/test/java/org/apache/ambari/server/api/services/ConfigGroupServiceTest.java @@ -34,7 +34,7 @@ public class ConfigGroupServiceTest extends BaseServiceTest { @Override public List<ServiceTestInvocation> getTestInvocations() throws Exception { - List<ServiceTestInvocation> listInvocations = new ArrayList<ServiceTestInvocation>(); + List<ServiceTestInvocation> listInvocations = new ArrayList<>(); // Get Config Groups ConfigGroupService configGroupService = new TestConfigGroupService http://git-wip-us.apache.org/repos/asf/ambari/blob/edbb5492/ambari-server/src/test/java/org/apache/ambari/server/api/services/ConfigurationServiceTest.java ---------------------------------------------------------------------- diff --git a/ambari-server/src/test/java/org/apache/ambari/server/api/services/ConfigurationServiceTest.java b/ambari-server/src/test/java/org/apache/ambari/server/api/services/ConfigurationServiceTest.java index 48daba7..adaffff 100644 --- a/ambari-server/src/test/java/org/apache/ambari/server/api/services/ConfigurationServiceTest.java +++ b/ambari-server/src/test/java/org/apache/ambari/server/api/services/ConfigurationServiceTest.java @@ -34,7 +34,7 @@ import org.apache.ambari.server.api.services.serializers.ResultSerializer; public class ConfigurationServiceTest extends BaseServiceTest { public List<ServiceTestInvocation> getTestInvocations() throws Exception { - List<ServiceTestInvocation> listInvocations = new ArrayList<ServiceTestInvocation>(); + List<ServiceTestInvocation> listInvocations = new ArrayList<>(); //getConfigurations ConfigurationService service = new TestConfigurationService("clusterName"); http://git-wip-us.apache.org/repos/asf/ambari/blob/edbb5492/ambari-server/src/test/java/org/apache/ambari/server/api/services/CredentialServiceTest.java ---------------------------------------------------------------------- diff --git a/ambari-server/src/test/java/org/apache/ambari/server/api/services/CredentialServiceTest.java b/ambari-server/src/test/java/org/apache/ambari/server/api/services/CredentialServiceTest.java index 3466cc7..73d3383 100644 --- a/ambari-server/src/test/java/org/apache/ambari/server/api/services/CredentialServiceTest.java +++ b/ambari-server/src/test/java/org/apache/ambari/server/api/services/CredentialServiceTest.java @@ -38,7 +38,7 @@ public class CredentialServiceTest extends BaseServiceTest { public List<ServiceTestInvocation> getTestInvocations() throws Exception { - List<ServiceTestInvocation> listInvocations = new ArrayList<ServiceTestInvocation>(); + List<ServiceTestInvocation> listInvocations = new ArrayList<>(); //getCredential CredentialService CredentialService = new TestCredentialService("alias"); http://git-wip-us.apache.org/repos/asf/ambari/blob/edbb5492/ambari-server/src/test/java/org/apache/ambari/server/api/services/ExtensionsServiceTest.java ---------------------------------------------------------------------- diff --git a/ambari-server/src/test/java/org/apache/ambari/server/api/services/ExtensionsServiceTest.java b/ambari-server/src/test/java/org/apache/ambari/server/api/services/ExtensionsServiceTest.java index 6186319..7a696a6 100644 --- a/ambari-server/src/test/java/org/apache/ambari/server/api/services/ExtensionsServiceTest.java +++ b/ambari-server/src/test/java/org/apache/ambari/server/api/services/ExtensionsServiceTest.java @@ -38,7 +38,7 @@ public class ExtensionsServiceTest extends BaseServiceTest { @Override public List<ServiceTestInvocation> getTestInvocations() throws Exception { - List<ServiceTestInvocation> listInvocations = new ArrayList<ServiceTestInvocation>(); + List<ServiceTestInvocation> listInvocations = new ArrayList<>(); // getExtension ExtensionsService service = new TestExtensionsService("extensionName", null); http://git-wip-us.apache.org/repos/asf/ambari/blob/edbb5492/ambari-server/src/test/java/org/apache/ambari/server/api/services/FeedServiceTest.java ---------------------------------------------------------------------- diff --git a/ambari-server/src/test/java/org/apache/ambari/server/api/services/FeedServiceTest.java b/ambari-server/src/test/java/org/apache/ambari/server/api/services/FeedServiceTest.java index 7756453..c899b93 100644 --- a/ambari-server/src/test/java/org/apache/ambari/server/api/services/FeedServiceTest.java +++ b/ambari-server/src/test/java/org/apache/ambari/server/api/services/FeedServiceTest.java @@ -39,7 +39,7 @@ public class FeedServiceTest extends BaseServiceTest { public List<ServiceTestInvocation> getTestInvocations() throws Exception { - List<ServiceTestInvocation> listInvocations = new ArrayList<ServiceTestInvocation>(); + List<ServiceTestInvocation> listInvocations = new ArrayList<>(); //getFeed FeedService feedService = new TestFeedService("feedName"); http://git-wip-us.apache.org/repos/asf/ambari/blob/edbb5492/ambari-server/src/test/java/org/apache/ambari/server/api/services/GroupPrivilegeServiceTest.java ---------------------------------------------------------------------- diff --git a/ambari-server/src/test/java/org/apache/ambari/server/api/services/GroupPrivilegeServiceTest.java b/ambari-server/src/test/java/org/apache/ambari/server/api/services/GroupPrivilegeServiceTest.java index 995dfaf..89545a5 100644 --- a/ambari-server/src/test/java/org/apache/ambari/server/api/services/GroupPrivilegeServiceTest.java +++ b/ambari-server/src/test/java/org/apache/ambari/server/api/services/GroupPrivilegeServiceTest.java @@ -43,7 +43,7 @@ import junit.framework.Assert; public class GroupPrivilegeServiceTest extends BaseServiceTest { public List<ServiceTestInvocation> getTestInvocations() throws Exception { - List<ServiceTestInvocation> listInvocations = new ArrayList<ServiceTestInvocation>(); + List<ServiceTestInvocation> listInvocations = new ArrayList<>(); GroupPrivilegeService groupPrivilegeService; Method m; @@ -70,7 +70,7 @@ public class GroupPrivilegeServiceTest extends BaseServiceTest { final UriInfo uriInfo = EasyMock.createNiceMock(UriInfo.class); final GroupPrivilegeService service = new TestGroupPrivilegeService(); - final List<Response> disabledMethods = new ArrayList<Response>(); + final List<Response> disabledMethods = new ArrayList<>(); disabledMethods.add(service.createPrivilege("test", headers, uriInfo)); disabledMethods.add(service.updatePrivilege("test", headers, uriInfo, "test")); disabledMethods.add(service.updatePrivileges("test", headers, uriInfo)); http://git-wip-us.apache.org/repos/asf/ambari/blob/edbb5492/ambari-server/src/test/java/org/apache/ambari/server/api/services/GroupServiceTest.java ---------------------------------------------------------------------- diff --git a/ambari-server/src/test/java/org/apache/ambari/server/api/services/GroupServiceTest.java b/ambari-server/src/test/java/org/apache/ambari/server/api/services/GroupServiceTest.java index b171ceb..f46d358 100644 --- a/ambari-server/src/test/java/org/apache/ambari/server/api/services/GroupServiceTest.java +++ b/ambari-server/src/test/java/org/apache/ambari/server/api/services/GroupServiceTest.java @@ -38,7 +38,7 @@ public class GroupServiceTest extends BaseServiceTest { @Override public List<ServiceTestInvocation> getTestInvocations() throws Exception { - List<ServiceTestInvocation> listInvocations = new ArrayList<ServiceTestInvocation>(); + List<ServiceTestInvocation> listInvocations = new ArrayList<>(); GroupService groupService; Method m; http://git-wip-us.apache.org/repos/asf/ambari/blob/edbb5492/ambari-server/src/test/java/org/apache/ambari/server/api/services/HostComponentServiceTest.java ---------------------------------------------------------------------- diff --git a/ambari-server/src/test/java/org/apache/ambari/server/api/services/HostComponentServiceTest.java b/ambari-server/src/test/java/org/apache/ambari/server/api/services/HostComponentServiceTest.java index 9cbed02..01ccd6a 100644 --- a/ambari-server/src/test/java/org/apache/ambari/server/api/services/HostComponentServiceTest.java +++ b/ambari-server/src/test/java/org/apache/ambari/server/api/services/HostComponentServiceTest.java @@ -38,7 +38,7 @@ import org.apache.ambari.server.api.services.serializers.ResultSerializer; public class HostComponentServiceTest extends BaseServiceTest { public List<ServiceTestInvocation> getTestInvocations() throws Exception { - List<ServiceTestInvocation> listInvocations = new ArrayList<ServiceTestInvocation>(); + List<ServiceTestInvocation> listInvocations = new ArrayList<>(); //getHostComponent HostComponentService componentService = new TestHostComponentService("clusterName", "serviceName", "componentName"); http://git-wip-us.apache.org/repos/asf/ambari/blob/edbb5492/ambari-server/src/test/java/org/apache/ambari/server/api/services/HostKerberosIdentityServiceTest.java ---------------------------------------------------------------------- diff --git a/ambari-server/src/test/java/org/apache/ambari/server/api/services/HostKerberosIdentityServiceTest.java b/ambari-server/src/test/java/org/apache/ambari/server/api/services/HostKerberosIdentityServiceTest.java index 7920405..c9200b0 100644 --- a/ambari-server/src/test/java/org/apache/ambari/server/api/services/HostKerberosIdentityServiceTest.java +++ b/ambari-server/src/test/java/org/apache/ambari/server/api/services/HostKerberosIdentityServiceTest.java @@ -39,7 +39,7 @@ import org.apache.ambari.server.api.services.serializers.ResultSerializer; public class HostKerberosIdentityServiceTest extends BaseServiceTest { public List<ServiceTestInvocation> getTestInvocations() throws Exception { - List<ServiceTestInvocation> listInvocations = new ArrayList<ServiceTestInvocation>(); + List<ServiceTestInvocation> listInvocations = new ArrayList<>(); //getComponent HostKerberosIdentityService service = new TestHostKerberosIdentityService("clusterName", "hostName", "identityId"); http://git-wip-us.apache.org/repos/asf/ambari/blob/edbb5492/ambari-server/src/test/java/org/apache/ambari/server/api/services/HostServiceTest.java ---------------------------------------------------------------------- diff --git a/ambari-server/src/test/java/org/apache/ambari/server/api/services/HostServiceTest.java b/ambari-server/src/test/java/org/apache/ambari/server/api/services/HostServiceTest.java index 0dc97bc..6aef04d 100644 --- a/ambari-server/src/test/java/org/apache/ambari/server/api/services/HostServiceTest.java +++ b/ambari-server/src/test/java/org/apache/ambari/server/api/services/HostServiceTest.java @@ -38,7 +38,7 @@ import org.apache.ambari.server.api.services.serializers.ResultSerializer; public class HostServiceTest extends BaseServiceTest { public List<ServiceTestInvocation> getTestInvocations() throws Exception { - List<ServiceTestInvocation> listInvocations = new ArrayList<ServiceTestInvocation>(); + List<ServiceTestInvocation> listInvocations = new ArrayList<>(); //getHost HostService service = new TestHostService("clusterName", "hostName"); http://git-wip-us.apache.org/repos/asf/ambari/blob/edbb5492/ambari-server/src/test/java/org/apache/ambari/server/api/services/HostStackVersionServiceTest.java ---------------------------------------------------------------------- diff --git a/ambari-server/src/test/java/org/apache/ambari/server/api/services/HostStackVersionServiceTest.java b/ambari-server/src/test/java/org/apache/ambari/server/api/services/HostStackVersionServiceTest.java index 57e4cf1..8367a94 100644 --- a/ambari-server/src/test/java/org/apache/ambari/server/api/services/HostStackVersionServiceTest.java +++ b/ambari-server/src/test/java/org/apache/ambari/server/api/services/HostStackVersionServiceTest.java @@ -37,7 +37,7 @@ import org.apache.ambari.server.controller.spi.Resource.Type; public class HostStackVersionServiceTest extends BaseServiceTest { public List<ServiceTestInvocation> getTestInvocations() throws Exception { - List<ServiceTestInvocation> listInvocations = new ArrayList<ServiceTestInvocation>(); + List<ServiceTestInvocation> listInvocations = new ArrayList<>(); HostStackVersionService hostStackVersionService; Method m; http://git-wip-us.apache.org/repos/asf/ambari/blob/edbb5492/ambari-server/src/test/java/org/apache/ambari/server/api/services/InstanceServiceTest.java ---------------------------------------------------------------------- diff --git a/ambari-server/src/test/java/org/apache/ambari/server/api/services/InstanceServiceTest.java b/ambari-server/src/test/java/org/apache/ambari/server/api/services/InstanceServiceTest.java index 86cc3b2..ee42b57 100644 --- a/ambari-server/src/test/java/org/apache/ambari/server/api/services/InstanceServiceTest.java +++ b/ambari-server/src/test/java/org/apache/ambari/server/api/services/InstanceServiceTest.java @@ -38,7 +38,7 @@ import org.apache.ambari.server.api.services.serializers.ResultSerializer; public class InstanceServiceTest extends BaseServiceTest { public List<ServiceTestInvocation> getTestInvocations() throws Exception { - List<ServiceTestInvocation> listInvocations = new ArrayList<ServiceTestInvocation>(); + List<ServiceTestInvocation> listInvocations = new ArrayList<>(); //getInstance InstanceService service = new TestInstanceService("clusterName", "instanceName"); http://git-wip-us.apache.org/repos/asf/ambari/blob/edbb5492/ambari-server/src/test/java/org/apache/ambari/server/api/services/JobServiceTest.java ---------------------------------------------------------------------- diff --git a/ambari-server/src/test/java/org/apache/ambari/server/api/services/JobServiceTest.java b/ambari-server/src/test/java/org/apache/ambari/server/api/services/JobServiceTest.java index 6e0fa96..128b345 100644 --- a/ambari-server/src/test/java/org/apache/ambari/server/api/services/JobServiceTest.java +++ b/ambari-server/src/test/java/org/apache/ambari/server/api/services/JobServiceTest.java @@ -36,7 +36,7 @@ public class JobServiceTest extends BaseServiceTest { @Override public List<ServiceTestInvocation> getTestInvocations() throws Exception { - List<ServiceTestInvocation> listInvocations = new ArrayList<ServiceTestInvocation>(); + List<ServiceTestInvocation> listInvocations = new ArrayList<>(); // getJob JobService service = new TestJobService("clusterName", "jobId"); http://git-wip-us.apache.org/repos/asf/ambari/blob/edbb5492/ambari-server/src/test/java/org/apache/ambari/server/api/services/LdapSyncEventServiceTest.java ---------------------------------------------------------------------- diff --git a/ambari-server/src/test/java/org/apache/ambari/server/api/services/LdapSyncEventServiceTest.java b/ambari-server/src/test/java/org/apache/ambari/server/api/services/LdapSyncEventServiceTest.java index 25939bc..9085bf5 100644 --- a/ambari-server/src/test/java/org/apache/ambari/server/api/services/LdapSyncEventServiceTest.java +++ b/ambari-server/src/test/java/org/apache/ambari/server/api/services/LdapSyncEventServiceTest.java @@ -37,7 +37,7 @@ import org.apache.ambari.server.controller.spi.Resource; public class LdapSyncEventServiceTest extends BaseServiceTest { public List<ServiceTestInvocation> getTestInvocations() throws Exception { - List<ServiceTestInvocation> listInvocations = new ArrayList<ServiceTestInvocation>(); + List<ServiceTestInvocation> listInvocations = new ArrayList<>(); //getEvent LdapSyncEventService permissionService = new TestLdapSyncEventService(); http://git-wip-us.apache.org/repos/asf/ambari/blob/edbb5492/ambari-server/src/test/java/org/apache/ambari/server/api/services/MemberServiceTest.java ---------------------------------------------------------------------- diff --git a/ambari-server/src/test/java/org/apache/ambari/server/api/services/MemberServiceTest.java b/ambari-server/src/test/java/org/apache/ambari/server/api/services/MemberServiceTest.java index 1e0137e..f9543df 100644 --- a/ambari-server/src/test/java/org/apache/ambari/server/api/services/MemberServiceTest.java +++ b/ambari-server/src/test/java/org/apache/ambari/server/api/services/MemberServiceTest.java @@ -37,7 +37,7 @@ import org.apache.ambari.server.controller.spi.Resource.Type; public class MemberServiceTest extends BaseServiceTest { public List<ServiceTestInvocation> getTestInvocations() throws Exception { - List<ServiceTestInvocation> listInvocations = new ArrayList<ServiceTestInvocation>(); + List<ServiceTestInvocation> listInvocations = new ArrayList<>(); MemberService memberService; Method m; http://git-wip-us.apache.org/repos/asf/ambari/blob/edbb5492/ambari-server/src/test/java/org/apache/ambari/server/api/services/NamedPropertySetTest.java ---------------------------------------------------------------------- diff --git a/ambari-server/src/test/java/org/apache/ambari/server/api/services/NamedPropertySetTest.java b/ambari-server/src/test/java/org/apache/ambari/server/api/services/NamedPropertySetTest.java index 43e2b2c..7fadeb1 100644 --- a/ambari-server/src/test/java/org/apache/ambari/server/api/services/NamedPropertySetTest.java +++ b/ambari-server/src/test/java/org/apache/ambari/server/api/services/NamedPropertySetTest.java @@ -33,7 +33,7 @@ public class NamedPropertySetTest { @Test public void testGetters() { - Map<String, Object> mapProps = new HashMap<String, Object>(); + Map<String, Object> mapProps = new HashMap<>(); mapProps.put("foo", "bar"); NamedPropertySet propertySet = new NamedPropertySet("foo", mapProps); @@ -43,7 +43,7 @@ public class NamedPropertySetTest { @Test public void testEquals() { - Map<String, Object> mapProps = new HashMap<String, Object>(); + Map<String, Object> mapProps = new HashMap<>(); mapProps.put("foo", "bar"); NamedPropertySet propertySet = new NamedPropertySet("foo", mapProps); @@ -60,7 +60,7 @@ public class NamedPropertySetTest { @Test public void testHashCode() { - Map<String, Object> mapProps = new HashMap<String, Object>(); + Map<String, Object> mapProps = new HashMap<>(); NamedPropertySet propertySet = new NamedPropertySet("foo", mapProps); NamedPropertySet propertySet2 = new NamedPropertySet("foo", mapProps); http://git-wip-us.apache.org/repos/asf/ambari/blob/edbb5492/ambari-server/src/test/java/org/apache/ambari/server/api/services/PermissionServiceTest.java ---------------------------------------------------------------------- diff --git a/ambari-server/src/test/java/org/apache/ambari/server/api/services/PermissionServiceTest.java b/ambari-server/src/test/java/org/apache/ambari/server/api/services/PermissionServiceTest.java index 6994513..bbb4578 100644 --- a/ambari-server/src/test/java/org/apache/ambari/server/api/services/PermissionServiceTest.java +++ b/ambari-server/src/test/java/org/apache/ambari/server/api/services/PermissionServiceTest.java @@ -38,7 +38,7 @@ import org.apache.ambari.server.api.services.serializers.ResultSerializer; public class PermissionServiceTest extends BaseServiceTest { public List<ServiceTestInvocation> getTestInvocations() throws Exception { - List<ServiceTestInvocation> listInvocations = new ArrayList<ServiceTestInvocation>(); + List<ServiceTestInvocation> listInvocations = new ArrayList<>(); //getPermission PermissionService service = new TestPermissionService("id");