use of io.vertx.core.json.JsonObject in project vert.x by eclipse.
the class KeyStoreTest method testDefaultJKSOptionsJson.
@Test
public void testDefaultJKSOptionsJson() {
JksOptions def = new JksOptions();
JksOptions json = new JksOptions(new JsonObject());
assertEquals(def.getPassword(), json.getPassword());
assertEquals(def.getPath(), json.getPath());
assertEquals(def.getValue(), json.getValue());
}
use of io.vertx.core.json.JsonObject in project vert.x by eclipse.
the class KeyStoreTest method testKeyCertOptionsJson.
@Test
public void testKeyCertOptionsJson() throws Exception {
PemKeyCertOptions options = new PemKeyCertOptions(new JsonObject());
assertEquals(null, options.getKeyPath());
assertEquals(null, options.getKeyValue());
assertEquals(null, options.getCertPath());
assertEquals(null, options.getCertValue());
String keyPath = TestUtils.randomAlphaString(100);
String keyValue = TestUtils.randomAlphaString(100);
String certPath = TestUtils.randomAlphaString(100);
String certValue = TestUtils.randomAlphaString(100);
options = new PemKeyCertOptions(new JsonObject().put("keyPath", keyPath).put("keyValue", keyValue.getBytes()).put("certPath", certPath).put("certValue", certValue.getBytes()));
assertEquals(keyPath, options.getKeyPath());
assertEquals(Buffer.buffer(keyValue), options.getKeyValue());
assertEquals(certPath, options.getCertPath());
assertEquals(Buffer.buffer(certValue), options.getCertValue());
}
use of io.vertx.core.json.JsonObject in project vert.x by eclipse.
the class KeyStoreTest method testPKCS12OptionsJson.
@Test
public void testPKCS12OptionsJson() throws Exception {
PfxOptions options = new PfxOptions(new JsonObject());
assertEquals(null, options.getPassword());
assertEquals(null, options.getPath());
assertEquals(null, options.getValue());
String password = TestUtils.randomAlphaString(100);
String path = TestUtils.randomAlphaString(100);
String value = TestUtils.randomAlphaString(100);
options = new PfxOptions(new JsonObject().put("password", password).put("path", path).put("value", value.getBytes()));
assertEquals(password, options.getPassword());
assertEquals(path, options.getPath());
assertEquals(Buffer.buffer(value), options.getValue());
}
use of io.vertx.core.json.JsonObject in project vert.x by eclipse.
the class KeyStoreTest method testDefaultKeyCertOptionsJson.
@Test
public void testDefaultKeyCertOptionsJson() throws Exception {
PemKeyCertOptions def = new PemKeyCertOptions();
PemKeyCertOptions json = new PemKeyCertOptions(new JsonObject());
assertEquals(def.getKeyPath(), json.getKeyPath());
assertEquals(def.getCertPath(), json.getCertPath());
assertEquals(def.getKeyValue(), json.getKeyValue());
assertEquals(def.getCertValue(), json.getCertValue());
}
use of io.vertx.core.json.JsonObject in project vert.x by eclipse.
the class LauncherTest method testRunVerticleWithConfString.
@Test
public void testRunVerticleWithConfString() throws Exception {
MyLauncher launcher = new MyLauncher();
JsonObject conf = new JsonObject().put("foo", "bar").put("wibble", 123);
String[] args = { "run", "java:" + TestVerticle.class.getCanonicalName(), "-conf", conf.encode() };
launcher.dispatch(args);
waitUntil(() -> TestVerticle.instanceCount.get() == 1);
assertEquals(conf, TestVerticle.conf);
}
Aggregations