/** * Assert the specified <code>condition</code> is <code>false</code>. If the condition is <code>true</code>, an assertion error is thrown * otherwise the execution continue. * @param condition the condition to assert * @param message the failure message * @return a reference to this, so the API can be used fluently */ public io.vertx.rxjava.ext.unit.TestContext assertFalse(boolean condition, String message) { delegate.assertFalse(condition, message); return this; }
/** * Assert the specified <code>condition</code> is <code>false</code>. If the condition is <code>true</code>, an assertion error is thrown * otherwise the execution continue. * @param condition the condition to assert * @return a reference to this, so the API can be used fluently */ public io.vertx.rxjava.ext.unit.TestContext assertFalse(boolean condition) { delegate.assertFalse(condition); return this; }
/** * Assert the specified <code>condition</code> is <code>false</code>. If the condition is <code>true</code>, an assertion error is thrown * otherwise the execution continue. * @param condition the condition to assert * @return a reference to this, so the API can be used fluently */ public io.vertx.rxjava.ext.unit.TestContext assertFalse(boolean condition) { delegate.assertFalse(condition); return this; }
/** * Assert the specified <code>condition</code> is <code>false</code>. If the condition is <code>true</code>, an assertion error is thrown * otherwise the execution continue. * @param condition the condition to assert * @param message the failure message * @return a reference to this, so the API can be used fluently */ public io.vertx.rxjava.ext.unit.TestContext assertFalse(boolean condition, String message) { delegate.assertFalse(condition, message); return this; }
@Override public void complete(String value, boolean terminal) { context.assertFalse(terminal); context.assertEquals("completed_by_foo", value); async.complete(); } });
@Override public void complete(String value, boolean terminal) { context.assertFalse(terminal); context.assertEquals("a", value); async.complete(); } });
private void deleteFileInDir(TestContext context, FileSystem fs, String path) { if (fs.existsBlocking(path)) { fs.deleteBlocking(path); } context.assertFalse(fs.existsBlocking(path)); }
@Test public void testNoSuchTemplate(TestContext should) { final Async test = should.async(); TemplateEngine engine = PebbleTemplateEngine.create(vertx); final JsonObject context = new JsonObject(); engine.render(context, "non-existing", render -> { should.assertFalse(render.succeeded()); test.complete(); }); test.await(); }
@Test public void testNoSuchTemplate(TestContext should) { final Async test = should.async(); TemplateEngine engine = ThymeleafTemplateEngine.create(vertx); final JsonObject context = new JsonObject(); engine.render(context, "nosuchtemplate.html", render -> { should.assertFalse(render.succeeded()); test.complete(); }); test.await(); }
@Test public void testNoSuchTemplate(TestContext should) { final Async test = should.async(); TemplateEngine engine = MVELTemplateEngine.create(vertx); engine.render(new JsonObject(), "nosuchtemplate.templ", render -> { should.assertFalse(render.succeeded()); test.complete(); }); test.await(); }
@Test public void testNoSuchTemplate(TestContext should) { final Async test = should.async(); TemplateEngine engine = RockerTemplateEngine.create(); final JsonObject context = new JsonObject(); engine.render(context, "nosuchtemplate.rocker.html", render -> { should.assertFalse(render.succeeded()); test.complete(); }); test.await(); }
@Test public void testNoSuchTemplate(TestContext should) { final Async test = should.async(); TemplateEngine engine = JadeTemplateEngine.create(vertx).setExtension("made"); final JsonObject context = new JsonObject(); engine.render(context, "somedir/foo", render -> { should.assertFalse(render.succeeded()); test.complete(); }); test.await(); }
@Test public void testLastAccessed(TestContext context) throws Exception { startShellServer(context, 100, 100); TestTtyConnection conn = termServer.openConnection(); for (int i = 0; i < 100; i++) { conn.read("" + i); Thread.sleep(10); context.assertFalse(conn.isClosed()); } context.assertTrue(conn.getCloseLatch().await(2, TimeUnit.SECONDS)); }
@Test public void testCloseRegistryOnVertxClose(TestContext context) { Vertx vertx = Vertx.vertx(); CommandRegistryImpl registry = (CommandRegistryImpl) CommandRegistry.getShared(vertx); context.assertFalse(registry.isClosed()); vertx.close(context.asyncAssertSuccess(v -> { context.assertTrue(registry.isClosed()); })); }
@Test public void keyNotFound(TestContext tc) { String key = randomFooBarUnicode(); ctx.readClient() .getValue(key, tc.asyncAssertSuccess(kv -> { tc.assertFalse(kv.isPresent()); })); }
@Test public void keysNotFound(TestContext tc) { String key = randomFooBarUnicode(); ctx.readClient() .getValues(key, tc.asyncAssertSuccess(list -> { tc.assertFalse(list.isPresent()); })); }
@Test public void testIsOpenChannel(TestContext ctx) { boolean result = client.isOpenChannel(); ctx.assertTrue(result); client.stop(ctx.asyncAssertSuccess(v -> { ctx.assertFalse(client.isOpenChannel()); })); }
@Test public void testIsConnected(TestContext ctx) { boolean result = client.isConnected(); ctx.assertTrue(result); client.stop(ctx.asyncAssertSuccess(v -> { ctx.assertFalse(client.isConnected()); })); }
@Test public void testSslModeDisable(TestContext ctx) { Async async = ctx.async(); PgConnectOptions options = new PgConnectOptions(TLSTest.options) .setSslMode(SslMode.DISABLE); PgClient.connect(vertx, new PgConnectOptions(options), ctx.asyncAssertSuccess(conn -> { ctx.assertFalse(conn.isSSL()); async.complete(); })); }
@Test public void testSslModeAllow(TestContext ctx) { Async async = ctx.async(); PgConnectOptions options = new PgConnectOptions(TLSTest.options) .setSslMode(SslMode.ALLOW); PgClient.connect(vertx, new PgConnectOptions(options), ctx.asyncAssertSuccess(conn -> { ctx.assertFalse(conn.isSSL()); async.complete(); })); }