Java Code Examples for org.netbeans.api.project.ProjectManager#getDefault()

The following examples show how to use org.netbeans.api.project.ProjectManager#getDefault() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: UnitTestForSourceQueryImplTest.java    From netbeans with Apache License 2.0 6 votes vote down vote up
@Override
protected void setUp() throws Exception {
    super.setUp();
    MockLookup.setLayersAndInstances(
        new org.netbeans.modules.java.project.UnitTestForSourceQueryImpl(),
        new org.netbeans.modules.projectapi.SimpleFileOwnerQueryImplementation()
    );
    scratch = TestUtil.makeScratchDir(this);
    projdir = scratch.createFolder("proj");
    J2SEProjectGenerator.setDefaultSourceLevel(new SpecificationVersion ("1.6"));   //NOI18N
    helper = J2SEProjectGenerator.createProject(FileUtil.toFile(projdir),"proj",null,null,null, false);
    J2SEProjectGenerator.setDefaultSourceLevel(null);
    sources = projdir.getFileObject("src");
    tests = projdir.getFileObject("test");
    pm = ProjectManager.getDefault();
    pp = pm.findProject(projdir);        
}
 
Example 2
Source File: HgProjectUtils.java    From netbeans with Apache License 2.0 6 votes vote down vote up
public static String getProjectName( final File root ) {
    if(root == null || !root.isDirectory()) return null;
    final ProjectManager projectManager = ProjectManager.getDefault();
    FileObject rootFileObj = FileUtil.toFileObject(FileUtil.normalizeFile(root));
    // This can happen if the root is "ssh://<something>"
    if (rootFileObj == null || projectManager == null) {
        return null;
    }
 
    String res = null;
    if (projectManager.isProject(rootFileObj)){
        try {
            Project prj = projectManager.findProject(rootFileObj);

            res = getProjectName(prj);
        } catch (Exception ex) {
            Mercurial.LOG.log(Level.FINE, "getProjectName() file: {0} {1}", new Object[] {rootFileObj.getPath(), ex.toString()}); // NOI18N
        }finally{
            return res;
        } 
    }else{
        return res;
    }
}
 
Example 3
Source File: AntBasedProjectRegistrationTest.java    From netbeans with Apache License 2.0 6 votes vote down vote up
protected @Override void setUp() throws Exception {
    super.setUp();
    MockLookup.init();
    assertEquals("No factory has been used yet", 0, AnnotatedProject.factoryCalls);
    Collection<? extends AntBasedProjectType> all = Lookups.forPath("Services/AntBasedProjectTypes").lookupAll(AntBasedProjectType.class);
    assertEquals("Two found", 2, all.size());
    Iterator<? extends AntBasedProjectType> it = all.iterator();
    if ("testFactory".equals(getName())) {
        it.next();
    }
    AntBasedProjectType t = it.next();
    MockLookup.setInstances(t);
    scratch = TestUtil.makeScratchDir(this);
    projdir = scratch.createFolder("proj");
    ProjectGenerator.createProject(projdir, t.getType());
    pm = ProjectManager.getDefault();
}
 
Example 4
Source File: AntProjectHelperTest.java    From netbeans with Apache License 2.0 6 votes vote down vote up
protected @Override void setUp() throws Exception {
    FileObject fo = FileUtil.getConfigFile("Services");
    if (fo != null) {
        fo.delete();
    }
    scratch = TestUtil.makeScratchDir(this);
    projdir = scratch.createFolder("proj");
    TestUtil.createFileFromContent(AntProjectHelperTest.class.getResource("data/project.xml"), projdir, "nbproject/project.xml");
    TestUtil.createFileFromContent(AntProjectHelperTest.class.getResource("data/private.xml"), projdir, "nbproject/private/private.xml");
    TestUtil.createFileFromContent(AntProjectHelperTest.class.getResource("data/project.properties"), projdir, "nbproject/project.properties");
    TestUtil.createFileFromContent(AntProjectHelperTest.class.getResource("data/private.properties"), projdir, "nbproject/private/private.properties");
    TestUtil.createFileFromContent(AntProjectHelperTest.class.getResource("data/global.properties"), scratch, "userdir/build.properties");
    ProjectProperties.antJar = new File(getWorkDir(), "ant/lib/ant.jar");
    MockLookup.setInstances(AntBasedTestUtil.testAntBasedProjectType());
    pm = ProjectManager.getDefault();
    p = pm.findProject(projdir);
    h = p.getLookup().lookup(AntProjectHelper.class);
    l = new AntBasedTestUtil.TestListener();
}
 
