olingo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chri...@apache.org
Subject [3/5] olingo-odata4 git commit: [OLINGO-1004] Deleted Complex Tests
Date Fri, 12 Aug 2016 10:03:18 GMT
[OLINGO-1004] Deleted Complex Tests

Duplicated in PrimitiveComplexITCase


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

Branch: refs/heads/master
Commit: bed8b4d02be15561f083abc22eb9f8e461c6de7a
Parents: af63c4f
Author: Christian Amend <christian.amend@sap.com>
Authored: Fri Aug 12 11:53:17 2016 +0200
Committer: Christian Amend <christian.amend@sap.com>
Committed: Fri Aug 12 11:53:17 2016 +0200

----------------------------------------------------------------------
 .../olingo/fit/base/PropertyTestITCase.java     | 121 -------------------
 1 file changed, 121 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/bed8b4d0/fit/src/test/java/org/apache/olingo/fit/base/PropertyTestITCase.java
----------------------------------------------------------------------
diff --git a/fit/src/test/java/org/apache/olingo/fit/base/PropertyTestITCase.java b/fit/src/test/java/org/apache/olingo/fit/base/PropertyTestITCase.java
index e16d9ea..525e5d5 100644
--- a/fit/src/test/java/org/apache/olingo/fit/base/PropertyTestITCase.java
+++ b/fit/src/test/java/org/apache/olingo/fit/base/PropertyTestITCase.java
@@ -21,24 +21,12 @@ package org.apache.olingo.fit.base;
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertNotNull;
 
-import java.io.IOException;
-
 import org.apache.olingo.client.api.ODataClient;
-import org.apache.olingo.client.api.communication.request.cud.ODataDeleteRequest;
-import org.apache.olingo.client.api.communication.request.cud.ODataEntityCreateRequest;
-import org.apache.olingo.client.api.communication.request.cud.ODataPropertyUpdateRequest;
-import org.apache.olingo.client.api.communication.request.cud.UpdateType;
 import org.apache.olingo.client.api.communication.request.retrieve.ODataPropertyRequest;
-import org.apache.olingo.client.api.communication.response.ODataDeleteResponse;
-import org.apache.olingo.client.api.communication.response.ODataEntityCreateResponse;
-import org.apache.olingo.client.api.communication.response.ODataPropertyUpdateResponse;
-import org.apache.olingo.client.api.communication.response.ODataRetrieveResponse;
-import org.apache.olingo.client.api.domain.ClientEntity;
 import org.apache.olingo.client.api.domain.ClientProperty;
 import org.apache.olingo.client.api.domain.ClientValuable;
 import org.apache.olingo.client.api.uri.URIBuilder;
 import org.apache.olingo.commons.api.format.ContentType;
