Package org.eclipse.core.resources

Examples of org.eclipse.core.resources.IProject.findMember()


        // instantiate the content provider
        JcrContentContentProvider contentProvider = new JcrContentContentProvider();

        // directly create the root node
        SyncDir syncDirNode = new SyncDir((IFolder) contentProject.findMember("jcr_root"));

        // test children of '/'
        Object[] children = contentProvider.getChildren(syncDirNode);
        assertChildrenHavePaths(children, "/content");
View Full Code Here


        // instantiate the content provider
        JcrContentContentProvider contentProvider = new JcrContentContentProvider();

        // directly create the root node
        SyncDir syncDirNode = new SyncDir((IFolder) contentProject.findMember("jcr_root"));

        // test children of '/'
        Object[] children = contentProvider.getChildren(syncDirNode);
        assertChildrenHavePaths(children, "/content");
View Full Code Here

        IResource resource = event.getResource();

        IProject project = resource.getProject();
        IPath syncDir = ProjectUtil.getSyncDirectoryValue(project);

        IResource member = project.findMember(syncDir);
        if (member == null) {
            addValidatorMessage(res, project, "Configured sync dir " + syncDir + " does not exist");
        } else if (member.getType() != IResource.FOLDER) {
            addValidatorMessage(res, project, "Configured sync dir " + syncDir + " is not a directory");
        }
View Full Code Here

        deh.clearUnexpectedEventsAfterSettling();

        runImport(contentProject);

        assertThat(contentProject.findMember("jcr_root/content/test-root/de"), nullValue());
    }

    @Test
    public void importFilesAndFoldersRespectsVltIgnore() throws Exception {
View Full Code Here

        repo.createNode("/content/test-root/en/files", "nt:folder");
        repo.createFile("/content/test-root/en/files/first.txt", "first file".getBytes());

        runImport(contentProject);

        assertThat(contentProject.findMember("jcr_root/content/test-root/en"), nullValue());
    }

    @Test
    public void importFilesAndFoldersRespectsVltIgnoreNotUnderImportRoot() throws Exception {
View Full Code Here

        repo.createNode("/content/test-root/en/files", "nt:folder");
        repo.createFile("/content/test-root/en/files/first.txt", "first file".getBytes());

        runImport(contentProject);

        assertThat(contentProject.findMember("jcr_root/content/test-root/en"), nullValue());
    }

    private void runImport(IProject contentProject) throws SerializationException, InvocationTargetException,
            InterruptedException, CoreException {
View Full Code Here

        // create .content.xml structure
        InputStream contentXml = getClass().getResourceAsStream("content-nested-structure.xml");
        project.createOrUpdateFile(Path.fromPortableString("jcr_root/content/test-root/en.xml"), contentXml);

        // directly create the root node
        syncDirNode = new SyncDir((IFolder) contentProject.findMember("jcr_root"));

    }

    @Test
    public void createNtFolderNode() throws Exception {
View Full Code Here

       
        project.createOrUpdateFile(Path.fromPortableString("jcr_root/test/hello.txt"), new ByteArrayInputStream(
                "goodbye, world".getBytes()));
       
        assertThat("Content sync dir can be exported",
                new ContentResourceTester().test(contentProject.findMember("jcr_root"), "canBeExported", null, null), equalTo(true));
        assertThat("Dir under sync dir can be exported",
                new ContentResourceTester().test(contentProject.findMember("jcr_root/test"), "canBeExported", null, null), equalTo(true));
        assertThat("File under sync dir can be exported",
                new ContentResourceTester().test(contentProject.findMember("jcr_root/test/hello.txt"), "canBeExported", null, null), equalTo(true));       
    }
View Full Code Here

                "goodbye, world".getBytes()));
       
        assertThat("Content sync dir can be exported",
                new ContentResourceTester().test(contentProject.findMember("jcr_root"), "canBeExported", null, null), equalTo(true));
        assertThat("Dir under sync dir can be exported",
                new ContentResourceTester().test(contentProject.findMember("jcr_root/test"), "canBeExported", null, null), equalTo(true));
        assertThat("File under sync dir can be exported",
                new ContentResourceTester().test(contentProject.findMember("jcr_root/test/hello.txt"), "canBeExported", null, null), equalTo(true));       
    }

    @Test
View Full Code Here

        assertThat("Content sync dir can be exported",
                new ContentResourceTester().test(contentProject.findMember("jcr_root"), "canBeExported", null, null), equalTo(true));
        assertThat("Dir under sync dir can be exported",
                new ContentResourceTester().test(contentProject.findMember("jcr_root/test"), "canBeExported", null, null), equalTo(true));
        assertThat("File under sync dir can be exported",
                new ContentResourceTester().test(contentProject.findMember("jcr_root/test/hello.txt"), "canBeExported", null, null), equalTo(true));       
    }

    @Test
    public void slingContentProjectUnrelatedResourcesAreNotExportable() throws CoreException, InterruptedException {
       
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.