本文整理了Java中org.assertj.core.api.AbstractIterableAssert.isNotEmpty()
方法的一些代码示例,展示了AbstractIterableAssert.isNotEmpty()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。AbstractIterableAssert.isNotEmpty()
方法的具体详情如下:
包路径:org.assertj.core.api.AbstractIterableAssert
类名称:AbstractIterableAssert
方法名:isNotEmpty
暂无
代码示例来源:origin: org.assertj/assertj-core
isNotEmpty();
return toAssert(actual.iterator().next(), navigationDescription("check first element"));
代码示例来源:origin: eclipse-vertx/vert.x
@Test
public void testNoCommandsWhenLoadedFromEmptyClassloader() {
ClassLoader classLoader = new URLClassLoader(new URL[0], null);
// We see the implementation from the classpath
loader = new ServiceCommandFactoryLoader(classLoader);
assertThat(loader.lookup()).isNotEmpty();
}
代码示例来源:origin: joel-costigliola/assertj-core
isNotEmpty();
return toAssert(actual.iterator().next(), navigationDescription("check first element"));
代码示例来源:origin: org.assertj/assertj-core
isNotEmpty();
assertThat(index).describedAs(navigationDescription("check index validity"))
.isBetween(0, IterableUtil.sizeOf(actual) - 1);
代码示例来源:origin: eclipse-vertx/vert.x
@Test
public void testStartingApplicationInRedeployModeWithFileConf2() throws IOException {
cli.dispatch(new Launcher(), new String[]{"run",
HttpTestVerticle.class.getName(), "--redeploy=**" + File.separator + "*.txt",
"--launcher-class=" + Launcher.class.getName(),
"--conf=" + new File("src/test/resources/conf.json").getAbsolutePath()
});
assertWaitUntil(() -> {
try {
return RunCommandTest.getHttpCode() == 200;
} catch (IOException e) {
return false;
}
});
JsonObject conf = RunCommandTest.getContent().getJsonObject("conf");
assertThat(conf).isNotNull().isNotEmpty();
assertThat(conf.getString("name")).isEqualTo("vertx");
}
代码示例来源:origin: eclipse-vertx/vert.x
@Test
public void testStartingApplicationInRedeployModeWithFileConf() throws IOException {
cli.dispatch(new Launcher(), new String[]{"run",
HttpTestVerticle.class.getName(), "--redeploy=**" + File.separator + "*.txt",
"--launcher-class=" + Launcher.class.getName(),
"--conf", new File("src/test/resources/conf.json").getAbsolutePath()
});
assertWaitUntil(() -> {
try {
return RunCommandTest.getHttpCode() == 200;
} catch (IOException e) {
return false;
}
});
JsonObject conf = RunCommandTest.getContent().getJsonObject("conf");
assertThat(conf).isNotNull().isNotEmpty();
assertThat(conf.getString("name")).isEqualTo("vertx");
}
代码示例来源:origin: joel-costigliola/assertj-core
isNotEmpty();
assertThat(index).describedAs(navigationDescription("check index validity"))
.isBetween(0, IterableUtil.sizeOf(actual) - 1);
代码示例来源:origin: org.assertj/assertj-core
isNotEmpty();
return toAssert(lastElement(), navigationDescription("check last element"));
代码示例来源:origin: eclipse-vertx/vert.x
@Test
public void testStartingApplicationInRedeployModeWithInlineConf2() throws IOException {
int random = (int) (Math.random() * 100);
cli.dispatch(new Launcher(), new String[]{"run",
HttpTestVerticle.class.getName(), "--redeploy=**" + File.separator + "*.txt",
"--launcher-class=" + Launcher.class.getName(),
"--conf={\"random\":" + random + "}"
});
assertWaitUntil(() -> {
try {
return RunCommandTest.getHttpCode() == 200;
} catch (IOException e) {
return false;
}
});
JsonObject conf = RunCommandTest.getContent().getJsonObject("conf");
assertThat(conf).isNotNull().isNotEmpty();
assertThat(conf.getInteger("random")).isEqualTo(random);
}
代码示例来源:origin: eclipse-vertx/vert.x
@Test
public void testStartingApplicationInRedeployModeWithInlineConf() throws IOException {
int random = (int) (Math.random() * 100);
cli.dispatch(new Launcher(), new String[]{"run",
HttpTestVerticle.class.getName(), "--redeploy=**" + File.separator + "*.txt",
"--launcher-class=" + Launcher.class.getName(),
"--conf", "{\"random\":" + random + "}"
});
assertWaitUntil(() -> {
try {
return RunCommandTest.getHttpCode() == 200;
} catch (IOException e) {
return false;
}
});
JsonObject conf = RunCommandTest.getContent().getJsonObject("conf");
assertThat(conf).isNotNull().isNotEmpty();
assertThat(conf.getInteger("random")).isEqualTo(random);
}
代码示例来源:origin: joel-costigliola/assertj-core
isNotEmpty();
return toAssert(lastElement(), navigationDescription("check last element"));
代码示例来源:origin: facebook/litho
@Test
public void testChangeSetCompleteCallbacksIsNotEmptyWithInsertBeforeMount() {
final RecyclerView recyclerView = mock(RecyclerView.class);
final ChangeSetCompleteCallback changeSetCompleteCallback =
mock(ChangeSetCompleteCallback.class);
final RecyclerBinder recyclerBinder =
new RecyclerBinder.Builder().rangeRatio(RANGE_RATIO).build(mComponentContext);
final ArrayList<RenderInfo> renderInfos = new ArrayList<>();
for (int i = 0; i < 5; i++) {
final Component component =
TestDrawableComponent.create(mComponentContext).widthPx(100).heightPx(100).build();
renderInfos.add(ComponentRenderInfo.create().component(component).build());
}
recyclerBinder.insertRangeAt(0, renderInfos);
recyclerBinder.notifyChangeSetComplete(true, changeSetCompleteCallback);
// Mount view after insertions
recyclerBinder.mount(recyclerView);
assertThat(recyclerBinder.mDataRenderedCallbacks).isNotEmpty();
}
代码示例来源:origin: facebook/litho
@Test
public void testChangeSetCompleteCallbacksIsNotEmptyWithAsyncInsertBeforeMount() {
final RecyclerView recyclerView = mock(RecyclerView.class);
final ChangeSetCompleteCallback changeSetCompleteCallback =
mock(ChangeSetCompleteCallback.class);
final RecyclerBinder recyclerBinder =
new RecyclerBinder.Builder().rangeRatio(RANGE_RATIO).build(mComponentContext);
final ArrayList<RenderInfo> renderInfos = new ArrayList<>();
for (int i = 0; i < 5; i++) {
final Component component =
TestDrawableComponent.create(mComponentContext).widthPx(100).heightPx(100).build();
renderInfos.add(ComponentRenderInfo.create().component(component).build());
}
recyclerBinder.insertRangeAtAsync(0, renderInfos);
recyclerBinder.notifyChangeSetCompleteAsync(true, changeSetCompleteCallback);
recyclerBinder.measure(
new Size(), makeSizeSpec(1000, EXACTLY), makeSizeSpec(1000, EXACTLY), null);
mLayoutThreadShadowLooper.runToEndOfTasks();
// Mount view after insertions
recyclerBinder.mount(recyclerView);
assertThat(recyclerBinder.mDataRenderedCallbacks).isNotEmpty();
}
代码示例来源:origin: facebook/litho
.doesNotContain(testElt5)
.hasSize(3)
.isNotEmpty();
assertThat(checkIterator(set)).isTrue();
代码示例来源:origin: io.vertx/vertx-core
@Test
public void testNoCommandsWhenLoadedFromEmptyClassloader() {
ClassLoader classLoader = new URLClassLoader(new URL[0], null);
// We see the implementation from the classpath
loader = new ServiceCommandFactoryLoader(classLoader);
assertThat(loader.lookup()).isNotEmpty();
}
代码示例来源:origin: io.vertx/vertx-core
@Test
public void testStartingApplicationInRedeployModeWithFileConf() throws IOException {
cli.dispatch(new Launcher(), new String[]{"run",
HttpTestVerticle.class.getName(), "--redeploy=**" + File.separator + "*.txt",
"--launcher-class=" + Launcher.class.getName(),
"--conf", new File("src/test/resources/conf.json").getAbsolutePath()
});
assertWaitUntil(() -> {
try {
return RunCommandTest.getHttpCode() == 200;
} catch (IOException e) {
return false;
}
});
JsonObject conf = RunCommandTest.getContent().getJsonObject("conf");
assertThat(conf).isNotNull().isNotEmpty();
assertThat(conf.getString("name")).isEqualTo("vertx");
}
代码示例来源:origin: io.vertx/vertx-core
@Test
public void testStartingApplicationInRedeployModeWithFileConf2() throws IOException {
cli.dispatch(new Launcher(), new String[]{"run",
HttpTestVerticle.class.getName(), "--redeploy=**" + File.separator + "*.txt",
"--launcher-class=" + Launcher.class.getName(),
"--conf=" + new File("src/test/resources/conf.json").getAbsolutePath()
});
assertWaitUntil(() -> {
try {
return RunCommandTest.getHttpCode() == 200;
} catch (IOException e) {
return false;
}
});
JsonObject conf = RunCommandTest.getContent().getJsonObject("conf");
assertThat(conf).isNotNull().isNotEmpty();
assertThat(conf.getString("name")).isEqualTo("vertx");
}
代码示例来源:origin: io.vertx/vertx-core
@Test
public void testStartingApplicationInRedeployModeWithInlineConf() throws IOException {
int random = (int) (Math.random() * 100);
cli.dispatch(new Launcher(), new String[]{"run",
HttpTestVerticle.class.getName(), "--redeploy=**" + File.separator + "*.txt",
"--launcher-class=" + Launcher.class.getName(),
"--conf", "{\"random\":" + random + "}"
});
assertWaitUntil(() -> {
try {
return RunCommandTest.getHttpCode() == 200;
} catch (IOException e) {
return false;
}
});
JsonObject conf = RunCommandTest.getContent().getJsonObject("conf");
assertThat(conf).isNotNull().isNotEmpty();
assertThat(conf.getInteger("random")).isEqualTo(random);
}
代码示例来源:origin: io.vertx/vertx-core
@Test
public void testStartingApplicationInRedeployModeWithInlineConf2() throws IOException {
int random = (int) (Math.random() * 100);
cli.dispatch(new Launcher(), new String[]{"run",
HttpTestVerticle.class.getName(), "--redeploy=**" + File.separator + "*.txt",
"--launcher-class=" + Launcher.class.getName(),
"--conf={\"random\":" + random + "}"
});
assertWaitUntil(() -> {
try {
return RunCommandTest.getHttpCode() == 200;
} catch (IOException e) {
return false;
}
});
JsonObject conf = RunCommandTest.getContent().getJsonObject("conf");
assertThat(conf).isNotNull().isNotEmpty();
assertThat(conf.getInteger("random")).isEqualTo(random);
}
代码示例来源:origin: com.datastax.cassandra/cassandra-driver-core
@Test(groups = "short", dataProvider = "newKeyspaceName")
public void should_notify_of_keyspace_drop(String keyspace) throws InterruptedException {
execute(CREATE_KEYSPACE, keyspace);
for (SchemaChangeListener listener : listeners) {
ArgumentCaptor<KeyspaceMetadata> added = ArgumentCaptor.forClass(KeyspaceMetadata.class);
verify(listener, timeout(NOTIF_TIMEOUT_MS).times(1)).onKeyspaceAdded(added.capture());
assertThat(added.getValue()).hasName(handleId(keyspace));
}
for (Metadata m : metadatas())
assertThat(m.getReplicas(keyspace, Bytes.fromHexString("0xCAFEBABE"))).isNotEmpty();
execute(CREATE_TABLE, keyspace); // to test table drop notifications
execute(DROP_KEYSPACE, keyspace);
for (SchemaChangeListener listener : listeners) {
ArgumentCaptor<TableMetadata> table = ArgumentCaptor.forClass(TableMetadata.class);
verify(listener, timeout(NOTIF_TIMEOUT_MS).times(1)).onTableRemoved(table.capture());
assertThat(table.getValue()).hasName("table1").isInKeyspace(handleId(keyspace));
ArgumentCaptor<KeyspaceMetadata> ks = ArgumentCaptor.forClass(KeyspaceMetadata.class);
verify(listener, timeout(NOTIF_TIMEOUT_MS).times(1)).onKeyspaceRemoved(ks.capture());
assertThat(ks.getValue()).hasName(handleId(keyspace));
}
for (Metadata m : metadatas()) {
assertThat(m.getKeyspace(keyspace)).isNull();
assertThat(m.getReplicas(keyspace, Bytes.fromHexString("0xCAFEBABE"))).isEmpty();
}
}
内容来源于网络,如有侵权,请联系作者删除!