예제 #1
0
  /*
   * Testing Correcting exception thrown
   *                 when calling Cookie.valueOf(null)
   */
  @Test
  public void testParse3() throws Exception {

    try {
      Cookie ck8 = javax.ws.rs.core.Cookie.valueOf(null);
      throw new Exception("Expectecd IllegalArgumentException not thrown.  Test Failed");
    } catch (java.lang.IllegalArgumentException ilex) {
    }
  }
예제 #2
0
  /*
   * Create a version 0 Cookie instance by Parsing a String
   */
  @Test
  public void testParse1() throws Exception {
    boolean pass = true;

    String cookie_toParse = "NAME_1=Value_1;";
    String name = "name_1";
    String value = "value_1";
    String path = "";
    String domain = "";
    int version = 0;

    Cookie ck6 = javax.ws.rs.core.Cookie.valueOf(cookie_toParse);
    pass = testCookie(ck6, name, value, path, domain, version);
  }
예제 #3
0
  /*
   * Create a version 0 Cookie instance by Parsing a String
   */
  @Test
  public void testParse2() throws Exception {
    boolean pass = true;
    String cookie_toParse = "$Version=\"1\"; Customer=\"WILE_E_COYOTE\"; $Path=\"/acme\"";

    String name = "customer";
    String value = "wile_e_coyote";
    String path = "/acme";
    String domain = "";
    int version = 1;

    Cookie ck7 = javax.ws.rs.core.Cookie.valueOf(cookie_toParse);

    pass = testCookie(ck7, name, value, path, domain, version);
  }