You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@atlas.apache.org by ma...@apache.org on 2017/09/21 22:19:39 UTC

atlas git commit: ATLAS-2158: good coding practices

Repository: atlas
Updated Branches:
  refs/heads/branch-0.8 59d3d3eea -> 3d2f65ea7


ATLAS-2158: good coding practices

Signed-off-by: Madhan Neethiraj <ma...@apache.org>


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

Branch: refs/heads/branch-0.8
Commit: 3d2f65ea7d2b21462918b97d1307244142905be0
Parents: 59d3d3e
Author: Ashutosh Mestry <am...@apache.org>
Authored: Thu Sep 21 14:45:59 2017 -0700
Committer: Madhan Neethiraj <ma...@apache.org>
Committed: Thu Sep 21 14:45:59 2017 -0700

----------------------------------------------------------------------
 .../atlas/repository/impexp/ZipFileResourceTestUtils.java | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/atlas/blob/3d2f65ea/repository/src/test/java/org/apache/atlas/repository/impexp/ZipFileResourceTestUtils.java
----------------------------------------------------------------------
diff --git a/repository/src/test/java/org/apache/atlas/repository/impexp/ZipFileResourceTestUtils.java b/repository/src/test/java/org/apache/atlas/repository/impexp/ZipFileResourceTestUtils.java
index f0dab47..be8c004 100644
--- a/repository/src/test/java/org/apache/atlas/repository/impexp/ZipFileResourceTestUtils.java
+++ b/repository/src/test/java/org/apache/atlas/repository/impexp/ZipFileResourceTestUtils.java
@@ -75,6 +75,9 @@ public class ZipFileResourceTestUtils {
         File f = new File(filePath);
         String s = FileUtils.readFileToString(f);
         assertFalse(StringUtils.isEmpty(s), "Model file read correctly!");
+        if(StringUtils.isEmpty(s)) {
+            throw new IOException("Unable to read file: " + fileName);
+        }
 
         return s;
     }
@@ -138,9 +141,12 @@ public class ZipFileResourceTestUtils {
     }
 
     private static void createTypesAsNeeded(AtlasTypesDef typesFromJson, AtlasTypeDefStore typeDefStore, AtlasTypeRegistry typeRegistry) throws AtlasBaseException {
-        AtlasTypesDef typesToCreate = AtlasTypeDefStoreInitializer.getTypesToCreate(typesFromJson, typeRegistry);
+        if(typesFromJson == null) {
+            return;
+        }
 
-        if (!typesToCreate.isEmpty()) {
+        AtlasTypesDef typesToCreate = AtlasTypeDefStoreInitializer.getTypesToCreate(typesFromJson, typeRegistry);
+        if (typesToCreate != null && !typesToCreate.isEmpty()) {
             typeDefStore.createTypesDef(typesToCreate);
         }
     }