use of ai.grakn.redismock.RedisServer in project grakn by graknlabs.
the class RedisWrapperTest method whenBuildingNoSentinelWellFormed_Succeeds.
@Test
public void whenBuildingNoSentinelWellFormed_Succeeds() {
RedisServer server = inMemoryRedisContext.server();
RedisWrapper redisWrapper = RedisWrapper.builder().setUseSentinel(false).addURI(new SimpleURI(server.getHost(), server.getBindPort()).toString()).build();
assertNotNull(redisWrapper.getJedisPool());
}
use of ai.grakn.redismock.RedisServer in project grakn by graknlabs.
the class GraknEngineServerTest method whenEngineServerIsStarted_SystemKeyspaceIsLoaded.
@Test
public void whenEngineServerIsStarted_SystemKeyspaceIsLoaded() throws IOException {
SimpleURI uri = new SimpleURI(Iterables.getOnlyElement(config.getProperty(GraknConfigKey.REDIS_HOST)));
RedisServer redisServer = RedisServer.newRedisServer(uri.getPort());
redisServer.start();
try {
try (GraknEngineServer server = createGraknEngineServer(mockRedisWrapper)) {
server.start();
assertNotNull(graknKeyspaceStore);
// init a random keyspace
String keyspaceName = "thisisarandomwhalekeyspace";
graknKeyspaceStore.addKeyspace(Keyspace.of(keyspaceName));
assertTrue(graknKeyspaceStore.containsKeyspace(Keyspace.of(keyspaceName)));
}
} finally {
redisServer.stop();
}
}
use of ai.grakn.redismock.RedisServer in project grakn by graknlabs.
the class RedisWrapperTest method whenBuildingSentinelNoMaster_Fails.
@Test(expected = IllegalStateException.class)
public void whenBuildingSentinelNoMaster_Fails() {
RedisServer server = inMemoryRedisContext.server();
RedisWrapper.builder().setUseSentinel(true).addURI(new SimpleURI(server.getHost(), server.getBindPort()).toString()).build();
}
use of ai.grakn.redismock.RedisServer in project grakn by graknlabs.
the class RedisWrapperTest method whenBuildingSentinelWellFormed_JedisCantConnect.
@Test(expected = JedisConnectionException.class)
public void whenBuildingSentinelWellFormed_JedisCantConnect() {
RedisServer server = inMemoryRedisContext.server();
RedisWrapper.builder().setUseSentinel(true).addURI(new SimpleURI(server.getHost(), server.getBindPort()).toString()).setMasterName("masterName").build();
}
Aggregations