Search in sources :

Example 6 with TestRepository

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

the class SearchEngineTest method setUpClass.

@BeforeAll
public static void setUpClass() throws Exception {
    repository = new TestRepository();
    repository.create(HistoryGuru.class.getResource("/repositories"));
    RuntimeEnvironment env = RuntimeEnvironment.getInstance();
    env.setSourceRoot(repository.getSourceRoot());
    env.setDataRoot(repository.getDataRoot());
    RepositoryFactory.initializeIgnoredNames(env);
    env.setSourceRoot(repository.getSourceRoot());
    env.setDataRoot(repository.getDataRoot());
    env.setHistoryEnabled(false);
    Indexer.getInstance().prepareIndexer(env, true, true, false, null, null);
    env.setDefaultProjectsFromNames(new TreeSet<>(Collections.singletonList("/c")));
    Indexer.getInstance().doIndexerExecution(true, null, null);
    configFile = File.createTempFile("configuration", ".xml");
    env.writeConfiguration(configFile);
    RuntimeEnvironment.getInstance().readConfiguration(new File(configFile.getAbsolutePath()));
}
Also used : TestRepository(org.opengrok.indexer.util.TestRepository) RuntimeEnvironment(org.opengrok.indexer.configuration.RuntimeEnvironment) HistoryGuru(org.opengrok.indexer.history.HistoryGuru) File(java.io.File) BeforeAll(org.junit.jupiter.api.BeforeAll)

Example 7 with TestRepository

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

the class HistoryContextTest method setUpClass.

@BeforeAll
public static void setUpClass() throws Exception {
    repositories = new TestRepository();
    repositories.create(HistoryContextTest.class.getResource("/repositories"));
    RuntimeEnvironment.getInstance().setRepositories(repositories.getSourceRoot());
}
Also used : TestRepository(org.opengrok.indexer.util.TestRepository) BeforeAll(org.junit.jupiter.api.BeforeAll)

Example 8 with TestRepository

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

the class SCCSRepositoryTest method setup.

@BeforeAll
public static void setup() throws Exception {
    repository = new TestRepository();
    URL repositoriesUrl = SCCSRepositoryTest.class.getResource("/repositories");
    assertNotNull(repositoriesUrl);
    repository.create(repositoriesUrl);
    repositoryRoot = new File(repository.getSourceRoot(), "teamware");
    assertTrue(repositoryRoot.isDirectory());
    sccsRepository = (SCCSRepository) RepositoryFactory.getRepository(repositoryRoot);
    assertNotNull(sccsRepository);
}
Also used : TestRepository(org.opengrok.indexer.util.TestRepository) File(java.io.File) URL(java.net.URL) BeforeAll(org.junit.jupiter.api.BeforeAll)

Example 9 with TestRepository

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

the class SearchHelperTest method setUp.

@BeforeEach
public void setUp() throws Exception {
    repository = new TestRepository();
    repository.create(IndexerTest.class.getClassLoader().getResource("sources"));
    env = RuntimeEnvironment.getInstance();
    env.setSourceRoot(repository.getSourceRoot());
    env.setDataRoot(repository.getDataRoot());
    env.setHistoryEnabled(false);
}
Also used : TestRepository(org.opengrok.indexer.util.TestRepository) BeforeEach(org.junit.jupiter.api.BeforeEach)

Example 10 with TestRepository

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

the class JFlexXrefTest method setUpClass.

@BeforeAll
public static void setUpClass() throws Exception {
    ctags = new Ctags();
    repository = new TestRepository();
    repository.create(JFlexXrefTest.class.getClassLoader().getResource("sources"));
}
Also used : TestRepository(org.opengrok.indexer.util.TestRepository) BeforeAll(org.junit.jupiter.api.BeforeAll)

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