Database System 0.1.0
Advanced C++20 Database System with Multi-Backend Support
Loading...
Searching...
No Matches
IntegrationTestBase Class Reference
Inheritance diagram for IntegrationTestBase:
Inheritance graph
Collaboration diagram for IntegrationTestBase:
Collaboration graph

Protected Member Functions

void SetUp () override
 
void TearDown () override
 

Protected Attributes

std::shared_ptr< database_contextcontext_
 
std::shared_ptr< database_managerdb_mgr_
 
std::shared_ptr< performance_monitormonitor_
 

Private Member Functions

void setup_performance_monitoring ()
 
void setup_security_framework ()
 
void setup_async_operations ()
 
void setup_orm_framework ()
 
void cleanup_components ()
 

Detailed Description

Definition at line 66 of file integration_tests.cpp.

Member Function Documentation

◆ cleanup_components()

void IntegrationTestBase::cleanup_components ( )
inlineprivate

Definition at line 138 of file integration_tests.cpp.

138 {
139 // Reset all components to clean state
140 if (db_mgr_) {
141 db_mgr_->disconnect_result();
142 }
143 }
std::shared_ptr< database_manager > db_mgr_

References db_mgr_.

Referenced by TearDown().

Here is the caller graph for this function:

◆ SetUp()

void IntegrationTestBase::SetUp ( )
inlineoverrideprotected

Definition at line 72 of file integration_tests.cpp.

72 {
73 // Initialize database context and manager
74 context_ = std::make_shared<database_context>();
75 db_mgr_ = std::make_shared<database_manager>(context_);
76
77 // Initialize all Phase 4 components
82 }
std::shared_ptr< database_context > context_

References context_, db_mgr_, setup_async_operations(), setup_orm_framework(), setup_performance_monitoring(), and setup_security_framework().

Referenced by ORMSecurityIntegrationTest::SetUp().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setup_async_operations()

void IntegrationTestBase::setup_async_operations ( )
inlineprivate

Definition at line 124 of file integration_tests.cpp.

124 {
125 auto& executor = async_executor::instance();
126 async_config config;
127 config.thread_pool_size = 4;
128 config.max_concurrent_operations = 20;
129 config.operation_timeout = std::chrono::seconds(30);
130 executor.configure(config);
131 }

Referenced by SetUp().

Here is the caller graph for this function:

◆ setup_orm_framework()

void IntegrationTestBase::setup_orm_framework ( )
inlineprivate

Definition at line 133 of file integration_tests.cpp.

133 {
134 entity_manager& mgr = context_->get_entity_manager();
136 }
Manages entity metadata and provides factory methods.
Definition entity.h:247
std::enable_if_t< is_entity_v< EntityType > > register_entity()

References context_, and database::orm::entity_manager::register_entity().

Referenced by SetUp().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setup_performance_monitoring()

void IntegrationTestBase::setup_performance_monitoring ( )
inlineprivate

Definition at line 90 of file integration_tests.cpp.

90 {
91 monitor_ = context_->get_performance_monitor();
92 monitoring_config config;
93 config.enable_query_tracking = true;
94 config.enable_connection_tracking = true;
95 config.enable_data_access_logging = true;
96 config.slow_query_threshold = std::chrono::milliseconds(100);
97 monitor_->configure(config);
98 }
std::shared_ptr< performance_monitor > monitor_

References context_, and monitor_.

Referenced by SetUp().

Here is the caller graph for this function:

◆ setup_security_framework()

void IntegrationTestBase::setup_security_framework ( )
inlineprivate

Definition at line 100 of file integration_tests.cpp.

100 {
101 auto& rbac = rbac_manager::instance();
102 auto& logger = context_->get_audit_logger();
103
104 // Create test roles
105 rbac_role admin_role("admin");
106 admin_role.add_permission("user.create");
107 admin_role.add_permission("user.read");
108 admin_role.add_permission("user.update");
109 admin_role.add_permission("user.delete");
110 rbac.create_role(admin_role);
111
112 rbac_role user_role("user");
113 user_role.add_permission("user.read");
114 rbac.create_role(user_role);
115
116 // Configure audit logging
117 audit_config audit_cfg;
118 audit_cfg.enable_database_operations = true;
119 audit_cfg.enable_authentication_events = true;
120 audit_cfg.enable_authorization_events = true;
121 logger.configure(audit_cfg);
122 }

References context_.

Referenced by SetUp().

Here is the caller graph for this function:

◆ TearDown()

void IntegrationTestBase::TearDown ( )
inlineoverrideprotected

Definition at line 84 of file integration_tests.cpp.

84 {
85 // Cleanup all components
87 }

References cleanup_components().

Here is the call graph for this function:

Member Data Documentation

◆ context_

std::shared_ptr<database_context> IntegrationTestBase::context_
protected

◆ db_mgr_

std::shared_ptr<database_manager> IntegrationTestBase::db_mgr_
protected

Definition at line 69 of file integration_tests.cpp.

Referenced by cleanup_components(), and SetUp().

◆ monitor_

std::shared_ptr<performance_monitor> IntegrationTestBase::monitor_
protected

Definition at line 70 of file integration_tests.cpp.

Referenced by setup_performance_monitoring().


The documentation for this class was generated from the following file: