incubator-ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hit...@apache.org
Subject svn commit: r1401083 [3/3] - in /incubator/ambari/branches/AMBARI-666: ./ ambari-server/src/main/java/org/apache/ambari/server/ ambari-server/src/main/java/org/apache/ambari/server/actionmanager/ ambari-server/src/main/java/org/apache/ambari/server/age...
Date Mon, 22 Oct 2012 21:19:11 GMT
Modified: incubator/ambari/branches/AMBARI-666/ambari-server/src/test/java/org/apache/ambari/server/state/cluster/ClusterTest.java
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/AMBARI-666/ambari-server/src/test/java/org/apache/ambari/server/state/cluster/ClusterTest.java?rev=1401083&r1=1401082&r2=1401083&view=diff
==============================================================================
--- incubator/ambari/branches/AMBARI-666/ambari-server/src/test/java/org/apache/ambari/server/state/cluster/ClusterTest.java
(original)
+++ incubator/ambari/branches/AMBARI-666/ambari-server/src/test/java/org/apache/ambari/server/state/cluster/ClusterTest.java
Mon Oct 22 21:19:10 2012
@@ -47,7 +47,7 @@ import org.apache.ambari.server.state.Se
 import org.apache.ambari.server.state.ServiceComponentHostFactory;
 import org.apache.ambari.server.state.ServiceFactory;
 import org.apache.ambari.server.state.StackVersion;
-import org.apache.ambari.server.state.fsm.InvalidStateTransitonException;
+import org.apache.ambari.server.state.fsm.InvalidStateTransitionException;
 import org.apache.ambari.server.state.host.HostHealthyHeartbeatEvent;
 import org.apache.ambari.server.state.host.HostRegistrationRequestEvent;
 import org.junit.After;
@@ -119,7 +119,7 @@ public class ClusterTest {
 
   @Test
   public void testHostEvent() throws AmbariException,
-      InvalidStateTransitonException {
+      InvalidStateTransitionException {
     HostInfo hostInfo = new HostInfo();
     hostInfo.setHostName("h1");
     hostInfo.setInterfaces("fip_4");
@@ -149,7 +149,7 @@ public class ClusterTest {
           new HostHealthyHeartbeatEvent("h1", currentTime));
       fail("Exception should be thrown on invalid event");
     }
-    catch (InvalidStateTransitonException e) {
+    catch (InvalidStateTransitionException e) {
       // Expected
     }
 

Modified: incubator/ambari/branches/AMBARI-666/ambari-server/src/test/java/org/apache/ambari/server/state/host/HostTest.java
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/AMBARI-666/ambari-server/src/test/java/org/apache/ambari/server/state/host/HostTest.java?rev=1401083&r1=1401082&r2=1401083&view=diff
==============================================================================
--- incubator/ambari/branches/AMBARI-666/ambari-server/src/test/java/org/apache/ambari/server/state/host/HostTest.java
(original)
+++ incubator/ambari/branches/AMBARI-666/ambari-server/src/test/java/org/apache/ambari/server/state/host/HostTest.java
Mon Oct 22 21:19:10 2012
@@ -31,6 +31,8 @@ import org.apache.ambari.server.agent.Di
 import org.apache.ambari.server.agent.HostInfo;
 import org.apache.ambari.server.orm.GuiceJpaInitializer;
 import org.apache.ambari.server.orm.InMemoryDefaultTestModule;
+import org.apache.ambari.server.orm.dao.HostDAO;
+import org.apache.ambari.server.orm.entities.HostEntity;
 import org.apache.ambari.server.state.*;
 import org.apache.ambari.server.state.HostHealthStatus.HealthStatus;
 import org.apache.ambari.server.state.host.HostHealthyHeartbeatEvent;
@@ -47,12 +49,14 @@ public class HostTest {
 
   private Injector injector;
   private Clusters clusters;
+  private HostDAO hostDAO;
 
   @Before
    public void setup() throws AmbariException{
     injector = Guice.createInjector(new InMemoryDefaultTestModule());
     injector.getInstance(GuiceJpaInitializer.class);
     clusters = injector.getInstance(Clusters.class);
+    hostDAO = injector.getInstance(HostDAO.class);
   }
 
   @After
@@ -120,6 +124,13 @@ public class HostTest {
     }
     host.handleEvent(e);
     Assert.assertEquals(currentTime, host.getLastRegistrationTime());
+
+    HostEntity entity = hostDAO.findByName(host.getHostName());
+    Assert.assertEquals(currentTime,
+        entity.getLastRegistrationTime().longValue());
+    Assert.assertEquals("os_arch", entity.getOsArch());
+    Assert.assertEquals("os_type", entity.getOsType());
+    Assert.assertEquals(10, entity.getTotalMem().longValue());
   }
 
   private void ensureHostUpdatesReceived(Host host) throws Exception {

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=1401083&r1=1401082&r2=1401083&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
Mon Oct 22 21:19:10 2012
@@ -32,7 +32,7 @@ import org.apache.ambari.server.controll
 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.InvalidStateTransitonException;
+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;



Mime
View raw message