Package org.apache.abdera.protocol.client

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


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

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


        try {
            // Should return 200 - Feed provided since feed is unmodified since.
            Assert.assertEquals(200, res.getStatus());
            Assert.assertEquals(ResponseType.SUCCESS, res.getType());
        } 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

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

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

        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);
View Full Code Here

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


    public static void printFeed( String title, String indent, Feed feed ) {
View Full Code Here

            Assert.assertTrue( -1 < responseBody.indexOf( "\"updated\"" ));
            Assert.assertTrue( -1 < responseBody.indexOf( "\"entries\"" ));
            // AtomTestCaseUtils.printResponseHeaders( "JSON Entry response headers:", "   ", res );
            // System.out.println( "ContentNegotiationTest.testJSONEntryGet JSON entry body=" + responseBody );
        } finally {
            res.release();
        }
    }

    protected String readResponse( Reader responseReader ) {
        if ( responseReader == null ) return "";
View Full Code Here

        // If-Match Assert response status code is 412. Precondition failed.
        // If-None-Match Assert response status code is 200. OK
        Assert.assertEquals(200, res.getStatus());
        // Put provides null body and no etags.
        res.release();
    }

    @Test
    public void testETagMissGet() throws Exception {
        // 4) Conditional GET example (get with etag. etag not in cache)
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.