Package org.apache.jackrabbit.core

Examples of org.apache.jackrabbit.core.TransientRepository


    @Before
    public void setUp() throws Exception {

        jcrProvider = new DefaultProvider();

        repository = new TransientRepository();

        JcrCollectionAdapter cp = new JcrCollectionAdapter();
        cp.setTitle("My Entries");
        cp.setAuthor("Apache Abdera");
        cp.setCollectionNodePath("entries");
View Full Code Here


     *
     * @param args command line arguments (ignored)
     * @throws Exception if an error occurs
     */
    public static void main(String[] args) throws Exception {
        Repository repository = new TransientRepository();
        Session session = repository.login();
        try {
            String user = session.getUserID();
            String name = repository.getDescriptor(Repository.REP_NAME_DESC);
            System.out.println(
                    "Logged in as " + user + " to a " + name + " repository.");
        } finally {
            session.logout();
        }
View Full Code Here

     *
     * @param args command line arguments (ignored)
     * @throws Exception if an error occurs
     */
    public static void main(String[] args) throws Exception {
        Repository repository = new TransientRepository();
        Session session = repository.login(
                new SimpleCredentials("username", "password".toCharArray()));
        try {
            Node root = session.getRootNode();

            // Store content
View Full Code Here

  public void testStartRepoWithDynamicConfigFromXml() throws Exception {
    RepositoryConf conf = getRepositoryConf();
   
    RepositoryConfig config = conf.createConfig("applications/test");
    config.init();
    TransientRepository repo = new TransientRepository(config);
    repo.login();
    repo.shutdown();
  }
View Full Code Here

    conf.print(new PrettyPrinter(System.out));
    System.out.println();
   
    RepositoryConfig config = conf.createConfig("applications/test2");
    config.init();
    TransientRepository repo = new TransientRepository(config);
    repo.login();
    repo.shutdown();
  }
View Full Code Here

  public Repository getRepository() throws RepositoryException {
    if (repo == null) {
      RepositoryConfig config = conf.createConfig(home);
      config.init();
      try {
        repo = new TransientRepository(config);
      } catch (IOException e) {
        throw new RepositoryException("Cannot instantiate " +
            "TransientRepository at " + home, e);
      }
    }
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

    }

    public void testMissingRootVersion() 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.