@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<String>(), 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);
}