incubator-ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nc...@apache.org
Subject [1/5] AMBARI-3728. Remove unused config code from Service, Component, HostComponent (ncole)
Date Fri, 08 Nov 2013 22:25:03 GMT
Updated Branches:
  refs/heads/trunk 8b3af9afe -> 471403cd5


http://git-wip-us.apache.org/repos/asf/incubator-ambari/blob/471403cd/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/AbstractResourceProviderTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/AbstractResourceProviderTest.java b/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/AbstractResourceProviderTest.java
index bc6561c..c86ad45 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/AbstractResourceProviderTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/AbstractResourceProviderTest.java
@@ -18,7 +18,14 @@
 
 package org.apache.ambari.server.controller.internal;
 
-import org.apache.ambari.server.controller.ActionRequest;
+import static org.easymock.EasyMock.createMock;
+
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Map;
+import java.util.Set;
+
 import org.apache.ambari.server.controller.AmbariManagementController;
 import org.apache.ambari.server.controller.ClusterRequest;
 import org.apache.ambari.server.controller.ConfigurationRequest;
@@ -35,14 +42,6 @@ import org.easymock.IArgumentMatcher;
 import org.junit.Assert;
 import org.junit.Test;
 
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Map;
-import java.util.Set;
-
-import static org.easymock.EasyMock.createMock;
-
 /**
  * Resource provider tests.
  */
@@ -373,7 +372,7 @@ public class AbstractResourceProviderTest {
                                       Map<String, String> configVersions, String desiredState) {
       this.hostComponentRequest =
           new ServiceComponentHostRequest(clusterName, serviceName, componentName,
-              hostName, configVersions, desiredState);
+              hostName, desiredState);
       add(this.hostComponentRequest);
     }
 
@@ -397,7 +396,6 @@ public class AbstractResourceProviderTest {
           eq(((ServiceComponentHostRequest) request).getServiceName(), hostComponentRequest.getServiceName()) &&
           eq(((ServiceComponentHostRequest) request).getComponentName(), hostComponentRequest.getComponentName()) &&
           eq(((ServiceComponentHostRequest) request).getHostname(), hostComponentRequest.getHostname()) &&
-          eq(((ServiceComponentHostRequest) request).getConfigVersions(), hostComponentRequest.getConfigVersions()) &&
           eq(((ServiceComponentHostRequest) request).getDesiredState(), hostComponentRequest.getDesiredState());
     }
 

