Search in sources :

Example 11 with TestRepository

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

the class CtagsTest method setUpClass.

@BeforeClass
public static void setUpClass() throws Exception {
    ctags = new Ctags();
    ctags.setBinary(RuntimeEnvironment.getInstance().getCtags());
    repository = new TestRepository();
    repository.create(CtagsTest.class.getResourceAsStream("/org/opensolaris/opengrok/index/source.zip"));
    /*
         * This setting is only needed for bug19195 but it does not seem
         * that it is possible to specify it just for single test case.
         * The config file contains assembly specific settings so it should
         * not be harmful to other test cases.
         */
    String extraOptionsFile = repository.getSourceRoot() + "/bug19195/ctags.config";
    ctags.setCTagsExtraOptionsFile(extraOptionsFile);
    assertTrue("No point in running ctags tests without valid ctags", RuntimeEnvironment.getInstance().validateExuberantCtags());
}
Also used : TestRepository(org.opensolaris.opengrok.util.TestRepository) BeforeClass(org.junit.BeforeClass)

Example 12 with TestRepository

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

the class FileHistoryCacheTest method setUp.

/**
     * Set up the test environment with repositories and a cache instance.
     *
     * @throws java.lang.Exception
     */
@Before
public void setUp() throws Exception {
    repositories = new TestRepository();
    repositories.create(getClass().getResourceAsStream("repositories.zip"));
    cache = new FileHistoryCache();
    cache.initialize();
}
Also used : TestRepository(org.opensolaris.opengrok.util.TestRepository) Before(org.junit.Before)

Example 13 with TestRepository

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

the class GitHistoryParserTest method setUpClass.

@BeforeClass
public static void setUpClass() throws Exception {
    repository = new TestRepository();
    repository.create(HistoryGuru.class.getResourceAsStream("repositories.zip"));
}
Also used : TestRepository(org.opensolaris.opengrok.util.TestRepository) BeforeClass(org.junit.BeforeClass)

Example 14 with TestRepository

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

the class HistoryGuruTest method setUpClass.

@BeforeClass
public static void setUpClass() throws Exception {
    repository = new TestRepository();
    repository.create(HistoryGuru.class.getResourceAsStream("repositories.zip"));
    FileUtilities.getAllFiles(new File(repository.getSourceRoot()), files, true);
    RuntimeEnvironment.getInstance().setVerbose(true);
    HistoryGuru instance = HistoryGuru.getInstance();
    instance.addRepositories(repository.getSourceRoot());
    // create cache with initial set of repos
    instance.createCache();
    // now create cache for more repos
    Collection<String> repos = new ArrayList<>();
    repos.add("git");
    repos.add("bazaar");
    repos.add("mercurial");
    repos.add("teamware");
    repos.add("rcs_test");
    repos.add("nonexistent");
    instance.createCache(repos);
}
Also used : TestRepository(org.opensolaris.opengrok.util.TestRepository) ArrayList(java.util.ArrayList) File(java.io.File) BeforeClass(org.junit.BeforeClass)

Example 15 with TestRepository

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

the class MercurialRepositoryTest 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 {
    repository = new TestRepository();
    repository.create(getClass().getResourceAsStream("repositories.zip"));
}
Also used : TestRepository(org.opensolaris.opengrok.util.TestRepository)

Aggregations

TestRepository (org.opensolaris.opengrok.util.TestRepository)22 BeforeClass (org.junit.BeforeClass)17 Ctags (org.opensolaris.opengrok.analysis.Ctags)6 File (java.io.File)4 Before (org.junit.Before)4 RuntimeEnvironment (org.opensolaris.opengrok.configuration.RuntimeEnvironment)3 HistoryGuru (org.opensolaris.opengrok.history.HistoryGuru)3 IndexerTest (org.opensolaris.opengrok.index.IndexerTest)2 ByteArrayOutputStream (java.io.ByteArrayOutputStream)1 CharArrayWriter (java.io.CharArrayWriter)1 PrintStream (java.io.PrintStream)1 ArrayList (java.util.ArrayList)1 CAnalyzerFactoryTest (org.opensolaris.opengrok.analysis.c.CAnalyzerFactoryTest)1