예제 #1
0
  @Test
  public void testCopyProject()
      throws IOException, NoProjectLoadedException, ProjectFileParsingException, Exception {
    System.out.println("---  testCopyAndRunProject");

    String projNameNew = "TestingGranCell";
    File projDirNew = new File(MainTest.getTempProjectDirectory(), projNameNew);

    if (projDirNew.exists()) {
      GeneralUtils.removeAllFiles(projDirNew, false, true, true);
    }

    System.out.println("Ex " + projDirNew.getCanonicalFile() + ": " + projDirNew.exists());
    projDirNew.mkdir();

    File projFile = new File(projDirNew, projNameNew + ".ncx");

    File oldProjDir = new File(ProjectStructure.getnCModelsDir(), "GranuleCell");
    File oldProj = new File(oldProjDir, "GranuleCell.ncx");

    ProjectManager p = new ProjectManager();

    Project proj = p.copyProject(oldProj, projFile);

    System.out.println("Created project at: " + proj.getProjectFile().getCanonicalPath());

    assertEquals(proj.getProjectName(), projNameNew);

    assertTrue(projFile.exists());
  }
예제 #2
0
  /** Test of createNewProject method, of class Project. */
  @Test
  public void testCreateNewProject() throws IOException, NoProjectLoadedException {
    System.out.println("---  testCreateNewProject");

    String projName2 = "TestingFrameworkProject";
    File projDir2 = new File(MainTest.getTempProjectDirectory(), projName2);

    Project proj = Project.createNewProject(projDir2.getAbsolutePath(), projName2, null);

    System.out.println("Created project at: " + proj.getProjectFile().getCanonicalPath());

    proj.saveProject();

    File projFileNew = proj.getProjectFile();

    assertEquals(proj.getProjectName(), projName2);

    assertTrue(projFileNew.exists());
  }