本文整理了Java中org.mozilla.zest.core.v1.ZestAssignStringDelimiters.<init>()
方法的一些代码示例,展示了ZestAssignStringDelimiters.<init>()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ZestAssignStringDelimiters.<init>()
方法的具体详情如下:
包路径:org.mozilla.zest.core.v1.ZestAssignStringDelimiters
类名称:ZestAssignStringDelimiters
方法名:<init>
[英]Instantiates a new zest action set variable.
[中]实例化一个新的zest action集变量。
代码示例来源:origin: mozilla/zest
@Override
public ZestAssignStringDelimiters deepCopy() {
ZestAssignStringDelimiters copy = new ZestAssignStringDelimiters(this.getIndex());
copy.setVariableName(this.getVariableName());
copy.location = this.location;
copy.setPrefix(this.prefix);
copy.setPostfix(this.postfix);
copy.setEnabled(this.isEnabled());
return copy;
}
代码示例来源:origin: mozilla/zest
new ZestAssignStringDelimiters(
"test.var.1", ZestAssignStringDelimiters.LOC_HEAD, "AA", "BB"));
assertEquals(8, script.getVariableNames().size());
script.add(c1);
c1.addIf(
new ZestAssignStringDelimiters(
"test.var.2", ZestAssignStringDelimiters.LOC_HEAD, "AA", "BB"));
assertEquals(9, script.getVariableNames().size());
代码示例来源:origin: mozilla/zest
/**
* Method testSimpleCase.
*
* @throws Exception
*/
@Test
public void testSimpleCase() throws Exception {
ZestAssignStringDelimiters ast = new ZestAssignStringDelimiters();
ZestResponse resp =
new ZestResponse(
null, "Header prefix12345postfix", "Body Prefix54321Postfix", 200, 0);
ast.setVariableName("aaa");
ast.setPrefix("prefix");
ast.setPostfix("postfix");
assertEquals("12345", ast.assign(resp, rt));
ast.setVariableName("aaa");
ast.setPrefix("Prefix");
ast.setPostfix("Postfix");
assertEquals("54321", ast.assign(resp, rt));
}
代码示例来源:origin: mozilla/zest
@Test
public void testSerialization() {
ZestAssignStringDelimiters assign =
new ZestAssignStringDelimiters("var", "BODY", ">>", "<<");
String str = ZestJSON.toString(assign);
// System.out.println(str);
ZestAssignStringDelimiters assign2 = (ZestAssignStringDelimiters) ZestJSON.fromString(str);
assertEquals(assign.getElementType(), assign2.getElementType());
assertEquals(assign.getLocation(), assign2.getLocation());
assertEquals(assign.getPrefix(), assign2.getPrefix());
assertEquals(assign.getPostfix(), assign2.getPostfix());
}
}
代码示例来源:origin: mozilla/zest
/**
* Method testRegexes.
*
* @throws Exception
*/
@Test
public void testRegexes() throws Exception {
ZestAssignStringDelimiters ast = new ZestAssignStringDelimiters();
ZestResponse resp =
new ZestResponse(
null, "Header prefix12345postfixZ", "Body Prefix54321PostfixZ", 200, 0);
ast.setVariableName("aaa");
ast.setPrefix("H");
ast.setPostfix("Z");
ast.setLocation(ZestAssignStringDelimiters.LOC_HEAD);
assertEquals("eader prefix12345postfix", ast.assign(resp, rt));
ast.setVariableName("aaa");
ast.setPrefix("B");
ast.setPostfix("Z");
ast.setLocation(ZestAssignStringDelimiters.LOC_BODY);
assertEquals("ody Prefix54321Postfix", ast.assign(resp, rt));
}
代码示例来源:origin: mozilla/zest
ZestAssignStringDelimiters ast = new ZestAssignStringDelimiters();
ZestResponse resp = new ZestResponse(null, "aaaa", "bbbb", 200, 0);
内容来源于网络,如有侵权,请联系作者删除!