Example 5
Source File: GeneratedFilesHelperTest.java    From netbeans with Apache License 2.0 6 votes vote down vote up
@Override
protected void setUp() throws Exception {
    FileObject fo = FileUtil.getConfigFile("Services");
    if (fo != null) {
        fo.delete();
    }
    scratch = TestUtil.makeScratchDir(this);
    projdir = scratch.createFolder("proj");
    TestUtil.createFileFromContent(GeneratedFilesHelperTest.class.getResource("data/project.xml"), projdir, "nbproject/project.xml");
    TestUtil.createFileFromContent(GeneratedFilesHelperTest.class.getResource("data/extension1.xml"), projdir, "nbproject/extension1.xml");
    extenderImpl = new ExtImpl();
    MockLookup.setInstances(AntBasedTestUtil.testAntBasedProjectType(extenderImpl));
    pm = ProjectManager.getDefault();
    p = pm.findProject(projdir);
    extenderImpl.project = p;
    h = p.getLookup().lookup(AntProjectHelper.class);
    gfh = p.getLookup().lookup(GeneratedFilesHelper.class);
    assertNotNull(gfh);
}
 
Example 6
Source File: AntBuildExtenderTest.java    From netbeans with Apache License 2.0 6 votes vote down vote up
@Override
protected void setUp() throws Exception {
    FileObject fo = FileUtil.getConfigFile("Services");
    if (fo != null) {
        fo.delete();
    }
    scratch = TestUtil.makeScratchDir(this);
    projdir = scratch.createFolder("proj");
    TestUtil.createFileFromContent(GeneratedFilesHelperTest.class.getResource("data/project.xml"), projdir, "nbproject/project.xml");
    extension1 = TestUtil.createFileFromContent(GeneratedFilesHelperTest.class.getResource("data/extension1.xml"), projdir, "nbproject/extension1.xml");
    extenderImpl = new ExtImpl();
    MockLookup.setInstances(AntBasedTestUtil.testAntBasedProjectType(extenderImpl));
    pm = ProjectManager.getDefault();
    p = pm.findProject(projdir);
    extenderImpl.project = p;
    gfh = p.getLookup().lookup(GeneratedFilesHelper.class);
    assertNotNull(gfh);
}
 
Example 7
Source File: OpenProjectsTrampolineImplTest.java    From netbeans with Apache License 2.0 6 votes vote down vote up
protected void setUp() throws Exception {
        super.setUp();
        scratch = TestUtil.makeScratchDir(this);
        goodproject = scratch.createFolder("good");
        goodproject.createFolder("testproject");
        goodproject2 = scratch.createFolder("good2");
        goodproject2.createFolder("testproject");
//        badproject = scratch.createFolder("bad");
//        badproject.createFolder("testproject").createData("broken");
//        mysteryproject = scratch.createFolder("mystery");
        MockLookup.setLookup(Lookups.fixed(
            new NbProjectManager(),
            new NbProjectInformationProvider(),
            new NbMutexEventProvider(),
            TestUtil.testProjectFactory()));
        pm = ProjectManager.getDefault();
        OpenProjectList.waitProjectsFullyOpen();
    }
 
