public class ConnectorTester extends Object
Typically, one would configure this tester with the relevant connector and the necessary context objects and then run one or more of the test methods.
Constructor and Description |
---|
ConnectorTester()
Creates a new ConnectorTester with a default AtomConfig.
|
ConnectorTester(Connector connector)
Creates a new ConnectorTester for the given connector with a default AtomConfig.
|
ConnectorTester(Connector connector,
APIVersion apiVersion)
Creates a new ConnectorTester for the given connector with a default AtomConfig and the provided API version.
|
Modifier and Type | Method and Description |
---|---|
String |
browseProfiles(String objTypeId)
Browses for object type profiles.
|
String |
browseTypes()
Browses for object types.
|
List<SimpleOperationResult> |
executeCreateOperation(List<InputStream> inputs)
Executes an CREATE operation.
|
List<SimpleOperationResult> |
executeCreateOperationWithTrackedData(List<SimpleTrackedData> inputs)
Executes an CREATE operation.
|
List<SimpleOperationResult> |
executeDeleteOperation(List<String> objectIds)
Executes a DELETE operation.
|
List<SimpleOperationResult> |
executeDeleteOperationWithTrackedData(List<SimpleTrackedData> inputs)
Executes a DELETE operation.
|
List<SimpleOperationResult> |
executeExecuteOperation(List<InputStream> inputs)
Executes an EXECUTE operation.
|
List<SimpleOperationResult> |
executeExecuteOperationWithTrackedData(List<SimpleTrackedData> inputs)
Executes an EXECUTE operation.
|
List<SimpleOperationResult> |
executeGetOperation(String objectId)
Executes a GET operation.
|
List<SimpleOperationResult> |
executeGetOperationWithTrackedData(SimpleTrackedData input)
Executes a GET operation.
|
List<SimpleOperationResult> |
executeOperation(OperationRequest request,
SimpleOperationResponse response,
OperationType expectedType)
Executes an operation.
|
List<SimpleOperationResult> |
executeQueryOperation(QueryFilter filter)
Executes a QUERY operation.
|
List<SimpleOperationResult> |
executeQueryOperationWithTrackedData(SimpleTrackedData input)
Executes a QUERY operation.
|
List<SimpleOperationResult> |
executeUpdateOperation(List<InputStream> inputs)
Executes an UPDATE operation.
|
List<SimpleOperationResult> |
executeUpdateOperationWithTrackedData(List<SimpleTrackedData> inputs)
Executes an UPDATE operation.
|
List<SimpleOperationResult> |
executeUpsertOperation(List<InputStream> inputs)
Executes an UPSERT operation.
|
List<SimpleOperationResult> |
executeUpsertOperationWithTrackedData(List<SimpleTrackedData> inputs)
Executes an UPSERT operation.
|
BrowseContext |
getBrowseContext()
Returns the currently configured BrowseContext.
|
AtomConfig |
getConfig()
Returns the currently configured AtomConfig.
|
Connector |
getConnector()
Returns the currently configured Connector.
|
OperationContext |
getOperationContext()
Returns the currently configured OperationContext.
|
void |
initializeConnector()
Initializes the currently configured connector.
|
void |
setAPIVersion(APIVersion apiVersion)
Sets the API version.
|
void |
setBrowseContext(BrowseContext newBrowseContext)
Sets the BrowseContext to the given instance.
|
void |
setBrowseContext(OperationType opType,
Map<String,Object> connProps,
Map<String,Object> opProps)
Sets the BrowseContext to a new instance of SimpleBrowseContext with the given arguments.
|
void |
setConfig(AtomConfig newConfig)
Sets the AtomConfig to the given instance.
|
void |
setConfig(int maxPageSize,
int maxNumObjects,
int maxCookieLength)
Sets the AtomConfig to a new instance of SimpleAtomConfig with the given arguments.
|
void |
setConnector(Connector newConnector)
Sets the Connector to the given instance.
|
void |
setOperationContext(OperationContext newOperationContext)
Sets the OperationContext to the given instance.
|
void |
setOperationContext(OperationType opType,
Map<String,Object> connProps,
Map<String,Object> opProps,
String objectTypeId,
Map<ObjectDefinitionRole,String> cookies)
Sets the OperationContext to a new instance of SimpleOperationContext with the given arguments..
|
void |
setProxyConfig(AtomProxyConfig newProxyConfig)
Sets the AtomProxyConfig value within SimpleAtomConfig instance.
|
void |
testBrowseProfiles(String objTypeId,
String expectedDefDoc)
Tests browsing for object type profiles.
|
void |
testBrowseTypes(String expectedTypeDoc)
Tests browsing for object types.
|
void |
testExecuteCreateOperation(List<InputStream> inputs,
List<SimpleOperationResult> expectedResults)
Tests executing a CREATE operation.
|
void |
testExecuteCreateOperationWithTrackedData(List<SimpleTrackedData> inputs,
List<SimpleOperationResult> expectedResults)
Tests executing a CREATE operation.
|
void |
testExecuteDeleteOperation(List<String> objectIds,
List<SimpleOperationResult> expectedResults)
Tests executing a DELETE operation.
|
void |
testExecuteDeleteOperationWithTrackedData(List<SimpleTrackedData> inputs,
List<SimpleOperationResult> expectedResults)
Tests executing a DELETE operation.
|
void |
testExecuteExecuteOperation(List<InputStream> inputs,
List<SimpleOperationResult> expectedResults)
Tests executing an EXECUTE operation.
|
void |
testExecuteGetOperation(String objectId,
List<SimpleOperationResult> expectedResults)
Tests executing a GET operation.
|
void |
testExecuteGetOperationWithTrackedData(SimpleTrackedData input,
List<SimpleOperationResult> expectedResults)
Tests executing a GET operation.
|
void |
testExecuteOperation(OperationRequest request,
SimpleOperationResponse response,
OperationType expectedType,
List<SimpleOperationResult> expectedResults)
Tests executing an operation.
|
void |
testExecuteQueryOperation(QueryFilter filter,
List<SimpleOperationResult> expectedResults)
Tests executing a QUERY operation.
|
void |
testExecuteQueryOperationWithTrackedData(SimpleTrackedData input,
List<SimpleOperationResult> expectedResults)
Tests executing a QUERY operation.
|
void |
testExecuteUpdateOperation(List<InputStream> inputs,
List<SimpleOperationResult> expectedResults)
Tests executing a UPDATE operation.
|
void |
testExecuteUpdateOperationWithTrackedData(List<SimpleTrackedData> inputs,
List<SimpleOperationResult> expectedResults)
Tests executing a UPDATE operation.
|
void |
testExecuteUpsertOperation(List<InputStream> inputs,
List<SimpleOperationResult> expectedResults)
Tests executing an UPSERT operation.
|
void |
testExecuteUpsertOperationWithTrackedData(List<SimpleTrackedData> inputs,
List<SimpleOperationResult> expectedResults)
Tests executing an UPSERT operation.
|
public ConnectorTester()
public ConnectorTester(Connector connector)
public ConnectorTester(Connector connector, APIVersion apiVersion)
public AtomConfig getConfig()
public void setConfig(int maxPageSize, int maxNumObjects, int maxCookieLength)
maxPageSize
- maximum batch size for paging operationsmaxNumObjects
- maximum number of objects that can be returned from a browsing requestmaxCookieLength
- maximum length of a cookie stored in an ObjectDefinitionpublic void setConfig(AtomConfig newConfig)
public void setProxyConfig(AtomProxyConfig newProxyConfig)
new SimpleAtomProxyConfig("exampleProxyHost","exampleProxyPort")
.withProxyUser("exampleUsername").withProxyPassword("*******");
If either of the setConfig() methods is used, a default implementation of AtomProxyConfig with null values will
be included and you lose out on the opportunity to set Atom's proxy configuration values. Expectation is to
include proxy configuration values in every AtomConfig instance.newProxyConfig
- public BrowseContext getBrowseContext()
public void setBrowseContext(OperationType opType, Map<String,Object> connProps, Map<String,Object> opProps)
opType
- the type of operation for which browsing is being requestedconnProps
- the connection properties for the browse request, may be null
opProps
- the operation properties for the browse request, may be null
public void setBrowseContext(BrowseContext newBrowseContext)
public OperationContext getOperationContext()
public void setOperationContext(OperationType opType, Map<String,Object> connProps, Map<String,Object> opProps, String objectTypeId, Map<ObjectDefinitionRole,String> cookies)
opType
- the type of operation being executedconnProps
- the connection properties for the operation execution, may be null
opProps
- the operation properties for the operation execution, may be null
objectTypeId
- the type of the object on which the operation is being executedcookies
- any cookies from the ObjectDefinition for the relevant object type, may be null
public void setOperationContext(OperationContext newOperationContext)
public Connector getConnector()
public void setConnector(Connector newConnector)
public void setAPIVersion(APIVersion apiVersion)
public void initializeConnector()
Prerequisites:
public void testBrowseTypes(String expectedTypeDoc)
Prerequisites:
expectedTypeDoc
- xml document string representing the expected outputpublic String browseTypes()
Prerequisites:
public void testBrowseProfiles(String objTypeId, String expectedDefDoc)
Prerequisites:
objTypeId
- the type id of the object type for which to create the profilesexpectedDefDoc
- xml document string representing the expected outputpublic String browseProfiles(String objTypeId)
Prerequisites:
objTypeId
- the type id of the object type for which to create the profilespublic void testExecuteGetOperation(String objectId, List<SimpleOperationResult> expectedResults)
Prerequisites:
objectId
- the id of the object to retrieveexpectedResults
- the expected output of the operationpublic void testExecuteGetOperationWithTrackedData(SimpleTrackedData input, List<SimpleOperationResult> expectedResults)
Prerequisites:
input
- the object to retrieveexpectedResults
- the expected output of the operationpublic List<SimpleOperationResult> executeGetOperation(String objectId)
Prerequisites:
objectId
- the id of the object to retrievepublic List<SimpleOperationResult> executeGetOperationWithTrackedData(SimpleTrackedData input)
Prerequisites:
input
- the object to retrievepublic void testExecuteQueryOperation(QueryFilter filter, List<SimpleOperationResult> expectedResults)
Prerequisites:
filter
- the query filter for the requestexpectedResults
- the expected output of the operationpublic void testExecuteQueryOperationWithTrackedData(SimpleTrackedData input, List<SimpleOperationResult> expectedResults)
Prerequisites:
input
- the tracked data containing the query inputexpectedResults
- the expected output of the operationpublic List<SimpleOperationResult> executeQueryOperation(QueryFilter filter)
Prerequisites:
filter
- the query filter for the requestpublic List<SimpleOperationResult> executeQueryOperationWithTrackedData(SimpleTrackedData input)
Prerequisites:
input
- the query object for the requestpublic void testExecuteDeleteOperation(List<String> objectIds, List<SimpleOperationResult> expectedResults)
Prerequisites:
objectIds
- ids of the objects to be deletedexpectedResults
- the expected output of the operationpublic void testExecuteDeleteOperationWithTrackedData(List<SimpleTrackedData> inputs, List<SimpleOperationResult> expectedResults)
Prerequisites:
inputs
- objects to be deletedexpectedResults
- the expected output of the operationpublic List<SimpleOperationResult> executeDeleteOperation(List<String> objectIds)
Prerequisites:
objectIds
- ids of the objects to be deletedpublic List<SimpleOperationResult> executeDeleteOperationWithTrackedData(List<SimpleTrackedData> inputs)
Prerequisites:
inputs
- the objects to be deletedpublic void testExecuteUpdateOperation(List<InputStream> inputs, List<SimpleOperationResult> expectedResults)
Prerequisites:
inputs
- the objects to be updatedexpectedResults
- the expected output of the operationpublic void testExecuteUpdateOperationWithTrackedData(List<SimpleTrackedData> inputs, List<SimpleOperationResult> expectedResults)
Prerequisites:
inputs
- the objects to be updatedexpectedResults
- the expected output of the operationpublic List<SimpleOperationResult> executeUpdateOperation(List<InputStream> inputs)
Prerequisites:
inputs
- the objects to be updatedpublic List<SimpleOperationResult> executeUpdateOperationWithTrackedData(List<SimpleTrackedData> inputs)
Prerequisites:
inputs
- the objects to be updatedpublic void testExecuteCreateOperation(List<InputStream> inputs, List<SimpleOperationResult> expectedResults)
Prerequisites:
inputs
- the objects to be createdexpectedResults
- the expected output of the operationpublic void testExecuteCreateOperationWithTrackedData(List<SimpleTrackedData> inputs, List<SimpleOperationResult> expectedResults)
Prerequisites:
inputs
- the objects to be createdexpectedResults
- the expected output of the operationpublic List<SimpleOperationResult> executeCreateOperation(List<InputStream> inputs)
Prerequisites:
inputs
- the objects to be createdpublic List<SimpleOperationResult> executeCreateOperationWithTrackedData(List<SimpleTrackedData> inputs)
Prerequisites:
inputs
- the objects to be createdpublic void testExecuteUpsertOperation(List<InputStream> inputs, List<SimpleOperationResult> expectedResults)
Prerequisites:
inputs
- the objects to be upsertedexpectedResults
- the expected output of the operationpublic void testExecuteUpsertOperationWithTrackedData(List<SimpleTrackedData> inputs, List<SimpleOperationResult> expectedResults)
Prerequisites:
inputs
- the objects to be upsertedexpectedResults
- the expected output of the operationpublic List<SimpleOperationResult> executeUpsertOperation(List<InputStream> inputs)
Prerequisites:
inputs
- the objects to be upsertedpublic List<SimpleOperationResult> executeUpsertOperationWithTrackedData(List<SimpleTrackedData> inputs)
Prerequisites:
inputs
- the objects to be upsertedpublic void testExecuteExecuteOperation(List<InputStream> inputs, List<SimpleOperationResult> expectedResults)
Prerequisites:
inputs
- the objects to be executeedexpectedResults
- the expected output of the operationpublic List<SimpleOperationResult> executeExecuteOperation(List<InputStream> inputs)
Prerequisites:
inputs
- the objects to be executedpublic List<SimpleOperationResult> executeExecuteOperationWithTrackedData(List<SimpleTrackedData> inputs)
Prerequisites:
inputs
- the objects to be executedpublic void testExecuteOperation(OperationRequest request, SimpleOperationResponse response, OperationType expectedType, List<SimpleOperationResult> expectedResults)
Prerequisites:
request
- required request informationresponse
- response trackerexpectedType
- the expected type of the operation being executedexpectedResults
- the expected output of the operationpublic List<SimpleOperationResult> executeOperation(OperationRequest request, SimpleOperationResponse response, OperationType expectedType)
Prerequisites:
request
- required request informationresponse
- response trackerexpectedType
- the expected type of the operation being executed