atlas-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From shweth...@apache.org
Subject incubator-atlas git commit: ATLAS-45 Entity submit fails (suma.shivaprasad via shwethags)
Date Tue, 21 Jul 2015 07:31:11 GMT
Repository: incubator-atlas
Updated Branches:
  refs/heads/master 414816720 -> 5e00edea2


ATLAS-45 Entity submit fails (suma.shivaprasad via shwethags)


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

Branch: refs/heads/master
Commit: 5e00edea2967ce944ad025211aacc531f451729d
Parents: 4148167
Author: Shwetha GS <sshivalingamurthy@hortonworks.com>
Authored: Tue Jul 21 13:01:05 2015 +0530
Committer: Shwetha GS <sshivalingamurthy@hortonworks.com>
Committed: Tue Jul 21 13:01:05 2015 +0530

----------------------------------------------------------------------
 release-log.txt                                           |  1 +
 .../java/org/apache/atlas/typesystem/types/DataTypes.java | 10 +++++++++-
 .../atlas/web/resources/EntityJerseyResourceIT.java       |  4 ++--
 3 files changed, 12 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-atlas/blob/5e00edea/release-log.txt
----------------------------------------------------------------------
diff --git a/release-log.txt b/release-log.txt
index 0cc6540..912632e 100644
--- a/release-log.txt
+++ b/release-log.txt
@@ -8,6 +8,7 @@ ATLAS-54 Rename configs in hive hook (shwethags)
 ATLAS-3 Mixed Index creation fails with Date types (suma.shivaprasad via shwethags)
 
 ALL CHANGES:
+ATLAS-45 Entity submit fails (suma.shivaprasad via shwethags)
 ATLAS-46 Different data directory with restart (shwethags)
 ATLAS-81 atlas debian packaing fails in maven build (vijay_k via shwethags)
 ATLAS-36 Need separate persisted properties for HTTP and HTTPS ports (jmaron)

http://git-wip-us.apache.org/repos/asf/incubator-atlas/blob/5e00edea/typesystem/src/main/java/org/apache/atlas/typesystem/types/DataTypes.java
----------------------------------------------------------------------
diff --git a/typesystem/src/main/java/org/apache/atlas/typesystem/types/DataTypes.java b/typesystem/src/main/java/org/apache/atlas/typesystem/types/DataTypes.java
index 5fc6c1b..e35453e 100755
--- a/typesystem/src/main/java/org/apache/atlas/typesystem/types/DataTypes.java
+++ b/typesystem/src/main/java/org/apache/atlas/typesystem/types/DataTypes.java
@@ -87,6 +87,14 @@ public class DataTypes {
 
         public abstract T nullValue();
 
+        @Override
+        protected T convertNull(Multiplicity m) throws AtlasException {
+            if (!m.nullAllowed()) {
+                throw new ValueConversionException.NullConversionException(m);
+            }
+
+            return nullValue();
+        }
     }
 
     public static class BooleanType extends PrimitiveType<Boolean> {
@@ -455,7 +463,7 @@ public class DataTypes {
 
         @Override
         public String convert(Object val, Multiplicity m) throws AtlasException {
-            if (val != null && (!(val instanceof String) || StringUtils.isNotBlank((CharSequence)
val))) {
+            if (val != null && (!(val instanceof String) || StringUtils.isNotEmpty((CharSequence)
val))) {
                 return val.toString();
             }
             return convertNull(m);

http://git-wip-us.apache.org/repos/asf/incubator-atlas/blob/5e00edea/webapp/src/test/java/org/apache/atlas/web/resources/EntityJerseyResourceIT.java
----------------------------------------------------------------------
diff --git a/webapp/src/test/java/org/apache/atlas/web/resources/EntityJerseyResourceIT.java
b/webapp/src/test/java/org/apache/atlas/web/resources/EntityJerseyResourceIT.java
index 9e28383..7361173 100755
--- a/webapp/src/test/java/org/apache/atlas/web/resources/EntityJerseyResourceIT.java
+++ b/webapp/src/test/java/org/apache/atlas/web/resources/EntityJerseyResourceIT.java
@@ -98,7 +98,7 @@ public class EntityJerseyResourceIT extends BaseResourceIT {
 
     @DataProvider
     public Object[][] invalidAttrValues() {
-        return new Object[][]{{null}, {""}, {" "}};
+        return new Object[][]{{null}, {""}};
     }
 
     @Test(dataProvider = "invalidAttrValues")
@@ -109,7 +109,7 @@ public class EntityJerseyResourceIT extends BaseResourceIT {
 
         try {
             createInstance(databaseInstance);
-            Assert.fail("Exptected MetadataServiceException");
+            Assert.fail("Expected AtlasServiceException");
         } catch (AtlasServiceException e) {
             Assert.assertEquals(e.getStatus(), ClientResponse.Status.BAD_REQUEST);
         }


Mime
View raw message