Example 8
Source File: SourceLevelQueryImplTest.java    From netbeans with Apache License 2.0 6 votes vote down vote up
private void prepareProject (String platformName) throws IOException {
    scratch = makeScratchDir(this);
    projdir = scratch.createFolder("proj");
    AntProjectHelper helper = ProjectGenerator.createProject(projdir, "org.netbeans.modules.web.project");
    pm = ProjectManager.getDefault();
    pp = pm.findProject(projdir);
    EditableProperties props = helper.getProperties(AntProjectHelper.PROJECT_PROPERTIES_PATH);
    props.setProperty("javac.source", "${def}");
    props.setProperty ("platform.active",platformName);
    props.setProperty("def", "1.2");
    helper.putProperties(AntProjectHelper.PROJECT_PROPERTIES_PATH, props);
    props = PropertyUtils.getGlobalProperties();
    props.put("default.javac.source","4.3");
    PropertyUtils.putGlobalProperties(props);
    sources = projdir.createFolder("src");
}
 
Example 9
Source File: AntArtifactQueryTest.java    From netbeans with Apache License 2.0 6 votes vote down vote up
protected @Override void setUp() throws Exception {
    FileObject fo = FileUtil.getConfigFile("Services");
    if (fo != null) {
        fo.delete();
    }

    MockLookup.setInstances(AntBasedTestUtil.testAntBasedProjectType(), TestUtil.testProjectFactory());
    scratch = TestUtil.makeScratchDir(this);
    projdir = scratch.createFolder("proj");
    ProjectGenerator.createProject(projdir, "test");
    pm = ProjectManager.getDefault();
    sisterprojdir = FileUtil.createFolder(scratch, "proj2");
    AntProjectHelper sisterh = ProjectGenerator.createProject(sisterprojdir, "test");
    EditableProperties props = sisterh.getProperties(AntProjectHelper.PROJECT_PROPERTIES_PATH);
    props.setProperty("build.jar", "dist/proj2.jar");
    props.setProperty("build.javadoc", "build/javadoc");
    sisterh.putProperties(AntProjectHelper.PROJECT_PROPERTIES_PATH, props);
    dummyprojdir = scratch.createFolder("dummy");
    dummyprojdir.createFolder("testproject");
}
 
Example 10
Source File: J2SESourcesTest.java    From netbeans with Apache License 2.0 6 votes vote down vote up
protected @Override void setUp() throws Exception {
        super.setUp();
        MockLookup.setLayersAndInstances(
            new org.netbeans.modules.projectapi.SimpleFileOwnerQueryImplementation()
        );
        scratch = TestUtil.makeScratchDir(this);
        projdir = scratch.createFolder("proj");
        J2SEProjectGenerator.setDefaultSourceLevel(new SpecificationVersion ("1.6"));   //NOI18N
        helper = J2SEProjectGenerator.createProject(FileUtil.toFile(projdir),"proj",null,null,null, false); //NOI18N
        J2SEProjectGenerator.setDefaultSourceLevel(null);
        sources = getFileObject(projdir, "src");
        build = getFileObject (scratch, "build");
        classes = getFileObject(build,"classes");
        File f = FileUtil.normalizeFile (FileUtil.toFile(build));
        String path = f.getAbsolutePath ();
//#47657: SourcesHelper.remarkExternalRoots () does not work on deleted folders
// To reproduce it uncomment following line
//        build.delete();
        EditableProperties props = helper.getProperties(AntProjectHelper.PROJECT_PROPERTIES_PATH);
        props.setProperty(ProjectProperties.BUILD_DIR, path);
        helper.putProperties(AntProjectHelper.PROJECT_PROPERTIES_PATH, props);
        pm = ProjectManager.getDefault();
        project = pm.findProject(projdir);
        assertTrue("Invalid project type", project instanceof J2SEProject);
    }
 
