Search in sources :

Example 1 with MongodForTestsFactory

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;
}
Also used : MongoClient(com.mongodb.MongoClient) RyaSailRepository(org.apache.rya.rdftriplestore.RyaSailRepository) MongodForTestsFactory(de.flapdoodle.embed.mongo.tests.MongodForTestsFactory)

Aggregations

MongoClient (com.mongodb.MongoClient)1 MongodForTestsFactory (de.flapdoodle.embed.mongo.tests.MongodForTestsFactory)1 RyaSailRepository (org.apache.rya.rdftriplestore.RyaSailRepository)1