-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Core] Configurable
hasCapability
responses
Closes #84. Host applications must be able to tolerate manager plugins that do not support the full suite of (optional) capabilities that a manager may implement. However, there was no way for hosts to use BAL to test their logic for dealing with different combinations of capabilities. In addition, configurable capabilities are required to enable e2e testing of the capability-based routing used by the upcoming hybrid plugin system (see OpenAssetIO/OpenAssetIO#1202). So add a simple way to override the default set of capabilities reported by BAL, by adding an optional "capabilities" list element to the library, where each element is a stringified capability, as defined in `kCapabilityNames`. Presence of a capability in this list indicates that it is supported. If the list is not found, then the default (i.e. true) set of capabilities is used. Short-circuit methods where the capability is unsupported. Instead, call the base class (which will raise an error). This logic is similar to that used in the SimpleCppManager (see OpenAssetIO/OpenAssetIO#1324). Signed-off-by: David Feltell <[email protected]>
- Loading branch information
Showing
6 changed files
with
217 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 14 additions & 0 deletions
14
tests/resources/library_business_logic_suite_capabilities_all.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
{ | ||
"capabilities": [ | ||
"entityReferenceIdentification", | ||
"managementPolicyQueries", | ||
"statefulContexts", | ||
"customTerminology", | ||
"resolution", | ||
"publishing", | ||
"relationshipQueries", | ||
"existenceQueries", | ||
"defaultEntityReferences", | ||
"entityTraitIntrospection" | ||
] | ||
} |
7 changes: 7 additions & 0 deletions
7
tests/resources/library_business_logic_suite_capabilities_minimal.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"capabilities": [ | ||
"entityReferenceIdentification", | ||
"managementPolicyQueries", | ||
"entityTraitIntrospection" | ||
] | ||
} |
3 changes: 3 additions & 0 deletions
3
tests/resources/library_business_logic_suite_capabilities_none.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"capabilities": [] | ||
} |