@Test(expected = ODataSystemException.class) public void testRenderException() throws ODataException, UnsupportedEncodingException { prepareRequestContextRenderException(GET, createODataUriForServiceDocument(XML)); serviceDocumentRenderer.render(context, null, responseBuilderMock); }
@Override public void render(ODataRequestContext requestContext, QueryResult data, ODataResponse.Builder responseBuilder) throws ODataException { LOG.debug("Start rendering service document for request: {}", requestContext); XMLServiceDocumentWriter writer = new XMLServiceDocumentWriter(requestContext.getUri(), requestContext.getEntityDataModel()); String serviceDocument = writer.buildServiceDocument(); try { responseBuilder .setContentType(XML) .setHeader("OData-Version", ODATA_VERSION_HEADER) .setBodyText(serviceDocument, StandardCharsets.UTF_8.name()); } catch (UnsupportedEncodingException e) { throw new ODataSystemException(e); } LOG.debug("End rendering service document for request: {}", requestContext); }
XMLServiceDocumentRenderer extends ServiceDocumentRenderer { @Override public void render(ODataRequestContext requestContext, QueryResult data, ODataResponse.Builder responseBuilder) throws ODataException { LOG.debug("Start rendering service document for request: {}", requestContext); XMLServiceDocumentWriter writer = new XMLServiceDocumentWriter(requestContext.getUri(), requestContext.getEntityDataModel()); String serviceDocument = writer.buildServiceDocument(); try { responseBuilder .setContentType(XML) .setHeader("OData-Version", ODATA_VERSION_HEADER) .setBodyText(serviceDocument, StandardCharsets.UTF_8.name()); } catch (UnsupportedEncodingException e) { throw new ODataSystemException(e); } LOG.debug("End rendering service document for request: {}", requestContext); } }
XMLServiceDocumentRenderer extends ServiceDocumentRenderer { @Override public void render(ODataRequestContext requestContext, QueryResult data, ODataResponse.Builder responseBuilder) throws ODataException { LOG.debug("Start rendering service document for request: {}", requestContext); XMLServiceDocumentWriter writer = new XMLServiceDocumentWriter(requestContext.getUri(), requestContext.getEntityDataModel()); String serviceDocument = writer.buildServiceDocument(); try { responseBuilder .setContentType(XML) .setHeader("OData-Version", ODATA_VERSION_HEADER) .setBodyText(serviceDocument, StandardCharsets.UTF_8.name()); } catch (UnsupportedEncodingException e) { throw new ODataSystemException(e); } LOG.debug("End rendering service document for request: {}", requestContext); }  }
XMLServiceDocumentRenderer extends ServiceDocumentRenderer { @Override public void render(ODataRequestContext requestContext, QueryResult data, ODataResponse.Builder responseBuilder) throws ODataException { LOG.debug("Start rendering service document for request: {}", requestContext); XMLServiceDocumentWriter writer = new XMLServiceDocumentWriter(requestContext.getUri(), requestContext.getEntityDataModel()); String serviceDocument = writer.buildServiceDocument(); try { responseBuilder .setContentType(XML) .setHeader("OData-Version", ODATA_VERSION_HEADER) .setBodyText(serviceDocument, StandardCharsets.UTF_8.name()); } catch (UnsupportedEncodingException e) { throw new ODataSystemException(e); } LOG.debug("End rendering service document for request: {}", requestContext); }  @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); }
XMLServiceDocumentRenderer extends ServiceDocumentRenderer { @Override public void render(ODataRequestContext requestContext, QueryResult data, ODataResponse.Builder responseBuilder) throws ODataException { LOG.debug("Start rendering service document for request: {}", requestContext); XMLServiceDocumentWriter writer = new XMLServiceDocumentWriter(requestContext.getUri(), requestContext.getEntityDataModel()); String serviceDocument = writer.buildServiceDocument(); try { responseBuilder .setContentType(XML) .setHeader("OData-Version", ODATA_VERSION_HEADER) .setBodyText(serviceDocument, StandardCharsets.UTF_8.name()); } catch (UnsupportedEncodingException e) { throw new ODataSystemException(e); } LOG.debug("End rendering service document for request: {}", requestContext); }  @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);  }