1 19 20 package org.netbeans.modules.apisupport.project; 21 22 import org.netbeans.modules.apisupport.project.spi.NbModuleProvider; 23 import org.netbeans.api.project.Project; 24 import org.netbeans.api.project.ProjectManager; 25 import org.openide.filesystems.FileObject; 26 27 32 public class NbModuleProviderTest extends TestBase { 33 34 public NbModuleProviderTest(String name) { 35 super(name); 36 } 37 38 public void testNbModuleProvider() throws Exception { 39 FileObject dir = nbCVSRoot().getFileObject("java/project"); 40 assertNotNull("have java/project checked out", dir); 41 Project p = ProjectManager.getDefault().findProject(dir); 42 NbModuleProvider nmtp = (NbModuleProvider) p.getLookup().lookup(NbModuleProvider.class); 43 assertNotNull("has NbModuleProvider", nmtp); 44 assertSame("is netbeans.org modules", NbModuleProvider.NETBEANS_ORG, nmtp.getModuleType()); 45 46 FileObject suite1 = resolveEEP("suite1"); 47 FileObject action = suite1.getFileObject("action-project"); 48 p = ProjectManager.getDefault().findProject(action); 49 nmtp = (NbModuleProvider) p.getLookup().lookup(NbModuleProvider.class); 50 assertNotNull("has NbModuleProvider", nmtp); 51 assertSame("is suite-component module", NbModuleProvider.SUITE_COMPONENT, nmtp.getModuleType()); 52 53 FileObject suite3 = resolveEEP("suite3"); 54 FileObject dummy = suite3.getFileObject("dummy-project"); 55 p = ProjectManager.getDefault().findProject(dummy); 56 nmtp = (NbModuleProvider) p.getLookup().lookup(NbModuleProvider.class); 57 assertNotNull("has NbModuleProvider", nmtp); 58 assertSame("is standalone modules", NbModuleProvider.STANDALONE, nmtp.getModuleType()); 59 } 60 61 } 62 | Popular Tags |