Пример #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);
  }