use of org.opensolaris.opengrok.util.TestRepository in project OpenGrok by OpenGrok.
the class IndexerRepoTest method setUp.
@Before
public void setUp() throws IOException {
repository = new TestRepository();
// For these tests we need Mercurial repository with renamed files.
repository.create(HistoryGuru.class.getResourceAsStream("repositories.zip"));
}
use of org.opensolaris.opengrok.util.TestRepository in project OpenGrok by OpenGrok.
the class HistoryContextTest method setUpClass.
@BeforeClass
public static void setUpClass() throws Exception {
repositories = new TestRepository();
repositories.create(HistoryContextTest.class.getResourceAsStream("/org/opensolaris/opengrok/history/repositories.zip"));
HistoryGuru.getInstance().addRepositories(repositories.getSourceRoot());
}
use of org.opensolaris.opengrok.util.TestRepository in project OpenGrok by OpenGrok.
the class PageConfigTest method setUpClass.
@BeforeClass
public static void setUpClass() throws Exception {
repository = new TestRepository();
repository.create(HistoryGuru.class.getResourceAsStream("repositories.zip"));
HistoryGuru.getInstance().addRepositories(repository.getSourceRoot());
}
use of org.opensolaris.opengrok.util.TestRepository in project OpenGrok by OpenGrok.
the class SearchEngineTest method setUpClass.
@BeforeClass
public static void setUpClass() throws Exception {
repository = new TestRepository();
repository.create(HistoryGuru.class.getResourceAsStream("repositories.zip"));
RuntimeEnvironment env = RuntimeEnvironment.getInstance();
env.setCtags(System.getProperty("org.opensolaris.opengrok.analysis.Ctags", "ctags"));
env.setSourceRoot(repository.getSourceRoot());
env.setDataRoot(repository.getDataRoot());
if (env.validateExuberantCtags()) {
env.setSourceRoot(repository.getSourceRoot());
env.setDataRoot(repository.getDataRoot());
env.setVerbose(false);
Indexer.getInstance().prepareIndexer(env, true, true, "/c", null, false, false, false, null, null, new ArrayList<>(), false);
Indexer.getInstance().doIndexerExecution(true, 1, null, null);
} else {
System.out.println("Skipping test. Could not find a ctags I could use in path.");
skip = true;
}
configFile = File.createTempFile("configuration", ".xml");
env.writeConfiguration(configFile);
RuntimeEnvironment.getInstance().readConfiguration(new File(configFile.getAbsolutePath()));
}
use of org.opensolaris.opengrok.util.TestRepository in project OpenGrok by OpenGrok.
the class SearchTest method setUpClass.
@BeforeClass
public static void setUpClass() throws Exception {
repository = new TestRepository();
repository.create(IndexerTest.class.getResourceAsStream("source.zip"));
RuntimeEnvironment env = RuntimeEnvironment.getInstance();
env.setCtags(System.getProperty("org.opensolaris.opengrok.analysis.Ctags", "ctags"));
env.setSourceRoot(repository.getSourceRoot());
env.setDataRoot(repository.getDataRoot());
if (env.validateExuberantCtags()) {
env.setSourceRoot(repository.getSourceRoot());
env.setDataRoot(repository.getDataRoot());
env.setVerbose(false);
Indexer.getInstance().prepareIndexer(env, true, true, "/c", null, false, false, false, null, null, new ArrayList<>(), false);
Indexer.getInstance().doIndexerExecution(true, 1, null, null);
} else {
System.out.println("Skipping test. Could not find a ctags I could use in path.");
skip = true;
}
configFile = File.createTempFile("configuration", ".xml");
env.writeConfiguration(configFile);
RuntimeEnvironment.getInstance().readConfiguration(new File(configFile.getAbsolutePath()));
PrintStream stream = new PrintStream(new ByteArrayOutputStream());
System.setErr(stream);
}
Aggregations