-import org.apache.olingo.commons.api.http.HttpMethod;
 import org.junit.Test;
 
 public class PropertyTestITCase extends AbstractTestITCase {
@@ -99,113 +87,4 @@ public class PropertyTestITCase extends AbstractTestITCase {
   public void geospatialFromFullJSON() {
     geospatial(client, ContentType.JSON_FULL_METADATA);
   }
-
-  private void complex(final ODataClient client, final ContentType contentType) {
-    final URIBuilder uriBuilder = client.newURIBuilder(testStaticServiceRootURL).
-        appendEntitySetSegment("Customers").appendKeySegment(2).appendPropertySegment("HomeAddress");
-    final ODataPropertyRequest<ClientProperty> req = client.getRetrieveRequestFactory().
-        getPropertyRequest(uriBuilder.build());
-    req.setFormat(contentType);
-
-    final ClientProperty prop = req.execute().getBody();
-    assertNotNull(prop);
-    // cast to workaround JDK 6 bug, fixed in JDK 7
-    assertEquals("Microsoft.Test.OData.Services.ODataWCFService.Address",
-        ((ClientValuable) prop).getValue().getTypeName());
-  }
-
-  @Test
-  public void complexFromXML() {
-    complex(client, ContentType.APPLICATION_XML);
-  }
-
-  @Test
-  public void complexFromJSON() {
-    complex(edmClient, ContentType.JSON);
-  }
-
-  @Test
-  public void complexFromFullJSON() {
-    complex(client, ContentType.JSON_FULL_METADATA);
-  }
-
-  private void updateComplexProperty(final ContentType contentType, final UpdateType type)
-          throws IOException {
-    final URIBuilder uriBuilder = client.newURIBuilder(testStaticServiceRootURL).
-        appendEntitySetSegment("Customers").appendKeySegment(1).appendPropertySegment("HomeAddress");
-
-    ODataPropertyRequest<ClientProperty> retrieveReq =
-        client.getRetrieveRequestFactory().getPropertyRequest(uriBuilder.build());
-    retrieveReq.setFormat(contentType);
-
-    ODataRetrieveResponse<ClientProperty> retrieveRes = retrieveReq.execute();
-    assertEquals(200, retrieveRes.getStatusCode());
-    ClientProperty oldAddress = retrieveRes.getBody();
-
-    ClientProperty homeAddress = client.getObjectFactory().newComplexProperty("HomeAddress",
-        client.getObjectFactory().newComplexValue(retrieveRes.getBody().getComplexValue().getTypeName()));
-
-    final String cityName = "Pescara";
-    homeAddress.getComplexValue().add(client.getObjectFactory().
-        newPrimitiveProperty("City", client.getObjectFactory().newPrimitiveValueBuilder().buildString(cityName)));
-
-    final ODataPropertyUpdateRequest updateReq = client.getCUDRequestFactory().
-        getPropertyComplexValueUpdateRequest(uriBuilder.build(), type, homeAddress);
-    if (client.getConfiguration().isUseXHTTPMethod()) {
-      assertEquals(HttpMethod.POST, updateReq.getMethod());
-    } else {
-      assertEquals(type.getMethod(), updateReq.getMethod());
-    }
-    updateReq.setFormat(contentType);
-
-    final ODataPropertyUpdateResponse updateRes = updateReq.execute();
-    assertEquals(204, updateRes.getStatusCode());
-
-    retrieveReq = client.getRetrieveRequestFactory().getPropertyRequest(uriBuilder.build());
-    retrieveReq.setFormat(contentType);
-
-    retrieveRes = retrieveReq.execute();
-    assertEquals(200, retrieveRes.getStatusCode());
-
-    homeAddress = retrieveRes.getBody();
-    assertEquals(cityName, homeAddress.getComplexValue().get("City").getPrimitiveValue().toString());
-
-    //
-    final ODataPropertyUpdateRequest resetRequest = client.getCUDRequestFactory().
-            getPropertyComplexValueUpdateRequest(uriBuilder.build(), type, oldAddress);
-    assertEquals(204, resetRequest.execute().getStatusCode());
-  }
-
-  @Test
-  public void patchComplexPropertyAsJSON() throws IOException {
-    updateComplexProperty(ContentType.JSON_FULL_METADATA, UpdateType.PATCH);
-  }
-
-  @Test
-  public void createAndDelete() {
-    // 1. create
-    final ClientEntity category = client.getObjectFactory().newEntity(null);
-    category.setId(client.newURIBuilder(testStaticServiceRootURL).
-        appendEntitySetSegment("Categories").appendKeySegment(1).build());
-
-    final URIBuilder createBuilder = client.newURIBuilder(testStaticServiceRootURL).
-        appendEntitySetSegment("Products").appendKeySegment(0).appendNavigationSegment("Categories").
-        appendRefSegment();
-    final ODataEntityCreateRequest<ClientEntity> createReq = client.getCUDRequestFactory().
-        getEntityCreateRequest(createBuilder.build(), category);
-
-    final ODataEntityCreateResponse<ClientEntity> createRes = createReq.execute();
-    assertEquals(204, createRes.getStatusCode());
-
-    // 2. delete
-    final URIBuilder deleteBuilder = client.newURIBuilder(testStaticServiceRootURL).
-        appendEntitySetSegment("Products").appendKeySegment(0).appendNavigationSegment("Categories").
-        appendKeySegment(1).appendRefSegment();
-    final ODataDeleteRequest deleteReq = client.getCUDRequestFactory().
-        getDeleteRequest(deleteBuilder.build());
-
-    final ODataDeleteResponse deleteRes = deleteReq.execute();
-    assertEquals(204, deleteRes.getStatusCode());
-  }
-
 }


Mime
View raw message