Commit 7828bdf5 by TJBChris

Added JSON reponse output as debug for easier debugging of response and

viewing of the output format.
parent dec14a89
...@@ -26,7 +26,6 @@ import com.tinkerpop.blueprints.Edge; ...@@ -26,7 +26,6 @@ import com.tinkerpop.blueprints.Edge;
import com.tinkerpop.blueprints.Graph; import com.tinkerpop.blueprints.Graph;
import com.tinkerpop.blueprints.Vertex; import com.tinkerpop.blueprints.Vertex;
import org.apache.commons.lang.StringUtils;
import org.apache.hadoop.metadata.MetadataException; import org.apache.hadoop.metadata.MetadataException;
import org.apache.hadoop.metadata.discovery.DiscoveryService; import org.apache.hadoop.metadata.discovery.DiscoveryService;
import org.apache.hadoop.metadata.repository.graph.GraphHelper; import org.apache.hadoop.metadata.repository.graph.GraphHelper;
...@@ -178,7 +177,7 @@ public class MetadataDiscoveryResource { ...@@ -178,7 +177,7 @@ public class MetadataDiscoveryResource {
throw new WebApplicationException( throw new WebApplicationException(
Servlets.getErrorResponse("Search: Error building JSON result set.", Response.Status.INTERNAL_SERVER_ERROR)); Servlets.getErrorResponse("Search: Error building JSON result set.", Response.Status.INTERNAL_SERVER_ERROR));
} }
LOG.debug("JSON result:" + response.toString());
return Response.ok(response).build(); return Response.ok(response).build();
} }
...@@ -239,7 +238,8 @@ public class MetadataDiscoveryResource { ...@@ -239,7 +238,8 @@ public class MetadataDiscoveryResource {
throw new WebApplicationException( throw new WebApplicationException(
Servlets.getErrorResponse("Search: Error building JSON result set.", Response.Status.INTERNAL_SERVER_ERROR)); Servlets.getErrorResponse("Search: Error building JSON result set.", Response.Status.INTERNAL_SERVER_ERROR));
} }
LOG.debug("JSON result:" + response.toString());
return Response.ok(response).build(); return Response.ok(response).build();
} }
......
...@@ -59,19 +59,18 @@ public class MetadataDiscoveryResourceIT extends BaseResourceIT { ...@@ -59,19 +59,18 @@ public class MetadataDiscoveryResourceIT extends BaseResourceIT {
} }
@Test (dependsOnMethods = "testFullTextUriExists", enabled = false) @Test (dependsOnMethods = "testFullTextUriExists")
public void testSearchForText() throws Exception { public void testSearchForText() throws Exception {
WebResource resource = service WebResource resource = service
.path("api/metadata/discovery/search/fulltext") .path("api/metadata/discovery/search/fulltext")
.queryParam("depth", "3").queryParam("text","serde1").queryParam("property","name"); .queryParam("depth", "3").queryParam("text","bar").queryParam("property","hive_table.name");
ClientResponse clientResponse = resource ClientResponse clientResponse = resource
.accept(MediaType.APPLICATION_JSON) .accept(MediaType.APPLICATION_JSON)
.type(MediaType.APPLICATION_JSON) .type(MediaType.APPLICATION_JSON)
.method(HttpMethod.GET, ClientResponse.class); .method(HttpMethod.GET, ClientResponse.class);
System.out.println(clientResponse.toString()); //TODO - Assure zero vertices and edges.
//TODO - Assure zero vertices and edges.
Assert.assertNotEquals(clientResponse.getStatus(), Response.Status.NOT_FOUND.getStatusCode()); Assert.assertNotEquals(clientResponse.getStatus(), Response.Status.NOT_FOUND.getStatusCode());
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment