Package org.mortbay.http

Examples of org.mortbay.http.HttpRequest


    }

    public void testHandleSetsResponseAttributeInCaseOfMissingResource() throws Exception {
      String pathInContext = "/invalid";
      String pathParams = "";
      HttpRequest httpRequest = new HttpRequest();
      HttpResponse httpResponse = new HttpResponse();
      handler.handle(pathInContext, pathParams, httpRequest, httpResponse);
      assertEquals("True", httpResponse.getAttribute("NotFound"));
    }
View Full Code Here


        StaticContentHandler.class.getDeclaredMethod("callSuperHandle", String.class, String.class, HttpRequest.class, HttpResponse.class)
      });

      String pathInContext = "/driver/?cmd=getNewBrowserSession&1=*chrome&2=http://www.google.com";
      String pathParams = "";
      HttpRequest httpRequest = new HttpRequest();
      HttpResponse httpResponse = new HttpResponse();
     
      expect(mock.getResource(pathInContext)).andReturn(Resource.newResource("found_resource"));
      mock.callSuperHandle(pathInContext, pathParams, httpRequest, httpResponse);
      expectLastCall().once();
View Full Code Here

     *
     * @param message the current message
     * @param headers the current set of headers
     */
    protected void copyRequestHeaders(Message message, Map<String, List<String>> headers) {
        HttpRequest req = (HttpRequest)message.get(HTTP_REQUEST);
        for (Enumeration e = req.getFieldNames(); e.hasMoreElements();) {
            String fname = (String)e.nextElement();
            List<String> values;
            if (headers.containsKey(fname)) {
                values = headers.get(fname);
            } else {
                values = new ArrayList<String>();
                headers.put(HttpHeaderHelper.getHeaderKey(fname), values);
            }
            for (Enumeration e2 = req.getFieldValues(fname); e2.hasMoreElements();) {
                String val = (String)e2.nextElement();
                values.add(val);
            }
        }
    }
View Full Code Here

TOP

Related Classes of org.mortbay.http.HttpRequest

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.