Expand description
§Stream Testing Framework
This module provides a comprehensive testing framework for stream applications, enabling developers to write reliable and maintainable tests.
§Features
- Test harness for stream applications
- Mock streams and event generators
- Time manipulation for testing windows
- Assertions for stream output
- Performance testing utilities
- Test fixtures and builders
- Test report generation
§Example
ⓘ
use oxirs_stream::testing_framework::*;
#[tokio::test]
async fn test_stream_processing() {
let harness = TestHarness::builder()
.with_mock_clock()
.with_event_generator(EventGenerator::sequential(100))
.build()
.await?;
harness.push_events(vec![/* events */]).await;
harness.advance_time(Duration::from_secs(60)).await;
assert_stream_output!(harness, contains(expected));
}Structs§
- Assertion
- Assertion for testing
- Captured
Event - Captured event with metadata
- Event
Generator - Event generator for creating test events
- Event
Matcher - Event matcher for assertions
- Generator
Config - Generator configuration
- Mock
Clock - Mock clock for time manipulation in tests
- Test
Fixture - Test fixture for common test scenarios
- Test
Harness - Test harness for stream testing
- Test
Harness Builder - Test harness builder
- Test
Harness Config - Configuration for the test harness
- Test
Metrics - Test metrics
- Test
Report - Test report
Enums§
- Assertion
Type - Assertion types
- Generator
Type - Types of event generators
- Performance
Metric - Performance metrics
- Test
Status - Test status