knox-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From m...@apache.org
Subject knox git commit: KNOX-1124 - Service Discovery Doesn't Work For Simple Descriptors With .yaml Extension (Phil Zampino via Sandeep More)
Date Fri, 01 Dec 2017 18:42:31 GMT
Repository: knox
Updated Branches:
  refs/heads/v0.14.0 f2c17d917 -> 9e6b32851


KNOX-1124 - Service Discovery Doesn't Work For Simple Descriptors With .yaml Extension (Phil
Zampino  via Sandeep More)


Project: http://git-wip-us.apache.org/repos/asf/knox/repo
Commit: http://git-wip-us.apache.org/repos/asf/knox/commit/9e6b3285
Tree: http://git-wip-us.apache.org/repos/asf/knox/tree/9e6b3285
Diff: http://git-wip-us.apache.org/repos/asf/knox/diff/9e6b3285

Branch: refs/heads/v0.14.0
Commit: 9e6b32851abb99fec4660a3f21927024660779bc
Parents: f2c17d9
Author: Sandeep More <more@apache.org>
Authored: Fri Dec 1 13:28:56 2017 -0500
Committer: Sandeep More <more@apache.org>
Committed: Fri Dec 1 13:28:56 2017 -0500

----------------------------------------------------------------------
 .../topology/simple/SimpleDescriptorFactory.java       |  2 +-
 .../topology/simple/SimpleDescriptorFactoryTest.java   | 13 +++++++++++--
 2 files changed, 12 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/knox/blob/9e6b3285/gateway-server/src/main/java/org/apache/hadoop/gateway/topology/simple/SimpleDescriptorFactory.java
----------------------------------------------------------------------
diff --git a/gateway-server/src/main/java/org/apache/hadoop/gateway/topology/simple/SimpleDescriptorFactory.java
b/gateway-server/src/main/java/org/apache/hadoop/gateway/topology/simple/SimpleDescriptorFactory.java
index 3df6d2f..2192eef 100644
--- a/gateway-server/src/main/java/org/apache/hadoop/gateway/topology/simple/SimpleDescriptorFactory.java
+++ b/gateway-server/src/main/java/org/apache/hadoop/gateway/topology/simple/SimpleDescriptorFactory.java
@@ -39,7 +39,7 @@ public class SimpleDescriptorFactory {
 
         if (path.endsWith(".json")) {
             sd = parseJSON(path);
-        } else if (path.endsWith(".yml")) {
+        } else if (path.endsWith(".yml") || path.endsWith(".yaml")) {
             sd = parseYAML(path);
         } else {
            throw new IllegalArgumentException("Unsupported simple descriptor format: " +
path.substring(path.lastIndexOf('.')));

http://git-wip-us.apache.org/repos/asf/knox/blob/9e6b3285/gateway-server/src/test/java/org/apache/hadoop/gateway/topology/simple/SimpleDescriptorFactoryTest.java
----------------------------------------------------------------------
diff --git a/gateway-server/src/test/java/org/apache/hadoop/gateway/topology/simple/SimpleDescriptorFactoryTest.java
b/gateway-server/src/test/java/org/apache/hadoop/gateway/topology/simple/SimpleDescriptorFactoryTest.java
index 129ff7c..7c42542 100644
--- a/gateway-server/src/test/java/org/apache/hadoop/gateway/topology/simple/SimpleDescriptorFactoryTest.java
+++ b/gateway-server/src/test/java/org/apache/hadoop/gateway/topology/simple/SimpleDescriptorFactoryTest.java
@@ -29,7 +29,8 @@ public class SimpleDescriptorFactoryTest {
 
     private enum FileType {
         JSON,
-        YAML
+        YAML,
+        YML
     }
 
     @Test
@@ -39,6 +40,7 @@ public class SimpleDescriptorFactoryTest {
 
     @Test
     public void testParseYAMLSimpleDescriptor() throws Exception {
+        testParseSimpleDescriptor(FileType.YML);
         testParseSimpleDescriptor(FileType.YAML);
     }
 
@@ -49,6 +51,7 @@ public class SimpleDescriptorFactoryTest {
 
     @Test
     public void testParseYAMLSimpleDescriptorWithServiceParams() throws Exception {
+        testParseSimpleDescriptorWithServiceParams(FileType.YML);
         testParseSimpleDescriptorWithServiceParams(FileType.YAML);
     }
 
@@ -59,6 +62,7 @@ public class SimpleDescriptorFactoryTest {
 
     @Test
     public void testParseYAMLSimpleDescriptorApplications() throws Exception {
+        testParseSimpleDescriptorWithApplications(FileType.YML);
         testParseSimpleDescriptorWithApplications(FileType.YAML);
     }
 
@@ -70,6 +74,7 @@ public class SimpleDescriptorFactoryTest {
 
     @Test
     public void testParseYAMLSimpleDescriptorWithServicesAndApplications() throws Exception
{
+        testParseSimpleDescriptorWithServicesAndApplications(FileType.YML);
         testParseSimpleDescriptorWithServicesAndApplications(FileType.YAML);
     }
 
@@ -327,9 +332,12 @@ public class SimpleDescriptorFactoryTest {
             case JSON:
                 extension = "json";
                 break;
-            case YAML:
+            case YML:
                 extension = "yml";
                 break;
+            case YAML:
+                extension = "yaml";
+                break;
         }
         return extension;
     }
@@ -402,6 +410,7 @@ public class SimpleDescriptorFactoryTest {
                                    appParams);
                 break;
             case YAML:
+            case YML:
                 result = writeYAML(path,
                                    discoveryType,
                                    discoveryAddress,


Mime
View raw message