当前位置: 首页>>代码示例>>Java>>正文


Java TestUtils.randomLong方法代码示例

本文整理汇总了Java中io.vertx.test.core.TestUtils.randomLong方法的典型用法代码示例。如果您正苦于以下问题:Java TestUtils.randomLong方法的具体用法?Java TestUtils.randomLong怎么用?Java TestUtils.randomLong使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在io.vertx.test.core.TestUtils的用法示例。


在下文中一共展示了TestUtils.randomLong方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: testTestOptions

import io.vertx.test.core.TestUtils; //导入方法依赖的package包/类
@org.junit.Test
public void testTestOptions() {
  TestOptions options = new TestOptions();
  assertEquals(TestOptions.DEFAULT_TIMEOUT, options.getTimeout());
  assertEquals(TestOptions.DEFAULT_USE_EVENT_LOOP, options.isUseEventLoop());
  assertEquals(Collections.<ReportOptions>emptyList(), options.getReporters());
  long timeout = TestUtils.randomLong();
  Boolean useEventLoop = randomBoolean();
  assertSame(options, options.setTimeout(timeout));
  assertSame(options, options.setUseEventLoop(useEventLoop));
  assertEquals(timeout, options.getTimeout());
  assertEquals(useEventLoop, options.isUseEventLoop());
  List<ReportOptions> reporters = new ArrayList<>();
  ReportOptions reporter1 = new ReportOptions();
  reporters.add(reporter1);
  assertSame(options, options.setReporters(reporters));
  assertEquals(reporters, options.getReporters());
  ReportOptions reporter2 = new ReportOptions();
  assertSame(options, options.addReporter(reporter2));
  assertEquals(reporters, options.getReporters());
  assertEquals(2, reporters.size());
  assertEquals(Arrays.asList(reporter1, reporter2), reporters);
}
 
开发者ID:vert-x3,项目名称:vertx-unit,代码行数:24,代码来源:OptionsTest.java

示例2: testCopyOptions

import io.vertx.test.core.TestUtils; //导入方法依赖的package包/类
@org.junit.Test
public void testCopyOptions() {
  TestOptions options = new TestOptions();
  long timeout = TestUtils.randomLong();
  Boolean useEventLoop = randomBoolean();
  String to = TestUtils.randomAlphaString(10);
  String at = TestUtils.randomAlphaString(10);
  String format = TestUtils.randomAlphaString(10);
  ReportOptions reporter = new ReportOptions().setTo(to).setFormat(format);
  options.setUseEventLoop(useEventLoop).setTimeout(timeout).addReporter(reporter);
  TestOptions copy = new TestOptions(options);
  options.setTimeout(TestUtils.randomLong());
  options.setUseEventLoop(randomBoolean());
  reporter.setTo(TestUtils.randomAlphaString(10));
  reporter.setFormat(TestUtils.randomAlphaString(10));
  options.getReporters().clear();
  assertEquals(timeout, copy.getTimeout());
  assertEquals(useEventLoop, copy.isUseEventLoop());
  assertEquals(1, copy.getReporters().size());
  assertEquals(to, copy.getReporters().get(0).getTo());
  assertEquals(format, copy.getReporters().get(0).getFormat());
}
 
开发者ID:vert-x3,项目名称:vertx-unit,代码行数:23,代码来源:OptionsTest.java

示例3: testJsonOptions

import io.vertx.test.core.TestUtils; //导入方法依赖的package包/类
@org.junit.Test
public void testJsonOptions() {
  JsonObject json = new JsonObject();
  long timeout = TestUtils.randomLong();
  Boolean useEventLoop = randomBoolean();
  String to = TestUtils.randomAlphaString(10);
  String at = TestUtils.randomAlphaString(10);
  String format = TestUtils.randomAlphaString(10);
  json.put("timeout", timeout);
  if (useEventLoop != null) {
    json.put("useEventLoop", useEventLoop);
  }
  json.put("reporters", new JsonArray().
      add(new JsonObject().
          put("to", to).
          put("at", at).
          put("format", format)));
  TestOptions options = new TestOptions(json);
  assertEquals(timeout, options.getTimeout());
  assertEquals(useEventLoop, options.isUseEventLoop());
  assertEquals(1, options.getReporters().size());
  assertEquals(to, options.getReporters().get(0).getTo());
  assertEquals(format, options.getReporters().get(0).getFormat());
}
 
开发者ID:vert-x3,项目名称:vertx-unit,代码行数:25,代码来源:OptionsTest.java

