_acs-tcl__disk_cache (private)

 _acs-tcl__disk_cache

Defined in packages/acs-tcl/tcl/test/acs-cache-procs.tcl

Partial Call Graph (max 5 caller/called nodes):
%3 aa_equals aa_equals (public) aa_log aa_log (public) aa_log_result aa_log_result (public) acs::disk_cache_eval acs::disk_cache_eval (public) acs::disk_cache_flush acs::disk_cache_flush (public) _acs-tcl__disk_cache _acs-tcl__disk_cache _acs-tcl__disk_cache->aa_equals _acs-tcl__disk_cache->aa_log _acs-tcl__disk_cache->aa_log_result _acs-tcl__disk_cache->acs::disk_cache_eval _acs-tcl__disk_cache->acs::disk_cache_flush

Testcases:
No testcase defined.
Source code:
        
        set _aa_export {}
        set body_count 1
        foreach testcase_body {{
        set key __acs_tcl_test_disk_cache
        set id 1234
        set have_disk_cache_parameter [acs::dc call apm parameter_p -package_key acs_tcl -parameter_name DiskCache]

        if {!$have_disk_cache_parameter} {
            #
            # If the optional parameter "DiskCache" is not defined, we
            # cannot set it. Therefore, there will be errors in the
            # log file causing the test
            # "acs_kernel__server_startup_ok" to fail.  Therefore, we
            # give up in this case.
            #
            aa_log "Optional parameter DiskCache is NOT defined"
            return
        }

        aa_log "Flush everything first"
        acs::disk_cache_flush -key $key -id $id

        set cache_p [::parameter::get_from_package_key  -package_key acs-tcl  -parameter DiskCache  -default 1]
        ns_log notice "cache_p $cache_p have_disk_cache_parameter $have_disk_cache_parameter"

        try {
            if {!$cache_p} {
                ::parameter::set_from_package_key  -package_key acs-tcl  -parameter DiskCache  -value 1
            }

            set call {
                nsv_incr __test_acs_tcl_disk_cache exec
                expr {1 + 1}
            }

            aa_log "Execute the call"
            set result [acs::disk_cache_eval -call $call -key $key -id $id]

            aa_log "Flush the cache"
            acs::disk_cache_flush -key $key -id $id

            aa_log "Execute the call again"
            set result [acs::disk_cache_eval -call $call -key $key -id $id]

            aa_equals "Result is 2" $result 2

            aa_log "Execute the call again"
            set result [acs::disk_cache_eval -call $call -key $key -id $id]

            aa_equals "Code was executed only twice"  [nsv_get __test_acs_tcl_disk_cache exec]  2

        } finally {
            nsv_unset -nocomplain __test_acs_tcl_disk_cache

            try {
                ::parameter::set_from_package_key  -package_key acs-tcl  -parameter DiskCache  -value $cache_p
            } on error {errmsg} {
                aa_log "'DiskCache' parameter not defined, nothing to reset."
            }
        }
    }} {
          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" "disk_cache (body $body_count): Error during execution: $msg, stack trace: \n$::errorInfo"
          }
          incr body_count
        }
XQL Not present:
Generic, PostgreSQL, Oracle
[ hide source ] | [ make this the default ]
Show another procedure: