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

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

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

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

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

    assertIntToDoubleFunction(test, RuntimeException.class);
  }
Ejemplo n.º 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);
  }
Ejemplo n.º 7
0
  @Test
  public void testCheckedDoubleToLongFunctionWithCustomHandler() {
    DoubleToLongFunction test =
        Unchecked.doubleToLongFunction(
            d -> {
              throw new Exception("" + d);
            },
            e -> {
              throw new IllegalStateException(e);
            });

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

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

    assertIntToDoubleFunction(test, IllegalStateException.class);
  }