コード例 #1
0
 /** Creates a new empty project in a temp directory */
 public void test2Reload() {
   logger.info("test2Reload");
   try {
     if (_project != null) {
       _project.close();
     }
     assertNotNull(
         _editor =
             FlexoResourceManager.initializeExistingProject(
                 _projectDirectory, EDITOR_FACTORY, null));
     _project = _editor.getProject();
   } catch (ProjectInitializerException e) {
     e.printStackTrace();
     fail();
   } catch (ProjectLoadingCancelledException e) {
     e.printStackTrace();
     fail();
   }
   logger.info("_project.getGeneratedCode()=" + _project.getGeneratedCode());
   _project.close();
   FileUtils.deleteDir(_projectDirectory);
   _editor = null;
   _project = null;
   _projectDirectory = null;
   _projectIdentifier = null;
 }
コード例 #2
0
 /** Creates a new empty project in a temp directory */
 public void test0CreateProject() {
   logger.info("test0CreateProject");
   ToolBox.setPlatform();
   FlexoLoggingManager.forceInitialize(-1, true, null, Level.INFO, null);
   try {
     File tempFile = File.createTempFile(TEST_CG, "");
     _projectDirectory = new File(tempFile.getParentFile(), tempFile.getName() + ".prj");
     tempFile.delete();
   } catch (IOException e) {
     fail();
   }
   logger.info("Project directory: " + _projectDirectory.getAbsolutePath());
   _projectIdentifier =
       _projectDirectory.getName().substring(0, _projectDirectory.getName().length() - 4);
   logger.info("Project identifier: " + _projectIdentifier);
   _editor = FlexoResourceManager.initializeNewProject(_projectDirectory, EDITOR_FACTORY, null);
   _project = _editor.getProject();
   logger.info("Project has been SUCCESSFULLY created");
 }