1 19 20 package org.netbeans.modules.j2ee.clientproject.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.junit.NbTestCase; 27 import org.netbeans.modules.j2ee.clientproject.AppClientProject; 28 import org.netbeans.modules.j2ee.clientproject.ui.customizer.AppClientProjectProperties; 29 import org.netbeans.spi.java.queries.SourceForBinaryQueryImplementation; 30 import org.netbeans.spi.project.support.ant.AntProjectHelper; 31 import org.openide.filesystems.FileUtil; 32 33 36 public class CompiledSourceForBinaryQueryTest extends NbTestCase { 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/ApplicationClient1"); 47 project = ProjectManager.getDefault().findProject(FileUtil.toFileObject(f)); 48 helper = ((AppClientProject) project).getAntProjectHelper(); 50 } 51 52 public void testSourceRootsFoundForNonExistingBinaryRootIssue65733() throws Exception { 53 File buildClassesDir = helper.resolveFile(helper.getStandardPropertyEvaluator().getProperty(AppClientProjectProperties.BUILD_CLASSES_DIR)); 54 assertFalse("Cannot test, the project should be cleaned first!", buildClassesDir .exists()); 56 URL buildClassesDirURL = new URL (buildClassesDir.toURI().toURL().toExternalForm() + "/"); 57 SourceForBinaryQueryImplementation s4bqi = 58 (SourceForBinaryQueryImplementation) project.getLookup().lookup(SourceForBinaryQueryImplementation.class); 59 assertNotNull(s4bqi.findSourceRoots(buildClassesDirURL)); 60 } 61 62 } 63 | Popular Tags |