public class PluginCompareBase extends AbstractPluginValue implements INullEmptyFeature, IDatabaseReader
Schema instance, and two databases, this plugin
compare these databases. The database used by the system under test name is '
system' and the reference database is 'reference'.
If some tables are expected to be ignored in comparison provide an instance
of IFilter using PluginFilter.| Modifier and Type | Field and Description |
|---|---|
protected IColumnReader |
columnReader
Recover object from a result set column to be compared against the
specification object.
|
static String |
FEATURE_FILTER
Feature for comparison filter.
|
static String |
FEATURE_REFERENCE
Feature for reference datasource name.
|
static String |
FEATURE_SCHEMA
Feature for schema name.
|
static String |
FEATURE_SYSTEM
Feature for system datasource name.
|
static String |
FEATURE_VIRTUAL
Feature for virtual keys usage.
|
protected INullEmptyHandler |
nullEmptyHandler
A null/empty handler.
|
eval, valuescopenameFEATURE_CONDITION, FEATURE_NORMALIZED, FEATURE_NORMALIZER, FEATURE_SLEEP, FEATURE_THREADSAFE, FEATURE_TIMEOUT, FEATURE_WAITparametersFEATURE_NULL_EMPTY_HANDLERFEATURE_COLUMN_READER| Constructor and Description |
|---|
PluginCompareBase() |
| Modifier and Type | Method and Description |
|---|---|
String |
createTableSelect(Schema schema,
Table table)
Creates the SQL to be used by comparison algorithm.
|
ENext |
doStart(IContext context,
IResultSet result) |
ActionType |
getActionType() |
IColumnReader |
getColumnReader()
Column reader resource.
|
IResultEnumerator |
getEnumerator(Table table,
ResultSet rsExpected,
ResultSet rsReceived)
Abstraction of enumeration.
|
String |
getFilter()
Get the filter name.
|
INullEmptyHandler |
getNullEmptyHandler()
Get handler.
|
String |
getReference()
Get the reference database name.
|
String |
getSchema()
Get the schema name.
|
String |
getSystem()
Get the system database name.
|
Boolean |
getVirtual()
Indicate if reference fields can be used for select construction.
|
void |
initialize(IContext context) |
void |
populateTableReport(Schema schema,
IDataFilter dataFilter,
SchemaReport report,
Table table,
ResultSet rsExpected,
ResultSet rsReceived)
Populate schema report.
|
void |
setColumnReader(IColumnReader columnReader)
Set a column reader.
|
void |
setFilter(String filter)
Set the filter name.
|
void |
setNullEmptyHandler(INullEmptyHandler nullEmptyHandler) |
void |
setReference(String reference)
Set the reference database name.
|
void |
setSchema(String schema)
Set the schema name.
|
void |
setSystem(String system)
Set the system database name.
|
void |
setVirtual(Boolean virtual)
Set the virtual flag.
|
getValue, getValue, isEval, setEval, setValuegetScope, saveGlobal, saveLocal, saveStrict, setScopegetName, setNamecopy, doEnd, getCondition, getConditionModel, getNormalized, getNormalized, getNormalizer, getParent, getSleep, getSleepModel, getThreadsafe, getTimeout, getTimeoutModel, getWait, getWaitModel, setCondition, setConditionModel, setNormalized, setNormalizer, setParent, setSleep, setSleepModel, setThreadsafe, setTimeout, setTimeoutModel, setWait, setWaitModel, toStringgetParameters, setParametersclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitgetParameters, setParameterspublic static final String FEATURE_SCHEMA
public static final String FEATURE_SYSTEM
public static final String FEATURE_REFERENCE
public static final String FEATURE_FILTER
protected INullEmptyHandler nullEmptyHandler
protected IColumnReader columnReader
public static final String FEATURE_VIRTUAL
public String getSchema()
public void setSchema(String schema)
schema - The name.public String getSystem()
public void setSystem(String system)
system - The database name.public String getReference()
public void setReference(String reference)
reference - The reference.public String getFilter()
public void setFilter(String filter)
filter - Name.public INullEmptyHandler getNullEmptyHandler()
public void setNullEmptyHandler(INullEmptyHandler nullEmptyHandler)
setNullEmptyHandler in interface INullEmptyFeaturepublic IColumnReader getColumnReader()
public void setColumnReader(IColumnReader columnReader)
IDatabaseReadersetColumnReader in interface IDatabaseReadercolumnReader - A reader.public Boolean getVirtual()
public void setVirtual(Boolean virtual)
virtual - The flag.public ActionType getActionType()
getActionType in interface IActionTypepublic void initialize(IContext context) throws PluginException
initialize in interface IPlugininitialize in class AbstractPluginPluginExceptionpublic ENext doStart(IContext context, IResultSet result) throws PluginException
doStart in interface IPlugindoStart in class AbstractPluginPluginExceptionpublic String createTableSelect(Schema schema, Table table)
schema - The schema.table - The table.public void populateTableReport(Schema schema, IDataFilter dataFilter, SchemaReport report, Table table, ResultSet rsExpected, ResultSet rsReceived) throws SQLException
schema - The schema object.dataFilter - The filter object.report - The report.table - The current table under analysis.rsExpected - The result set of reference database.rsReceived - The result set of system database.SQLException - On comparison errors.public IResultEnumerator getEnumerator(Table table, ResultSet rsExpected, ResultSet rsReceived)
table - The table source of result sets.rsExpected - The result from querying reference database.rsReceived - The result from querying system database.Copyright © 2017. All rights reserved.