Package de.berndsteindorff.junittca.model

Examples of de.berndsteindorff.junittca.model.ClassFile


    try {
      ProjectFileHandler pfh = new ProjectFileHandler();
      pfh.loadFile(new File("test666.yap"));
      pfh.newProject("Bla Projekt 1");
      pfh.getProject().addTestClass(
          new ClassFile(Const.NAME_DUMMYTEST, Const.CLASSPATH));
      pfh.runTests();
      pfh.runTests();
      pfh.closeDatabase();

    } catch (Exception e) {
View Full Code Here


      }
    }

    @Override
    public Object getValueAt(int row, int col) {
      ClassFile cf = classFiles.get(row);
      // logger.info("row "+ row + " col "+ col+ " cf: " +
      // cf.getClassName());
      if (col == 0) {
        return cf.getPackageName();
      } else if (col == 1) {
        return cf.getSimpleClassName();
      } else if (col == 2) {
        return markedClassRow[row];
      } else
        return "";
    }
View Full Code Here

  @Test
  public void reloadClassesSimple() throws ClassNotFoundException {
    FileClassLoader2 fcl = new FileClassLoader2(CLASSPATH);

    List<ClassFile> classFiles = new ArrayList<ClassFile>(3);
    classFiles.add(new ClassFile(
        "de.berndsteindorff.junittca.model.test.ClassMethodsTest",
        CLASSPATH + DIRSEP));
    classFiles.add(new ClassFile(NAME_DUMMYTEST, CLASSPATH + DIRSEP));
    classFiles.add(new ClassFile(
        "de.berndsteindorff.junittca.model.test.ProjectTest", CLASSPATH
            + DIRSEP));
    List<Class<?>> classes = fcl.reloadClasses(classFiles);

    assertEquals(3, classes.size());
View Full Code Here

   */
  @Test
  public void classChangingNoChange() throws ClassNotFoundException {
    logger.info("classChangingNoChange");
    Project project = new Project("Bernds Projekt111");
    project.addTestClass(new ClassFile(NAME_DUMMYTEST, CLASSPATH + DIRSEP));

    assertEquals(1, project.getActualTestClasses().size());

    FileClassLoader2 fcl = new FileClassLoader2(Const.CLASSPATH);
    List<Class<?>> classes = fcl.reloadClasses(project
View Full Code Here

   *             The exception should not exist.
   */
  @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());
    assertEquals(Const.CLASSPATH + DIRSEP, cf.getClassPath());

    ClassFile exp = new ClassFile(
        "de.berndsteindorff.junittca.model.test.RunTest",
        Const.CLASSPATH + DIRSEP);
    assertEquals(exp, cf);
  }
View Full Code Here

   *             The exception should not exist.
   */
  @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());
    assertEquals(Const.CLASSPATH + DIRSEP, cf.getClassPath());

    ClassFile exp = new ClassFile(
        "de.berndsteindorff.junittca.model.test.RunTest",
        Const.CLASSPATH + DIRSEP);
    assertEquals(exp, cf);
  }
View Full Code Here

   * Test loading a file with a class with no test.
   */
  @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

   *             Should not happen.
   */
  @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());
    assertEquals(CLASSPATH_TESTPROJEKT + DIRSEP, cf.getClassPath());

  }
View Full Code Here

   *             Should not happen.
   */
  @Test
  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());
    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());
    assertEquals(CLASSPATH_TESTPROJEKT + DIRSEP, cf.getClassPath());

  }
View Full Code Here

   */
  @Test
  public void loadClassesFromClasspath() throws ClassNotFoundException {
    logger.info("loadClassesFromStandardClasspath");
    List<ClassFile> expTestClasses = new ArrayList<ClassFile>();
    expTestClasses.add(new ClassFile(
        "de.berndsteindorff.junittca.model.test.ClassFileTest",
        CLASSPATH + DIRSEP));
    expTestClasses.add(new ClassFile(
        "de.berndsteindorff.junittca.model.test.ClassMethodsTest",
        CLASSPATH + DIRSEP));
    expTestClasses.add(new ClassFile(NAME_DUMMYTEST, CLASSPATH + DIRSEP));
    expTestClasses.add(new ClassFile(
        "de.berndsteindorff.junittca.model.test.FileClassLoaderTest",
        CLASSPATH + DIRSEP));
    expTestClasses
        .add(new ClassFile(
            "de.berndsteindorff.junittca.model.test.ProjectFileHandlerTest",
            CLASSPATH + DIRSEP));
    expTestClasses.add(new ClassFile(
        "de.berndsteindorff.junittca.model.test.ProjectTest", CLASSPATH
            + DIRSEP));
    expTestClasses.add(new ClassFile(
        "de.berndsteindorff.junittca.model.test.RunTest", CLASSPATH
            + DIRSEP));

    FileClassLoader2 fcl = new FileClassLoader2(CLASSPATH);

View Full Code Here

TOP

Related Classes of de.berndsteindorff.junittca.model.ClassFile

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.