Package de.berndsteindorff.junittca.model

Examples of de.berndsteindorff.junittca.model.ClassFile


   * @throws ClassNotFoundException
   */
  @Test
  public void loadClassesFromTwoClasspath() throws ClassNotFoundException {
    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));
    expTestClasses.add(new ClassFile(
        "de.berndsteindorff.junittca.tests.MathSimpleTest",
        CLASSPATH_TESTPROJEKT + DIRSEP));
    expTestClasses.add(new ClassFile(
        "de.berndsteindorff.junittca.tests.StocksSupportFailTest",
        CLASSPATH_TESTPROJEKT + DIRSEP));
    expTestClasses.add(new ClassFile(
        "de.berndsteindorff.junittca.tests.StocksSupportOkTest",
        CLASSPATH_TESTPROJEKT + DIRSEP));

    FileClassLoader2 fcl = new FileClassLoader2(CLASSPATH + PATHSEP
        + CLASSPATH_TESTPROJEKT);
View Full Code Here


   * new ClassLoader, otherwise the ClassLoader found a "duplicate class
   * definiton for name:..."
   */
  @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
    cf = fcl.findClass(new File(PATH_DUMMYTEST));
    assertEquals(NAME_DUMMYTEST, cf.getClassName());
  }
View Full Code Here

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

    fcl = new FileClassLoader2(CLASSPATH_TESTPROJEKT);
    List<ClassFile> classFiles = new ArrayList<ClassFile>(1);
    classFiles.add(cf);
    Result result = JUnitCore.runClasses(fcl.reloadClasses(classFiles).get(
View Full Code Here

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

    assertEquals(1, project.getActualTestClasses().size());
    FileClassLoader2 fcl = new FileClassLoader2(CLASSPATH);
    Class<?> clazz = fcl.reloadClasses(project.getActualTestClasses()).get(
        0);
View Full Code Here

   */
  @Test
  public synchronized void oneMoreMethodAndRun() throws Exception {
    logger.info("oneMoreMethodAndRun");
    Project project = new Project("Bernds Projekt102");
    project.addTestClass(new ClassFile(NAME_DUMMYTEST, CLASSPATH + DIRSEP));

    try {

      project.runTests();
      assertEquals(1, project.getTestRuns().size());
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

  public void loadSave() throws Exception {
    logger.info("loadSave");
    ph.newProject("Bernds Projekt");
    Project project = ph.getProject();
    project.setClasspath(CLASSPATH);
    project.addTestClass(new ClassFile(NAME_DUMMYTEST, CLASSPATH + DIRSEP));

    ph.saveProject();

    Project exp = new Project("Bernds Projekt");
    exp.setClasspath(Const.CLASSPATH);
    exp.addTestClass(new ClassFile(NAME_DUMMYTEST, CLASSPATH + DIRSEP));

    ph.loadProject("Bernds Projekt");
    assertEquals(exp.getName(), ph.getProject().getName());
    assertEquals(exp.getClasspath(), ph.getProject().getClasspath());
    ClassFile expCf = exp.getActualTestClasses().get(0);
    ClassFile doneCf = ph.getProject().getActualTestClasses().get(0);
    assertEquals(expCf, doneCf);

  }
View Full Code Here

  public void multipleSavingWithSameName() throws Exception {
    logger.info("multipleSavingWithSameName");
    ph.newProject("Bernds Projekt23");
    Project project = ph.getProject();
    project.setClasspath(PATH_DB);
    project.addTestClass(new ClassFile(NAME_DUMMYTEST, CLASSPATH + DIRSEP));
    ph.saveProject();

    ph.closeDatabase();
    ph.loadFile(new File(PATH_DB + i + ".yap"));
    ph.newProject("Bernds Projekt23");
View Full Code Here

  public void runSimple() throws Exception {
    logger.info("runSimple");
    ph.newProject("Bernds Projekt17");
    Project project = ph.getProject();
    project.setClasspath(Const.CLASSPATH);
    project.addTestClass(new ClassFile(NAME_DUMMYTEST, CLASSPATH + DIRSEP));
    ph.saveProject();

    ph.runTests();
    assertEquals(1, project.getTestRuns().size());
    assertEquals(1, project.getTestRuns().get(0).getClassMethods().size());
View Full Code Here

  public void runTests() throws Exception {
    logger.info("runTests");
    ph.newProject("bla");
    Project project = ph.getProject();
    project.setClasspath(CLASSPATH);
    project.addTestClass(new ClassFile(NAME_DUMMYTEST, CLASSPATH + DIRSEP));
    project.setName("bla17");
    ph.runTests();

    assertEquals(1, project.getTestRuns().size());
    ph.closeDatabase();
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.