Search in sources :

Example 1 with FakeMetricsFactory

use of io.vertx.test.fakemetrics.FakeMetricsFactory in project vert.x by eclipse.

the class HttpMetricsTest method getOptions.

@Override
protected VertxOptions getOptions() {
    VertxOptions options = super.getOptions();
    options.setMetricsOptions(new MetricsOptions().setEnabled(true).setFactory(new FakeMetricsFactory()));
    return options;
}
Also used : MetricsOptions(io.vertx.core.metrics.MetricsOptions) FakeMetricsFactory(io.vertx.test.fakemetrics.FakeMetricsFactory) VertxOptions(io.vertx.core.VertxOptions)

Example 2 with FakeMetricsFactory

use of io.vertx.test.fakemetrics.FakeMetricsFactory in project vert.x by eclipse.

the class HttpMetricsTestBase method getOptions.

@Override
protected VertxOptions getOptions() {
    VertxOptions options = super.getOptions();
    options.setMetricsOptions(new MetricsOptions().setEnabled(true).setFactory(new FakeMetricsFactory()));
    return options;
}
Also used : MetricsOptions(io.vertx.core.metrics.MetricsOptions) FakeMetricsFactory(io.vertx.test.fakemetrics.FakeMetricsFactory) VertxOptions(io.vertx.core.VertxOptions)

Example 3 with FakeMetricsFactory

use of io.vertx.test.fakemetrics.FakeMetricsFactory in project vert.x by eclipse.

the class LauncherExtensibilityTest method testThatCustomLauncherCanCustomizeMetricsOption.

@Test
public void testThatCustomLauncherCanCustomizeMetricsOption() throws Exception {
    Launcher myLauncher = new Launcher() {

        @Override
        protected String getMainVerticle() {
            return HttpTestVerticle.class.getName();
        }

        @Override
        public void afterStartingVertx(Vertx vertx) {
            LauncherExtensibilityTest.this.vertx = vertx;
        }

        @Override
        public void beforeStartingVertx(VertxOptions options) {
            options.getMetricsOptions().setEnabled(true).setFactory(new FakeMetricsFactory());
        }
    };
    myLauncher.dispatch(new String[0]);
    assertWaitUntil(() -> {
        try {
            return RunCommandTest.getHttpCode() == 200;
        } catch (IOException e) {
            return false;
        }
    });
    assertThat(RunCommandTest.getContent().getBoolean("metrics")).isEqualTo(true);
}
Also used : FakeMetricsFactory(io.vertx.test.fakemetrics.FakeMetricsFactory) Launcher(io.vertx.core.Launcher) IOException(java.io.IOException) Vertx(io.vertx.core.Vertx) VertxOptions(io.vertx.core.VertxOptions) Test(org.junit.Test) RunCommandTest(io.vertx.core.impl.launcher.commands.RunCommandTest)

Aggregations

VertxOptions (io.vertx.core.VertxOptions)3 FakeMetricsFactory (io.vertx.test.fakemetrics.FakeMetricsFactory)3 MetricsOptions (io.vertx.core.metrics.MetricsOptions)2 Launcher (io.vertx.core.Launcher)1 Vertx (io.vertx.core.Vertx)1 RunCommandTest (io.vertx.core.impl.launcher.commands.RunCommandTest)1 IOException (java.io.IOException)1 Test (org.junit.Test)1