public abstract class BrowserTest extends ConnectorTest
ConnectorTester
. Implementing classes will execute all
defined tests.connectorTester, testContext
Constructor and Description |
---|
BrowserTest(String label,
String id,
String expectedElementName,
EnumSet<OperationType> expectedOperations)
Creates a new test instance.
|
Modifier and Type | Method and Description |
---|---|
protected void |
afterTestBrowseProfile(ObjectDefinitions objectDefinitions)
This method can be overridden to provide additional verification beyond the base verifications performed by
testBrowseProfile() . |
protected static void |
clearBrowseCache()
This method can be used to clear the browse cache.Used in scenarios when testing object browse on different api
version where different versions support different objects on same operation.
|
protected int |
getExpectedObjectCount(OperationType operationType)
This method must be overridden to return the expected number of object types for the specified operation if
isStrict() has been overridden to return true. |
protected ObjectDefinitions |
getObjectDefinitions(OperationType operationType)
A convenience method to get profile definitions for the requested operation type
|
void |
getObjectTypes()
Setup method for browser tests
|
protected boolean |
isStrict()
This method can be overridden to enable strict verification of the browse types test.
|
void |
testBrowseProfile()
Test method to verify the profile for current object
|
void |
testBrowseTypesForCreateOperation()
Test method to verify if the current object supports the
OperationType.CREATE operation |
void |
testBrowseTypesForDeleteOperation()
Test method to verify if the current object supports the
OperationType.DELETE operation |
void |
testBrowseTypesForExecuteOperation()
Test method to verify if the current object supports the
OperationType.EXECUTE operation |
void |
testBrowseTypesForGetOperation()
Test method to verify if the current object supports the
OperationType.GET operation |
void |
testBrowseTypesForQueryOperation()
Test method to verify if the current object supports the
OperationType.QUERY operation |
void |
testBrowseTypesForUpdateOperation()
Test method to verify if the current object supports the
OperationType.UPDATE operation |
void |
testBrowseTypesForUpsertOperation()
Test method to verify if the current object supports the
OperationType.UPSERT operation |
browseProfile, browseTypes, clearObjectDefinitionCache, getBrowseContext, getConnectorTestContext, getOperationContext, setupConnectorTester
public BrowserTest(String label, String id, String expectedElementName, EnumSet<OperationType> expectedOperations)
Intended to be used as part of a Parameterized
test but can be run as a single test instance by invoking
this constructor from the no argument constructor of the implementing class.
label
- the label for the expected ObjectType
id
- the id for the expected ObjectType
expectedElementName
- the expected name of the element in the profile ObjectDefinition
expectedOperations
- the expected OperationType
values supported for this objectpublic final void getObjectTypes()
This method will perform the browse for all operations and cache the response so that it does not need to be performed for each object under test.
public final void testBrowseTypesForGetOperation()
OperationType.GET
operationpublic final void testBrowseTypesForQueryOperation()
OperationType.QUERY
operationpublic final void testBrowseTypesForUpdateOperation()
OperationType.UPDATE
operationpublic final void testBrowseTypesForUpsertOperation()
OperationType.UPSERT
operationpublic final void testBrowseTypesForCreateOperation()
OperationType.CREATE
operationpublic final void testBrowseTypesForDeleteOperation()
OperationType.DELETE
operationpublic final void testBrowseTypesForExecuteOperation()
OperationType.EXECUTE
operationpublic final void testBrowseProfile() throws Exception
Base verifications include verifying that a definition exists for the expected element and that definition has a schema defined. The test will use the expected operation with the most supported roles.
Exception
- exception browsing profileprotected static void clearBrowseCache()
protected void afterTestBrowseProfile(ObjectDefinitions objectDefinitions) throws Exception
testBrowseProfile()
. This method will only execute after other verifications have passed.objectDefinitions
- object definitions instance created by testBrowseProfile()
Exception
- exception validating the object definitionsprotected ObjectDefinitions getObjectDefinitions(OperationType operationType)
protected boolean isStrict()
If this method overridden to return true, then getExpectedObjectCount(OperationType)
must also be
overridden as it is used to determine the expected number of object types for each operation.
protected int getExpectedObjectCount(OperationType operationType)
isStrict()
has been overridden to return true.operationType
- OperationType
under test