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/21 12:23:23 UTC

svn commit: r1025930 - /tuscany/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

Author: nash
Date: Thu Oct 21 10:23:23 2010
New Revision: 1025930

URL: http://svn.apache.org/viewvc?rev=1025930&view=rev
Log:
Add test to ensure If-Modified-Since returns 304 if feed is unmodified

Modified:
    tuscany/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

Modified: tuscany/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
URL: http://svn.apache.org/viewvc/tuscany/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?rev=1025930&r1=1025929&r2=1025930&view=diff
==============================================================================
--- tuscany/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 (original)
+++ tuscany/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 Thu Oct 21 10:23:23 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.