示例4: testMongoClientBulkWriteStatuses

import io.vertx.test.core.TestUtils; //导入方法依赖的package包/类
@Test
public void testMongoClientBulkWriteStatuses() {
  long randomMatched = TestUtils.randomLong();
  long randomModified = TestUtils.randomLong();
  long randomInserted = TestUtils.randomLong();
  long randomDeleted = TestUtils.randomLong();
  List<JsonObject> upserts = randomUpsertIds();

  MongoClientBulkWriteResult mongoClientBulkWriteResult = new MongoClientBulkWriteResult(randomInserted,
      randomMatched, randomDeleted, randomModified, upserts);

  assertEquals(randomMatched, mongoClientBulkWriteResult.getMatchedCount());
  assertEquals(randomModified, mongoClientBulkWriteResult.getModifiedCount());
  assertEquals(randomInserted, mongoClientBulkWriteResult.getInsertedCount());
  assertEquals(randomDeleted, mongoClientBulkWriteResult.getDeletedCount());
  assertEquals(upserts, mongoClientBulkWriteResult.getUpserts());
}
 
开发者ID:vert-x3,项目名称:vertx-mongo-client,代码行数:18,代码来源:MongoClientBulkWriteResultTest.java

示例5: testCopyMongoClientBulkWriteResult

import io.vertx.test.core.TestUtils; //导入方法依赖的package包/类
@Test
public void testCopyMongoClientBulkWriteResult() {
  MongoClientBulkWriteResult mongoClientBulkWriteResultOrigin = new MongoClientBulkWriteResult(TestUtils.randomLong(),
      TestUtils.randomLong(), TestUtils.randomLong(), TestUtils.randomLong(), randomUpsertIds());

  MongoClientBulkWriteResult mongoClientBulkWriteResultCopy = new MongoClientBulkWriteResult(
      mongoClientBulkWriteResultOrigin);

  assertEquals(mongoClientBulkWriteResultCopy.getMatchedCount(), mongoClientBulkWriteResultOrigin.getMatchedCount());
  assertEquals(mongoClientBulkWriteResultCopy.getModifiedCount(),
      mongoClientBulkWriteResultOrigin.getModifiedCount());
  assertEquals(mongoClientBulkWriteResultCopy.getInsertedCount(),
      mongoClientBulkWriteResultOrigin.getInsertedCount());
  assertEquals(mongoClientBulkWriteResultCopy.getDeletedCount(), mongoClientBulkWriteResultOrigin.getDeletedCount());
  assertEquals(mongoClientBulkWriteResultCopy.getUpserts(), mongoClientBulkWriteResultOrigin.getUpserts());
}
 
开发者ID:vert-x3,项目名称:vertx-mongo-client,代码行数:17,代码来源:MongoClientBulkWriteResultTest.java

示例6: testMongoClientDeleteResultWithRemovedCountSpecified

import io.vertx.test.core.TestUtils; //导入方法依赖的package包/类
@Test
public void testMongoClientDeleteResultWithRemovedCountSpecified() {
  long randomRemoved = TestUtils.randomLong();
  MongoClientDeleteResult mongoClientDeleteResult = new MongoClientDeleteResult(randomRemoved);

  assertEquals(randomRemoved, mongoClientDeleteResult.getRemovedCount());
}
 
开发者ID:vert-x3,项目名称:vertx-mongo-client,代码行数:8,代码来源:MongoClientDeleteResultTest.java

示例7: testCopyMongoClientDeleteResult

import io.vertx.test.core.TestUtils; //导入方法依赖的package包/类
@Test
public void testCopyMongoClientDeleteResult() {
  MongoClientDeleteResult origin = new MongoClientDeleteResult(TestUtils.randomLong());
  MongoClientDeleteResult copy = new MongoClientDeleteResult(origin);

  assertEquals(origin.getRemovedCount(), copy.getRemovedCount());
}
 
开发者ID:vert-x3,项目名称:vertx-mongo-client,代码行数:8,代码来源:MongoClientDeleteResultTest.java

示例8: logicallyEqual

import io.vertx.test.core.TestUtils; //导入方法依赖的package包/类
private void logicallyEqual() {
  long randomRemoved = TestUtils.randomLong();
  MongoClientDeleteResult mongoClientDeleteResult1 = new MongoClientDeleteResult(randomRemoved);
  MongoClientDeleteResult mongoClientDeleteResult2 = new MongoClientDeleteResult(randomRemoved);
  assertTrue(mongoClientDeleteResult1.equals(mongoClientDeleteResult2));
  assertTrue(mongoClientDeleteResult2.equals(mongoClientDeleteResult1));
}
 
