Package org.apache.abdera.protocol.client

Examples of org.apache.abdera.protocol.client.ClientResponse.release()


        // Assert.assertNotNull( res.getLocation().toString() );
        // Assert.assertEquals( "", res.getContentLocation().toString() );
        Assert.assertNotNull( res.getHeader( "ETag" ) );
        lastModified = res.getLastModified();
        Assert.assertNotNull(lastModified);
        res.release();
    }

    @Test
    public void testETagHitGet() throws Exception {
        // 3) Conditional GET example (get with etag. etag match)
View Full Code Here


        // Assert response status code is 304 Not Modified.
        // Assert header ETag: "e180ee84f0671b1"
        // Assert header Last-Modified: Fri, 25 Jul 2008 14:36:44 -0500
        // Assert.assertEquals(304, res.getStatus());
        res.release();
    }


    @Test
    public void testUpToDateGet() throws Exception {
View Full Code Here

        // >      HTTP/1.1 304 Not Modified
        //       Date: Sat, 24 Feb 2007 13:17:11 GMT

        // Assert response status code is 304 Not Modified.
        Assert.assertEquals(304, res.getStatus());
        res.release();
    }

    @Test
    public void testOutOfDateGet() throws Exception {
        // 4) Conditional GET example (get with If-Mod. entry is not to date)
View Full Code Here

        // Assert.assertNotNull( res.getLocation().toString() );
        // Assert.assertEquals( "", res.getContentLocation().toString() );
        Assert.assertNotNull( res.getHeader( "ETag" ) );
        lastModified = res.getLastModified();
        Assert.assertNotNull(lastModified);
        res.release();
    }

    @Test
    public void testUpToDateUnModGet() throws Exception {
        // 3) Conditional GET example (get with If-Unmod. entry is not modified (< predicate date).
View Full Code Here

        // Assert header Location: http://example.org/edit/first-post.atom
        // Assert header Content-Location: http://example.org/edit/first-post.atom
        // Assert header ETag: "e180ee84f0671b1"
        // Assert header Last-Modified: Less than If-Unmod
        Assert.assertEquals(200, res.getStatus());
        res.release();
    }

    @Test
    public void testOutOfDateUnModGet() throws Exception {
        // 4) Conditional GET example (get with If-Unmod. entry is modified (> predicate date)
View Full Code Here

        // >      HTTP/1.1 304 Not Modified
        //       Date: Sat, 24 Feb 2007 13:17:11 GMT

        // Assert response status code is 304 Not Modified.
        Assert.assertEquals(304, res.getStatus());
        res.release();
    }
}
View Full Code Here

        assertNotNull(c.getHref());
      }
   
      col_uri = getBase() + "/collections/entries";
    } finally {
      response.release();
    }

    // post a new entry
    response = client.post(col_uri, entry, options);
View Full Code Here

      assertNotNull(response.getLocation());
      assertNotNull(response.getContentLocation());
   
      self_uri = response.getLocation().toString();
    } finally {
      response.release();
    }
    // get the collection to see if our entry is there
    response = client.get(col_uri, options);
View Full Code Here

    try {
      assertEquals(200, response.getStatus());
      Document<Feed> feed_doc = response.getDocument();
      assertEquals(1, feed_doc.getRoot().getEntries().size());
    } finally {
      response.release();
    }

    // get the entry to see if we can get it
    response = client.get(self_uri, options);
View Full Code Here

      // change the entry
      Document<Entry> doc = response.getDocument();
      entry = (Entry) doc.getRoot().clone();
      entry.setTitle("New title");
    } finally
      response.release();
    }

    // submit the changed entry back to the server
    response = client.put(edit_uri, entry, options);
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.