io.airlift.testing.Assertions.assertBetweenInclusive()方法的使用及代码示例

x33g5p2x  于11个月前 转载在 其他  
字(10.2k)|赞(0)|评价(0)|浏览(30)

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

Assertions.assertBetweenInclusive介绍

暂无

代码示例

代码示例来源:origin: prestodb/presto

if (memoryUsage == -1) {
  memoryUsage = driverContext.getSystemMemoryUsage();
  assertBetweenInclusive(memoryUsage, 460000L, 469999L);
if (memoryUsage == -1) {
  memoryUsage = driverContext.getSystemMemoryUsage();
  assertBetweenInclusive(memoryUsage, 460000L, 469999L);
if (memoryUsage == -1) {
  memoryUsage = driverContext.getSystemMemoryUsage();
  assertBetweenInclusive(memoryUsage, 360000L, 369999L);

代码示例来源:origin: prestodb/presto

assertBetweenInclusive(pageSource.getSystemMemoryUsage(), 180000L, 189999L); // Memory usage before lazy-loading the block
createUnboundedVarcharType().getSlice(block, block.getPositionCount() - 1); // trigger loading for lazy block
memoryUsage = pageSource.getSystemMemoryUsage();
assertBetweenInclusive(memoryUsage, 460000L, 469999L); // Memory usage after lazy-loading the actual block
assertBetweenInclusive(pageSource.getSystemMemoryUsage(), 180000L, 189999L); // Memory usage before lazy-loading the block
createUnboundedVarcharType().getSlice(block, block.getPositionCount() - 1); // trigger loading for lazy block
memoryUsage = pageSource.getSystemMemoryUsage();
assertBetweenInclusive(memoryUsage, 460000L, 469999L); // Memory usage after lazy-loading the actual block
assertBetweenInclusive(pageSource.getSystemMemoryUsage(), 90000L, 99999L); // Memory usage before lazy-loading the block
createUnboundedVarcharType().getSlice(block, block.getPositionCount() - 1); // trigger loading for lazy block
memoryUsage = pageSource.getSystemMemoryUsage();
assertBetweenInclusive(memoryUsage, 360000L, 369999L); // Memory usage after lazy-loading the actual block

代码示例来源:origin: prestodb/presto

assertBetweenInclusive(group1Ran, 995, 1000);
assertBetweenInclusive(group2Ran, 1995, 2000);

代码示例来源:origin: prestodb/presto

int upperBound = binomial.inverseCumulativeProbability(0.999999);
assertBetweenInclusive(group1Ran, lowerBound, upperBound);
assertBetweenInclusive(group2Ran, lowerBound, upperBound);
assertBetweenInclusive(group3Ran, 2 * lowerBound, 2 * upperBound);

代码示例来源:origin: prestodb/presto

assertBetweenInclusive(actualIncreasedMemory, expectedReservedExtraBytes, expectedReservedExtraBytes + additionalMemoryInBytes);
assertBetweenInclusive(rehashedMemoryUsage * 1.0 / newMemoryUsage, 0.99, 1.01);

代码示例来源:origin: airlift/airlift

public static <T extends Comparable<T>> void assertBetweenInclusive(T actual, T lowerBound, T upperBound)
{
  assertBetweenInclusive(actual, lowerBound, upperBound, null);
}

代码示例来源:origin: io.airlift/testing

public static <T extends Comparable<T>> void assertBetweenInclusive(T actual, T lowerBound, T upperBound)
{
  assertBetweenInclusive(actual, lowerBound, upperBound, null);
}

代码示例来源:origin: com.teradata.airlift/testing

public static <T extends Comparable<T>> void assertBetweenInclusive(T actual, T lowerBound, T upperBound)
{
  assertBetweenInclusive(actual, lowerBound, upperBound, null);
}

代码示例来源:origin: airlift/airlift

@SuppressWarnings({"unchecked", "rawtypes"})
public void passBetweenInclusive(Comparable actual, Comparable lowerBound, Comparable upperBound)
{
  assertBetweenInclusive(actual, lowerBound, upperBound);
  assertBetweenInclusive(actual, lowerBound, upperBound, MESSAGE);
}

代码示例来源:origin: com.teradata.airlift/testing

@SuppressWarnings({"RawUseOfParameterizedType"})
public void passBetweenInclusive(Comparable actual, Comparable lowerBound, Comparable upperBound)
{
  Assertions.assertBetweenInclusive(actual, lowerBound, upperBound);
  Assertions.assertBetweenInclusive(actual, lowerBound, upperBound, MESSAGE);
}

代码示例来源:origin: io.airlift/testing

@SuppressWarnings({"unchecked", "rawtypes"})
public void passBetweenInclusive(Comparable actual, Comparable lowerBound, Comparable upperBound)
{
  assertBetweenInclusive(actual, lowerBound, upperBound);
  assertBetweenInclusive(actual, lowerBound, upperBound, MESSAGE);
}

代码示例来源:origin: airlift/airlift

@SuppressWarnings({"unchecked", "rawtypes"})
public void failBetweenInclusive(Comparable actual, Comparable lowerBound, Comparable upperBound)
{
  try {
    assertBetweenInclusive(actual, lowerBound, upperBound);
    fail("Expected AssertionError");
  }
  catch (AssertionError e) {
    verifyExceptionMessage(e, null, actual, lowerBound, upperBound);
  }
  try {
    assertBetweenInclusive(actual, lowerBound, upperBound, MESSAGE);
    fail("Expected AssertionError");
  }
  catch (AssertionError e) {
    verifyExceptionMessage(e, MESSAGE, actual, lowerBound, upperBound);
  }
}

代码示例来源:origin: com.teradata.airlift/testing

@SuppressWarnings({"RawUseOfParameterizedType"})
public void failBetweenInclusive(Comparable actual, Comparable lowerBound, Comparable upperBound)
{
  try {
    Assertions.assertBetweenInclusive(actual, lowerBound, upperBound);
    Assert.fail("Expected AssertionError");
  }
  catch (AssertionError e) {
    verifyExceptionMessage(e, null, actual, lowerBound, upperBound);
  }
  try {
    Assertions.assertBetweenInclusive(actual, lowerBound, upperBound, MESSAGE);
    Assert.fail("Expected AssertionError");
  }
  catch (AssertionError e) {
    verifyExceptionMessage(e, MESSAGE, actual, lowerBound, upperBound);
  }
}

代码示例来源:origin: io.airlift/testing

@SuppressWarnings({"unchecked", "rawtypes"})
public void failBetweenInclusive(Comparable actual, Comparable lowerBound, Comparable upperBound)
{
  try {
    assertBetweenInclusive(actual, lowerBound, upperBound);
    fail("Expected AssertionError");
  }
  catch (AssertionError e) {
    verifyExceptionMessage(e, null, actual, lowerBound, upperBound);
  }
  try {
    assertBetweenInclusive(actual, lowerBound, upperBound, MESSAGE);
    fail("Expected AssertionError");
  }
  catch (AssertionError e) {
    verifyExceptionMessage(e, MESSAGE, actual, lowerBound, upperBound);
  }
}

代码示例来源:origin: io.airlift/http-client-experimental

@Test
public void testKeepAlive()
    throws Exception
{
  URI uri = URI.create(baseURI.toASCIIString() + "/?remotePort=");
  Request request = prepareGet()
      .setUri(uri)
      .build();
  ListMultimap<String, String> headers1 = executeRequest(request, new ResponseHeadersHandler());
  Thread.sleep(1000);
  ListMultimap<String, String> headers2 = executeRequest(request, new ResponseHeadersHandler());
  Thread.sleep(1000);
  ListMultimap<String, String> headers3 = executeRequest(request, new ResponseHeadersHandler());
  Assert.assertEquals(headers1.get("remotePort").size(), 1);
  Assert.assertEquals(headers2.get("remotePort").size(), 1);
  Assert.assertEquals(headers3.get("remotePort").size(), 1);
  int port1 = Integer.parseInt(headers1.get("remotePort").get(0));
  int port2 = Integer.parseInt(headers2.get("remotePort").get(0));
  int port3 = Integer.parseInt(headers3.get("remotePort").get(0));
  Assert.assertEquals(port2, port1);
  Assert.assertEquals(port3, port1);
  Assertions.assertBetweenInclusive(port1, 1024, 65535);
}

代码示例来源:origin: com.teradata.airlift/http-client

@Test
public void testKeepAlive()
    throws Exception
{
  URI uri = URI.create(baseURI.toASCIIString() + "/?remotePort=");
  Request request = prepareGet()
      .setUri(uri)
      .build();
  StatusResponse response1 = executeRequest(request, createStatusResponseHandler());
  Thread.sleep(1000);
  StatusResponse response2 = executeRequest(request, createStatusResponseHandler());
  Thread.sleep(1000);
  StatusResponse response3 = executeRequest(request, createStatusResponseHandler());
  assertNotNull(response1.getHeader("remotePort"));
  assertNotNull(response2.getHeader("remotePort"));
  assertNotNull(response3.getHeader("remotePort"));
  int port1 = Integer.parseInt(response1.getHeader("remotePort"));
  int port2 = Integer.parseInt(response2.getHeader("remotePort"));
  int port3 = Integer.parseInt(response3.getHeader("remotePort"));
  assertEquals(port2, port1);
  assertEquals(port3, port1);
  assertBetweenInclusive(port1, 1024, 65535);
}

代码示例来源:origin: airlift/airlift

@Test
public void testKeepAlive()
    throws Exception
{
  URI uri = URI.create(baseURI.toASCIIString() + "/?remotePort=");
  Request request = prepareGet()
      .setUri(uri)
      .build();
  StatusResponse response1 = executeRequest(request, createStatusResponseHandler());
  Thread.sleep(1000);
  StatusResponse response2 = executeRequest(request, createStatusResponseHandler());
  Thread.sleep(1000);
  StatusResponse response3 = executeRequest(request, createStatusResponseHandler());
  assertNotNull(response1.getHeader("remotePort"));
  assertNotNull(response2.getHeader("remotePort"));
  assertNotNull(response3.getHeader("remotePort"));
  int port1 = Integer.parseInt(response1.getHeader("remotePort"));
  int port2 = Integer.parseInt(response2.getHeader("remotePort"));
  int port3 = Integer.parseInt(response3.getHeader("remotePort"));
  assertEquals(port2, port1);
  assertEquals(port3, port1);
  assertBetweenInclusive(port1, 1024, 65535);
}

代码示例来源:origin: io.airlift/http-client

@Test
public void testKeepAlive()
    throws Exception
{
  URI uri = URI.create(baseURI.toASCIIString() + "/?remotePort=");
  Request request = prepareGet()
      .setUri(uri)
      .build();
  StatusResponse response1 = executeRequest(request, createStatusResponseHandler());
  Thread.sleep(1000);
  StatusResponse response2 = executeRequest(request, createStatusResponseHandler());
  Thread.sleep(1000);
  StatusResponse response3 = executeRequest(request, createStatusResponseHandler());
  assertNotNull(response1.getHeader("remotePort"));
  assertNotNull(response2.getHeader("remotePort"));
  assertNotNull(response3.getHeader("remotePort"));
  int port1 = Integer.parseInt(response1.getHeader("remotePort"));
  int port2 = Integer.parseInt(response2.getHeader("remotePort"));
  int port3 = Integer.parseInt(response3.getHeader("remotePort"));
  assertEquals(port2, port1);
  assertEquals(port3, port1);
  assertBetweenInclusive(port1, 1024, 65535);
}

代码示例来源:origin: uk.co.nichesolutions.presto/presto-hive

assertFalse(operator.isFinished());
  operator.getOutput();
  assertBetweenInclusive(driverContext.getSystemMemoryUsage(), 550000L, 639999L);
  assertFalse(operator.isFinished());
  operator.getOutput();
  assertBetweenInclusive(driverContext.getSystemMemoryUsage(), 450000L, 539999L);
assertBetweenInclusive(driverContext.getSystemMemoryUsage(), 110000L, 119999L);
assertFalse(operator.isFinished());
Page lastPage = operator.getOutput();

代码示例来源:origin: io.prestosql/presto-main

assertBetweenInclusive(group1Ran, 995, 1000);
assertBetweenInclusive(group2Ran, 1995, 2000);

相关文章