_acs-authentication__auth_authority_edit (private)

 _acs-authentication__auth_authority_edit

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

Partial Call Graph (max 5 caller/called nodes):
%3 aa_false aa_false (public) aa_log aa_log (public) aa_log_result aa_log_result (public) aa_run_with_teardown aa_run_with_teardown (public) aa_true aa_true (public) _acs-authentication__auth_authority_edit _acs-authentication__auth_authority_edit _acs-authentication__auth_authority_edit->aa_false _acs-authentication__auth_authority_edit->aa_log _acs-authentication__auth_authority_edit->aa_log_result _acs-authentication__auth_authority_edit->aa_run_with_teardown _acs-authentication__auth_authority_edit->aa_true

Testcases:
No testcase defined.
Source code:
        
        set _aa_export {}
        set body_count 1
        foreach testcase_body {{
    aa_log "Retrieving test authority"
    set authority_id [auth::authority::get_id -short_name "acs_testing"]

    set random_string [ad_generate_random_string]
    set random_object [db_string get_object {
        select max(object_id) from acs_objects
    }]
    set random_boolean [expr {int(rand() * 10) % 2}]
    set random_int [expr {int(rand() * pow(10, 7))}]

    set valid_values [list  short_name $random_string  pretty_name $random_string  help_contact_text $random_string  help_contact_text_format "text/enhanced"  enabled_p $random_boolean  sort_order $random_int  auth_impl_id $random_object  pwd_impl_id $random_object  forgotten_pwd_url $random_string  change_pwd_url $random_string  register_impl_id $random_object  register_url $random_string  user_info_impl_id $random_object  get_doc_impl_id $random_object  process_doc_impl_id $random_object  batch_sync_enabled_p $random_boolean]

    set broken_values $valid_values
    lappend broken_values [ad_generate_random_string""

    set illegal_values $valid_values
    lappend illegal_values authority_id [db_string gen_id {
        select coalesce(max(authority_id), 0) + 1 from auth_authorities
    }]

    aa_run_with_teardown  -rollback  -test_code {
            array set values $broken_values
            aa_true "Trying to update non-existing columns returns an error"  [catch {auth::authority::edit -authority_id $authority_id -array values}]
            array unset values

            array set values $illegal_values
            aa_true "Trying to update illegal columns columns returns an error"  [catch {auth::authority::edit -authority_id $authority_id -array values}]
            array unset values

            array set values $valid_values
            aa_false "Update valid columns and values is fine"  [catch {auth::authority::edit -authority_id $authority_id -array values}]
            array unset values

            auth::authority::get -authority_id $authority_id -array updated_values
            foreach {key value} $valid_values {
                # Check if value is what we set in the update. We need
                # to normalize booleans.
                aa_true "(get): Value '$key' was updated to '$value'"  {[info exists updated_values($key)] && ($updated_values($key) eq $value ||
                                                            ([string is boolean -strict $updated_values($key)] && [string is boolean -strict $value] &&
                                                             [string is true -strict $updated_values($key)] == [string is true -strict $value]))
                    }
                set updated_value [auth::authority::get_element  -authority_id $authority_id  -element      $key]
                aa_true "(get_element): Value '$key' was updated to '$value'"  {$updated_value eq $value ||
                        ([string is boolean -strict $updated_value] && [string is boolean -strict $value] &&
                         [string is true -strict $updated_value] == [string is true -strict $value])
                    }
            }
        }
}} {
          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" "auth_authority_edit (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: