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

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


    public void slingContentProjectIsExportable() 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 bundle facet
        project.installFacet("sling.content", "1.0");

        assertThat("Sling content project can be exported",
                new ContentResourceTester().test(contentProject, "canBeExported", null, null), equalTo(true));
    }
View Full Code Here


    public void slingContentProjectSyncedResourcesAreExportable() 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 bundle facet
        project.installFacet("sling.content", "1.0");
       
        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",
View Full Code Here

    public void slingContentProjectUnrelatedResourcesAreNotExportable() 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 bundle facet
        project.installFacet("sling.content", "1.0");
       
        project.createOrUpdateFile(Path.fromPortableString("res/hello.txt"), new ByteArrayInputStream(
                "goodbye, world".getBytes()));
       
        assertThat("Dir not under content sync dir can not be exported",
                new ContentResourceTester().test(contentProject.findMember("res"), "canBeExported", null, null), equalTo(false));
        assertThat("File not under content sync dir can not be exported",
View Full Code Here

    public void projectMembersContainContentXmlFirst() 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");

        project.createOrUpdateFile(Path.fromPortableString("jcr_root/content/1_file.txt"), new ByteArrayInputStream(
                new byte[0]));
        project.createOrUpdateFile(Path.fromPortableString("jcr_root/content/2_folder/filler.txt"),
                new ByteArrayInputStream(new byte[0]));
        project.createOrUpdateFile(Path.fromPortableString("jcr_root/content/3_file.txt"), new ByteArrayInputStream(
                new byte[0]));
        project.createOrUpdateFile(Path.fromPortableString("jcr_root/content/4_folder/filler.txt"),
                new ByteArrayInputStream(new byte[0]));
        project.createOrUpdateFile(Path.fromPortableString("jcr_root/content/5_file.txt"), new ByteArrayInputStream(
                new byte[0]));
        project.createOrUpdateFile(Path.fromPortableString("jcr_root/content/.content.xml"), new ByteArrayInputStream(
                new byte[0]));

        IModule module = ServerUtil.getModule(contentProject);

        SlingContentModuleFactory moduleFactory = new SlingContentModuleFactory();
View Full Code Here

    public void projectMembersContainDotDirFoldersLast() 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");

        project.createOrUpdateFile(Path.fromPortableString("jcr_root/content/testproject/_jcr_content/image/file"),
                new ByteArrayInputStream(new byte[0]));
        project.createOrUpdateFile(
                Path.fromPortableString("jcr_root/content/testproject/_jcr_content/image/file.dir/.content.xml"),
                new ByteArrayInputStream(new byte[0]));
        project.createOrUpdateFile(
                Path.fromPortableString("jcr_root/content/testproject/_jcr_content/image/file.dir/_jcr_content/_dam_thumbnails/_dam_thumbnail_319.png"),
                new ByteArrayInputStream(new byte[0]));

        IModule module = ServerUtil.getModule(contentProject);
View Full Code Here

    public void slingContentProjectSyncedResourcesAreExportable() 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 bundle facet
        project.installFacet("sling.content", "1.0");

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


        IPath filterPath = ProjectUtil.findFilterPath(contentProject);
        assertThat("filterPath.absolute", filterPath.isAbsolute(), equalTo(true));
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.