org.mozilla.zest.core.v1.ZestCookie.getPath()方法的使用及代码示例

x33g5p2x  于2022-02-05 转载在 其他  
字(3.0k)|赞(0)|评价(0)|浏览(74)

本文整理了Java中org.mozilla.zest.core.v1.ZestCookie.getPath()方法的一些代码示例,展示了ZestCookie.getPath()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ZestCookie.getPath()方法的具体详情如下:
包路径:org.mozilla.zest.core.v1.ZestCookie
类名称:ZestCookie
方法名:getPath

ZestCookie.getPath介绍

暂无

代码示例

代码示例来源:origin: mozilla/zest

/** @deprecated (0.14.0) Use {@link #getZestCookies()} instead. */
@Deprecated
public List<Cookie> getCookies() {
  List<Cookie> cookies = new ArrayList<>();
  for (ZestCookie cookie : this.cookies) {
    cookies.add(
        new Cookie(
            cookie.getDomain(),
            cookie.getName(),
            cookie.getValue(),
            cookie.getPath(),
            cookie.getExpiryDate(),
            cookie.isSecure()));
  }
  return cookies;
}

代码示例来源:origin: mozilla/zest

/**
 * Replace tokens.
 *
 * @param tokens the tokens
 */
public void replaceTokens(ZestVariables tokens) {
  if (this.urlToken != null) {
    this.setUrlToken(tokens.replaceInString(this.urlToken, true));
    try {
      this.setUrl(new URL(this.getUrlToken()));
    } catch (MalformedURLException e) {
      // Ignore
    }
  } else if (this.url != null) {
    try {
      this.setUrl(new URL(tokens.replaceInString(this.url.toString(), true)));
    } catch (MalformedURLException e) {
      // Ignore
    }
  }
  this.setMethod(tokens.replaceInString(this.getMethod(), false));
  this.setHeaders(tokens.replaceInString(this.getHeaders(), false));
  this.setData(tokens.replaceInString(this.getData(), false));
  for (ZestCookie cookie : this.cookies) {
    cookie.setDomain(tokens.replaceInString(cookie.getDomain(), false));
    cookie.setName(tokens.replaceInString(cookie.getName(), false));
    cookie.setValue(tokens.replaceInString(cookie.getValue(), false));
    cookie.setPath(tokens.replaceInString(cookie.getPath(), false));
  }
}

代码示例来源:origin: mozilla/zest

assertTrue(cookie.getName().equals(cookie2.getName()));
assertTrue(cookie.getValue().equals(cookie2.getValue()));
assertTrue(cookie.getPath().equals(cookie2.getPath()));
assertTrue(cookie.getExpiryDate().equals(cookie2.getExpiryDate()));
assertTrue(cookie.isSecure() == cookie2.isSecure());

代码示例来源:origin: mozilla/zest

zestCookie.getName(),
zestCookie.getValue(),
zestCookie.getPath(),
zestCookie.getExpiryDate(),
zestCookie.isSecure());

代码示例来源:origin: mozilla/zest

assertEquals("12JKL34", req2.getZestCookies().get(0).getName());
assertEquals("56GHI78", req2.getZestCookies().get(0).getValue());
assertEquals("/DEFGA/GHIB", req2.getZestCookies().get(0).getPath());

代码示例来源:origin: mozilla/zest

@Override
public ZestRequest deepCopy() {
  ZestRequest zr = new ZestRequest(this.getIndex());
  zr.setUrl(this.url);
  zr.setUrlToken(this.urlToken);
  zr.setData(this.data);
  zr.setMethod(this.method);
  zr.setHeaders(this.headers);
  zr.setFollowRedirects(this.followRedirects);
  zr.setTimestamp(this.timestamp);
  if (this.getResponse() != null) {
    zr.setResponse(this.getResponse().deepCopy());
  }
  for (ZestAssertion zt : this.getAssertions()) {
    zr.addAssertion((ZestAssertion) zt.deepCopy());
  }
  for (ZestCookie cookie : this.cookies) {
    zr.addCookie(
        new ZestCookie(
            cookie.getDomain(),
            cookie.getName(),
            cookie.getValue(),
            cookie.getPath(),
            cookie.getExpiryDate(),
            cookie.isSecure()));
  }
  zr.setEnabled(this.isEnabled());
  return zr;
}

相关文章