Package org.apache.jackrabbit.vault.fs.io

Examples of org.apache.jackrabbit.vault.fs.io.ImportOptions


    }

    private void doOrderTest(AccessControlHandling ac) throws Exception {
        JcrPackage pack = packMgr.upload(getStream("testpackages/mode_ac_test_e.zip"), true);
        assertNotNull(pack);
        ImportOptions opts = getDefaultOptions();
        opts.setAccessControlHandling(ac);
        pack.install(opts);

        // test if nodes and ACLs of first package exist
        assertNodeExists("/testroot/node_e");
        int idx0 = hasPermission("/testroot/secured", false, new String[]{"jcr:all"}, "everyone", Collections.<String, String[]>emptyMap());
View Full Code Here


    public void testRepoACL() throws RepositoryException, IOException, PackageException {
        removeRepoACL();

        JcrPackage pack = packMgr.upload(getStream("testpackages/repo_policy.zip"), false);
        assertNotNull(pack);
        ImportOptions opts = getDefaultOptions();
        opts.setAccessControlHandling(AccessControlHandling.OVERWRITE);
        pack.install(opts);

        // test if nodes and ACLs of first package exist
        assertPermission(null, false, new String[]{"jcr:all"}, "everyone", null);
        assertPermission(null, false, new String[]{"jcr:all"}, "testuser", null);

        pack = packMgr.upload(getStream("testpackages/repo_no_policy.zip"), true);
        assertNotNull(pack);
        opts = getDefaultOptions();
        opts.setAccessControlHandling(AccessControlHandling.OVERWRITE);
        pack.install(opts);

        assertPermissionMissing(null, false, new String[]{"jcr:all"}, "everyone", null);
        assertPermissionMissing(null, false, new String[]{"jcr:all"}, "testuser", null);
View Full Code Here

        addACL(null, true, new String[]{"jcr:all"}, "testuser1");
        assertPermission(null, true, new String[]{"jcr:all"}, "testuser1", null);

        JcrPackage pack = packMgr.upload(getStream("testpackages/repo_policy.zip"), false);
        assertNotNull(pack);
        ImportOptions opts = getDefaultOptions();
        opts.setAccessControlHandling(AccessControlHandling.MERGE);
        pack.install(opts);

        // test if nodes and ACLs of first package exist
        assertPermission(null, false, new String[]{"jcr:all"}, "everyone", null);
        assertPermission(null, false, new String[]{"jcr:all"}, "testuser", null);
View Full Code Here

        addACL(null, true, new String[]{"jcr:all"}, "testuser1");
        assertPermission(null, true, new String[]{"jcr:all"}, "testuser1", null);

        JcrPackage pack = packMgr.upload(getStream("testpackages/repo_policy.zip"), false);
        assertNotNull(pack);
        ImportOptions opts = getDefaultOptions();
        opts.setAccessControlHandling(AccessControlHandling.MERGE_PRESERVE);
        pack.install(opts);

        // test if nodes and ACLs of first package exist
        assertPermission(null, false, new String[]{"jcr:all"}, "everyone", null);
        assertPermission(null, true, new String[]{"jcr:all"}, "testuser", null);
View Full Code Here

    public void testNonRecursive() throws RepositoryException, IOException, PackageException {
        JcrPackage pack = packMgr.upload(getStream("testpackages/subtest.zip"), false);
        assertNotNull(pack);

        // install
        ImportOptions opts = getDefaultOptions();
        opts.setNonRecursive(true);
        pack.install(opts);

        // check for sub packages
        assertNodeExists("/etc/packages/my_packages/sub_a.zip");
        assertNodeExists("/etc/packages/my_packages/sub_b.zip");
View Full Code Here

    public void testRecursiveIgnoreA() throws RepositoryException, IOException, PackageException {
        JcrPackage pack = packMgr.upload(getStream("testpackages/subtest_ignore_a.zip"), false);
        assertNotNull(pack);

        // install
        ImportOptions opts = getDefaultOptions();
        opts.setNonRecursive(false);
        pack.install(opts);

        // check for sub packages
        assertNodeExists("/etc/packages/my_packages/sub_a.zip"); // todo: ignore should ignore A completely
        assertNodeExists("/etc/packages/my_packages/sub_b.zip");
View Full Code Here

    public void testRecursiveAddA() throws RepositoryException, IOException, PackageException {
        JcrPackage pack = packMgr.upload(getStream("testpackages/subtest_add_a.zip"), false);
        assertNotNull(pack);

        // install
        ImportOptions opts = getDefaultOptions();
        opts.setNonRecursive(false);
        pack.install(opts);

        // check for sub packages
        assertNodeExists("/etc/packages/my_packages/sub_a.zip");
        assertNodeExists("/etc/packages/my_packages/sub_b.zip");
View Full Code Here

    public void testRecursiveExtractA() throws RepositoryException, IOException, PackageException {
        JcrPackage pack = packMgr.upload(getStream("testpackages/subtest_extract_a.zip"), false);
        assertNotNull(pack);

        // install
        ImportOptions opts = getDefaultOptions();
        opts.setNonRecursive(false);
        pack.install(opts);

        // check for sub packages
        assertNodeExists("/etc/packages/my_packages/sub_a.zip");
        assertNodeExists("/etc/packages/my_packages/sub_b.zip");
View Full Code Here

    public void testRecursive() throws RepositoryException, IOException, PackageException {
        JcrPackage pack = packMgr.upload(getStream("testpackages/subtest.zip"), false);
        assertNotNull(pack);

        // install
        ImportOptions opts = getDefaultOptions();
        opts.setNonRecursive(false);
        pack.install(opts);

        // check for sub packages
        assertNodeExists("/etc/packages/my_packages/sub_a.zip");
        assertNodeExists("/etc/packages/my_packages/sub_b.zip");
View Full Code Here

    public void testUninstallNonRecursive() throws RepositoryException, IOException, PackageException {
        JcrPackage pack = packMgr.upload(getStream("testpackages/subtest.zip"), false);
        assertNotNull(pack);

        // install
        ImportOptions opts = getDefaultOptions();
        opts.setNonRecursive(false);
        pack.install(opts);

        assertNodeExists("/tmp/a");
        assertNodeExists("/tmp/b");

        // uninstall
        opts.setNonRecursive(true);
        pack.uninstall(opts);

        assertNodeMissing("/etc/packages/my_packages/sub_a.zip");
        assertNodeMissing("/etc/packages/my_packages/sub_b.zip");
        assertNodeExists("/tmp/a");
View Full Code Here

TOP

Related Classes of org.apache.jackrabbit.vault.fs.io.ImportOptions

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.