_acs-tcl__data_links_update_links (private)

 _acs-tcl__data_links_update_links

Defined in packages/acs-tcl/tcl/test/application-data-link-procs.tcl

Partial Call Graph (max 5 caller/called nodes):
%3 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) ad_generate_random_string ad_generate_random_string (public) _acs-tcl__data_links_update_links _acs-tcl__data_links_update_links _acs-tcl__data_links_update_links->aa_log _acs-tcl__data_links_update_links->aa_log_result _acs-tcl__data_links_update_links->aa_run_with_teardown _acs-tcl__data_links_update_links->aa_true _acs-tcl__data_links_update_links->ad_generate_random_string

Testcases:
No testcase defined.
Source code:
        
        set _aa_export {}
        set body_count 1
        foreach testcase_body {{
    aa_run_with_teardown -rollback -test_code {
        # create some test objects
        set name "cr_item__[ad_generate_random_string]"

        for {set i 0} {$i<10} {incr i} {
            set o($i) [content::item::new  -name ${name}_$i  -title ${name}_$i]
        }

        # generate some text with links between the objects
        foreach n [array names o] {
            append text "\nTest Content Link to $o($n) <a href=\"/o/$o($n)\">Link</a> \n"
        }
        # update the links
        foreach n [array names o] {
            application_data_link::update_links_from  -object_id $o($n)  -text $text
        }
        # scan for links and compare
        set correct_links [lsort [application_data_link::scan_for_links  -text $text]]
        aa_true "Correct links is not empty" [llength $correct_links]
        foreach n [array names o] {
            set links [lsort [application_data_link::get_links_from  -object_id $o($n)]]
            aa_true "Object \#${n} references correct"  {$correct_links eq $links}
        }
        # now change the text and update one of the objects
        for {set i 0} {$i < 5} {incr i} {
            append new_text "\nTest Content Link to $o($i) /o/$o($i) \n"
        }
        for {set i 0} {$i < 5} {incr i} {
            application_data_link::update_links_from  -object_id $o($i)  -text $new_text
        }
        set new_correct_links [lsort [application_data_link::scan_for_links  -text $new_text]]

        for {set i 0} {$i < 5} {incr i} {
            set links [lsort [application_data_link::get_links_from  -object_id $o($i)]]
            aa_true "Object \#${i} updated references correct"  {$new_correct_links eq $links}
        }
    }
}} {
          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" "data_links_update_links (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: