1 19 20 package org.netbeans.modules.j2ee.ejbjarproject.queries; 21 22 import java.io.File ; 23 import java.net.URL ; 24 import org.netbeans.api.project.Project; 25 import org.netbeans.api.project.ProjectManager; 26 import org.netbeans.modules.j2ee.ejbjarproject.EjbJarProject; 27 import org.netbeans.modules.j2ee.ejbjarproject.test.TestBase; 28 import org.netbeans.modules.j2ee.ejbjarproject.ui.customizer.EjbJarProjectProperties; 29 import org.netbeans.spi.java.queries.SourceForBinaryQueryImplementation; 30 import org.netbeans.spi.project.support.ant.AntProjectHelper; 31 import org.openide.filesystems.FileUtil; 32 36 public class CompiledSourceForBinaryQueryTest extends TestBase { 37 38 private Project project; 39 private AntProjectHelper helper; 40 41 public CompiledSourceForBinaryQueryTest(String testName) { 42 super(testName); 43 } 44 45 public void setUp() throws Exception { 46 File f = new File (getDataDir().getAbsolutePath(), "projects/EJBModule1"); 47 project = ProjectManager.getDefault().findProject(FileUtil.toFileObject(f)); 48 helper = ((EjbJarProject)project).getAntProjectHelper(); 50 } 51 52 public void testSourceRootsFoundForNonExistingBinaryRootIssue65733() throws Exception { 53 File buildClassesDir = helper.resolveFile(helper.getStandardPropertyEvaluator().getProperty(EjbJarProjectProperties.BUILD_CLASSES_DIR)); 54 assertFalse("Cannot test, the project should be cleaned first!", buildClassesDir .exists()); 56 URL buildClassesDirURL = new URL (buildClassesDir.toURL().toExternalForm() + "/"); 57 SourceForBinaryQueryImplementation s4bqi = (SourceForBinaryQueryImplementation)project.getLookup().lookup(SourceForBinaryQueryImplementation.class); 58 assertNotNull(s4bqi.findSourceRoots(buildClassesDirURL)); 59 } 60 } 61 | Popular Tags |