public abstract class ConnectorTestContext extends SimpleAtomContext implements OperationContext
OperationContext implementation for use with the ConnectorTester junit tests.
All test classes must provide a concrete implementation of this class
| Constructor and Description |
|---|
ConnectorTestContext()
Creates a new context with the default
SimpleAtomConfig and an instance
of the connector specified by the implementing class |
| Modifier and Type | Method and Description |
|---|---|
void |
addConnectionProperty(String key,
Object value)
Method to add a connection property to the context
|
void |
addCookie(ObjectDefinitionRole role,
String cookie)
Method to add a cookie to the context
|
void |
addOperationProperty(String key,
Object value)
Method to add an operation property to the context
|
void |
addSelectableField(String field)
Method to add a selectable field to the context
|
void |
addToCache(Object key,
Object value)
Method to add a key/value pair to the connector cache
|
PayloadMetadata |
createMetadata()
Creates a new payload metadata instance that can be used in an
ExtendedPayload. |
APIVersion |
getAPIVersion()
Get the
APIVersion for the test |
BrowseContext |
getBrowseContext()
Getter for the browse context
|
PropertyMap |
getConnectionProperties()
Returns the relevant connection properties if this connector has the
requireConnectionForBrowse flag enabled in the connector's descriptor. |
Connector |
getConnector()
Returns the connector instance with which this context is associated.
|
ConcurrentMap<Object,Object> |
getConnectorCache()
Returns the current connector cache.
|
protected abstract Class<? extends Connector> |
getConnectorClass()
This method should return the
Class of the connector under test |
String |
getCustomOperationType()
Returns the custom type of the operation that is currently being
configured.
|
String |
getObjectDefinitionCookie(ObjectDefinitionRole role)
Returns an object definition cookie constructed by the object profile retrieval during a browsing request.
|
String |
getObjectTypeId()
Returns the id of the object type for which this operation is being executed.
|
PropertyMap |
getOperationProperties()
Returns any operation properties flagged as
includeInBrowse for the current OperationType in the
connector's descriptor. |
OperationType |
getOperationType()
Returns the currently configured OperationType
|
List<String> |
getSelectedFields()
Returns a field list describing the fields to be retrieved.
|
SSLContext |
getSSLContext(PublicKeyStore publicKeyStore,
PrivateKeyStore privateKeyStore)
TODO CON-601 pull up in 2.1
Returns a
SSLContext. |
boolean |
hasCookie(ObjectDefinitionRole role)
Method to determine if the context contains a cookie for an
ObjectDefinitionRole |
boolean |
isCookieRequired()
This flag indicates whether or not the operation under test
requires that a cookie be added to the connector cache
|
void |
setCookieRequired(boolean cookieRequired)
Setter method for cookie flag
|
void |
setObjectTypeId(String objectTypeId)
Getter for the object type id
|
void |
setOperationCustomType(String customOperationType)
Setter for the operation custom type
|
void |
setOperationType(OperationType operationType)
Setter for the operation type
|
createSSLContext, createTempOutputStream, getConfig, tempOutputStreamToInputStream, tempOutputStreamToPayloadclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitcreateTempOutputStream, getConfig, tempOutputStreamToInputStream, tempOutputStreamToPayloadpublic ConnectorTestContext()
SimpleAtomConfig and an instance
of the connector specified by the implementing classpublic APIVersion getAPIVersion()
APIVersion for the testAPIVersion valuepublic Connector getConnector()
ConnectorContextgetConnector in interface ConnectorContextpublic ConcurrentMap<Object,Object> getConnectorCache()
ConnectorContextgetConnectorCache in interface ConnectorContextpublic OperationType getOperationType()
BrowseContextgetOperationType in interface BrowseContextpublic String getCustomOperationType()
BrowseContextgetCustomOperationType in interface BrowseContextpublic PropertyMap getConnectionProperties()
ConnectorContextrequireConnectionForBrowse flag enabled in the connector's descriptor.getConnectionProperties in interface ConnectorContextpublic PropertyMap getOperationProperties()
BrowseContextincludeInBrowse for the current OperationType in the
connector's descriptor.getOperationProperties in interface BrowseContextpublic String getObjectTypeId()
OperationContextgetObjectTypeId in interface OperationContextpublic String getObjectDefinitionCookie(ObjectDefinitionRole role)
OperationContextgetObjectDefinitionCookie in interface OperationContextrole - the role identifying the profile for which the profile is desirednull if no cookie was stored for the profilepublic List<String> getSelectedFields()
OperationContextnull, indicating that all fields
should be retrievedgetSelectedFields in interface OperationContextpublic PayloadMetadata createMetadata()
PayloadMetadataFactoryExtendedPayload.createMetadata in interface PayloadMetadataFactorypublic SSLContext getSSLContext(PublicKeyStore publicKeyStore, PrivateKeyStore privateKeyStore) throws GeneralSecurityException
BrowseContextSSLContext. Passing null for public and private key stores will make an attempt to
configure it to use trusted JVM and deployed atom certificates if called during an operation execution.getSSLContext in interface BrowseContextGeneralSecurityExceptionpublic BrowseContext getBrowseContext()
public void setOperationType(OperationType operationType)
operationType - the operationType to setpublic void setOperationCustomType(String customOperationType)
customOperationType - the custom operation id to setpublic void setObjectTypeId(String objectTypeId)
objectTypeId - the objectTypeId to setpublic boolean hasCookie(ObjectDefinitionRole role)
ObjectDefinitionRolerole - the role to verifypublic void addCookie(ObjectDefinitionRole role, String cookie)
role - ObjectDefinitionRole associated to the cookiecookie - the cookiepublic void addToCache(Object key, Object value)
key - the key for the entryvalue - the value for the entrypublic void addConnectionProperty(String key, Object value)
key - the key for the propertyvalue - the value for the propertypublic void addOperationProperty(String key, Object value)
key - the key for the propertyvalue - the value for the propertypublic void addSelectableField(String field)
field - the name of the fieldpublic boolean isCookieRequired()
public void setCookieRequired(boolean cookieRequired)
cookieRequired - the cookieRequired to set