_acs-tcl__ad_proc_change_state_member (private)

 _acs-tcl__ad_proc_change_state_member

Defined in packages/acs-tcl/tcl/test/test-membership-rel-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) aa_run_with_teardown aa_run_with_teardown (public) acs::test::user::create acs::test::user::create (public) _acs-tcl__ad_proc_change_state_member _acs-tcl__ad_proc_change_state_member _acs-tcl__ad_proc_change_state_member->aa_equals _acs-tcl__ad_proc_change_state_member->aa_log _acs-tcl__ad_proc_change_state_member->aa_log_result _acs-tcl__ad_proc_change_state_member->aa_run_with_teardown _acs-tcl__ad_proc_change_state_member->acs::test::user::create

Testcases:
No testcase defined.
Source code:
        
        set _aa_export {}
        set body_count 1
        foreach testcase_body {{
    aa_run_with_teardown -rollback -test_code {

        # We get a user_id as party_id
        set user_id [db_nextval acs_object_id_seq]

        # Create the user
        set user_info [acs::test::user::create -user_id $user_id]
        set rel_id [db_string get_rel_id "select max(rel_id) from acs_rels where object_id_two = :user_id" -default 0]

        # Try to change his state to approved
        aa_log "We change the state to approved"
        membership_rel::approve -rel_id $rel_id
        set member_state [acs_user::get -user_id $user_id -element member_state]

        # Verifying if the state was changed
        aa_equals "Changed State to aprroved"  $member_state "approved"

        
        # Try to change his state to banned
        aa_log "We change the state to banned"
        membership_rel::ban -rel_id $rel_id
        set member_state [acs_user::get -user_id $user_id -element member_state]

        # Verifying if the state was changed
        aa_equals "Changed State to banned"  $member_state "banned"


        # Try to change his state to rejected
        aa_log "We change the state to rejected"
        membership_rel::reject -rel_id $rel_id
        set member_state [acs_user::get -user_id $user_id -element member_state]

        # Verifying if the state was changed
        aa_equals "Changed State to rejected"  $member_state "rejected"


        # Try to change his state to unapproved
        aa_log "We change the state to unapproved"
        membership_rel::unapprove -rel_id $rel_id
        set member_state [acs_user::get -user_id $user_id -element member_state]

        # Verifying if the state was changed
        aa_equals "Changed State to unapproved"   $member_state "needs approval"

        # Try to change his state to expired
        aa_log "We change the state to expired"
        membership_rel::expire -rel_id $rel_id
        set member_state [acs_user::get -user_id $user_id -element member_state]

        # Verifying if the state was changed
        aa_equals "Changed State to expired"   $member_state "expired"

        # Try to change his state to deleted
        aa_log "We change the state to deleted"
        membership_rel::delete -rel_id $rel_id
        set member_state [acs_user::get -user_id $user_id -element member_state]

        # Verifying if the state was changed
        aa_equals "Changed State to deleted"  $member_state "deleted"
    }
}} {
          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" "ad_proc_change_state_member (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: