atlas-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From suma...@apache.org
Subject [1/2] incubator-atlas git commit: ATLAS-396 Creating an entity with non-existing type results in Unable to deserialize json error (guptaneeru via sumasai)
Date Mon, 22 Feb 2016 23:22:37 GMT
Repository: incubator-atlas
Updated Branches:
  refs/heads/master 95590d230 -> 3869b8a2f


ATLAS-396 Creating an entity with non-existing type results in Unable to deserialize json
error (guptaneeru via sumasai)


Project: http://git-wip-us.apache.org/repos/asf/incubator-atlas/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-atlas/commit/e181131d
Tree: http://git-wip-us.apache.org/repos/asf/incubator-atlas/tree/e181131d
Diff: http://git-wip-us.apache.org/repos/asf/incubator-atlas/diff/e181131d

Branch: refs/heads/master
Commit: e181131d35e92de4fa074ffe0a2f71ed95f49a72
Parents: 648c8d8
Author: Suma Shivaprasad <sumasai.shivaprasad@gmail.com>
Authored: Mon Feb 22 15:21:35 2016 -0800
Committer: Suma Shivaprasad <sumasai.shivaprasad@gmail.com>
Committed: Mon Feb 22 15:21:35 2016 -0800

----------------------------------------------------------------------
 release-log.txt                                          |  3 ++-
 .../apache/atlas/services/DefaultMetadataService.java    |  4 ++--
 .../apache/atlas/service/DefaultMetadataServiceTest.java | 11 +++++++++++
 3 files changed, 15 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-atlas/blob/e181131d/release-log.txt
----------------------------------------------------------------------
diff --git a/release-log.txt b/release-log.txt
index 52391ba..9ca9cc4 100644
--- a/release-log.txt
+++ b/release-log.txt
@@ -7,12 +7,13 @@ ATLAS-409 Atlas will not import avro tables with schema read from a file
(dosset
 ATLAS-379 Create sqoop and falcon metadata addons (venkatnrangan,bvellanki,sowmyaramesh via
shwethags)
 
 ALL CHANGES:
+ATLAS_396 Creating an entity with non-existing type results in "Unable to deserialize json"
error (guptaneeru via sumasai)
 ATLAS-318 Config file conatining API endpoint + all api calls to be centralized (sanjayp
via sumasai)
 ATLAS-471 Atlas Server could run out of memory due to Scala memory leak (yhemanth via sumasai)
 ATLAS-486 Updated pom.xml to fix scm url and upgrade plugin (sneethiraj via sumasai)
 ATLAS-457 Upgrade to 0.9 version of Kafka dependency (yhemanth via shwethags)
 ATLAS-398 Delete trait that exists but not linked to entity results in "400 Bad request".
It should result "404 not found" (ndjouhr via shwethags)
-ATLAS-287: UI: GUID on table details page
+ATLAS-287 UI: GUID on table details page (anilsg via sumasai)
 ATLAS-372 Expose entity deletion through REST API (dkantor via shwethags)
 ATLAS-452 Exceptions while running HiveHookIT#testAlterTableRename (shwethags)
 ATLAS-388 UI : On creating Tag, the page to be reset for creating new Tag (Anilg via shwethags)

http://git-wip-us.apache.org/repos/asf/incubator-atlas/blob/e181131d/repository/src/main/java/org/apache/atlas/services/DefaultMetadataService.java
----------------------------------------------------------------------
diff --git a/repository/src/main/java/org/apache/atlas/services/DefaultMetadataService.java
b/repository/src/main/java/org/apache/atlas/services/DefaultMetadataService.java
index 2de8e50..889e200 100755
--- a/repository/src/main/java/org/apache/atlas/services/DefaultMetadataService.java
+++ b/repository/src/main/java/org/apache/atlas/services/DefaultMetadataService.java
@@ -309,11 +309,11 @@ public class DefaultMetadataService implements MetadataService {
                 instances[index] = typedInstrance;
             }
             return instances;
-        } catch(ValueConversionException e) {
+        } catch(ValueConversionException | TypeNotFoundException  e) {
             throw e;
         } catch (Exception e) {  // exception from deserializer
             LOG.error("Unable to deserialize json={}", entityInstanceDefinition, e);
-            throw new IllegalArgumentException("Unable to deserialize json");
+            throw new IllegalArgumentException("Unable to deserialize json", e);
         }
     }
 

http://git-wip-us.apache.org/repos/asf/incubator-atlas/blob/e181131d/repository/src/test/java/org/apache/atlas/service/DefaultMetadataServiceTest.java
----------------------------------------------------------------------
diff --git a/repository/src/test/java/org/apache/atlas/service/DefaultMetadataServiceTest.java
b/repository/src/test/java/org/apache/atlas/service/DefaultMetadataServiceTest.java
index ea0d8e8..d00f12e 100644
--- a/repository/src/test/java/org/apache/atlas/service/DefaultMetadataServiceTest.java
+++ b/repository/src/test/java/org/apache/atlas/service/DefaultMetadataServiceTest.java
@@ -165,6 +165,17 @@ public class DefaultMetadataServiceTest {
         entity.set("type", "VARCHAR(32)");
         return entity;
     }
+
+    @Test(expectedExceptions = TypeNotFoundException.class)
+    public void testCreateEntityWithUnknownDatatype() throws Exception {
+        Referenceable entity = new Referenceable("Unknown datatype");
+        String dbName = RandomStringUtils.randomAlphanumeric(10);
+        entity.set("name", dbName);
+        entity.set("description", "us db");
+        createInstance(entity);
+        Assert.fail(TypeNotFoundException.class.getSimpleName() +" was expected but none
thrown.");
+    }
+
     @Test
     public void testCreateEntityWithUniqueAttribute() throws Exception {
         //name is the unique attribute


Mime
View raw message