View Javadoc
1   /*
2    * Copyright (C) 2019, Google LLC and others
3    *
4    * This program and the accompanying materials are made available under the
5    * terms of the Eclipse Distribution License v. 1.0 which is available at
6    * https://www.eclipse.org/org/documents/edl-v10.php.
7    *
8    * SPDX-License-Identifier: BSD-3-Clause
9    */
10  package org.eclipse.jgit.revwalk;
11  
12  import static org.junit.Assert.assertNotNull;
13  
14  import org.eclipse.jgit.internal.storage.file.FileRepository;
15  import org.eclipse.jgit.internal.storage.file.GC;
16  import org.eclipse.jgit.junit.TestRepository;
17  
18  public class BitmappedReachabilityCheckerTest
19  		extends ReachabilityCheckerTestCase {
20  
21  	@Override
22  	protected ReachabilityChecker getChecker(
23  			TestRepository<FileRepository> repository) throws Exception {
24  		// GC generates the bitmaps
25  		GC gc = new GC(repo.getRepository());
26  		gc.setAuto(false);
27  		gc.gc();
28  
29  		// This is null when the test didn't create any branch
30  		assertNotNull("Probably the test didn't define any ref",
31  				repo.getRevWalk().getObjectReader().getBitmapIndex());
32  
33  		return new BitmappedReachabilityChecker(repository.getRevWalk());
34  	}
35  
36  }