Examples of queryParameter()


Examples of com.github.kristofa.test.http.HttpRequestImpl.queryParameter()

        responseProvider.addHttpRequestMatchingFilter(filter);

        final HttpRequestImpl request1 = new HttpRequestImpl();
        request1.method(Method.GET);
        request1.path("/a/b");
        request1.queryParameter("a", "1");
        request1.httpMessageHeader("custom", "value");

        final HttpResponse response1 = responseProvider.getResponse(request1);
        assertNotNull("We expect matcher to be kicked in and provided response.", response1);
        assertEquals("We expect custom response.", 201, response1.getHttpCode());
View Full Code Here

Examples of com.github.kristofa.test.http.HttpRequestImpl.queryParameter()

        final HttpRequestImpl request3 = new HttpRequestImpl();
        request3.method(Method.GET);
        request3.path("/a/c");
        request3.httpMessageHeader("Content-Type", "application/json");
        request3.queryParameter("a", "1");

        final HttpResponse response3 = responseProvider.getResponse(request3);
        assertNotNull("We expected exact match to have worked.", response3);
        assertEquals(200, response3.getHttpCode());
View Full Code Here

Examples of er.extensions.foundation.ERXMutableURL.queryParameter()

        String sessionIdKey = WOApplication.application().sessionIdKey();
        String sessionId = request.cookieValueForKey(sessionIdKey);
        if (sessionId == null) {
          ERXMutableURL url = new ERXMutableURL();
          url.setQueryParameters(request.queryString());
          sessionId = url.queryParameter(sessionIdKey);
          if (sessionId == null && input.has(sessionIdKey)) {
            sessionId = input.getString(sessionIdKey);
          }
        }
        context._setRequestSessionID(sessionId);
View Full Code Here

Examples of org.jboss.resteasy.client.ClientRequest.queryParameter()

    ClientRequest client = new ClientRequest(UriBuilder.fromUri(request.endpoint() + "/" + request.path()),
        ClientRequest.getDefaultExecutor(), providerFactory);

    for(Map.Entry<String, List<Object> > entry : request.queryParams().entrySet()) {
      for (Object o : entry.getValue()) {
        client = client.queryParameter(entry.getKey(), String.valueOf(o));
      }
    }

    for (Entry<String, List<Object>> h : request.headers().entrySet()) {
      StringBuilder sb = new StringBuilder();
View Full Code Here

Examples of org.jboss.resteasy.client.ClientRequest.queryParameter()

    public static void userJoinsLanguageTeam(String username,
            String localesCSV) throws Exception {
        ClientRequest request =
                createRequest("/accounts/u/" + username + "/languages");

        checkAndReleaseConnection(request.queryParameter("locales", localesCSV)
                .put());
    }

    public static void makeSampleProject() throws Exception {
        checkAndReleaseConnection(createRequest("/project").put());
View Full Code Here

Examples of org.jboss.resteasy.client.ClientRequest.queryParameter()

         Assert.assertEquals(204, response.getStatus());
      }
     
      {
         ClientRequest request = new ClientRequest(generateURL("/queryParam"));
         request.queryParameter("param", "hello world");
         ClientResponse<String> response = request.get(String.class);
         Assert.assertEquals(200, response.getStatus());
         Assert.assertEquals("hello world", response.getEntity());
      }
View Full Code Here

Examples of org.jboss.resteasy.client.ClientRequest.queryParameter()

   @Test
   public void testXmlEnumParam() throws Exception
   {
      ClientRequest request = new ClientRequest(TestPortProvider.generateURL("/enum"));
      request.queryParameter("loc", "north");
      String res = request.getTarget(String.class);
      Assert.assertEquals("NORTH", res.toUpperCase());

   }
View Full Code Here

Examples of org.jboss.resteasy.client.ClientRequest.queryParameter()

  
   @Test
   public void testQuery() throws Exception
   {
      ClientRequest request = new ClientRequest("http://localhost:8081/query/list?q1=a&q2=b&q1=c");
      request.queryParameter("q1", "d");
      System.out.println("Sending request");
      ClientResponse<String> response = request.get(String.class);
      System.out.println("Received response: " + response.getEntity());
      Assert.assertEquals(200, response.getStatus());
      Assert.assertEquals("a:c:d:", response.getEntity());
View Full Code Here

Examples of org.jboss.resteasy.client.ClientRequest.queryParameter()

   {
      ClientRequest request = new ClientRequest(generateURL("/generic/sub"));
      ClientResponse<String> response = null;
      try
      {
         response = request.queryParameter("foo", "42.0").get(String.class);
         Assert.assertEquals(HttpResponseCodes.SC_OK, response.getStatus());
         Assert.assertEquals("42.0", response.getEntity());
      }

      catch (Exception e)
View Full Code Here

Examples of org.jboss.resteasy.client.ClientRequest.queryParameter()

         Assert.assertEquals(204, response.getStatus());
      }
     
      {
         ClientRequest request = new ClientRequest(generateURL("/queryParam"));
         request.queryParameter("param", "hello world");
         ClientResponse<String> response = request.get(String.class);
         Assert.assertEquals(HttpServletResponse.SC_OK, response.getStatus());
         Assert.assertEquals("hello world", response.getEntity());
      }
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.