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

Examples of org.apache.sling.ide.test.impl.helpers.RepositoryAccessor.createFile()


        // create server-side content
        RepositoryAccessor repo = new RepositoryAccessor(config);
        repo.createNode("/content/test-root/en", "nt:folder");
        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, hasFolder("jcr_root/content/test-root/en/files"));
        assertThat(contentProject, hasFile("jcr_root/content/test-root/en/files/first.txt", "first file".getBytes()));
View Full Code Here


        // create server-side content
        RepositoryAccessor repo = new RepositoryAccessor(config);
        repo.createNode("/content/test-root/de", "nt:folder");
        repo.createNode("/content/test-root/de/files", "nt:folder");
        repo.createFile("/content/test-root/de/files/first.txt", "first file".getBytes());

        deh.clearUnexpectedEventsAfterSettling();

        runImport(contentProject);
View Full Code Here

        // create server-side content
        RepositoryAccessor repo = new RepositoryAccessor(config);
        repo.createNode("/content/test-root/en", "nt:folder");
        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());
    }
View Full Code Here

        // create server-side content
        RepositoryAccessor repo = new RepositoryAccessor(config);
        repo.createNode("/content/test-root/en", "nt:folder");
        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());
    }
View Full Code Here

        // create server-side content
        RepositoryAccessor repo = new RepositoryAccessor(config);
        repo.tryDeleteResource("/content/test-root");
        repo.createNode("/content/test-root", "sling:Folder");
        repo.createFile("/content/test-root/file.txt", "hello, world".getBytes());
        repo.doWithSession(new SessionRunnable<Void>() {
            @Override
            public Void doWithSession(Session session) throws RepositoryException {

                ValueFactory valueFactory = session.getValueFactory();
View Full Code Here

        // create server-side content
        RepositoryAccessor repo = new RepositoryAccessor(config);
        repo.createNode("/content/test-root/en", "nt:folder");
        repo.createNode("/content/test-root/en/files", "nt:folder");
        repo.createFile("/content/test-root/en/files/first.txt", "first file".getBytes());
        repo.createFile("/content/test-root/en/files/second.txt", "second file".getBytes());

        // delete file since it was deployed when the module was added to the server
        repo.tryDeleteResource("/content/test-root/hello.txt");
View Full Code Here

        // create server-side content
        RepositoryAccessor repo = new RepositoryAccessor(config);
        repo.createNode("/content/test-root/en", "nt:folder");
        repo.createNode("/content/test-root/en/files", "nt:folder");
        repo.createFile("/content/test-root/en/files/first.txt", "first file".getBytes());
        repo.createFile("/content/test-root/en/files/second.txt", "second file".getBytes());

        // delete file since it was deployed when the module was added to the server
        repo.tryDeleteResource("/content/test-root/hello.txt");

        // run initial import
View Full Code Here

        deh.clearUnexpectedEventsAfterSettling();

        repo.createNode("/content/test-root/folder", "sling:Folder");
        repo.createNode("/content/test-root/folder/jcr:content", "nt:unstructured");
        repo.createFile("/content/test-root/folder/jcr:content/some_file.txt", "dummy contents".getBytes());
        repo.doWithSession(new SessionRunnable<Void>() {

            @Override
            public Void doWithSession(Session session) throws RepositoryException {
                session.getRootNode().getNode("content/test-root/folder/jcr:content/some_file.txt/jcr:content")
View Full Code Here

        ServerAdapter server = new ServerAdapter(wstServer.getServer());
        server.installModule(contentProject);

        deh.clearUnexpectedEventsAfterSettling();

        repo.createFile("/content/test-root/sling:file", "some_content".getBytes());

        runImport(contentProject);

        assertThat(contentProject, hasFile("jcr_root/content/test-root/_sling_file"));
    }
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.