Search in sources :

Example 16 with TestRepository

use of org.opensolaris.opengrok.util.TestRepository in project OpenGrok by OpenGrok.

the class TroffAnalyzerTest method setUpBeforeClass.

/**
     * Test method for {@link org.opensolaris.opengrok.analysis.document
     * .TroffAnalyzer#TroffAnalyzer(org.opensolaris.opengrok.analysis.FileAnalyzerFactory)}.
     *
     * @throws java.lang.Exception
     */
@BeforeClass
public static void setUpBeforeClass() throws Exception {
    factory = new TroffAnalyzerFactory();
    assertNotNull(factory);
    analyzer = new TroffAnalyzer(factory);
    assertNotNull(analyzer);
    repository = new TestRepository();
    repository.create(TroffAnalyzerTest.class.getResourceAsStream("/org/opensolaris/opengrok/index/source.zip"));
    String file = System.getProperty("opengrok.test.troff.doc", repository.getSourceRoot() + "/document/foobar.1");
    File f = new File(file);
    if (!(f.canRead() && f.isFile())) {
        fail("troff testfile " + f + " not found");
    }
    CharArrayWriter w = new CharArrayWriter((int) f.length());
    Util.dump(w, f, false);
    content = w.toString();
}
Also used : TestRepository(org.opensolaris.opengrok.util.TestRepository) File(java.io.File) CharArrayWriter(java.io.CharArrayWriter) BeforeClass(org.junit.BeforeClass)

Example 17 with TestRepository

use of org.opensolaris.opengrok.util.TestRepository in project OpenGrok by OpenGrok.

the class JFlexXrefTest method setUpClass.

@BeforeClass
public static void setUpClass() throws Exception {
    ctags = new Ctags();
    ctags.setBinary(RuntimeEnvironment.getInstance().getCtags());
    repository = new TestRepository();
    repository.create(JFlexXrefTest.class.getResourceAsStream("/org/opensolaris/opengrok/index/source.zip"));
}
Also used : TestRepository(org.opensolaris.opengrok.util.TestRepository) BeforeClass(org.junit.BeforeClass)

Example 18 with TestRepository

use of org.opensolaris.opengrok.util.TestRepository in project OpenGrok by OpenGrok.

the class PascalAnalyzerFactoryTest method setUpClass.

@BeforeClass
public static void setUpClass() throws Exception {
    ctags = new Ctags();
    ctags.setBinary(RuntimeEnvironment.getInstance().getCtags());
    repository = new TestRepository();
    repository.create(PascalAnalyzerFactoryTest.class.getResourceAsStream("/org/opensolaris/opengrok/index/source.zip"));
}
Also used : TestRepository(org.opensolaris.opengrok.util.TestRepository) Ctags(org.opensolaris.opengrok.analysis.Ctags) BeforeClass(org.junit.BeforeClass)

Example 19 with TestRepository

use of org.opensolaris.opengrok.util.TestRepository in project OpenGrok by OpenGrok.

the class SearchHelperTest method setUp.

@Before
public void setUp() throws IOException {
    repository = new TestRepository();
    repository.create(IndexerTest.class.getResourceAsStream("source.zip"));
    env = RuntimeEnvironment.getInstance();
    env.setSourceRoot(repository.getSourceRoot());
    env.setDataRoot(repository.getDataRoot());
    env.setVerbose(true);
}
Also used : TestRepository(org.opensolaris.opengrok.util.TestRepository) IndexerTest(org.opensolaris.opengrok.index.IndexerTest) Before(org.junit.Before)

Example 20 with TestRepository

use of org.opensolaris.opengrok.util.TestRepository in project OpenGrok by OpenGrok.

the class IgnoredNamesTest method setUpClass.

@BeforeClass
public static void setUpClass() throws Exception {
    repository = new TestRepository();
    repository.create(CAnalyzerFactoryTest.class.getResourceAsStream("/org/opensolaris/opengrok/index/source.zip"));
}
Also used : TestRepository(org.opensolaris.opengrok.util.TestRepository) CAnalyzerFactoryTest(org.opensolaris.opengrok.analysis.c.CAnalyzerFactoryTest) BeforeClass(org.junit.BeforeClass)

Aggregations

TestRepository (org.opensolaris.opengrok.util.TestRepository)22 BeforeClass (org.junit.BeforeClass)17 Ctags (org.opensolaris.opengrok.analysis.Ctags)6 File (java.io.File)4 Before (org.junit.Before)4 RuntimeEnvironment (org.opensolaris.opengrok.configuration.RuntimeEnvironment)3 HistoryGuru (org.opensolaris.opengrok.history.HistoryGuru)3 IndexerTest (org.opensolaris.opengrok.index.IndexerTest)2 ByteArrayOutputStream (java.io.ByteArrayOutputStream)1 CharArrayWriter (java.io.CharArrayWriter)1 PrintStream (java.io.PrintStream)1 ArrayList (java.util.ArrayList)1 CAnalyzerFactoryTest (org.opensolaris.opengrok.analysis.c.CAnalyzerFactoryTest)1