use of org.opengrok.indexer.util.TestRepository in project OpenGrok by OpenGrok.
the class FileControllerTest method setUp.
@BeforeEach
@Override
public void setUp() throws Exception {
super.setUp();
repository = new TestRepository();
repository.create(HistoryGuru.class.getResource("/repositories"));
env.setSourceRoot(repository.getSourceRoot());
env.setDataRoot(repository.getDataRoot());
env.setProjectsEnabled(true);
env.setHistoryEnabled(true);
RepositoryFactory.initializeIgnoredNames(env);
Indexer.getInstance().prepareIndexer(env, // search for repositories
true, // scan and add projects
true, // don't create dictionary
false, // subFiles - needed when refreshing history partially
null, // repositories - needed when refreshing history partially
null);
Indexer.getInstance().doIndexerExecution(true, Collections.singletonList("/git"), null);
}
use of org.opengrok.indexer.util.TestRepository in project OpenGrok by OpenGrok.
the class HistoryControllerTest method setUp.
@BeforeEach
@Override
public void setUp() throws Exception {
super.setUp();
repository = new TestRepository();
repository.create(HistoryGuru.class.getResource("/repositories"));
env.setSourceRoot(repository.getSourceRoot());
env.setDataRoot(repository.getDataRoot());
env.setProjectsEnabled(true);
env.setHistoryEnabled(true);
RepositoryFactory.initializeIgnoredNames(env);
Indexer.getInstance().prepareIndexer(env, // search for repositories
true, // scan and add projects
true, // don't create dictionary
false, // subFiles - needed when refreshing history partially
null, // repositories - needed when refreshing history partially
null);
}
use of org.opengrok.indexer.util.TestRepository in project OpenGrok by OpenGrok.
the class SuggesterControllerTest method setUpClass.
@BeforeAll
public static void setUpClass() throws Exception {
// necessary to test CORS from controllers
System.setProperty("sun.net.http.allowRestrictedHeaders", "true");
repository = new TestRepository();
repository.create(SuggesterControllerTest.class.getClassLoader().getResource("sources"));
env.setHistoryEnabled(false);
env.setProjectsEnabled(true);
Indexer.getInstance().prepareIndexer(env, true, true, false, null, null);
env.setDefaultProjectsFromNames(Collections.singleton("__all__"));
Indexer.getInstance().doIndexerExecution(true, null, null);
env.getSuggesterConfig().setRebuildCronConfig(null);
}
use of org.opengrok.indexer.util.TestRepository in project OpenGrok by OpenGrok.
the class IndexDatabaseSymlinksTest method setUpClass.
@BeforeAll
public static void setUpClass() throws Exception {
env = RuntimeEnvironment.getInstance();
repository = new TestRepository();
repository.createExternal(IndexDatabaseSymlinksTest.class.getResourceAsStream("/index/links_tests.zip"));
// Create and verify symlink from source/ to external/links_tests/links
Path symlink = Paths.get(repository.getSourceRoot(), "links");
Path target = Paths.get(repository.getExternalRoot(), "links_tests", "links");
assertTrue(target.toFile().exists(), target + "should exist");
Files.createSymbolicLink(symlink, target);
assertTrue(symlink.toFile().exists(), symlink + " should exist");
env.setSourceRoot(repository.getSourceRoot());
env.setDataRoot(repository.getDataRoot());
env.setHistoryEnabled(true);
env.setProjectsEnabled(true);
RepositoryFactory.initializeIgnoredNames(env);
}
use of org.opengrok.indexer.util.TestRepository in project OpenGrok by OpenGrok.
the class IndexerMainTest method setUp.
@BeforeEach
public void setUp() throws IOException, URISyntaxException {
repository = new TestRepository();
// For these tests we need Mercurial repository with renamed files.
repository.create(HistoryGuru.class.getResource("/repositories"));
}
Aggregations