Package java.lang.invoke

Examples of java.lang.invoke.MethodHandle.invokeWithArguments()


  }

  @Test(expectedExceptions = IllegalArgumentException.class)
  public void check_less_rejects_non_comparable() throws Throwable {
    MethodHandle handle = OperatorSupport.bootstrap(lookup(), "less", BINOP_TYPE, 2).dynamicInvoker();
    handle.invokeWithArguments(new Object(), new Object());
  }

  @Test
  public void check_lessOrEquals() throws Throwable {
    MethodHandle handle = OperatorSupport.bootstrap(lookup(), "lessorequals", BINOP_TYPE, 2).dynamicInvoker();
View Full Code Here


  @Test
  public void check_lessOrEquals() throws Throwable {
    MethodHandle handle = OperatorSupport.bootstrap(lookup(), "lessorequals", BINOP_TYPE, 2).dynamicInvoker();

    assertThat((Boolean) handle.invokeWithArguments(1, 2), is(true));
    assertThat((Boolean) handle.invokeWithArguments(1, 1), is(true));
    assertThat((Boolean) handle.invokeWithArguments(2, 1), is(false));
  }

  @Test(expectedExceptions = IllegalArgumentException.class)
View Full Code Here

  @Test
  public void check_lessOrEquals() throws Throwable {
    MethodHandle handle = OperatorSupport.bootstrap(lookup(), "lessorequals", BINOP_TYPE, 2).dynamicInvoker();

    assertThat((Boolean) handle.invokeWithArguments(1, 2), is(true));
    assertThat((Boolean) handle.invokeWithArguments(1, 1), is(true));
    assertThat((Boolean) handle.invokeWithArguments(2, 1), is(false));
  }

  @Test(expectedExceptions = IllegalArgumentException.class)
  public void check_lessOrEquals_rejects_non_comparable() throws Throwable {
View Full Code Here

  public void check_lessOrEquals() throws Throwable {
    MethodHandle handle = OperatorSupport.bootstrap(lookup(), "lessorequals", BINOP_TYPE, 2).dynamicInvoker();

    assertThat((Boolean) handle.invokeWithArguments(1, 2), is(true));
    assertThat((Boolean) handle.invokeWithArguments(1, 1), is(true));
    assertThat((Boolean) handle.invokeWithArguments(2, 1), is(false));
  }

  @Test(expectedExceptions = IllegalArgumentException.class)
  public void check_lessOrEquals_rejects_non_comparable() throws Throwable {
    MethodHandle handle = OperatorSupport.bootstrap(lookup(), "lessorequals", BINOP_TYPE, 2).dynamicInvoker();
View Full Code Here

  }

  @Test(expectedExceptions = IllegalArgumentException.class)
  public void check_lessOrEquals_rejects_non_comparable() throws Throwable {
    MethodHandle handle = OperatorSupport.bootstrap(lookup(), "lessorequals", BINOP_TYPE, 2).dynamicInvoker();
    handle.invokeWithArguments(new Object(), new Object());
  }

  @Test
  public void check_more() throws Throwable {
    MethodHandle handle = OperatorSupport.bootstrap(lookup(), "more", BINOP_TYPE, 2).dynamicInvoker();
View Full Code Here

  @Test
  public void check_more() throws Throwable {
    MethodHandle handle = OperatorSupport.bootstrap(lookup(), "more", BINOP_TYPE, 2).dynamicInvoker();

    assertThat((Boolean) handle.invokeWithArguments(1, 2), is(false));
    assertThat((Boolean) handle.invokeWithArguments(1, 1), is(false));
    assertThat((Boolean) handle.invokeWithArguments(2, 1), is(true));
  }

  @Test(expectedExceptions = IllegalArgumentException.class)
View Full Code Here

  @Test
  public void check_more() throws Throwable {
    MethodHandle handle = OperatorSupport.bootstrap(lookup(), "more", BINOP_TYPE, 2).dynamicInvoker();

    assertThat((Boolean) handle.invokeWithArguments(1, 2), is(false));
    assertThat((Boolean) handle.invokeWithArguments(1, 1), is(false));
    assertThat((Boolean) handle.invokeWithArguments(2, 1), is(true));
  }

  @Test(expectedExceptions = IllegalArgumentException.class)
  public void check_more_rejects_non_comparable() throws Throwable {
View Full Code Here

  public void check_more() throws Throwable {
    MethodHandle handle = OperatorSupport.bootstrap(lookup(), "more", BINOP_TYPE, 2).dynamicInvoker();

    assertThat((Boolean) handle.invokeWithArguments(1, 2), is(false));
    assertThat((Boolean) handle.invokeWithArguments(1, 1), is(false));
    assertThat((Boolean) handle.invokeWithArguments(2, 1), is(true));
  }

  @Test(expectedExceptions = IllegalArgumentException.class)
  public void check_more_rejects_non_comparable() throws Throwable {
    MethodHandle handle = OperatorSupport.bootstrap(lookup(), "more", BINOP_TYPE, 2).dynamicInvoker();
View Full Code Here

  }

  @Test(expectedExceptions = IllegalArgumentException.class)
  public void check_more_rejects_non_comparable() throws Throwable {
    MethodHandle handle = OperatorSupport.bootstrap(lookup(), "more", BINOP_TYPE, 2).dynamicInvoker();
    handle.invokeWithArguments(new Object(), new Object());
  }

  @Test
  public void check_moreOrEquals() throws Throwable {
    MethodHandle handle = OperatorSupport.bootstrap(lookup(), "moreorequals", BINOP_TYPE, 2).dynamicInvoker();
View Full Code Here

  @Test
  public void check_moreOrEquals() throws Throwable {
    MethodHandle handle = OperatorSupport.bootstrap(lookup(), "moreorequals", BINOP_TYPE, 2).dynamicInvoker();

    assertThat((Boolean) handle.invokeWithArguments(1, 2), is(false));
    assertThat((Boolean) handle.invokeWithArguments(1, 1), is(true));
    assertThat((Boolean) handle.invokeWithArguments(2, 1), is(true));
  }

  @Test(expectedExceptions = IllegalArgumentException.class)
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.