Search in sources :

Example 11 with ConsistencyReport

use of org.apache.jackrabbit.core.persistence.check.ConsistencyReport in project jackrabbit by apache.

the class AddMoveTest method testAddMove.

public void testAddMove() throws RepositoryException, NotExecutableException {
    Session session1 = getHelper().getReadWriteSession();
    Session session2 = getHelper().getReadWriteSession();
    session1.getNode(folder1Path).addNode("node2");
    session2.move(folder1Path + "/node1", folder2Path + "/node1");
    session2.save();
    Node node = session1.getNode(folder2Path + "/node1");
    node.setProperty("foo", "bar");
    session1.save();
    ConsistencyReport consistencyReport = TestHelper.checkConsistency(testRootNode.getSession(), false, null);
    //for (ReportItem item : consistencyReport.getItems()) {
    //    System.out.println(item.getMessage());
    //}
    assertTrue(consistencyReport.getItems().size() == 0);
}
Also used : Node(javax.jcr.Node) ConsistencyReport(org.apache.jackrabbit.core.persistence.check.ConsistencyReport) Session(javax.jcr.Session)

Aggregations

ConsistencyReport (org.apache.jackrabbit.core.persistence.check.ConsistencyReport)11 Session (javax.jcr.Session)8 Node (javax.jcr.Node)7 File (java.io.File)6 UUID (java.util.UUID)6 TransientRepository (org.apache.jackrabbit.core.TransientRepository)6 SQLException (java.sql.SQLException)2 ItemNotFoundException (javax.jcr.ItemNotFoundException)2 RepositoryException (javax.jcr.RepositoryException)2 ConstraintViolationException (javax.jcr.nodetype.ConstraintViolationException)2 InvalidItemStateException (javax.jcr.InvalidItemStateException)1 NotExecutableException (org.apache.jackrabbit.test.NotExecutableException)1