_acs-authentication__sync_start_end (private)
_acs-authentication__sync_start_end
Defined in packages/acs-authentication/tcl/test/sync-test-procs.tcl
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- No testcase defined.
Source code: set _aa_export {} set body_count 1 foreach testcase_body {{ aa_run_with_teardown -rollback -test_code { # Start noninteractive job set local_authority_id [auth::authority::local] set job_id [auth::sync::job::start -authority_id $local_authority_id] aa_equals "Authority has been stored correctly" [auth::sync::job::get_authority_id -job_id $job_id] $local_authority_id set broken_job_id [db_string get_broken_job { select max(job_id) + 1 from auth_batch_jobs }] aa_true "Querying the authority on an invalid job id fails" [catch { auth::sync::job::get_authority_id -job_id $broken_job_id }] aa_true "Returns a job_id" {$job_id ne ""} # Get doc auth::sync::job::start_get_document -job_id $job_id auth::sync::job::end_get_document -job_id $job_id -doc_status "ok" -doc_message "" -document {<enterprise><person recstatus="1"></person></enterprise>} # Valid successful log entry auth::sync::job::create_entry -job_id $job_id -operation "insert" -username "foobar" -user_id [ad_conn user_id] -success # Valid unsuccessful log entry auth::sync::job::create_entry -job_id $job_id -operation "insert" -username "foobar" -user_id [ad_conn user_id] -message "A problem" -element_messages "" # End job array set job [auth::sync::job::end -job_id $job_id] aa_true "Elapsed time less than 30 seconds" {$job(run_time_seconds) < 30} aa_log "Elapsed time: $job(run_time_seconds) seconds" aa_false "Not interactive" [string is true -strict $job(interactive_p)] aa_equals "Number of actions" $job(num_actions) 2 aa_equals "Number of problems" $job(num_problems) 1 aa_false "Log URL nonempty" {$job(log_url) eq ""} # Purge not deleting the job auth::sync::purge_jobs -num_days 1 aa_equals "Job still exists" [db_string job_exists_p { select count(*) from auth_batch_job_entries where job_id = :job_id }] 2 # Tricking it into deleting the job aa_log "Updating the job end time" db_dml update_job { update auth_batch_jobs set job_end_time = to_date('1974-03-27', 'YYYY-MM-DD') where job_id = :job_id } auth::sync::purge_jobs -num_days 1 aa_equals "Job has been purged" [db_string job_exists_p { select count(*) from auth_batch_job_entries where job_id = :job_id }] 0 } }} { 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" "sync_start_end (body $body_count): Error during execution: $msg, stack trace: \n$::errorInfo" } incr body_count }XQL Not present: Generic, PostgreSQL, Oracle