use of org.apache.beam.vendor.bytebuddy.v1_11_0.net.bytebuddy.implementation.bytecode.StackManipulation in project byte-buddy by raphw.
the class MethodInvocationGenericTest method testGenericMethodErasureEqual.
@Test
public void testGenericMethodErasureEqual() throws Exception {
when(methodReturnType.asErasure()).thenReturn(declaredErasure);
StackManipulation stackManipulation = MethodInvocation.invoke(methodDescription);
assertThat(stackManipulation.isValid(), is(true));
assertThat(stackManipulation, is((StackManipulation) MethodInvocation.invoke(declaredMethod)));
}
use of org.apache.beam.vendor.bytebuddy.v1_11_0.net.bytebuddy.implementation.bytecode.StackManipulation in project byte-buddy by raphw.
the class MethodInvocationGenericTest method testGenericMethodSpecialErasureEqual.
@Test
public void testGenericMethodSpecialErasureEqual() throws Exception {
when(methodReturnType.asErasure()).thenReturn(declaredErasure);
StackManipulation stackManipulation = MethodInvocation.invoke(methodDescription).special(targetType);
assertThat(stackManipulation.isValid(), is(true));
assertThat(stackManipulation, is(MethodInvocation.invoke(declaredMethod).special(targetType)));
}
use of org.apache.beam.vendor.bytebuddy.v1_11_0.net.bytebuddy.implementation.bytecode.StackManipulation in project byte-buddy by raphw.
the class MethodInvocationGenericTest method testGenericMethodVirtual.
@Test
public void testGenericMethodVirtual() throws Exception {
TypeDescription genericErasure = mock(TypeDescription.class);
when(methodReturnType.asErasure()).thenReturn(genericErasure);
when(genericErasure.asErasure()).thenReturn(genericErasure);
StackManipulation stackManipulation = MethodInvocation.invoke(methodDescription).virtual(targetType);
assertThat(stackManipulation.isValid(), is(true));
assertThat(stackManipulation, is((StackManipulation) new StackManipulation.Compound(MethodInvocation.invoke(declaredMethod).virtual(targetType), TypeCasting.to(genericErasure))));
}
use of org.apache.beam.vendor.bytebuddy.v1_11_0.net.bytebuddy.implementation.bytecode.StackManipulation in project byte-buddy by raphw.
the class MethodInvocationGenericTest method testIllegal.
@Test
public void testIllegal() throws Exception {
TypeDescription genericErasure = mock(TypeDescription.class);
when(methodReturnType.asErasure()).thenReturn(genericErasure);
when(declaredMethod.isTypeInitializer()).thenReturn(true);
StackManipulation stackManipulation = MethodInvocation.invoke(methodDescription);
assertThat(stackManipulation.isValid(), is(false));
}
use of org.apache.beam.vendor.bytebuddy.v1_11_0.net.bytebuddy.implementation.bytecode.StackManipulation in project byte-buddy by raphw.
the class MethodInvocationGenericTest method testGenericMethodSpecial.
@Test
public void testGenericMethodSpecial() throws Exception {
TypeDescription genericErasure = mock(TypeDescription.class);
when(methodReturnType.asErasure()).thenReturn(genericErasure);
when(genericErasure.asErasure()).thenReturn(genericErasure);
StackManipulation stackManipulation = MethodInvocation.invoke(methodDescription).special(targetType);
assertThat(stackManipulation.isValid(), is(true));
assertThat(stackManipulation, is((StackManipulation) new StackManipulation.Compound(MethodInvocation.invoke(declaredMethod).special(targetType), TypeCasting.to(genericErasure))));
}
Aggregations