Index: openacs-4/packages/xowiki/tcl/test/xowiki-link-test-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/tcl/test/xowiki-link-test-procs.tcl,v diff -u -r1.1.2.3 -r1.1.2.4 --- openacs-4/packages/xowiki/tcl/test/xowiki-link-test-procs.tcl 19 Sep 2019 12:57:42 -0000 1.1.2.3 +++ openacs-4/packages/xowiki/tcl/test/xowiki-link-test-procs.tcl 25 Sep 2019 16:59:07 -0000 1.1.2.4 @@ -1,7 +1,6 @@ namespace eval ::xowiki::test { aa_register_case \ - -init_classes {xowiki_require_test_instance} \ -cats {smoke production_safe} \ -procs { "::xowiki::Page instproc render" @@ -10,21 +9,18 @@ Test links pointing to folders in different instances } { # - # Should we cleanup the test instances after run? - # - set finally_clean_test_instances_p 1 - - # # Set up of the test case. # set main_xowiki_instance_name /xowiki-test set linked_xowiki_instance_name /xowiki-test-linked set main_package_id [::acs::test::require_package_instance \ -package_key xowiki \ + -empty \ -instance_name $main_xowiki_instance_name] set linked_package_id [::acs::test::require_package_instance \ -package_key xowiki \ + -empty \ -instance_name $linked_xowiki_instance_name] aa_log main_package_id=$main_package_id aa_log linked_package_id=$linked_package_id @@ -128,13 +124,5 @@ # reset system locale to saved value # #lang::system::set_locale $defined_locale - - if {$finally_clean_test_instances_p} { - foreach instance_name [list $main_xowiki_instance_name $linked_xowiki_instance_name] { - set node_id [site_node::get_node_id -url /$instance_name] - site_node::unmount -node_id $node_id - site_node::delete -node_id $node_id -delete_package - } - } } } Index: openacs-4/packages/xowiki/tcl/test/xowiki-test-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/tcl/test/xowiki-test-procs.tcl,v diff -u -r1.1.2.28 -r1.1.2.29 --- openacs-4/packages/xowiki/tcl/test/xowiki-test-procs.tcl 3 Jul 2019 20:56:39 -0000 1.1.2.28 +++ openacs-4/packages/xowiki/tcl/test/xowiki-test-procs.tcl 25 Sep 2019 16:59:07 -0000 1.1.2.29 @@ -17,23 +17,7 @@ namespace eval ::xowiki::test { - aa_register_init_class \ - xowiki_require_test_instance { - Make sure the test instance is there and create it if necessary. - } { - aa_export_vars {_xowiki_test_instance_name} - set _xowiki_test_instance_name /xowiki-test - ::acs::test::require_package_instance \ - -package_key xowiki \ - -instance_name $_xowiki_test_instance_name - } { - # Here one might unmount the package afterwards. Right now - # we decide to keep it so it is possible to e.g. inspect - # the results or test further in the mounted instance. - } - aa_register_case \ - -init_classes {xowiki_require_test_instance} \ -cats {smoke production_safe} \ -procs { "::xowiki::Package instproc item_ref" @@ -45,9 +29,28 @@ Test various forms of path resolving } { aa_run_with_teardown -rollback -test_code { + set _xowiki_test_instance_name /xowiki-test + ::acs::test::require_package_instance \ + -package_key xowiki \ + -instance_name $_xowiki_test_instance_name + set instance $_xowiki_test_instance_name set testfolder .testfolder + # get a random swa to be able to create the folder + set swa_context [acs_magic_object security_context_root] + set one_swa [::xo::dc get_value get_swa { + select min(user_id) from users + where acs_permission.permission_p(:swa_context, user_id, 'admin') + }] + set request_info [acs::test::http -user_id $one_swa $instance/] + set folder_info [::xowiki::test::require_test_folder \ + -last_request $request_info \ + -instance $instance \ + -folder_name $testfolder \ + -fresh \ + ] + # # Force the system locale to en_US. The value is # automatically reset to the previous value, since we are @@ -207,7 +210,7 @@ } - aa_register_case -init_classes {xowiki_require_test_instance} -cats {web} -procs { + aa_register_case -cats {web} -procs { "::xo::Package instproc initialize" "::xowiki::Package instproc invoke" "::xo::Package instproc reply_to_user" @@ -228,7 +231,11 @@ # set user_id [ad_conn user_id] - set instance $_xowiki_test_instance_name + set instance /xowiki-test + ::acs::test::require_package_instance \ + -package_key xowiki \ + -instance_name $instance + set testfolder .testfolder try {