Files
CoreRasurae e828acf175
CI / lint (push) Successful in 1m32s
CI / typecheck (push) Successful in 1m38s
CI / lint (pull_request) Successful in 1m30s
CI / typecheck (pull_request) Successful in 1m30s
CI / behave (3.11) (pull_request) Successful in 1m39s
CI / behave (3.12) (pull_request) Successful in 1m39s
CI / build (pull_request) Successful in 1m29s
CI / behave (3.13) (pull_request) Successful in 1m39s
CI / behave (3.11) (push) Successful in 1m39s
CI / behave (3.12) (push) Successful in 1m41s
CI / behave (3.13) (push) Successful in 1m37s
CI / build (push) Successful in 1m30s
feat: Initial version of CleverRDFLib
ISSUES CLOSED: #1
2025-12-19 22:26:14 +00:00

124 lines
5.3 KiB
Gherkin

Feature: Observer Pattern Implementation
As a developer using CleverRDFLib
I want to observe loading and build events
So that I can monitor and react to ontology processing events
Background:
Given I have observer instances available
Scenario: Observe loading started event
Given I have a LoadingObserver registered
And I have an ontology to load
When I load the ontology
Then the observer should receive a loading started event
And the event should contain the ontology URI
Scenario: Observe loading completed event
Given I have a LoadingObserver registered
And I have an ontology to load
When I load the ontology
Then the observer should receive a loading completed event
And the event should contain the count of loaded ontologies
Scenario: Observe loading failed event
Given I have a LoadingObserver registered
And I have an invalid ontology to load
When I attempt to load the ontology
Then the observer should receive a loading failed event
And the event should contain error information
Scenario: Observe build started event
Given I have a ClassHierarchyBuildObserver registered
And I have a graph to build hierarchy from
When I build the class hierarchy
Then the observer should receive a build started event
And the event should contain the graph identifier
Scenario: Observe build completed event
Given I have a ClassHierarchyBuildObserver registered
And I have a graph to build hierarchy from
When I build the class hierarchy
Then the observer should receive a build completed event
And the event should contain the graph identifier
Scenario: Observe build inconsistency event
Given I have a ClassHierarchyBuildObserver registered
And I have a graph with inconsistent definitions
When I build the class hierarchy
Then the observer should receive build inconsistency events
And each event should contain the element IRI and message
Scenario: Observe build failed event
Given I have a ClassHierarchyBuildObserver registered
And I have a graph that causes build failures for observers
When I attempt to build the class hierarchy
Then the observer should receive build failed events
And each observer event should contain the error exception
Scenario: Use composite loading observer
Given I have multiple LoadingObserver instances
When I create a composite observer with the observers
Then the composite should forward events to all observers
And all observers should receive the same events
Scenario: Use composite build observer
Given I have multiple ClassHierarchyBuildObserver instances
When I create a composite observer with the observers
Then the composite should forward events to all observers
And all observers should receive the same events
Scenario: Add build observer to composite build observer
Given I have observer instances available
Given I have multiple ClassHierarchyBuildObserver instances
When I create a composite build observer with the observers
And I have a new build observer to add
When I add the build observer to the composite build observer
Then the composite build observer should contain the new observer
Scenario: Remove build observer from composite build observer
Given I have observer instances available
Given I have multiple ClassHierarchyBuildObserver instances
When I create a composite build observer with the observers
And I have a build observer to remove
When I remove the build observer from the composite build observer
Then the composite build observer should no longer contain the observer
Scenario: Add observer to composite
Given I have a composite observer with existing observers
And I have a new observer to add
When I add the observer to the composite
Then the composite should contain the new observer
And the new observer should receive future events
Scenario: Remove observer from composite
Given I have a composite observer with multiple observers
And I have an observer to remove
When I remove the observer from the composite
Then the composite should no longer contain the observer
And the removed observer should not receive future events
Scenario: Collect build warnings with collector
Given I have a ClassHierarchyBuildCollector registered
And I have a graph with inconsistencies
When I build the class hierarchy
Then the collector should collect all warnings
And I should be able to retrieve the collected warnings
And the warnings should contain inconsistency messages
And I should be able to retrieve the collected failures
Scenario: Collect build warnings for property with missing domain class
Given I have a ClassHierarchyBuildCollector registered
And I have a graph with property missing domain class
When I build the class hierarchy
Then the collector should collect inconsistency warnings
And the warnings should mention missing domain class
Scenario: Handle observer exceptions gracefully
Given I have an observer that raises exceptions
And I have a composite observer containing the problematic observer
When events are sent to the composite observer
Then the composite should handle exceptions gracefully
And other observers should still receive events