Package org.apache.sling.ide.test.impl.helpers

Examples of org.apache.sling.ide.test.impl.helpers.ProjectAdapter


    public void inferContentProjectContentMissingFilter() throws CoreException, InterruptedException {

        // create faceted project
        IProject contentProject = projectRule.getProject();

        ProjectAdapter project = new ProjectAdapter(contentProject);
        project.addNatures("org.eclipse.wst.common.project.facet.core.nature");

        // install content facet
        project.installFacet("sling.content", "1.0");

        // create files
        project.createOrUpdateFile(Path.fromPortableString("src/main/content/jcr_root/test/hello.txt"),
                new ByteArrayInputStream("goodbye, world".getBytes()));

        assertThat(ProjectHelper.getInferredContentProjectContentRoot(contentProject), CoreMatchers.nullValue());
    }
View Full Code Here


    public void inferContentProjectContentMissingJcrRoot() throws CoreException, InterruptedException {

        // create faceted project
        IProject contentProject = projectRule.getProject();

        ProjectAdapter project = new ProjectAdapter(contentProject);
        project.addNatures("org.eclipse.wst.common.project.facet.core.nature");

        // install content facet
        project.installFacet("sling.content", "1.0");

        // create files
        project.createOrUpdateFile(Path.fromPortableString("src/main/content/META-INF/vault/filter.xml"),
                new ByteArrayInputStream("<workspaceFilter version=\"1.0\"/>".getBytes()));

        assertThat(ProjectHelper.getInferredContentProjectContentRoot(contentProject), CoreMatchers.nullValue());
    }
View Full Code Here

    public void projectWithInstalledFacetIsCandidate() throws CoreException, InterruptedException {

        // create faceted project
        IProject contentProject = projectRule.getProject();

        ProjectAdapter project = new ProjectAdapter(contentProject);
        project.addNatures("org.eclipse.wst.common.project.facet.core.nature");

        // create files
        project.createOrUpdateFile(Path.fromPortableString("src/main/content/jcr_root/test/hello.txt"),
                new ByteArrayInputStream("goodbye, world".getBytes()));

        project.createOrUpdateFile(Path.fromPortableString("src/main/content/META-INF/vault/filter.xml"),
                new ByteArrayInputStream("<workspaceFilter version=\"1.0\"/>".getBytes()));

        assertThat(ProjectHelper.isPotentialContentProject(contentProject), CoreMatchers.equalTo(true));
    }
View Full Code Here

    public void projectWithoutInstalledFacetIsNotCandidate() throws CoreException, InterruptedException {

        // create faceted project
        IProject contentProject = projectRule.getProject();

        ProjectAdapter project = new ProjectAdapter(contentProject);
        project.addNatures("org.eclipse.wst.common.project.facet.core.nature");

        // install content facet
        project.installFacet("sling.content", "1.0");

        // create files
        project.createOrUpdateFile(Path.fromPortableString("src/main/content/jcr_root/test/hello.txt"),
                new ByteArrayInputStream("goodbye, world".getBytes()));

        project.createOrUpdateFile(Path.fromPortableString("src/main/content/META-INF/vault/filter.xml"),
                new ByteArrayInputStream("<workspaceFilter version=\"1.0\"/>".getBytes()));

        assertThat(ProjectHelper.isPotentialContentProject(contentProject), CoreMatchers.equalTo(false));
    }
