aa_stub (public)

 aa_stub proc_name new_body

Defined in packages/acs-automated-testing/tcl/aa-test-procs.tcl

Stubs a function. Provide the procedure name and the new body code.

Either call this function from within a testcase for a testcase specific stub, or outside a testcase for a file-wide stub.

Parameters:
proc_name
new_body
Author:
Peter Harper
Created:
24 July 2001

Partial Call Graph (max 5 caller/called nodes):
%3 test_acs_admin_check_expired_certificates acs_admin_check_expired_certificates (test acs-admin) aa_stub aa_stub test_acs_admin_check_expired_certificates->aa_stub test_auth_email_on_password_change auth_email_on_password_change (test acs-authentication) test_auth_email_on_password_change->aa_stub test_auth_password_change auth_password_change (test acs-authentication) test_auth_password_change->aa_stub test_auth_password_recover auth_password_recover (test acs-authentication) test_auth_password_recover->aa_stub test_auth_password_reset auth_password_reset (test acs-authentication) test_auth_password_reset->aa_stub aa_proc_copy aa_proc_copy aa_stub->aa_proc_copy aa_run_testcase aa_run_testcase (private) aa_run_testcase->aa_stub workflow::test::run_bug_tracker_test workflow::test::run_bug_tracker_test (public) workflow::test::run_bug_tracker_test->aa_stub

Testcases:
acs_admin_check_expired_certificates, auth_password_change, auth_password_recover, auth_password_reset, auth_use_email_for_login_p, auth_email_on_password_change, util__replace_temporary_tags_with_lookups
Source code:
    if {[info exists ::aa_testcase_id]} {
        #
        # Runtime testcase stub.
        # If a stub for this procedure hasn't already been defined, take a copy
        # of the original procedure and add it to the ::aa_stub_names list.
        #
        if {$proc_name ni $::aa_stub_names} {
            lappend ::aa_stub_names $proc_name
            aa_proc_copy $proc_name ${proc_name}_unstubbed
        }
        set ::aa_stub_sequence($proc_name) 1

        aa_proc_copy $proc_name $proc_name "
      global aa_stub_sequence
      global aa_testcase_id
      set sequence_id \$::aa_stub_sequence\($proc_name\)
      incr ::aa_stub_sequence\($proc_name\)
      $new_body
    "
        return
    } else {
        #
        # File wide stub.
        #
        if {![nsv_exists aa_file_wide_stubs [info script]]} {
            nsv_set aa_file_wide_stubs [info script] {}
        }
        nsv_lappend aa_file_wide_stubs [info script] [list $proc_name $new_body]
    }
XQL Not present:
Generic, PostgreSQL, Oracle
[ hide source ] | [ make this the default ]
Show another procedure: