use of org.opengrok.indexer.util.TestRepository in project OpenGrok by OpenGrok.
the class CVSRepositoryTest method setUpTestRepository.
/**
* Set up a test repository. Should be called by the tests that need it. The
* test repository will be destroyed automatically when the test finishes.
*/
private void setUpTestRepository() throws IOException, URISyntaxException {
repository = new TestRepository();
repository.create(getClass().getResource("/repositories"));
// Checkout cvsrepo anew in order to get the CVS/Root files point to
// the temporary directory rather than the OpenGrok workspace directory
// it was created from. This is necessary since 'cvs update' changes
// the CVS parent directory after branch has been created.
File root = new File(repository.getSourceRoot(), "cvs_test");
File cvsrepodir = new File(root, "cvsrepo");
IOUtils.removeRecursive(cvsrepodir.toPath());
File cvsroot = new File(root, "cvsroot");
runCvsCommand(root, "-d", cvsroot.getAbsolutePath(), "checkout", "cvsrepo");
}
use of org.opengrok.indexer.util.TestRepository in project OpenGrok by OpenGrok.
the class ProjectsControllerTest 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);
env.setHandleHistoryOfRenamedFiles(true);
RepositoryFactory.initializeIgnoredNames(env);
}
use of org.opengrok.indexer.util.TestRepository in project OpenGrok by OpenGrok.
the class SearchControllerTest 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(SearchControllerTest.class.getClassLoader().getResource("sources"));
env.setHistoryEnabled(false);
env.setProjectsEnabled(true);
env.setDefaultProjectsFromNames(Collections.singleton("__all__"));
env.getSuggesterConfig().setRebuildCronConfig(null);
}
use of org.opengrok.indexer.util.TestRepository in project OpenGrok by OpenGrok.
the class IndexerTest method setUp.
@BeforeEach
public void setUp() throws Exception {
repository = new TestRepository();
repository.create(IndexerTest.class.getClassLoader().getResource("sources"));
}
use of org.opengrok.indexer.util.TestRepository in project OpenGrok by OpenGrok.
the class IndexerRepoTest 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