public class DataCorrelationUtil extends Object implements com.ibm.rational.test.lt.testeditor.main.LoadTestLoggingConstants
| Modifier and Type | Field and Description |
|---|---|
static String |
ORIGINAL_REGEX_KEY |
prefix_RPTN, RPTNE0001_INIT_ERROR, RPTNE0002_INTERNAL_ERROR, RPTNE0003_CREATE_DATAPOOL, RPTNE0004_EXTENSION_ERROR, RPTNE0005_MARKER_NOT_FOUND, RPTNE0017_CREATE_REFERENCE, RPTNE0020_CREATE_DATAPOOL_SUBST, RPTNE0040_OPEN_FILE, RPTNE0050_DISPLAY_RULES_FAILED, RPTNI0009_COLUMNS_REFRESHED, RPTNW0006_DC_ERROR, RPTNW0007_DATAPOOL_REMOVED, RPTNW0008_COLUMNS_REMOVED, RPTNW0016_CREATE_REFERENCE| Constructor and Description |
|---|
DataCorrelationUtil() |
| Modifier and Type | Method and Description |
|---|---|
static void |
addDcOwnershipResolver(com.ibm.rational.test.lt.testeditor.dc.IDcOwnershipResolver resolver)
This method should be used to store datacorrelation resolvers.
|
static void |
addFileContentsSubstitutionField(String fieldName,
boolean onlyFileContents)
Registers the field (identified by name) as supporting File Contents Substituter.
|
static com.ibm.rational.test.common.models.behavior.cbdata.CorrelationHarvester |
createCorrelationHarvester(IDCStringLocator sl,
LoadTestEditor editor)
Creates CorrelationHarvester.
|
static com.ibm.rational.test.common.models.behavior.cbdata.Substituter |
createSubstituter(IDCStringLocator strLoc,
com.ibm.rational.test.common.models.behavior.cbdata.DataSource ds,
LoadTestEditor editor)
Creates Substituter.
|
static Button |
displayLinkWithDSVOption(com.ibm.rational.common.test.editor.framework.kernel.util.LoadTestWidgetFactory factory,
Composite parent,
int cols) |
static HashMap<String,Object> |
getAttributeDisplayNames() |
static String |
getDatasourceCategory(com.ibm.rational.test.common.models.behavior.cbdata.DataSource ds)
Return
ICategoriesIDs constant for a given DataSource |
static int |
getDcSize(CBActionElement element) |
static String |
getErrorMessage() |
static List |
getHarvestersFor(com.ibm.rational.test.common.models.behavior.cbdata.DataSourceHost host,
String attrName,
Comparator comparator)
Returns list of harvesters for the given
host. |
static List |
getHarvestersFor(com.ibm.rational.test.common.models.behavior.cbdata.DataSourceHost host,
String attrName,
Comparator comparator,
IProgressMonitor monitor) |
static String |
getLabelForAttribute(String name)
Returns display name for a given datacorrelation attribute.
|
static List |
getSubstitutersFor(com.ibm.rational.test.common.models.behavior.cbdata.SubstituterHost host,
String attrName,
Comparator comparator)
Returns list of
Substituter objects. |
static List |
getSubstitutersFor(com.ibm.rational.test.common.models.behavior.cbdata.SubstituterHost host,
String attrName,
Comparator comparator,
IProgressMonitor monitor) |
static boolean |
isFixedDataSource(com.ibm.rational.test.common.models.behavior.cbdata.DataSource ds)
Returns whether the specified data source is fixed in the test, i.e. it
can be consumed from anywhere in the test.
|
static boolean |
isReadOnly(com.ibm.rational.test.common.models.behavior.cbdata.CoreHarvester ch,
String feature) |
static boolean |
isShowMoreSubstitutionOptions() |
static boolean |
okToRemove(com.ibm.rational.test.common.models.behavior.cbdata.Arbitrary a,
LoadTestEditor editor) |
static boolean |
okToRemove(com.ibm.rational.test.common.models.behavior.cbdata.DataSource ds,
LoadTestEditor editor) |
static boolean |
okToRemove(com.ibm.rational.test.lt.testeditor.common.LTTextStructuredSelection s,
LoadTestEditor editor)
Deprecated.
|
static boolean |
okToRemove(com.ibm.rational.test.common.models.behavior.cbdata.Substituter su,
LoadTestEditor editor) |
protected static IDCStringLocator |
promptForHarvesterType(List list,
IDCStringLocator sl) |
static boolean |
promptToRemove(Datapool datapool,
LoadTestEditor editor) |
static boolean |
promptToRemove(com.ibm.rational.test.common.models.behavior.cbdata.DataSource ds,
LoadTestEditor editor) |
static boolean |
promptToRemove(List dataSourcesLIst,
LoadTestEditor editor) |
static boolean |
promptToRemove(com.ibm.rational.test.lt.testeditor.common.LTTextStructuredSelection sel,
LoadTestEditor editor) |
static boolean |
promptToRemove(com.ibm.rational.test.common.models.behavior.cbdata.Substituter su,
LoadTestEditor editor) |
static com.ibm.rational.test.common.models.behavior.cbdata.Substituter |
replaceDataSource(com.ibm.rational.test.common.models.behavior.cbdata.Substituter subst,
com.ibm.rational.test.common.models.behavior.cbdata.DataSource ds)
|
static com.ibm.rational.test.common.models.behavior.cbdata.Substituter |
replaceDataSource(com.ibm.rational.test.common.models.behavior.cbdata.Substituter subst,
com.ibm.rational.test.common.models.behavior.cbdata.DataSource ds,
com.ibm.rational.test.common.models.behavior.cbdata.DataSource _oldDs)
Replaces DataSource in the given Substituter.
|
static void |
replaceSubstitutersInMatches(com.ibm.rational.test.common.models.behavior.cbdata.Substituter oldSub,
com.ibm.rational.test.common.models.behavior.cbdata.Substituter newSub) |
static CBActionElement |
resolveDcOwnership(com.ibm.rational.test.common.models.behavior.cbdata.CoreHarvester ch)
Finds
IDcWonershipResolver based on the argument DataSource. |
static CBActionElement |
resolveDcOwnership(String attribute,
CBActionElement action) |
static CBActionElement |
resolveDcOwnership(com.ibm.rational.test.common.models.behavior.cbdata.Substituter substituter)
Finds
IDcWonershipResolver based on the argument DataSource. |
static void |
setErrorMessage(String errorMessage) |
static void |
setLabelForAttribute(String name,
com.ibm.rational.test.lt.testeditor.dc.DataCorrelationLabelProvider.LabelFormatter formatter)
Stores a human-readable
LabelFormatter for a given attribute name. |
static void |
setLabelForAttribute(String name,
String displayName)
Stores a human-readable display name for a given attribute name.
|
static void |
setShowMoreSubstitutionOptions(boolean b) |
static void |
showLinkWithDSVMessage(Shell shell,
LoadTestEditor editor,
com.ibm.rational.test.lt.testeditor.views.ISubstitutionTargetProvider targetProvider)
Enables link with Data Sources View.
|
static Boolean |
supportsFileContentsSubstitution(String fieldName)
Checks if the field identified by supplied fieldName supports FileContents Substituters.
|
public static final String ORIGINAL_REGEX_KEY
public static com.ibm.rational.test.common.models.behavior.cbdata.CorrelationHarvester createCorrelationHarvester(IDCStringLocator sl, LoadTestEditor editor) throws com.ibm.rational.test.lt.datacorrelation.testgen.DCException
This method is called from ExtendedStyledText in response of user's selecting of various menu options.
This method collects available datacorrelation provider that are capable of creating Harvester for selected text.
If more than one handler is found, the method presents a dialog box with selection.
sl - IDCStringLocator description of the selected text.editor - LoadTestEditornull.com.ibm.rational.test.lt.datacorrelation.testgen.DCExceptionDataCorrelatorprotected static IDCStringLocator promptForHarvesterType(List list, IDCStringLocator sl)
list - public static String getErrorMessage()
public static void setErrorMessage(String errorMessage)
errorMessage - The errorMessage to set.public static com.ibm.rational.test.common.models.behavior.cbdata.Substituter replaceDataSource(com.ibm.rational.test.common.models.behavior.cbdata.Substituter subst,
com.ibm.rational.test.common.models.behavior.cbdata.DataSource ds,
com.ibm.rational.test.common.models.behavior.cbdata.DataSource _oldDs)
BuiltInDataSource.subst - Substituter. Substituter in which the DataSource needs to be replaced, or set.ds - DataSource to correlate with._oldDs - previous data source, if anypublic static com.ibm.rational.test.common.models.behavior.cbdata.Substituter replaceDataSource(com.ibm.rational.test.common.models.behavior.cbdata.Substituter subst,
com.ibm.rational.test.common.models.behavior.cbdata.DataSource ds)
BuiltInDataSource.subst - Substituter. Substituter in which the DataSource needs to be replaced, or set.ds - DataSource to correlate with.public static com.ibm.rational.test.common.models.behavior.cbdata.Substituter createSubstituter(IDCStringLocator strLoc, com.ibm.rational.test.common.models.behavior.cbdata.DataSource ds, LoadTestEditor editor) throws com.ibm.rational.test.lt.datacorrelation.testgen.DCException
This method is called from ExtendedStyledText in response of user's selecting of various menu options.
This method collects available datacorrelation providers that are capable of creating Substituters
for selected text.
If more than one handler is found, the method presents a dialog box with selection.
strLoc - IDCStringLocator description of the selected text.ds - DataSource to use for substitution.editor - LoadTestEditornull.com.ibm.rational.test.lt.datacorrelation.testgen.DCExceptionDataCorrelatorpublic static boolean okToRemove(com.ibm.rational.test.common.models.behavior.cbdata.DataSource ds,
LoadTestEditor editor)
ds - editor - public static boolean promptToRemove(com.ibm.rational.test.common.models.behavior.cbdata.DataSource ds,
LoadTestEditor editor)
ds - editor - public static boolean promptToRemove(com.ibm.rational.test.lt.testeditor.common.LTTextStructuredSelection sel,
LoadTestEditor editor)
ds - editor - public static boolean promptToRemove(List dataSourcesLIst, LoadTestEditor editor)
ds - editor - public static boolean okToRemove(com.ibm.rational.test.common.models.behavior.cbdata.Arbitrary a,
LoadTestEditor editor)
a - Arbitraryeditor - LoadTestEditorpublic static boolean okToRemove(com.ibm.rational.test.common.models.behavior.cbdata.Substituter su,
LoadTestEditor editor)
su - editor - public static boolean promptToRemove(com.ibm.rational.test.common.models.behavior.cbdata.Substituter su,
LoadTestEditor editor)
su - editor - public static String getLabelForAttribute(String name)
DataCorrelationLabelProvider#setLabelForAttribute(String, LabelFormatter) or
DataCorrelationLabelProvider#setLabelForAttribute(String, String).name - String attribute namepublic static void setLabelForAttribute(String name, String displayName)
name - String Attribute name.displayName - Display NameExtendedStyledTextpublic static void setLabelForAttribute(String name, com.ibm.rational.test.lt.testeditor.dc.DataCorrelationLabelProvider.LabelFormatter formatter)
LabelFormatter for a given attribute name. Protocol extension plugin must
register its attribute names/display names if it supports datacorrelation/datapooling. LabelFormatter is responsible
for formatting and returning correct display name for a given attribute namename - String Datacorrelation Attribute Name.formatter - Class implementing DataCorrelationLabelProvider.LabelFormatterExtendedStyledText,
DataCorrelationLabelProvider.LabelFormatterpublic static HashMap<String,Object> getAttributeDisplayNames()
public static void addDcOwnershipResolver(com.ibm.rational.test.lt.testeditor.dc.IDcOwnershipResolver resolver)
IDcOwnershipResolver
returns real parent of DataSource or Substituter based on the
attribute name.resolver - IDcOwnershipResolver, must not be null.public static CBActionElement resolveDcOwnership(com.ibm.rational.test.common.models.behavior.cbdata.CoreHarvester ch)
IDcWonershipResolver based on the argument DataSource.ch - CorrelationHarvesterpublic static CBActionElement resolveDcOwnership(com.ibm.rational.test.common.models.behavior.cbdata.Substituter substituter)
IDcWonershipResolver based on the argument DataSource.substituter - Substituterpublic static CBActionElement resolveDcOwnership(String attribute, CBActionElement action)
public static List getSubstitutersFor(com.ibm.rational.test.common.models.behavior.cbdata.SubstituterHost host, String attrName, Comparator comparator, IProgressMonitor monitor)
public static List getSubstitutersFor(com.ibm.rational.test.common.models.behavior.cbdata.SubstituterHost host, String attrName, Comparator comparator)
Substituter objects. The list contains only substituters
that with a given attributeName. In addition, the comparator is used to further
filter the list.host - SubstituterHost host.attrName - String. Attribute namecomparator - Comparator. This can be either a class that implements Comparator directly
or an instance of DefaultAttributeMatcher.public static List getHarvestersFor(com.ibm.rational.test.common.models.behavior.cbdata.DataSourceHost host, String attrName, Comparator comparator, IProgressMonitor monitor)
public static List getHarvestersFor(com.ibm.rational.test.common.models.behavior.cbdata.DataSourceHost host, String attrName, Comparator comparator)
host. The list contains only harvesters
with a given attributeName. In addition, the comparator is used to further
filter the list.host - DataSourceHost host.attrName - String. Attribute namecomparator - Comparator. This can be either a class that implements Comparator directly
or an instance of DefaultAttributeMatcher.public static boolean promptToRemove(Datapool datapool, LoadTestEditor editor)
@Deprecated public static boolean okToRemove(com.ibm.rational.test.lt.testeditor.common.LTTextStructuredSelection s, LoadTestEditor editor)
public static Button displayLinkWithDSVOption(com.ibm.rational.common.test.editor.framework.kernel.util.LoadTestWidgetFactory factory, Composite parent, int cols)
public static void showLinkWithDSVMessage(Shell shell, LoadTestEditor editor, com.ibm.rational.test.lt.testeditor.views.ISubstitutionTargetProvider targetProvider)
LoadTestEditorPlugin.isAutoLinkWithDsv(). When this value is true,
the UI is expected to update the Test Data Sources View with substitutable locations where appropriate (by using ISubstitutionTargetProvider.shell - Shell for any popup dialogs that may be displayed by this method.editor - LoadTestEditor the editor. If not null the Data Source View will be displayed.targetProvider - ISubstitutionTargetProvider. If not null, the Data Sources View will display this targetISubstitutionTargetProvider,
LoadTestEditorPlugin.isAutoLinkWithDsv(),
LoadTestEditorPlugin.setAutoLinkWithDsv(boolean),
ShowDataSourceViewActionpublic static Boolean supportsFileContentsSubstitution(String fieldName)
fieldName - Stringnull if not supported. Otherwise, the value of the returned Boolean is true
if this field supports file contents substitution only, or false if both types.ToggleFileSubstitutionAction,
DataCorrelationUtil.addFileContentsSubstitutionField(String, boolean)public static void addFileContentsSubstitutionField(String fieldName, boolean onlyFileContents)
DataCorrelatingTextAttrField.getAttributeName().NOTE: The use case where the same field can have both file contents and regular substitution, based on some external criteria is not supported. For example, HTTP POST data chunks, if binary, can have only file contents substitution, and, if text, both types.
fieldName - String field Name.onlyFileContents - boolean. If true then the field supports file contents substitution only, if
false both regular and file contents substitution types are supported in this field.ToggleFileSubstitutionAction,
DataCorrelationUtil.addFileContentsSubstitutionField(String, boolean)public static int getDcSize(CBActionElement element)
element - CBActionElement. Expected to be instance of DataSourceHost and/or SubstituterHostDataSource (if the element is DataSourceHost) and/or Substituter (if the
element is SubstituterHost)public static String getDatasourceCategory(com.ibm.rational.test.common.models.behavior.cbdata.DataSource ds)
ICategoriesIDs constant for a given DataSourceds - DataSourcenull if ds is unknown type.public static boolean isReadOnly(com.ibm.rational.test.common.models.behavior.cbdata.CoreHarvester ch,
String feature)
public static boolean isShowMoreSubstitutionOptions()
public static void setShowMoreSubstitutionOptions(boolean b)
public static void replaceSubstitutersInMatches(com.ibm.rational.test.common.models.behavior.cbdata.Substituter oldSub,
com.ibm.rational.test.common.models.behavior.cbdata.Substituter newSub)
public static boolean isFixedDataSource(com.ibm.rational.test.common.models.behavior.cbdata.DataSource ds)
ds - © Copyright IBM Corp. 2013. All rights reserved.