use of org.apache.jena.query.text.TextIndexLucene in project jena by apache.
the class TestTextIndexLuceneAssembler method testResourceDirectory.
@Test
public void testResourceDirectory() {
TextIndexLuceneAssembler assembler = new TextIndexLuceneAssembler();
Resource root = SIMPLE_INDEX_SPEC2;
Assembler a = Assembler.general;
// the open method is not supposed to throw exceptions when the directory is
// a resource
TextIndexLucene index = (TextIndexLucene) assembler.open(a, root, /*mode*/
null);
try {
assertFalse(index.getDirectory() instanceof RAMDirectory);
assertNotNull(index.getQueryAnalyzer());
} finally {
index.close();
}
}
use of org.apache.jena.query.text.TextIndexLucene in project jena by apache.
the class TestTextIndexLuceneAssembler method testLiteralDirectory.
@Test
public void testLiteralDirectory() {
TextIndexLuceneAssembler assembler = new TextIndexLuceneAssembler();
Resource root = SIMPLE_INDEX_SPEC_LITERAL_DIR;
Assembler a = Assembler.general;
// the open method is not supposed to throw exceptions when the directory is
// a literal
TextIndexLucene index = (TextIndexLucene) assembler.open(a, root, /*mode*/
null);
try {
assertNotNull(index);
} finally {
index.close();
}
}
use of org.apache.jena.query.text.TextIndexLucene in project jena by apache.
the class TestTextIndexLuceneAssembler method testMemDirectory.
@Test
public void testMemDirectory() {
TextIndexLuceneAssembler assembler = new TextIndexLuceneAssembler();
Resource root = SIMPLE_INDEX_SPEC_MEM_DIR;
Assembler a = Assembler.general;
// the open method is not supposed to throw exceptions when the directory is
// a iri resource
TextIndexLucene index = (TextIndexLucene) assembler.open(a, root, /*mode*/
null);
try {
assertTrue(index.getDirectory() instanceof RAMDirectory);
} finally {
index.close();
}
}
Aggregations