Search in sources :

Example 31 with TestRepository

use of org.opengrok.indexer.util.TestRepository in project OpenGrok by OpenGrok.

the class GitRepositoryOctopusTest method setUpClass.

@BeforeAll
public static void setUpClass() throws Exception {
    repository = new TestRepository();
    repository.create(GitRepositoryOctopusTest.class.getResourceAsStream("/history/git-octopus.zip"));
    RuntimeEnvironment.getInstance().setMergeCommitsEnabled(true);
}
Also used : TestRepository(org.opengrok.indexer.util.TestRepository) BeforeAll(org.junit.jupiter.api.BeforeAll)

Example 32 with TestRepository

use of org.opengrok.indexer.util.TestRepository in project OpenGrok by OpenGrok.

the class BitKeeperRepositoryTest method setUp.

@BeforeEach
public void setUp() {
    try {
        testRepo = new TestRepository();
        testRepo.create(getClass().getResource("/repositories"));
        final File root = new File(testRepo.getSourceRoot(), "bitkeeper");
        bkRepo = (BitKeeperRepository) RepositoryFactory.getRepository(root);
        bkFiles = Arrays.asList(root.list(new BitKeeperFilenameFilter()));
    } catch (final Exception e) {
        testRepo = null;
        bkRepo = null;
        bkFiles = null;
    }
}
Also used : TestRepository(org.opengrok.indexer.util.TestRepository) File(java.io.File) IOException(java.io.IOException) BeforeEach(org.junit.jupiter.api.BeforeEach)

Example 33 with TestRepository

use of org.opengrok.indexer.util.TestRepository in project OpenGrok by OpenGrok.

the class FileHistoryCacheTest method setUp.

/**
 * Set up the test environment with repositories and a cache instance.
 */
@BeforeEach
public void setUp() throws Exception {
    repositories = new TestRepository();
    repositories.create(getClass().getResource("/repositories"));
    cache = new FileHistoryCache();
    cache.initialize();
    savedFetchHistoryWhenNotInCache = env.isFetchHistoryWhenNotInCache();
    savedIsHandleHistoryOfRenamedFiles = env.isHandleHistoryOfRenamedFiles();
    savedIsTagsEnabled = env.isTagsEnabled();
}
Also used : TestRepository(org.opengrok.indexer.util.TestRepository) BeforeEach(org.junit.jupiter.api.BeforeEach)

Example 34 with TestRepository

use of org.opengrok.indexer.util.TestRepository in project OpenGrok by OpenGrok.

the class BoundaryChangesetsTest method setUp.

@BeforeEach
public void setUp() throws Exception {
    repositories = new TestRepository();
    repositories.create(getClass().getResource("/repositories"));
    File reposRoot = new File(repositories.getSourceRoot(), "git");
    Repository repo = RepositoryFactory.getRepository(reposRoot);
    assertNotNull(repo);
    assertTrue(repo instanceof RepositoryWithPerPartesHistory);
    gitRepository = (GitRepository) repo;
}
Also used : TestRepository(org.opengrok.indexer.util.TestRepository) TestRepository(org.opengrok.indexer.util.TestRepository) File(java.io.File) BeforeEach(org.junit.jupiter.api.BeforeEach)

Example 35 with TestRepository

use of org.opengrok.indexer.util.TestRepository in project OpenGrok by OpenGrok.

the class FileHistoryCacheOctopusTest method setUp.

@BeforeEach
public void setUp() throws Exception {
    RuntimeEnvironment.getInstance().setMergeCommitsEnabled(true);
    repositories = new TestRepository();
    repositories.create(getClass().getResourceAsStream("/history/git-octopus.zip"));
    cache = new FileHistoryCache();
    cache.initialize();
}
Also used : TestRepository(org.opengrok.indexer.util.TestRepository) BeforeEach(org.junit.jupiter.api.BeforeEach)

Aggregations

TestRepository (org.opengrok.indexer.util.TestRepository)45 BeforeAll (org.junit.jupiter.api.BeforeAll)26 BeforeEach (org.junit.jupiter.api.BeforeEach)16 HistoryGuru (org.opengrok.indexer.history.HistoryGuru)15 File (java.io.File)14 RuntimeEnvironment (org.opengrok.indexer.configuration.RuntimeEnvironment)10 Ctags (org.opengrok.indexer.analysis.Ctags)6 EnabledForRepository (org.opengrok.indexer.condition.EnabledForRepository)3 Project (org.opengrok.indexer.configuration.Project)3 BufferedWriter (java.io.BufferedWriter)2 FileWriter (java.io.FileWriter)2 IOException (java.io.IOException)2 Path (java.nio.file.Path)2 Test (org.junit.jupiter.api.Test)2 CharArrayWriter (java.io.CharArrayWriter)1 FileReader (java.io.FileReader)1 StringWriter (java.io.StringWriter)1 URL (java.net.URL)1 Files (java.nio.file.Files)1 Paths (java.nio.file.Paths)1