Package org.p6spy.signedjartest

Examples of org.p6spy.signedjartest.SignedJarTestTarget


public class SignedJarTest extends BaseTestCase {

  @Test
  public void testProxyOfClassFromSignedJar() {
    SignedJarTestTarget target = new SignedJarTestTargetImpl();
    Delegate delegate = new Delegate() {
      @Override
      public Object invoke(Object proxy, Object underlying, Method method, Object[] args) throws Throwable {
        return method.invoke(underlying, args);
      }
    };

    GenericInvocationHandler<SignedJarTestTarget> invocationHandler = new GenericInvocationHandler<SignedJarTestTarget>(target);
    invocationHandler.addDelegate(new MethodNameMatcher("doSomething"), delegate);

    SignedJarTestTarget proxy = ProxyFactory.createProxy(target, invocationHandler);

    proxy.doSomething();

  }
View Full Code Here

TOP

Related Classes of org.p6spy.signedjartest.SignedJarTestTarget

Copyright © 2018 www.massapicom. 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.