@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 ByteBuffersDirectory);
        assertNotNull(index.getQueryAnalyzer());
    }
    finally {
        index.close();
    }
}