You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by hi...@apache.org on 2012/10/04 02:10:41 UTC

svn commit: r1393845 [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/agent/TestHeartbeatHandler.java
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/AMBARI-666/ambari-server/src/test/java/org/apache/ambari/server/agent/TestHeartbeatHandler.java?rev=1393845&r1=1393844&r2=1393845&view=diff
==============================================================================
--- incubator/ambari/branches/AMBARI-666/ambari-server/src/test/java/org/apache/ambari/server/agent/TestHeartbeatHandler.java (original)
+++ incubator/ambari/branches/AMBARI-666/ambari-server/src/test/java/org/apache/ambari/server/agent/TestHeartbeatHandler.java Thu Oct  4 00:10:39 2012
@@ -24,12 +24,12 @@ import org.apache.ambari.server.AmbariEx
 import org.apache.ambari.server.actionmanager.ActionDBInMemoryImpl;
 import org.apache.ambari.server.actionmanager.ActionManager;
 import org.apache.ambari.server.agent.HostStatus.Status;
+import org.apache.ambari.server.state.Clusters;
+import org.apache.ambari.server.state.Host;
+import org.apache.ambari.server.state.HostState;
 import org.apache.ambari.server.state.fsm.InvalidStateTransitonException;
-import org.apache.ambari.server.state.live.Clusters;
 import org.apache.ambari.server.state.live.ClustersImpl;
-import org.apache.ambari.server.state.live.host.Host;
 import org.apache.ambari.server.state.live.host.HostImpl;
-import org.apache.ambari.server.state.live.host.HostState;
 import org.junit.Test;
 
 public class TestHeartbeatHandler {

Modified: incubator/ambari/branches/AMBARI-666/ambari-server/src/test/java/org/apache/ambari/server/agent/TestHeartbeatMonitor.java
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/AMBARI-666/ambari-server/src/test/java/org/apache/ambari/server/agent/TestHeartbeatMonitor.java?rev=1393845&r1=1393844&r2=1393845&view=diff
==============================================================================
--- incubator/ambari/branches/AMBARI-666/ambari-server/src/test/java/org/apache/ambari/server/agent/TestHeartbeatMonitor.java (original)
+++ incubator/ambari/branches/AMBARI-666/ambari-server/src/test/java/org/apache/ambari/server/agent/TestHeartbeatMonitor.java Thu Oct  4 00:10:39 2012
@@ -24,10 +24,10 @@ import java.util.ArrayList;
 import java.util.List;
 
 import org.apache.ambari.server.actionmanager.ActionManager;
-import org.apache.ambari.server.state.live.Clusters;
-import org.apache.ambari.server.state.live.host.Host;
-import org.apache.ambari.server.state.live.host.HostEvent;
-import org.apache.ambari.server.state.live.host.HostState;
+import org.apache.ambari.server.state.Clusters;
+import org.apache.ambari.server.state.Host;
+import org.apache.ambari.server.state.HostEvent;
+import org.apache.ambari.server.state.HostState;
 import org.junit.Test;
 
 public class TestHeartbeatMonitor {

Modified: incubator/ambari/branches/AMBARI-666/ambari-server/src/test/java/org/apache/ambari/server/state/live/TestClusterImpl.java
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/AMBARI-666/ambari-server/src/test/java/org/apache/ambari/server/state/live/TestClusterImpl.java?rev=1393845&r1=1393844&r2=1393845&view=diff
==============================================================================
--- incubator/ambari/branches/AMBARI-666/ambari-server/src/test/java/org/apache/ambari/server/state/live/TestClusterImpl.java (original)
+++ incubator/ambari/branches/AMBARI-666/ambari-server/src/test/java/org/apache/ambari/server/state/live/TestClusterImpl.java Thu Oct  4 00:10:39 2012
@@ -29,16 +29,16 @@ import org.apache.ambari.server.AmbariEx
 import org.apache.ambari.server.agent.DiskInfo;
 import org.apache.ambari.server.agent.HostInfo;
 import org.apache.ambari.server.state.AgentVersion;
+import org.apache.ambari.server.state.Cluster;
+import org.apache.ambari.server.state.Clusters;
 import org.apache.ambari.server.state.ConfigVersion;
 import org.apache.ambari.server.state.DeployState;
+import org.apache.ambari.server.state.HostState;
 import org.apache.ambari.server.state.StackVersion;
 import org.apache.ambari.server.state.State;
 import org.apache.ambari.server.state.fsm.InvalidStateTransitonException;
 import org.apache.ambari.server.state.live.host.HostHealthyHeartbeatEvent;
 import org.apache.ambari.server.state.live.host.HostRegistrationRequestEvent;
-import org.apache.ambari.server.state.live.host.HostState;
-import org.apache.ambari.server.state.live.svccomphost.ServiceComponentHostInstallEvent;
-import org.apache.ambari.server.state.live.svccomphost.ServiceComponentHostOpRestartedEvent;
 import org.junit.After;
 import org.junit.Before;
 import org.junit.Test;
@@ -59,7 +59,6 @@ public class TestClusterImpl {
     Assert.assertEquals("c1", c1.getClusterName());
     clusters.addHost(h1);
     clusters.mapHostToCluster(h1, "c1");
-    c1.addServiceComponentHost(s1, sc1, h1, false);
   }
 
   @After
@@ -82,29 +81,6 @@ public class TestClusterImpl {
 
   }
 
-  @Test
-  public void testAddServiceComponentHost() throws AmbariException {
-    try {
-      c1.addServiceComponentHost("s2", "sc2", "h2", false);
-      fail("Expected failure on invalid cluster/host");
-    } catch (Exception e) {
-      // Expected
-    }
-
-    clusters.addCluster("c2");
-    clusters.addHost("h2");
-    clusters.mapHostToCluster("h2", "c2");
-    c1.addServiceComponentHost("s2", "sc2", "h2", false);
-
-    try {
-      c1.addServiceComponentHost("s2", "sc2", "h2", false);
-      fail("Duplicate add should fail");
-    }
-    catch (AmbariException e) {
-      // Expected
-    }
-
-  }
 
   @Test
   public void testGetHostState() throws AmbariException {
@@ -156,58 +132,5 @@ public class TestClusterImpl {
 
   }
 
-  @Test
-  public void testGetServiceComponentHostState() throws AmbariException {
-    Assert.assertNotNull(c1.getServiceComponentHostState(s1, sc1, h1));
-    Assert.assertEquals(DeployState.INIT,
-        c1.getServiceComponentHostState(s1, sc1, h1).getLiveState());
-  }
-
-  @Test
-  public void testSetServiceComponentHostState() throws AmbariException {
-    ConfigVersion cVersion = new ConfigVersion("0.0.c");
-    StackVersion sVersion = new StackVersion("hadoop-x.y.z");
-    DeployState liveState =
-        DeployState.INSTALL_FAILED;
-    State expected =
-        new State(cVersion, sVersion, liveState);
-    c1.setServiceComponentHostState(s1, sc1, h1, expected);
-
-    State actual =
-        c1.getServiceComponentHostState(s1, sc1, h1);
-
-    Assert.assertEquals(expected, actual);
-    Assert.assertEquals(DeployState.INSTALL_FAILED,
-        actual.getLiveState());
-
-  }
-
-  @Test
-  public void testServiceComponentHostEvent()
-      throws AmbariException, InvalidStateTransitonException {
-    ConfigVersion cVersion = new ConfigVersion("0.0.c");
-    StackVersion sVersion = new StackVersion("hadoop-x.y.z");
-    DeployState liveState =
-        DeployState.INSTALL_FAILED;
-    State expected =
-        new State(cVersion, sVersion, liveState);
-    c1.setServiceComponentHostState(s1, sc1, h1, expected);
-
-    try {
-      c1.handleServiceComponentHostEvent(s1, sc1, h1,
-          new ServiceComponentHostInstallEvent(sc1, h1, 1001));
-      fail("Exception should be thrown on invalid event");
-    }
-    catch (InvalidStateTransitonException e) {
-      // Expected
-    }
-
-    c1.handleServiceComponentHostEvent(s1, sc1, h1,
-        new ServiceComponentHostOpRestartedEvent(sc1, h1, 1002));
-
-    Assert.assertEquals(DeployState.INSTALLING,
-        c1.getServiceComponentHostState(s1, sc1, h1).getLiveState());
-
-  }
 
 }

Modified: incubator/ambari/branches/AMBARI-666/ambari-server/src/test/java/org/apache/ambari/server/state/live/TestClustersImpl.java
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/AMBARI-666/ambari-server/src/test/java/org/apache/ambari/server/state/live/TestClustersImpl.java?rev=1393845&r1=1393844&r2=1393845&view=diff
==============================================================================
--- incubator/ambari/branches/AMBARI-666/ambari-server/src/test/java/org/apache/ambari/server/state/live/TestClustersImpl.java (original)
+++ incubator/ambari/branches/AMBARI-666/ambari-server/src/test/java/org/apache/ambari/server/state/live/TestClustersImpl.java Thu Oct  4 00:10:39 2012
@@ -26,7 +26,9 @@ import junit.framework.Assert;
 
 import org.apache.ambari.server.AmbariException;
 import org.apache.ambari.server.ClusterNotFoundException;
-import org.apache.ambari.server.state.live.host.Host;
+import org.apache.ambari.server.state.Cluster;
+import org.apache.ambari.server.state.Clusters;
+import org.apache.ambari.server.state.Host;
 import org.junit.After;
 import org.junit.Before;
 import org.junit.Test;

Modified: incubator/ambari/branches/AMBARI-666/ambari-server/src/test/java/org/apache/ambari/server/state/live/host/TestHostImpl.java
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/AMBARI-666/ambari-server/src/test/java/org/apache/ambari/server/state/live/host/TestHostImpl.java?rev=1393845&r1=1393844&r2=1393845&view=diff
==============================================================================
--- incubator/ambari/branches/AMBARI-666/ambari-server/src/test/java/org/apache/ambari/server/state/live/host/TestHostImpl.java (original)
+++ incubator/ambari/branches/AMBARI-666/ambari-server/src/test/java/org/apache/ambari/server/state/live/host/TestHostImpl.java Thu Oct  4 00:10:39 2012
@@ -26,7 +26,9 @@ import java.util.List;
 import org.apache.ambari.server.agent.DiskInfo;
 import org.apache.ambari.server.agent.HostInfo;
 import org.apache.ambari.server.state.AgentVersion;
-import org.apache.ambari.server.state.live.host.HostHealthStatus.HealthStatus;
+import org.apache.ambari.server.state.HostHealthStatus;
+import org.apache.ambari.server.state.HostState;
+import org.apache.ambari.server.state.HostHealthStatus.HealthStatus;
 import org.junit.Assert;
 import org.junit.Test;
 

Modified: incubator/ambari/branches/AMBARI-666/ambari-server/src/test/java/org/apache/ambari/server/state/live/svccomphost/TestServiceComponentHostImpl.java
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/AMBARI-666/ambari-server/src/test/java/org/apache/ambari/server/state/live/svccomphost/TestServiceComponentHostImpl.java?rev=1393845&r1=1393844&r2=1393845&view=diff
==============================================================================
--- incubator/ambari/branches/AMBARI-666/ambari-server/src/test/java/org/apache/ambari/server/state/live/svccomphost/TestServiceComponentHostImpl.java (original)
+++ incubator/ambari/branches/AMBARI-666/ambari-server/src/test/java/org/apache/ambari/server/state/live/svccomphost/TestServiceComponentHostImpl.java Thu Oct  4 00:10:39 2012
@@ -19,8 +19,8 @@
 package org.apache.ambari.server.state.live.svccomphost;
 
 import org.apache.ambari.server.state.DeployState;
-import org.apache.ambari.server.state.live.svccomphost.ServiceComponentHostEvent;
-import org.apache.ambari.server.state.live.svccomphost.ServiceComponentHostEventType;
+import org.apache.ambari.server.state.ServiceComponentHostEvent;
+import org.apache.ambari.server.state.ServiceComponentHostEventType;
 import org.apache.ambari.server.state.live.svccomphost.ServiceComponentHostImpl;
 import org.apache.ambari.server.state.live.svccomphost.ServiceComponentHostOpFailedEvent;
 import org.apache.ambari.server.state.live.svccomphost.ServiceComponentHostOpInProgressEvent;