Search in sources :

Example 21 with EnabledForRepository

use of org.opengrok.indexer.condition.EnabledForRepository in project OpenGrok by OpenGrok.

the class HistoryGuruTest method testAddSubRepositoryNotNestable.

@Test
@EnabledForRepository(CVS)
void testAddSubRepositoryNotNestable() {
    HistoryGuru instance = HistoryGuru.getInstance();
    // Check out CVS underneath a Git repository.
    File cvsRoot = new File(repository.getSourceRoot(), "cvs_test");
    assertTrue(cvsRoot.exists());
    assertTrue(cvsRoot.isDirectory());
    File gitRoot = new File(repository.getSourceRoot(), "git");
    assertTrue(gitRoot.exists());
    assertTrue(gitRoot.isDirectory());
    CVSRepositoryTest.runCvsCommand(gitRoot, "-d", cvsRoot.toPath().resolve("cvsroot").toFile().getAbsolutePath(), "checkout", "cvsrepo");
    Collection<RepositoryInfo> addedRepos = instance.addRepositories(Collections.singleton(Paths.get(repository.getSourceRoot(), "git").toString()));
    assertEquals(1, addedRepos.size());
}
Also used : File(java.io.File) Test(org.junit.jupiter.api.Test) ParameterizedTest(org.junit.jupiter.params.ParameterizedTest) EnabledForRepository(org.opengrok.indexer.condition.EnabledForRepository)

Aggregations

Test (org.junit.jupiter.api.Test)21 EnabledForRepository (org.opengrok.indexer.condition.EnabledForRepository)21 File (java.io.File)19 TestRepository (org.opengrok.indexer.util.TestRepository)14 ParameterizedTest (org.junit.jupiter.params.ParameterizedTest)12 LinkedList (java.util.LinkedList)5 EnabledOnOs (org.junit.jupiter.api.condition.EnabledOnOs)5 Path (java.nio.file.Path)3 Date (java.util.Date)3 RuntimeEnvironment (org.opengrok.indexer.configuration.RuntimeEnvironment)3 BufferedWriter (java.io.BufferedWriter)2 FileWriter (java.io.FileWriter)2 StringWriter (java.io.StringWriter)2 ArrayList (java.util.ArrayList)2 Term (org.apache.lucene.index.Term)2 BooleanQuery (org.apache.lucene.search.BooleanQuery)2 PhraseQuery (org.apache.lucene.search.PhraseQuery)2 TermQuery (org.apache.lucene.search.TermQuery)2 Project (org.opengrok.indexer.configuration.Project)2 HistoryGuru (org.opengrok.indexer.history.HistoryGuru)2