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

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

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

Assertions.assertGreaterThan介绍

暂无

代码示例

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

private static void assertClosedRetainedSizes(OrcRecordReader reader)
  {
    assertEquals(reader.getCurrentStripeRetainedSizeInBytes(), 0);
    // after close() we still account for the StreamReader instance sizes.
    assertGreaterThan(reader.getStreamReaderRetainedSizeInBytes(), 0L);
    // after close() we still account for the StreamReader instance sizes.
    assertGreaterThan(reader.getRetainedSizeInBytes(), 0L);
    assertEquals(reader.getSystemMemoryUsage(), 0);
  }
}

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

@Test
public void testOrdering()
{
  Iterator<StandardErrorCode> iterator = asList(StandardErrorCode.values()).iterator();
  assertTrue(iterator.hasNext());
  int previous = code(iterator.next());
  while (iterator.hasNext()) {
    StandardErrorCode code = iterator.next();
    int current = code(code);
    assertGreaterThan(current, previous, "Code is out of order: " + code);
    if ((code != GENERIC_INTERNAL_ERROR) && (code != GENERIC_INSUFFICIENT_RESOURCES)) {
      assertEquals(current, previous + 1, "Code is not sequential: " + code);
    }
    previous = current;
  }
}

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

private static void assertInitialRetainedSizes(OrcRecordReader reader, int rows)
{
  assertEquals(reader.getReaderRowCount(), rows);
  assertEquals(reader.getReaderPosition(), 0);
  assertEquals(reader.getCurrentStripeRetainedSizeInBytes(), 0);
  // there will be object overheads
  assertGreaterThan(reader.getStreamReaderRetainedSizeInBytes(), 0L);
  // there will be object overheads
  assertGreaterThan(reader.getRetainedSizeInBytes(), 0L);
  assertEquals(reader.getSystemMemoryUsage(), 0);
}

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

@Test
public void testSplitPage()
{
  int positionCount = 10;
  int maxPageSizeInBytes = 100;
  List<Type> types = ImmutableList.of(BIGINT, BIGINT, BIGINT);
  Page largePage = createSequencePage(types, positionCount, 0, 1, 1);
  List<Page> pages = splitPage(largePage, maxPageSizeInBytes);
  assertGreaterThan(pages.size(), 1);
  assertPageSize(pages, maxPageSizeInBytes);
  assertPositionCount(pages, positionCount);
  MaterializedResult actual = toMaterializedResult(TEST_SESSION, types, pages);
  MaterializedResult expected = toMaterializedResult(TEST_SESSION, types, ImmutableList.of(largePage));
  assertEquals(actual, expected);
}

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

assertGreaterThan(outputPageCount, 3);
assertBuilderSize(groupByHash, types, Collections.nCopies(pageCount, 0), Collections.nCopies(rowCount, 0), groupedTopNBuilder.getEstimatedSizeInBytes());

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

@Test
public void pageProcessingDelay()
{
  Session session = testSessionBuilder()
      .setCatalog("blackhole")
      .setSchema("default")
      .build();
  Duration pageProcessingDelay = new Duration(1, SECONDS);
  assertThatQueryReturnsValue(
      format("CREATE TABLE nation WITH ( %s = 8, %s = 1, %s = 1, %s = 1, %s = '%s' ) AS " +
              "SELECT * FROM tpch.tiny.nation",
          FIELD_LENGTH_PROPERTY,
          ROWS_PER_PAGE_PROPERTY,
          PAGES_PER_SPLIT_PROPERTY,
          SPLIT_COUNT_PROPERTY,
          PAGE_PROCESSING_DELAY,
          pageProcessingDelay),
      25L,
      session);
  Stopwatch stopwatch = Stopwatch.createStarted();
  assertEquals(queryRunner.execute(session, "SELECT * FROM nation").getRowCount(), 1);
  queryRunner.execute(session, "INSERT INTO nation SELECT CAST(null AS BIGINT), CAST(null AS VARCHAR(25)), CAST(null AS BIGINT), CAST(null AS VARCHAR(152))");
  stopwatch.stop();
  assertGreaterThan(stopwatch.elapsed(MILLISECONDS), pageProcessingDelay.toMillis());
  assertThatQueryReturnsValue("DROP TABLE nation", true);
}

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

@Test
public void testAllFormats()
    throws Exception
{
  HiveClientConfig config = new HiveClientConfig();
  File tempDir = Files.createTempDir();
  try {
    ExtendedHiveMetastore metastore = createTestingFileHiveMetastore(new File(tempDir, "metastore"));
    for (HiveStorageFormat format : HiveStorageFormat.values()) {
      config.setHiveStorageFormat(format);
      config.setHiveCompressionCodec(NONE);
      long uncompressedLength = writeTestFile(config, metastore, makeFileName(tempDir, config));
      assertGreaterThan(uncompressedLength, 0L);
      for (HiveCompressionCodec codec : HiveCompressionCodec.values()) {
        if (codec == NONE) {
          continue;
        }
        config.setHiveCompressionCodec(codec);
        long length = writeTestFile(config, metastore, makeFileName(tempDir, config));
        assertTrue(uncompressedLength > length, format("%s with %s compressed to %s which is not less than %s", format, codec, length, uncompressedLength));
      }
    }
  }
  finally {
    deleteRecursively(tempDir.toPath(), ALLOW_INSECURE);
  }
}

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