开发者ID:vert-x3,项目名称:vertx-mongo-client,代码行数:8,代码来源:MongoClientDeleteResultTest.java

示例9: logicallyEqual

import io.vertx.test.core.TestUtils; //导入方法依赖的package包/类
private void logicallyEqual() {
  long randomMatched = TestUtils.randomLong();
  long randomModified = TestUtils.randomLong();
  long randomInserted = TestUtils.randomLong();
  long randomDeleted = TestUtils.randomLong();
  List<JsonObject> upserts = randomUpsertIds();

  MongoClientBulkWriteResult mongoClientBulkWriteResult1 = new MongoClientBulkWriteResult(randomInserted,
      randomMatched, randomDeleted, randomModified, upserts);
  MongoClientBulkWriteResult mongoClientBulkWriteResult2 = new MongoClientBulkWriteResult(randomInserted,
      randomMatched, randomDeleted, randomModified, upserts);

  assertTrue(mongoClientBulkWriteResult1.equals(mongoClientBulkWriteResult2));
  assertTrue(mongoClientBulkWriteResult2.equals(mongoClientBulkWriteResult1));
}
 
开发者ID:vert-x3,项目名称:vertx-mongo-client,代码行数:16,代码来源:MongoClientBulkWriteResultTest.java

示例10: testMongoClientUpdateResultStatuses

import io.vertx.test.core.TestUtils; //导入方法依赖的package包/类
@Test
public void testMongoClientUpdateResultStatuses() {
  long randomMatched = TestUtils.randomLong();
  JsonObject randomUpsertedId = randomUpsertId();
  long randomModified = TestUtils.randomLong();

  MongoClientUpdateResult mongoClientUpdateResult = new MongoClientUpdateResult(randomMatched, randomUpsertedId, randomModified);

  assertEquals(randomMatched, mongoClientUpdateResult.getDocMatched());
  assertEquals(randomUpsertedId, mongoClientUpdateResult.getDocUpsertedId());
  assertEquals(randomModified, mongoClientUpdateResult.getDocModified());
}
 
开发者ID:vert-x3,项目名称:vertx-mongo-client,代码行数:13,代码来源:MongoClientUpdateResultTest.java

示例11: testCopyMongoClientUpdateResult

import io.vertx.test.core.TestUtils; //导入方法依赖的package包/类
@Test
public void testCopyMongoClientUpdateResult() {
  MongoClientUpdateResult mongoClientUpdateResultOrigin = new MongoClientUpdateResult(TestUtils.randomLong(),
    randomUpsertId(), TestUtils.randomLong());
  MongoClientUpdateResult mongoClientUpdateResultCopy = new MongoClientUpdateResult(mongoClientUpdateResultOrigin);

  assertEquals(mongoClientUpdateResultOrigin.getDocMatched(), mongoClientUpdateResultCopy.getDocMatched());
  assertEquals(mongoClientUpdateResultOrigin.getDocUpsertedId(), mongoClientUpdateResultCopy.getDocUpsertedId());
  assertEquals(mongoClientUpdateResultOrigin.getDocModified(), mongoClientUpdateResultCopy.getDocModified());
}
 
开发者ID:vert-x3,项目名称:vertx-mongo-client,代码行数:11,代码来源:MongoClientUpdateResultTest.java

示例12: logicallyEqual

import io.vertx.test.core.TestUtils; //导入方法依赖的package包/类
private void logicallyEqual() {
  long randomMatched = TestUtils.randomLong();
  JsonObject randomUpsertedId = randomUpsertId();
  long randomModified = TestUtils.randomLong();
  MongoClientUpdateResult mongoClientUpdateResult1 = new MongoClientUpdateResult(randomMatched, randomUpsertedId, randomModified);
  MongoClientUpdateResult mongoClientUpdateResult2 = new MongoClientUpdateResult(randomMatched, randomUpsertedId, randomModified);
  assertTrue(mongoClientUpdateResult1.equals(mongoClientUpdateResult2));
  assertTrue(mongoClientUpdateResult2.equals(mongoClientUpdateResult1));
}
 
开发者ID:vert-x3,项目名称:vertx-mongo-client,代码行数:10,代码来源:MongoClientUpdateResultTest.java


注:本文中的io.vertx.test.core.TestUtils.randomLong方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。