You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by ma...@apache.org on 2012/10/24 08:37:25 UTC

svn commit: r1401567 [2/2] - in /incubator/ambari/branches/AMBARI-666: ./ ambari-server/src/main/java/org/apache/ambari/server/actionmanager/ ambari-server/src/main/java/org/apache/ambari/server/agent/ ambari-server/src/main/java/org/apache/ambari/serv...

Modified: incubator/ambari/branches/AMBARI-666/ambari-server/src/test/java/org/apache/ambari/server/controller/AmbariManagementControllerTest.java
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/AMBARI-666/ambari-server/src/test/java/org/apache/ambari/server/controller/AmbariManagementControllerTest.java?rev=1401567&r1=1401566&r2=1401567&view=diff
==============================================================================
--- incubator/ambari/branches/AMBARI-666/ambari-server/src/test/java/org/apache/ambari/server/controller/AmbariManagementControllerTest.java (original)
+++ incubator/ambari/branches/AMBARI-666/ambari-server/src/test/java/org/apache/ambari/server/controller/AmbariManagementControllerTest.java Wed Oct 24 06:37:23 2012
@@ -36,6 +36,8 @@ import org.apache.ambari.server.orm.Guic
 import org.apache.ambari.server.orm.InMemoryDefaultTestModule;
 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.ConfigImpl;
 import org.apache.ambari.server.state.Host;
 import org.apache.ambari.server.state.Service;
 import org.apache.ambari.server.state.ServiceComponent;
@@ -1165,6 +1167,32 @@ public class AmbariManagementControllerT
     String clusterName = "foo1";
     String serviceName = "HDFS";
 
+    Cluster cluster = clusters.getCluster(clusterName);
+    Service s1 = cluster.getService(serviceName);
+
+    Map<String, Config> configs = new HashMap<String, Config>();
+    Map<String, String> properties = new HashMap<String, String>();
+    properties.put("a", "a1");
+    properties.put("b", "b1");
+
+    Config c1 = new ConfigImpl(cluster, "hdfs-site", properties, injector);
+    properties.put("c", "c1");
+    properties.put("d", "d1");
+    Config c2 = new ConfigImpl(cluster, "core-site", properties, injector);
+    Config c3 = new ConfigImpl(cluster, "foo-site", properties, injector);
+
+    c1.setVersionTag("v1");
+    c2.setVersionTag("v1");
+    c3.setVersionTag("v1");
+
+    cluster.addDesiredConfig(c1);
+    cluster.addDesiredConfig(c2);
+    cluster.addDesiredConfig(c3);
+
+    configs.put(c1.getType(), c1);
+    configs.put(c2.getType(), c2);
+    s1.updateDesiredConfigs(configs);
+
     ServiceRequest r1 = new ServiceRequest(clusterName, serviceName, null,
         State.INSTALLED.toString());
     Set<ServiceRequest> requests1 = new HashSet<ServiceRequest>();
