Package de.berndsteindorff.junittca.model

Examples of de.berndsteindorff.junittca.model.Project


  public void sendEvent(TcaEvent e) {
    String ename = e.getEventName();
    if (ename.equals(TcaEventCommands.UPDATESTART)
        || ename.equals(TcaEventCommands.UPDATECLASSES)) {
      logger.info(ename);
      Project project = model.getProject();
      tfClasspath.setText(project.getClasspath());
      createTableClasses(project.getActualTestClasses());
      logger.info("testClasses.size: "
          + project.getActualTestClasses().size() ", class-path: " + project.getClasspath());
      repaint();
    } else if (ename.equals(TcaEventCommands.SAVEPROJECT)) {
      Project project = model.getProject();
      try {
        project.setClasspath(tfClasspath.getText());
      } catch (Exception e1) {
        TcaFrame.handleException(e1);
      }
    } else if (ename.equals(TcaEventCommands.UPDATECLASSPATH)) {
      Project project = model.getProject();
      logger.info(ename + "new class-path: " + project.getClasspath());
      tfClasspath.setText(project.getClasspath());
      repaint();
    }
  }
View Full Code Here


  @Override
  public void sendEvent(TcaEvent e) {
    String ename = e.getEventName();
    if (ename.equals(TcaEventCommands.UPDATERUN)) {
      logger.info(ename);
      Project project = model.getProject();
      run = project.getTestRuns().get(0);
      setRun();
      repaint();
    }
  }
View Full Code Here

  @Override
  public void sendEvent(TcaEvent e) {
    String ename = e.getEventName();
    logger.info(ename);
    if (ename.equals(TcaEventCommands.UPDATESTART)) {
      Project project = model.getProject();
      tfProjectName.setText(project.getName());
      createTableHistory(project.getTestRuns());
      repaint();
    } else if (ename.equals(TcaEventCommands.UPDATERUN)) {
      Project project = model.getProject();
      Run run = project.getTestRuns().get(0);
      Result result = run.getResult();
      counterPanel.setRunValue(result.getRunCount());
      counterPanel.setIgnoredValue(result.getIgnoreCount());
      counterPanel.setOkValue(result.getRunCount()
          - result.getFailureCount());
      counterPanel.setFailureValue(result.getFailureCount());
      if (result.getFailureCount() == 0) {
        progressBar.setBackground(Color.GREEN);
      } else {
        progressBar.setBackground(Color.RED);
      }
      createTableHistory(project.getTestRuns());

      repaint();
    } else if (ename.equals(TcaEventCommands.SAVEPROJECT)) {
      Project project = model.getProject();
      project.setName(tfProjectName.getText());
    }
  }
View Full Code Here

   *             Should not happen.
   */
  @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
        .getActualTestClasses());

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

  }
View Full Code Here

   *             Should not happen.
   */
  @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);
    assertEquals(6, clazz.getDeclaredMethods().length);

    try {
      loadChangedClass();

      fcl = new FileClassLoader2(CLASSPATH);
      clazz = fcl.reloadClasses(project.getActualTestClasses()).get(0);

      assertEquals(1, project.getActualTestClasses().size());
      assertEquals(7, clazz.getDeclaredMethods().length);
    } finally {
      loadOldClass();
    }
  }
View Full Code Here

   * @throws Exception
   */
  @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());
      Run run1 = project.getTestRuns().get(0);
      assertEquals(1, run1.getClassMethods().size());
      ClassMethods cm1 = run1.getClassMethods().get(0);
      assertEquals(3, cm1.getTestMethods().size());
      loadChangedClass();

      project.runTests();
      assertEquals(2, project.getTestRuns().size());
      Run run2 = project.getTestRuns().get(0);
      assertEquals(1, run2.getClassMethods().size());
      ClassMethods cm2 = run2.getClassMethods().get(0);
      assertEquals(4, cm2.getTestMethods().size());
    } finally {
      loadOldClass();
View Full Code Here

   */
  @Test
  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

   */
  @Test
  public void databaseOpened() throws Exception {
    logger.info("singleton");
    ph.newProject("Bernds Projekt17");
    Project project = ph.getProject();
    ph.saveProject();

    project.setName("Bernds Projektname wird geaendert");
    ph.saveProject();

    project.setClasspath(CLASSPATH);
    ph.saveProject();

    assertEquals(1, ph.loadProjectNames().length);

    ph.closeDatabase();
    ph.loadFile(new File(PATH_DB + i + ".yap"));

    ph.loadProject("Bernds Projektname wird geaendert");
    assertEquals(project.getName(), ph.getProject().getName());
    assertEquals(project.getClasspath(), ph.getProject().getClasspath());
  }
View Full Code Here

   */
  @Test
  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

   */
  @Test
  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

TOP

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

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.