atlas-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mad...@apache.org
Subject incubator-atlas git commit: ATLAS-1516: fix unit test failure in DefaultMetadataServiceTest.testSpecialCharacters()
Date Wed, 01 Feb 2017 19:23:27 GMT
Repository: incubator-atlas
Updated Branches:
  refs/heads/master 5d8fae555 -> f640da721


ATLAS-1516: fix unit test failure in DefaultMetadataServiceTest.testSpecialCharacters()


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

Branch: refs/heads/master
Commit: f640da72112cd2647b6dee5a5ac498b360a83ee3
Parents: 5d8fae5
Author: Madhan Neethiraj <madhan@apache.org>
Authored: Wed Feb 1 08:34:17 2017 -0800
Committer: Madhan Neethiraj <madhan@apache.org>
Committed: Wed Feb 1 09:50:54 2017 -0800

----------------------------------------------------------------------
 .../org/apache/atlas/service/DefaultMetadataServiceTest.java     | 4 ++--
 .../src/main/java/org/apache/atlas/typesystem/Referenceable.java | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-atlas/blob/f640da72/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 aa1cdaa..03ef4fe 100644
--- a/repository/src/test/java/org/apache/atlas/service/DefaultMetadataServiceTest.java
+++ b/repository/src/test/java/org/apache/atlas/service/DefaultMetadataServiceTest.java
@@ -215,7 +215,7 @@ public class DefaultMetadataServiceTest {
         //verify that entity can be created with reserved characters in string value, array
value and map key and value
         Referenceable entity = new Referenceable(typeDefinition.typeName);
         entity.set(strAttrName, randomStrWithReservedChars());
-        entity.set(arrayAttrName, new String[]{randomStrWithReservedChars()});
+        entity.set(arrayAttrName, new ArrayList<String>() {{ add(randomStrWithReservedChars());
}});
         entity.set(mapAttrName, new HashMap<String, String>() {{
             put(randomStrWithReservedChars(), randomStrWithReservedChars());
         }});
@@ -244,7 +244,7 @@ public class DefaultMetadataServiceTest {
 
         Referenceable newActual = new Referenceable(expected.getId(), actual.getTypeName(),
actual.getValuesMap(),
                 traits, traitsMap);
-        assertEquals(InstanceSerialization.toJson(newActual, true), InstanceSerialization.toJson(expected,
true));
+        assertEquals(newActual, expected);
     }
 
     private String randomStrWithReservedChars() {

http://git-wip-us.apache.org/repos/asf/incubator-atlas/blob/f640da72/typesystem/src/main/java/org/apache/atlas/typesystem/Referenceable.java
----------------------------------------------------------------------
diff --git a/typesystem/src/main/java/org/apache/atlas/typesystem/Referenceable.java b/typesystem/src/main/java/org/apache/atlas/typesystem/Referenceable.java
index 401df5f..8cad2f8 100755
--- a/typesystem/src/main/java/org/apache/atlas/typesystem/Referenceable.java
+++ b/typesystem/src/main/java/org/apache/atlas/typesystem/Referenceable.java
@@ -162,7 +162,7 @@ public class Referenceable extends Struct implements IReferenceableInstance
{
     @Override
     public boolean equals(Object o) {
         if (this == o) return true;
-        if (o == null || getClass() != o.getClass()) return false;
+        if (o == null || getClass() != o.getClass() || !super.equalsContents(o)) return false;
         Referenceable that = (Referenceable) o;
         return Objects.equals(id, that.id) &&
                 Objects.equals(traits, that.traits) &&


Mime
View raw message