use of org.apache.beam.vendor.bytebuddy.v1_11_0.net.bytebuddy.implementation.bytecode.StackManipulation in project byte-buddy by raphw.
the class ReferenceTypeAwareAssignerTest method testSourceToTargetAssignable.
@Test
public void testSourceToTargetAssignable() throws Exception {
defineAssignability(true, false);
StackManipulation stackManipulation = ReferenceTypeAwareAssigner.INSTANCE.assign(source, target, Assigner.Typing.STATIC);
assertThat(stackManipulation.isValid(), is(true));
StackManipulation.Size size = stackManipulation.apply(methodVisitor, implementationContext);
assertThat(size.getSizeImpact(), is(0));
assertThat(size.getMaximalSize(), is(0));
verifyZeroInteractions(methodVisitor);
}
use of org.apache.beam.vendor.bytebuddy.v1_11_0.net.bytebuddy.implementation.bytecode.StackManipulation in project byte-buddy by raphw.
the class ReferenceTypeAwareAssignerTest method testTargetToSourceAssignable.
@Test(expected = IllegalStateException.class)
public void testTargetToSourceAssignable() throws Exception {
defineAssignability(false, true);
StackManipulation stackManipulation = ReferenceTypeAwareAssigner.INSTANCE.assign(source, target, Assigner.Typing.STATIC);
assertThat(stackManipulation.isValid(), is(false));
stackManipulation.apply(methodVisitor, implementationContext);
}
use of org.apache.beam.vendor.bytebuddy.v1_11_0.net.bytebuddy.implementation.bytecode.StackManipulation in project byte-buddy by raphw.
the class AssignerEqualTypesOnlyTest method testAssignmentErasureNotEqual.
@Test
public void testAssignmentErasureNotEqual() throws Exception {
StackManipulation stackManipulation = Assigner.EqualTypesOnly.ERASURE.assign(first, second, Assigner.Typing.of(dynamicallyTyped));
assertThat(stackManipulation.isValid(), is(false));
verify(first).asErasure();
verifyNoMoreInteractions(first);
verify(second).asErasure();
verifyNoMoreInteractions(second);
}
use of org.apache.beam.vendor.bytebuddy.v1_11_0.net.bytebuddy.implementation.bytecode.StackManipulation in project byte-buddy by raphw.
the class AssignerRefusingTest method testAssignmentEqual.
@Test
public void testAssignmentEqual() throws Exception {
StackManipulation stackManipulation = Assigner.Refusing.INSTANCE.assign(first, first, Assigner.Typing.of(dynamicallyTyped));
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 AssignerRefusingTest method testAssignmentNotEqual.
@Test
public void testAssignmentNotEqual() throws Exception {
StackManipulation stackManipulation = Assigner.Refusing.INSTANCE.assign(first, second, Assigner.Typing.of(dynamicallyTyped));
assertThat(stackManipulation.isValid(), is(false));
}
Aggregations