http://git-wip-us.apache.org/repos/asf/incubator-ambari/blob/471403cd/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/ComponentResourceProviderTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/ComponentResourceProviderTest.java b/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/ComponentResourceProviderTest.java
index 1db614d..5238127 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/ComponentResourceProviderTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/ComponentResourceProviderTest.java
@@ -170,9 +170,9 @@ public class ComponentResourceProviderTest {
 
     expect(service.getServiceComponents()).andReturn(serviceComponentMap).anyTimes();
 
-    expect(serviceComponent1.convertToResponse()).andReturn(new ServiceComponentResponse(100L, "Cluster100", "Service100", "Component100", null, null, ""));
-    expect(serviceComponent2.convertToResponse()).andReturn(new ServiceComponentResponse(100L, "Cluster100", "Service100", "Component101", null, null, ""));
-    expect(serviceComponent3.convertToResponse()).andReturn(new ServiceComponentResponse(100L, "Cluster100", "Service100", "Component102", null, null, ""));
+    expect(serviceComponent1.convertToResponse()).andReturn(new ServiceComponentResponse(100L, "Cluster100", "Service100", "Component100", null, ""));
+    expect(serviceComponent2.convertToResponse()).andReturn(new ServiceComponentResponse(100L, "Cluster100", "Service100", "Component101", null, ""));
+    expect(serviceComponent3.convertToResponse()).andReturn(new ServiceComponentResponse(100L, "Cluster100", "Service100", "Component102", null, ""));
 
 
     expect(ambariMetaInfo.getComponentCategory((String) anyObject(), (String) anyObject(),
@@ -252,9 +252,9 @@ public class ComponentResourceProviderTest {
 
     expect(service.getServiceComponents()).andReturn(serviceComponentMap).anyTimes();
 
-    expect(serviceComponent1.convertToResponse()).andReturn(new ServiceComponentResponse(100L, "Cluster100", "Service100", "Component101", null, null, ""));
-    expect(serviceComponent2.convertToResponse()).andReturn(new ServiceComponentResponse(100L, "Cluster100", "Service100", "Component102", null, null, ""));
-    expect(serviceComponent3.convertToResponse()).andReturn(new ServiceComponentResponse(100L, "Cluster100", "Service100", "Component103", null, null, ""));
+    expect(serviceComponent1.convertToResponse()).andReturn(new ServiceComponentResponse(100L, "Cluster100", "Service100", "Component101", null, ""));
+    expect(serviceComponent2.convertToResponse()).andReturn(new ServiceComponentResponse(100L, "Cluster100", "Service100", "Component102", null, ""));
+    expect(serviceComponent3.convertToResponse()).andReturn(new ServiceComponentResponse(100L, "Cluster100", "Service100", "Component103", null, ""));
     expect(serviceComponent1.getDesiredState()).andReturn(State.INSTALLED).anyTimes();
     expect(serviceComponent2.getDesiredState()).andReturn(State.INSTALLED).anyTimes();
     expect(serviceComponent3.getDesiredState()).andReturn(State.INSTALLED).anyTimes();
@@ -362,7 +362,7 @@ public class ComponentResourceProviderTest {
 
     // requests
     ServiceComponentRequest request1 = new ServiceComponentRequest("cluster1", "service1", "component1",
-        Collections.<String, String>emptyMap(), null);
+        null);
 
     Set<ServiceComponentRequest> setRequests = new HashSet<ServiceComponentRequest>();
     setRequests.add(request1);
@@ -414,13 +414,13 @@ public class ComponentResourceProviderTest {
 
     // requests
     ServiceComponentRequest request1 = new ServiceComponentRequest("cluster1", "service1", "component1",
-        Collections.<String, String>emptyMap(), null);
+        null);
     ServiceComponentRequest request2 = new ServiceComponentRequest("cluster1", "service1", "component2",
-        Collections.<String, String>emptyMap(), null);
+        null);
     ServiceComponentRequest request3 = new ServiceComponentRequest("cluster1", "service1", "component3",
-        Collections.<String, String>emptyMap(), null);
+        null);
     ServiceComponentRequest request4 = new ServiceComponentRequest("cluster1", "service1", "component4",
-        Collections.<String, String>emptyMap(), null);
+        null);
 
     Set<ServiceComponentRequest> setRequests = new HashSet<ServiceComponentRequest>();
     setRequests.add(request1);
@@ -484,7 +484,7 @@ public class ComponentResourceProviderTest {
 
     // requests
     ServiceComponentRequest request1 = new ServiceComponentRequest("cluster1", "service1", "component1",
-        Collections.<String, String>emptyMap(), null);
+        null);
 
     Set<ServiceComponentRequest> setRequests = new HashSet<ServiceComponentRequest>();
     setRequests.add(request1);

http://git-wip-us.apache.org/repos/asf/incubator-ambari/blob/471403cd/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/HostComponentResourceProviderTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/HostComponentResourceProviderTest.java b/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/HostComponentResourceProviderTest.java
index b84f96e..69dd707 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/HostComponentResourceProviderTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/HostComponentResourceProviderTest.java
@@ -106,16 +106,13 @@ public class HostComponentResourceProviderTest {
     StackId stackId = new StackId("HDP-0.1");
     StackId stackId2 = new StackId("HDP-0.2");
     allResponse.add(new ServiceComponentHostResponse(
-        "Cluster100", "Service100", "Component100", "Host100", null, null, State.INSTALLED.toString(),
-        stackId.getStackId(), State.STARTED.toString(),
+        "Cluster100", "Service100", "Component100", "Host100", State.INSTALLED.toString(), stackId.getStackId(), State.STARTED.toString(),
         stackId2.getStackId()));
     allResponse.add(new ServiceComponentHostResponse(
-        "Cluster100", "Service100", "Component101", "Host100", null, null, State.INSTALLED.toString(),
-        stackId.getStackId(), State.STARTED.toString(),
+        "Cluster100", "Service100", "Component101", "Host100", State.INSTALLED.toString(), stackId.getStackId(), State.STARTED.toString(),
         stackId2.getStackId()));
     allResponse.add(new ServiceComponentHostResponse(
-        "Cluster100", "Service100", "Component102", "Host100", null, null, State.INSTALLED.toString(),
-        stackId.getStackId(), State.STARTED.toString(),
+        "Cluster100", "Service100", "Component102", "Host100", State.INSTALLED.toString(), stackId.getStackId(), State.STARTED.toString(),
         stackId2.getStackId()));
     Map<String, String> expectedNameValues = new HashMap<String, String>();
     expectedNameValues.put(
@@ -187,7 +184,7 @@ public class HostComponentResourceProviderTest {
 
     Set<ServiceComponentHostResponse> nameResponse = new HashSet<ServiceComponentHostResponse>();
     nameResponse.add(new ServiceComponentHostResponse(
-        "Cluster102", "Service100", "Component100", "Host100", null, null, "STARTED", "", "", ""));
+        "Cluster102", "Service100", "Component100", "Host100", "STARTED", "", "", ""));
 
     // set expectations
     expect(managementController.getHostComponents(

http://git-wip-us.apache.org/repos/asf/incubator-ambari/blob/471403cd/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/HostResourceProviderTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/HostResourceProviderTest.java b/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/HostResourceProviderTest.java
index 90f26bb..fba59ec 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/HostResourceProviderTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/HostResourceProviderTest.java
@@ -226,9 +226,9 @@ public class HostResourceProviderTest {
     Set<Cluster> clusterSet = new HashSet<Cluster>();
     clusterSet.add(cluster);
 
-    ServiceComponentHostResponse shr1 = new ServiceComponentHostResponse("Cluster100", "Service100", "Component100", "Host100", null, null, "STARTED", "", null, null);
-    ServiceComponentHostResponse shr2 = new ServiceComponentHostResponse("Cluster100", "Service100", "Component102", "Host100", null, null, "STARTED", "", null, null);
-    ServiceComponentHostResponse shr3 = new ServiceComponentHostResponse("Cluster100", "Service100", "Component103", "Host100", null, null, "STARTED", "", null, null);
+    ServiceComponentHostResponse shr1 = new ServiceComponentHostResponse("Cluster100", "Service100", "Component100", "Host100", "STARTED", "", null, null);
+    ServiceComponentHostResponse shr2 = new ServiceComponentHostResponse("Cluster100", "Service100", "Component102", "Host100", "STARTED", "", null, null);
+    ServiceComponentHostResponse shr3 = new ServiceComponentHostResponse("Cluster100", "Service100", "Component103", "Host100", "STARTED", "", null, null);
 
     Set<ServiceComponentHostResponse> responses = new HashSet<ServiceComponentHostResponse>();
     responses.add(shr1);
@@ -324,9 +324,9 @@ public class HostResourceProviderTest {
     Set<Cluster> clusterSet = new HashSet<Cluster>();
     clusterSet.add(cluster);
 
-    ServiceComponentHostResponse shr1 = new ServiceComponentHostResponse("Cluster100", "Service100", "Component100", "Host100", null, null, "STARTED", "", null, null);
-    ServiceComponentHostResponse shr2 = new ServiceComponentHostResponse("Cluster100", "Service100", "Component102", "Host100", null, null, "STARTED", "", null, null);
-    ServiceComponentHostResponse shr3 = new ServiceComponentHostResponse("Cluster100", "Service100", "Component103", "Host100", null, null, "STARTED", "", null, null);
+    ServiceComponentHostResponse shr1 = new ServiceComponentHostResponse("Cluster100", "Service100", "Component100", "Host100", "STARTED", "", null, null);
+    ServiceComponentHostResponse shr2 = new ServiceComponentHostResponse("Cluster100", "Service100", "Component102", "Host100", "STARTED", "", null, null);
+    ServiceComponentHostResponse shr3 = new ServiceComponentHostResponse("Cluster100", "Service100", "Component103", "Host100", "STARTED", "", null, null);
 
     Set<ServiceComponentHostResponse> responses = new HashSet<ServiceComponentHostResponse>();
     responses.add(shr1);
@@ -424,9 +424,9 @@ public class HostResourceProviderTest {
     Set<Cluster> clusterSet = new HashSet<Cluster>();
     clusterSet.add(cluster);
 
-    ServiceComponentHostResponse shr1 = new ServiceComponentHostResponse("Cluster100", "Service100", "Component100", "Host100", null, null, "STARTED", "", null, null);
-    ServiceComponentHostResponse shr2 = new ServiceComponentHostResponse("Cluster100", "Service100", "Component102", "Host100", null, null, "INSTALLED", "", null, null);
-    ServiceComponentHostResponse shr3 = new ServiceComponentHostResponse("Cluster100", "Service100", "Component103", "Host100", null, null, "STARTED", "", null, null);
+    ServiceComponentHostResponse shr1 = new ServiceComponentHostResponse("Cluster100", "Service100", "Component100", "Host100", "STARTED", "", null, null);
+    ServiceComponentHostResponse shr2 = new ServiceComponentHostResponse("Cluster100", "Service100", "Component102", "Host100", "INSTALLED", "", null, null);
+    ServiceComponentHostResponse shr3 = new ServiceComponentHostResponse("Cluster100", "Service100", "Component103", "Host100", "STARTED", "", null, null);
 
     Set<ServiceComponentHostResponse> responses = new HashSet<ServiceComponentHostResponse>();
     responses.add(shr1);
@@ -604,9 +604,9 @@ public class HostResourceProviderTest {
     Set<Cluster> clusterSet = new HashSet<Cluster>();
     clusterSet.add(cluster);
 
-    ServiceComponentHostResponse shr1 = new ServiceComponentHostResponse("Cluster100", "Service100", "Component100", "Host100", null, null, "STARTED", "", null, null);
-    ServiceComponentHostResponse shr2 = new ServiceComponentHostResponse("Cluster100", "Service100", "Component102", "Host100", null, null, "INSTALLED", "", null, null);
-    ServiceComponentHostResponse shr3 = new ServiceComponentHostResponse("Cluster100", "Service100", "Component103", "Host100", null, null, "STARTED", "", null, null);
+    ServiceComponentHostResponse shr1 = new ServiceComponentHostResponse("Cluster100", "Service100", "Component100", "Host100", "STARTED", "", null, null);
+    ServiceComponentHostResponse shr2 = new ServiceComponentHostResponse("Cluster100", "Service100", "Component102", "Host100", "INSTALLED", "", null, null);
+    ServiceComponentHostResponse shr3 = new ServiceComponentHostResponse("Cluster100", "Service100", "Component103", "Host100", "STARTED", "", null, null);
 
     Set<ServiceComponentHostResponse> responses = new HashSet<ServiceComponentHostResponse>();
     responses.add(shr1);

http://git-wip-us.apache.org/repos/asf/incubator-ambari/blob/471403cd/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/JMXHostProviderTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/JMXHostProviderTest.java b/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/JMXHostProviderTest.java
index b15a203..1a1bad6 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/JMXHostProviderTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/JMXHostProviderTest.java
@@ -70,8 +70,7 @@ public class JMXHostProviderTest {
     if (desiredState != null) {
       dStateStr = desiredState.toString();
     }
-    ServiceRequest r1 = new ServiceRequest(clusterName, serviceName, null,
-      dStateStr);
+    ServiceRequest r1 = new ServiceRequest(clusterName, serviceName, dStateStr);
     Set<ServiceRequest> requests = new HashSet<ServiceRequest>();
     requests.add(r1);
     ServiceResourceProviderTest.createServices(controller, requests);
@@ -85,7 +84,7 @@ public class JMXHostProviderTest {
       dStateStr = desiredState.toString();
     }
     ServiceComponentRequest r = new ServiceComponentRequest(clusterName,
-      serviceName, componentName, null, dStateStr);
+      serviceName, componentName, dStateStr);
     Set<ServiceComponentRequest> requests =
       new HashSet<ServiceComponentRequest>();
     requests.add(r);
@@ -100,7 +99,7 @@ public class JMXHostProviderTest {
       dStateStr = desiredState.toString();
     }
     ServiceComponentHostRequest r = new ServiceComponentHostRequest(clusterName,
-      serviceName, componentName, hostname, null, dStateStr);
+      serviceName, componentName, hostname, dStateStr);
     Set<ServiceComponentHostRequest> requests =
       new HashSet<ServiceComponentHostRequest>();
     requests.add(r);
@@ -161,8 +160,7 @@ public class JMXHostProviderTest {
     Map<String, String> configVersions = new HashMap<String, String>();
     Set<ServiceRequest> sReqs = new HashSet<ServiceRequest>();
     configVersions.put("hdfs-site", "version1");
-    sReqs.add(new ServiceRequest(clusterName, serviceName, configVersions,
-      null));
+    sReqs.add(new ServiceRequest(clusterName, serviceName, null));
     ServiceResourceProviderTest.updateServices(controller, sReqs, mapRequestProps, true, false);
   }
 

http://git-wip-us.apache.org/repos/asf/incubator-ambari/blob/471403cd/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/RequestImplTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/RequestImplTest.java b/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/RequestImplTest.java
index 0ed5d31..01d76af 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/RequestImplTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/RequestImplTest.java
@@ -60,8 +60,6 @@ public class RequestImplTest {
     Assert.assertTrue(validPropertyIds.contains("HostRoles/actual_configs"));
     Assert.assertTrue(validPropertyIds.contains("HostRoles/desired_stack_id"));
     Assert.assertTrue(validPropertyIds.contains("HostRoles/stack_id"));
-    Assert.assertTrue(validPropertyIds.contains("HostRoles/desired_configs"));
-    Assert.assertTrue(validPropertyIds.contains("HostRoles/configs"));
     Assert.assertTrue(validPropertyIds.contains("HostRoles/desired_state"));
     Assert.assertTrue(validPropertyIds.contains("HostRoles/state"));
     Assert.assertTrue(validPropertyIds.contains("HostRoles/component_name"));
@@ -91,7 +89,6 @@ public class RequestImplTest {
     Assert.assertTrue(validPropertyIds.contains("Services/description"));
     Assert.assertTrue(validPropertyIds.contains("Services/display_name"));
     Assert.assertTrue(validPropertyIds.contains("Services/attributes"));
-    Assert.assertTrue(validPropertyIds.contains("ServiceInfo/desired_configs"));
     Assert.assertTrue(validPropertyIds.contains("params/run_smoke_test"));
     Assert.assertTrue(validPropertyIds.contains("params/reconfigure_client"));
 
@@ -131,7 +128,6 @@ public class RequestImplTest {
     Assert.assertTrue(validPropertyIds.contains("ServiceComponentInfo/state"));
     Assert.assertTrue(validPropertyIds.contains("ServiceComponents/display_name"));
     Assert.assertTrue(validPropertyIds.contains("ServiceComponents/description"));
-    Assert.assertTrue(validPropertyIds.contains("ServiceComponentInfo/desired_configs"));
     Assert.assertTrue(validPropertyIds.contains("params/run_smoke_test"));
 
 

http://git-wip-us.apache.org/repos/asf/incubator-ambari/blob/471403cd/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/ServiceResourceProviderTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/ServiceResourceProviderTest.java b/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/ServiceResourceProviderTest.java
index cc134ab..83f0991 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/ServiceResourceProviderTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/ServiceResourceProviderTest.java
@@ -18,6 +18,25 @@
 
 package org.apache.ambari.server.controller.internal;
 
+import static org.easymock.EasyMock.anyBoolean;
+import static org.easymock.EasyMock.anyObject;
+import static org.easymock.EasyMock.capture;
+import static org.easymock.EasyMock.createMock;
+import static org.easymock.EasyMock.createNiceMock;
+import static org.easymock.EasyMock.expect;
+import static org.easymock.EasyMock.replay;
+import static org.easymock.EasyMock.verify;
+
+import java.util.Collection;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.LinkedHashMap;
+import java.util.LinkedHashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
 import org.apache.ambari.server.AmbariException;
 import org.apache.ambari.server.api.services.AmbariMetaInfo;
 import org.apache.ambari.server.controller.AmbariManagementController;
@@ -45,25 +64,6 @@ import org.easymock.Capture;
 import org.junit.Assert;
 import org.junit.Test;
 
-import java.util.Collection;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.LinkedHashMap;
-import java.util.LinkedHashSet;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
-import static org.easymock.EasyMock.anyBoolean;
-import static org.easymock.EasyMock.anyObject;
-import static org.easymock.EasyMock.capture;
-import static org.easymock.EasyMock.createMock;
-import static org.easymock.EasyMock.createNiceMock;
-import static org.easymock.EasyMock.expect;
-import static org.easymock.EasyMock.replay;
-import static org.easymock.EasyMock.verify;
-
 /**
  * ServiceResourceProvider tests.
  */
@@ -492,9 +492,9 @@ public class ServiceResourceProviderTest {
     StackId stackId = createNiceMock(StackId.class);
     ComponentInfo componentInfo = createNiceMock(ComponentInfo.class);
 
-    ServiceComponentHostResponse shr1 = new ServiceComponentHostResponse("C1", "MAPREDUCE", "JOBTRACKER", "Host100", null, null, "STARTED", "", null, null);
-    ServiceComponentHostResponse shr2 = new ServiceComponentHostResponse("C1", "MAPREDUCE", "MAPREDUCE_CLIENT", "Host100", null, null, "STARTED", "", null, null);
-    ServiceComponentHostResponse shr3 = new ServiceComponentHostResponse("C1", "MAPREDUCE", "TASKTRACKER", "Host100", null, null, "STARTED", "", null, null);
+    ServiceComponentHostResponse shr1 = new ServiceComponentHostResponse("C1", "MAPREDUCE", "JOBTRACKER", "Host100", "STARTED", "", null, null);
+    ServiceComponentHostResponse shr2 = new ServiceComponentHostResponse("C1", "MAPREDUCE", "MAPREDUCE_CLIENT", "Host100", "STARTED", "", null, null);
+    ServiceComponentHostResponse shr3 = new ServiceComponentHostResponse("C1", "MAPREDUCE", "TASKTRACKER", "Host100", "STARTED", "", null, null);
 
     Set<ServiceComponentHostResponse> responses = new LinkedHashSet<ServiceComponentHostResponse>();
     responses.add(shr1);
@@ -540,9 +540,9 @@ public class ServiceResourceProviderTest {
     StackId stackId = createNiceMock(StackId.class);
     ComponentInfo componentInfo = createNiceMock(ComponentInfo.class);
 
-    ServiceComponentHostResponse shr1 = new ServiceComponentHostResponse("C1", "MAPREDUCE", "JOBTRACKER", "Host100", null, null, "UNKNOWN", "", null, null);
-    ServiceComponentHostResponse shr2 = new ServiceComponentHostResponse("C1", "MAPREDUCE", "MAPREDUCE_CLIENT", "Host100", null, null, "STARTED", "", null, null);
-    ServiceComponentHostResponse shr3 = new ServiceComponentHostResponse("C1", "MAPREDUCE", "TASKTRACKER", "Host100", null, null, "STARTED", "", null, null);
+    ServiceComponentHostResponse shr1 = new ServiceComponentHostResponse("C1", "MAPREDUCE", "JOBTRACKER", "Host100", "UNKNOWN", "", null, null);
+    ServiceComponentHostResponse shr2 = new ServiceComponentHostResponse("C1", "MAPREDUCE", "MAPREDUCE_CLIENT", "Host100", "STARTED", "", null, null);
+    ServiceComponentHostResponse shr3 = new ServiceComponentHostResponse("C1", "MAPREDUCE", "TASKTRACKER", "Host100", "STARTED", "", null, null);
 
     Set<ServiceComponentHostResponse> responses = new LinkedHashSet<ServiceComponentHostResponse>();
     responses.add(shr1);
@@ -586,9 +586,9 @@ public class ServiceResourceProviderTest {
     StackId stackId = createNiceMock(StackId.class);
     ComponentInfo componentInfo = createNiceMock(ComponentInfo.class);
 
-    ServiceComponentHostResponse shr1 = new ServiceComponentHostResponse("C1", "MAPREDUCE", "JOBTRACKER", "Host100", null, null, "STARTING", "", null, null);
-    ServiceComponentHostResponse shr2 = new ServiceComponentHostResponse("C1", "MAPREDUCE", "MAPREDUCE_CLIENT", "Host100", null, null, "STARTED", "", null, null);
-    ServiceComponentHostResponse shr3 = new ServiceComponentHostResponse("C1", "MAPREDUCE", "TASKTRACKER", "Host100", null, null, "STARTED", "", null, null);
+    ServiceComponentHostResponse shr1 = new ServiceComponentHostResponse("C1", "MAPREDUCE", "JOBTRACKER", "Host100", "STARTING", "", null, null);
+    ServiceComponentHostResponse shr2 = new ServiceComponentHostResponse("C1", "MAPREDUCE", "MAPREDUCE_CLIENT", "Host100", "STARTED", "", null, null);
+    ServiceComponentHostResponse shr3 = new ServiceComponentHostResponse("C1", "MAPREDUCE", "TASKTRACKER", "Host100", "STARTED", "", null, null);
 
     Set<ServiceComponentHostResponse> responses = new LinkedHashSet<ServiceComponentHostResponse>();
     responses.add(shr1);
@@ -632,9 +632,9 @@ public class ServiceResourceProviderTest {
     StackId stackId = createNiceMock(StackId.class);
     ComponentInfo componentInfo = createNiceMock(ComponentInfo.class);
 
-    ServiceComponentHostResponse shr1 = new ServiceComponentHostResponse("C1", "MAPREDUCE", "JOBTRACKER", "Host100", null, null, "INSTALLED", "", null, null);
-    ServiceComponentHostResponse shr2 = new ServiceComponentHostResponse("C1", "MAPREDUCE", "MAPREDUCE_CLIENT", "Host100", null, null, "STARTED", "", null, null);
-    ServiceComponentHostResponse shr3 = new ServiceComponentHostResponse("C1", "MAPREDUCE", "TASKTRACKER", "Host100", null, null, "STARTED", "", null, null);
+    ServiceComponentHostResponse shr1 = new ServiceComponentHostResponse("C1", "MAPREDUCE", "JOBTRACKER", "Host100", "INSTALLED", "", null, null);
+    ServiceComponentHostResponse shr2 = new ServiceComponentHostResponse("C1", "MAPREDUCE", "MAPREDUCE_CLIENT", "Host100", "STARTED", "", null, null);
+    ServiceComponentHostResponse shr3 = new ServiceComponentHostResponse("C1", "MAPREDUCE", "TASKTRACKER", "Host100", "STARTED", "", null, null);
 
     Set<ServiceComponentHostResponse> responses = new LinkedHashSet<ServiceComponentHostResponse>();
     responses.add(shr1);
@@ -678,9 +678,9 @@ public class ServiceResourceProviderTest {
     StackId stackId = createNiceMock(StackId.class);
     ComponentInfo componentInfo = createNiceMock(ComponentInfo.class);
 
-    ServiceComponentHostResponse shr1 = new ServiceComponentHostResponse("C1", "MAPREDUCE", "JOBTRACKER", "Host100", null, null, "MAINTENANCE", "", null, null);
-    ServiceComponentHostResponse shr2 = new ServiceComponentHostResponse("C1", "MAPREDUCE", "MAPREDUCE_CLIENT", "Host100", null, null, "STARTED", "", null, null);
-    ServiceComponentHostResponse shr3 = new ServiceComponentHostResponse("C1", "MAPREDUCE", "TASKTRACKER", "Host100", null, null, "STARTED", "", null, null);
+    ServiceComponentHostResponse shr1 = new ServiceComponentHostResponse("C1", "MAPREDUCE", "JOBTRACKER", "Host100", "MAINTENANCE", "", null, null);
+    ServiceComponentHostResponse shr2 = new ServiceComponentHostResponse("C1", "MAPREDUCE", "MAPREDUCE_CLIENT", "Host100", "STARTED", "", null, null);
+    ServiceComponentHostResponse shr3 = new ServiceComponentHostResponse("C1", "MAPREDUCE", "TASKTRACKER", "Host100", "STARTED", "", null, null);
 
     Set<ServiceComponentHostResponse> responses = new LinkedHashSet<ServiceComponentHostResponse>();
     responses.add(shr1);
@@ -726,9 +726,9 @@ public class ServiceResourceProviderTest {
     StackId stackId = createNiceMock(StackId.class);
     ComponentInfo componentInfo = createNiceMock(ComponentInfo.class);
 
-    ServiceComponentHostResponse shr1 = new ServiceComponentHostResponse("C1", "HDFS", "NAMENODE", "Host100", null, null, "STARTED", "", null, null);
-    ServiceComponentHostResponse shr2 = new ServiceComponentHostResponse("C1", "HDFS", "SECONDARY_NAMENODE", "Host100", null, null, "STARTED", "", null, null);
-    ServiceComponentHostResponse shr3 = new ServiceComponentHostResponse("C1", "HDFS", "JOURNALNODE", "Host100", null, null, "STARTED", "", null, null);
+    ServiceComponentHostResponse shr1 = new ServiceComponentHostResponse("C1", "HDFS", "NAMENODE", "Host100",  "STARTED", "", null, null);
+    ServiceComponentHostResponse shr2 = new ServiceComponentHostResponse("C1", "HDFS", "SECONDARY_NAMENODE", "Host100", "STARTED", "", null, null);
+    ServiceComponentHostResponse shr3 = new ServiceComponentHostResponse("C1", "HDFS", "JOURNALNODE", "Host100", "STARTED", "", null, null);
 
     Set<ServiceComponentHostResponse> responses = new LinkedHashSet<ServiceComponentHostResponse>();
     responses.add(shr1);
@@ -774,9 +774,9 @@ public class ServiceResourceProviderTest {
     StackId stackId = createNiceMock(StackId.class);
     ComponentInfo componentInfo = createNiceMock(ComponentInfo.class);
 
-    ServiceComponentHostResponse shr1 = new ServiceComponentHostResponse("C1", "HDFS", "NAMENODE", "Host100", null, null, "INSTALLED", "", null, null);
-    ServiceComponentHostResponse shr2 = new ServiceComponentHostResponse("C1", "HDFS", "NAMENODE", "Host101", null, null, "STARTED", "", null, null);
-    ServiceComponentHostResponse shr3 = new ServiceComponentHostResponse("C1", "HDFS", "JOURNALNODE", "Host100", null, null, "STARTED", "", null, null);
+    ServiceComponentHostResponse shr1 = new ServiceComponentHostResponse("C1", "HDFS", "NAMENODE", "Host100", "INSTALLED", "", null, null);
+    ServiceComponentHostResponse shr2 = new ServiceComponentHostResponse("C1", "HDFS", "NAMENODE", "Host101", "STARTED", "", null, null);
+    ServiceComponentHostResponse shr3 = new ServiceComponentHostResponse("C1", "HDFS", "JOURNALNODE", "Host100", "STARTED", "", null, null);
 
     Set<ServiceComponentHostResponse> responses = new LinkedHashSet<ServiceComponentHostResponse>();
     responses.add(shr1);
@@ -822,9 +822,9 @@ public class ServiceResourceProviderTest {
     StackId stackId = createNiceMock(StackId.class);
     ComponentInfo componentInfo = createNiceMock(ComponentInfo.class);
 
-    ServiceComponentHostResponse shr1 = new ServiceComponentHostResponse("C1", "HDFS", "HBASE_MASTER", "Host100", null, null, "STARTED", "", null, null);
-    ServiceComponentHostResponse shr2 = new ServiceComponentHostResponse("C1", "HDFS", "HBASE_MASTER", "Host101", null, null, "INSTALLED", "", null, null);
-    ServiceComponentHostResponse shr3 = new ServiceComponentHostResponse("C1", "HDFS", "HBASE_REGIONSERVER", "Host100", null, null, "STARTED", "", null, null);
+    ServiceComponentHostResponse shr1 = new ServiceComponentHostResponse("C1", "HDFS", "HBASE_MASTER", "Host100",  "STARTED", "", null, null);
+    ServiceComponentHostResponse shr2 = new ServiceComponentHostResponse("C1", "HDFS", "HBASE_MASTER", "Host101", "INSTALLED", "", null, null);
+    ServiceComponentHostResponse shr3 = new ServiceComponentHostResponse("C1", "HDFS", "HBASE_REGIONSERVER", "Host100", "STARTED", "", null, null);
 
     Set<ServiceComponentHostResponse> responses = new LinkedHashSet<ServiceComponentHostResponse>();
     responses.add(shr1);

http://git-wip-us.apache.org/repos/asf/incubator-ambari/blob/471403cd/ambari-server/src/test/java/org/apache/ambari/server/stageplanner/TestStagePlanner.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/stageplanner/TestStagePlanner.java b/ambari-server/src/test/java/org/apache/ambari/server/stageplanner/TestStagePlanner.java
index 8206fff..cf1e412 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/stageplanner/TestStagePlanner.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/stageplanner/TestStagePlanner.java
@@ -17,9 +17,10 @@
  */
 package org.apache.ambari.server.stageplanner;
 
-import static org.junit.Assert.*;
+import static org.junit.Assert.assertEquals;
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.when;
 
-import java.util.HashMap;
 import java.util.List;
 
 import org.apache.ambari.server.AmbariException;
@@ -27,22 +28,19 @@ import org.apache.ambari.server.Role;
 import org.apache.ambari.server.RoleCommand;
 import org.apache.ambari.server.actionmanager.Stage;
 import org.apache.ambari.server.metadata.RoleCommandOrder;
+import org.apache.ambari.server.orm.GuiceJpaInitializer;
+import org.apache.ambari.server.orm.InMemoryDefaultTestModule;
+import org.apache.ambari.server.state.StackId;
+import org.apache.ambari.server.state.cluster.ClusterImpl;
 import org.apache.ambari.server.state.svccomphost.ServiceComponentHostStartEvent;
 import org.apache.ambari.server.utils.StageUtils;
+import org.junit.After;
+import org.junit.Before;
 import org.junit.Test;
 
-import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.when;
-
-import org.apache.ambari.server.state.StackId;
 import com.google.inject.Guice;
 import com.google.inject.Injector;
-import org.apache.ambari.server.orm.GuiceJpaInitializer;
-import org.apache.ambari.server.state.cluster.ClusterImpl;
 import com.google.inject.persist.PersistService;
-import org.apache.ambari.server.orm.InMemoryDefaultTestModule;
-import org.junit.After;
-import org.junit.Before;
 
 public class TestStagePlanner {
 
@@ -91,10 +89,10 @@ public class TestStagePlanner {
     Stage stage = StageUtils.getATestStage(1, 1, "host1");
     stage.addHostRoleExecutionCommand("host2", Role.HBASE_MASTER,
         RoleCommand.START, new ServiceComponentHostStartEvent("HBASE_MASTER",
-            "host2", now, new HashMap<String, String>()), "cluster1", "HBASE");
+            "host2", now), "cluster1", "HBASE");
     stage.addHostRoleExecutionCommand("host3", Role.ZOOKEEPER_SERVER,
         RoleCommand.START, new ServiceComponentHostStartEvent("ZOOKEEPER_SERVER",
-            "host3", now, new HashMap<String, String>()), "cluster1", "ZOOKEEPER");
+            "host3", now), "cluster1", "ZOOKEEPER");
     System.out.println(stage.toString());
 
     rg.build(stage);
@@ -117,40 +115,40 @@ public class TestStagePlanner {
     Stage stage = StageUtils.getATestStage(1, 1, "host1");
     stage.addHostRoleExecutionCommand("host11", Role.SECONDARY_NAMENODE,
         RoleCommand.START, new ServiceComponentHostStartEvent("SECONDARY_NAMENODE",
-            "host11", now, new HashMap<String, String>()), "cluster1", "HDFS");
+            "host11", now), "cluster1", "HDFS");
     stage.addHostRoleExecutionCommand("host2", Role.HBASE_MASTER,
         RoleCommand.START, new ServiceComponentHostStartEvent("HBASE_MASTER",
-            "host2", now, new HashMap<String, String>()), "cluster1", "HBASE");
+            "host2", now), "cluster1", "HBASE");
     stage.addHostRoleExecutionCommand("host3", Role.ZOOKEEPER_SERVER,
         RoleCommand.START, new ServiceComponentHostStartEvent("ZOOKEEPER_SERVER",
-            "host3", now, new HashMap<String, String>()), "cluster1", "ZOOKEEPER");
+            "host3", now), "cluster1", "ZOOKEEPER");
     stage.addHostRoleExecutionCommand("host4", Role.DATANODE,
         RoleCommand.START, new ServiceComponentHostStartEvent("DATANODE",
-            "host4", now, new HashMap<String, String>()), "cluster1", "HDFS");
+            "host4", now), "cluster1", "HDFS");
     stage.addHostRoleExecutionCommand("host4", Role.HBASE_REGIONSERVER,
         RoleCommand.START, new ServiceComponentHostStartEvent("HBASE_REGIONSERVER",
-            "host4", now, new HashMap<String, String>()), "cluster1", "HBASE");
+            "host4", now), "cluster1", "HBASE");
     stage.addHostRoleExecutionCommand("host4", Role.TASKTRACKER,
         RoleCommand.START, new ServiceComponentHostStartEvent("TASKTRACKER",
-            "host4", now, new HashMap<String, String>()), "cluster1", "MAPREDUCE");
+            "host4", now), "cluster1", "MAPREDUCE");
     stage.addHostRoleExecutionCommand("host5", Role.JOBTRACKER,
         RoleCommand.START, new ServiceComponentHostStartEvent("JOBTRACKER",
-            "host5", now, new HashMap<String, String>()), "cluster1", "MAPREDUCE");
+            "host5", now), "cluster1", "MAPREDUCE");
     stage.addHostRoleExecutionCommand("host6", Role.OOZIE_SERVER,
         RoleCommand.START, new ServiceComponentHostStartEvent("OOZIE_SERVER",
-            "host6", now, new HashMap<String, String>()), "cluster1", "OOZIE");
+            "host6", now), "cluster1", "OOZIE");
     stage.addHostRoleExecutionCommand("host7", Role.WEBHCAT_SERVER,
         RoleCommand.START, new ServiceComponentHostStartEvent("WEBHCAT_SERVER",
-            "host7", now, new HashMap<String, String>()), "cluster1", "WEBHCAT");
+            "host7", now), "cluster1", "WEBHCAT");
     stage.addHostRoleExecutionCommand("host8", Role.NAGIOS_SERVER,
         RoleCommand.START, new ServiceComponentHostStartEvent("NAGIOS_SERVER",
-            "host8", now, new HashMap<String, String>()), "cluster1", "NAGIOS");
+            "host8", now), "cluster1", "NAGIOS");
     stage.addHostRoleExecutionCommand("host4", Role.GANGLIA_MONITOR,
         RoleCommand.START, new ServiceComponentHostStartEvent("GANGLIA_MONITOR",
-            "host4", now, new HashMap<String, String>()), "cluster1", "GANGLIA");
+            "host4", now), "cluster1", "GANGLIA");
     stage.addHostRoleExecutionCommand("host9", Role.GANGLIA_SERVER,
         RoleCommand.START, new ServiceComponentHostStartEvent("GANGLIA_SERVER",
-            "host9", now, new HashMap<String, String>()), "cluster1", "GANGLIA");
+            "host9", now), "cluster1", "GANGLIA");
     System.out.println(stage.toString());
     rg.build(stage);
     System.out.println(rg.stringifyGraph());

