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 2013/01/11 04:02:41 UTC

svn commit: r1431843 [10/10] - in /incubator/ambari/trunk: ./ ambari-agent/ ambari-agent/conf/unix/ ambari-agent/src/main/package/rpm/ ambari-agent/src/main/puppet/modules/configgenerator/manifests/ ambari-agent/src/main/puppet/modules/hdp-ganglia/mani...

Modified: incubator/ambari/trunk/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/ClusterControllerImplTest.java
URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/ClusterControllerImplTest.java?rev=1431843&r1=1431842&r2=1431843&view=diff
==============================================================================
--- incubator/ambari/trunk/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/ClusterControllerImplTest.java (original)
+++ incubator/ambari/trunk/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/ClusterControllerImplTest.java Fri Jan 11 03:02:37 2013
@@ -19,23 +19,14 @@
 package org.apache.ambari.server.controller.internal;
 
 import junit.framework.Assert;
-import org.apache.ambari.server.AmbariException;
-import org.apache.ambari.server.controller.spi.ProviderModule;
-import org.apache.ambari.server.controller.spi.RequestStatus;
-import org.apache.ambari.server.controller.spi.Schema;
-import org.apache.ambari.server.controller.spi.UnsupportedPropertyException;
+import org.apache.ambari.server.controller.spi.*;
 import org.apache.ambari.server.controller.utilities.PredicateHelper;
 import org.apache.ambari.server.controller.utilities.PropertyHelper;
-import org.apache.ambari.server.controller.spi.ClusterController;
-import org.apache.ambari.server.controller.spi.Predicate;
-import org.apache.ambari.server.controller.spi.PropertyProvider;
-import org.apache.ambari.server.controller.spi.Request;
-import org.apache.ambari.server.controller.spi.Resource;
-import org.apache.ambari.server.controller.spi.ResourceProvider;
 import org.apache.ambari.server.controller.utilities.PredicateBuilder;
 import org.junit.Test;
 
 import java.util.Collection;
+import java.util.Collections;
 import java.util.HashMap;
 import java.util.HashSet;
 import java.util.LinkedList;
