_acs-developer-support__ds_add_test (private)
_acs-developer-support__ds_add_test
Defined in packages/acs-developer-support/tcl/test/acs-developer-support-procs.tcl
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- No testcase defined.
Source code: set _aa_export {} set body_count 1 foreach testcase_body {{ set old_enabled_state [ds_enabled_p] set old_db_state [ds_database_enabled_p] try { set collection_enabled_p [ds_collection_enabled_p] set enabled_p 0 nsv_set ds_properties enabled_p $enabled_p set ::ds_enabled_p $enabled_p set key $::ad_conn(request).comment set db_key $::ad_conn(request).db set pr_key $::ad_conn(request).prof nsv_set ds_request $key "" set current_size 0 ds_add comment __test set size_new [llength [nsv_get ds_request $key]] aa_true "DS is disabled, adding should not have effect" {$current_size == $size_new} aa_true "DS is disabled, profiling fails" [catch {ds_profile start __test}] aa_true "Profiling fails on invalid command" [catch {ds_profile __test __test}] nsv_set ds_request $key [list] set current_size 0 aa_log "enabling DS" set enabled_p 1 nsv_set ds_properties enabled_p $enabled_p set ::ds_enabled_p $enabled_p aa_log "start profiling" ds_profile start __test aa_true "Profiling fails on invalid command" [catch {ds_profile __test __test}] aa_true "DS is enabled, profiling started correctly" { [info exists ::ds_profile__start_clock(__test)] && $::ds_profile__start_clock(__test) ne "" } aa_log "stopping profiling" ds_profile stop __test aa_true "DS is enabled, profiling stopped correctly" {[llength [nsv_get ds_request $pr_key]] == 2} aa_log "Adding stuff to the report" ds_add comment __test ds_comment __test set db_current_size [expr {[nsv_exists ds_request $db_key] ? [llength [nsv_get ds_request $db_key]] : 0}] aa_log "disable database stats collection" ds_set_database_enabled 0 aa_log "issuing a query" db_string query {select 1 from dual} set db_size_new [expr {[nsv_exists ds_request $db_key] ? [llength [nsv_get ds_request $db_key]] : 0}] aa_log $db_size_new aa_true "DB stat collection is disabled, db stat collection should not have effect" {$db_current_size == $db_size_new} aa_log "enabled database stats collection" ds_set_database_enabled 1 set db_current_size [expr {[nsv_exists ds_request $db_key] ? [llength [nsv_get ds_request $db_key]] : 0}] aa_log "issuing a query" db_string query {select 1 from dual} set db_size_new [llength [nsv_get ds_request $db_key]] if {$collection_enabled_p} { aa_true "Collection is enabled, db stat collection should work" {$db_current_size < $db_size_new} } else { aa_true "Collection is disabled, db stat collection should not have effect" {$db_current_size == $db_size_new} } set size_new [llength [nsv_get ds_request $key]] if {$collection_enabled_p} { aa_true "Collection is enabled, adding should work" {$current_size + 2 == $size_new} } else { aa_true "Collection is disabled, adding should not have effect" {$current_size == $size_new} } } finally { nsv_set ds_properties enabled_p $old_enabled_state set ::ds_enabled_p $old_enabled_state ds_set_database_enabled $old_db_state } }} { aa_log "Running testcase body $body_count" set ::__aa_test_indent [info level] set catch_val [catch $testcase_body msg] if {$catch_val != 0 && $catch_val != 2} { aa_log_result "fail" "ds_add_test (body $body_count): Error during execution: $msg, stack trace: \n$::errorInfo" } incr body_count }XQL Not present: Generic, PostgreSQL, Oracle