use of java.lang.invoke.MethodType in project jdk8u_jdk by JetBrains.
the class MethodTypeTest method testWrap.
@Test
public void testWrap() {
System.out.println("wrap");
MethodType[] instances = { mt_viS, mt_OO2, mt_vv, mt_Ov, mt_iSI, mt_ISi, mt_ISI, mt_iSi };
MethodType[] expResults = { mt_VIS, mt_OO2, mt_Vv, mt_Ov, mt_ISI, mt_ISI, mt_ISI, mt_ISI };
for (int i = 0; i < instances.length; i++) {
MethodType result = instances[i].wrap();
assertSame("#" + i, expResults[i], result);
}
}
use of java.lang.invoke.MethodType in project jdk8u_jdk by JetBrains.
the class MethodTypeTest method testMake_Class.
/**
* Test of make method, of class MethodType.
*/
@Test
public void testMake_Class() {
System.out.println("make (from single type)");
Class<?> rt = Integer.class;
MethodType expResult = MethodType.methodType(rt, new Class<?>[0]);
MethodType result = MethodType.methodType(rt);
assertSame(expResult, result);
}
use of java.lang.invoke.MethodType in project jdk8u_jdk by JetBrains.
the class MethodTypeTest method testEquals_Object.
/**
* Test of equals method, of class MethodType.
*/
@Test
public void testEquals_Object() {
System.out.println("equals");
Object x = null;
MethodType instance = mt_viS;
boolean expResult = false;
boolean result = instance.equals(x);
assertEquals(expResult, result);
}
use of java.lang.invoke.MethodType in project jdk8u_jdk by JetBrains.
the class MethodTypeTest method testUnwrap.
@Test
public void testUnwrap() {
System.out.println("unwrap");
MethodType[] instances = { mt_viS, mt_OO2, mt_vv, mt_Ov, mt_iSI, mt_ISi, mt_ISI, mt_iSi };
MethodType[] expResults = { mt_viS, mt_OO2, mt_vv, mt_Ov, mt_iSi, mt_iSi, mt_iSi, mt_iSi };
for (int i = 0; i < instances.length; i++) {
MethodType result = instances[i].unwrap();
assertSame("#" + i, expResults[i], result);
}
}
use of java.lang.invoke.MethodType in project jdk8u_jdk by JetBrains.
the class MethodTypeTest method testParameterArray.
/**
* Test of parameterArray method, of class MethodType.
*/
@Test
public void testParameterArray() {
System.out.println("parameterArray");
MethodType instance = mt_viS;
Class<?>[] expResult = ptypes;
Class<?>[] result = instance.parameterArray();
assertEquals(Arrays.asList(expResult), Arrays.asList(result));
}
Aggregations