http://git-wip-us.apache.org/repos/asf/incubator-ambari/blob/471403cd/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 e55b280..d083592 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
@@ -426,7 +426,6 @@ public class ClusterTest {
     clusterServiceEntity.setClusterEntity(clusterEntity);
     clusterServiceEntity.setServiceComponentDesiredStateEntities(
         Collections.EMPTY_LIST);
-    clusterServiceEntity.setServiceConfigMappings(Collections.EMPTY_LIST);
     ServiceDesiredStateEntity stateEntity = mock(ServiceDesiredStateEntity.class);
     Gson gson = new Gson();
     when(stateEntity.getDesiredStackVersion()).thenReturn(gson.toJson(new StackId("HDP-0.1"),

http://git-wip-us.apache.org/repos/asf/incubator-ambari/blob/471403cd/ambari-server/src/test/java/org/apache/ambari/server/state/cluster/ClustersTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/state/cluster/ClustersTest.java b/ambari-server/src/test/java/org/apache/ambari/server/state/cluster/ClustersTest.java
index a10523b..3bc4e56 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/state/cluster/ClustersTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/state/cluster/ClustersTest.java
@@ -347,10 +347,6 @@ public class ClustersTest {
     Service hdfs = cluster.addService("HDFS");
     hdfs.persist();
     
-    // service config
-    hdfs.updateDesiredConfigs(new HashMap<String,Config>() {{ put("t1", config1); }});
-    hdfs.persist();
-
     Assert.assertNotNull(injector.getInstance(ClusterServiceDAO.class).findByClusterAndServiceNames(c1, "HDFS"));
 
     ServiceComponent nameNode = hdfs.addServiceComponent("NAMENODE");
@@ -389,7 +385,6 @@ public class ClustersTest {
     Assert.assertEquals(2, injector.getProvider(EntityManager.class).get().createQuery("SELECT config FROM ClusterConfigEntity config").getResultList().size());
     Assert.assertEquals(1, injector.getProvider(EntityManager.class).get().createQuery("SELECT state FROM ClusterStateEntity state").getResultList().size());
     Assert.assertEquals(1, injector.getProvider(EntityManager.class).get().createQuery("SELECT config FROM ClusterConfigMappingEntity config").getResultList().size());
-    Assert.assertEquals(1, injector.getProvider(EntityManager.class).get().createQuery("SELECT config FROM ServiceConfigMappingEntity config").getResultList().size());
     
     clusters.deleteCluster(c1);
 
@@ -399,7 +394,6 @@ public class ClustersTest {
     Assert.assertEquals(0, injector.getProvider(EntityManager.class).get().createQuery("SELECT config FROM ClusterConfigEntity config").getResultList().size());
     Assert.assertEquals(0, injector.getProvider(EntityManager.class).get().createQuery("SELECT state FROM ClusterStateEntity state").getResultList().size());
     Assert.assertEquals(0, injector.getProvider(EntityManager.class).get().createQuery("SELECT config FROM ClusterConfigMappingEntity config").getResultList().size());
-    Assert.assertEquals(0, injector.getProvider(EntityManager.class).get().createQuery("SELECT config FROM ServiceConfigMappingEntity config").getResultList().size());
     
   }
   @Test

http://git-wip-us.apache.org/repos/asf/incubator-ambari/blob/471403cd/ambari-server/src/test/java/org/apache/ambari/server/state/svccomphost/ServiceComponentHostTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/state/svccomphost/ServiceComponentHostTest.java b/ambari-server/src/test/java/org/apache/ambari/server/state/svccomphost/ServiceComponentHostTest.java
index 353d270..8be68f8 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/state/svccomphost/ServiceComponentHostTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/state/svccomphost/ServiceComponentHostTest.java
@@ -18,15 +18,11 @@
 
 package org.apache.ambari.server.state.svccomphost;
 
-import static org.junit.Assert.fail;
-
-import java.util.Collection;
 import java.util.HashMap;
-import java.util.HashSet;
 import java.util.Map;
-import java.util.Set;
 
-import com.google.inject.Provider;
+import javax.persistence.EntityManager;
+
 import org.apache.ambari.server.AmbariException;
 import org.apache.ambari.server.ServiceComponentNotFoundException;
 import org.apache.ambari.server.ServiceNotFoundException;
@@ -34,14 +30,22 @@ import org.apache.ambari.server.api.services.AmbariMetaInfo;
 import org.apache.ambari.server.controller.ServiceComponentHostResponse;
 import org.apache.ambari.server.orm.GuiceJpaInitializer;
 import org.apache.ambari.server.orm.InMemoryDefaultTestModule;
-import org.apache.ambari.server.orm.dao.HostComponentDesiredStateDAO;
-import org.apache.ambari.server.orm.dao.HostComponentStateDAO;
-import org.apache.ambari.server.orm.entities.HostComponentConfigMappingEntity;
-import org.apache.ambari.server.orm.entities.HostComponentDesiredStateEntity;
-import org.apache.ambari.server.orm.entities.HostComponentDesiredStateEntityPK;
-import org.apache.ambari.server.orm.entities.HostComponentStateEntity;
-import org.apache.ambari.server.orm.entities.HostComponentStateEntityPK;
-import org.apache.ambari.server.state.*;
+import org.apache.ambari.server.state.Cluster;
+import org.apache.ambari.server.state.Clusters;
+import org.apache.ambari.server.state.Config;
+import org.apache.ambari.server.state.ConfigFactory;
+import org.apache.ambari.server.state.Host;
+import org.apache.ambari.server.state.HostConfig;
+import org.apache.ambari.server.state.Service;
+import org.apache.ambari.server.state.ServiceComponent;
+import org.apache.ambari.server.state.ServiceComponentFactory;
+import org.apache.ambari.server.state.ServiceComponentHost;
+import org.apache.ambari.server.state.ServiceComponentHostEvent;
+import org.apache.ambari.server.state.ServiceComponentHostEventType;
+import org.apache.ambari.server.state.ServiceComponentHostFactory;
+import org.apache.ambari.server.state.ServiceFactory;
+import org.apache.ambari.server.state.StackId;
+import org.apache.ambari.server.state.State;
 import org.apache.ambari.server.state.configgroup.ConfigGroup;
 import org.apache.ambari.server.state.configgroup.ConfigGroupFactory;
 import org.apache.ambari.server.state.fsm.InvalidStateTransitionException;
@@ -55,10 +59,9 @@ import org.slf4j.LoggerFactory;
 import com.google.inject.Guice;
 import com.google.inject.Inject;
 import com.google.inject.Injector;
+import com.google.inject.Provider;
 import com.google.inject.persist.PersistService;
 
-import javax.persistence.EntityManager;
-
 public class ServiceComponentHostTest {
   private static Logger LOG = LoggerFactory.getLogger(ServiceComponentHostTest.class);
   @Inject
@@ -74,10 +77,6 @@ public class ServiceComponentHostTest {
   @Inject
   private AmbariMetaInfo metaInfo;
   @Inject
-  private HostComponentStateDAO hostComponentStateDAO;
-  @Inject
-  private HostComponentDesiredStateDAO hostComponentDesiredStateDAO;
-  @Inject
   Provider<EntityManager> entityManagerProvider;
   @Inject
   private ConfigFactory configFactory;
@@ -186,8 +185,7 @@ public class ServiceComponentHostTest {
             impl.getDesiredStackVersion().getStackId());
       case HOST_SVCCOMP_START:
         return new ServiceComponentHostStartEvent(
-            impl.getServiceComponentName(), impl.getHostName(), timestamp,
-            configs);
+            impl.getServiceComponentName(), impl.getHostName(), timestamp);
       case HOST_SVCCOMP_STOP:
         return new ServiceComponentHostStopEvent(
             impl.getServiceComponentName(), impl.getHostName(), timestamp);
@@ -209,8 +207,9 @@ public class ServiceComponentHostTest {
       case HOST_SVCCOMP_WIPEOUT:
         return new ServiceComponentHostWipeoutEvent(
             impl.getServiceComponentName(), impl.getHostName(), timestamp);
+      default:
+        return null;
     }
-    return null;
   }
 
   private void runStateChanges(ServiceComponentHostImpl impl,
@@ -222,10 +221,6 @@ public class ServiceComponentHostTest {
     throws Exception {
     long timestamp = 0;
 
-    boolean checkConfigs = false;
-    if (startEventType == ServiceComponentHostEventType.HOST_SVCCOMP_START) {
-      checkConfigs = true;
-    }
     boolean checkStack = false;
     if (startEventType == ServiceComponentHostEventType.HOST_SVCCOMP_INSTALL) {
       checkStack = true;
@@ -244,10 +239,6 @@ public class ServiceComponentHostTest {
     Assert.assertEquals(-1, impl.getLastOpEndTime());
     Assert.assertEquals(inProgressState,
         impl.getState());
-    if (checkConfigs) {
-      Assert.assertTrue(impl.getConfigVersions().size() > 0);
-      Assert.assertEquals("" + startTime, impl.getConfigVersions().get("time"));
-    }
     if (checkStack) {
       Assert.assertNotNull(impl.getStackVersion());
       Assert.assertEquals(impl.getDesiredStackVersion().getStackId(),
@@ -608,120 +599,6 @@ public class ServiceComponentHostTest {
   }
 
   @Test
-  public void testLiveStateUpdatesForReconfigure() throws Exception {
-    ServiceComponentHost sch =
-        createNewServiceComponentHost("HDFS", "DATANODE", "h1", false);
-    ServiceComponentHostImpl impl =  (ServiceComponentHostImpl) sch;
-
-    sch.setDesiredState(State.INSTALLED);
-    sch.setState(State.INSTALLED);
-
-    Map<String, Config> desired = new HashMap<String, Config>();
-    ConfigFactory configFactory = injector.getInstance(ConfigFactory.class);
-
-    Cluster cluster = clusters.getCluster("C1");
-    Config c1 = configFactory.createNew(cluster, "type1", new HashMap<String, String>());
-//        new ConfigImpl(cluster, "type1", new HashMap<String, String>(), injector);
-    Config c2 = configFactory.createNew(cluster, "type2", new HashMap<String, String>());
-//        new ConfigImpl(cluster, "type2", new HashMap<String, String>(),        injector);
-    Config c3 = configFactory.createNew(cluster, "type3", new HashMap<String, String>());
-//        new ConfigImpl(cluster, "type3", new HashMap<String, String>(),   injector);
-    Config c4v5 = configFactory.createNew(cluster, "type4", new HashMap<String, String>());
-    Config c2v3 = configFactory.createNew(cluster, "type2", new HashMap<String, String>());
-
-
-    c1.setVersionTag("v1");
-    c2.setVersionTag("v1");
-    c3.setVersionTag("v1");
-    c4v5.setVersionTag("v5");
-    c2v3.setVersionTag("v3");
-
-    c1.persist();
-    c2.persist();
-    c3.persist();
-    c4v5.persist();
-    c2v3.persist();
-
-    desired.put("type1", c1);
-    desired.put("type2", c2);
-    desired.put("type3", c3);
-    impl.updateDesiredConfigs(desired);
-    impl.persist();
-
-    HostComponentDesiredStateEntityPK desiredPK =
-        new HostComponentDesiredStateEntityPK();
-    desiredPK.setClusterId(clusters.getCluster("C1").getClusterId());
-    desiredPK.setServiceName("HDFS");
-    desiredPK.setComponentName("DATANODE");
-    desiredPK.setHostName("h1");
-
-    HostComponentDesiredStateEntity desiredEntity =
-        hostComponentDesiredStateDAO.findByPK(desiredPK);
-    Assert.assertEquals(3,
-        desiredEntity.getHostComponentDesiredConfigMappingEntities().size());
-
-    Map<String, String> oldConfigs = new HashMap<String, String>();
-    oldConfigs.put("type1", "v1");
-    oldConfigs.put("type2", "v1");
-    oldConfigs.put("type3", "v1");
-
-    HostComponentStateEntityPK primaryKey =
-        new HostComponentStateEntityPK();
-    primaryKey.setClusterId(clusters.getCluster("C1").getClusterId());
-    primaryKey.setServiceName("HDFS");
-    primaryKey.setComponentName("DATANODE");
-    primaryKey.setHostName("h1");
-    HostComponentStateEntity entity =
-        hostComponentStateDAO.findByPK(primaryKey);
-    Collection<HostComponentConfigMappingEntity> entities =
-        entity.getHostComponentConfigMappingEntities();
-    Assert.assertEquals(0, entities.size());
-
-    impl.setConfigs(oldConfigs);
-    impl.persist();
-
-    Assert.assertEquals(3, impl.getConfigVersions().size());
-    entity = hostComponentStateDAO.findByPK(primaryKey);
-    entities = entity.getHostComponentConfigMappingEntities();
-    Assert.assertEquals(3, entities.size());
-
-    Map<String, String> newConfigs = new HashMap<String, String>();
-    newConfigs.put("type1", "v1");
-    newConfigs.put("type2", "v3");
-    newConfigs.put("type4", "v5");
-
-    ServiceComponentHostStartEvent startEvent =
-        new ServiceComponentHostStartEvent("DATANODE", "h1", 1, newConfigs);
-
-    impl.handleEvent(startEvent);
-
-    Assert.assertEquals(newConfigs.size(),
-        impl.getConfigVersions().size());
-
-    entity = hostComponentStateDAO.findByPK(primaryKey);
-    entities = entity.getHostComponentConfigMappingEntities();
-    Assert.assertEquals(3, entities.size());
-
-    for (HostComponentConfigMappingEntity e : entities) {
-      LOG.debug("Found live config "
-          + e.getConfigType() + ":" + e.getVersionTag());
-      Assert.assertTrue(e.getComponentName().equals("DATANODE")
-          && e.getClusterId() == primaryKey.getClusterId()
-          && e.getHostName().equals("h1")
-          && e.getServiceName().equals("HDFS"));
-      if (e.getConfigType().equals("type1")) {
-        Assert.assertEquals("v1", e.getVersionTag());
-      } else if (e.getConfigType().equals("type2")) {
-        Assert.assertEquals("v3", e.getVersionTag());
-      } else if (e.getConfigType().equals("type4")) {
-        Assert.assertEquals("v5", e.getVersionTag());
-      } else {
-        fail("Found invalid type");
-      }
-    }
-  }
-
-  @Test
   public void testCanBeRemoved() throws Exception{
     ServiceComponentHostImpl impl = (ServiceComponentHostImpl)
         createNewServiceComponentHost("HDFS", "HDFS_CLIENT", "h1", true);


Mime
View raw message