Package org.apache.abdera.protocol.client

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


    response = client.delete(edit_uri, options);

    try {
      assertEquals(204, response.getStatus());
    } finally {
      response.release();
    }

    // is the entry gone?
    response = client.get(self_uri, options);
View Full Code Here


    response = client.get(self_uri, options);

    try {
      assertEquals(404, response.getStatus());
    } finally {
      response.release();
    }

    // is the media resource gone?
    options.setNoCache(true); // need to force revalidation to check
View Full Code Here

    response = client.get(media, options);

    try {
      assertEquals(404, response.getStatus());
    } finally {
      response.release();
    }

    // YAY! We can handle media link entries
  }
 
View Full Code Here

            eTag = res.getHeader("ETag");
            Assert.assertNotNull( eTag );
            lastModified = res.getLastModified();
            Assert.assertNotNull( lastModified );
        } finally {
            res.release();
        }
    }   

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

            Assert.assertEquals(ResponseType.SUCCESS, res.getType());
            // AtomTestCaseUtils.printResponseHeaders( "Feed response headers:", "   ", res );
            // System.out.println("Feed response content:");
            // AtomTestCaseUtils.prettyPrint(abdera, res.getDocument());
        } finally {
            res.release();
        }
    }   

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

        Assert.assertNotNull(res);
        try {
            // Should return 304 - Feed not provided since it matches ETag.
            Assert.assertEquals(304, res.getStatus());
        } finally {
            res.release();
        }
    }   

    // @Test @Ignore Intermitently fails, see TUSCANY-3299
    public void testUnmodifiedGetIfUnModified() throws Exception {   
View Full Code Here

        Assert.assertNotNull(res);
        try {
            // Should return 304 - Feed not provided since feed is modified since.
            Assert.assertEquals(304, res.getStatus());
        } finally {
            res.release();
        }
    }   

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

            String thisETag = res.getHeader("ETag");
            Assert.assertNotNull( thisETag );
            Date thisLastModified = res.getLastModified();
            Assert.assertNotNull( thisLastModified );                       
        } finally {
            res.release();
        }
    }   

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

            Assert.assertEquals(304, res.getStatus());
            // AtomTestCaseUtils.printResponseHeaders( "Feed response headers:", "   ", res );
            // System.out.println("Feed response content:");
            // AtomTestCaseUtils.prettyPrint(abdera, res.getDocument());
        } finally {
            res.release();
        }
    }   

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

            // AtomTestCaseUtils.printResponseHeaders( "Feed modified if-none-match response headers:", "   ", res );
            // System.out.println("Feed response content:");
            // AtomTestCaseUtils.prettyPrint(abdera, res.getDocument());
        } finally {
            res.release();
        }
    }   

    @Test
    public void testModifiedGetIfUnModified() throws Exception {   
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.