Package net.sourceforge.urlrewriter4j.core.utilities

Examples of net.sourceforge.urlrewriter4j.core.utilities.NameValueCollection


    super();
    mEngine = pEngine;
    setLocation(pFacade.getRawUrl());
    mHttpMethod = pFacade.getHttpMethod();
   
    mProperties = new NameValueCollection();
    for (String oKey : pFacade.getHeaders().keySet()) {
      mProperties.add(oKey, pFacade.getHeaders().get(oKey));
    }
    Cookie[] oCookies = pFacade.getCookies();
    if (oCookies != null) {
      for (int i = 0; i < oCookies.length; i++) {
        Cookie oCookie = oCookies[i];
        mProperties.add(oCookie.getName(), oCookie.getValue());
      }
    }
    if (pFacade.getServerVariables() != null) {
      for (String oKey : pFacade.getServerVariables().keySet()) {
        mProperties.add(oKey, pFacade.getServerVariables().get(oKey));
      }
    }
    mHeaders = new NameValueCollection();
    mCookies = new ArrayList<Cookie>();
    mContextFacade = pFacade;
  }
View Full Code Here


  private static final String FULL_URL = URL_BASE + "?location=123";
  private static final String URL_PARAM_NAME = "location";
  private static final String URL_PARAM_VALUE = "123";
 
  public void testParseNullResult() {
    NameValueCollection oParams = URLUtil.parseQueryString(null);
    assertNull(oParams);
  }
View Full Code Here

    NameValueCollection oParams = URLUtil.parseQueryString(null);
    assertNull(oParams);
  }
 
  public void testParseZeroResult() {
    NameValueCollection oParams = URLUtil.parseQueryString(URL_BASE);
    assertNotNull(oParams);
    assertEquals(0, oParams.size());
  }
View Full Code Here

    assertNotNull(oParams);
    assertEquals(0, oParams.size());
  }
 
  public void testParseZeroResultWithQuestionMark() {
    NameValueCollection oParams = URLUtil.parseQueryString(URL_BASE + "?");
    assertNotNull(oParams);
    assertEquals(0, oParams.size());
  }
View Full Code Here

    assertNotNull(oParams);
    assertEquals(0, oParams.size());
  }
 
  public void testParseOneResult() {
    NameValueCollection oParams = URLUtil.parseQueryString(FULL_URL);
    assertNotNull(oParams);
    assertEquals(1, oParams.size());
  }
View Full Code Here

    assertNotNull(oParams);
    assertEquals(1, oParams.size());
  }
 
  public void testParseResult() {
    NameValueCollection oParams = URLUtil.parseQueryString(FULL_URL);
    assertNotNull(oParams);
    assertEquals(1, oParams.size());
    assertEquals(URL_PARAM_VALUE, oParams.get(URL_PARAM_NAME));
  }
View Full Code Here

    assertEquals(1, oParams.size());
    assertEquals(URL_PARAM_VALUE, oParams.get(URL_PARAM_NAME));
  }
 
  public void testParseMissingParamValue() {
    NameValueCollection oParams = URLUtil.parseQueryString(URL_BASE + "?location");
    assertNotNull(oParams);
    assertEquals(0, oParams.size());
    assertNull(oParams.get(URL_PARAM_NAME));
  }
View Full Code Here

    assertEquals(0, oParams.size());
    assertNull(oParams.get(URL_PARAM_NAME));
  }
 
  public void testParseResultWithPound() {
    NameValueCollection oParams = URLUtil.parseQueryString(FULL_URL + "#test");
    assertNotNull(oParams);
    assertEquals(1, oParams.size());
    assertEquals(URL_PARAM_VALUE, oParams.get(URL_PARAM_NAME));
  }
View Full Code Here

TOP

Related Classes of net.sourceforge.urlrewriter4j.core.utilities.NameValueCollection

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.