Ejemplo n.º 1
0
 public void test_DartModelImpl_getDartProject_string() {
   DartModelImpl model = new DartModelImpl();
   String projectName = "testProject";
   DartProject project = model.getDartProject(projectName);
   assertNotNull(project);
   assertEquals(projectName, project.getProject().getName());
 }
Ejemplo n.º 2
0
 public void test_DartModelImpl_getDartProject_project() {
   DartModelImpl model = new DartModelImpl();
   IProject project = new MockProject();
   DartProject dartProject = model.getDartProject(project);
   assertNotNull(dartProject);
   assertEquals(project, dartProject.getProject());
 }
Ejemplo n.º 3
0
 public void test_DartModelManager_create_file_exist() throws Exception {
   DartProject moneyProject = MoneyProjectUtilities.getMoneyProject();
   IFile file = moneyProject.getProject().getFile("money.dart");
   DartElementImpl element = DartModelManager.getInstance().create(file);
   assertNotNull(element);
   assertTrue(element instanceof CompilationUnitImpl);
   assertTrue(element.exists());
 }
Ejemplo n.º 4
0
 public static void deleteProject(final DartProject project) {
   try {
     project
         .getProject()
         .getWorkspace()
         .run(
             new IWorkspaceRunnable() {
               @Override
               public void run(IProgressMonitor monitor) throws CoreException {
                 deleteProject(project.getProject());
               }
             },
             null);
   } catch (CoreException exception) {
     // DartCore.getLogger().logError(exception, "Could not delete the project " +
     // project.getElementName()); //$NON-NLS-1$
   }
 }
Ejemplo n.º 5
0
 public void test_DartModelManager_create_file_nonExist() throws Exception {
   DartProject moneyProject = MoneyProjectUtilities.getMoneyProject();
   IFile file = moneyProject.getProject().getFile("doesNotExist.dart");
   DartElementImpl element = DartModelManager.getInstance().create(file);
   assertNull(element);
 }