本文整理了Java中org.mozilla.zest.core.v1.ZestRequest.getIndex()
方法的一些代码示例,展示了ZestRequest.getIndex()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ZestRequest.getIndex()
方法的具体详情如下:
包路径:org.mozilla.zest.core.v1.ZestRequest
类名称:ZestRequest
方法名:getIndex
暂无
代码示例来源:origin: mozilla/zest
@Override
public void responseFailed(ZestRequest request, ZestResponse response)
throws ZestAssertFailException {
this.debug(request.getIndex() + " Response FAILED");
}
代码示例来源:origin: mozilla/zest
@Override
public void responsePassed(ZestRequest request, ZestResponse response) {
this.debug(request.getIndex() + " Response PASSED");
}
代码示例来源:origin: mozilla/zest
@Override
public void responseFailed(ZestRequest request, ZestResponse response, ZestAssertion assertion)
throws ZestAssertFailException {
this.debug(request.getIndex() + " Assertion FAILED: " + assertion.getClass().getName());
if (this.getStopOnAssertFail()) {
throw new ZestAssertFailException(assertion);
}
}
代码示例来源: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;
}
代码示例来源:origin: mozilla/zest
/**
* Method testAddingElses.
*
* @throws Exception
*/
@Test
public void testAddingElses() throws Exception {
ZestConditional zc = new ZestConditional(new ZestExpressionRegex("BODY", ""));
ZestRequest req = new ZestRequest();
zc.addElse(req);
assertEquals(1, req.getIndex());
checkOrder(new ZestStatement[] {zc, req, null});
ZestRequest req2 = new ZestRequest();
zc.addElse(req2);
// 0: zc
// 1: req
// 2: req2
checkOrder(new ZestStatement[] {zc, req, req2, null});
ZestRequest req3 = new ZestRequest();
zc.addElse(1, req3);
// 0: zc
// 1: req
// 2: req3
// 3: req2
checkOrder(new ZestStatement[] {zc, req, req3, req2, null});
}
代码示例来源:origin: mozilla/zest
/**
* Method testAddingIfs.
*
* @throws Exception
*/
@Test
public void testAddingIfs() throws Exception {
ZestConditional zc = new ZestConditional(new ZestExpressionRegex("BODY", ""));
ZestRequest req = new ZestRequest();
zc.addIf(req);
assertEquals(1, req.getIndex());
checkOrder(new ZestStatement[] {zc, req, null});
ZestRequest req2 = new ZestRequest();
zc.addIf(req2);
// 0: zc
// 1: req
// 2: req2
checkOrder(new ZestStatement[] {zc, req, req2, null});
ZestRequest req3 = new ZestRequest();
zc.addIf(1, req3);
// 0: zc
// 1: req
// 2: req3
// 3: req2
checkOrder(new ZestStatement[] {zc, req, req3, req2, null});
}
代码示例来源:origin: mozilla/zest
/**
* Method testAddingIfs.
*
* @throws Exception
*/
@Test
public void testAddingIfs() throws Exception {
ZestConditional zc = new ZestConditional(new ZestExpressionRegex("BODY", ""));
ZestRequest req = new ZestRequest();
zc.addIf(req);
assertEquals(1, req.getIndex());
checkOrder(new ZestStatement[] {zc, req, null});
ZestRequest req2 = new ZestRequest();
zc.addIf(req2);
// 0: zc
// 1: req
// 2: req2
checkOrder(new ZestStatement[] {zc, req, req2, null});
ZestRequest req3 = new ZestRequest();
zc.addIf(1, req3);
// 0: zc
// 1: req
// 2: req3
// 3: req2
checkOrder(new ZestStatement[] {zc, req, req3, req2, null});
}
代码示例来源:origin: mozilla/zest
/**
* Method testAddingElses.
*
* @throws Exception
*/
@Test
public void testAddingElses() throws Exception {
ZestConditional zc = new ZestConditional(new ZestExpressionRegex("BODY", ""));
ZestRequest req = new ZestRequest();
zc.addElse(req);
assertEquals(1, req.getIndex());
checkOrder(new ZestStatement[] {zc, req, null});
ZestRequest req2 = new ZestRequest();
zc.addElse(req2);
// 0: zc
// 1: req
// 2: req2
checkOrder(new ZestStatement[] {zc, req, req2, null});
ZestRequest req3 = new ZestRequest();
zc.addElse(1, req3);
// 0: zc
// 1: req
// 2: req3
// 3: req2
checkOrder(new ZestStatement[] {zc, req, req3, req2, null});
}
内容来源于网络,如有侵权,请联系作者删除!