Package org.apache.commons.configuration.web

Examples of org.apache.commons.configuration.web.ServletRequestConfiguration


    assertTrue(requestURI.toURL().toString().length() > 0); // force resolving the URI to a string

    List<NameValuePair> parsedParams = URLEncodedUtils.parse(requestURI, "UTF-8");
    MockServletRequest mockServletRequest = MockServletRequest.create(parsedParams);
    DataConfiguration params = new DataConfiguration(new ServletRequestConfiguration(mockServletRequest));
    SenseiRequest bRequest = DefaultSenseiJSONServlet.convertSenseiRequest(params);
    assertEquals(aRequest, bRequest);
  }
View Full Code Here


      throws SenseiException, UnsupportedEncodingException, JSONException
  {
    SenseiRequest testRequest = createNonRandomSenseiRequest();
    List<NameValuePair> list = HttpRestSenseiServiceImpl.convertRequestToQueryParams(testRequest);
    MockServletRequest mockServletRequest = MockServletRequest.create(list);
    DataConfiguration params = new DataConfiguration(new ServletRequestConfiguration(mockServletRequest));
    SenseiRequest resultRequest = DefaultSenseiJSONServlet.convertSenseiRequest(params);
    assertEquals(testRequest, resultRequest);
  }
View Full Code Here

    aRequest.setShowExplanation(EXPECTED_SHOW_EXPLANATION);

    SenseiRequest bRequest = new SenseiRequest();
    List<NameValuePair> list = HttpRestSenseiServiceImpl.convertRequestToQueryParams(aRequest);
    MockServletRequest mockServletRequest = MockServletRequest.create(list);
    DataConfiguration params = new DataConfiguration(new ServletRequestConfiguration(mockServletRequest));
    DefaultSenseiJSONServlet.convertScalarParams(bRequest, params);
    assertEquals(aRequest, bRequest);
  }
View Full Code Here

    SenseiRequest bRequest = new SenseiRequest();
    List<NameValuePair> qparams = new ArrayList<NameValuePair>();
    HttpRestSenseiServiceImpl.convertFacetInitParams(qparams, initParams);
    MockServletRequest mockServletRequest = MockServletRequest.create(qparams);
    DataConfiguration params = new DataConfiguration(new ServletRequestConfiguration(mockServletRequest));
    DefaultSenseiJSONServlet.convertInitParams(bRequest, params);
    assertEquals(aRequest, bRequest);
  }
View Full Code Here

    SenseiRequest bRequest = new SenseiRequest();
    List<NameValuePair> list = new ArrayList<NameValuePair>();
    HttpRestSenseiServiceImpl.convertFacetSpecs(list, facetSpecMap);
    MockServletRequest mockServletRequest = MockServletRequest.create(list);
    DataConfiguration params = new DataConfiguration(new ServletRequestConfiguration(mockServletRequest));
    DefaultSenseiJSONServlet.convertFacetParam(bRequest, params);
    assertEquals(aRequest, bRequest);
  }
View Full Code Here

    SenseiRequest bRequest = new SenseiRequest();
    List<NameValuePair> list = new ArrayList<NameValuePair>();
    HttpRestSenseiServiceImpl.convertSortFieldParams(list, sortFields);
    MockServletRequest mockServletRequest = MockServletRequest.create(list);
    DataConfiguration params = new DataConfiguration(new ServletRequestConfiguration(mockServletRequest));
    DefaultSenseiJSONServlet.convertSortParam(bRequest, params);
    assertEquals(aRequest, bRequest);
  }
View Full Code Here

    SenseiRequest bRequest = new SenseiRequest();
    List<NameValuePair> list = new ArrayList<NameValuePair>();
    HttpRestSenseiServiceImpl.convertSenseiQuery(list, senseiQuery);
    MockServletRequest mockServletRequest = MockServletRequest.create(list);
    DataConfiguration params = new DataConfiguration(new ServletRequestConfiguration(mockServletRequest));
    DefaultSenseiJSONServlet.convertSenseiQuery(bRequest, params);
    assertEquals(aRequest, bRequest);
  }
View Full Code Here

    SenseiRequest bRequest = new SenseiRequest();
    List<NameValuePair> list = new ArrayList<NameValuePair>();
    HttpRestSenseiServiceImpl.convertPartitionParams(list, partitions);
    MockServletRequest mockServletRequest = MockServletRequest.create(list);
    DataConfiguration params = new DataConfiguration(new ServletRequestConfiguration(mockServletRequest));
    DefaultSenseiJSONServlet.convertPartitionParams(bRequest, params);
    assertEquals(aRequest, bRequest);
  }
View Full Code Here

    SenseiRequest bRequest = new SenseiRequest();
    bRequest.addSelections(selections);
    List<NameValuePair> list = new ArrayList<NameValuePair>();
    HttpRestSenseiServiceImpl.convertSelectionNames(list, bRequest);
    MockServletRequest mockServletRequest = MockServletRequest.create(list);
    DataConfiguration params = new DataConfiguration(new ServletRequestConfiguration(mockServletRequest));
    DefaultSenseiJSONServlet.convertSelectParam(bRequest, params);
    assertEquals(aRequest, bRequest);
  }
View Full Code Here

  abstract protected SenseiRequest buildSenseiRequest(DataConfiguration params) throws Exception;
 
  @Override
  protected SenseiRequest buildSenseiRequest(HttpServletRequest req)
      throws Exception {
    DataConfiguration params = new DataConfiguration(new ServletRequestConfiguration(req));
    return buildSenseiRequest(params);
  }
View Full Code Here

TOP

Related Classes of org.apache.commons.configuration.web.ServletRequestConfiguration

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.