本文整理了Java中org.assertj.core.api.AbstractIterableAssert.isNotNull()
方法的一些代码示例,展示了AbstractIterableAssert.isNotNull()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。AbstractIterableAssert.isNotNull()
方法的具体详情如下:
包路径:org.assertj.core.api.AbstractIterableAssert
类名称:AbstractIterableAssert
方法名:isNotNull
暂无
代码示例来源:origin: org.assertj/assertj-core
@Override
public SELF isNotNull() {
return super.isNotNull();
}
代码示例来源:origin: joel-costigliola/assertj-core
@Override
public SELF isNotNull() {
return super.isNotNull();
}
代码示例来源:origin: facebook/litho
public LithoViewAssert containsTestKey(String testKey, OccurrenceCount count) {
final Deque<TestItem> testItems = LithoViewTestHelper.findTestItems(actual, testKey);
Java6Assertions.assertThat(testItems)
.hasSize(count.times)
.overridingErrorMessage(
"Expected to find test key <%s> in LithoView <%s> %s, but %s.",
testKey,
actual,
count,
testItems.isEmpty() ?
"couldn't find it" :
String.format(Locale.ROOT, "saw it %d times instead", testItems.size()))
.isNotNull();
return this;
}
代码示例来源:origin: eclipse-vertx/vert.x
@Test
public void loadFactoriesWithClassloader() throws Exception {
ClassLoader custom = new URLClassLoader(new URL[]{new File("target/externals").toURI().toURL()});
// Try without the custom classloader.
Collection<SomeFactory> factories = ServiceHelper.loadFactories(SomeFactory.class);
assertThat(factories)
.isNotNull()
.hasSize(0);
// Try with the custom classloader
factories = ServiceHelper.loadFactories(SomeFactory.class, custom);
assertThat(factories)
.isNotNull()
.hasSize(1);
assertThat(factories.iterator().next().classloader()).isEqualTo(custom);
}
代码示例来源:origin: eclipse-vertx/vert.x
@Test
public void loadFactories() throws Exception {
Collection<FakeFactory> factories = ServiceHelper.loadFactories(FakeFactory.class);
assertThat(factories)
.isNotNull()
.hasSize(2);
Collection<NotImplementedSPI> impl = ServiceHelper.loadFactories(NotImplementedSPI.class);
assertThat(impl)
.isNotNull()
.hasSize(0);
}
代码示例来源:origin: eclipse-vertx/vert.x
@Test
public void loadFactoriesFromTCCL() throws Exception {
ClassLoader custom = new URLClassLoader(new URL[]{new File("target/externals").toURI().toURL()});
// Try without the TCCL classloader.
Collection<SomeFactory> factories = ServiceHelper.loadFactories(SomeFactory.class);
assertThat(factories)
.isNotNull()
.hasSize(0);
// Try with the TCCL classloader
final ClassLoader originalTCCL = Thread.currentThread().getContextClassLoader();
try {
Thread.currentThread().setContextClassLoader(custom);
factories = ServiceHelper.loadFactories(SomeFactory.class);
assertThat(factories)
.isNotNull()
.hasSize(1);
assertThat(factories.iterator().next().classloader()).isEqualTo(custom);
} finally {
Thread.currentThread().setContextClassLoader(originalTCCL);
}
}
代码示例来源: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: 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: io.vertx/vertx-core
@Test
public void loadFactoriesWithClassloader() throws Exception {
ClassLoader custom = new URLClassLoader(new URL[]{new File("target/externals").toURI().toURL()});
// Try without the custom classloader.
Collection<SomeFactory> factories = ServiceHelper.loadFactories(SomeFactory.class);
assertThat(factories)
.isNotNull()
.hasSize(0);
// Try with the custom classloader
factories = ServiceHelper.loadFactories(SomeFactory.class, custom);
assertThat(factories)
.isNotNull()
.hasSize(1);
assertThat(factories.iterator().next().classloader()).isEqualTo(custom);
}
代码示例来源:origin: io.vertx/vertx-core
@Test
public void loadFactories() throws Exception {
Collection<FakeFactory> factories = ServiceHelper.loadFactories(FakeFactory.class);
assertThat(factories)
.isNotNull()
.hasSize(2);
Collection<NotImplementedSPI> impl = ServiceHelper.loadFactories(NotImplementedSPI.class);
assertThat(impl)
.isNotNull()
.hasSize(0);
}
代码示例来源:origin: io.vertx/vertx-core
@Test
public void loadFactoriesFromTCCL() throws Exception {
ClassLoader custom = new URLClassLoader(new URL[]{new File("target/externals").toURI().toURL()});
// Try without the TCCL classloader.
Collection<SomeFactory> factories = ServiceHelper.loadFactories(SomeFactory.class);
assertThat(factories)
.isNotNull()
.hasSize(0);
// Try with the TCCL classloader
final ClassLoader originalTCCL = Thread.currentThread().getContextClassLoader();
try {
Thread.currentThread().setContextClassLoader(custom);
factories = ServiceHelper.loadFactories(SomeFactory.class);
assertThat(factories)
.isNotNull()
.hasSize(1);
assertThat(factories.iterator().next().classloader()).isEqualTo(custom);
} finally {
Thread.currentThread().setContextClassLoader(originalTCCL);
}
}
代码示例来源: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
createType(udt).addColumn("first", DataType.text()).addColumn("last", DataType.text()));
UserType userType = cluster().getMetadata().getKeyspace(keyspace).getUserType(udt);
assertThat(userType).isNotNull();
代码示例来源:origin: com.datastax.cassandra/cassandra-driver-core
assertThat(schemaDisabledCluster.getMetadata().newTokenRange(token1, token2)).isNotNull();
assertThat(schemaDisabledCluster.getMetadata().getTokenRanges()).isNotNull().isNotEmpty();
代码示例来源:origin: apache/archiva
@Test
public void testGetProjectsWithOtherNamespacesPresent()
throws Exception
{
ProjectMetadata projectMetadata = new ProjectMetadata();
projectMetadata.setId( TEST_PROJECT );
projectMetadata.setNamespace( "org.apache.maven" );
repository.updateProject( TEST_REPO_ID, projectMetadata );
repository.updateNamespace( TEST_REPO_ID, "org.apache.maven.shared" );
Collection<String> projects = repository.getProjects( TEST_REPO_ID, "org.apache.maven" );
assertThat( projects ).isNotNull().isNotEmpty().hasSize( 1 ).contains( TEST_PROJECT );
}
内容来源于网络,如有侵权,请联系作者删除!