From a5513768597bf404451c4d8ca1202b51370c8898 Mon Sep 17 00:00:00 2001 From: nash Date: Tue, 26 Oct 2010 19:36:25 +0000 Subject: Merge r1025930 Add test to ensure If-Modified-Since returns 304 if feed is unmodified git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@1027700 13f79535-47bb-0310-9956-ffa450edef68 --- .../binding/atom/ProviderFeedEntityTagsTestCase.java | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) (limited to 'sca-java-1.x/trunk/modules/binding-atom-abdera/src/test/java/org/apache/tuscany') diff --git a/sca-java-1.x/trunk/modules/binding-atom-abdera/src/test/java/org/apache/tuscany/sca/binding/atom/ProviderFeedEntityTagsTestCase.java b/sca-java-1.x/trunk/modules/binding-atom-abdera/src/test/java/org/apache/tuscany/sca/binding/atom/ProviderFeedEntityTagsTestCase.java index 7ddc193bdc..c2768be986 100644 --- a/sca-java-1.x/trunk/modules/binding-atom-abdera/src/test/java/org/apache/tuscany/sca/binding/atom/ProviderFeedEntityTagsTestCase.java +++ b/sca-java-1.x/trunk/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. -- cgit v1.2.3