当前位置: 首页>>代码示例>>Java>>正文


Java ODataServiceDocumentRequest类代码示例

本文整理汇总了Java中org.apache.olingo.client.api.communication.request.retrieve.ODataServiceDocumentRequest的典型用法代码示例。如果您正苦于以下问题:Java ODataServiceDocumentRequest类的具体用法?Java ODataServiceDocumentRequest怎么用?Java ODataServiceDocumentRequest使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


ODataServiceDocumentRequest类属于org.apache.olingo.client.api.communication.request.retrieve包,在下文中一共展示了ODataServiceDocumentRequest类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getEdmTest

import org.apache.olingo.client.api.communication.request.retrieve.ODataServiceDocumentRequest; //导入依赖的package包/类
@Test
public void getEdmTest() throws Exception {
  final ODataClient client = getODataClient();
  final String serviceUrl = getServiceUrl();
  final ODataServiceDocumentRequest reqeust =
      client.getRetrieveRequestFactory().getServiceDocumentRequest(serviceUrl);

  reqeust.setFormat(ContentType.APPLICATION_XML);

  final Edm redHelixEdm = readEdm(client, serviceUrl);

  Assert.assertEquals(1, redHelixEdm.getSchemas().size());

  for (EdmSchema schema : redHelixEdm.getSchemas()) {
    Assert.assertEquals(RED_HELIX_NAME_SPACE, schema.getNamespace());
  }
}
 
开发者ID:RedHelixOrg,项目名称:RedHelix-1,代码行数:18,代码来源:EdmTest.java

示例2: readServiceDocument

import org.apache.olingo.client.api.communication.request.retrieve.ODataServiceDocumentRequest; //导入依赖的package包/类
@Test
public void readServiceDocument() {
  ODataServiceDocumentRequest request = getClient().getRetrieveRequestFactory()
      .getServiceDocumentRequest(SERVICE_URI);
  assertNotNull(request);
  setCookieHeader(request);

  ODataRetrieveResponse<ClientServiceDocument> response = request.execute();
  saveCookieHeader(response);
  assertEquals(HttpStatusCode.OK.getStatusCode(), response.getStatusCode());

  ClientServiceDocument serviceDocument = response.getBody();
  assertNotNull(serviceDocument);
  assertThat(serviceDocument.getEntitySetNames(), hasItem(ES_ALL_PRIM));
  assertThat(serviceDocument.getFunctionImportNames(), hasItem("FICRTCollCTTwoPrim"));
  assertThat(serviceDocument.getSingletonNames(), hasItem("SIMedia"));
}
 
开发者ID:apache,项目名称:olingo-odata4,代码行数:18,代码来源:BasicITCase.java

示例3: readServiceDocument

import org.apache.olingo.client.api.communication.request.retrieve.ODataServiceDocumentRequest; //导入依赖的package包/类
@Test
public void readServiceDocument() throws Exception {
  ODataServiceDocumentRequest request = getClient().getRetrieveRequestFactory()
      .getServiceDocumentRequest(TecSvcConst.BASE_URI);
  setCookieHeader(request);
  ODataRetrieveResponse<ClientServiceDocument> response = request.execute();
  saveCookieHeader(response);
  assertEquals(HttpStatusCode.OK.getStatusCode(), response.getStatusCode());

  request = getClient().getRetrieveRequestFactory().getServiceDocumentRequest(TecSvcConst.BASE_URI);
  request.setIfNoneMatch(response.getETag());
  setCookieHeader(request);
  response = request.execute();
  saveCookieHeader(response);
  assertEquals(HttpStatusCode.NOT_MODIFIED.getStatusCode(), response.getStatusCode());

  request = getClient().getRetrieveRequestFactory().getServiceDocumentRequest(TecSvcConst.BASE_URI);
  request.setIfMatch("W/\"0\"");
  setCookieHeader(request);
  executeAndExpectError(request, HttpStatusCode.PRECONDITION_FAILED);
}
 
开发者ID:apache,项目名称:olingo-odata4,代码行数:22,代码来源:ConditionalITCase.java

示例4: getServiceDocumentRequest

import org.apache.olingo.client.api.communication.request.retrieve.ODataServiceDocumentRequest; //导入依赖的package包/类
@Override
public ODataServiceDocumentRequest getServiceDocumentRequest(final String serviceRoot) {
  return new ODataServiceDocumentRequestImpl(client,
      serviceRoot != null && !serviceRoot.isEmpty() && serviceRoot.endsWith("/") ?
          client.newURIBuilder(serviceRoot).build() :
          client.newURIBuilder(serviceRoot + '/').build());
}
 
开发者ID:apache,项目名称:olingo-odata4,代码行数:8,代码来源:RetrieveRequestFactoryImpl.java

示例5: testServiceReq

import org.apache.olingo.client.api.communication.request.retrieve.ODataServiceDocumentRequest; //导入依赖的package包/类
@Test
public void testServiceReq() {
	ODataServiceDocumentRequest serviceReq =
			client.getRetrieveRequestFactory().getServiceDocumentRequest(serviceRoot);
	ODataRetrieveResponse<ClientServiceDocument> serviceRes = serviceReq.execute();
	ClientServiceDocument serviceBody = serviceRes.getBody();		
	Collection<String> names = serviceBody.getEntitySetNames();
	assertFalse(names.isEmpty());
}
 
开发者ID:jbaliuka,项目名称:sql-analytic,代码行数:10,代码来源:SQLODataServletTest.java


注:本文中的org.apache.olingo.client.api.communication.request.retrieve.ODataServiceDocumentRequest类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。