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:43:10 UTC
svn commit: r1027704 -
/tuscany/sca-java-2.x/trunk/modules/binding-atom-runtime/src/test/java/org/apache/tuscany/sca/binding/atom/ProviderFeedEntityTagsTestCase.java
Author: nash
Date: Tue Oct 26 19:43:10 2010
New Revision: 1027704
URL: http://svn.apache.org/viewvc?rev=1027704&view=rev
Log:
Merge r1027700 Add test to ensure If-Modified-Since returns 304 if feed is unmodified
Modified:
tuscany/sca-java-2.x/trunk/modules/binding-atom-runtime/src/test/java/org/apache/tuscany/sca/binding/atom/ProviderFeedEntityTagsTestCase.java
Modified: tuscany/sca-java-2.x/trunk/modules/binding-atom-runtime/src/test/java/org/apache/tuscany/sca/binding/atom/ProviderFeedEntityTagsTestCase.java
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/modules/binding-atom-runtime/src/test/java/org/apache/tuscany/sca/binding/atom/ProviderFeedEntityTagsTestCase.java?rev=1027704&r1=1027703&r2=1027704&view=diff
==============================================================================
--- tuscany/sca-java-2.x/trunk/modules/binding-atom-runtime/src/test/java/org/apache/tuscany/sca/binding/atom/ProviderFeedEntityTagsTestCase.java (original)
+++ tuscany/sca-java-2.x/trunk/modules/binding-atom-runtime/src/test/java/org/apache/tuscany/sca/binding/atom/ProviderFeedEntityTagsTestCase.java Tue Oct 26 19:43:10 2010
@@ -315,9 +315,23 @@ public class ProviderFeedEntityTagsTestC
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.