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

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

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

Assertions.assertGreaterThanOrEqual介绍

暂无

代码示例

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

assertGreaterThanOrEqual(queryStatsList.size(), 5); // duplicate stats is possible
assertEquals(queryStatsList.get(0).getState(), "QUEUED");
assertEquals(queryStatsList.get(queryStatsList.size() - 1).getState(), "FINISHED");

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

@Test
public void testNoDictionariesBytesLimit()
{
  int stripeMaxBytes = megabytes(100);
  int bytesPerRow = 1024;
  int expectedMaxRowCount = stripeMaxBytes / bytesPerRow;
  DataSimulator simulator = new DataSimulator(0, stripeMaxBytes, expectedMaxRowCount * 2, megabytes(16), bytesPerRow);
  for (int loop = 0; loop < 3; loop++) {
    assertFalse(simulator.isDictionaryMemoryFull());
    assertEquals(simulator.getRowCount(), 0);
    assertEquals(simulator.getBufferedBytes(), 0);
    simulator.advanceToNextStateChange();
    // since there are no dictionary columns, the simulator should advance until the strip is full
    assertFalse(simulator.isDictionaryMemoryFull());
    assertGreaterThanOrEqual(simulator.getBufferedBytes(), (long) stripeMaxBytes);
    assertGreaterThanOrEqual(simulator.getRowCount(), expectedMaxRowCount);
    simulator.finalOptimize();
    assertFalse(simulator.isDictionaryMemoryFull());
    assertGreaterThanOrEqual(simulator.getBufferedBytes(), (long) stripeMaxBytes);
    assertGreaterThanOrEqual(simulator.getRowCount(), expectedMaxRowCount);
    simulator.reset();
  }
}

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

assertTrue(column.isDirect());
assertLessThan(simulator.getBufferedBytes(), (long) stripeMaxBytes);
assertGreaterThanOrEqual(simulator.getRowCount(), expectedRowCountAtFlip);
assertGreaterThanOrEqual(simulator.getBufferedBytes(), (long) stripeMaxBytes);
assertGreaterThanOrEqual(simulator.getRowCount(), expectedMaxRowCountAtFull);
assertGreaterThanOrEqual(simulator.getBufferedBytes(), (long) stripeMaxBytes);
assertGreaterThanOrEqual(simulator.getRowCount(), expectedMaxRowCountAtFull);

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

assertTrue(column.isDirect());
assertLessThan(simulator.getBufferedBytes(), (long) stripeMaxBytes);
assertGreaterThanOrEqual(simulator.getRowCount(), expectedRowCountAtFlip);
assertGreaterThanOrEqual(simulator.getBufferedBytes(), (long) stripeMaxBytes);
assertGreaterThanOrEqual(simulator.getRowCount(), expectedMaxRowCountAtFull);
assertGreaterThanOrEqual(simulator.getBufferedBytes(), (long) stripeMaxBytes);
assertGreaterThanOrEqual(simulator.getRowCount(), expectedMaxRowCountAtFull);

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

assertFalse(dictionaryColumn.isDirect());
assertLessThan(simulator.getBufferedBytes(), (long) stripeMaxBytes);
assertGreaterThanOrEqual(simulator.getRowCount(), expectedRowCountAtFlip);
assertTrue(directColumn.isDirect());
assertFalse(dictionaryColumn.isDirect());
assertGreaterThanOrEqual(simulator.getBufferedBytes(), (long) stripeMaxBytes);
assertGreaterThanOrEqual(simulator.getRowCount(), expectedMaxRowCountAtFull);
assertTrue(directColumn.isDirect());
assertFalse(dictionaryColumn.isDirect());
assertGreaterThanOrEqual(simulator.getBufferedBytes(), (long) stripeMaxBytes);
assertGreaterThanOrEqual(simulator.getRowCount(), expectedMaxRowCountAtFull);

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

@Test
public void testSingleDictionaryColumnByteLimit()
{
  int bytesPerEntry = 1024;
  int dictionaryEntries = 1024;
  TestDictionaryColumn column = dictionaryColumn(bytesPerEntry, dictionaryEntries);
  // construct a simulator that will hit the row limit first
  int stripeMaxBytes = megabytes(100);
  int bytesPerRow = estimateIndexBytesPerValue(dictionaryEntries);
  int expectedMaxRowCount = stripeMaxBytes / bytesPerRow;
  DataSimulator simulator = new DataSimulator(0, stripeMaxBytes, expectedMaxRowCount * 10, megabytes(16), 0, column);
  for (int loop = 0; loop < 3; loop++) {
    assertFalse(simulator.isDictionaryMemoryFull());
    assertFalse(column.isDirect());
    assertEquals(simulator.getRowCount(), 0);
    assertEquals(simulator.getBufferedBytes(), 0);
    simulator.advanceToNextStateChange();
    // since there dictionary columns is only 1 MB, the simulator should advance until the strip is full
    assertFalse(simulator.isDictionaryMemoryFull());
    assertFalse(column.isDirect());
    assertGreaterThanOrEqual(simulator.getBufferedBytes(), (long) stripeMaxBytes);
    assertLessThan(simulator.getRowCount(), expectedMaxRowCount);
    simulator.finalOptimize();
    assertFalse(simulator.isDictionaryMemoryFull());
    assertFalse(column.isDirect());
    assertGreaterThanOrEqual(simulator.getBufferedBytes(), (long) stripeMaxBytes);
    assertLessThan(simulator.getRowCount(), expectedMaxRowCount);
    simulator.reset();
  }
}

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

