aa_register_component (public)

 aa_register_component component_id component_desc body

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

Registers a reusable code component. Provide a component identifier, description and component body code.

This is useful for re-using code that sets up / clears down, data common to many testcases.

Parameters:
component_id
component_desc
body
Author:
Peter Harper
Created:
28 October 2001

Partial Call Graph (max 5 caller/called nodes):
%3 test_db_check_news_archive db_check_news_archive (test news) aa_register_component aa_register_component test_db_check_news_archive->aa_register_component test_db_check_news_create db_check_news_create (test news) test_db_check_news_create->aa_register_component test_db_check_news_set_approve db_check_news_set_approve (test news) test_db_check_news_set_approve->aa_register_component test_db_check_news_status db_check_news_status (test news) test_db_check_news_status->aa_register_component

Testcases:
db_check_news_create, db_check_news_archive, db_check_news_set_approve, db_check_news_status
Source code:
    #
    # Work out the package key
    #
    set package_root [file join $::acs::rootdir packages]
    set package_rel [string replace [info script]  0 [string length $package_root]]
    set package_key [lindex [file split $package_rel] 0]
    #
    # First, search the current list of components. If an old version already
    # exists, replace it with the new version.
    #
    set lpos 0
    set found_pos -1
    foreach component [nsv_get aa_test components] {
        if {[lindex $component 0] == $component_id &&
            [lindex $component 1] == $package_key} {
            nsv_set aa_test components [lreplace [nsv_get aa_test components]  $lpos $lpos  [list $component_id $package_key  $component_desc  [info script]  $body]]
            set found_pos $lpos
            break
        }
        incr lpos
    }
    #
    # If we haven't already replaced an existing entry, append the new
    # entry to the list.
    #
    if {$found_pos == -1} {
        nsv_lappend aa_test components [list $component_id $package_key  $component_desc  [info script]  $body]
    }

    #  set munged_body [subst {uplevel 1 {$body}}]
    d_proc -private _${package_key}__c_$component_id {} $body
XQL Not present:
Generic, PostgreSQL, Oracle
[ hide source ] | [ make this the default ]
Show another procedure: