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