use of io.vertx.core.impl.Deployment in project vert.x by eclipse.
the class ComplexHATest method checkHasDeployments.
protected int checkHasDeployments(int pos, int prevPos) {
Set<Deployment> prevSet = deploymentSnapshots[prevPos];
Set<Deployment> currSet = takeDeploymentSnapshot(pos);
for (Deployment prev : prevSet) {
boolean contains = false;
for (Deployment curr : currSet) {
if (curr.verticleIdentifier().equals(prev.verticleIdentifier()) && curr.deploymentOptions().equals(prev.deploymentOptions())) {
contains = true;
break;
}
}
assertTrue(contains);
}
return currSet.size();
}
use of io.vertx.core.impl.Deployment 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.Deployment 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();
}
use of io.vertx.core.impl.Deployment in project vert.x by eclipse.
the class HATest method checkDeploymentExists.
protected void checkDeploymentExists(int pos, String verticleName, DeploymentOptions options) {
VertxInternal vi = (VertxInternal) vertices[pos];
for (String deploymentID : vi.deploymentIDs()) {
Deployment dep = vi.getDeployment(deploymentID);
if (verticleName.equals(dep.verticleIdentifier()) && options.equals(dep.deploymentOptions())) {
return;
}
}
fail("Can't find deployment for verticleName: " + verticleName + " on node " + pos);
}
Aggregations