View Full Code Here

    public void listChildrenInNestedStructure() throws Exception {

        // create faceted project
        IProject contentProject = projectRule.getProject();

        ProjectAdapter project = new ProjectAdapter(contentProject);
        project.addNatures("org.eclipse.wst.common.project.facet.core.nature");

        // install content facet
        project.installFacet("sling.content", "1.0");

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

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

        // directly create the root node
View Full Code Here

    public void listChildrenWithNestedContentXmlInEscapedDir() throws Exception {

        // create faceted project
        IProject contentProject = projectRule.getProject();

        ProjectAdapter project = new ProjectAdapter(contentProject);
        project.addNatures("org.eclipse.wst.common.project.facet.core.nature");

        // install content facet
        project.installFacet("sling.content", "1.0");

        // create .content.xml structure
        project.createOrUpdateFile(Path.fromPortableString("jcr_root/content/.content.xml"), getClass()
                .getResourceAsStream("sling-folder-nodetype.xml"));

        project.createOrUpdateFile(Path.fromPortableString("jcr_root/content/_sling_stuff/.content.xml"), getClass()
                .getResourceAsStream("nt-unstructured-nodetype.xml"));

        // instantiate the content provider
        JcrContentContentProvider contentProvider = new JcrContentContentProvider();
View Full Code Here

    public void importFilesAndFolders() throws Exception {

        // create faceted project
        IProject contentProject = projectRule.getProject();

        ProjectAdapter project = new ProjectAdapter(contentProject);
        project.addNatures(JavaCore.NATURE_ID, "org.eclipse.wst.common.project.facet.core.nature");

        // install bundle facet
        project.installFacet("sling.content", "1.0");

        wstServer.waitForServerToStart();

        project.createVltFilterWithRoots("/content/test-root/en");
        project.createOrUpdateFile(Path.fromPortableString("jcr_root/content/test-root/en/hello.txt"),
                new ByteArrayInputStream("hello, world".getBytes()));

        ServerAdapter server = new ServerAdapter(wstServer.getServer());
        server.installModule(contentProject);
View Full Code Here

    public void importFilesAndFoldersRespectsVltFilters() throws Exception {

        // create faceted project
        IProject contentProject = projectRule.getProject();

        ProjectAdapter project = new ProjectAdapter(contentProject);
        project.addNatures(JavaCore.NATURE_ID, "org.eclipse.wst.common.project.facet.core.nature");

        // install bundle facet
        project.installFacet("sling.content", "1.0");

        wstServer.waitForServerToStart();

        project.createVltFilterWithRoots("/content/test-root/en");
        project.createOrUpdateFile(Path.fromPortableString("jcr_root/content/test-root/en/hello.txt"),
                new ByteArrayInputStream("hello, world".getBytes()));

        ServerAdapter server = new ServerAdapter(wstServer.getServer());
        server.installModule(contentProject);
View Full Code Here

    public void importFilesAndFoldersRespectsVltIgnore() throws Exception {

        // create faceted project
        IProject contentProject = projectRule.getProject();

        ProjectAdapter project = new ProjectAdapter(contentProject);
        project.addNatures(JavaCore.NATURE_ID, "org.eclipse.wst.common.project.facet.core.nature");

        // install bundle facet
        project.installFacet("sling.content", "1.0");

        wstServer.waitForServerToStart();

        project.createVltFilterWithRoots("/content/test-root/en");
        project.createOrUpdateFile(Path.fromPortableString("jcr_root/content/test-root/.vltignore"),
                new ByteArrayInputStream("en\n".getBytes()));

        ServerAdapter server = new ServerAdapter(wstServer.getServer());
        server.installModule(contentProject);
View Full Code Here

    public void importFilesAndFoldersRespectsVltIgnoreNotUnderImportRoot() throws Exception {

        // create faceted project
        IProject contentProject = projectRule.getProject();

        ProjectAdapter project = new ProjectAdapter(contentProject);
        project.addNatures(JavaCore.NATURE_ID, "org.eclipse.wst.common.project.facet.core.nature");

        // install bundle facet
        project.installFacet("sling.content", "1.0");

        wstServer.waitForServerToStart();

        project.createVltFilterWithRoots("/content/test-root/en");
        project.createOrUpdateFile(Path.fromPortableString("jcr_root/content/hello.txt"), new ByteArrayInputStream(
                "hello, world".getBytes()));

        project.createOrUpdateFile(Path.fromPortableString("jcr_root/.vltignore"), new ByteArrayInputStream(
                "content/test-root/en\n".getBytes()));

        ServerAdapter server = new ServerAdapter(wstServer.getServer());
        server.installModule(contentProject);
View Full Code Here

TOP

Related Classes of org.apache.sling.ide.test.impl.helpers.ProjectAdapter

Copyright © 2018 www.massapicom. 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.