Package org.apache.abdera.protocol.client

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


      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
    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

    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 testModifiedGetIfModified() throws Exception {   
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

      // 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.