예제 #1
0
  @Test
  public void testCheckedDoubleToLongFunction() {
    DoubleToLongFunction test =
        Unchecked.doubleToLongFunction(
            d -> {
              throw new Exception("" + d);
            });

    assertDoubleToLongFunction(test, RuntimeException.class);
  }
예제 #2
0
  @Test
  public void testCheckedToLongFunction() {
    ToLongFunction<Object> test =
        Unchecked.toLongFunction(
            t -> {
              throw new Exception("" + t);
            });

    assertToLongFunction(test, RuntimeException.class);
  }
예제 #3
0
  @Test
  public void testCheckedFunction() {
    Function<Object, Object> test =
        Unchecked.function(
            t -> {
              throw new Exception("" + t);
            });

    assertFunction(test, RuntimeException.class);
  }
예제 #4
0
  @Test
  public void testCheckedLongToDoubleFunction() {
    LongToDoubleFunction test =
        Unchecked.longToDoubleFunction(
            l -> {
              throw new Exception("" + l);
            });

    assertLongToDoubleFunction(test, RuntimeException.class);
  }
예제 #5
0
  @Test
  public void testCheckedIntToDoubleFunction() {
    IntToDoubleFunction test =
        Unchecked.intToDoubleFunction(
            i -> {
              throw new Exception("" + i);
            });

    assertIntToDoubleFunction(test, RuntimeException.class);
  }
예제 #6
0
  @Test
  public void testCheckedToIntFunctionWithCustomHandler() {
    ToIntFunction<Object> test =
        Unchecked.toIntFunction(
            t -> {
              throw new Exception("" + t);
            },
            e -> {
              throw new IllegalStateException(e);
            });

    assertToIntFunction(test, IllegalStateException.class);
  }
예제 #7
0
  @Test
  public void testCheckedDoubleToLongFunctionWithCustomHandler() {
    DoubleToLongFunction test =
        Unchecked.doubleToLongFunction(
            d -> {
              throw new Exception("" + d);
            },
            e -> {
              throw new IllegalStateException(e);
            });

    assertDoubleToLongFunction(test, IllegalStateException.class);
  }
예제 #8
0
  @Test
  public void testCheckedLongToDoubleFunctionWithCustomHandler() {
    LongToDoubleFunction test =
        Unchecked.longToDoubleFunction(
            l -> {
              throw new Exception("" + l);
            },
            e -> {
              throw new IllegalStateException(e);
            });

    assertLongToDoubleFunction(test, IllegalStateException.class);
  }
예제 #9
0
  @Test
  public void testCheckedIntToDoubleFunctionWithCustomHandler() {
    IntToDoubleFunction test =
        Unchecked.intToDoubleFunction(
            i -> {
              throw new Exception("" + i);
            },
            e -> {
              throw new IllegalStateException(e);
            });

    assertIntToDoubleFunction(test, IllegalStateException.class);
  }