本文整理了Java中org.mozilla.zest.core.v1.ZestRequest.<init>()
方法的一些代码示例,展示了ZestRequest.<init>()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ZestRequest.<init>()
方法的具体详情如下:
包路径:org.mozilla.zest.core.v1.ZestRequest
类名称:ZestRequest
方法名:<init>
[英]Instantiates a new zest request.
[中]实例化一个新的zest请求。
代码示例来源:origin: mozilla/zest
private static ZestRequest createRequest() {
return new ZestRequest();
}
代码示例来源:origin: mozilla/zest
/**
* Method testMoveLastElse.
*
* @throws Exception
*/
@Test
public void testMoveLastElse() throws Exception {
ZestConditional zc = new ZestConditional(new ZestExpressionRegex("BODY", ""));
ZestRequest req1 = new ZestRequest();
ZestRequest req2 = new ZestRequest();
ZestRequest req3 = new ZestRequest();
zc.addElse(req1);
zc.addElse(req2);
zc.addElse(req3);
zc.moveElse(0, req3);
checkOrder(new ZestStatement[] {zc, req3, req1, req2, null});
}
代码示例来源:origin: mozilla/zest
/**
* Method testRemoveMiddleElse.
*
* @throws Exception
*/
@Test
public void testRemoveMiddleElse() throws Exception {
ZestConditional zc = new ZestConditional(new ZestExpressionRegex("BODY", ""));
ZestRequest req1 = new ZestRequest();
ZestRequest req2 = new ZestRequest();
ZestRequest req3 = new ZestRequest();
zc.addElse(req1);
zc.addElse(req2);
zc.addElse(req3);
zc.removeElse(req2);
checkOrder(new ZestStatement[] {zc, req1, req3, null});
}
代码示例来源:origin: mozilla/zest
/**
* Method testMoveSecondElse.
*
* @throws Exception
*/
@Test
public void testMoveSecondElse() throws Exception {
ZestConditional zc = new ZestConditional(new ZestExpressionRegex("BODY", ""));
ZestRequest req1 = new ZestRequest();
ZestRequest req2 = new ZestRequest();
ZestRequest req3 = new ZestRequest();
zc.addElse(req1);
zc.addElse(req2);
zc.addElse(req3);
zc.moveElse(2, req2);
checkOrder(new ZestStatement[] {zc, req1, req3, req2, null});
}
代码示例来源:origin: mozilla/zest
/**
* Method testRemoveLastIf.
*
* @throws Exception
*/
@Test
public void testRemoveLastIf() throws Exception {
ZestConditional zc = new ZestConditional(new ZestExpressionRegex("BODY", ""));
ZestRequest req1 = new ZestRequest();
ZestRequest req2 = new ZestRequest();
ZestRequest req3 = new ZestRequest();
zc.addIf(req1);
zc.addIf(req2);
zc.addIf(req3);
zc.removeIf(req3);
checkOrder(new ZestStatement[] {zc, req1, req2, null});
}
代码示例来源:origin: mozilla/zest
/**
* Method testMoveFirstIf.
*
* @throws Exception
*/
@Test
public void testMoveFirstIf() throws Exception {
ZestConditional zc = new ZestConditional(new ZestExpressionRegex("BODY", ""));
ZestRequest req1 = new ZestRequest();
ZestRequest req2 = new ZestRequest();
ZestRequest req3 = new ZestRequest();
zc.addIf(req1);
zc.addIf(req2);
zc.addIf(req3);
zc.moveIf(2, req1);
checkOrder(new ZestStatement[] {zc, req2, req3, req1, null});
}
代码示例来源:origin: mozilla/zest
/**
* Method testMoveLastIf.
*
* @throws Exception
*/
@Test
public void testMoveLastIf() throws Exception {
ZestConditional zc = new ZestConditional(new ZestExpressionRegex("BODY", ""));
ZestRequest req1 = new ZestRequest();
ZestRequest req2 = new ZestRequest();
ZestRequest req3 = new ZestRequest();
zc.addIf(req1);
zc.addIf(req2);
zc.addIf(req3);
zc.moveIf(1, req3);
checkOrder(new ZestStatement[] {zc, req1, req3, req2, null});
}
代码示例来源:origin: mozilla/zest
/**
* Method testMoveFirstElse.
*
* @throws Exception
*/
@Test
public void testMoveFirstElse() throws Exception {
ZestConditional zc = new ZestConditional(new ZestExpressionRegex("BODY", ""));
ZestRequest req1 = new ZestRequest();
ZestRequest req2 = new ZestRequest();
ZestRequest req3 = new ZestRequest();
zc.addElse(req1);
zc.addElse(req2);
zc.addElse(req3);
zc.moveElse(1, req1);
checkOrder(new ZestStatement[] {zc, req2, req1, req3, null});
}
代码示例来源:origin: mozilla/zest
/**
* Method testMoveLastElse.
*
* @throws Exception
*/
@Test
public void testMoveLastElse() throws Exception {
ZestConditional zc = new ZestConditional(new ZestExpressionRegex("BODY", ""));
ZestRequest req1 = new ZestRequest();
ZestRequest req2 = new ZestRequest();
ZestRequest req3 = new ZestRequest();
zc.addElse(req1);
zc.addElse(req2);
zc.addElse(req3);
zc.moveElse(0, req3);
checkOrder(new ZestStatement[] {zc, req3, req1, req2, null});
}
代码示例来源:origin: mozilla/zest
/**
* Method testRemoveMiddleIf.
*
* @throws Exception
*/
@Test
public void testRemoveMiddleIf() throws Exception {
ZestConditional zc = new ZestConditional(new ZestExpressionRegex("BODY", ""));
ZestRequest req1 = new ZestRequest();
ZestRequest req2 = new ZestRequest();
ZestRequest req3 = new ZestRequest();
zc.addIf(req1);
zc.addIf(req2);
zc.addIf(req3);
zc.removeIf(req2);
checkOrder(new ZestStatement[] {zc, req1, req3, null});
}
代码示例来源:origin: mozilla/zest
/**
* Method testRemoveFirstElse.
*
* @throws Exception
*/
@Test
public void testRemoveFirstElse() throws Exception {
ZestConditional zc = new ZestConditional(new ZestExpressionRegex("BODY", ""));
ZestRequest req1 = new ZestRequest();
ZestRequest req2 = new ZestRequest();
ZestRequest req3 = new ZestRequest();
zc.addElse(req1);
zc.addElse(req2);
zc.addElse(req3);
zc.removeElse(req1);
checkOrder(new ZestStatement[] {zc, req2, req3, null});
}
代码示例来源:origin: mozilla/zest
/**
* Method testMoveSecondElse.
*
* @throws Exception
*/
@Test
public void testMoveSecondElse() throws Exception {
ZestConditional zc = new ZestConditional(new ZestExpressionRegex("BODY", ""));
ZestRequest req1 = new ZestRequest();
ZestRequest req2 = new ZestRequest();
ZestRequest req3 = new ZestRequest();
zc.addElse(req1);
zc.addElse(req2);
zc.addElse(req3);
zc.moveElse(2, req2);
checkOrder(new ZestStatement[] {zc, req1, req3, req2, null});
}
代码示例来源:origin: mozilla/zest
/**
* Method testMoveSecondIf.
*
* @throws Exception
*/
@Test
public void testMoveSecondIf() throws Exception {
ZestConditional zc = new ZestConditional(new ZestExpressionRegex("BODY", ""));
ZestRequest req1 = new ZestRequest();
ZestRequest req2 = new ZestRequest();
ZestRequest req3 = new ZestRequest();
zc.addIf(req1);
zc.addIf(req2);
zc.addIf(req3);
checkOrder(new ZestStatement[] {zc, req1, req2, req3, null});
zc.moveIf(0, req2);
checkOrder(new ZestStatement[] {zc, req2, req1, req3, null});
}
代码示例来源:origin: mozilla/zest
@Test(expected = IllegalArgumentException.class)
public void shouldFailToRunNonPassiveStatementsInPassiveScripts() throws Exception {
// Given
ZestScript script = new ZestScript();
script.setType(ZestScript.Type.Passive);
script.add(new ZestRequest());
ZestBasicRunner runner = new ZestBasicRunner();
// When
runner.run(script, new HashMap<String, String>());
// Then = IllegalArgumentException
}
代码示例来源:origin: mozilla/zest
/**
* Method testMovingElseStatements.
*
* @throws Exception
*/
@Test
public void testMovingElseStatements() throws Exception {
ZestConditional zc1 = new ZestConditional(new ZestExpressionRegex("BODY", ""));
ZestRequest req1 = new ZestRequest();
ZestRequest req2 = new ZestRequest();
zc1.addElse(req1);
zc1.addElse(req2);
zc1.moveElse(0, req2);
checkOrder(new ZestStatement[] {zc1, req2, req1, null});
}
/*
代码示例来源:origin: mozilla/zest
@Test
public void testIsTrue() {
ZestExpressionURL urlExpr = new ZestExpressionURL();
urlExpr.setIncludeRegexes(includeStrings);
urlExpr.setExcludeRegexes(excludeStrings);
try {
ZestRequest request = new ZestRequest();
request.setUrl(new URL("http://www.PING1.com"));
assertTrue(urlExpr.isTrue(new TestRuntime(request)));
} catch (MalformedURLException e) {
e.printStackTrace();
}
}
代码示例来源:origin: mozilla/zest
@Test
public void testIsTrueFalse() {
ZestExpressionURL urlExpr = new ZestExpressionURL();
urlExpr.setIncludeRegexes(includeStrings);
urlExpr.setExcludeRegexes(excludeStrings);
try {
ZestRequest request = new ZestRequest();
request.setUrl(new URL("http://www.PONG1.com"));
assertFalse(urlExpr.isTrue(new TestRuntime(request)));
} catch (MalformedURLException e) {
e.printStackTrace();
}
}
代码示例来源:origin: mozilla/zest
@Test
public void testIsTrueDifferentURL() {
ZestExpressionURL urlExpr = new ZestExpressionURL();
urlExpr.setIncludeRegexes(includeStrings);
urlExpr.setExcludeRegexes(excludeStrings);
try {
ZestRequest request = new ZestRequest();
request.setUrl(new URL("http://www.asdf.com"));
assertFalse(urlExpr.isTrue(new TestRuntime(request)));
} catch (MalformedURLException e) {
e.printStackTrace();
}
}
代码示例来源:origin: mozilla/zest
/**
* Method testDeepConditionals1.
*
* @throws Exception
*/
@Test
public void testDeepConditionals1() throws Exception {
ZestConditional zc1 = new ZestConditional(new ZestExpressionRegex("BODY", ""));
ZestConditional zc2 = new ZestConditional(new ZestExpressionRegex("BODY", ""));
ZestRequest req1 = new ZestRequest();
ZestRequest req2 = new ZestRequest();
zc1.addIf(zc2);
zc2.addIf(req1);
zc1.addElse(req2);
checkOrder(new ZestStatement[] {zc1, zc2, req1, req2, null});
}
代码示例来源:origin: mozilla/zest
/**
* Method testDeepConditionals1.
*
* @throws Exception
*/
@Test
public void testDeepConditionals1() throws Exception {
ZestConditional zc1 = new ZestConditional(new ZestExpressionRegex("BODY", ""));
ZestConditional zc2 = new ZestConditional(new ZestExpressionRegex("BODY", ""));
ZestRequest req1 = new ZestRequest();
ZestRequest req2 = new ZestRequest();
zc1.addIf(zc2);
zc2.addIf(req1);
zc1.addElse(req2);
checkOrder(new ZestStatement[] {zc1, zc2, req1, req2, null});
}
内容来源于网络,如有侵权,请联系作者删除!