예제 #1
0
  private void populateData(int count) {
    JsonEncoder jsonEncoder = new JsonEncoder();
    try {
      for (long i = 0; i < count; i++) {
        Object value =
            ImmutableMap.of("id", Long.toString(i), "value", UUID.randomUUID().toString());

        try (Jedis jedis = embeddedRedis.getJedisPool().getResource()) {
          jedis.set(tableName + ":" + i, jsonEncoder.toString(value));
        }
      }
    } catch (Exception e) {
      throw Throwables.propagate(e);
    }
  }
예제 #2
0
 @AfterClass
 public void stopRedis() throws Exception {
   embeddedRedis.close();
 }
예제 #3
0
 @BeforeClass
 public void startRedis() throws Exception {
   embeddedRedis = EmbeddedRedis.createEmbeddedRedis();
   embeddedRedis.start();
 }