Package com.j2speed.accessor.ClassAccessorTest.AccessPackageProtectedObject

Examples of com.j2speed.accessor.ClassAccessorTest.AccessPackageProtectedObject.AccessInner


  public void testForInnerString() {
    ClassAccessor accessor = ClassAccessor.create("com.j2speed.accessor.separate.PackagePrivateObject");
    Object object = accessor.constructor(String.class).newInstance("Alex");
    ClassAccessor innerAccessor = accessor.forInner("Inner");
    Date expectedDate = new Date();
    AccessInner inner = innerAccessor.constructor(object, Date.class).newProxy(AccessInner.class, expectedDate);
    assertSame(expectedDate, inner.getDate());
  }
View Full Code Here


  public void testCreateAccessorClassOfQString() {
    ClassAccessor accessor = ClassAccessor.create("com.j2speed.accessor.separate.PackagePrivateObject");
    Object object = accessor.constructor(String.class).newInstance("Alex");
    ClassAccessor innerAccessor = ClassAccessor.create(object.getClass(), "Inner");
    Date expectedDate = new Date();
    AccessInner inner = innerAccessor.constructor(object, Date.class).newProxy(AccessInner.class, expectedDate);
    assertSame(expectedDate, inner.getDate());
  }
View Full Code Here

  public void testCreateAccessorClassOfQStringClassLoader() {
    ClassAccessor accessor = ClassAccessor.create("com.j2speed.accessor.separate.PackagePrivateObject", getClass().getClassLoader());
    Object object = accessor.constructor(String.class).newInstance("Alex");
    ClassAccessor innerAccessor = ClassAccessor.create(object.getClass(), "Inner", getClass().getClassLoader());
    Date expectedDate = new Date();
    AccessInner inner = innerAccessor.constructor(object, Date.class).newProxy(AccessInner.class, expectedDate);
    assertSame(expectedDate, inner.getDate());
  }
View Full Code Here

TOP

Related Classes of com.j2speed.accessor.ClassAccessorTest.AccessPackageProtectedObject.AccessInner

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.