org.mozilla.zest.core.v1.ZestExpressionResponseTime.<init>()方法的使用及代码示例

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

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

ZestExpressionResponseTime.<init>介绍

[英]Instantiates a new zest expression response time.
[中]实例化新的zest表达式响应时间。

代码示例

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

@Override
public ZestExpressionResponseTime deepCopy() {
  return new ZestExpressionResponseTime(timeInMs, greaterThan, isInverse());
}

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

@Test
public void testSetTimeInMs() {
  long time = 1000;
  ZestExpressionResponseTime timeExpr = new ZestExpressionResponseTime(10);
  timeExpr.setTimeInMs(time);
  assertTrue(time == timeExpr.getTimeInMs());
}

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

@Test
public void testEvaluate() {
  ZestExpressionResponseTime timeExpr = new ZestExpressionResponseTime(1000);
  timeExpr.setGreaterThan(false);
  ZestResponse response = new ZestResponse(null, "", "", 100, 10);
  assertTrue(timeExpr.evaluate(new TestRuntime(response)));
}

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

@Test
public void testDeepCopyNoPointer() {
  ZestExpressionResponseTime timeExpr = new ZestExpressionResponseTime(100);
  ZestExpressionResponseTime copy = timeExpr.deepCopy();
  timeExpr.setTimeInMs(50);
  assertTrue(timeExpr.getTimeInMs() != copy.getTimeInMs());
}

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

@Test
public void testIsTrueGreaterThan() {
  ZestExpressionResponseTime timeExpr = new ZestExpressionResponseTime(0);
  timeExpr.setGreaterThan(true);
  ZestResponse response = new ZestResponse(null, "", "", 200, 100);
  assertTrue(timeExpr.isTrue(new TestRuntime(response)));
}

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

ZestExpressionAnd and = new ZestExpressionAnd();
and.addChildCondition(new ZestExpressionLength("response.body", 100, 200));
and.addChildCondition(new ZestExpressionResponseTime(1000));
and.addChildCondition(or);
and.addChildCondition(and.deepCopy());

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

@Test
public void testEvaluateGreaterThanIsInverse() {
  ZestExpressionResponseTime timeExpTime = new ZestExpressionResponseTime(1000);
  ZestResponse response = new ZestResponse(null, "", "", 200, 1000);
  timeExpTime.setInverse(true);
  timeExpTime.setGreaterThan(true);
  assertTrue(timeExpTime.evaluate(new TestRuntime(response)));
}

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

public void testIsTrueDeepCopyDifferentGreaterThan() {
    ZestExpressionResponseTime timeExpr = new ZestExpressionResponseTime(1000);
    ZestExpressionResponseTime copy = timeExpr.deepCopy();
    timeExpr.setGreaterThan(false);
    ZestRuntime runtime = new TestRuntime(new ZestResponse(null, "", "", 100, 10));
    assertTrue(timeExpr.isTrue(runtime) && !copy.isTrue(runtime));
  }
}

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

@Test
public void testDeepCopyNoPointers() {
  ZestExpressionResponseTime timeExpr = new ZestExpressionResponseTime(1000);
  ZestExpressionResponseTime copy = timeExpr.deepCopy();
  timeExpr.setGreaterThan(false);
  timeExpr.setTimeInMs(5);
  assertFalse(
      copy.getTimeInMs() == timeExpr.getTimeInMs()
          || copy.isGreaterThan() == timeExpr.isGreaterThan());
}

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

@Test
public void testDeepCopy() {
  ZestExpressionResponseTime timeExpr = new ZestExpressionResponseTime(1000, false, true);
  ZestExpressionResponseTime copy = timeExpr.deepCopy();
  assertTrue(copy.getTimeInMs() == timeExpr.getTimeInMs());
  assertEquals(copy.isGreaterThan(), timeExpr.isGreaterThan());
  assertEquals(copy.isInverse(), timeExpr.isInverse());
}

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

ZestExpressionRegex regex =
    new ZestExpressionRegex(ZestVariables.RESPONSE_BODY, "54321");
ZestExpressionResponseTime time = new ZestExpressionResponseTime(100);
LinkedList<String> includeRegex = new LinkedList<>();
LinkedList<String> excludeRegex = new LinkedList<>();

相关文章