Exemplo n.º 1
0
  @Test(expected = NoSuchUniqueId.class)
  public void incrementAndGetCounterNSU() throws Exception {
    final byte[] tsuid = {0, 0, 1, 0, 0, 1, 0, 0, 2};
    class ErrBack implements Callback<Object, Exception> {
      @Override
      public Object call(Exception e) throws Exception {
        Throwable ex = e;
        while (ex.getClass().equals(DeferredGroupException.class)) {
          ex = ex.getCause();
        }
        throw (Exception) ex;
      }
    }

    TSMeta.incrementAndGetCounter(tsdb, tsuid).addErrback(new ErrBack()).joinUninterruptibly();
  }
Exemplo n.º 2
0
 @Test
 public void incrementAndGetCounter() throws Exception {
   final byte[] tsuid = {0, 0, 1, 0, 0, 1, 0, 0, 1};
   TSMeta.incrementAndGetCounter(tsdb, tsuid).joinUninterruptibly();
   verify(client).bufferAtomicIncrement((AtomicIncrementRequest) any());
 }