Package org.apache.jackrabbit.core

Examples of org.apache.jackrabbit.core.TransientRepository


public class VersioningTest {
   
    public static void main(String[] args) throws Exception {
        //RepositoryConfig config = RepositoryConfig.create(new FileInputStream(new File("C:/tmp/repository.xml")), "C:/tmp/repository");
        Repository repository = new TransientRepository();//RepositoryImpl.create(config);
        Session session = repository.login( new SimpleCredentials("username", "password".toCharArray()) );
        try {
           
            String nodeName = "" + System.currentTimeMillis();
           
            Node rootNode = session.getRootNode();
View Full Code Here


    }

    @Override
    protected Context createJndiContext() throws Exception {
        Context context = super.createJndiContext();
        repository = new TransientRepository("target/repository.xml", "target/repository");
        context.bind("repository", repository);
        return context;
    }
View Full Code Here

        File config = new File(CONFIG_FILE);
        if (!config.exists()) {
            throw new Exception("missing config file: " + config.getPath());
        }
        repository = new TransientRepository(CONFIG_FILE,
                "target/repository_with_auth");

        // set up a user to authenticate
        SessionImpl session = (SessionImpl) repository
                .login(new SimpleCredentials("admin", "admin".toCharArray()));
View Full Code Here

    }

    @Override
    protected Context createJndiContext() throws Exception {
        Context context = super.createJndiContext();
        repository = new TransientRepository("target/repository.xml", "target/repository");
        context.bind("repository", repository);
        return context;
    }
View Full Code Here

    }

    @Override
    protected Context createJndiContext() throws Exception {
        Context context = super.createJndiContext();
        repository = new TransientRepository("target/repository.xml", "target/repository");
        context.bind("repository", repository);
        return context;
    }
View Full Code Here

        File config = new File(CONFIG_FILE);
        if (!config.exists()) {
            throw new Exception("missing config file: " + config.getPath());
        }
        repository = new TransientRepository(CONFIG_FILE,
                "target/repository_with_auth");

        // set up a user to authenticate
        SessionImpl session = (SessionImpl) repository
                .login(new SimpleCredentials("admin", "admin".toCharArray()));
View Full Code Here

    }

    @Override
    protected Context createJndiContext() throws Exception {
        Context context = super.createJndiContext();
        repository = new TransientRepository("target/repository.xml", "target/repository");
        context.bind("repository", repository);
        return context;
    }
View Full Code Here

     * href="https://issues.apache.org/jira/browse/JCR-3069">JCR-3069</a>
     */
    public void testAutoFixWithConsistencyCheck() throws Exception {

        // new repository
        TransientRepository rep = new TransientRepository(new File(TEST_DIR));
        Session s = openSession(rep, false);
        Node root = s.getRootNode();

        // add nodes /test and /test/missing
        Node test = root.addNode("test");
        Node missing = test.addNode("missing");
        missing.addMixin("mix:referenceable");
        UUID id = UUID.fromString(missing.getIdentifier());
        s.save();
        s.logout();

        destroyBundle(id, "workspaces/default");

        s = openSession(rep, false);
        try {
            ConsistencyReport r = TestHelper.checkConsistency(s, false, null);
            assertNotNull(r);
            assertNotNull(r.getItems());
            assertEquals(1, r.getItems().size());
            assertEquals(test.getIdentifier(), r.getItems().iterator().next()
                    .getNodeId());
        } finally {
            s.logout();
            rep.shutdown();
            FileUtils.deleteDirectory(new File("repository"));
        }
    }
View Full Code Here

    }

    public void testOrphan() throws Exception {

        // new repository
        TransientRepository rep = new TransientRepository(new File(TEST_DIR));
        Session s = openSession(rep, false);

        try {
            Node root = s.getRootNode();
View Full Code Here

    }

    public void testMissingVHR() throws Exception {

        // new repository
        TransientRepository rep = new TransientRepository(new File(TEST_DIR));
        Session s = openSession(rep, false);

        String oldVersionRecoveryProp = System
                .getProperty("org.apache.jackrabbit.version.recovery");
View Full Code Here

TOP

Related Classes of org.apache.jackrabbit.core.TransientRepository

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.