Package test

Examples of test.SomeClass


public class ClassUtilsTest {

  @Test
  public void testParentLastClassLoading() throws Exception {
    Resource jar = new DefaultResourceLoader().getResource("class-v1.jar");
    SomeClass v2 = new SomeClass();
    assertEquals("Class-v2", System.getProperty(SomeClass.LAST_LOADED));
    assertNotNull(System.getProperty(SomeClass.CLASS_LOADED + ".2"));

    // use v2 CL as a parent
    Object obj = loadFromJar(jar, v2.getClass().getClassLoader(), "test.SomeClass");

    // check the jar classes are preferred
    assertEquals("Class-v1", System.getProperty(SomeClass.LAST_LOADED));
    assertNotNull(System.getProperty(SomeClass.CLASS_LOADED + ".1"));
    assertFalse(v2.getClass().equals(obj.getClass()));
  }
View Full Code Here

TOP

Related Classes of test.SomeClass

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.