Examples of MethodProxy


Examples of net.sf.cglib.proxy.MethodProxy

        return null;
    }

    private static int getSuperIndex(Class proxyType, Method method) {
        Signature signature = new Signature(method.getName(), Type.getReturnType(method), Type.getArgumentTypes(method));
        MethodProxy methodProxy = MethodProxy.find(proxyType, signature);
        if (methodProxy != null) {
            return methodProxy.getSuperIndex();
        }
        return -1;
    }
View Full Code Here

Examples of net.sf.cglib.proxy.MethodProxy

    void initialize() {
        String encodingStyle = "";
        for (int i = 0; i < operationInfos.length; i++) {
            OperationInfo operationInfo = operationInfos[i];
            Signature signature = operationInfo.getSignature();
            MethodProxy methodProxy = MethodProxy.find(serviceEndpointClass, signature);
            if (methodProxy == null) {
                throw new RuntimeException("No method proxy for operationInfo " + signature);
            }
            int index = methodProxy.getSuperIndex();
            sortedOperationInfos[index] = operationInfo;
            if (operationInfo.getOperationDesc().getUse() == Use.ENCODED) {
                encodingStyle = org.apache.axis.Constants.URI_SOAP11_ENC;
            }
        }
View Full Code Here

Examples of org.mockito.cglib.proxy.MethodProxy

    private static final long serialVersionUID = -4389233991416356668L;

    public void setMockitoNamingPolicy(MockitoMethodProxy mockitoMethodProxy) {
        try {
            MethodProxy methodProxy = mockitoMethodProxy.getMethodProxy();
            Field createInfoField = reflectOnCreateInfo(methodProxy);
            createInfoField.setAccessible(true);
            Object createInfo = createInfoField.get(methodProxy);
            Field namingPolicyField = createInfo.getClass().getDeclaredField("namingPolicy");
            namingPolicyField.setAccessible(true);
View Full Code Here

Examples of org.mockito.cglib.proxy.MethodProxy

public class SerializableMockitoMethodProxyTest extends TestBase {

    @Test
    public void shouldCreateCorrectCreationInfo() throws Exception {
        // given
        MethodProxy proxy = MethodProxy.create(String.class, Integer.class, "", "", "");
        SerializableMockitoMethodProxy serializableMockitoMethodProxy = new SerializableMockitoMethodProxy(proxy);
        serializableMockitoMethodProxy.methodProxy = null;

        // when
        Object methodProxy = Whitebox.invokeMethod(serializableMockitoMethodProxy, "getMethodProxy"new Object[0]);
View Full Code Here

Examples of org.mockito.cglib.proxy.MethodProxy

    }

    @Test
    public void shouldCreateCorrectSignatures() throws Exception {
        // given
        MethodProxy proxy = MethodProxy.create(String.class, Integer.class, "a", "b", "c");
        SerializableMockitoMethodProxy serializableMockitoMethodProxy = new SerializableMockitoMethodProxy(proxy);
        serializableMockitoMethodProxy.methodProxy = null;

        // when
        MethodProxy methodProxy = (MethodProxy) Whitebox.invokeMethod(serializableMockitoMethodProxy, "getMethodProxy"new Object[0]);

        // then
        assertEquals("a", methodProxy.getSignature().getDescriptor());
        assertEquals("b", methodProxy.getSignature().getName());
        assertEquals("c", methodProxy.getSuperName());
    }
View Full Code Here

Examples of org.mockito.cglib.proxy.MethodProxy

   
    //TODO: move to separate factory
    @Test
    public void shouldCreateSerializableMethodProxyIfIsSerializableMock() throws Exception {
        MethodInterceptorFilter filter = new MethodInterceptorFilter(handler, (MockSettingsImpl) withSettings().serializable());
        MethodProxy methodProxy = MethodProxy.create(String.class, String.class, "", "toString", "toString");
       
        // when
        MockitoMethodProxy mockitoMethodProxy = filter.createMockitoMethodProxy(methodProxy);
       
        // then
View Full Code Here

Examples of org.mockito.cglib.proxy.MethodProxy

    }
   
    @Test
    public void shouldCreateNONSerializableMethodProxyIfIsNotSerializableMock() throws Exception {
        MethodInterceptorFilter filter = new MethodInterceptorFilter(handler, (MockSettingsImpl) withSettings());
        MethodProxy methodProxy = MethodProxy.create(String.class, String.class, "", "toString", "toString");
       
        // when
        MockitoMethodProxy mockitoMethodProxy = filter.createMockitoMethodProxy(methodProxy);
       
        // then
View Full Code Here

Examples of org.mockito.cglib.proxy.MethodProxy

public class CGLIBHackerTest extends TestBase {

    @Test
    public void shouldSetMockitoNamingPolicy() throws Exception {
        //given
        MethodProxy methodProxy = MethodProxy.create(String.class, Integer.class, "", "", "");
       
        //when
        new CGLIBHacker().setMockitoNamingPolicy(methodProxy);
       
        //then
View Full Code Here

Examples of org.mockito.cglib.proxy.MethodProxy

    }
   
    @Test
    public void shouldSetMockitoNamingPolicyEvenIfMethodProxyIsProxied() throws Exception {
        //given
        MethodProxy proxiedMethodProxy = spy(MethodProxy.create(String.class, Integer.class, "", "", ""));
       
        //when
        new CGLIBHacker().setMockitoNamingPolicy(proxiedMethodProxy);
       
        //then
View Full Code Here

Examples of org.mockito.cglib.proxy.MethodProxy

    private static final long serialVersionUID = -4389233991416356668L;

    public void setMockitoNamingPolicy(MockitoMethodProxy mockitoMethodProxy) {
        try {
            MethodProxy methodProxy = mockitoMethodProxy.getMethodProxy();
            Field createInfoField = reflectOnCreateInfo(methodProxy);
            createInfoField.setAccessible(true);
            Object createInfo = createInfoField.get(methodProxy);
            Field namingPolicyField = createInfo.getClass().getDeclaredField("namingPolicy");
            namingPolicyField.setAccessible(true);
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.