use of org.opengrok.indexer.util.TestRepository in project OpenGrok by OpenGrok.
the class CSharpAnalyzerFactoryTest method setUpClass.
@BeforeAll
public static void setUpClass() throws Exception {
ctags = new Ctags();
repository = new TestRepository();
repository.create(CSharpAnalyzerFactoryTest.class.getClassLoader().getResource("sources"));
CSharpAnalyzerFactory analFact = new CSharpAnalyzerFactory();
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 CtagsTest method setUpClass.
@BeforeAll
public static void setUpClass() throws Exception {
ctags = new Ctags();
repository = new TestRepository();
repository.create(CtagsTest.class.getClassLoader().getResource("sources"));
/*
* 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);
}
use of org.opengrok.indexer.util.TestRepository in project OpenGrok by OpenGrok.
the class JarAnalyzerTest method setUpClass.
@BeforeAll
public static void setUpClass() throws Exception {
env = RuntimeEnvironment.getInstance();
originalProjectsEnabled = env.isProjectsEnabled();
env.setProjectsEnabled(false);
repository = new TestRepository();
repository.createEmpty();
repository.addAdhocFile(TESTPLUGINS_JAR, AuthorizationFrameworkReloadTest.class.getResourceAsStream("/authorization/plugins/" + TESTPLUGINS_JAR), null);
env.setSourceRoot(repository.getSourceRoot());
env.setDataRoot(repository.getDataRoot());
RepositoryFactory.initializeIgnoredNames(env);
env.setHistoryEnabled(false);
IndexChangedListener progress = new DefaultIndexChangedListener();
Indexer.getInstance().prepareIndexer(env, true, true, false, null, null);
env.setDefaultProjectsFromNames(new TreeSet<>(Collections.singletonList("/c")));
Indexer.getInstance().doIndexerExecution(true, null, progress);
configFile = File.createTempFile("configuration", ".xml");
env.writeConfiguration(configFile);
env.readConfiguration(new File(configFile.getAbsolutePath()));
}
use of org.opengrok.indexer.util.TestRepository in project OpenGrok by OpenGrok.
the class PascalAnalyzerFactoryTest method setUpClass.
@BeforeAll
public static void setUpClass() throws Exception {
ctags = new Ctags();
repository = new TestRepository();
repository.create(PascalAnalyzerFactoryTest.class.getClassLoader().getResource("sources"));
PascalAnalyzerFactory analyzerFactory = new PascalAnalyzerFactory();
analyzer = analyzerFactory.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 DiffTest method setUp.
@BeforeAll
static void setUp() throws Exception {
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);
}
Aggregations