Java 类com.google.common.util.concurrent.FuturesGetCheckedInputs.TwoArgConstructorException 实例源码

项目:guava-mock    文件:FuturesGetCheckedTest.java   
public void testGetCheckedUntimed_interrupted() {
  SettableFuture<String> future = SettableFuture.create();
  Thread.currentThread().interrupt();
  try {
    getChecked(future, TwoArgConstructorException.class);
    fail();
  } catch (TwoArgConstructorException expected) {
    assertThat(expected.getCause()).isInstanceOf(InterruptedException.class);
    assertTrue(Thread.currentThread().isInterrupted());
  } finally {
    Thread.interrupted();
  }
}
项目:guava-mock    文件:FuturesGetCheckedTest.java   
public void testGetCheckedUntimed_cancelled() throws TwoArgConstructorException {
  SettableFuture<String> future = SettableFuture.create();
  future.cancel(true);
  try {
    getChecked(future, TwoArgConstructorException.class);
    fail();
  } catch (CancellationException expected) {
  }
}
项目:guava-mock    文件:FuturesGetCheckedTest.java   
public void testGetCheckedUntimed_ExecutionExceptionChecked() {
  try {
    getChecked(FAILED_FUTURE_CHECKED_EXCEPTION, TwoArgConstructorException.class);
    fail();
  } catch (TwoArgConstructorException expected) {
    assertEquals(CHECKED_EXCEPTION, expected.getCause());
  }
}
项目:guava-mock    文件:FuturesGetCheckedTest.java   
public void testGetCheckedUntimed_ExecutionExceptionUnchecked()
    throws TwoArgConstructorException {
  try {
    getChecked(FAILED_FUTURE_UNCHECKED_EXCEPTION, TwoArgConstructorException.class);
    fail();
  } catch (UncheckedExecutionException expected) {
    assertEquals(UNCHECKED_EXCEPTION, expected.getCause());
  }
}
项目:guava-mock    文件:FuturesGetCheckedTest.java   
public void testGetCheckedUntimed_ExecutionExceptionError() throws TwoArgConstructorException {
  try {
    getChecked(FAILED_FUTURE_ERROR, TwoArgConstructorException.class);
    fail();
  } catch (ExecutionError expected) {
    assertEquals(ERROR, expected.getCause());
  }
}
项目:guava-mock    文件:FuturesGetCheckedTest.java   
public void testGetCheckedUntimed_ExecutionExceptionOtherThrowable() {
  try {
    getChecked(FAILED_FUTURE_OTHER_THROWABLE, TwoArgConstructorException.class);
    fail();
  } catch (TwoArgConstructorException expected) {
    assertEquals(OTHER_THROWABLE, expected.getCause());
  }
}
项目:guava-mock    文件:FuturesGetCheckedTest.java   
public void testGetCheckedUntimed_RuntimeException() throws TwoArgConstructorException {
  try {
    getChecked(RUNTIME_EXCEPTION_FUTURE, TwoArgConstructorException.class);
    fail();
  } catch (RuntimeException expected) {
    assertEquals(RUNTIME_EXCEPTION, expected);
  }
}
项目:guava-mock    文件:FuturesGetCheckedTest.java   
public void testGetCheckedUntimed_Error() throws TwoArgConstructorException {
  try {
    getChecked(ERROR_FUTURE, TwoArgConstructorException.class);
  } catch (Error expected) {
    assertEquals(ERROR, expected);
    return;
  }
  fail();
}
项目:guava-mock    文件:FuturesGetCheckedTest.java   
public void testGetCheckedTimed_interrupted() {
  SettableFuture<String> future = SettableFuture.create();
  Thread.currentThread().interrupt();
  try {
    getChecked(future, TwoArgConstructorException.class, 0, SECONDS);
    fail();
  } catch (TwoArgConstructorException expected) {
    assertThat(expected.getCause()).isInstanceOf(InterruptedException.class);
    assertTrue(Thread.currentThread().isInterrupted());
  } finally {
    Thread.interrupted();
  }
}
项目:guava-mock    文件:FuturesGetCheckedTest.java   
public void testGetCheckedTimed_cancelled() throws TwoArgConstructorException {
  SettableFuture<String> future = SettableFuture.create();
  future.cancel(true);
  try {
    getChecked(future, TwoArgConstructorException.class, 0, SECONDS);
    fail();
  } catch (CancellationException expected) {
  }
}
项目:guava-mock    文件:FuturesGetCheckedTest.java   
public void testGetCheckedTimed_ExecutionExceptionChecked() {
  try {
    getChecked(FAILED_FUTURE_CHECKED_EXCEPTION, TwoArgConstructorException.class, 0, SECONDS);
    fail();
  } catch (TwoArgConstructorException expected) {
    assertEquals(CHECKED_EXCEPTION, expected.getCause());
  }
}
项目:guava-mock    文件:FuturesGetCheckedTest.java   
public void testGetCheckedTimed_ExecutionExceptionUnchecked() throws TwoArgConstructorException {
  try {
    getChecked(FAILED_FUTURE_UNCHECKED_EXCEPTION, TwoArgConstructorException.class, 0, SECONDS);
    fail();
  } catch (UncheckedExecutionException expected) {
    assertEquals(UNCHECKED_EXCEPTION, expected.getCause());
  }
}
项目:guava-mock    文件:FuturesGetCheckedTest.java   
public void testGetCheckedTimed_ExecutionExceptionError() throws TwoArgConstructorException {
  try {
    getChecked(FAILED_FUTURE_ERROR, TwoArgConstructorException.class, 0, SECONDS);
    fail();
  } catch (ExecutionError expected) {
    assertEquals(ERROR, expected.getCause());
  }
}
项目:guava-mock    文件:FuturesGetCheckedTest.java   
public void testGetCheckedTimed_ExecutionExceptionOtherThrowable() {
  try {
    getChecked(FAILED_FUTURE_OTHER_THROWABLE, TwoArgConstructorException.class, 0, SECONDS);
    fail();
  } catch (TwoArgConstructorException expected) {
    assertEquals(OTHER_THROWABLE, expected.getCause());
  }
}
项目:guava-mock    文件:FuturesGetCheckedTest.java   
public void testGetCheckedTimed_RuntimeException() throws TwoArgConstructorException {
  try {
    getChecked(RUNTIME_EXCEPTION_FUTURE, TwoArgConstructorException.class, 0, SECONDS);
    fail();
  } catch (RuntimeException expected) {
    assertEquals(RUNTIME_EXCEPTION, expected);
  }
}
项目:guava-mock    文件:FuturesGetCheckedTest.java   
public void testGetCheckedTimed_Error() throws TwoArgConstructorException {
  try {
    getChecked(ERROR_FUTURE, TwoArgConstructorException.class, 0, SECONDS);
  } catch (Error expected) {
    assertEquals(ERROR, expected);
    return;
  }
  fail();
}
项目:guava-mock    文件:FuturesGetCheckedTest.java   
public void testGetCheckedTimed_TimeoutException() {
  SettableFuture<String> future = SettableFuture.create();
  try {
    getChecked(future, TwoArgConstructorException.class, 0, SECONDS);
    fail();
  } catch (TwoArgConstructorException expected) {
    assertThat(expected.getCause()).isInstanceOf(TimeoutException.class);
  }
}
项目:googles-monorepo-demo    文件:FuturesGetCheckedTest.java   
public void testGetCheckedUntimed_interrupted() {
  SettableFuture<String> future = SettableFuture.create();
  Thread.currentThread().interrupt();
  try {
    getChecked(future, TwoArgConstructorException.class);
    fail();
  } catch (TwoArgConstructorException expected) {
    assertThat(expected.getCause()).isInstanceOf(InterruptedException.class);
    assertTrue(Thread.currentThread().isInterrupted());
  } finally {
    Thread.interrupted();
  }
}
项目:googles-monorepo-demo    文件:FuturesGetCheckedTest.java   
public void testGetCheckedUntimed_cancelled() throws TwoArgConstructorException {
  SettableFuture<String> future = SettableFuture.create();
  future.cancel(true);
  try {
    getChecked(future, TwoArgConstructorException.class);
    fail();
  } catch (CancellationException expected) {
  }
}
项目:googles-monorepo-demo    文件:FuturesGetCheckedTest.java   
public void testGetCheckedUntimed_ExecutionExceptionChecked() {
  try {
    getChecked(FAILED_FUTURE_CHECKED_EXCEPTION, TwoArgConstructorException.class);
    fail();
  } catch (TwoArgConstructorException expected) {
    assertEquals(CHECKED_EXCEPTION, expected.getCause());
  }
}
项目:googles-monorepo-demo    文件:FuturesGetCheckedTest.java   
public void testGetCheckedUntimed_ExecutionExceptionUnchecked()
    throws TwoArgConstructorException {
  try {
    getChecked(FAILED_FUTURE_UNCHECKED_EXCEPTION, TwoArgConstructorException.class);
    fail();
  } catch (UncheckedExecutionException expected) {
    assertEquals(UNCHECKED_EXCEPTION, expected.getCause());
  }
}
项目:googles-monorepo-demo    文件:FuturesGetCheckedTest.java   
public void testGetCheckedUntimed_ExecutionExceptionError() throws TwoArgConstructorException {
  try {
    getChecked(FAILED_FUTURE_ERROR, TwoArgConstructorException.class);
    fail();
  } catch (ExecutionError expected) {
    assertEquals(ERROR, expected.getCause());
  }
}
项目:googles-monorepo-demo    文件:FuturesGetCheckedTest.java   
public void testGetCheckedUntimed_ExecutionExceptionOtherThrowable() {
  try {
    getChecked(FAILED_FUTURE_OTHER_THROWABLE, TwoArgConstructorException.class);
    fail();
  } catch (TwoArgConstructorException expected) {
    assertEquals(OTHER_THROWABLE, expected.getCause());
  }
}
项目:googles-monorepo-demo    文件:FuturesGetCheckedTest.java   
public void testGetCheckedUntimed_RuntimeException() throws TwoArgConstructorException {
  try {
    getChecked(RUNTIME_EXCEPTION_FUTURE, TwoArgConstructorException.class);
    fail();
  } catch (RuntimeException expected) {
    assertEquals(RUNTIME_EXCEPTION, expected);
  }
}
项目:googles-monorepo-demo    文件:FuturesGetCheckedTest.java   
public void testGetCheckedUntimed_Error() throws TwoArgConstructorException {
  try {
    getChecked(ERROR_FUTURE, TwoArgConstructorException.class);
  } catch (Error expected) {
    assertEquals(ERROR, expected);
    return;
  }
  fail();
}
项目:googles-monorepo-demo    文件:FuturesGetCheckedTest.java   
public void testGetCheckedTimed_interrupted() {
  SettableFuture<String> future = SettableFuture.create();
  Thread.currentThread().interrupt();
  try {
    getChecked(future, TwoArgConstructorException.class, 0, SECONDS);
    fail();
  } catch (TwoArgConstructorException expected) {
    assertThat(expected.getCause()).isInstanceOf(InterruptedException.class);
    assertTrue(Thread.currentThread().isInterrupted());
  } finally {
    Thread.interrupted();
  }
}
项目:googles-monorepo-demo    文件:FuturesGetCheckedTest.java   
public void testGetCheckedTimed_cancelled() throws TwoArgConstructorException {
  SettableFuture<String> future = SettableFuture.create();
  future.cancel(true);
  try {
    getChecked(future, TwoArgConstructorException.class, 0, SECONDS);
    fail();
  } catch (CancellationException expected) {
  }
}
项目:googles-monorepo-demo    文件:FuturesGetCheckedTest.java   
public void testGetCheckedTimed_ExecutionExceptionChecked() {
  try {
    getChecked(FAILED_FUTURE_CHECKED_EXCEPTION, TwoArgConstructorException.class, 0, SECONDS);
    fail();
  } catch (TwoArgConstructorException expected) {
    assertEquals(CHECKED_EXCEPTION, expected.getCause());
  }
}
项目:googles-monorepo-demo    文件:FuturesGetCheckedTest.java   
public void testGetCheckedTimed_ExecutionExceptionUnchecked() throws TwoArgConstructorException {
  try {
    getChecked(FAILED_FUTURE_UNCHECKED_EXCEPTION, TwoArgConstructorException.class, 0, SECONDS);
    fail();
  } catch (UncheckedExecutionException expected) {
    assertEquals(UNCHECKED_EXCEPTION, expected.getCause());
  }
}
项目:googles-monorepo-demo    文件:FuturesGetCheckedTest.java   
public void testGetCheckedTimed_ExecutionExceptionError() throws TwoArgConstructorException {
  try {
    getChecked(FAILED_FUTURE_ERROR, TwoArgConstructorException.class, 0, SECONDS);
    fail();
  } catch (ExecutionError expected) {
    assertEquals(ERROR, expected.getCause());
  }
}
项目:googles-monorepo-demo    文件:FuturesGetCheckedTest.java   
public void testGetCheckedTimed_ExecutionExceptionOtherThrowable() {
  try {
    getChecked(FAILED_FUTURE_OTHER_THROWABLE, TwoArgConstructorException.class, 0, SECONDS);
    fail();
  } catch (TwoArgConstructorException expected) {
    assertEquals(OTHER_THROWABLE, expected.getCause());
  }
}
项目:googles-monorepo-demo    文件:FuturesGetCheckedTest.java   
public void testGetCheckedTimed_RuntimeException() throws TwoArgConstructorException {
  try {
    getChecked(RUNTIME_EXCEPTION_FUTURE, TwoArgConstructorException.class, 0, SECONDS);
    fail();
  } catch (RuntimeException expected) {
    assertEquals(RUNTIME_EXCEPTION, expected);
  }
}
项目:googles-monorepo-demo    文件:FuturesGetCheckedTest.java   
public void testGetCheckedTimed_Error() throws TwoArgConstructorException {
  try {
    getChecked(ERROR_FUTURE, TwoArgConstructorException.class, 0, SECONDS);
  } catch (Error expected) {
    assertEquals(ERROR, expected);
    return;
  }
  fail();
}
项目:googles-monorepo-demo    文件:FuturesGetCheckedTest.java   
public void testGetCheckedTimed_TimeoutException() {
  SettableFuture<String> future = SettableFuture.create();
  try {
    getChecked(future, TwoArgConstructorException.class, 0, SECONDS);
    fail();
  } catch (TwoArgConstructorException expected) {
    assertThat(expected.getCause()).isInstanceOf(TimeoutException.class);
  }
}
项目:guava    文件:FuturesGetCheckedTest.java   
public void testGetCheckedUntimed_interrupted() {
  SettableFuture<String> future = SettableFuture.create();
  Thread.currentThread().interrupt();
  try {
    getChecked(future, TwoArgConstructorException.class);
    fail();
  } catch (TwoArgConstructorException expected) {
    assertThat(expected.getCause()).isInstanceOf(InterruptedException.class);
    assertTrue(Thread.currentThread().isInterrupted());
  } finally {
    Thread.interrupted();
  }
}
项目:guava    文件:FuturesGetCheckedTest.java   
public void testGetCheckedUntimed_cancelled() throws TwoArgConstructorException {
  SettableFuture<String> future = SettableFuture.create();
  future.cancel(true);
  try {
    getChecked(future, TwoArgConstructorException.class);
    fail();
  } catch (CancellationException expected) {
  }
}
项目:guava    文件:FuturesGetCheckedTest.java   
public void testGetCheckedUntimed_ExecutionExceptionChecked() {
  try {
    getChecked(FAILED_FUTURE_CHECKED_EXCEPTION, TwoArgConstructorException.class);
    fail();
  } catch (TwoArgConstructorException expected) {
    assertEquals(CHECKED_EXCEPTION, expected.getCause());
  }
}
项目:guava    文件:FuturesGetCheckedTest.java   
public void testGetCheckedUntimed_ExecutionExceptionUnchecked()
    throws TwoArgConstructorException {
  try {
    getChecked(FAILED_FUTURE_UNCHECKED_EXCEPTION, TwoArgConstructorException.class);
    fail();
  } catch (UncheckedExecutionException expected) {
    assertEquals(UNCHECKED_EXCEPTION, expected.getCause());
  }
}
项目:guava    文件:FuturesGetCheckedTest.java   
public void testGetCheckedUntimed_ExecutionExceptionError() throws TwoArgConstructorException {
  try {
    getChecked(FAILED_FUTURE_ERROR, TwoArgConstructorException.class);
    fail();
  } catch (ExecutionError expected) {
    assertEquals(ERROR, expected.getCause());
  }
}
项目:guava    文件:FuturesGetCheckedTest.java   
public void testGetCheckedUntimed_ExecutionExceptionOtherThrowable() {
  try {
    getChecked(FAILED_FUTURE_OTHER_THROWABLE, TwoArgConstructorException.class);
    fail();
  } catch (TwoArgConstructorException expected) {
    assertEquals(OTHER_THROWABLE, expected.getCause());
  }
}