Package com.google.greaze.server.internal.utils

Examples of com.google.greaze.server.internal.utils.UrlParamsExtractor


    this.urlParamBuilder = new UrlParamStringBuilder(gson);
  }

  public void testNoParams() {
    UrlParamsSpec spec = new UrlParamsSpec.Builder().build();
    UrlParamsExtractor extractor = new UrlParamsExtractor(spec, gson);
    HttpServletRequestFake request = new HttpServletRequestFake().setRequestMethod("GET");
    UrlParams urlParams = extractor.extractUrlParams(request);
    assertEquals(0, urlParams.getParamsMap().entrySet().size());
  }
View Full Code Here


  public void testOneParam() {
    UrlParamsSpec spec = new UrlParamsSpec.Builder().put("foo", String.class).build();
    UrlParams urlParameters = new UrlParams.Builder(spec)
      .put("foo", "bar bar").build();
    String urlParamsString = urlParamBuilder.add(urlParameters).build();
    UrlParamsExtractor extractor = new UrlParamsExtractor(spec, gson);
    HttpServletRequestFake request = new HttpServletRequestFake()
      .setRequestMethod("GET")
      .setUrlParams(urlParamsString);
    UrlParams urlParams = extractor.extractUrlParams(request);
    assertEquals("bar bar", urlParams.getParamsMap().get("foo"));
  }
View Full Code Here

          buildUrlParams(request, spec.getUrlParamsSpec(), gson),
          buildRequestBody(request, spec.getBodySpec(), gson));
    }

    private static UrlParams buildUrlParams(HttpServletRequest request, UrlParamsSpec spec, Gson gson) {
      UrlParamsExtractor urlParamsExtractor = new UrlParamsExtractor(spec, gson);
      return urlParamsExtractor.extractUrlParams(request);
    }
View Full Code Here

          buildUrlParams(request.getUrlParams(), spec.getUrlParamsSpec(), gson), request.getBody());
    }

    private static UrlParams buildUrlParams(Map<String, String> urlParams,
        UrlParamsSpec spec, Gson gson) {
      UrlParamsExtractor urlParamsExtractor = new UrlParamsExtractor(spec, gson);
      return urlParamsExtractor.extractUrlParams(urlParams);
    }
View Full Code Here

  public RequestReceiver(GsonBuilder gsonBuilder, RequestSpec spec) {
    this.gson = gsonBuilder
        .registerTypeAdapterFactory(new RequestBodyGsonTypeAdapterFactory(spec.getBodySpec()))
        .create();
    this.spec = spec;
    this.urlParamsExtractor = new UrlParamsExtractor(spec.getUrlParamsSpec(), gson);
  }
View Full Code Here

TOP

Related Classes of com.google.greaze.server.internal.utils.UrlParamsExtractor

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.