1 19 20 package org.netbeans.modules.projectimport.eclipse; 21 22 import java.io.File ; 23 import java.util.Collection ; 24 25 31 public class ComplexProjectAnalysisTest extends ProjectImporterTestCase { 32 33 36 public ComplexProjectAnalysisTest(String name) { 37 super(name); 38 } 39 40 public void testComplexAloneProjectForLatestMilestone() throws Exception { 41 File projectDir = extractToWorkDir("complexAlone-3.1M6.zip"); 42 EclipseProject project = ProjectFactory.getInstance().load(projectDir); 43 assertNotNull(project); 44 doProjectTest(project); 45 } 46 47 private void doProjectTest(EclipseProject project) { 48 49 String name = project.getName(); 50 assertTrue("Name cannot be null or empty", (name != null && !name.equals(""))); 51 52 File directory = project.getDirectory(); 53 assertNotNull(directory); 54 55 String jdkDir = project.getJDKDirectory(); 56 58 Collection srcRoots = project.getSourceRoots(); 59 assertFalse("Tere should be at least on source root", 60 srcRoots.isEmpty()); 61 62 Collection extSrcRoots = project.getExternalSourceRoots(); 63 assertTrue("There shouldn't be any external source roots for the project", 64 extSrcRoots.isEmpty()); 65 66 Collection libs = project.getLibraries(); 67 assertFalse("There are some libraries for the project.", libs.isEmpty()); 68 69 Collection extLibs = project.getExternalLibraries(); 70 assertFalse("There are some external libraries for the project", 71 extLibs.isEmpty()); 72 73 Collection variables = project.getVariables(); 74 assertTrue("There are no variables for the project.", variables.isEmpty()); 75 76 Collection projects = project.getProjectsEntries(); 77 assertTrue("There are no required projects for the project.", projects.isEmpty()); 78 79 80 printMessage("\n\n\nGathered info:"); 81 printMessage(" name: " + name); 82 printMessage(" dir: " + directory); 83 printMessage(" jdkDir: " + jdkDir); 84 printCollection("sourceRoots", srcRoots); 85 printCollection("externalSourceRoots", extSrcRoots); 86 printCollection("libraries", libs); 87 printCollection("external libraries", extLibs); 88 printCollection("projects", projects); 89 printCollection("variables", variables); 90 } 91 } 92 | Popular Tags |