Package io.vertx.core.json

Examples of io.vertx.core.json.JsonObject$Iter


        JerseyOptions options = new DefaultJerseyOptions(null);
        When when = WhenFactory.createSync();

        DefaultWhenJerseyServer whenJerseyServer = new DefaultWhenJerseyServer(vertx, server, options, when);

        JsonObject config = new JsonObject()
                .put("host", host)
                .put("port", port)
                .put("resources", new JsonArray().add("com.englishtown.vertx.jersey.promises.integration.resources"));

        CountDownLatch latch = new CountDownLatch(1);
View Full Code Here


     */
    @Override
    public void start(final Future<Void> startedResult) throws Exception {
        this.start();

        JsonObject config = getVertx().context().config();
        options.init(config, getVertx());

        jerseyServer.init(options, ar -> {
            if (ar.succeeded()) {
                startedResult.complete();
View Full Code Here

        await();
    }

    @Override
    protected JsonObject loadConfig() {
        return new JsonObject()
                .put("hk2_binder", "com.englishtown.vertx.jersey.metrics.integration.IntegrationTestBinder")
                .put("port", 8080)
                .put("resources", new JsonArray().add("com.englishtown.vertx.jersey.resources"));
    }
View Full Code Here

    protected JsonObject loadConfig(String name) {

        try (InputStream is = this.getClass().getResourceAsStream(name)) {
            try (Scanner scanner = new Scanner(is, "UTF-8").useDelimiter("\\A")) {
                return scanner.hasNext() ? new JsonObject(scanner.next()) : new JsonObject();
            }
        } catch (IOException e) {
            throw new RuntimeException(e);
        }
View Full Code Here

    DefaultJerseyOptions options;

    @Before
    public void setUp() throws Exception {

        config = new JsonObject();

        ServiceLocator locator = new ServiceLocatorImpl("test", null);
        options = new DefaultJerseyOptions(locator);
        options.init(config, vertx);
View Full Code Here

     * {@inheritDoc}
     */
    @Override
    public void start(Future<Void> startedResult) throws Exception {

        JsonObject jerseyConfig = vertx.context().config().getJsonObject("jersey");

        jerseyServer.createServer(jerseyConfig)
                .then(server -> {
                    startedResult.complete();
                    return null;
View Full Code Here

    TestVerticle verticle = new TestVerticle();
    TestVerticleFactory fact = new TestVerticleFactory("actual", verticle);
    vertx.registerVerticleFactory(fact);
    TestVerticleFactory factResolve = new TestVerticleFactory("resolve", "actual:myverticle");
    vertx.registerVerticleFactory(factResolve);
    JsonObject config = new JsonObject().put("foo", "bar");
    DeploymentOptions original = new DeploymentOptions().setWorker(false).setConfig(config).setIsolationGroup("somegroup");
    DeploymentOptions options = new DeploymentOptions(original);
    vertx.deployVerticle("resolve:someid", options, res -> {
      assertTrue(res.succeeded());
      assertEquals("resolve:someid", factResolve.identifierToResolve);
View Full Code Here

        throw new IOException("whatever");
      }
      identifierToResolve = identifier;
      deploymentOptionsToResolve = deploymentOptions;
      // Now we change the deployment options
      deploymentOptions.setConfig(new JsonObject().put("wibble", "quux"));
      deploymentOptions.setWorker(true);
      deploymentOptions.setIsolationGroup("othergroup");
      return resolvedIdentifier;
    }
View Full Code Here

  @Test
  public void testSimpleFailover() throws Exception {
    startNodes(2, new VertxOptions().setHAEnabled(true));
    DeploymentOptions options = new DeploymentOptions().setHa(true);
    JsonObject config = new JsonObject().put("foo", "bar");
    options.setConfig(config);
    CountDownLatch latch = new CountDownLatch(1);
    vertices[0].deployVerticle("java:" + HAVerticle1.class.getName(), options, ar -> {
      assertTrue(ar.succeeded());
      assertEquals(1, vertices[0].deployments().size());
View Full Code Here

  @Test
  public void testQuorum() throws Exception {
    Vertx vertx1 = startVertx(2);
    DeploymentOptions options = new DeploymentOptions().setHa(true);
    JsonObject config = new JsonObject().put("foo", "bar");
    options.setConfig(config);
    vertx1.deployVerticle("java:" + HAVerticle1.class.getName(), options, ar -> {
      assertTrue(ar.succeeded());
      assertTrue(vertx1.deployments().contains(ar.result()));
      testComplete();
View Full Code Here

TOP

Related Classes of io.vertx.core.json.JsonObject$Iter

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.