Example 11
Source File: SourceRootsTest.java    From netbeans with Apache License 2.0 6 votes vote down vote up
@Override
protected void setUp() throws Exception {
    super.setUp();
    MockLookup.setLayersAndInstances(
        new org.netbeans.modules.projectapi.SimpleFileOwnerQueryImplementation()
    );
    scratch = TestUtil.makeScratchDir(this);
    projdir = scratch.createFolder("proj");
    J2SEProjectGenerator.setDefaultSourceLevel(new SpecificationVersion ("1.6"));   //NOI18N
    helper = J2SEProjectGenerator.createProject(FileUtil.toFile(projdir),"proj",null,null,null, false); //NOI18N
    J2SEProjectGenerator.setDefaultSourceLevel(null);   //NOI18N
    sources = projdir.getFileObject("src");
    tests = projdir.getFileObject("test");
    pm = ProjectManager.getDefault();
    Project p = pm.findProject(projdir);
    assertTrue("Invalid project type",p instanceof J2SEProject);
    pp = (J2SEProject) p;
}
 
Example 12
Source File: J2SESharabilityQueryTest.java    From netbeans with Apache License 2.0 6 votes vote down vote up
protected void setUp() throws Exception {
    super.setUp();
    MockLookup.setLayersAndInstances(
        new org.netbeans.modules.projectapi.SimpleFileOwnerQueryImplementation()
    );
    scratch = TestUtil.makeScratchDir(this);
    projdir = scratch.createFolder("proj");
    J2SEProjectGenerator.setDefaultSourceLevel(new SpecificationVersion ("1.6"));   //NOI18N
    helper = J2SEProjectGenerator.createProject(FileUtil.toFile(projdir),"proj",null,null,null, false); //NOI18N
    J2SEProjectGenerator.setDefaultSourceLevel(null);
    sources = projdir.getFileObject("src");
    tests = projdir.getFileObject("test");
    dist = FileUtil.createFolder(projdir,"dist");
    build = FileUtil.createFolder(projdir,"build");
    pm = ProjectManager.getDefault();
    Project p = pm.findProject(projdir);
    assertTrue("Invalid project type",p instanceof J2SEProject);
    pp = (J2SEProject) p;
}
 
Example 13
Source File: BinaryForSourceQueryImplTest.java    From netbeans with Apache License 2.0 6 votes vote down vote up
private void prepareProject () throws IOException {
    scratch = TestUtil.makeScratchDir(this);
    projdir = scratch.createFolder("proj");        
    MockLookup.setLayersAndInstances();
    J2SEProjectGenerator.setDefaultSourceLevel(new SpecificationVersion ("1.6"));   //NOI18N
    helper = J2SEProjectGenerator.createProject(FileUtil.toFile(projdir),"proj",null,null,null, false);
    J2SEProjectGenerator.setDefaultSourceLevel(null);   //NOI18N
    pm = ProjectManager.getDefault();
    pp = Optional.ofNullable(pm.findProject(projdir))
            .map((p) -> p.getLookup().lookup(J2SEProject.class))
            .orElseThrow(()-> new AssertionError("No J2SEProject in " + FileUtil.getFileDisplayName(projdir)));
    sources = projdir.getFileObject("src");
    tests = FileUtil.createFolder(projdir, "test");
    FileObject fo = projdir.createFolder("build");
    buildClasses = fo.createFolder("classes");
    buildTestClasses = FileUtil.createFolder(fo, "test/classes");
    distJarURL = FileUtil.urlForArchiveOrDir(FileUtil.normalizeFile(
            helper.resolveFile(pp.evaluator().getProperty(ProjectProperties.DIST_JAR))));
}
 
