You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@atlas.apache.org by su...@apache.org on 2016/12/09 00:04:23 UTC
incubator-atlas git commit: ATLAS-1357: NPE Fix for search filter
changes & callAPI related fixes
Repository: incubator-atlas
Updated Branches:
refs/heads/master 28410df5f -> d9d487bc3
ATLAS-1357: NPE Fix for search filter changes & callAPI related fixes
Project: http://git-wip-us.apache.org/repos/asf/incubator-atlas/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-atlas/commit/d9d487bc
Tree: http://git-wip-us.apache.org/repos/asf/incubator-atlas/tree/d9d487bc
Diff: http://git-wip-us.apache.org/repos/asf/incubator-atlas/diff/d9d487bc
Branch: refs/heads/master
Commit: d9d487bc33b4711d483490ccaaf17aabf5c480aa
Parents: 28410df
Author: apoorvnaik <an...@hortonworks.com>
Authored: Thu Dec 8 08:22:09 2016 -0800
Committer: Suma Shivaprasad <su...@gmail.com>
Committed: Thu Dec 8 15:51:45 2016 -0800
----------------------------------------------------------------------
.../main/java/org/apache/atlas/model/SearchFilter.java | 8 +++++++-
release-log.txt | 1 +
.../atlas/web/resources/EntityJerseyResourceIT.java | 6 +++---
.../apache/atlas/web/resources/TypesJerseyResourceIT.java | 10 +++++-----
4 files changed, 16 insertions(+), 9 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-atlas/blob/d9d487bc/intg/src/main/java/org/apache/atlas/model/SearchFilter.java
----------------------------------------------------------------------
diff --git a/intg/src/main/java/org/apache/atlas/model/SearchFilter.java b/intg/src/main/java/org/apache/atlas/model/SearchFilter.java
index 677726b..93e89c8 100644
--- a/intg/src/main/java/org/apache/atlas/model/SearchFilter.java
+++ b/intg/src/main/java/org/apache/atlas/model/SearchFilter.java
@@ -73,7 +73,13 @@ public class SearchFilter {
}
public String getParam(String name) {
- return getParams(name).get(0);
+ String ret = null;
+
+ if (name != null && params != null) {
+ ret = params.getFirst(name);
+ }
+
+ return ret;
}
public List<String> getParams(String name) {
http://git-wip-us.apache.org/repos/asf/incubator-atlas/blob/d9d487bc/release-log.txt
----------------------------------------------------------------------
diff --git a/release-log.txt b/release-log.txt
index 02fe03b..eec5a0f 100644
--- a/release-log.txt
+++ b/release-log.txt
@@ -9,6 +9,7 @@ ATLAS-1060 Add composite indexes for exact match performance improvements for al
ATLAS-1127 Modify creation and modification timestamps to Date instead of Long(sumasai)
ALL CHANGES:
+ATLAS-1358 NPE Fix for search filter changes & callAPI related fixes (apoorvnaik via sumasai)
ATLAS-1357: Fixes for test failures from ATLAS-1307 (apoorvnaik via sumasai)
ATLAS-1307: Integration test calls routing via the Client. (apoorvnaik via sumasai)
ATLAS-1355: Fix for bad error translation from V2 API (apoorvnaik via sumasai)
http://git-wip-us.apache.org/repos/asf/incubator-atlas/blob/d9d487bc/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 1de7d65..b5af111 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
@@ -429,10 +429,10 @@ public class EntityJerseyResourceIT extends BaseResourceIT {
@Test(expectedExceptions = AtlasServiceException.class)
public void testGetEntityListForBadEntityType() throws Exception {
- Map<String, String> queryParams = new HashMap<>();
- queryParams.put("type", "blah");
+ MultivaluedMap<String, String> queryParams = new MultivaluedMapImpl();
+ queryParams.add("type", "blah");
- JSONObject response = serviceClient.callAPIWithBody(AtlasClient.API.GET_ENTITY, queryParams);
+ JSONObject response = serviceClient.callAPIWithQueryParams(AtlasClient.API.GET_ENTITY, queryParams);
assertNotNull(response);
Assert.assertNotNull(response.get(AtlasClient.ERROR));
Assert.assertNotNull(response.get(AtlasClient.STACKTRACE));
http://git-wip-us.apache.org/repos/asf/incubator-atlas/blob/d9d487bc/webapp/src/test/java/org/apache/atlas/web/resources/TypesJerseyResourceIT.java
----------------------------------------------------------------------
diff --git a/webapp/src/test/java/org/apache/atlas/web/resources/TypesJerseyResourceIT.java b/webapp/src/test/java/org/apache/atlas/web/resources/TypesJerseyResourceIT.java
index db89d21..87bf9a8 100755
--- a/webapp/src/test/java/org/apache/atlas/web/resources/TypesJerseyResourceIT.java
+++ b/webapp/src/test/java/org/apache/atlas/web/resources/TypesJerseyResourceIT.java
@@ -20,6 +20,7 @@ package org.apache.atlas.web.resources;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableSet;
+import com.sun.jersey.core.util.MultivaluedMapImpl;
import org.apache.atlas.AtlasClient;
import org.apache.atlas.AtlasServiceException;
import org.apache.atlas.typesystem.TypesDef;
@@ -41,12 +42,11 @@ import org.testng.annotations.AfterClass;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;
+import javax.ws.rs.core.MultivaluedMap;
import javax.ws.rs.core.Response;
import java.util.ArrayList;
import java.util.Arrays;
-import java.util.HashMap;
import java.util.List;
-import java.util.Map;
import static org.apache.atlas.typesystem.types.utils.TypesUtil.createOptionalAttrDef;
import static org.testng.Assert.assertEquals;
@@ -187,10 +187,10 @@ public class TypesJerseyResourceIT extends BaseResourceIT {
public void testGetTraitNames() throws Exception {
String[] traitsAdded = addTraits();
- Map<String, String> queryParams = new HashMap<>();
- queryParams.put("type", DataTypes.TypeCategory.TRAIT.name());
+ MultivaluedMap<String, String> queryParams = new MultivaluedMapImpl();
+ queryParams.add("type", DataTypes.TypeCategory.TRAIT.name());
- JSONObject response = serviceClient.callAPIWithBody(AtlasClient.API.LIST_TYPES, queryParams);
+ JSONObject response = serviceClient.callAPIWithQueryParams(AtlasClient.API.LIST_TYPES, queryParams);
Assert.assertNotNull(response);
Assert.assertNotNull(response.get(AtlasClient.REQUEST_ID));