@Test public void testRecursiveInfoGetsFileLock() throws Exception { final TestOptions options = TestOptions.getInstance(); final SvnOperationFactory svnOperationFactory = new SvnOperationFactory(); final Sandbox sandbox = Sandbox.createWithCleanup(getTestName() + ".testRecursiveInfoGetsFileLock", options); try { final SVNURL url = sandbox.createSvnRepository(); final CommitBuilder commitBuilder = new CommitBuilder(url); commitBuilder.addFile("directory/file"); commitBuilder.commit(); final SVNURL fileUrl = url.appendPath("directory/file", false); final String lockMessage = "lock message"; final SvnSetLock setLock = svnOperationFactory.createSetLock(); setLock.setSingleTarget(SvnTarget.fromURL(fileUrl)); setLock.setLockMessage(lockMessage); setLock.run(); final SVNLock[] lock = new SVNLock[1]; final SvnGetInfo getInfo = svnOperationFactory.createGetInfo(); getInfo.setDepth(SVNDepth.INFINITY); getInfo.setSingleTarget(SvnTarget.fromURL(url)); getInfo.setReceiver( new ISvnObjectReceiver<SvnInfo>() { public void receive(SvnTarget target, SvnInfo info) throws SVNException { if (target.getPathOrUrlDecodedString().endsWith("file")) { lock[0] = info.getLock(); } } }); getInfo.run(); Assert.assertNotNull(lock[0]); Assert.assertEquals("/directory/file", lock[0].getPath()); Assert.assertEquals(lockMessage, lock[0].getComment()); } finally { svnOperationFactory.dispose(); sandbox.dispose(); } }