Example 14
Source File: BootClassPathImplementationTest.java    From netbeans with Apache License 2.0 5 votes vote down vote up
private void prepareProject (String platformName) throws IOException {
    projdir = scratch.createFolder("proj");
    final JavaPlatform[] jps = JavaPlatformManager.getDefault().getPlatforms(platformName, null);
    assertEquals(1, jps.length);
    final JavaPlatform jp = jps[0];
    AntProjectHelper helper = new J2SEProjectBuilder(FileUtil.toFile(projdir), "Test Project")  //NOI18N
            .addDefaultSourceRoots()
            .setJavaPlatform(jp)
            .build();
    pm = ProjectManager.getDefault();
    final Project p = pm.findProject(projdir);
    pp = p.getLookup().lookup(J2SEProject.class);
    sources = FileUtil.createFolder(projdir, "src");    //NOI18N
    tests = FileUtil.createFolder(projdir, "test");     //NOI18N
}
 
Example 15
Source File: SourcePathImplAddonsTest.java    From netbeans with Apache License 2.0 5 votes vote down vote up
@Override
protected void setUp() throws Exception {
    super.setUp();
    // setup some platforms -- needed for testing findClassPath(FileObject, ClassPath.BOOT)
    scratchFO = TestUtil.makeScratchDir(this);
    FileObject defaultPlatformBootRoot = scratchFO.createFolder(DEFAULT_PLATFORM_ROOT);
    ClassPath defBCP = ClassPathSupport.createClassPath(new URL[] { defaultPlatformBootRoot.getURL() });

    MockLookup.setLayersAndInstances(new TestPlatformProvider(defBCP, defBCP));
    
    assertTrue("No Java platforms found.", JavaPlatformManager.getDefault().getInstalledPlatforms().length >= 2);
    
    // setup the project
    File f = new File(getDataDir().getAbsolutePath(), "projects/" + EJB_PROJ1);
    
    projdirFO = scratchFO.getFileObject(EJB_PROJ1);
    
    // Delete if previously not deleted.
    if (projdirFO != null){
        projdirFO.delete();
    }
    projdirFO = scratchFO.createFolder(EJB_PROJ1);
    
    File origCopy = new File(getDataDir().getAbsolutePath(),
            "projects/" + EJB_PROJ1);
    TestUtil.copyDir(origCopy, FileUtil.toFile(projdirFO));
    
    pm = ProjectManager.getDefault();
    proj = pm.findProject(projdirFO).getLookup().lookup(EjbJarProject.class);
    helper = proj.getAntProjectHelper();
}
 
Example 16
Source File: SourcePathImplementationTest.java    From netbeans with Apache License 2.0 5 votes vote down vote up
protected void setUp() throws Exception {
    super.setUp();
    scratch = TestUtil.makeScratchDir(this);
    projdir = scratch.createFolder("proj");
    J2SEProjectGenerator.setDefaultSourceLevel(new SpecificationVersion ("1.6"));   //NOI18N
    MockLookup.setLayersAndInstances();
    helper = J2SEProjectGenerator.createProject(FileUtil.toFile(projdir),"proj",null,null,null, false); //NOI18N
    J2SEProjectGenerator.setDefaultSourceLevel(null);
    pm = ProjectManager.getDefault();
    pp = pm.findProject(projdir).getLookup().lookup(J2SEProject.class);
    sources = projdir.getFileObject("src");
}
 
Example 17
Source File: SourcePathImplAddonsTest.java    From netbeans with Apache License 2.0 5 votes vote down vote up
protected void setUp() throws Exception {
    super.setUp();
    scratchFO = TestUtil.makeScratchDir(this);

    FileObject bootPlatformRoot = scratchFO.createFolder(DEFAULT_PLATFORM_ROOT);
    ClassPath defBCP = ClassPathSupport.createClassPath(new URL[] { bootPlatformRoot.getURL() });

    MockLookup.setLayersAndInstances(new TestPlatformProvider(defBCP, defBCP));
    
    assertTrue("No Java platforms found.", JavaPlatformManager.getDefault().getInstalledPlatforms().length >= 2);
    
    projdirFO = scratchFO.getFileObject("WebApplication1");
    
    // Delete if previously not deleted.
    if (projdirFO != null){
        projdirFO.delete();
    }
    
    projdirFO = scratchFO.createFolder("WebApplication1");
    File origCopy = new File(getDataDir().getAbsolutePath(), 
            "projects/WebApplication1");
    TestUtil.copyDir(origCopy, FileUtil.toFile(projdirFO));
    
    pm = ProjectManager.getDefault();
    proj = pm.findProject(projdirFO).getLookup().lookup(WebProject.class);
    helper = proj.getAntProjectHelper();
}
 
