@Override protected void before() throws IOException { try { this.server = new RedisServer(this.port); this.server.start(); } catch (Exception e) { if (!suppressExceptions) { throw e; } } }
public void start() throws IOException { redisServer.start(); jedisPool = new JedisPool(new JedisPoolConfig(), getConnectString(), getPort()); }
@Override protected void before() { try { redisServer = RedisServer.builder().port(port).setting("maxmemory 16MB").build(); redisServer.start(); } catch (final Exception e) { if (port == DEFAULT_REDIS_PORT && ignoreDefaultPortFailure) { log.info("Unable to start embedded Redis on default port. Ignoring error. Assuming redis is already running."); } else { throw new RuntimeException(format("Error while initializing the Redis server" + " on port %d", port), e); } } }
@BeforeSuite(alwaysRun = true) public void globalBeforeSuite() { if (Boolean.valueOf(System.getProperty("killbill.test.redis", "false"))) { redisServer = new RedisServer(56379); redisServer.start(); redissonClient = new RedissonCacheClientProvider("redis://127.0.0.1:56379", 1).get(); theRealClock = new DistributedClockMock(); ((DistributedClockMock) theRealClock).setRedissonClient(redissonClient); extraPropertiesForTestSuite = ImmutableMap.<String, String>of("org.killbill.cache.config.redis", "true", "org.killbill.cache.config.redis.url", "redis://127.0.0.1:56379"); } else { theRealClock.resetDeltaFromReality(); extraPropertiesForTestSuite = ImmutableMap.<String, String>of(); } // The clock needs to be setup early in @BeforeSuite, as it is needed when starting the server, but see below clock = theRealClock; }
@PostConstruct public void setUp() throws IOException { this.redisServer = new RedisServer(DEFAULT_PORT); if (available(DEFAULT_PORT)) { this.redisServer.start(); } }
@PostConstruct public void setUp() throws IOException { this.redisServer = new RedisServer(DEFAULT_PORT); if (available(DEFAULT_PORT)) { this.redisServer.start(); } }
@BeforeMethod public void setUp(final Method testMethod) throws Exception { redisProvided = Boolean.parseBoolean(System.getProperty("redis.provided", "false")); redisPort = Integer.parseInt(System.getProperty("redis.port", "16379")); if (!redisProvided) { embeddedRedisServer = new RedisServer(redisPort); embeddedRedisServer.start(); } }
@Test public void testAutoReconnect() throws Exception { RedisStorageClient client = createClient(); // Issue a command to create a connection assertTrue(client.add("key1", 0, toBytes("foo")).get()); assertEquals("foo", toString(client.get("key1"))); // Stop and start server to close all connections if (!redisProvided) { embeddedRedisServer.stop(); embeddedRedisServer.start(); } // If we now issue commands, the old connection is defunct and will be replaced assertTrue(client.add("key1", 0, toBytes("foo")).get()); assertEquals("foo", toString(client.get("key1"))); client.shutdown(); }
@BeforeMethod public void setUp(final Method testMethod) throws Throwable { redisProvided = Boolean.parseBoolean(System.getProperty("redis.provided", "false")); final int redisPort = Integer.parseInt(System.getProperty("redis.port", "16379")); if (!redisProvided) { embeddedRedisServer = new RedisServer(redisPort); embeddedRedisServer.start(); } try { System.setProperty( "org.apache.catalina.startup.EXIT_ON_INIT_FAILURE", "true" ); _tomcat1 = getTestUtils().tomcatBuilder().port(_portTomcat1).memcachedNodes("redis://localhost:"+ redisPort) .sticky(true).buildAndStart(); } catch ( final Throwable e ) { LOG.error( "could not start tomcat.", e ); throw e; } redisClient = new BinaryJedis("localhost", redisPort); transcoderService = new TranscoderService(new JavaSerializationTranscoder(_tomcat1.getManager())); }
public EmailEmbeddedRedis start() { log.info("Started Embedded Redis Server on port {}.", redisPort); redisServer.start(); return this; }
@Override protected void before() throws Throwable { if (System.getProperty(builder.skipProperty) != null) { log.info("Skip RedisRule because of existing property '" + builder.skipProperty + "'"); return; } log.info("start Redis-Instance ..."); redisServer = new RedisServerBuilder().port(builder.port).build(); redisServer.start(); log.info("Redis-Instance started."); }
public void start() throws IOException { redisServer.start(); jedisPool = new JedisPool(new JedisPoolConfig(), getConnectString(), getPort()); }
@BeforeClass static public void startRedis() throws Exception { System.out.println("Creating redis server on port: " + PORT); server = new RedisServer(PORT); System.out.println("Created embedded redis server on port " + PORT); server.start(); }
private EmbeddedRedis(int port) throws IOException, URISyntaxException { this.connection = URI.create(String.format("redis://127.0.0.1:%d/0", port)); this.redisServer = RedisServer .builder() .port(port) .setting("bind 127.0.0.1") .setting("appendonly no") .setting("save \"\"") .setting("databases 1") .build(); this.redisServer.start(); }
@BeforeClass static public void startRedis() throws Exception { System.out.println("Creating redis server on port: " + DEFAULT_PORT); server = new RedisServer(DEFAULT_PORT); System.out.println("Created embedded redis server on port " + DEFAULT_PORT); server.start(); }
@BeforeClass static public void startRedis() throws Exception { System.out.println("Creating redis server on port: " + DEFAULT_PORT); server = new RedisServer(DEFAULT_PORT); System.out.println("Created embedded redis server on port " + DEFAULT_PORT); server.start(); }
@BeforeClass static public void startRedis() throws Exception { server = new RedisServer(6379); System.out.println("Created embedded redis server on port 6379"); server.start(); }
@Override public void setup() { if (redisServer == null) { redisServer = RedisServer.builder().port(6379).setting("bind 127.0.0.1") // secure + prevents // popups on Windows .setting("maxmemory 512M").setting("timeout 30000").build(); redisServer.start(); } }
@Before public void setUp(TestContext tc) throws IOException { vertx = Vertx.vertx(); vertx.exceptionHandler(tc.exceptionHandler()); redisServer = new RedisServer(6379); redisServer.start(); testRedisClient = RedisClient.create(vertx, new RedisOptions().setHost("localhost").setPort(6379)); }
@Before public void setUp(TestContext tc) throws IOException { vertx = Vertx.vertx(); vertx.exceptionHandler(tc.exceptionHandler()); redisServer = new RedisServer(6379); redisServer.start(); testRedisClient = RedisClient.create(vertx, new RedisOptions().setHost("localhost").setPort(6379)); }