use of io.vertx.core.impl.VertxInternal in project vert.x by eclipse.
the class MetricsOptionsTest method testMetricsFromServiceLoader.
@Test
public void testMetricsFromServiceLoader() {
vertx.close();
VertxOptions options = new VertxOptions().setMetricsOptions(new MetricsOptions().setEnabled(true));
vertx = createVertxLoadingMetricsFromMetaInf(options, "io.vertx.test.fakemetrics.FakeMetricsFactory");
VertxMetrics metrics = ((VertxInternal) vertx).metricsSPI();
assertNotNull(metrics);
assertTrue(metrics instanceof FakeVertxMetrics);
}
use of io.vertx.core.impl.VertxInternal in project vert.x by eclipse.
the class ClusteredAsynchronousLockTest method testLockReleasedForKilledNode.
/**
* Cannot run with the fake cluster manager.
* Subclasses need to override the method and call <code>super.testLockReleasedForKilledNode()</code>.
*/
@Test
@Ignore
public void testLockReleasedForKilledNode() throws Exception {
testLockReleased(latch -> {
VertxInternal vi = (VertxInternal) vertices[0];
vi.getClusterManager().leave(onSuccess(v -> {
latch.countDown();
}));
});
}
use of io.vertx.core.impl.VertxInternal in project vert.x by eclipse.
the class ClusteredEventBusTest method testSubsRemovedForKilledNode.
@Test
public void testSubsRemovedForKilledNode() throws Exception {
testSubsRemoved(latch -> {
VertxInternal vi = (VertxInternal) vertices[1];
vi.getClusterManager().leave(onSuccess(v -> {
latch.countDown();
}));
});
}
use of io.vertx.core.impl.VertxInternal in project vert.x by eclipse.
the class ComplexHATest method takeDeploymentSnapshot.
protected Set<Deployment> takeDeploymentSnapshot(int pos) {
Set<Deployment> snapshot = new ConcurrentHashSet<>();
VertxInternal v = (VertxInternal) vertices[pos];
for (String depID : v.deploymentIDs()) {
snapshot.add(v.getDeployment(depID));
}
return snapshot;
}
use of io.vertx.core.impl.VertxInternal in project vert.x by eclipse.
the class VerticleFactoryTest method testResolve.
@Test
public void testResolve() {
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);
assertEquals(options, factResolve.deploymentOptionsToResolve);
assertEquals("actual:myverticle", fact.identifier);
assertTrue(verticle.startCalled);
assertTrue(verticle.startCalled);
assertEquals(1, vertx.deploymentIDs().size());
Deployment dep = ((VertxInternal) vertx).getDeployment(res.result());
assertNotNull(dep);
assertFalse(original.equals(dep.deploymentOptions()));
assertFalse(dep.deploymentOptions().getConfig().containsKey("foo"));
assertEquals("quux", dep.deploymentOptions().getConfig().getString("wibble"));
assertTrue(dep.deploymentOptions().isWorker());
assertEquals("othergroup", dep.deploymentOptions().getIsolationGroup());
testComplete();
});
await();
}
Aggregations