Example 18
Source File: CompiledSourceForBinaryQueryTest.java    From netbeans with Apache License 2.0 5 votes vote down vote up
private void prepareProject () throws IOException {
    scratch = TestUtil.makeScratchDir(this);
    projdir = scratch.createFolder("proj");
    J2SEProjectGenerator.setDefaultSourceLevel(new SpecificationVersion ("1.6"));   //NOI18N
    helper = J2SEProjectGenerator.createProject(FileUtil.toFile(projdir),"proj",null,null,null, false);
    J2SEProjectGenerator.setDefaultSourceLevel(null);   //NOI18N
    pm = ProjectManager.getDefault();
    pp = pm.findProject(projdir);
    sources = projdir.getFileObject("src");
    FileObject fo = projdir.createFolder("build");
    buildClasses = fo.createFolder("classes");        
}
 
Example 19
Source File: J2SEActionProviderTest.java    From netbeans with Apache License 2.0 4 votes vote down vote up
protected @Override void setUp() throws Exception {
        super.setUp();
        MockLookup.setLayersAndInstances(new SimplePlatformProvider());
        scratch = TestUtil.makeScratchDir(this);
        projdir = scratch.createFolder("proj");
        J2SEProjectGenerator.setDefaultSourceLevel(new SpecificationVersion ("1.6"));   //NOI18N
        helper = J2SEProjectGenerator.createProject(FileUtil.toFile(projdir),"proj","foo.Main","manifest.mf",null, false); //NOI18N
        EditableProperties ep = helper.getProperties(AntProjectHelper.PRIVATE_PROPERTIES_PATH);
        ep.put(ProjectProperties.DO_DEPEND, "true"); // to avoid too many changes in tests from issue #118079       
        helper.putProperties(AntProjectHelper.PRIVATE_PROPERTIES_PATH, ep);
        J2SEProjectGenerator.setDefaultSourceLevel(null);
        pm = ProjectManager.getDefault();
        pp = pm.findProject(projdir).getLookup().lookup(J2SEProject.class);
        actionProvider = new J2SEActionProvider(pp, pp.getUpdateHelper());
        actionProvider.startFSListener();
        sources = projdir.getFileObject("src");
        tests = projdir.getFileObject("test");
//        projdir.createData("build.xml");
        build = projdir.createFolder("build");
        build.createFolder("classes");
        FileObject pkg = sources.getFileObject("foo");        
        FileObject fo = pkg.createData("Bar.java");
        sourcePkg1 = DataFolder.findFolder (pkg);
        pkg = sources.createFolder("foo2");
        sourcePkg2 = DataFolder.findFolder (pkg);
        someSource1 = DataObject.find(fo);
        fo = sources.getFileObject("foo").getFileObject("Main.java");
        createMain(fo);
        someSource2 = DataObject.find(fo);
        fo = sources.getFileObject("foo").createData("Third.java");
        someSource3 = DataObject.find(fo);
        pkg = tests.createFolder("foo");
        fo = pkg.createData("BarTest.java");
        testPkg1 = DataFolder.findFolder (pkg);
        pkg = tests.createFolder("foo2");
        testPkg2 = DataFolder.findFolder (pkg);
        someTest1 = DataObject.find(fo);
        fo = tests.getFileObject("foo").createData("MainTest.java");
        someTest2 = DataObject.find(fo);
        assertNotNull(someSource1);
        assertNotNull(someSource2);
        assertNotNull(someTest1);
        assertNotNull(someTest2);
    }
 
