You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tuscany.apache.org by na...@apache.org on 2010/10/26 21:36:26 UTC
svn commit: r1027700 -
/tuscany/sca-java-1.x/trunk/modules/binding-atom-abdera/src/test/java/org/apache/tuscany/sca/binding/atom/ProviderFeedEntityTagsTestCase.java
Author: nash
Date: Tue Oct 26 19:36:25 2010
New Revision: 1027700
URL: http://svn.apache.org/viewvc?rev=1027700&view=rev
Log:
Merge r1025930 Add test to ensure If-Modified-Since returns 304 if feed is unmodified
Modified:
tuscany/sca-java-1.x/trunk/modules/binding-atom-abdera/src/test/java/org/apache/tuscany/sca/binding/atom/ProviderFeedEntityTagsTestCase.java
Modified: tuscany/sca-java-1.x/trunk/modules/binding-atom-abdera/src/test/java/org/apache/tuscany/sca/binding/atom/ProviderFeedEntityTagsTestCase.java
URL: http://svn.apache.org/viewvc/tuscany/sca-java-1.x/trunk/modules/binding-atom-abdera/src/test/java/org/apache/tuscany/sca/binding/atom/ProviderFeedEntityTagsTestCase.java?rev=1027700&r1=1027699&r2=1027700&view=diff
==============================================================================
--- tuscany/sca-java-1.x/trunk/modules/binding-atom-abdera/src/test/java/org/apache/tuscany/sca/binding/atom/ProviderFeedEntityTagsTestCase.java (original)
+++ tuscany/sca-java-1.x/trunk/modules/binding-atom-abdera/src/test/java/org/apache/tuscany/sca/binding/atom/ProviderFeedEntityTagsTestCase.java Tue Oct 26 19:36:25 2010
@@ -187,13 +187,27 @@ public class ProviderFeedEntityTagsTestC
@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.