use of de.flapdoodle.embed.mongo.tests.MongodForTestsFactory in project incubator-rya by apache.
the class ITBase method getNewMongoResources.
/**
* @return A new {@link MongoClient}. Note: This does not have RYA installed.
* @throws MongoException
* @throws InferenceEngineException
* @throws RyaDAOException
* @throws AccumuloSecurityException
* @throws AccumuloException
* @throws RepositoryException
* @throws NumberFormatException
* @throws IOException
* @throws SailException
*/
public static MongoClient getNewMongoResources(final String ryaInstanceName) throws MongoException, NumberFormatException, RepositoryException, AccumuloException, AccumuloSecurityException, RyaDAOException, InferenceEngineException, IOException, SailException {
// Initialize the test mongo that will be used to host rya.
final MongodForTestsFactory mongodTestFactory = new MongodForTestsFactory();
final MongoClient newClient = mongodTestFactory.newMongo();
clients.add(newClient);
final String host = newClient.getAddress().getHost();
final int port = newClient.getAddress().getPort();
final RyaSailRepository newRepo = setupRya(ryaInstanceName, host, port, newClient);
ryaRepos.add(newRepo);
return newClient;
}
Aggregations