Example 20
Source File: ReferenceHelperTest.java    From netbeans with Apache License 2.0 4 votes vote down vote up
protected void setUp() throws Exception {
    super.setUp();
    ClassLoader l = ReferenceHelper.class.getClassLoader();
    MockLookup.setLookup(
        Lookups.fixed(AntBasedTestUtil.testAntBasedProjectType(), AntBasedTestUtil.testCollocationQueryImplementation(Utilities.toURI(getWorkDir()))),
        Lookups.singleton(l),
        Lookups.exclude(Lookups.metaInfServices(l), CollocationQueryImplementation.class));
    scratch = TestUtil.makeScratchDir(this);
    projdir = scratch.createFolder("proj");
    TestUtil.createFileFromContent(ReferenceHelperTest.class.getResource("data/project.xml"), projdir, "nbproject/project.xml");
    pm = ProjectManager.getDefault();
    p = pm.findProject(projdir);
    assertNotNull("found project in " + projdir, p);
    h = p.getLookup().lookup(AntProjectHelper.class);
    assertNotNull("found helper for " + p, h);
    r = p.getLookup().lookup(ReferenceHelper.class);
    assertNotNull("found ref helper for " + p, r);
    sisterprojdir = FileUtil.createFolder(scratch, "proj2");
    assertTrue("projdir and sisterprojdir collocated",
        CollocationQuery.areCollocated(projdir.toURI(), sisterprojdir.toURI()));
    sisterh = ProjectGenerator.createProject(sisterprojdir, "test");
    setCodeNameOfTestProject(sisterh, "proj2");
    EditableProperties props = sisterh.getProperties(AntProjectHelper.PROJECT_PROPERTIES_PATH);
    props.setProperty("build.jar", "dist/proj2.jar");
    props.setProperty("build.javadoc", "build/javadoc");
    props.setProperty("build.javadoc.complete", "build/complete-javadoc");
    sisterh.putProperties(AntProjectHelper.PROJECT_PROPERTIES_PATH, props);
    // Probably unnecessary: pm.saveProject(pm.findProject(sisterprojdir));
    
    sisterprojdir2 = FileUtil.createFolder(scratch, "proj2-copy");
    assertTrue("projdir and sisterprojdir2 collocated",
        CollocationQuery.areCollocated(projdir.toURI(), sisterprojdir2.toURI()));
    sisterh2 = ProjectGenerator.createProject(sisterprojdir2, "test");
    setCodeNameOfTestProject(sisterh2, "proj2");
    props = sisterh2.getProperties(AntProjectHelper.PROJECT_PROPERTIES_PATH);
    props.setProperty("build.jar", "dist/proj2.jar");
    props.setProperty("build.javadoc", "build/javadoc");
    props.setProperty("build.javadoc.complete", "build/complete-javadoc");
    sisterh2.putProperties(AntProjectHelper.PROJECT_PROPERTIES_PATH, props);
    
    sepprojdir = FileUtil.createFolder(scratch, "separate/proj3");
    // If following assert fails then there is a global impl of collocation
    // query which says that these two files are collocated. Hidden it
    // similarly as it is done for SampleCVSCollocationQueryImpl
    // in META-INF/services.
    assertFalse("" + projdir + " and " + sepprojdir + " cannot be collocated",
        CollocationQuery.areCollocated(projdir.toURI(), sepprojdir.toURI()));
    seph = ProjectGenerator.createProject(sepprojdir, "test");
    setCodeNameOfTestProject(seph, "proj3");
    props = seph.getProperties(AntProjectHelper.PROJECT_PROPERTIES_PATH);
    props.setProperty("build.jar", "d i s t/p r o j 3.jar");
    seph.putProperties(AntProjectHelper.PROJECT_PROPERTIES_PATH, props);
    //l = new AntBasedTestUtil.TestListener();
    
    pev = h.getStandardPropertyEvaluator();
}