Index: openacs-4/packages/acs-tcl/tcl/test/navigation-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-tcl/tcl/test/navigation-procs.tcl,v diff -u -N -r1.7.2.1 -r1.7.2.2 --- openacs-4/packages/acs-tcl/tcl/test/navigation-procs.tcl 10 Sep 2015 08:22:03 -0000 1.7.2.1 +++ openacs-4/packages/acs-tcl/tcl/test/navigation-procs.tcl 14 Feb 2017 20:18:49 -0000 1.7.2.2 @@ -14,6 +14,7 @@ aa_run_with_teardown -test_code { set testnode_1 [list "/navigation_test_node1/" "navigation_test_node1"] set testnode_2 [list "[lindex $testnode_1 0]navigation_test_node2/" "navigation_test_node2"] + # Create hierarchy from the random created nodes db_1row query { select MIN(node_id) as first_node from site_nodes @@ -82,11 +83,11 @@ # Setup nodes from the context bar, create two random nodes to include set separator "-" - set random [ad_generate_random_string] - set testnode_1 [list "/$random/" $random] + set random1 [ad_generate_random_string] + set testnode_1 [list "/$random1/" "ACS Automated Testing"] - set random [ad_generate_random_string] - set testnode_2 [list "[lindex $testnode_1 0]$random/" $random] + set random2 [ad_generate_random_string] + set testnode_2 [list "[lindex $testnode_1 0]$random2/" "ACS Automated Testing"] set leave_node "ref_final" set root_node [list "/" \#acs-kernel.Main_Site\#] @@ -101,16 +102,31 @@ select MIN(node_id) as first_node from site_nodes } set idp $first_node - set idr_1 [site_node::new -name [lindex $testnode_1 1] -parent_id $idp] - set idr_2 [site_node::new -name [lindex $testnode_2 1] -parent_id $idr_1] - aa_log "Created two test sites nodes: testnode_1 = [lindex $testnode_1 1],testnode_2 = [lindex $testnode_2 1]\n\ntestnode_2 is a testnode_1 children" + set idr_1 [site_node::new -name $random1 -parent_id $idp] + set idr_2 [site_node::new -name $random2 -parent_id $idr_1] + site_node::mount -node_id $idr_1 -object_id [ad_conn package_id] + site_node::mount -node_id $idr_2 -object_id [ad_conn package_id] + aa_log "Created two test sites nodes: testnode_1 = [lindex $testnode_1 1],\n\ + testnode_2 = [lindex $testnode_2 1]n\ + testnode_2 is a child of testnode_1" + array set node [site_node::get -node_id $idp] + array set node1 [site_node::get -node_id $idr_1] + array set node2 [site_node::get -node_id $idr_2] + set msg "" + append msg \ + "node0 $idp parent $node(parent_id) url $node(url) object_id $node(object_id)"\ + "\nnode1 $idr_1 parent $node1(parent_id) url $node1(url) object_id $node1(object_id)" \ + "\nnode2 $idr_2 parent $node2(parent_id) url $node2(url) object_id $node2(object_id)" + aa_log $msg + #----------------------------------------------------------------------- # Case 1: node_id = testnode_1 #----------------------------------------------------------------------- - aa_log "Case 1: node_id = testnode_1" + aa_log "Case 1: node_id = testnode_1 <$testnode_1>" set bar_components [list $root_node $testnode_1 $admin_node] - set context_barp "" + #aa_log "bar_components $bar_components" + set context_barp "" foreach value $bar_components { append context_barp "" + append context_barp "\">" append context_barp [lindex $value 1] - append context_barp "" - append context_barp " $separator " + append context_barp "" + append context_barp " $separator " } append context_barp "$leave_node" set context_bar [ad_context_bar -node_id $idr_2 -separator $separator $leave_node]