Search in sources :

Example 1 with IndexChangedListener

use of org.opengrok.indexer.index.IndexChangedListener 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()));
}
Also used : TestRepository(org.opengrok.indexer.util.TestRepository) IndexChangedListener(org.opengrok.indexer.index.IndexChangedListener) DefaultIndexChangedListener(org.opengrok.indexer.index.DefaultIndexChangedListener) DefaultIndexChangedListener(org.opengrok.indexer.index.DefaultIndexChangedListener) AuthorizationFrameworkReloadTest(org.opengrok.indexer.authorization.AuthorizationFrameworkReloadTest) File(java.io.File) BeforeAll(org.junit.jupiter.api.BeforeAll)

Aggregations

File (java.io.File)1 BeforeAll (org.junit.jupiter.api.BeforeAll)1 AuthorizationFrameworkReloadTest (org.opengrok.indexer.authorization.AuthorizationFrameworkReloadTest)1 DefaultIndexChangedListener (org.opengrok.indexer.index.DefaultIndexChangedListener)1 IndexChangedListener (org.opengrok.indexer.index.IndexChangedListener)1 TestRepository (org.opengrok.indexer.util.TestRepository)1