_acs-tcl__data_links_with_tag (private)

 _acs-tcl__data_links_with_tag

Defined in packages/acs-tcl/tcl/test/application-data-link-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-tcl__data_links_with_tag _acs-tcl__data_links_with_tag _acs-tcl__data_links_with_tag->aa_false _acs-tcl__data_links_with_tag->aa_log _acs-tcl__data_links_with_tag->aa_log_result _acs-tcl__data_links_with_tag->aa_run_with_teardown _acs-tcl__data_links_with_tag->aa_true

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<6} {incr i} {
        set o($i) [content::item::new  -name ${name}_$i  -title ${name}_$i]
        }

        aa_log "Creating link between objects"
        application_data_link::new -this_object_id $o(0) -target_object_id $o(1) -relation_tag tag

        aa_true "Verify objects are linked"  [application_data_link::link_exists  -from_object_id $o(0)  -to_object_id $o(1)  -relation_tag tag]

        aa_log "Deleting links attached to first object"
        application_data_link::delete_links -object_id $o(0)

        aa_false "Verify objects are deleted"  [application_data_link::link_exists  -from_object_id $o(0)  -to_object_id $o(1)  -relation_tag tag]

        aa_log "Creating many links between objects"
        application_data_link::new -this_object_id $o(0) -target_object_id $o(1) -relation_tag tag1
        application_data_link::new -this_object_id $o(0) -target_object_id $o(2) -relation_tag tag1
        application_data_link::new -this_object_id $o(0) -target_object_id $o(3) -relation_tag tag2
        application_data_link::new -this_object_id $o(3) -target_object_id $o(4) -relation_tag tag2
        application_data_link::new -this_object_id $o(3) -target_object_id $o(5) -relation_tag tag2

        aa_true "Verify link for tag1"  {[llength [application_data_link::get_linked -from_object_id $o(0)  -to_object_type [acs_object_type $o(0)] -relation_tag tag1]] == 2}

        aa_true "Verify link for tag2"  {[llength [application_data_link::get_linked -from_object_id $o(3)  -to_object_type [acs_object_type $o(3)] -relation_tag tag2]] == 3}

        aa_true "Verify content link"  {[llength [application_data_link::get_linked_content -from_object_id $o(0)  -to_content_type content_revision -relation_tag tag1]] == 2}

        aa_true "Verify links to one object with multiple link tags"  {[llength [application_data_link::get -object_id $o(0) -relation_tag tag1]] == 2}

        aa_true "Verify links to one object with multiple link tags"  {[llength [application_data_link::get -object_id $o(0) -relation_tag tag2]] == 1}

    }
}} {
          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_with_tag (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: