localRemote.indexDatabase().copyIndexesTo(cloneRepo.indexDatabase());
protected void testCopyIndexesTo(IndexDatabase target) { IndexInfo index1 = createIndex("Layer1", this.indexDb); this.indexDb.copyIndexesTo(target); Optional<IndexInfo> indexInfo = target.getIndexInfo(index1.getTreeName(), index1.getAttributeName()); assertNotNull(indexInfo); assertTrue(indexInfo.isPresent()); assertEquals(index1, indexInfo.get()); Set<IndexTreeMapping> expectedMappings = toSet(this.indexDb.resolveIndexedTrees(index1)); Set<IndexTreeMapping> actualMappings = toSet(target.resolveIndexedTrees(index1)); assertEquals(expectedMappings.size(), actualMappings.size()); assertEquals(expectedMappings, actualMappings); Set<ObjectId> expectedIndexTrees = verifyAllReachableTrees(this.indexDb, expectedMappings); Set<ObjectId> actualIndexTrees = verifyAllReachableTrees(target, actualMappings); assertEquals(expectedIndexTrees.size(), actualIndexTrees.size()); assertEquals(expectedIndexTrees, actualIndexTrees); }