Search in sources :

Example 1 with NodeStateResourceLoader

use of org.apache.jackrabbit.oak.plugins.index.lucene.NodeStateAnalyzerFactory.NodeStateResourceLoader in project jackrabbit-oak by apache.

the class NodeStateAnalyzerFactoryTest method nodeStateResourceLoader.

@Test
public void nodeStateResourceLoader() throws Exception {
    byte[] testData = "hello".getBytes();
    NodeBuilder nb = EMPTY_NODE.builder();
    createFileNode(nb, "foo", testData);
    NodeStateResourceLoader loader = new NodeStateResourceLoader(nb.getNodeState(), new ClasspathResourceLoader());
    assertArrayEquals(testData, IOUtils.toByteArray(loader.openResource("foo")));
}
Also used : NodeStateResourceLoader(org.apache.jackrabbit.oak.plugins.index.lucene.NodeStateAnalyzerFactory.NodeStateResourceLoader) ClasspathResourceLoader(org.apache.lucene.analysis.util.ClasspathResourceLoader) NodeBuilder(org.apache.jackrabbit.oak.spi.state.NodeBuilder) Test(org.junit.Test)

Aggregations

NodeStateResourceLoader (org.apache.jackrabbit.oak.plugins.index.lucene.NodeStateAnalyzerFactory.NodeStateResourceLoader)1 NodeBuilder (org.apache.jackrabbit.oak.spi.state.NodeBuilder)1 ClasspathResourceLoader (org.apache.lucene.analysis.util.ClasspathResourceLoader)1 Test (org.junit.Test)1