You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@olingo.apache.org by ch...@apache.org on 2013/10/10 14:02:34 UTC
git commit: Some more ref tests
Updated Branches:
refs/heads/master 7ef5a9baa -> 28948cd1d
Some more ref tests
Project: http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/commit/28948cd1
Tree: http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/tree/28948cd1
Diff: http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/diff/28948cd1
Branch: refs/heads/master
Commit: 28948cd1d37c3bd70f5c1d68977d124819537bf7
Parents: 7ef5a9b
Author: Christian Amend <ch...@apache.org>
Authored: Thu Oct 10 13:54:12 2013 +0200
Committer: Christian Amend <ch...@apache.org>
Committed: Thu Oct 10 13:54:12 2013 +0200
----------------------------------------------------------------------
.../olingo/odata2/fit/ref/MiscChangeTest.java | 18 ++++++++++++++++--
1 file changed, 16 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/blob/28948cd1/odata2-lib/odata-fit/src/test/java/org/apache/olingo/odata2/fit/ref/MiscChangeTest.java
----------------------------------------------------------------------
diff --git a/odata2-lib/odata-fit/src/test/java/org/apache/olingo/odata2/fit/ref/MiscChangeTest.java b/odata2-lib/odata-fit/src/test/java/org/apache/olingo/odata2/fit/ref/MiscChangeTest.java
index ca0db8e..526d756 100644
--- a/odata2-lib/odata-fit/src/test/java/org/apache/olingo/odata2/fit/ref/MiscChangeTest.java
+++ b/odata2-lib/odata-fit/src/test/java/org/apache/olingo/odata2/fit/ref/MiscChangeTest.java
@@ -91,6 +91,15 @@ public class MiscChangeTest extends AbstractRefTest {
callUri(ODataHttpMethod.PUT, "Container2.Photos(Id=2,Type='image%2Fbmp')/$value", null, null, "00", IMAGE_GIF,
HttpStatusCodes.NO_CONTENT);
checkEtag(response, "W/\"2\"");
+
+ response =
+ callUri(ODataHttpMethod.PATCH, url, null, null, "00", HttpContentType.APPLICATION_OCTET_STREAM,
+ HttpStatusCodes.METHOD_NOT_ALLOWED);
+ response.getEntity().getContent().close();
+ response =
+ callUri(ODataHttpMethod.MERGE, url, null, null, "00", HttpContentType.APPLICATION_OCTET_STREAM,
+ HttpStatusCodes.METHOD_NOT_ALLOWED);
+ response.getEntity().getContent().close();
}
@Test
@@ -100,10 +109,12 @@ public class MiscChangeTest extends AbstractRefTest {
String url = "Container2.Photos(Id=3,Type='image%2Fjpeg')/Image/$value";
callUri(ODataHttpMethod.PUT, url, HttpHeaders.ETAG, "W/\"3\"", "4711", HttpContentType.APPLICATION_OCTET_STREAM,
HttpStatusCodes.NO_CONTENT);
- assertEquals("4711", getBody(callUri(url)));
+ HttpResponse response = callUri(url);
+ assertEquals("4711", getBody(response));
+ checkMediaType(response, HttpContentType.APPLICATION_OCTET_STREAM);
url = "Container2.Photos(Id=4,Type='foo')/BinaryData/$value";
- HttpResponse response =
+ response =
callUri(ODataHttpMethod.PUT, url, HttpHeaders.ETAG, "W/\"4\"", "4711", IMAGE_JPEG, HttpStatusCodes.NO_CONTENT);
checkEtag(response, "W/\"4\"");
assertEquals("4711", getBody(callUri(url)));
@@ -113,6 +124,9 @@ public class MiscChangeTest extends AbstractRefTest {
putUri(url, content, HttpContentType.TEXT_PLAIN, HttpStatusCodes.NO_CONTENT);
assertEquals(content, getBody(callUri(url)));
+ callUri(ODataHttpMethod.PATCH, url, null, null, content, HttpContentType.TEXT_PLAIN, HttpStatusCodes.NO_CONTENT);
+ callUri(ODataHttpMethod.MERGE, url, null, null, content, HttpContentType.TEXT_PLAIN, HttpStatusCodes.NO_CONTENT);
+
putUri("Employees('2')/EmployeeId/$value", "42", HttpContentType.TEXT_PLAIN, HttpStatusCodes.METHOD_NOT_ALLOWED);
putUri("Employees('2')/Age/$value", "42a", HttpContentType.TEXT_PLAIN, HttpStatusCodes.BAD_REQUEST);
putUri(url, "2000-13-78T42:19:18z", HttpContentType.TEXT_PLAIN, HttpStatusCodes.BAD_REQUEST);