Index: src/test/java/org/apache/jackrabbit/core/cluster/DbClusterTestJCR3162.java =================================================================== --- src/test/java/org/apache/jackrabbit/core/cluster/DbClusterTestJCR3162.java (revision 1214672) +++ src/test/java/org/apache/jackrabbit/core/cluster/DbClusterTestJCR3162.java (working copy) @@ -37,15 +37,13 @@ import org.apache.jackrabbit.commons.JcrUtils; import org.apache.jackrabbit.core.RepositoryImpl; import org.apache.jackrabbit.core.config.RepositoryConfig; +import org.apache.jackrabbit.test.JUnitTest; import org.h2.tools.Server; -import org.junit.After; -import org.junit.Before; -import org.junit.Test; /** * Test for JCR3162 */ -public class DbClusterTestJCR3162 { +public class DbClusterTestJCR3162 extends JUnitTest { private static final SimpleCredentials ADMIN = new SimpleCredentials( "admin", "admin".toCharArray()); @@ -59,7 +57,6 @@ private String clusterId1 = UUID.randomUUID().toString(); private String clusterId2 = UUID.randomUUID().toString(); - @Before public void setUp() throws Exception { deleteAll(); server1 = Server.createTcpServer("-tcpPort", "9001", "-baseDir", @@ -85,7 +82,6 @@ } - @After public void tearDown() throws Exception { try { rep1.shutdown(); @@ -103,7 +99,6 @@ FileUtils.deleteDirectory(new File("./target/dbClusterTest")); } - @Test public void test() throws RepositoryException { int count = 5; @@ -114,6 +109,7 @@ JcrConstants.NT_UNSTRUCTURED); for (int i = 0; i < count; i++) { n.addNode("child_" + i); + n.addMixin("mix:versionable"); } s1.save(); @@ -129,7 +125,7 @@ // verify Session s2 = rep2.login(ADMIN); - checkConsistency(s2, n.getPath(), count); + checkConsistency(s2, "/", s2.getRootNode().getNodes().getSize()); } private void resetJournalRev() { @@ -157,7 +153,7 @@ } } - private void checkConsistency(Session s, String path, int nodes) + private void checkConsistency(Session s, String path, long nodes) throws RepositoryException { s.refresh(true); @@ -174,7 +170,7 @@ .getWorkspace() .getQueryManager() .createQuery( - "SELECT * FROM [" + JcrConstants.NT_UNSTRUCTURED + "SELECT * FROM [" + JcrConstants.NT_BASE + "] as NODE WHERE ischildnode(NODE, [" + path + "])", Query.JCR_SQL2).execute().getRows(); @@ -184,5 +180,9 @@ foundViaQuery++; } Assert.assertEquals(nodes, foundViaQuery); + + for (Node c : JcrUtils.getChildNodes(n)) { + checkConsistency(s, c.getPath(), c.getNodes().getSize()); + } } }