assertFalse(column.isDirect());
assertLessThan(simulator.getBufferedBytes(), (long) stripeMaxBytes);
assertGreaterThanOrEqual(simulator.getRowCount(), expectedMaxRowCount);
assertFalse(column.isDirect());
assertLessThan(simulator.getBufferedBytes(), (long) stripeMaxBytes);
assertGreaterThanOrEqual(simulator.getRowCount(), expectedMaxRowCount);

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

assertFalse(column.isDirect());
assertLessThan(simulator.getBufferedBytes(), (long) stripeMaxBytes);
assertGreaterThanOrEqual(simulator.getRowCount(), expectedMaxRowCount);
assertFalse(column.isDirect());
assertLessThan(simulator.getBufferedBytes(), (long) stripeMaxBytes);
assertGreaterThanOrEqual(simulator.getRowCount(), expectedMaxRowCount);

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

public void doIntegration(TestingOrcDataSource orcDataSource, DataSize maxMergeDistance, DataSize maxReadSize, DataSize tinyStripeThreshold)
    throws IOException
{
  OrcReader orcReader = new OrcReader(orcDataSource, ORC, maxMergeDistance, maxReadSize, tinyStripeThreshold, new DataSize(1, Unit.MEGABYTE));
  // 1 for reading file footer
  assertEquals(orcDataSource.getReadCount(), 1);
  List<StripeInformation> stripes = orcReader.getFooter().getStripes();
  // Sanity check number of stripes. This can be three or higher because of orc writer low memory mode.
  assertGreaterThanOrEqual(stripes.size(), 3);
  //verify wrapped by CachingOrcReader
  assertInstanceOf(wrapWithCacheIfTinyStripes(orcDataSource, stripes, maxMergeDistance, tinyStripeThreshold), CachingOrcDataSource.class);
  OrcRecordReader orcRecordReader = orcReader.createRecordReader(
      ImmutableMap.of(0, VARCHAR),
      (numberOfRows, statisticsByColumnIndex) -> true,
      HIVE_STORAGE_TIME_ZONE,
      newSimpleAggregatedMemoryContext(),
      INITIAL_BATCH_SIZE);
  int positionCount = 0;
  while (true) {
    int batchSize = orcRecordReader.nextBatch();
    if (batchSize <= 0) {
      break;
    }
    Block block = orcRecordReader.readBlock(VARCHAR, 0);
    positionCount += block.getPositionCount();
  }
  assertEquals(positionCount, POSITION_COUNT);
}

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

assertGreaterThanOrEqual(stream.getLength(), size);
size = stream.getLength();

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

public static <T extends Comparable<T>> void assertGreaterThanOrEqual(T actual, T expected)
{
  assertGreaterThanOrEqual(actual, expected, null);
}

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

public static <T extends Comparable<T>> void assertGreaterThanOrEqual(T actual, T expected)
{
  assertGreaterThanOrEqual(actual, expected, null);
}

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

public static <T extends Comparable<T>> void assertGreaterThanOrEqual(T actual, T expected)
{
  assertGreaterThanOrEqual(actual, expected, null);
}

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

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

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

@SuppressWarnings({"RawUseOfParameterizedType"})
public void passGreaterThanOrEqual(Comparable actual, Comparable expected)
{
  Assertions.assertGreaterThanOrEqual(actual, expected);
  Assertions.assertGreaterThanOrEqual(actual, expected, MESSAGE);
}

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

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

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

@Test
public void time()
    throws Exception
{
  TimedStat stat = new TimedStat();
  stat.time((Callable<Void>) () -> {
    LockSupport.parkNanos(SECONDS.toNanos(10));
    return null;
  });
  assertEquals(stat.getCount(), 1);
  assertEquals(stat.getMin(), stat.getMax());
  assertGreaterThanOrEqual(stat.getMax(), 10.0);
}

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

@Test
public void time()
    throws Exception
{
  TimedStat stat = new TimedStat();
  stat.time((Callable<Void>) () -> {
    LockSupport.parkNanos(SECONDS.toNanos(10));
    return null;
  });
  assertEquals(stat.getCount(), 1);
  assertEquals(stat.getMin(), stat.getMax());
  assertGreaterThanOrEqual(stat.getMax(), 10.0);
}

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

@Test
  public void test()
      throws Exception
  {
    JmxGcMonitor gcMonitor = new JmxGcMonitor();
    assertEquals(gcMonitor.getMajorGcCount(), 0);
    assertEquals(gcMonitor.getMajorGcTime(), new Duration(0, NANOSECONDS));
    try {
      gcMonitor.start();
      assertGreaterThanOrEqual(gcMonitor.getMajorGcCount(), (long) 0);
      assertGreaterThanOrEqual(gcMonitor.getMajorGcTime(), new Duration(0, NANOSECONDS));
    }
    finally {
      gcMonitor.stop();
    }
  }
}

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

@Test
  public void test()
      throws Exception
  {
    JmxGcMonitor gcMonitor = new JmxGcMonitor();
    assertEquals(gcMonitor.getMajorGcCount(), 0);
    assertEquals(gcMonitor.getMajorGcTime(), new Duration(0, NANOSECONDS));
    try {
      gcMonitor.start();
      assertGreaterThanOrEqual(gcMonitor.getMajorGcCount(), (long) 0);
      assertGreaterThanOrEqual(gcMonitor.getMajorGcTime(), new Duration(0, NANOSECONDS));
    }
    finally {
      gcMonitor.stop();
    }
  }
}

相关文章