Package org.springsource.loaded.test.infra

Examples of org.springsource.loaded.test.infra.TestClassLoader


 
  @Before
  public void setup() throws Exception {
    SpringLoadedPreProcessor.disabled = true;
    NameRegistry.reset();
    binLoader = new TestClassLoader(toURLs(TestDataPath, TestDataAspectJPath, AspectjrtJar, CodeJar, Java8CodeJar), this.getClass().getClassLoader());
  }
View Full Code Here


  public void teardown() throws Exception {
    SpringLoadedPreProcessor.disabled = false;
  }

  public void switchToGroovy() {
    binLoader = new TestClassLoader(toURLs(GroovyTestDataPath, GroovyrtJar), this.getClass().getClassLoader());
    //    Thread.currentThread().setContextClassLoader(binLoader);
  }
View Full Code Here

public class TestInfrastructureTests extends SpringLoadedTests {

  // Just attempt to access something in the testdata project through the classloader
  @Test
  public void loader() {
    TestClassLoader tcl = new TestClassLoader(toURLs(TestDataPath), this.getClass().getClassLoader());
    URL url = tcl.findResource("data/SimpleClass.class");
    Assert.assertNotNull(url);
    url = tcl.findResource("data/MissingClass.class");
    Assert.assertNull(url);
  }
View Full Code Here

  // Check loading of data as a byte array
  // Size changed here from 331 to 394 when switched to AspectJ project for testcode!
  @Test
  public void loading() {
    TestClassLoader tcl = new TestClassLoader(toURLs(TestDataPath), this.getClass().getClassLoader());
    byte[] classdata = Utils.loadDottedClassAsBytes(tcl, "data.SimpleClass");
    Assert.assertNotNull(classdata);
    Assert.assertEquals(331, classdata.length);
  }
View Full Code Here

   */
  @Ignore
  @Test
  public void jar() throws Exception {

    TestClassLoader tcl = new TestClassLoader(toURLs(ExpressionsJar), this.getClass().getClassLoader());
    ZipFile zf = new ZipFile(ExpressionsJar);
    Enumeration<? extends ZipEntry> entries = zf.entries();
    while (entries.hasMoreElements()) {
      ZipEntry ze = entries.nextElement();
      System.out.println(ze.getName());
      String name = ze.getName();
      if (name.endsWith(".class")) {
        name = name.substring(0,name.length()-6);
        tcl.loadClass(name.replaceAll("/","."));
      }
    }
//    URL url = tcl.findResource("data/SimpleClass.class");
//    Assert.assertNotNull(url);
//    url = tcl.findResource("data/MissingClass.class");
View Full Code Here

* @author kdvolder
*/
public class JustJavaClassProvider extends SpringLoadedTests implements IClassProvider {

  public JustJavaClassProvider() {
    binLoader = new TestClassLoader(toURLs(TestDataPath), ClassLoader.getSystemClassLoader());
  }
View Full Code Here

TOP

Related Classes of org.springsource.loaded.test.infra.TestClassLoader

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.