@@ -1845,7 +1873,6 @@ public class AmbariManagementControllerT
 
   @Test
   public void testServiceUpdateInvalidRequest() throws AmbariException {
-    // TODO
     // multiple clusters
     // dup services
     // multiple diff end states
@@ -2070,7 +2097,7 @@ public class AmbariManagementControllerT
     // sch3 to start
     // sch5 to start
     Stage stage1, stage2;
-    if (stages.get(0).getStageId() == 0) {
+    if (stages.get(0).getStageId() == 1) {
       stage1 = stages.get(0);
       stage2 = stages.get(1);
     } else {

Modified: incubator/ambari/branches/AMBARI-666/ambari-server/src/test/java/org/apache/ambari/server/controller/jmx/JMXPropertyProviderTest.java
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/AMBARI-666/ambari-server/src/test/java/org/apache/ambari/server/controller/jmx/JMXPropertyProviderTest.java?rev=1401567&r1=1401566&r2=1401567&view=diff
==============================================================================
--- incubator/ambari/branches/AMBARI-666/ambari-server/src/test/java/org/apache/ambari/server/controller/jmx/JMXPropertyProviderTest.java (original)
+++ incubator/ambari/branches/AMBARI-666/ambari-server/src/test/java/org/apache/ambari/server/controller/jmx/JMXPropertyProviderTest.java Wed Oct 24 06:37:23 2012
@@ -28,7 +28,6 @@ import org.junit.Test;
 
 import java.util.Collections;
 import java.util.Map;
-import java.util.Set;
 
 /**
  * JMX property provider tests.

Modified: incubator/ambari/branches/AMBARI-666/ambari-server/src/test/java/org/apache/ambari/server/controller/jmx/TestHostMappingProvider.java
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/AMBARI-666/ambari-server/src/test/java/org/apache/ambari/server/controller/jmx/TestHostMappingProvider.java?rev=1401567&r1=1401566&r2=1401567&view=diff
==============================================================================
--- incubator/ambari/branches/AMBARI-666/ambari-server/src/test/java/org/apache/ambari/server/controller/jmx/TestHostMappingProvider.java (original)
+++ incubator/ambari/branches/AMBARI-666/ambari-server/src/test/java/org/apache/ambari/server/controller/jmx/TestHostMappingProvider.java Wed Oct 24 06:37:23 2012
@@ -18,8 +18,6 @@
 
 package org.apache.ambari.server.controller.jmx;
 
-import org.apache.ambari.server.AmbariException;
-
 import java.util.HashMap;
 import java.util.Map;
 
@@ -40,4 +38,4 @@ public class TestHostMappingProvider {
   public static Map<String, String> getHostMap() {
     return HOST_MAPPING;
   }
-}
\ No newline at end of file
+}

Modified: incubator/ambari/branches/AMBARI-666/ambari-server/src/test/java/org/apache/ambari/server/security/authorization/LdapServerPropertiesTest.java
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/AMBARI-666/ambari-server/src/test/java/org/apache/ambari/server/security/authorization/LdapServerPropertiesTest.java?rev=1401567&r1=1401566&r2=1401567&view=diff
==============================================================================
--- incubator/ambari/branches/AMBARI-666/ambari-server/src/test/java/org/apache/ambari/server/security/authorization/LdapServerPropertiesTest.java (original)
+++ incubator/ambari/branches/AMBARI-666/ambari-server/src/test/java/org/apache/ambari/server/security/authorization/LdapServerPropertiesTest.java Wed Oct 24 06:37:23 2012
@@ -22,7 +22,6 @@ import com.google.inject.Inject;
 import com.google.inject.Injector;
 import org.apache.ambari.server.configuration.Configuration;
 import org.junit.Before;
-import org.junit.BeforeClass;
 import org.junit.Test;
 
 import java.util.List;

Modified: incubator/ambari/branches/AMBARI-666/ambari-server/src/test/java/org/apache/ambari/server/stageplanner/TestStagePlanner.java
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/AMBARI-666/ambari-server/src/test/java/org/apache/ambari/server/stageplanner/TestStagePlanner.java?rev=1401567&r1=1401566&r2=1401567&view=diff
==============================================================================
--- incubator/ambari/branches/AMBARI-666/ambari-server/src/test/java/org/apache/ambari/server/stageplanner/TestStagePlanner.java (original)
+++ incubator/ambari/branches/AMBARI-666/ambari-server/src/test/java/org/apache/ambari/server/stageplanner/TestStagePlanner.java Wed Oct 24 06:37:23 2012
@@ -25,13 +25,12 @@ 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.state.svccomphost.ServiceComponentHostInstallEvent;
 import org.apache.ambari.server.state.svccomphost.ServiceComponentHostStartEvent;
 import org.apache.ambari.server.utils.StageUtils;
 import org.junit.Test;
 
 public class TestStagePlanner {
-  
+
   @Test
   public void testSingleStagePlan() {
     RoleCommandOrder.initialize();
@@ -48,7 +47,7 @@ public class TestStagePlanner {
     assertEquals(stage.getExecutionCommands(hostname), outStages.get(0)
         .getExecutionCommands(hostname));
   }
-  
+
   @Test
   public void testMultiStagePlan() {
     RoleCommandOrder.initialize();
@@ -63,7 +62,7 @@ public class TestStagePlanner {
         RoleCommand.START, new ServiceComponentHostStartEvent("ZOOKEEPER_SERVER",
             "host3", now), "cluster1", "ZOOKEEPER");
     System.out.println(stage.toString());
-    
+
     rg.build(stage);
     System.out.println(rg.stringifyGraph());
     List<Stage> outStages = rg.getStages();
@@ -72,7 +71,7 @@ public class TestStagePlanner {
     }
     assertEquals(3, outStages.size());
   }
-  
+
   @Test
   public void testManyStages() {
     RoleCommandOrder.initialize();

Modified: incubator/ambari/branches/AMBARI-666/ambari-server/src/test/java/org/apache/ambari/server/state/ServiceComponentTest.java
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/AMBARI-666/ambari-server/src/test/java/org/apache/ambari/server/state/ServiceComponentTest.java?rev=1401567&r1=1401566&r2=1401567&view=diff
==============================================================================
--- incubator/ambari/branches/AMBARI-666/ambari-server/src/test/java/org/apache/ambari/server/state/ServiceComponentTest.java (original)
+++ incubator/ambari/branches/AMBARI-666/ambari-server/src/test/java/org/apache/ambari/server/state/ServiceComponentTest.java Wed Oct 24 06:37:23 2012
@@ -271,7 +271,6 @@ public class ServiceComponentTest {
 
   @Test
   public void testConvertToResponse() throws AmbariException {
-    // TODO
     String componentName = "sc1";
     ServiceComponent component = serviceComponentFactory.createNew(service,
         componentName);

Modified: incubator/ambari/branches/AMBARI-666/ambari-server/src/test/java/org/apache/ambari/server/state/svccomphost/ServiceComponentHostTest.java
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/AMBARI-666/ambari-server/src/test/java/org/apache/ambari/server/state/svccomphost/ServiceComponentHostTest.java?rev=1401567&r1=1401566&r2=1401567&view=diff
==============================================================================
--- incubator/ambari/branches/AMBARI-666/ambari-server/src/test/java/org/apache/ambari/server/state/svccomphost/ServiceComponentHostTest.java (original)
+++ incubator/ambari/branches/AMBARI-666/ambari-server/src/test/java/org/apache/ambari/server/state/svccomphost/ServiceComponentHostTest.java Wed Oct 24 06:37:23 2012
@@ -18,22 +18,16 @@
 
 package org.apache.ambari.server.state.svccomphost;
 
-import java.util.List;
-import java.util.Map;
-
 import com.google.inject.Guice;
 import com.google.inject.Inject;
 import com.google.inject.Injector;
 import com.google.inject.persist.PersistService;
-import com.google.inject.persist.Transactional;
 
 import org.apache.ambari.server.AmbariException;
 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.state.*;
-import org.apache.ambari.server.state.fsm.InvalidStateTransitionException;
-import org.apache.ambari.server.state.job.Job;
 import org.apache.ambari.server.state.svccomphost.ServiceComponentHostImpl;
 import org.apache.ambari.server.state.svccomphost.ServiceComponentHostInstallEvent;
 import org.apache.ambari.server.state.svccomphost.ServiceComponentHostOpFailedEvent;