summaryrefslogtreecommitdiffstats
path: root/sca-java-1.x/branches
diff options
context:
space:
mode:
authornash <nash@13f79535-47bb-0310-9956-ffa450edef68>2010-10-21 10:23:23 +0000
committernash <nash@13f79535-47bb-0310-9956-ffa450edef68>2010-10-21 10:23:23 +0000
commit6a2fb5a2e3b6dca68075cf99be7bb0b00d39d018 (patch)
tree3fc73a4734df5f4168b1b874e52c3128d4fd2b62 /sca-java-1.x/branches
parent50af954096b24ddd2b9e050d0de6129f8fc1f598 (diff)
Add test to ensure If-Modified-Since returns 304 if feed is unmodified
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@1025930 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'sca-java-1.x/branches')
-rw-r--r--sca-java-1.x/branches/sca-java-1.6.1/modules/binding-atom-abdera/src/test/java/org/apache/tuscany/sca/binding/atom/ProviderFeedEntityTagsTestCase.java20
1 files changed, 17 insertions, 3 deletions
diff --git a/sca-java-1.x/branches/sca-java-1.6.1/modules/binding-atom-abdera/src/test/java/org/apache/tuscany/sca/binding/atom/ProviderFeedEntityTagsTestCase.java b/sca-java-1.x/branches/sca-java-1.6.1/modules/binding-atom-abdera/src/test/java/org/apache/tuscany/sca/binding/atom/ProviderFeedEntityTagsTestCase.java
index 7ddc193bdc..c2768be986 100644
--- a/sca-java-1.x/branches/sca-java-1.6.1/modules/binding-atom-abdera/src/test/java/org/apache/tuscany/sca/binding/atom/ProviderFeedEntityTagsTestCase.java
+++ b/sca-java-1.x/branches/sca-java-1.6.1/modules/binding-atom-abdera/src/test/java/org/apache/tuscany/sca/binding/atom/ProviderFeedEntityTagsTestCase.java
@@ -187,13 +187,27 @@ public class ProviderFeedEntityTagsTestCase {
@Test
public void testUnmodifiedGetIfModified() throws Exception {
System.out.println(">>>ProviderFeedEntityTagsTestCase.testFeedUnmodifiedGetIfModified");
+ // Feed request with predicates
+ 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
- RequestOptions opts = new RequestOptions();
- final String contentType = "application/atom+xml";
+ opts = new RequestOptions();
opts.setContentType(contentType);
opts.setHeader( "If-Modified-Since", dateFormat.format( new Date( 0 ) ));
- ClientResponse res = client.get(providerURI, opts);
+ res = client.get(providerURI, opts);
Assert.assertNotNull(res);
try {
// Should return 200 - Feed provided since feed is changed.