本文整理汇总了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);
}
示例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());
}
示例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());
}
示例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());
}
示例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());
}
示例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());
}
示例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());
}
示例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));
}
示例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));
}
示例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());
}
示例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());
}
示例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));
}