You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@olingo.apache.org by sk...@apache.org on 2014/07/08 10:28:20 UTC

[10/15] git commit: [OLINGO-337] BasicITCase

[OLINGO-337] BasicITCase


Project: http://git-wip-us.apache.org/repos/asf/olingo-odata4/repo
Commit: http://git-wip-us.apache.org/repos/asf/olingo-odata4/commit/32c113df
Tree: http://git-wip-us.apache.org/repos/asf/olingo-odata4/tree/32c113df
Diff: http://git-wip-us.apache.org/repos/asf/olingo-odata4/diff/32c113df

Branch: refs/heads/master
Commit: 32c113df0b88069f130c6ebb4d40cb8f54149579
Parents: f464091
Author: Stephan Klevenz <st...@sap.com>
Authored: Fri Jul 4 08:38:08 2014 +0200
Committer: Stephan Klevenz <st...@sap.com>
Committed: Fri Jul 4 12:21:01 2014 +0200

----------------------------------------------------------------------
 .../org/apache/olingo/fit/tecsvc/BasicITCase.java     | 14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/32c113df/fit/src/test/java/org/apache/olingo/fit/tecsvc/BasicITCase.java
----------------------------------------------------------------------
diff --git a/fit/src/test/java/org/apache/olingo/fit/tecsvc/BasicITCase.java b/fit/src/test/java/org/apache/olingo/fit/tecsvc/BasicITCase.java
index 8c5650f..c188568 100644
--- a/fit/src/test/java/org/apache/olingo/fit/tecsvc/BasicITCase.java
+++ b/fit/src/test/java/org/apache/olingo/fit/tecsvc/BasicITCase.java
@@ -20,6 +20,7 @@ package org.apache.olingo.fit.tecsvc;
 
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
 
 import org.apache.olingo.client.api.communication.request.retrieve.EdmMetadataRequest;
 import org.apache.olingo.client.api.communication.request.retrieve.ODataServiceDocumentRequest;
@@ -41,6 +42,7 @@ public class BasicITCase {
   @Before
   public void before() {
     odata = ODataClientFactory.getV4();
+    odata.getConfiguration().setDefaultPubFormat(ODataFormat.JSON);
   }
 
   @Test
@@ -49,8 +51,17 @@ public class BasicITCase {
             odata.getRetrieveRequestFactory().getServiceDocumentRequest(REF_SERVICE);
     request.setAccept("application/json;odata.metadata=minimal");
     assertNotNull(request);
-    ODataServiceDocument serviceDocument = request.execute().getBody();
+
+    ODataRetrieveResponse<ODataServiceDocument> response = request.execute();
+
+    assertEquals(200, response.getStatusCode());
+
+    ODataServiceDocument serviceDocument = response.getBody();
     assertNotNull(serviceDocument);
+
+    assertTrue(serviceDocument.getEntitySetNames().contains("ESAllPrim"));
+    assertTrue(serviceDocument.getFunctionImportNames().contains("FICRTCollCTTwoPrim"));
+    assertTrue(serviceDocument.getSingletonNames().contains("SIMedia"));
   }
 
   @Test
@@ -66,5 +77,6 @@ public class BasicITCase {
     assertEquals("com.sap.odata.test1", edm.getSchema("com.sap.odata.test1").getNamespace());
     assertEquals("Namespace1_Alias", edm.getSchema("com.sap.odata.test1").getAlias());
     assertNotNull(edm.getTerm(new FullQualifiedName("Core.Description")));
+    assertEquals(2, edm.getSchemas().size());
   }
 }