Class OpenMetadataPerformanceTestCase
java.lang.Object
org.odpi.openmetadata.conformance.beans.OpenMetadataTestCase
org.odpi.openmetadata.conformance.tests.performance.OpenMetadataPerformanceTestCase
- Direct Known Subclasses:
TestClassificationSearch
,TestClassificationUpdate
,TestEntityClassification
,TestEntityCreation
,TestEntityDeclassification
,TestEntityDelete
,TestEntityHistoryRetrieval
,TestEntityHistorySearch
,TestEntityPurge
,TestEntityReHome
,TestEntityReIdentify
,TestEntityRestore
,TestEntityRetrieval
,TestEntityRetype
,TestEntitySearch
,TestEntityUndo
,TestEntityUpdate
,TestEnvironment
,TestGraphHistoryQueries
,TestGraphQueries
,TestRelationshipCreation
,TestRelationshipDelete
,TestRelationshipHistoryRetrieval
,TestRelationshipHistorySearch
,TestRelationshipPurge
,TestRelationshipReHome
,TestRelationshipReIdentify
,TestRelationshipRestore
,TestRelationshipRetrieval
,TestRelationshipRetype
,TestRelationshipSearch
,TestRelationshipUndo
,TestRelationshipUpdate
OpenMetadataPerformanceTestCase is the superclass for an open metadata performance test. It manages the
test environment and reporting.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.odpi.openmetadata.conformance.beans.OpenMetadataTestCase
OpenMetadataTestCase.TestPhase
-
Field Summary
Fields inherited from class org.odpi.openmetadata.conformance.beans.OpenMetadataTestCase
defaultProfileId, defaultRequirementId, discoveredProperties, exceptionBean, notSupportedAssertions, successfulAssertions, successMessage, testCaseDescriptionURL, testCaseId, testCaseName, unsuccessfulAssertions, workPad
-
Constructor Summary
ModifierConstructorDescriptionprotected
OpenMetadataPerformanceTestCase
(PerformanceWorkPad workPad, Integer defaultProfileId) Typical constructor used when the test case id needs to be constructed by th test case code.protected
OpenMetadataPerformanceTestCase
(PerformanceWorkPad workPad, String testCaseId, String testCaseName, Integer defaultProfileId) Typical constructor used when the name of the test case id is fixed -
Method Summary
Modifier and TypeMethodDescriptionprotected String
buildExceptionMessage
(String testName, String methodName, String operationDescription, Map<String, String> parameters, Exception cause) protected InstanceProperties
generatePropertiesForInstance
(String userId, List<TypeDefAttribute> allTypeDefAttributes, int instanceCount) Return generated instance properties specialised for search testsprotected InstanceProperties
getAllPropertiesForInstance
(String userId, TypeDef typeDef, int instanceCount) Return instance properties for the properties defined in the TypeDef and all of its supertypes.protected int
Return the number of instances that should exist per type in the repository.protected OMRSMetadataCollection
Return the metadata collection used to call the repository.protected PrimitivePropertyValue
getPrimitivePropertyValue
(String propertyName, PrimitiveDef propertyType, boolean attrUnique, int instanceCount) Create a primitive property value for the requested property.protected List<TypeDefAttribute>
getPropertiesForTypeDef
(String userId, TypeDef typeDef) Recursively walk the supertype hierarchy starting at the given typeDef, and collect all the TypeDefAttributes.protected OMRSRepositoryConnector
Return the repository connector generated from the cohort registration event.protected OMRSRepositoryHelper
Return the repository helper for the repository.protected void
logTestEnd
(String methodName) Log that the test case is ending.protected void
logTestStart
(String methodName) Log that the test case is starting.protected String
updateTestIdByType
(String typeName, String rootTestCaseId, String testCaseName) Verify that the name of the type (which forms part of the test id) is not null.Methods inherited from class org.odpi.openmetadata.conformance.beans.OpenMetadataTestCase
addDiscoveredProperty, addNotSupportedAssertion, assertCondition, assertCondition, assertObjectsAreEqual, cleanTest, cleanup, endAsynchronousTest, executeTest, executeTest, getResult, getSummary, getTestCaseDescriptionURL, getTestCaseId, getTestCaseName, isTestPassed, isTestRan, run, run, setSuccessMessage, startAsynchronousTest, toString, updateTestId, verifyCondition, verifyCondition, verifyObjectsAreEqual
-
Field Details
-
performanceWorkPad
-
cohortRepositoryConnector
-
-
Constructor Details
-
OpenMetadataPerformanceTestCase
protected OpenMetadataPerformanceTestCase(PerformanceWorkPad workPad, String testCaseId, String testCaseName, Integer defaultProfileId) Typical constructor used when the name of the test case id is fixed- Parameters:
workPad
- location for workbench resultstestCaseId
- identifier of test casetestCaseName
- name of test casedefaultProfileId
- identifier of default profile (for unexpected exceptions)
-
OpenMetadataPerformanceTestCase
Typical constructor used when the test case id needs to be constructed by th test case code.- Parameters:
workPad
- location for workbench resultsdefaultProfileId
- identifier of default profile (for unexpected exceptions)
-
-
Method Details
-
logTestStart
Log that the test case is starting.- Specified by:
logTestStart
in classOpenMetadataTestCase
- Parameters:
methodName
- calling method name
-
logTestEnd
Log that the test case is ending.- Specified by:
logTestEnd
in classOpenMetadataTestCase
- Parameters:
methodName
- calling method name
-
updateTestIdByType
Verify that the name of the type (which forms part of the test id) is not null.- Parameters:
typeName
- name of the type being testedrootTestCaseId
- base test case IdtestCaseName
- name of the test case- Returns:
- typeName (or "null" if null so messages are displayed properly.)
-
getInstancesPerType
protected int getInstancesPerType()Return the number of instances that should exist per type in the repository.- Returns:
- number of instances per type
-
getRepositoryConnector
Return the repository connector generated from the cohort registration event.- Returns:
- OMRSRepositoryConnector object
- Throws:
Exception
- if the connector is not properly set up.
-
getMetadataCollection
Return the metadata collection used to call the repository.- Returns:
- OMRSMetadataCollection object
- Throws:
Exception
- if the connector is not properly set up.
-
getRepositoryHelper
Return the repository helper for the repository.- Returns:
- OMRSRepositoryHelper object
- Throws:
Exception
- if the connector is not properly set up.
-
getPrimitivePropertyValue
protected PrimitivePropertyValue getPrimitivePropertyValue(String propertyName, PrimitiveDef propertyType, boolean attrUnique, int instanceCount) Create a primitive property value for the requested property.- Parameters:
propertyName
- name of the propertypropertyType
- type of the propertyattrUnique
- whether this property value should be distinct (or common)instanceCount
- counter to be used in customisation of distinct values- Returns:
- PrimitiveTypePropertyValue object
-
getAllPropertiesForInstance
protected InstanceProperties getAllPropertiesForInstance(String userId, TypeDef typeDef, int instanceCount) throws Exception Return instance properties for the properties defined in the TypeDef and all of its supertypes.- Parameters:
userId
- calling usertypeDef
- the definition of the typeinstanceCount
- a generator parameter for customisation of individual instance properties- Returns:
- properties for an instance of this type
- Throws:
Exception
- problem manipulating types
-
generatePropertiesForInstance
protected InstanceProperties generatePropertiesForInstance(String userId, List<TypeDefAttribute> allTypeDefAttributes, int instanceCount) throws Exception Return generated instance properties specialised for search tests- Parameters:
userId
- calling userallTypeDefAttributes
- list of all the TDAs for typeinstanceCount
- a generator parameter for customisation of individual instance properties- Returns:
- properties for an instance of this type
- Throws:
Exception
- problem manipulating types
-
getPropertiesForTypeDef
Recursively walk the supertype hierarchy starting at the given typeDef, and collect all the TypeDefAttributes. This method does not use the properties defined in the TypeDef provided since that TypeDef is from the gallery returned by the repository connector. Instead it uses the name of the TypeDef to look up the TypeDef in the RepositoryHelper - using the Known types rather than the Active types. This is to ensure consistency with the open metadata type definition.- Parameters:
userId
- the userId of the caller, needed for retrieving type definitionstypeDef
- the definition of the type- Returns:
- properties for an instance of this type
-
buildExceptionMessage
-