Package KFM.GUI

Examples of KFM.GUI.HttpParams


    String aName1= "c";
    assertTrue("", httpparams.getParam(aName1).equals(""));
  }

  public void testGetParameterNames() {
    HttpParams httpparams = new HttpParams("http://www.siemens.com/pfad/zum/servlet/SieMap?a=b&c=d&a=e");
    Enumeration enumerationRet = httpparams.getParameterNames();
    int size = 0;
    while (enumerationRet.hasMoreElements()) {
          enumerationRet.nextElement();
          size++;
    }
View Full Code Here


    }
    assertTrue("Found wrong number of parameter names. Expected 2, found " + size, size == 2);
  }

  public void testGetParameterValues() {
    HttpParams httpparams = new HttpParams("http://www.siemens.com/pfad/zum/servlet/SieMap?a=b&c=d&a=e");
    String aName1=  "a";
    String[] ret = httpparams.getParameterValues(aName1);
    assertTrue("Found wrong number of parameter values. Expected 2, found" + ret.length, ret.length == 2);
  }
View Full Code Here

    String[] ret = httpparams.getParameterValues(aName1);
    assertTrue("Found wrong number of parameter values. Expected 2, found" + ret.length, ret.length == 2);
  }

  public void testGetProtocol() {
    HttpParams httpparams = new HttpParams("https://www.siemens.com/pfad/zum/servlet/SieMap?a=b&c=d&a=e");
    String stringRet = httpparams.getProtocol();
    assertTrue("Found wrong protocol: " + stringRet, stringRet.equals("https"));
  }
View Full Code Here

    HttpParams httpparams = new HttpParams("https://www.siemens.com/pfad/zum/servlet/SieMap?a=b&c=d&a=e");
    String stringRet = httpparams.getProtocol();
    assertTrue("Found wrong protocol: " + stringRet, stringRet.equals("https"));
  }
  public void testGetProtocol2() {
    HttpParams httpparams = new HttpParams();
    String stringRet = httpparams.getProtocol();
    assertTrue("getProtocol() with empty constructor did not return null but: " + stringRet, stringRet == null);
  }
View Full Code Here

    String stringRet = httpparams.getProtocol();
    assertTrue("getProtocol() with empty constructor did not return null but: " + stringRet, stringRet == null);
  }

  public void testRemoveParam() {
    HttpParams httpparams = new HttpParams("https://www.siemens.com/pfad/zum/servlet/SieMap?a=b&c=d&a=e");
    String aName1=  "a";
    httpparams.removeParam(aName1);
    assertTrue("removed " + aName1 + " but getParam returned value " + httpparams.getParam(aName1), httpparams.getParam(aName1).equals(""));
  }
View Full Code Here

    httpparams.removeParam(aName1);
    assertTrue("removed " + aName1 + " but getParam returned value " + httpparams.getParam(aName1), httpparams.getParam(aName1).equals(""));
  }

  public void testRemoveParam2() {
    HttpParams httpparams = new HttpParams("https://www.siemens.com/pfad/zum/servlet/SieMap?a=b&c=d&a=e");
    String aName1=  "x";
    Enumeration tNames = httpparams.getParameterNames();
    int sizeBefore = 0;
    while (tNames.hasMoreElements()) {
          tNames.nextElement();
          sizeBefore++;
    }
    httpparams.removeParam(aName1);
    tNames = httpparams.getParameterNames();
    int sizeAfter = 0;
    while (tNames.hasMoreElements()) {
          tNames.nextElement();
          sizeAfter++;
    }
View Full Code Here

    }
    assertTrue("removed not existing param" + aName1 + " but number of param names differs", sizeBefore == sizeAfter);
  }

  public void testRemoveParam3() {
    HttpParams httpparams = new HttpParams("https://www.siemens.com/pfad/zum/servlet/SieMap?a=b&c=d&a=e");
    String aName1=  "a";
    String aValue2=  "e";
    httpparams.removeParam(aName1, aValue2);
    String[] tValues = httpparams.getParameterValues(aName1);
    for (int i = 0; i < tValues.length; i++) {
        if (tValues[i].equals(aValue2)) {
            fail("removed" + aName1 + " with value " + aValue2 + " but it is still there.");
        }
    }
View Full Code Here

        }
    }
  }

  public void testReplaceParam() {
    HttpParams httpparams = new HttpParams("https://www.siemens.com/pfad/zum/servlet/SieMap?a=b&c=d&a=e");
    String aName1=  "a";
    String aValue2=  "r";
    httpparams.replaceParam(aName1, aValue2);
    assertTrue("replacement of " + aName1 + " by " + aValue2 + "failed:", httpparams.getParam(aName1).equals(aValue2));
  }
View Full Code Here

    assertTrue("replacement of " + aName1 + " by " + aValue2 + "failed:", httpparams.getParam(aName1).equals(aValue2));
  }


  public void testGetAnchor1() {
    HttpParams httpparams = new HttpParams("https://www.siemens.com/pfad/zum/servlet/SieMap?a=b&c=d&a=e#anchor");
    String aName1=  "anchor";
    assertTrue("Anchor missing, expected #" + aName1, httpparams.getAnchor().equals(aName1));
  }
View Full Code Here

    HttpParams httpparams = new HttpParams("https://www.siemens.com/pfad/zum/servlet/SieMap?a=b&c=d&a=e#anchor");
    String aName1=  "anchor";
    assertTrue("Anchor missing, expected #" + aName1, httpparams.getAnchor().equals(aName1));
  }
  public void testGetAnchor2() {
    HttpParams httpparams = new HttpParams("https://www.siemens.com/pfad/zum/servlet/SieMap#anchor");
    String aName1=  "anchor";
    assertTrue("Anchor missing, expected #" + aName1, httpparams.getAnchor().equals(aName1));
  }
View Full Code Here

TOP

Related Classes of KFM.GUI.HttpParams

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.