@Test public void testFunctionResultStringScore() throws UnsupportedEncodingException { ODataUri execFunctionODataUri = new ODataUriParser(entityDataModel).parseUri(ODATA_ENDPOINT_URL + "ODataDemoFunctionImport"); ODataRequestContext oDataRequestContext = TestUtils.createODataRequestContext( createODataRequest(ODataRequest.Method.GET, XML), execFunctionODataUri, entityDataModel); int score = xmlValueRenderer.score(oDataRequestContext, QueryResult.from(TEST_BUILD_VERSION)); assertTrue(score > 0); }
@Override public int score(ODataRequestContext requestContext, QueryResult data) { if (!isNonEntityQuery(requestContext.getUri(), requestContext.getEntityDataModel())) { return DEFAULT_SCORE; } int operationScore = DEFAULT_SCORE; if (ODataUriUtil.isFunctionCallUri(requestContext.getUri()) || ODataUriUtil.isActionCallUri(requestContext.getUri())) { operationScore = DEFAULT_OPERATION_SCORE; } int returnScore = Math.max(super.score(requestContext, data), operationScore); LOG.debug("Renderer score is {}", returnScore); return returnScore; }
XMLValueRenderer extends AbstractAtomRenderer { @Override public int score(ODataRequestContext requestContext, QueryResult data) { if (!isNonEntityQuery(requestContext.getUri(), requestContext.getEntityDataModel())) { return DEFAULT_SCORE; } int operationScore = DEFAULT_SCORE; if (ODataUriUtil.isFunctionCallUri(requestContext.getUri()) || ODataUriUtil.isActionCallUri(requestContext.getUri())) { operationScore = DEFAULT_OPERATION_SCORE; } int returnScore = Math.max(super.score(requestContext, data), operationScore); LOG.debug("Renderer score is {}", returnScore); return returnScore; } }
XMLValueRenderer extends AbstractAtomRenderer { @Override public int score(ODataRequestContext requestContext, QueryResult data) { if (!isNonEntityQuery(requestContext.getUri(), requestContext.getEntityDataModel())) { return DEFAULT_SCORE; } int operationScore = DEFAULT_SCORE; if (ODataUriUtil.isFunctionCallUri(requestContext.getUri()) || ODataUriUtil.isActionCallUri(requestContext.getUri())) { operationScore = DEFAULT_OPERATION_SCORE; } int returnScore = Math.max(super.score(requestContext, data), operationScore); LOG.debug("Renderer score is {}", returnScore); return returnScore; }  }
XMLValueRenderer extends AbstractAtomRenderer { @Override public int score(ODataRequestContext requestContext, QueryResult data) { if (!isNonEntityQuery(requestContext.getUri(), requestContext.getEntityDataModel())) { return DEFAULT_SCORE; } int operationScore = DEFAULT_SCORE; if (ODataUriUtil.isFunctionCallUri(requestContext.getUri()) || ODataUriUtil.isActionCallUri(requestContext.getUri())) { operationScore = DEFAULT_OPERATION_SCORE; } int returnScore = Math.max(super.score(requestContext, data), operationScore); LOG.debug("Renderer score is {}", returnScore); return returnScore; }  @Override int score(ODataRequestContext requestContext, QueryResult data); @Override void render(ODataRequestContext requestContext, QueryResult data, ODataResponse.Builder responseBuilder); @Override ChunkedActionRenderResult renderStart(ODataRequestContext requestContext, QueryResult result,
                                                 OutputStream outputStream); @Override ChunkedActionRenderResult renderBody(ODataRequestContext requestContext, QueryResult result,
                                                ChunkedActionRenderResult previousResult); @Override void renderEnd(ODataRequestContext requestContext, QueryResult result,
                          ChunkedActionRenderResult previousResult); }
XMLValueRenderer extends AbstractAtomRenderer { @Override public int score(ODataRequestContext requestContext, QueryResult data) { if (!isNonEntityQuery(requestContext.getUri(), requestContext.getEntityDataModel())) { return DEFAULT_SCORE; } int operationScore = DEFAULT_SCORE; if (ODataUriUtil.isFunctionCallUri(requestContext.getUri()) || ODataUriUtil.isActionCallUri(requestContext.getUri())) { operationScore = DEFAULT_OPERATION_SCORE; } int returnScore = Math.max(super.score(requestContext, data), operationScore); LOG.debug("Renderer score is {}", returnScore); return returnScore; }  @Override int score(ODataRequestContext requestContext, QueryResult data); @Override void render(ODataRequestContext requestContext, QueryResult data, ODataResponse.Builder responseBuilder); @Override ChunkedActionRenderResult renderStart(ODataRequestContext requestContext, QueryResult result,
                                                 OutputStream outputStream); @Override ChunkedActionRenderResult renderBody(ODataRequestContext requestContext, QueryResult result,
                                                ChunkedActionRenderResult previousResult); @Override void renderEnd(ODataRequestContext requestContext, QueryResult result,
                          ChunkedActionRenderResult previousResult);  }