1 19 20 package org.netbeans.modules.apisupport.project.suite; 21 22 import java.io.File ; 23 import org.netbeans.api.project.Project; 24 import org.netbeans.api.project.ProjectManager; 25 import org.netbeans.api.project.ProjectUtils; 26 import org.netbeans.modules.apisupport.project.TestBase; 27 import org.netbeans.modules.apisupport.project.universe.NbPlatform; 28 import org.openide.filesystems.FileObject; 29 import org.openide.filesystems.FileUtil; 30 31 36 public class SuiteProjectGeneratorTest extends TestBase { 37 39 public SuiteProjectGeneratorTest(String testName) { 40 super(testName); 41 } 42 43 private static final String [] SUITE_CREATED_FILES = { 44 "build.xml", 45 "nbproject/project.xml", 46 "nbproject/build-impl.xml", 47 "nbproject/platform.properties", 48 "nbproject/project.properties", 49 }; 50 51 public void testCreateSuiteProject() throws Exception { 52 File targetPrjDir = new File (getWorkDir(), "testSuite"); 53 SuiteProjectGenerator.createSuiteProject(targetPrjDir, NbPlatform.PLATFORM_ID_DEFAULT); 54 FileObject fo = FileUtil.toFileObject(targetPrjDir); 55 Project p = ProjectManager.getDefault().findProject(fo); 57 assertNotNull("have a project in " + targetPrjDir, p); 58 SuiteProjectTest.openSuite(p); 59 for (int i=0; i < SUITE_CREATED_FILES.length; i++) { 61 assertNotNull(SUITE_CREATED_FILES[i]+" file/folder cannot be found", 62 fo.getFileObject(SUITE_CREATED_FILES[i])); 63 } 64 } 65 66 public void testSuiteProjectWithDotInName() throws Exception { 67 File targetPrjDir = new File (getWorkDir(), "testSuite 1.0"); 68 SuiteProjectGenerator.createSuiteProject(targetPrjDir, NbPlatform.PLATFORM_ID_DEFAULT); 69 FileObject fo = FileUtil.toFileObject(targetPrjDir); 70 Project p = ProjectManager.getDefault().findProject(fo); 72 assertEquals("#66080: right display name", "testSuite 1.0", ProjectUtils.getInformation(p).getDisplayName()); 73 } 74 75 } 76 | Popular Tags |