}
@Test
public void addNodesConcurrent() throws Exception {
for (int i = 0; i < NUM_CLUSTER_NODES; i++) {
MongoMK mk = new MongoMK.Builder()
.setMongoDB(createConnection().getDB())
.setClusterId(i + 1).open();
mks.add(mk);
}
Map<String, Exception> exceptions = Collections.synchronizedMap(
new HashMap<String, Exception>());
for (int i = 0; i < mks.size(); i++) {
MongoMK mk = mks.get(i);
Repository repo = new Jcr(mk).createRepository();
workers.add(new Thread(new Worker(repo, exceptions), "Worker-" + (i + 1)));
}
for (Thread t : workers) {
t.start();