1 19 20 package org.netbeans.modules.apisupport.project.ui; 21 22 import org.netbeans.api.java.project.JavaProjectConstants; 23 import org.netbeans.api.project.Project; 24 import org.netbeans.api.project.ProjectManager; 25 import org.netbeans.modules.apisupport.project.TestBase; 26 import org.netbeans.spi.project.ActionProvider; 27 import org.openide.filesystems.FileObject; 28 import org.openide.filesystems.FileUtil; 29 import org.openide.loaders.DataObject; 30 import org.openide.util.lookup.Lookups; 31 32 34 38 public class ModuleActionsTest extends TestBase { 39 40 public ModuleActionsTest(String name) { 41 super(name); 42 } 43 44 public void testDebugFix() throws Exception { 45 Project freeform = ProjectManager.getDefault().findProject(FileUtil.toFileObject(file("ant/freeform"))); 47 assertNotNull("have project in ant/freeform", freeform); 48 ActionProvider ap = (ActionProvider) freeform.getLookup().lookup(ActionProvider.class); 49 assertNotNull("have ActionProvider", ap); 50 FileObject actionsJava = FileUtil.toFileObject(file("ant/freeform/src/org/netbeans/modules/ant/freeform/Actions.java")); 51 assertNotNull("have Actions.java", actionsJava); 52 assertTrue("Fix enabled on it", ap.isActionEnabled(JavaProjectConstants.COMMAND_DEBUG_FIX, Lookups.singleton(DataObject.find(actionsJava)))); 53 } 54 55 } 56 | Popular Tags |