@@ -50,6 +41,8 @@ public class ClusterControllerImplTest {
 
   private static final Set<String> propertyProviderProperties = new HashSet<String>();
 
+  private static final String UNSUPPORTED_PROPERTY = PropertyHelper.getPropertyId("c1", "unsupported");
+
   static {
     propertyProviderProperties.add(PropertyHelper.getPropertyId("c3", "p5"));
     propertyProviderProperties.add(PropertyHelper.getPropertyId("c3", "p6"));
@@ -76,6 +69,16 @@ public class ClusterControllerImplTest {
     public Set<String> getPropertyIds() {
       return propertyProviderProperties;
     }
+
+    @Override
+    public Set<String> checkPropertyIds(Set<String> propertyIds) {
+      if (!propertyProviderProperties.containsAll(propertyIds)) {
+        Set<String> unsupportedPropertyIds = new HashSet<String>(propertyIds);
+        unsupportedPropertyIds.removeAll(propertyProviderProperties);
+        return unsupportedPropertyIds;
+      }
+      return Collections.emptySet();
+    }
   };
 
   private static final List<PropertyProvider> propertyProviders = new LinkedList<PropertyProvider>();
@@ -165,6 +168,52 @@ public class ClusterControllerImplTest {
   }
 
   @Test
+  public void testGetResourcesWithUnsupportedPropertyPredicate() throws Exception{
+    ClusterController controller = new ClusterControllerImpl(new TestProviderModule());
+
+    Set<String> propertyIds = new HashSet<String>();
+
+    propertyIds.add(PropertyHelper.getPropertyId("c1", "p1"));
+    propertyIds.add(PropertyHelper.getPropertyId("c1", "p2"));
+    propertyIds.add(PropertyHelper.getPropertyId("c1", "p3"));
+    propertyIds.add(PropertyHelper.getPropertyId("c2", "p4"));
+
+    Request request = PropertyHelper.getReadRequest(propertyIds);
+
+    Predicate predicate = new PredicateBuilder().property(UNSUPPORTED_PROPERTY).equals(1).toPredicate();
+
+    try {
+      controller.getResources(Resource.Type.Host, request, predicate);
+      Assert.fail("Expected an UnsupportedPropertyException for the unsupported properties.");
+    } catch (UnsupportedPropertyException e) {
+      // Expected
+    }
+  }
+
+  @Test
+  public void testGetResourcesWithUnsupportedPropertyRequest() throws Exception{
+    ClusterController controller = new ClusterControllerImpl(new TestProviderModule());
+
+    Set<String> propertyIds = new HashSet<String>();
+
+    propertyIds.add(PropertyHelper.getPropertyId("c1", "p1"));
+    propertyIds.add(PropertyHelper.getPropertyId("c1", "p2"));
+    propertyIds.add(PropertyHelper.getPropertyId("c1", "p3"));
+    propertyIds.add(UNSUPPORTED_PROPERTY);
+
+    Request request = PropertyHelper.getReadRequest(propertyIds);
+
+    Predicate predicate = new PredicateBuilder().property("c1/p2").equals(1).toPredicate();
+
+    try {
+      controller.getResources(Resource.Type.Host, request, predicate);
+      Assert.fail("Expected an UnsupportedPropertyException for the unsupported properties.");
+    } catch (UnsupportedPropertyException e) {
+      // Expected
+    }
+  }
+
+  @Test
   public void testCreateResources() throws Exception{
     TestProviderModule providerModule = new TestProviderModule();
     TestResourceProvider resourceProvider = (TestResourceProvider) providerModule.getResourceProvider(Resource.Type.Host);
@@ -188,6 +237,29 @@ public class ClusterControllerImplTest {
   }
 
   @Test
+  public void testCreateResourcesWithUnsupportedProperty() throws Exception{
+    TestProviderModule providerModule = new TestProviderModule();
+    ClusterController controller = new ClusterControllerImpl(providerModule);
+
+    Set<Map<String, Object>> properties = new HashSet<Map<String, Object>>();
+    Map<String, Object> propertyMap = new HashMap<String, Object>();
+
+    propertyMap.put(PropertyHelper.getPropertyId("c1", "p1"), 99);
+    propertyMap.put(UNSUPPORTED_PROPERTY, 2);
+
+    properties.add(propertyMap);
+
+    Request request = PropertyHelper.getCreateRequest(properties);
+
+    try {
+      controller.createResources(Resource.Type.Host, request);
+      Assert.fail("Expected an UnsupportedPropertyException for the unsupported properties.");
+    } catch (UnsupportedPropertyException e) {
+      // Expected
+    }
+  }
+
+  @Test
   public void testUpdateResources() throws Exception{
     TestProviderModule providerModule = new TestProviderModule();
     TestResourceProvider resourceProvider = (TestResourceProvider) providerModule.getResourceProvider(Resource.Type.Host);
@@ -210,6 +282,50 @@ public class ClusterControllerImplTest {
   }
 
   @Test
+  public void testUpdateResourcesWithUnsupportedPropertyRequest() throws Exception{
+    TestProviderModule providerModule = new TestProviderModule();
+    ClusterController controller = new ClusterControllerImpl(providerModule);
+
+    Map<String, Object> propertyMap = new HashMap<String, Object>();
+
+    propertyMap.put(PropertyHelper.getPropertyId("c1", "p1"), 99);
+    propertyMap.put(UNSUPPORTED_PROPERTY, 2);
+
+    Request request = PropertyHelper.getUpdateRequest(propertyMap);
+
+    Predicate predicate = new PredicateBuilder().property("c1/p2").equals(1).toPredicate();
+
+    try {
+      controller.updateResources(Resource.Type.Host, request, predicate);
+      Assert.fail("Expected an UnsupportedPropertyException for the unsupported properties.");
+    } catch (UnsupportedPropertyException e) {
+      // Expected
+    }
+  }
+
+  @Test
+  public void testUpdateResourcesWithUnsupportedPropertyPredicate() throws Exception{
+    TestProviderModule providerModule = new TestProviderModule();
+    ClusterController controller = new ClusterControllerImpl(providerModule);
+
+    Map<String, Object> propertyMap = new HashMap<String, Object>();
+
+    propertyMap.put(PropertyHelper.getPropertyId("c1", "p1"), 99);
+    propertyMap.put(PropertyHelper.getPropertyId("c1", "p2"), 2);
+
+    Request request = PropertyHelper.getUpdateRequest(propertyMap);
+
+    Predicate predicate = new PredicateBuilder().property(UNSUPPORTED_PROPERTY).equals(1).toPredicate();
+
+    try {
+      controller.updateResources(Resource.Type.Host, request, predicate);
+      Assert.fail("Expected an UnsupportedPropertyException for the unsupported properties.");
+    } catch (UnsupportedPropertyException e) {
+      // Expected
+    }
+  }
+
+  @Test
   public void testUpdateResourcesResolvePredicate() throws Exception{
     TestProviderModule providerModule = new TestProviderModule();
     TestResourceProvider resourceProvider = (TestResourceProvider) providerModule.getResourceProvider(Resource.Type.Host);
@@ -252,6 +368,21 @@ public class ClusterControllerImplTest {
   }
 
   @Test
+  public void testDeleteResourcesWithUnsupportedProperty() throws Exception{
+    TestProviderModule providerModule = new TestProviderModule();
+    ClusterController controller = new ClusterControllerImpl(providerModule);
+
+    Predicate predicate = new PredicateBuilder().property(UNSUPPORTED_PROPERTY).equals(1).toPredicate();
+
+    try {
+      controller.deleteResources(Resource.Type.Host, predicate);
+      Assert.fail("Expected an UnsupportedPropertyException for the unsupported properties.");
+    } catch (UnsupportedPropertyException e) {
+      // Expected
+    }
+  }
+
+  @Test
   public void testDeleteResourcesResolvePredicate() throws Exception{
     TestProviderModule providerModule = new TestProviderModule();
     TestResourceProvider resourceProvider = (TestResourceProvider) providerModule.getResourceProvider(Resource.Type.Host);
@@ -286,7 +417,7 @@ public class ClusterControllerImplTest {
     }
 
     Map<String, Set<String>> categories = schema.getCategoryProperties();
-    for (String propertyId : resourceProvider.getPropertyIds()) {
+    for (String propertyId : resourceProvider.getPropertyIdsForSchema()) {
       String category = PropertyHelper.getPropertyCategory(propertyId);
       Set<String> properties = categories.get(category);
       Assert.assertNotNull(properties);
@@ -333,7 +464,7 @@ public class ClusterControllerImplTest {
     private Predicate lastPredicate = null;
 
     @Override
-    public Set<Resource> getResources(Request request, Predicate predicate) throws AmbariException, UnsupportedPropertyException {
+    public Set<Resource> getResources(Request request, Predicate predicate) throws SystemException, UnsupportedPropertyException, NoSuchResourceException, NoSuchParentResourceException {
 
       Set<Resource> resources = new HashSet<Resource>();
 
@@ -351,7 +482,7 @@ public class ClusterControllerImplTest {
     }
 
     @Override
-    public RequestStatus createResources(Request request) throws AmbariException, UnsupportedPropertyException {
+    public RequestStatus createResources(Request request)  {
       lastAction = Action.Create;
       lastRequest = request;
       lastPredicate = null;
@@ -359,7 +490,7 @@ public class ClusterControllerImplTest {
     }
 
     @Override
-    public RequestStatus updateResources(Request request, Predicate predicate) throws AmbariException, UnsupportedPropertyException {
+    public RequestStatus updateResources(Request request, Predicate predicate) throws SystemException, UnsupportedPropertyException, NoSuchResourceException, NoSuchParentResourceException {
       lastAction = Action.Update;
       lastRequest = request;
       lastPredicate = predicate;
@@ -367,7 +498,7 @@ public class ClusterControllerImplTest {
     }
 
     @Override
-    public RequestStatus deleteResources(Predicate predicate) throws AmbariException, UnsupportedPropertyException {
+    public RequestStatus deleteResources(Predicate predicate) throws SystemException, UnsupportedPropertyException, NoSuchResourceException, NoSuchParentResourceException {
       lastAction = Action.Delete;
       lastRequest = null;
       lastPredicate = predicate;
@@ -375,11 +506,21 @@ public class ClusterControllerImplTest {
     }
 
     @Override
-    public Set<String> getPropertyIds() {
+    public Set<String> getPropertyIdsForSchema() {
       return resourceProviderProperties;
     }
 
     @Override
+    public Set<String> checkPropertyIds(Set<String> propertyIds) {
+      if (!resourceProviderProperties.containsAll(propertyIds)) {
+        Set<String> unsupportedPropertyIds = new HashSet<String>(propertyIds);
+        unsupportedPropertyIds.removeAll(resourceProviderProperties);
+        return unsupportedPropertyIds;
+      }
+      return Collections.emptySet();
+    }
+
+    @Override
     public Map<Resource.Type, String> getKeyPropertyIds() {
       return keyPropertyIds;
     }

Modified: incubator/ambari/trunk/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/ResourceProviderImplTest.java
URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/ResourceProviderImplTest.java?rev=1431843&r1=1431842&r2=1431843&view=diff
==============================================================================
--- incubator/ambari/trunk/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/ResourceProviderImplTest.java (original)
+++ incubator/ambari/trunk/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/ResourceProviderImplTest.java Fri Jan 11 03:02:37 2013
@@ -115,74 +115,6 @@ public class ResourceProviderImplTest {
     verify(managementController, response);
   }
 
-  @Ignore
-  @Test
-  public void testCreateClusterResourcesUnsupportedProperty() throws Exception{
-    Resource.Type type = Resource.Type.Cluster;
-
-    AmbariManagementController managementController = createMock(AmbariManagementController.class);
-
-    // replay
-    replay(managementController);
-
-    ResourceProvider provider = ResourceProviderImpl.getResourceProvider(
-        type,
-        PropertyHelper.getPropertyIds(type),
-        PropertyHelper.getKeyPropertyIds(type),
-        managementController);
-
-    TestObserver observer = new TestObserver();
-
-    ((ObservableResourceProvider)provider).addObserver(observer);
-
-    // add the property map to a set for the request.  add more maps for multiple creates
-    Set<Map<String, Object>> propertySet = new LinkedHashSet<Map<String, Object>>();
-
-    // Cluster 1: create a map of properties for the request
-    Map<String, Object> properties = new LinkedHashMap<String, Object>();
-
-    // add the cluster name to the properties map
-    properties.put(ClusterResourceProvider.CLUSTER_NAME_PROPERTY_ID, "Cluster100");
-
-    // add the version to the properties map
-    properties.put(ClusterResourceProvider.CLUSTER_VERSION_PROPERTY_ID, "HDP-0.1");
-
-    // add an unsupported property to the properties map
-    properties.put("UnsupportedProperty1", "Cluster100");
-
-    propertySet.add(properties);
-
-    // Cluster 2: create a map of properties for the request
-    properties = new LinkedHashMap<String, Object>();
-
-    // add the cluster id to the properties map
-    properties.put(ClusterResourceProvider.CLUSTER_ID_PROPERTY_ID, 99L);
-
-    // add the version to the properties map
-    properties.put(ClusterResourceProvider.CLUSTER_VERSION_PROPERTY_ID, "HDP-0.1");
-
-    // add an unsupported property to the properties map
-    properties.put("UnsupportedProperty2", "Cluster100");
-
-    propertySet.add(properties);
-
-    // create the request
-    Request request = PropertyHelper.getCreateRequest(propertySet);
-
-    try {
-      provider.createResources(request);
-      Assert.fail("Expected UnsupportedPropertyException.");
-    } catch (UnsupportedPropertyException e) {
-      // expected
-      Assert.assertEquals(Resource.Type.Cluster, e.getType());
-      Assert.assertTrue(e.getPropertyIds().contains("UnsupportedProperty1"));
-      Assert.assertTrue(e.getPropertyIds().contains("UnsupportedProperty2"));
-    }
-
-    // verify
-    verify(managementController);
-  }
-
   @Test
   public void testGetClusterResources() throws Exception{
     Resource.Type type = Resource.Type.Cluster;
@@ -308,55 +240,6 @@ public class ResourceProviderImplTest {
     verify(managementController, response);
   }
 
-  @Ignore
-  @Test
-  public void testUpdateClusterResourcesUnsupportedProperty() throws Exception{
-    Resource.Type type = Resource.Type.Cluster;
-
-    AmbariManagementController managementController = createMock(AmbariManagementController.class);
-
-    Set<ClusterResponse> nameResponse = new HashSet<ClusterResponse>();
-    nameResponse.add(new ClusterResponse(102L, "Cluster102", null, null));
-
-    // replay
-    replay(managementController);
-
-    ResourceProvider provider = ResourceProviderImpl.getResourceProvider(
-        type,
-        PropertyHelper.getPropertyIds(type),
-        PropertyHelper.getKeyPropertyIds(type),
-        managementController);
-
-    TestObserver observer = new TestObserver();
-
-    ((ObservableResourceProvider)provider).addObserver(observer);
-
-    Map<String, Object> properties = new LinkedHashMap<String, Object>();
-
-    properties.put(ClusterResourceProvider.CLUSTER_VERSION_PROPERTY_ID, "HDP-0.1");
-
-    // add an unsupported property to the properties map
-    properties.put("UnsupportedProperty1", "Cluster100");
-
-    // create the request
-    Request request = PropertyHelper.getUpdateRequest(properties);
-
-    // update the cluster named Cluster102
-    Predicate  predicate = new PredicateBuilder().property(ClusterResourceProvider.CLUSTER_NAME_PROPERTY_ID).equals("Cluster102").toPredicate();
-
-    try {
-      provider.updateResources(request, predicate);
-      Assert.fail("Expected UnsupportedPropertyException.");
-    } catch (UnsupportedPropertyException e) {
-      // expected
-      Assert.assertEquals(Resource.Type.Cluster, e.getType());
-      Assert.assertTrue(e.getPropertyIds().contains("UnsupportedProperty1"));
-    }
-
-    // verify
-    verify(managementController);
-  }
-
   @Test
   public void testDeleteClusterResources() throws Exception{
     Resource.Type type = Resource.Type.Cluster;

Modified: incubator/ambari/trunk/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/SchemaImplTest.java
URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/SchemaImplTest.java?rev=1431843&r1=1431842&r2=1431843&view=diff
==============================================================================
--- incubator/ambari/trunk/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/SchemaImplTest.java (original)
+++ incubator/ambari/trunk/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/SchemaImplTest.java Fri Jan 11 03:02:37 2013
@@ -19,18 +19,11 @@
 package org.apache.ambari.server.controller.internal;
 
 import junit.framework.Assert;
-import org.apache.ambari.server.AmbariException;
-import org.apache.ambari.server.controller.spi.RequestStatus;
-import org.apache.ambari.server.controller.spi.UnsupportedPropertyException;
+import org.apache.ambari.server.controller.spi.*;
 import org.apache.ambari.server.controller.utilities.PropertyHelper;
-import org.apache.ambari.server.controller.spi.Predicate;
-import org.apache.ambari.server.controller.spi.PropertyProvider;
-import org.apache.ambari.server.controller.spi.Request;
-import org.apache.ambari.server.controller.spi.Resource;
-import org.apache.ambari.server.controller.spi.ResourceProvider;
-import org.apache.ambari.server.controller.spi.Schema;
 import org.junit.Test;
 
+import java.util.Collections;
 import java.util.HashMap;
 import java.util.HashSet;
 import java.util.LinkedList;
@@ -54,27 +47,28 @@ public class SchemaImplTest {
 
   private static final ResourceProvider resourceProvider = new ResourceProvider() {
     @Override
-    public Set<Resource> getResources(Request request, Predicate predicate) throws AmbariException, UnsupportedPropertyException {
+    public Set<Resource> getResources(Request request, Predicate predicate) throws SystemException, UnsupportedPropertyException, NoSuchResourceException, NoSuchParentResourceException {
       return null;
     }
 
     @Override
-    public RequestStatus createResources(Request request) throws AmbariException, UnsupportedPropertyException {
+    public RequestStatus createResources(Request request)
+        throws SystemException, UnsupportedPropertyException, ResourceAlreadyExistsException, NoSuchParentResourceException {
       return new RequestStatusImpl(null);
     }
 
     @Override
-    public RequestStatus updateResources(Request request, Predicate predicate) throws AmbariException, UnsupportedPropertyException {
+    public RequestStatus updateResources(Request request, Predicate predicate) throws SystemException, UnsupportedPropertyException, NoSuchResourceException, NoSuchParentResourceException {
       return new RequestStatusImpl(null);
     }
 
     @Override
-    public RequestStatus deleteResources(Predicate predicate) throws AmbariException, UnsupportedPropertyException {
+    public RequestStatus deleteResources(Predicate predicate) throws SystemException, UnsupportedPropertyException, NoSuchResourceException, NoSuchParentResourceException {
       return new RequestStatusImpl(null);
     }
 
     @Override
-    public Set<String> getPropertyIds() {
+    public Set<String> getPropertyIdsForSchema() {
       return resourceProviderProperties;
     }
 
@@ -82,6 +76,16 @@ public class SchemaImplTest {
     public Map<Resource.Type, String> getKeyPropertyIds() {
       return keyPropertyIds;
     }
+
+    @Override
+    public Set<String> checkPropertyIds(Set<String> propertyIds) {
+      if (!resourceProviderProperties.containsAll(propertyIds)) {
+        Set<String> unsupportedPropertyIds = new HashSet<String>(propertyIds);
+        unsupportedPropertyIds.removeAll(resourceProviderProperties);
+        return unsupportedPropertyIds;
+      }
+      return Collections.emptySet();
+    }
   };
 
   private static final Set<String> propertyProviderProperties = new HashSet<String>();
@@ -103,6 +107,16 @@ public class SchemaImplTest {
     public Set<String> getPropertyIds() {
       return propertyProviderProperties;
     }
+
+    @Override
+    public Set<String> checkPropertyIds(Set<String> propertyIds) {
+      if (!propertyProviderProperties.containsAll(propertyIds)) {
+        Set<String> unsupportedPropertyIds = new HashSet<String>(propertyIds);
+        unsupportedPropertyIds.removeAll(propertyProviderProperties);
+        return unsupportedPropertyIds;
+      }
+      return Collections.emptySet();
+    }
   };
 
   private static final List<PropertyProvider> propertyProviders = new LinkedList<PropertyProvider>();

Modified: incubator/ambari/trunk/ambari-server/src/test/java/org/apache/ambari/server/orm/InMemoryDefaultTestModule.java
URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-server/src/test/java/org/apache/ambari/server/orm/InMemoryDefaultTestModule.java?rev=1431843&r1=1431842&r2=1431843&view=diff
==============================================================================
--- incubator/ambari/trunk/ambari-server/src/test/java/org/apache/ambari/server/orm/InMemoryDefaultTestModule.java (original)
+++ incubator/ambari/trunk/ambari-server/src/test/java/org/apache/ambari/server/orm/InMemoryDefaultTestModule.java Fri Jan 11 03:02:37 2013
@@ -1,5 +1,23 @@
 package org.apache.ambari.server.orm;
 
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
 import com.google.inject.AbstractModule;
 import org.apache.ambari.server.configuration.Configuration;
 import org.apache.ambari.server.controller.ControllerModule;

Modified: incubator/ambari/trunk/ambari-server/src/test/java/org/apache/ambari/server/state/cluster/ClustersTest.java
URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-server/src/test/java/org/apache/ambari/server/state/cluster/ClustersTest.java?rev=1431843&r1=1431842&r2=1431843&view=diff
==============================================================================
--- incubator/ambari/trunk/ambari-server/src/test/java/org/apache/ambari/server/state/cluster/ClustersTest.java (original)
+++ incubator/ambari/trunk/ambari-server/src/test/java/org/apache/ambari/server/state/cluster/ClustersTest.java Fri Jan 11 03:02:37 2013
@@ -33,6 +33,7 @@ import junit.framework.Assert;
 
 import org.apache.ambari.server.AmbariException;
 import org.apache.ambari.server.ClusterNotFoundException;
+import org.apache.ambari.server.DuplicateResourceException;
 import org.apache.ambari.server.HostNotFoundException;
 import org.apache.ambari.server.api.services.AmbariMetaInfo;
 import org.apache.ambari.server.orm.GuiceJpaInitializer;
@@ -211,7 +212,13 @@ public class ClustersTest {
 
     clusters.mapHostToCluster(h1, c1);
     clusters.mapHostToCluster(h2, c1);
-    clusters.mapHostToCluster(h1, c1);
+
+    try {
+      clusters.mapHostToCluster(h1, c1);
+      fail("Expected exception for duplicate");
+    } catch (DuplicateResourceException e) {
+      // expected
+    }
 
     Set<String> hostnames = new HashSet<String>();
     hostnames.add(h1);

Modified: incubator/ambari/trunk/ambari-server/src/test/java/org/apache/ambari/server/state/svccomphost/ServiceComponentHostTest.java
URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-server/src/test/java/org/apache/ambari/server/state/svccomphost/ServiceComponentHostTest.java?rev=1431843&r1=1431842&r2=1431843&view=diff
==============================================================================
--- incubator/ambari/trunk/ambari-server/src/test/java/org/apache/ambari/server/state/svccomphost/ServiceComponentHostTest.java (original)
+++ incubator/ambari/trunk/ambari-server/src/test/java/org/apache/ambari/server/state/svccomphost/ServiceComponentHostTest.java Fri Jan 11 03:02:37 2013
@@ -241,13 +241,22 @@ public class ServiceComponentHostTest {
 
     ServiceComponentHostEvent installEvent2 = createEvent(impl, ++timestamp,
         startEventType);
+   
     boolean exceptionThrown = false;
+    LOG.info("Transitioning from " + impl.getState() + " " + installEvent2.getType());
     try {
       impl.handleEvent(installEvent2);
     } catch (Exception e) {
       exceptionThrown = true;
     }
-    Assert.assertTrue("Exception not thrown on invalid event", exceptionThrown);
+    if (impl.getState() == State.INSTALLING || impl.getState() == State.STARTING) {
+      startTime = timestamp;
+    // We need to allow install on a install.
+      Assert.assertTrue("Exception not thrown on invalid event", !exceptionThrown);
+    } 
+    else {
+      Assert.assertTrue("Exception not thrown on invalid event", exceptionThrown);
+    }
     Assert.assertEquals(startTime, impl.getLastOpStartTime());
     Assert.assertEquals(-1, impl.getLastOpLastUpdateTime());
     Assert.assertEquals(-1, impl.getLastOpEndTime());

Modified: incubator/ambari/trunk/ambari-server/src/test/resources/ambari.properties
URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-server/src/test/resources/ambari.properties?rev=1431843&r1=1431842&r2=1431843&view=diff
==============================================================================
--- incubator/ambari/trunk/ambari-server/src/test/resources/ambari.properties (original)
+++ incubator/ambari/trunk/ambari-server/src/test/resources/ambari.properties Fri Jan 11 03:02:37 2013
@@ -0,0 +1,17 @@
+# Copyright 2011 The Apache Software Foundation
+# 
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
\ No newline at end of file

Modified: incubator/ambari/trunk/ambari-server/src/test/resources/api_testscripts/curl-addcluster.sh
URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-server/src/test/resources/api_testscripts/curl-addcluster.sh?rev=1431843&r1=1431842&r2=1431843&view=diff
==============================================================================
--- incubator/ambari/trunk/ambari-server/src/test/resources/api_testscripts/curl-addcluster.sh (original)
+++ incubator/ambari/trunk/ambari-server/src/test/resources/api_testscripts/curl-addcluster.sh Fri Jan 11 03:02:37 2013
@@ -1,2 +1,17 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
 curl -i -X POST -d '{"Clusters": {"version" : "HDP-1.2.0"}}' http://localhost:8080/api/clusters/c1
 curl -i -X POST http://localhost:8080/api/clusters/c1/hosts/localhost.localdomain

Modified: incubator/ambari/trunk/ambari-server/src/test/resources/api_testscripts/curl-addganglia.sh
URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-server/src/test/resources/api_testscripts/curl-addganglia.sh?rev=1431843&r1=1431842&r2=1431843&view=diff
==============================================================================
--- incubator/ambari/trunk/ambari-server/src/test/resources/api_testscripts/curl-addganglia.sh (original)
+++ incubator/ambari/trunk/ambari-server/src/test/resources/api_testscripts/curl-addganglia.sh Fri Jan 11 03:02:37 2013
@@ -1,3 +1,17 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
 curl -i -X POST http://localhost:8080/api/clusters/c1/services/GANGLIA
 curl -i -X POST http://localhost:8080/api/clusters/c1/services/GANGLIA/components/GANGLIA_SERVER
 curl -i -X POST http://localhost:8080/api/clusters/c1/services/GANGLIA/components/GANGLIA_MONITOR

Modified: incubator/ambari/trunk/ambari-server/src/test/resources/api_testscripts/curl-addhbase.sh
URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-server/src/test/resources/api_testscripts/curl-addhbase.sh?rev=1431843&r1=1431842&r2=1431843&view=diff
==============================================================================
--- incubator/ambari/trunk/ambari-server/src/test/resources/api_testscripts/curl-addhbase.sh (original)
+++ incubator/ambari/trunk/ambari-server/src/test/resources/api_testscripts/curl-addhbase.sh Fri Jan 11 03:02:37 2013
@@ -1,3 +1,18 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
 curl -i -X POST http://localhost:8080/api/clusters/c1/services/HBASE
 curl -i -X POST http://localhost:8080/api/clusters/c1/services/HBASE/components/HBASE_MASTER
 curl -i -X POST http://localhost:8080/api/clusters/c1/services/HBASE/components/HBASE_REGIONSERVER

Modified: incubator/ambari/trunk/ambari-server/src/test/resources/api_testscripts/curl-addhdfs.sh
URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-server/src/test/resources/api_testscripts/curl-addhdfs.sh?rev=1431843&r1=1431842&r2=1431843&view=diff
==============================================================================
--- incubator/ambari/trunk/ambari-server/src/test/resources/api_testscripts/curl-addhdfs.sh (original)
+++ incubator/ambari/trunk/ambari-server/src/test/resources/api_testscripts/curl-addhdfs.sh Fri Jan 11 03:02:37 2013
@@ -1,3 +1,18 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
 curl -i -X POST http://localhost:8080/api/clusters/c1/services/HDFS
 curl -i -X POST -d '{"type": "core-site", "tag": "version1", "properties" : { "fs.default.name" : "localhost:8020"}}' http://localhost:8080/api/clusters/c1/configurations
 curl -i -X POST -d '{"type": "hdfs-site", "tag": "version1", "properties" : { "dfs.datanode.data.dir.perm" : "750"}}' http://localhost:8080/api/clusters/c1/configurations

Modified: incubator/ambari/trunk/ambari-server/src/test/resources/api_testscripts/curl-addmapreduce.sh
URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-server/src/test/resources/api_testscripts/curl-addmapreduce.sh?rev=1431843&r1=1431842&r2=1431843&view=diff
==============================================================================
--- incubator/ambari/trunk/ambari-server/src/test/resources/api_testscripts/curl-addmapreduce.sh (original)
+++ incubator/ambari/trunk/ambari-server/src/test/resources/api_testscripts/curl-addmapreduce.sh Fri Jan 11 03:02:37 2013
@@ -1,3 +1,18 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
 curl -i -X POST http://localhost:8080/api/clusters/c1/services/MAPREDUCE
 curl -i -X POST -d '{"type": "core-site", "tag": "version2", "properties" : { "fs.default.name" : "localhost:8020"}}' http://localhost:8080/api/clusters/c1/configurations
 curl -i -X POST -d '{"type": "mapred-site", "tag": "version1", "properties" : { "mapred.job.tracker" : "localhost:50300", "mapreduce.history.server.embedded": "false", "mapreduce.history.server.http.address": "localhost:51111"}}' http://localhost:8080/api/clusters/c1/configurations

Modified: incubator/ambari/trunk/ambari-server/src/test/resources/api_testscripts/curl-addnagios.sh
URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-server/src/test/resources/api_testscripts/curl-addnagios.sh?rev=1431843&r1=1431842&r2=1431843&view=diff
==============================================================================
--- incubator/ambari/trunk/ambari-server/src/test/resources/api_testscripts/curl-addnagios.sh (original)
+++ incubator/ambari/trunk/ambari-server/src/test/resources/api_testscripts/curl-addnagios.sh Fri Jan 11 03:02:37 2013
@@ -1,3 +1,18 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
 curl -i -X POST http://localhost:8080/api/clusters/c1/services/NAGIOS
 curl -i -X POST http://localhost:8080/api/clusters/c1/services/NAGIOS/components/NAGIOS_SERVER
 curl -i -X POST http://localhost:8080/api/clusters/c1/hosts/localhost.localdomain/host_components/NAGIOS_SERVER

Modified: incubator/ambari/trunk/ambari-server/src/test/resources/api_testscripts/curl-adduser.sh
URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-server/src/test/resources/api_testscripts/curl-adduser.sh?rev=1431843&r1=1431842&r2=1431843&view=diff
==============================================================================
--- incubator/ambari/trunk/ambari-server/src/test/resources/api_testscripts/curl-adduser.sh (original)
+++ incubator/ambari/trunk/ambari-server/src/test/resources/api_testscripts/curl-adduser.sh Fri Jan 11 03:02:37 2013
@@ -1,3 +1,18 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
 curl -i -o - -X GET http://localhost:8080/api/users
 curl -i -o - -X GET http://localhost:8080/api/users/admin
 #POST - to create a user test3 with password ambari belonging to both roles user and admin, the roles can just be admin

Modified: incubator/ambari/trunk/ambari-server/src/test/resources/api_testscripts/curl-addzk.sh
URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-server/src/test/resources/api_testscripts/curl-addzk.sh?rev=1431843&r1=1431842&r2=1431843&view=diff
==============================================================================
--- incubator/ambari/trunk/ambari-server/src/test/resources/api_testscripts/curl-addzk.sh (original)
+++ incubator/ambari/trunk/ambari-server/src/test/resources/api_testscripts/curl-addzk.sh Fri Jan 11 03:02:37 2013
@@ -1,3 +1,18 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
 curl -i -X POST -d '{"type": "zoo", "tag": "version1", "properties" : { "tickTime" : "20"}}' http://localhost:8080/api/clusters/c1/configurations
 curl -i -X POST http://localhost:8080/api/clusters/c1/services/ZOOKEEPER
 curl -i -X POST http://localhost:8080/api/clusters/c1/services/ZOOKEEPER/components/ZOOKEEPER_SERVER

Modified: incubator/ambari/trunk/ambari-server/src/test/resources/stacks/HDP/0.1/services/HDFS/metainfo.xml
URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-server/src/test/resources/stacks/HDP/0.1/services/HDFS/metainfo.xml?rev=1431843&r1=1431842&r2=1431843&view=diff
==============================================================================
--- incubator/ambari/trunk/ambari-server/src/test/resources/stacks/HDP/0.1/services/HDFS/metainfo.xml (original)
+++ incubator/ambari/trunk/ambari-server/src/test/resources/stacks/HDP/0.1/services/HDFS/metainfo.xml Fri Jan 11 03:02:37 2013
@@ -1,4 +1,17 @@
 <?xml version="1.0"?>
+<!--
+  Licensed under the Apache License, Version 2.0 (the "License");
+  you may not use this file except in compliance with the License.
+  You may obtain a copy of the License at
+
+    http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License. See accompanying LICENSE file.
+-->
 <metainfo>
     <user>root</user>
     <comment>This is comment for HDFS service</comment>

Modified: incubator/ambari/trunk/ambari-server/src/test/resources/stacks/HDP/0.1/services/MAPREDUCE/metainfo.xml
URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-server/src/test/resources/stacks/HDP/0.1/services/MAPREDUCE/metainfo.xml?rev=1431843&r1=1431842&r2=1431843&view=diff
==============================================================================
--- incubator/ambari/trunk/ambari-server/src/test/resources/stacks/HDP/0.1/services/MAPREDUCE/metainfo.xml (original)
+++ incubator/ambari/trunk/ambari-server/src/test/resources/stacks/HDP/0.1/services/MAPREDUCE/metainfo.xml Fri Jan 11 03:02:37 2013
@@ -1,4 +1,17 @@
 <?xml version="1.0"?>
+<!--
+  Licensed under the Apache License, Version 2.0 (the "License");
+  you may not use this file except in compliance with the License.
+  You may obtain a copy of the License at
+
+    http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License. See accompanying LICENSE file.
+-->
 <metainfo>
   <user>root</user>
   <comment>This is comment for Mapred service</comment>

Modified: incubator/ambari/trunk/ambari-server/src/test/resources/stacks/HDP/0.2/services/HDFS/metainfo.xml
URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-server/src/test/resources/stacks/HDP/0.2/services/HDFS/metainfo.xml?rev=1431843&r1=1431842&r2=1431843&view=diff
==============================================================================
--- incubator/ambari/trunk/ambari-server/src/test/resources/stacks/HDP/0.2/services/HDFS/metainfo.xml (original)
+++ incubator/ambari/trunk/ambari-server/src/test/resources/stacks/HDP/0.2/services/HDFS/metainfo.xml Fri Jan 11 03:02:37 2013
@@ -1,4 +1,17 @@
 <?xml version="1.0"?>
+<!--
+  Licensed under the Apache License, Version 2.0 (the "License");
+  you may not use this file except in compliance with the License.
+  You may obtain a copy of the License at
+
+    http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License. See accompanying LICENSE file.
+-->
 <metainfo>
     <user>root</user>
     <comment>This is comment for HDFS service</comment>

Modified: incubator/ambari/trunk/ambari-server/src/test/resources/stacks/HDP/0.2/services/MAPREDUCE/metainfo.xml
URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-server/src/test/resources/stacks/HDP/0.2/services/MAPREDUCE/metainfo.xml?rev=1431843&r1=1431842&r2=1431843&view=diff
==============================================================================
--- incubator/ambari/trunk/ambari-server/src/test/resources/stacks/HDP/0.2/services/MAPREDUCE/metainfo.xml (original)
+++ incubator/ambari/trunk/ambari-server/src/test/resources/stacks/HDP/0.2/services/MAPREDUCE/metainfo.xml Fri Jan 11 03:02:37 2013
@@ -1,4 +1,17 @@
 <?xml version="1.0"?>
+<!--
+  Licensed under the Apache License, Version 2.0 (the "License");
+  you may not use this file except in compliance with the License.
+  You may obtain a copy of the License at
+
+    http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License. See accompanying LICENSE file.
+-->
 <metainfo>
   <user>root</user>
   <comment>This is comment for Mapred service</comment>

Modified: incubator/ambari/trunk/ambari-server/src/test/resources/test_api.sh
URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-server/src/test/resources/test_api.sh?rev=1431843&r1=1431842&r2=1431843&view=diff
==============================================================================
--- incubator/ambari/trunk/ambari-server/src/test/resources/test_api.sh (original)
+++ incubator/ambari/trunk/ambari-server/src/test/resources/test_api.sh Fri Jan 11 03:02:37 2013
@@ -1,3 +1,18 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
 AGENT_HOST="localhost.localdomain"
 curl -i -X POST -d '{"Clusters": {"version" : "HDP-1.2.0"}}' http://localhost:8080/api/v1/clusters/c1
 curl -i -X POST http://localhost:8080/api/v1/clusters/c1/services/HDFS

Modified: incubator/ambari/trunk/ambari-server/src/test/resources/test_multnode_api.sh
URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-server/src/test/resources/test_multnode_api.sh?rev=1431843&r1=1431842&r2=1431843&view=diff
==============================================================================
--- incubator/ambari/trunk/ambari-server/src/test/resources/test_multnode_api.sh (original)
+++ incubator/ambari/trunk/ambari-server/src/test/resources/test_multnode_api.sh Fri Jan 11 03:02:37 2013
@@ -1,3 +1,18 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
 SERVER_HOST="ec2-107-20-75-170.compute-1.amazonaws.com"
 declare -a AGENT_HOSTS=('test1' 'test2');
 

Modified: incubator/ambari/trunk/ambari-server/src/test/resources/web/WEB-INF/web.xml
URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-server/src/test/resources/web/WEB-INF/web.xml?rev=1431843&r1=1431842&r2=1431843&view=diff
==============================================================================
--- incubator/ambari/trunk/ambari-server/src/test/resources/web/WEB-INF/web.xml (original)
+++ incubator/ambari/trunk/ambari-server/src/test/resources/web/WEB-INF/web.xml Fri Jan 11 03:02:37 2013
@@ -1,4 +1,17 @@
 <?xml version="1.0" encoding="UTF-8"?>
+<!--
+  Licensed under the Apache License, Version 2.0 (the "License");
+  you may not use this file except in compliance with the License.
+  You may obtain a copy of the License at
+
+    http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License. See accompanying LICENSE file.
+-->
 <web-app xmlns="http://java.sun.com/xml/ns/javaee"
          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
          xsi:schemaLocation="http://java.sun.com/xml/ns/javaee

Modified: incubator/ambari/trunk/ambari-server/src/test/resources/web/index.jsp
URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-server/src/test/resources/web/index.jsp?rev=1431843&r1=1431842&r2=1431843&view=diff
==============================================================================
--- incubator/ambari/trunk/ambari-server/src/test/resources/web/index.jsp (original)
+++ incubator/ambari/trunk/ambari-server/src/test/resources/web/index.jsp Fri Jan 11 03:02:37 2013
@@ -1,3 +1,16 @@
+<!--
+  Licensed under the Apache License, Version 2.0 (the "License");
+  you may not use this file except in compliance with the License.
+  You may obtain a copy of the License at
+
+    http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License. See accompanying LICENSE file.
+-->
 <%--
   Created by IntelliJ IDEA.
   User: john

Modified: incubator/ambari/trunk/contrib/addons/src/addOns/nagios/scripts/nagios_alerts.php
URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/contrib/addons/src/addOns/nagios/scripts/nagios_alerts.php?rev=1431843&r1=1431842&r2=1431843&view=diff
==============================================================================
--- incubator/ambari/trunk/contrib/addons/src/addOns/nagios/scripts/nagios_alerts.php (original)
+++ incubator/ambari/trunk/contrib/addons/src/addOns/nagios/scripts/nagios_alerts.php Fri Jan 11 03:02:37 2013
@@ -371,13 +371,16 @@ function hdp_mon_generate_response( $res
       case "HBASEMASTER":
         $pieces[0] = "HBASE";
         break;
+      case "HIVE-METASTORE":
+        $pieces[0] = "HIVE";
+        break;
       case "HDFS":
       case "MAPREDUCE":
       case "HBASE":
       case "ZOOKEEPER":
-      case "HIVE-METASTORE":
       case "OOZIE":
       case "TEMPLETON":
+      case "GANGLIA":
       case "PUPPET":
         break;
       default:

Modified: incubator/ambari/trunk/contrib/ambari-log4j/.classpath
URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/contrib/ambari-log4j/.classpath?rev=1431843&r1=1431842&r2=1431843&view=diff
==============================================================================
--- incubator/ambari/trunk/contrib/ambari-log4j/.classpath (original)
+++ incubator/ambari/trunk/contrib/ambari-log4j/.classpath Fri Jan 11 03:02:37 2013
@@ -7,8 +7,8 @@
   <classpathentry kind="var" path="M2_REPO/javax/xml/bind/jaxb-api/2.2.7/jaxb-api-2.2.7.jar"/>
   <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
   <classpathentry kind="var" path="M2_REPO/junit/junit/3.8.1/junit-3.8.1.jar"/>
-  <classpathentry kind="var" path="M2_REPO/org/apache/hadoop/hadoop-tools/1.1.0.1/hadoop-tools-1.1.0.1.jar"/>
-  <classpathentry kind="var" path="M2_REPO/org/apache/hadoop/hadoop-core/1.1.0.1/hadoop-core-1.1.0.1.jar"/>
+  <classpathentry kind="var" path="M2_REPO/org/apache/hadoop/hadoop-tools/1.1.1.1/hadoop-tools-1.1.1.1.jar"/>
+  <classpathentry kind="var" path="M2_REPO/org/apache/hadoop/hadoop-core/1.1.1.1/hadoop-core-1.1.1.1.jar"/>
   <classpathentry kind="var" path="M2_REPO/commons-cli/commons-cli/1.2/commons-cli-1.2.jar"/>
   <classpathentry kind="var" path="M2_REPO/xmlenc/xmlenc/0.52/xmlenc-0.52.jar"/>
   <classpathentry kind="var" path="M2_REPO/commons-io/commons-io/2.1/commons-io-2.1.jar"/>
@@ -35,8 +35,7 @@
   <classpathentry kind="var" path="M2_REPO/org/eclipse/jdt/core/3.1.1/core-3.1.1.jar"/>
   <classpathentry kind="var" path="M2_REPO/ant/ant/1.6.5/ant-1.6.5.jar"/>
   <classpathentry kind="var" path="M2_REPO/commons-el/commons-el/1.0/commons-el-1.0.jar"/>
-  <classpathentry kind="var" path="M2_REPO/net/java/dev/jets3t/jets3t/0.7.1/jets3t-0.7.1.jar"/>
-  <classpathentry kind="var" path="M2_REPO/net/sf/kosmosfs/kfs/0.3/kfs-0.3.jar"/>
+  <classpathentry kind="var" path="M2_REPO/net/java/dev/jets3t/jets3t/0.6.1/jets3t-0.6.1.jar"/>
   <classpathentry kind="var" path="M2_REPO/hsqldb/hsqldb/1.8.0.10/hsqldb-1.8.0.10.jar"/>
   <classpathentry kind="var" path="M2_REPO/org/codehaus/jackson/jackson-mapper-asl/1.9.2/jackson-mapper-asl-1.9.2.jar"/>
   <classpathentry kind="var" path="M2_REPO/org/codehaus/jackson/jackson-core-asl/1.9.2/jackson-core-asl-1.9.2.jar"/>

Modified: incubator/ambari/trunk/contrib/ambari-log4j/README.md
URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/contrib/ambari-log4j/README.md?rev=1431843&r1=1431842&r2=1431843&view=diff
==============================================================================
--- incubator/ambari/trunk/contrib/ambari-log4j/README.md (original)
+++ incubator/ambari/trunk/contrib/ambari-log4j/README.md Fri Jan 11 03:02:37 2013
@@ -1,6 +1,23 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+
 ambari-log4j
 ============
 
+
 log4j add-ons for Apache Ambari.
 
 1. MapReduce JobHistory

Modified: incubator/ambari/trunk/contrib/ambari-log4j/pom.xml
URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/contrib/ambari-log4j/pom.xml?rev=1431843&r1=1431842&r2=1431843&view=diff
==============================================================================
--- incubator/ambari/trunk/contrib/ambari-log4j/pom.xml (original)
+++ incubator/ambari/trunk/contrib/ambari-log4j/pom.xml Fri Jan 11 03:02:37 2013
@@ -1,3 +1,19 @@
+<!--
+   Licensed to the Apache Software Foundation (ASF) under one or more
+   contributor license agreements.  See the NOTICE file distributed with
+   this work for additional information regarding copyright ownership.
+   The ASF licenses this file to You under the Apache License, Version 2.0
+   (the "License"); you may not use this file except in compliance with
+   the License.  You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
+-->
 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
   xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
   <modelVersion>4.0.0</modelVersion>

Modified: incubator/ambari/trunk/contrib/ambari-log4j/src/main/java/org/apache/ambari/log4j/hadoop/mapreduce/jobhistory/JobHistoryAppender.java
URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/contrib/ambari-log4j/src/main/java/org/apache/ambari/log4j/hadoop/mapreduce/jobhistory/JobHistoryAppender.java?rev=1431843&r1=1431842&r2=1431843&view=diff
==============================================================================
--- incubator/ambari/trunk/contrib/ambari-log4j/src/main/java/org/apache/ambari/log4j/hadoop/mapreduce/jobhistory/JobHistoryAppender.java (original)
+++ incubator/ambari/trunk/contrib/ambari-log4j/src/main/java/org/apache/ambari/log4j/hadoop/mapreduce/jobhistory/JobHistoryAppender.java Fri Jan 11 03:02:37 2013
@@ -113,14 +113,11 @@ public class JobHistoryAppender extends 
         LOG.info("database set to 'none'");
       } else {
         try {
-          LOG.info("Connecting to database " + database +
-              " as user " + user + " password " + password + 
-              " and driver " + driver); 
           logStore = 
               new DatabaseStore(driver, database, user, password, 
                   new MapReduceJobHistoryUpdater());
         } catch (IOException ioe) {
-          LOG.info("Failed to connect to db " + database, ioe);
+          LOG.debug("Failed to connect to db " + database, ioe);
           System.err.println("Failed to connect to db " + database + 
               " as user " + user + " password " + password + 
               " and driver " + driver + " with " + 
@@ -128,7 +125,7 @@ public class JobHistoryAppender extends 
           throw new RuntimeException(
               "Failed to create database store for " + database, ioe);
         } catch (Exception e) {
-          LOG.info("Failed to connect to db " + database, e);
+          LOG.debug("Failed to connect to db " + database, e);
           System.err.println("Failed to connect to db " + database + 
               " as user " + user + " password " + password + 
               " and driver " + driver + " with " + 

Modified: incubator/ambari/trunk/contrib/ambari-log4j/src/main/resources/ambari.schema
URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/contrib/ambari-log4j/src/main/resources/ambari.schema?rev=1431843&r1=1431842&r2=1431843&view=diff
==============================================================================
--- incubator/ambari/trunk/contrib/ambari-log4j/src/main/resources/ambari.schema (original)
+++ incubator/ambari/trunk/contrib/ambari-log4j/src/main/resources/ambari.schema Fri Jan 11 03:02:37 2013
@@ -1,3 +1,20 @@
+--
+-- Licensed to the Apache Software Foundation (ASF) under one
+-- or more contributor license agreements.  See the NOTICE file
+-- distributed with this work for additional information
+-- regarding copyright ownership.  The ASF licenses this file
+-- to you under the Apache License, Version 2.0 (the
+-- "License"); you may not use this file except in compliance
+-- with the License.  You may obtain a copy of the License at
+--
+--     http://www.apache.org/licenses/LICENSE-2.0
+--
+-- Unless required by applicable law or agreed to in writing, software
+-- distributed under the License is distributed on an "AS IS" BASIS,
+-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+-- See the License for the specific language governing permissions and
+-- limitations under the License.
+--
 CREATE TABLE workflow (
   workflowId TEXT, workflowName TEXT,
   parentWorkflowId TEXT,  

Modified: incubator/ambari/trunk/pom.xml
URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/pom.xml?rev=1431843&r1=1431842&r2=1431843&view=diff
==============================================================================
--- incubator/ambari/trunk/pom.xml (original)
+++ incubator/ambari/trunk/pom.xml Fri Jan 11 03:02:37 2013
@@ -21,7 +21,7 @@
   <artifactId>ambari</artifactId>
   <packaging>pom</packaging>
   <name>Ambari Main</name>
-  <version>1.0.3-SNAPSHOT</version>
+  <version>1.2.0-SNAPSHOT</version>
   <description>Ambari</description>
   <pluginRepositories>
     <pluginRepository>