public class LuceneSupportTest extends BaseJDBCTestCase
Basic test of the optional tool which provides Lucene indexing of columns in Derby tables.
| Modifier and Type | Class and Description |
|---|---|
private static class |
LuceneSupportTest.AbstractTokenizer
Common logic for XMLTextTokenizer and XMLTagsTokenizer.
|
static class |
LuceneSupportTest.MultiFieldIndexDescriptor |
static class |
LuceneSupportTest.XMLAnalyzer
Custom analyzer for XML files.
|
private static class |
LuceneSupportTest.XMLTagsTokenizer |
private static class |
LuceneSupportTest.XMLTextTokenizer |
| Modifier and Type | Field and Description |
|---|---|
private static java.lang.String |
ILLEGAL_CHARACTER |
DEFAULT_DB_DIR, DERBY_LOG, ERRORSTACKTRACEFILE| Constructor and Description |
|---|
LuceneSupportTest(java.lang.String name) |
| Modifier and Type | Method and Description |
|---|---|
static org.apache.lucene.queryparser.classic.QueryParser |
createXMLQueryParser(org.apache.lucene.util.Version version,
java.lang.String[] fields,
org.apache.lucene.analysis.Analyzer analyzer)
Create a simple query parser for multiple fields, which uses
StandardAnalyzer instead of the XMLAnalyzer that was used to create
the index.
|
private static void |
getAllText(org.w3c.dom.Node node,
java.lang.StringBuilder sb)
Strip out all tags from an XML node, so that only the text is left.
|
private static java.util.List<java.lang.String> |
getAllXMLTags(org.w3c.dom.Node node)
Get a list of all the XML tags in a node.
|
static org.apache.derby.optional.api.LuceneIndexDescriptor |
makeMultiFieldIndexDescriptor()
Create the custom index descriptor for the multi-field test
|
private static org.w3c.dom.Document |
parseXMLDocument(java.io.Reader reader)
Parse an XML document from a Reader.
|
protected void |
setUp() |
static junit.framework.Test |
suite() |
protected void |
tearDown()
Tear down this fixture, sub-classes should call
super.tearDown().
|
void |
testCreateAndQueryIndex() |
void |
testDropIndexBadCharacters() |
void |
testListIndex() |
void |
testMultipleFields() |
void |
testUpdateIndex() |
assertCallError, assertCheckTable, assertCommitError, assertCompileError, assertEquals, assertEquals, assertEquals, assertEquivalentDataType, assertErrorCode, assertGetIntError, assertNextError, assertPreparedStatementError, assertResults, assertResults, assertSQLExceptionEquals, assertSQLState, assertSQLState, assertStatementError, assertStatementError, assertStatementError, assertStatementError, assertStatementErrorUnordered, assertTableRowCount, assertUpdateCount, assertUpdateCount, assertWarning, chattyPrepare, chattyPrepareCall, checkAllConsistency, checkEstimatedRowCount, closeStatement, commit, createStatement, createStatement, createStatement, dropTable, dropTable, dropView, dropView, dumpRs, dumpRs, emptyStatementCache, executeQuery, expectCompilationError, expectCompilationError, expectExecutionError, getClientTransactionID, getConnection, getDatabaseProperty, getLastSQLException, goodStatement, goodUpdate, initializeConnection, openConnection, openDefaultConnection, openDefaultConnection, openDefaultConnection, openUserConnection, prepareCall, prepareCall, prepareCall, prepareStatement, prepareStatement, prepareStatement, prepareStatement, prepareStatement, prepareStatement, rollback, runBare, runBareOverridable, runScript, runScript, runSQLCommands, setAutoCommit, usingDB2Client, usingDerbyNetClient, usingEmbeddedalarm, assertDirectoryDeleted, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertExecJavaCmdAsExpected, assertLaunchedJUnitTestMethod, assertLaunchedJUnitTestMethod, assertSameNullness, assertSecurityManager, assertThrowableEquals, currentDirectory, execJavaCmd, execJavaCmd, execJavaCmd, fail, getClassVersionMajor, getEmmaJar, getFailureFolder, getFilesWith, getJavaExecutableName, getSystemProperty, getTestConfiguration, getTestResource, hasInterruptibleIO, isCVM, isIBMJVM, isJ9Platform, isJava5, isJava7, isJava8, isPhoneME, isPlatform, isSunJVM, isWindowsPlatform, newAssertionFailedError, openTestResource, println, printStackTrace, readProcessOutput, removeDirectory, removeDirectory, removeFiles, removeSystemProperty, runsWithEmma, runsWithJaCoCo, setSystemErr, setSystemOut, setSystemProperty, sleep, sleepAtLeastOneTick, traceit, vmAtLeastassertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertFalse, assertFalse, assertNotNull, assertNotNull, assertNotSame, assertNotSame, assertNull, assertNull, assertSame, assertSame, assertTrue, assertTrue, countTestCases, createResult, fail, fail, failNotEquals, failNotSame, failSame, format, getName, run, run, runTest, setName, toStringprivate static final java.lang.String ILLEGAL_CHARACTER
public static junit.framework.Test suite()
public void testCreateAndQueryIndex()
throws java.lang.Exception
java.lang.Exceptionpublic void testUpdateIndex()
throws java.lang.Exception
java.lang.Exceptionpublic void testListIndex()
throws java.lang.Exception
java.lang.Exceptionpublic void testDropIndexBadCharacters()
throws java.lang.Exception
java.lang.Exceptionpublic void testMultipleFields()
throws java.sql.SQLException
java.sql.SQLExceptionpublic static org.apache.derby.optional.api.LuceneIndexDescriptor makeMultiFieldIndexDescriptor()
public static org.apache.lucene.queryparser.classic.QueryParser createXMLQueryParser(org.apache.lucene.util.Version version,
java.lang.String[] fields,
org.apache.lucene.analysis.Analyzer analyzer)
private static org.w3c.dom.Document parseXMLDocument(java.io.Reader reader)
private static java.util.List<java.lang.String> getAllXMLTags(org.w3c.dom.Node node)
private static void getAllText(org.w3c.dom.Node node,
java.lang.StringBuilder sb)
protected void setUp()
throws java.sql.SQLException
setUp in class junit.framework.TestCasejava.sql.SQLExceptionprotected void tearDown()
throws java.lang.Exception
BaseJDBCTestCasetearDown in class BaseJDBCTestCasejava.lang.ExceptionApache Derby V10.14 Internals - Copyright © 2004,2018 The Apache Software Foundation. All Rights Reserved.