diff options
author | nash <nash@13f79535-47bb-0310-9956-ffa450edef68> | 2010-10-26 19:43:10 +0000 |
---|---|---|
committer | nash <nash@13f79535-47bb-0310-9956-ffa450edef68> | 2010-10-26 19:43:10 +0000 |
commit | f4c310f5e2702ba807a6deba3c3f6d2ae9870866 (patch) | |
tree | 7bbfc51d52b16c2b2aeb776eada8645be3c41bb6 /sca-java-2.x/trunk/modules | |
parent | a5513768597bf404451c4d8ca1202b51370c8898 (diff) |
Merge r1027700 Add test to ensure If-Modified-Since returns 304 if feed is unmodified
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@1027704 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'sca-java-2.x/trunk/modules')
-rw-r--r-- | sca-java-2.x/trunk/modules/binding-atom-runtime/src/test/java/org/apache/tuscany/sca/binding/atom/ProviderFeedEntityTagsTestCase.java | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/sca-java-2.x/trunk/modules/binding-atom-runtime/src/test/java/org/apache/tuscany/sca/binding/atom/ProviderFeedEntityTagsTestCase.java b/sca-java-2.x/trunk/modules/binding-atom-runtime/src/test/java/org/apache/tuscany/sca/binding/atom/ProviderFeedEntityTagsTestCase.java index 932344649f..ddec9d4034 100644 --- a/sca-java-2.x/trunk/modules/binding-atom-runtime/src/test/java/org/apache/tuscany/sca/binding/atom/ProviderFeedEntityTagsTestCase.java +++ b/sca-java-2.x/trunk/modules/binding-atom-runtime/src/test/java/org/apache/tuscany/sca/binding/atom/ProviderFeedEntityTagsTestCase.java @@ -315,9 +315,23 @@ public class ProviderFeedEntityTagsTestCase { RequestOptions opts = new RequestOptions(); final String contentType = "application/atom+xml"; opts.setContentType(contentType); + opts.setHeader( "If-Modified-Since", dateFormat.format( new Date() )); + + ClientResponse res = client.get(providerURI, opts); + Assert.assertNotNull(res); + try { + // Should return 304 - Feed not provided since feed is unmodified. + Assert.assertEquals(304, res.getStatus()); + } finally { + res.release(); + } + + // Feed request with predicates + opts = new RequestOptions(); + opts.setContentType(contentType); opts.setHeader( "If-Modified-Since", dateFormat.format( previousSecond(lastModified) )); - ClientResponse res = client.get(providerURI, opts); + res = client.get(providerURI, opts); Assert.assertNotNull(res); try { // Should return 200 - Feed provided since feed is changed. |