use of org.opengrok.indexer.util.TestRepository in project OpenGrok by OpenGrok.
the class HistoryGuruTest method setUpClass.
@BeforeAll
public static void setUpClass() throws Exception {
env = RuntimeEnvironment.getInstance();
savedNestingMaximum = env.getNestingMaximum();
repository = new TestRepository();
repository.create(HistoryGuru.class.getResource("/repositories"));
RepositoryFactory.initializeIgnoredNames(env);
FileUtilities.getAllFiles(new File(repository.getSourceRoot()), FILES, true);
assertNotEquals(0, FILES.size());
HistoryGuru histGuru = HistoryGuru.getInstance();
assertNotNull(histGuru);
assertEquals(0, histGuru.getRepositories().size());
// Add initial set of repositories to HistoryGuru and RuntimeEnvironment.
// This is a test in itself. While this makes the structure of the tests
// a bit incomprehensible, it does not make sense to run the rest of tests
// if the basic functionality does not work.
env.setRepositories(repository.getSourceRoot());
assertTrue(histGuru.getRepositories().size() > 0);
assertEquals(histGuru.getRepositories().size(), env.getRepositories().size());
// Create cache with initial set of repositories.
histGuru.createCache();
}
use of org.opengrok.indexer.util.TestRepository in project OpenGrok by OpenGrok.
the class IgnoredNamesTest method setUpClass.
@BeforeAll
public static void setUpClass() throws Exception {
repository = new TestRepository();
repository.create(CAnalyzerFactoryTest.class.getClassLoader().getResource("sources"));
// Populate ignored lists with repository specific entries.
RepositoryFactory.initializeIgnoredNames(RuntimeEnvironment.getInstance());
}
use of org.opengrok.indexer.util.TestRepository in project OpenGrok by OpenGrok.
the class JavaAnalyzerFactoryTest method setUpClass.
@BeforeAll
public static void setUpClass() throws Exception {
ctags = new Ctags();
repository = new TestRepository();
repository.create(JavaAnalyzerFactoryTest.class.getClassLoader().getResource("sources"));
JavaAnalyzerFactory analFact = new JavaAnalyzerFactory();
analyzer = analFact.getAnalyzer();
RuntimeEnvironment env = RuntimeEnvironment.getInstance();
if (env.validateUniversalCtags()) {
analyzer.setCtags(new Ctags());
}
}
use of org.opengrok.indexer.util.TestRepository in project OpenGrok by OpenGrok.
the class TroffAnalyzerTest method setUpBeforeClass.
/**
* Test method for {@link org.opengrok.indexer.analysis.document
* .TroffAnalyzer#TroffAnalyzer(org.opengrok.indexer.analysis.FileAnalyzerFactory)}.
*
* @throws java.lang.Exception exception
*/
@BeforeAll
public static void setUpBeforeClass() throws Exception {
factory = new TroffAnalyzerFactory();
assertNotNull(factory);
analyzer = new TroffAnalyzer(factory);
assertNotNull(analyzer);
repository = new TestRepository();
repository.create(TroffAnalyzerTest.class.getClassLoader().getResource("sources"));
String file = System.getProperty("opengrok.test.troff.doc", repository.getSourceRoot() + "/document/foobar.1");
File f = new File(file);
assertTrue(f.canRead() && f.isFile(), "troff testfile " + f + " not found");
CharArrayWriter w = new CharArrayWriter((int) f.length());
Util.dump(w, f, false);
content = w.toString();
}
use of org.opengrok.indexer.util.TestRepository in project OpenGrok by OpenGrok.
the class CxxAnalyzerFactoryTest method setUpClass.
@BeforeAll
public static void setUpClass() throws Exception {
ctags = new Ctags();
repository = new TestRepository();
repository.create(CxxAnalyzerFactoryTest.class.getClassLoader().getResource("sources"));
CxxAnalyzerFactory analFact = new CxxAnalyzerFactory();
analyzer = analFact.getAnalyzer();
RuntimeEnvironment env = RuntimeEnvironment.getInstance();
if (env.validateUniversalCtags()) {
analyzer.setCtags(new Ctags());
}
}
Aggregations