Ejemplo n.º 1
0
 @Test
 @DataFrom("invokeMethodData")
 public void testInvokeMethod(String methodName, String value) throws Exception {
   MethodAccessor<Void> accessor = new MethodAccessor<Void>(ChildClaz.class, methodName);
   accessor.invoke(new ChildClaz(), new Object[0]);
   String result = ParentClaz.method;
   want.string(result).isEqualTo(value);
 }
Ejemplo n.º 2
0
  /**
   * Test method for {@link
   * com.j2speed.accessor.AbstractMethodAccessor#invokeBase(java.lang.Object[])} .
   *
   * @throws Exception
   * @throws Throwable
   */
  @Test
  public void testInvoke() throws Exception {
    int expected = 26071973;
    want.number(getPrivate.invoke(test, new Object[0]).intValue()).isEqualTo(expected);

    int newValue = 26072007;
    want.number(setPrivate.invoke(test, new Object[] {newValue})).isEqualTo(expected);
    want.number(getPrivate.invoke(test, new Object[] {})).isEqualTo(newValue);
  }