Package com.google.api.explorer.client.base

Examples of com.google.api.explorer.client.base.ApiRequest


  private Map<String, String> headers = ImmutableMap.of("Content-Type", "application/json");
  private HttpMethod method = HttpMethod.POST;


  public void testRequestParameters() {
    ApiRequest req = generateRequest(path, body, headers, method);

    DynamicJso obj = (DynamicJso) CrossDomainRequest.convertRequest(req);

    assertEquals(path, obj.getString("url"));
    assertEquals(body, obj.getString("body"));
View Full Code Here


   * Test whether setting the base path has an effect. It shouldn't.
   */
  public void testAlternateBase() {
    Config.setBaseUrl("https://www.googleapis.com/alternate/base/path");

    ApiRequest req = generateRequest(path, body, headers, method);

    DynamicJso obj = (DynamicJso) CrossDomainRequest.convertRequest(req);

    assertEquals(path, obj.getString("url"));
    assertEquals(body, obj.getString("body"));
View Full Code Here

  }

  private ApiRequest generateRequest(final String path, final String body,
      final Map<String, String> headers, final HttpMethod method) {

    return new ApiRequest() {

      @Override
      public String getRequestBody() {
        return body;
      }
View Full Code Here

    EasyMock.verify(event, analyticsManager, historyCache, delegate);
  }

  /** This is necessary because history item cannot be subclassed. */
  private HistoryItem createEmptyHistoryItem() {
    ApiRequest mockRequest = EasyMock.createMock(ApiRequest.class);
    ApiResponse mockResponse = EasyMock.createMock(ApiResponse.class);
    return new HistoryItem("1", mockRequest, mockResponse, 0, 0);
  }
View Full Code Here

   */
  private void populateHistoryItems(
      final String prefix, Iterable<HistoryItem> historyItems, EntryAggregatorView aggregator) {

    for (final HistoryItem item : historyItems) {
      ApiRequest request = item.getRequest();
      HasClickHandlers rowHandler = aggregator.addEntry(new HistoryEntry(request.getMethod()
          .getId(), request.getHttpMethod().toString() + " " + request.getRequestPath(), item
          .getEndTime()));
      rowHandler.addClickHandler(new ClickHandler() {
        @Override
        public void onClick(ClickEvent event) {
          presenter.handleClickHistoryItem(prefix, item);
View Full Code Here

TOP

Related Classes of com.google.api.explorer.client.base.ApiRequest

Copyright © 2018 www.massapicom. 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.