Package de.berndsteindorff.junittca.model

Examples of de.berndsteindorff.junittca.model.FileClassLoader2.findClass()


  @Test
  public void loadClass() throws ClassNotFoundException {
    logger.info("loadClass");
    ClassFile cf = null;
    FileClassLoader2 fcl = new FileClassLoader2(Const.CLASSPATH);
    cf = fcl.findClass(new File(Const.CLASSPATH + DIRSEP + "de" + DIRSEP
        + "berndsteindorff" + DIRSEP + "junittca_local" + DIRSEP + "model"
        + DIRSEP + "test" + DIRSEP + "RunTest.class"));

    assertEquals("de.berndsteindorff.junittca.model.test.RunTest", cf
        .getClassName());
View Full Code Here


  @Test
  public void loadClassOtherClassPathEnd() throws ClassNotFoundException {
    logger.info("loadClassOtherClassPathEnd");
    ClassFile cf = null;
    FileClassLoader2 fcl = new FileClassLoader2(Const.CLASSPATH + DIRSEP);
    cf = fcl.findClass(new File(Const.CLASSPATH + DIRSEP + "de" + DIRSEP
        + "berndsteindorff" + DIRSEP + "junittca_local" + DIRSEP + "model"
        + DIRSEP + "test" + DIRSEP + "RunTest.class"));

    assertEquals("de.berndsteindorff.junittca.model.test.RunTest", cf
        .getClassName());
View Full Code Here

  @Test
  public void loadClassWithNoTest() {
    logger.info("loadClassWithNoTest");
    ClassFile cf = null;
    FileClassLoader2 fcl = new FileClassLoader2(Const.CLASSPATH + DIRSEP);
    cf = fcl.findClass(new File(Const.CLASSPATH + DIRSEP + "de" + DIRSEP
        + "berndsteindorff" + DIRSEP + "junittca_local" + DIRSEP + "model"
        + DIRSEP + "test" + DIRSEP + "DummyMain.class"));
    assertNull(cf);
  }
View Full Code Here

  @Test
  public void loadClassFromExtClasspath() throws ClassNotFoundException {
    logger.info("loadClassFromExtClasspath");
    ClassFile cf = null;
    FileClassLoader2 fcl = new FileClassLoader2(Const.CLASSPATH_TESTPROJEKT);
    cf = fcl.findClass(new File(Const.CLASSPATH_TESTPROJEKT + DIRSEP + "de"
        + DIRSEP + "berndsteindorff" + DIRSEP + "junittca_local" + DIRSEP
        + "tests" + DIRSEP + "StocksSupportOkTest.class"));

    assertEquals("de.berndsteindorff.junittca.tests.StocksSupportOkTest",
        cf.getClassName());
View Full Code Here

  public void loadClassFromThwoClasspaths() throws ClassNotFoundException {
    logger.info("loadClassFromExtClasspath");
    ClassFile cf = null;
    FileClassLoader2 fcl = new FileClassLoader2(CLASSPATH_TESTPROJEKT
        + PATHSEP + CLASSPATH);
    cf = fcl.findClass(new File(CLASSPATH_TESTPROJEKT + DIRSEP + "de"
        + DIRSEP + "berndsteindorff" + DIRSEP + "junittca_local" + DIRSEP
        + "tests" + DIRSEP + "StocksSupportOkTest.class"));

    assertEquals("de.berndsteindorff.junittca.tests.StocksSupportOkTest",
        cf.getClassName());
View Full Code Here

        cf.getClassName());
    assertEquals(CLASSPATH_TESTPROJEKT + DIRSEP, cf.getClassPath());

    cf = null;
    fcl = new FileClassLoader2(CLASSPATH + PATHSEP + CLASSPATH_TESTPROJEKT);
    cf = fcl.findClass(new File(CLASSPATH_TESTPROJEKT + DIRSEP + "de"
        + DIRSEP + "berndsteindorff" + DIRSEP + "junittca_local" + DIRSEP
        + "tests" + DIRSEP + "StocksSupportOkTest.class"));

    assertEquals("de.berndsteindorff.junittca.tests.StocksSupportOkTest",
        cf.getClassName());
View Full Code Here

   */
  @Test
  public void loadClassTwice() {
    ClassFile cf = null;
    FileClassLoader2 fcl = new FileClassLoader2(CLASSPATH);
    cf = fcl.findClass(new File(PATH_DUMMYTEST));

    assertEquals(NAME_DUMMYTEST, cf.getClassName());

    fcl = new FileClassLoader2(CLASSPATH); // to initialize a new
    // ClassLoader is very important
View Full Code Here

    assertEquals(NAME_DUMMYTEST, cf.getClassName());

    fcl = new FileClassLoader2(CLASSPATH); // to initialize a new
    // ClassLoader is very important
    cf = fcl.findClass(new File(PATH_DUMMYTEST));
    assertEquals(NAME_DUMMYTEST, cf.getClassName());
  }

  /**
   * Test loading a class from ac classpath and run it.
View Full Code Here

  public void loadClassFromExtClasspathAndRunTest()
      throws ClassNotFoundException {
    logger.info("loadClassFromExtClasspathAndRunTest");
    ClassFile cf = null;
    FileClassLoader2 fcl = new FileClassLoader2(CLASSPATH_TESTPROJEKT);
    cf = fcl.findClass(new File(CLASSPATH_TESTPROJEKT + DIRSEP + "de"
        + DIRSEP + "berndsteindorff" + DIRSEP + "junittca_local" + DIRSEP
        + "tests" + DIRSEP + "StocksSupportOkTest.class"));

    assertEquals("de.berndsteindorff.junittca.tests.StocksSupportOkTest",
        cf.getClassName());
View Full Code Here

    FileClassLoader2 fcl = new FileClassLoader2(CLASSPATH);
    File file = new File(CLASSPATH + DIRSEP + "de" + DIRSEP
        + "berndsteindorff" + DIRSEP + "junittca_local" + DIRSEP
        + "TcaMain.class");
    try {
      ClassFile cf = fcl.findClass(file);
      assertNull(cf);

      ProjectFileHandler pfh = new ProjectFileHandler();
      pfh.newProject("bla");
      pfh.getProject().setClasspath(CLASSPATH);
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.