You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by sr...@apache.org on 2014/07/25 19:05:39 UTC

git commit: AMBARI-6622. BlueprintResourceProviderTest fails on exception message assertion

Repository: ambari
Updated Branches:
  refs/heads/trunk d6949dc37 -> 05549b273


AMBARI-6622. BlueprintResourceProviderTest fails on exception message assertion


Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/05549b27
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/05549b27
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/05549b27

Branch: refs/heads/trunk
Commit: 05549b27347b96d63f8d104b27ed36401daf8c74
Parents: d6949dc
Author: Srimanth Gunturi <sg...@hortonworks.com>
Authored: Fri Jul 25 09:53:57 2014 -0700
Committer: Srimanth Gunturi <sg...@hortonworks.com>
Committed: Fri Jul 25 09:54:03 2014 -0700

----------------------------------------------------------------------
 .../server/controller/internal/BlueprintResourceProvider.java    | 4 +++-
 .../controller/internal/BlueprintResourceProviderTest.java       | 2 +-
 2 files changed, 4 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/05549b27/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/BlueprintResourceProvider.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/BlueprintResourceProvider.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/BlueprintResourceProvider.java
index 1fa71ce..2cf01ff 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/BlueprintResourceProvider.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/BlueprintResourceProvider.java
@@ -84,6 +84,8 @@ public class BlueprintResourceProvider extends BaseBlueprintProcessor {
   protected static final String CONFIGURATION_PROPERTY_ID = "configurations";
   protected static final String PROPERTIES_PROPERTY_ID = "properties";
   protected static final String PROPERTIES_ATTRIBUTES_PROPERTY_ID = "properties_attributes";
+  protected static final String SCHEMA_IS_NOT_SUPPORTED_MESSAGE =
+      "Configuration format provided in Blueprint is not supported";
 
   // Primary Key Fields
   private static Set<String> pkPropertyIds =
@@ -528,7 +530,7 @@ public class BlueprintResourceProvider extends BaseBlueprintProcessor {
           || (levels == 4 && PROPERTIES_ATTRIBUTES_PROPERTY_ID.equals(propertiesType))) {
         return new BlueprintConfigPopulationStrategyV2();
       } else {
-        throw new IllegalArgumentException("Configuration format provided in Blueprint is not supported");
+        throw new IllegalArgumentException(SCHEMA_IS_NOT_SUPPORTED_MESSAGE);
       }
     } else {
       return new BlueprintConfigPopulationStrategyV2();

http://git-wip-us.apache.org/repos/asf/ambari/blob/05549b27/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/BlueprintResourceProviderTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/BlueprintResourceProviderTest.java b/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/BlueprintResourceProviderTest.java
index 3f732f8..84cc2a9 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/BlueprintResourceProviderTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/BlueprintResourceProviderTest.java
@@ -1468,7 +1468,7 @@ public class BlueprintResourceProviderTest {
     Map<String, String> configMap = new HashMap<String, String>();
     configMap.put("global/properties/lot/nagios_contact", "foo@ffl.dsfds");
     expectedException.expect(IllegalArgumentException.class);
-    expectedException.expectMessage("Configuration definition schema is not supported");
+    expectedException.expectMessage(provider.SCHEMA_IS_NOT_SUPPORTED_MESSAGE);
 
     provider.decidePopulationStrategy(configMap);
   }