QueryResultResource { @GET @Produces(MediaType.APPLICATION_JSON) public Response getQueryResult(@HeaderParam(QueryResource.tajoSessionIdHeaderName) String sessionId) { if (LOG.isDebugEnabled()) { LOG.debug("Client sent a get query result request."); } Response response = null; try { initializeContext(); JerseyResourceDelegateContextKey<String> sessionIdKey = JerseyResourceDelegateContextKey.valueOf(sessionIdKeyName, String.class); context.put(sessionIdKey, sessionId); response = JerseyResourceDelegateUtil.runJerseyResourceDelegate( new GetQueryResultDelegate(), application, context, LOG); } catch (Throwable e) { LOG.error(e.getMessage(), e); response = ResourcesUtil.createExceptionResponse(null, e.getMessage()); } return response; }  UriInfo getUriInfo(); void setUriInfo(UriInfo uriInfo); Application getApplication(); void setApplication(Application application); String getDatabaseName(); void setDatabaseName(String databaseName); String getQueryId(); void setQueryId(String queryId); @GET @Produces(MediaType.APPLICATION_JSON) Response getQueryResult(@HeaderParam(QueryResource.tajoSessionIdHeaderName) String sessionId); @GET @Path("{cacheId}") @Produces(MediaType.APPLICATION_OCTET_STREAM) Response getQueryResultSet(@HeaderParam(QueryResource.tajoSessionIdHeaderName) String sessionId,
      @PathParam("cacheId") String cacheId,
      @DefaultValue("-1") @QueryParam("offset") int offset,
      @DefaultValue("-1") @QueryParam("count") int count);  }
@Test public void testGetQueryResult() throws Exception { String sessionId = generateNewSessionAndGetId(); URI queryIdURI = sendNewQueryResquest(sessionId, "select * from lineitem"); URI queryResultURI = new URI(queryIdURI + "/result"); GetQueryResultDataResponse response = restClient.target(queryResultURI) .request().header(tajoSessionIdHeaderName, sessionId) .get(new GenericType<GetQueryResultDataResponse>(GetQueryResultDataResponse.class)); assertNotNull(response); assertNotNull(response.getResultCode()); assertEquals(ResultCode.OK, response.getResultCode()); assertNotNull(response.getSchema()); assertEquals(16, response.getSchema().getRootColumns().size()); assertNotNull(response.getResultset()); assertTrue(response.getResultset().getId() != 0); assertNotNull(response.getResultset().getLink()); }