Package org.apache.abdera.protocol.client

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


      assertEquals(200, response.getStatus());

      String mediavalue = read(response.getInputStream());
      assertEquals("TEST", mediavalue);
    } finally {
      response.release();
    }

    // delete the entry
    response = client.delete(edit_uri, options);
View Full Code Here


    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

   
    // Should be revalidated and return a 404
    options.setHeader("x-reqnum", "3");
    response = client.get(CHECK_MUST_REVALIDATE, options)
    assertEquals(response.getStatus(), 404);
    response.release();

  }
 
  private void _methodInvalidates(int type) throws Exception {
   
View Full Code Here

    options.setHeader("Connection", "close");
    options.setHeader("x-reqnum", "1");
    ClientResponse response = client.get(CHECK_CACHE_INVALIDATE, options);
 
    String resp1 = getResponse(response);
    response.release();
    assertEquals(resp1, "1");
   
    // calling a method that could change state on the server should invalidate the cache
    options.setHeader("x-reqnum", "2");
    switch(type) {
View Full Code Here

        response = client.delete(
          CHECK_CACHE_INVALIDATE,
          options);
        break;
    }
    response.release();
   
    options.setHeader("x-reqnum", "3");
    response = client.get(CHECK_CACHE_INVALIDATE, options);
 
    resp1 = getResponse(response);
View Full Code Here

   
    options.setHeader("x-reqnum", "3");
    response = client.get(CHECK_CACHE_INVALIDATE, options);
 
    resp1 = getResponse(response);
    response.release();
    assertEquals(resp1, "3");
  }
 
  private void _requestCacheInvalidation(int type) throws Exception {
   
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

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.