@Test
  private void testSplitPageNonDecreasingPageSize()
  {
    int positionCount = 100;
    int maxPageSizeInBytes = 1;
    List<Type> types = ImmutableList.of(VARCHAR);

    Slice expectedValue = wrappedBuffer("test".getBytes());
    BlockBuilder blockBuilder = VARCHAR.createBlockBuilder(null, 1, expectedValue.length());
    blockBuilder.writeBytes(expectedValue, 0, expectedValue.length()).closeEntry();
    Block rleBlock = new RunLengthEncodedBlock(blockBuilder.build(), positionCount);
    Page initialPage = new Page(rleBlock);
    List<Page> pages = splitPage(initialPage, maxPageSizeInBytes);

    // the page should only be split in half as the recursion should terminate
    // after seeing that the size of the Page doesn't decrease
    assertEquals(pages.size(), 2);
    Page first = pages.get(0);
    Page second = pages.get(1);

    // the size of the pages will remain the same and should be greater than the maxPageSizeInBytes
    assertGreaterThan((int) first.getSizeInBytes(), maxPageSizeInBytes);
    assertGreaterThan((int) second.getSizeInBytes(), maxPageSizeInBytes);
    assertPositionCount(pages, positionCount);
    MaterializedResult actual = toMaterializedResult(TEST_SESSION, types, pages);
    MaterializedResult expected = toMaterializedResult(TEST_SESSION, types, ImmutableList.of(initialPage));
    assertEquals(actual, expected);
  }
}

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

int upperBound = binomial.inverseCumulativeProbability(0.999999);
assertLessThan(foo, upperBound);
assertGreaterThan(foo, lowerBound);
upperBound = binomial.inverseCumulativeProbability(0.999999);
assertLessThan(foo, upperBound);
assertGreaterThan(foo, lowerBound);

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

assertGreaterThan(reader.getCurrentStripeRetainedSizeInBytes(), stripeReaderRetainedSize);
assertGreaterThan(reader.getRetainedSizeInBytes() - readerRetainedSize, 0L);
assertGreaterThan(reader.getSystemMemoryUsage() - readerSystemMemoryUsage, 0L);

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

assertGreaterThan(reader.getCurrentStripeRetainedSizeInBytes(), stripeReaderRetainedSize);
assertGreaterThan(reader.getRetainedSizeInBytes() - readerRetainedSize, 0L);
assertGreaterThan(reader.getSystemMemoryUsage() - readerSystemMemoryUsage, 0L);

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

assertEquals(statistics.getRowCount().getAsLong(), CREATE_TABLE_DATA.getRowCount());
assertEquals(statistics.getFileCount().getAsLong(), 1L);
assertGreaterThan(statistics.getInMemoryDataSizeInBytes().getAsLong(), 0L);
assertGreaterThan(statistics.getOnDiskDataSizeInBytes().getAsLong(), 0L);

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

assertEquals(partitionStatistics.getRowCount().getAsLong(), 1L);
assertEquals(partitionStatistics.getFileCount().getAsLong(), 1L);
assertGreaterThan(partitionStatistics.getInMemoryDataSizeInBytes().getAsLong(), 0L);
assertGreaterThan(partitionStatistics.getOnDiskDataSizeInBytes().getAsLong(), 0L);

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

assertGreaterThan(reader.getCurrentStripeRetainedSizeInBytes(), stripeReaderRetainedSize);
assertGreaterThan(reader.getRetainedSizeInBytes() - readerRetainedSize, 0L);
assertGreaterThan(reader.getSystemMemoryUsage() - readerSystemMemoryUsage, 0L);

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

assertEquals(statistics.getRowCount().getAsLong(), i + 1L);
assertEquals(statistics.getFileCount().getAsLong(), i + 1L);
assertGreaterThan(statistics.getInMemoryDataSizeInBytes().getAsLong(), 0L);
assertGreaterThan(statistics.getOnDiskDataSizeInBytes().getAsLong(), 0L);

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

assertEquals(tableStatistics.getRowCount().getAsLong(), CREATE_TABLE_DATA.getRowCount() * (i + 1));
assertEquals(tableStatistics.getFileCount().getAsLong(), i + 1L);
assertGreaterThan(tableStatistics.getInMemoryDataSizeInBytes().getAsLong(), 0L);
assertGreaterThan(tableStatistics.getOnDiskDataSizeInBytes().getAsLong(), 0L);

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

int upperBound = binomial.inverseCumulativeProbability(0.999999);
assertLessThan(group2Ran, upperBound);
assertGreaterThan(group2Ran, lowerBound);

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

assertGreaterThan(lowerLevelTime, (higherLevelTime * 2) - 10);
assertLessThan(higherLevelTime, (lowerLevelTime * 2) + 10);

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

assertGreaterThan(getHashCapacity.apply(operator), oldCapacity);

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

@SuppressWarnings({"unchecked", "rawtypes"})
public void passGreaterThan(Comparable actual, Comparable expected)
{
  assertGreaterThan(actual, expected);
  assertGreaterThan(actual, expected, MESSAGE);
}

相关文章