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

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

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

ZestAssignStringDelimiters.setPrefix介绍

[英]Sets the prefix.
[中]设置前缀。

代码示例

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

/**
 * Instantiates a new zest action set variable.
 *
 * @param variableName the variable name
 * @param location the location
 * @param prefix the prefix
 * @param postfix the postfix
 */
public ZestAssignStringDelimiters(
    String variableName, String location, String prefix, String postfix) {
  super(variableName);
  this.location = location;
  this.setPrefix(prefix);
  this.setPostfix(postfix);
}

代码示例来源: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

/**
 * 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

ast.setPrefix("bbb");
ast.setPostfix("ccc");
try {
ast.setPrefix(null);
ast.setPostfix("ccc");
try {
ast.setPrefix("bbb");
ast.setPostfix(null);
try {
ast.setPrefix("xxx");
ast.setPostfix("yyy");
try {

代码示例来源: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));
}

相关文章