Index: openacs-4/packages/acs-admin/tcl/test/acs-admin-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-admin/tcl/test/acs-admin-procs.tcl,v diff -u -r1.6.2.8 -r1.6.2.9 --- openacs-4/packages/acs-admin/tcl/test/acs-admin-procs.tcl 15 Feb 2021 13:27:30 -0000 1.6.2.8 +++ openacs-4/packages/acs-admin/tcl/test/acs-admin-procs.tcl 16 Feb 2021 20:59:02 -0000 1.6.2.9 @@ -32,6 +32,8 @@ } -procs { acs_admin::check_expired_certificates aa_stub + + exec } acs_admin_check_expired_certificates { Check acs_admin::check_expired_certificates } { @@ -171,6 +173,8 @@ acs_admin::require_site_wide_subsite acs_admin::require_site_wide_package site_node::get + + apm_arg_names_for_callback_type } acs_admin_require_site_wide { Basic check for acs_admin::require_site_wide_subsite and acs_admin::require_site_wide_package Index: openacs-4/packages/acs-api-browser/tcl/test/acs-api-browser-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-api-browser/tcl/test/acs-api-browser-procs.tcl,v diff -u -r1.4.2.22 -r1.4.2.23 --- openacs-4/packages/acs-api-browser/tcl/test/acs-api-browser-procs.tcl 15 Feb 2021 13:41:25 -0000 1.4.2.22 +++ openacs-4/packages/acs-api-browser/tcl/test/acs-api-browser-procs.tcl 16 Feb 2021 20:59:02 -0000 1.4.2.23 @@ -111,6 +111,8 @@ -procs { api_describe_function ad_looks_like_html_p + + util_wrap_list } \ acs_api_browser_api_describe_function { Check api_describe_function @@ -158,6 +160,8 @@ -procs { api_proc_documentation ad_looks_like_html_p + + util_wrap_list } \ acs_api_browser_api_proc_documentation { Check api_proc_documentation Index: openacs-4/packages/acs-authentication/tcl/test/acs-authentication-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-authentication/tcl/test/acs-authentication-procs.tcl,v diff -u -r1.53.2.16 -r1.53.2.17 --- openacs-4/packages/acs-authentication/tcl/test/acs-authentication-procs.tcl 15 Feb 2021 17:53:26 -0000 1.53.2.16 +++ openacs-4/packages/acs-authentication/tcl/test/acs-authentication-procs.tcl 16 Feb 2021 20:59:02 -0000 1.53.2.17 @@ -52,6 +52,11 @@ acs_user::get_user_info auth::authenticate auth::create_user + + util_text_to_url + package_instantiate_object + cr_filename_to_mime_type + package_exec_plsql } \ auth_authenticate { Test the auth::authenticate proc. @@ -206,6 +211,8 @@ acs::test::user::create acs_user::get + util_text_to_url + package_instantiate_object } auth_create_user { Test the auth::create_user proc. } { @@ -371,6 +378,8 @@ -error_level {warning} \ -procs { auth::get_registration_elements + + util_text_to_url } \ auth_get_registration_elements { Test the auth::get_registration_elements proc @@ -453,6 +462,8 @@ auth::password::change parameter::get parameter::set_value + + util_text_to_url } \ auth_password_change { Test the auth::password::change proc. @@ -509,6 +520,9 @@ auth::password::recover_password auth::test::get_password_vars aa_stub + + util_text_to_url + ad_sign } \ auth_password_recover { Test the auth::password::recover_password proc. @@ -542,6 +556,8 @@ -procs { auth::password::get_forgotten_url auth::test::get_password_vars + + util_text_to_url } \ auth_password_get_forgotten_url { Test the auth::password::get_forgotten_url proc. @@ -568,6 +584,8 @@ -procs { auth::password::retrieve auth::test::get_password_vars + + util_text_to_url } \ auth_password_retrieve { Test the auth::password::retrieve proc. @@ -593,6 +611,8 @@ auth::authority::local auth::create_user auth::password::reset + + util_text_to_url } \ auth_password_reset { Test the auth::password::reset proc. @@ -795,6 +815,8 @@ auth::driver::get_parameter_values auth::driver::get_parameters auth::driver::set_parameter_value + + util_text_to_url } \ auth_driver_get_parameter_values { Test the auth::driver::set_parameter_values proc. @@ -856,6 +878,8 @@ auth::create_user auth::get_registration_elements parameter::set_value + + util_text_to_url } \ auth_use_email_for_login_p { Test auth::UseEmailForLoginP @@ -936,6 +960,8 @@ auth::create_user auth::password::change parameter::set_value + + util_text_to_url } \ auth_email_on_password_change { Test acs-kernel.EmailAccountOwnerOnPasswordChangeP parameter Index: openacs-4/packages/acs-authentication/tcl/test/sync-test-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-authentication/tcl/test/sync-test-procs.tcl,v diff -u -r1.28.2.3 -r1.28.2.4 --- openacs-4/packages/acs-authentication/tcl/test/sync-test-procs.tcl 15 Feb 2021 17:53:27 -0000 1.28.2.3 +++ openacs-4/packages/acs-authentication/tcl/test/sync-test-procs.tcl 16 Feb 2021 20:59:02 -0000 1.28.2.4 @@ -543,6 +543,8 @@ auth::sync::job::get_entries auth::sync::job::get_entry util_sets_equal_p + + util_text_to_url } \ sync_batch_ims_example_doc { Test IMS Enterprise 1.1 batch sync with the XML document from the specification. @@ -740,6 +742,8 @@ auth::sync::job::get auth::sync::job::get_entries auth::sync::job::get_entry + + util_text_to_url } \ sync_batch_ims_test { Test IMS Enterprise 1.1 batch sync with a constructed document which actually works @@ -1017,6 +1021,11 @@ ad_url acs_sc::invoke util_current_location + + util_text_to_url + ad_sign + ad_get_signed_cookie_with_expr + ad_verify_signature_with_expr } \ sync_http_get_document { Test the HTTPGet implementation of GetDocument service contract. Index: openacs-4/packages/acs-automated-testing/tcl/test/acs-automated-testing-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-automated-testing/tcl/test/acs-automated-testing-procs.tcl,v diff -u -r1.10.2.5 -r1.10.2.6 --- openacs-4/packages/acs-automated-testing/tcl/test/acs-automated-testing-procs.tcl 14 Feb 2021 21:05:52 -0000 1.10.2.5 +++ openacs-4/packages/acs-automated-testing/tcl/test/acs-automated-testing-procs.tcl 16 Feb 2021 20:59:02 -0000 1.10.2.6 @@ -10,8 +10,7 @@ -procs { aa_equals aa_false - aa_log - aa_register_case + aa_log aa_run_with_teardown aa_section aa_true @@ -24,6 +23,9 @@ acs::test::reply_has_status_code acs::test::user::create acs::test::user::delete + + aa_register_case + aa_runseries } \ webtest_example { @@ -89,10 +91,12 @@ aa_register_case \ -cats {api smoke production_safe} \ -procs { - aa_register_case aa::coverage::proc_coverage aa_equals aa_true + + aa_register_case + aa_runseries } \ aa__coverage_proc_coverage { @@ -137,11 +141,13 @@ aa_register_case \ -cats {api smoke production_safe} \ -procs { - aa_register_case aa::coverage::proc_covered_p aa::coverage::proc_list aa_equals aa_true + + aa_register_case + aa_runseries } \ aa__coverage_proc_proc_list_covered { @@ -185,9 +191,11 @@ aa_register_case \ -cats {api smoke production_safe} \ -procs { - aa_register_case aa::coverage::proc_coverage_level aa_equals + + aa_runseries + aa_register_case } \ aa__coverage_proc_coverage_level { Index: openacs-4/packages/acs-content-repository/tcl/test/acs-content-repository-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-content-repository/tcl/test/acs-content-repository-procs.tcl,v diff -u -r1.9 -r1.9.2.1 --- openacs-4/packages/acs-content-repository/tcl/test/acs-content-repository-procs.tcl 20 Jul 2018 09:00:33 -0000 1.9 +++ openacs-4/packages/acs-content-repository/tcl/test/acs-content-repository-procs.tcl 16 Feb 2021 20:59:03 -0000 1.9.2.1 @@ -16,7 +16,7 @@ } \ acs_content_repository_trivial_smoke_test { Minimal smoke test. -} { +} { aa_run_with_teardown \ -rollback \ @@ -46,7 +46,7 @@ # teardown doesn't seem to eliminate this: set delete_result [content::keyword::delete -keyword_id $new_keyword_id] - # would test that delete works but there's no relevant function in the API + # would test that delete works but there's no relevant function in the API } } Index: openacs-4/packages/acs-content-repository/tcl/test/content-image-test-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-content-repository/tcl/test/content-image-test-procs.tcl,v diff -u -r1.9 -r1.9.2.1 --- openacs-4/packages/acs-content-repository/tcl/test/content-image-test-procs.tcl 20 Jul 2018 09:00:33 -0000 1.9 +++ openacs-4/packages/acs-content-repository/tcl/test/content-image-test-procs.tcl 16 Feb 2021 20:59:03 -0000 1.9.2.1 @@ -82,6 +82,8 @@ content::folder::register_content_type content::item::get_id image::new + + package_object_attribute_list } \ image_new { Index: openacs-4/packages/acs-content-repository/tcl/test/content-item-test-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-content-repository/tcl/test/content-item-test-procs.tcl,v diff -u -r1.13.2.2 -r1.13.2.3 --- openacs-4/packages/acs-content-repository/tcl/test/content-item-test-procs.tcl 26 Aug 2020 16:02:36 -0000 1.13.2.2 +++ openacs-4/packages/acs-content-repository/tcl/test/content-item-test-procs.tcl 16 Feb 2021 20:59:03 -0000 1.13.2.3 @@ -30,6 +30,8 @@ content::type::attribute::new content::type::delete content::type::new + + package_object_attribute_list } \ content_item { content item test @@ -187,8 +189,8 @@ # create a new content type ######################################################### - catch {content::type::delete -content_type "test_type"} errmsg - set new_type_id [content::type::new \ + catch {content::type::delete -content_type "test_type"} errmsg + set new_type_id [content::type::new \ -content_type "test_type" \ -pretty_name "test_type" \ -pretty_plural "test_type" \ Index: openacs-4/packages/acs-lang/tcl/test/acs-lang-test-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-lang/tcl/test/acs-lang-test-procs.tcl,v diff -u -r1.28.2.16 -r1.28.2.17 --- openacs-4/packages/acs-lang/tcl/test/acs-lang-test-procs.tcl 15 Feb 2021 13:27:30 -0000 1.28.2.16 +++ openacs-4/packages/acs-lang/tcl/test/acs-lang-test-procs.tcl 16 Feb 2021 20:59:03 -0000 1.28.2.17 @@ -1070,6 +1070,11 @@ lang::test::execute_upgrade lang::test::setup_test_package lang::test::teardown_test_package + + apm_package_info_file_path + apm_callback_and_log + apm_interface_add + apm_version_enable } upgrade { Test that a package can be upgraded with new catalog files and that the resulting keys and messages Index: openacs-4/packages/acs-subsite/tcl/test/acs-subsite-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/tcl/test/acs-subsite-procs.tcl,v diff -u -r1.12.2.18 -r1.12.2.19 --- openacs-4/packages/acs-subsite/tcl/test/acs-subsite-procs.tcl 14 Feb 2021 21:09:41 -0000 1.12.2.18 +++ openacs-4/packages/acs-subsite/tcl/test/acs-subsite-procs.tcl 16 Feb 2021 20:59:03 -0000 1.12.2.19 @@ -29,6 +29,8 @@ group::new lang::message::unregister lang::util::convert_to_i18n + + util_memoize_flush_pattern } \ group_localization { Create a group and check that the automagical localization @@ -84,6 +86,8 @@ permission::grant rel_segment::new relation_add + + util_memoize_flush_pattern } \ acs_subsite_expose_bug_775 { Exposes Bug 775. @@ -200,11 +204,14 @@ group::member_p group::new relation_add + + util_memoize_flush_pattern } acs_subsite_check_composite_group { - Build a 3-level hierarchy of composite groups and check - memberships. This test case covers the membership and composition - rel insertion triggers and composability of basic membership and - admin rels. + + Build a 3-level hierarchy of composite groups and check + memberships. This test case covers the membership and composition + rel insertion triggers and composability of basic membership and + admin rels. @author Michael Steigman } { Index: openacs-4/packages/acs-tcl/tcl/test/acs-tcl-test-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-tcl/tcl/test/acs-tcl-test-procs.tcl,v diff -u -r1.71.2.33 -r1.71.2.34 --- openacs-4/packages/acs-tcl/tcl/test/acs-tcl-test-procs.tcl 16 Feb 2021 14:19:51 -0000 1.71.2.33 +++ openacs-4/packages/acs-tcl/tcl/test/acs-tcl-test-procs.tcl 16 Feb 2021 20:59:03 -0000 1.71.2.34 @@ -62,6 +62,8 @@ apm_read_package_info_file apm_supported_callback_types db_dml + + apm_attribute_value } \ apm__test_info_file { Test that the procs for interfacing with package info files - @@ -198,6 +200,9 @@ apm_supported_callback_types apm_test_callback_file_path apm_version_id_from_package_key + + apm_callback_format_args + apm_test_callback_proc } apm__test_callback_invoke { Test the proc apm_invoke_callback_proc @@ -1106,69 +1111,12 @@ aa_log "100 years - we know it's wrong because of Tcl library limitations: [util::age_pretty -timestamp_ansi "1904-01-01 12:00:00" -sysdate_ansi "2004-01-01 12:00:00"]" } -aa_register_case \ - -procs db_get_quote_indices \ - -cats {api} \ - db_get_quote_indices { - Test the proc db_get_quote_indices. - @author Peter Marklund -} { - aa_equals "" [db_get_quote_indices {'a'}] {0 2} - aa_equals "" [db_get_quote_indices {'a''}] {} - aa_equals "" [db_get_quote_indices {'a'a'a'}] {0 2 4 6} - aa_equals "" [db_get_quote_indices {a'b'c'd''s'}] {1 3 5 10} - aa_equals "" [db_get_quote_indices {'}] {} - aa_equals "" [db_get_quote_indices {''}] {} - aa_equals "" [db_get_quote_indices {a''a}] {} - aa_equals "" [db_get_quote_indices {a'b'a}] {1 3} - aa_equals "" [db_get_quote_indices {'a''b'}] {0 5} -} - -aa_register_case \ - -procs { - db_bind_var_substitution - db_type - } \ - -cats {api} \ - db_bind_var_substitution { - Test the proc db_bind_var_substitution. - - @author Peter Marklund -} { - - # DRB: Not all of these test cases work for Oracle (select can't be used in - # db_exec_plsql) and bindvar substitution is done by Oracle, not the driver, - # anyway so there's not much point in testing. These tests really test - # Oracle bindvar emulation, in other words... - - if { [db_type] ne "oracle" } { - set sql {to_char(fm.posting_date, 'YYYY-MM-DD HH24:MI:SS')} - aa_equals "don't subst bind vars in quoted date" [db_bind_var_substitution $sql {SS 3 MI 4}] $sql - - set sql {to_char(fm.posting_date, :SS)} - aa_equals "don't subst bind vars in quoted date" [db_bind_var_substitution $sql {SS 3 MI 4}] {to_char(fm.posting_date, '3')} - - set sql {to_char(fm.posting_date, don''t subst ':SS', do subst :SS )} - aa_equals "don't subst bind vars in quoted date" [db_bind_var_substitution $sql {SS 3 MI 4}] {to_char(fm.posting_date, don''t subst ':SS', do subst '3' )} - - - set SS 3 - set db_value [db_exec_plsql test_bind { - select ':SS' - }] - aa_equals "db_exec_plsql should not bind quoted var" $db_value ":SS" - - set db_value [db_exec_plsql test_bind { - select :SS - }] - aa_equals "db_exec_plsql bind not quoted var" $db_value "3" - } -} - aa_register_case -cats {api} \ -bugs 1450 \ - -procs ad_enhanced_text_to_html \ + -procs { + ad_enhanced_text_to_html + } \ ad_enhanced_text_to_html { Process sample text correctly @@ -1187,199 +1135,8 @@ } -aa_register_case \ - -cats {db smoke production_safe} \ - -procs {db_foreach} \ - db__db_foreach { - Checks that db_foreach works as expected - } { - set results [list] - db_foreach query {SELECT a FROM (VALUES (1), (2), (3), (4), (5), (6), (7)) AS X(a)} { - lappend results $a - } - aa_equals "db_foreach collects correct values from query" \ - [list 1 2 3 4 5 6 7] \ - $results - set results "" - db_foreach query {select 1 from dual where 1 = 2} { - set results "found" - } else { - set results "not found" - } - aa_equals "db_foreach executes the 'no row' code block using the 'else' syntax" \ - "not found" \ - $results - - set results "" - db_foreach query {select 1 from dual where 1 = 2} { - set results "found" - } if_no_rows { - set results "not found" - } - aa_equals "db_foreach executes the 'no row' code block using the 'if_no_rows' syntax" \ - "not found" \ - $results - } - aa_register_case \ - -cats {api db} \ - -procs { - db_flush_cache - db_list - db_list_of_lists - db_multirow - db_0or1row - db_string - } \ - db__caching { - test db_* API caching - } { - - # Check db_string caching - - # Check that cached and non-cached calls return the same value. We need to - # check the caching API call twice, once to fill the cache and return the - # value, and again to see that the call returns the proper value from the - # cache. This series ends by testing the flushing of db_cache_pool with an - # exact pattern. - - set not_cached \ - [db_string test1 {select first_names from persons where person_id = 0}] - aa_equals "Test that caching and non-caching db_string call return same result" \ - [db_string -cache_key test1 test1 {select first_names from persons where person_id = 0}] \ - $not_cached - aa_true "Test1 cached value found." \ - ![catch {ns_cache get db_cache_pool test1} errmsg] - aa_equals "Test that cached db_string returns the right value from the cache" \ - [db_string -cache_key test1 test1 {select first_names from persons where person_id = 0}] \ - $not_cached - db_flush_cache -cache_key_pattern test1 - aa_true "Flush of test1 from cache using the exact key" \ - [catch {ns_cache get db_cache_pool test1} errmsg] - - # Check that cached and non-cached calls return the same default if no value - # is returned by the query. This series ends by testing the flushing of the - # entire db_cache_pool cache. - - set not_cached \ - [db_string test2 {select first_names from persons where person_id=1 and person_id=2} \ - -default foo] - aa_equals "Test that caching and non-caching db_string call return same default value" \ - [db_string -cache_key test2 test2 {select first_names from persons where person_id=1 and person_id=2} \ - -default foo] \ - $not_cached - aa_true "Test2 cached value found." \ - ![catch {ns_cache get db_cache_pool test2} errmsg] - aa_equals "Test that caching and non-caching db_string call return same default value" \ - [db_string -cache_key test2 test2 {select first_names from persons where person_id=1 and person_id=2} \ - -default foo] \ - $not_cached - db_flush_cache - aa_true "Flush of test2 by flushing entire pool" \ - [catch {ns_cache get db_cache_pool test2} errmsg] - - # Check that cached and non-cached calls return an error if the query returns - # no data and no default is supplied. This series ends by testing cache flushing - # by "string match" pattern. - - aa_true "Uncached db_string call returns error if query returns no data" \ - [catch {db_string test3 "select first_names from persons where person_id=1 and person_id=2"}] - aa_true "Cached db_string call returns error if query returns no data" \ - [catch {db_string -cache_key test3 test3 "select first_names from persons where person_id=1 and person_id=2"}] - aa_true "db_string call returns error if caching call returned error" \ - [catch {db_string -cache_key test3 test3 "select first_names from persons where person_id=1 and person_id=2"}] - db_flush_cache -cache_key_pattern tes*3 - aa_true "Flush of test3 from cache using pattern" \ - [catch {ns_cache get db_cache_pool test3} errmsg] - - # Check db_list caching - - set not_cached \ - [db_list test4 {select first_names from persons where person_id = 0}] - aa_equals "Test that caching and non-caching db_list call return same result" \ - [db_list -cache_key test4 test4 {select first_names from persons where person_id = 0}] \ - $not_cached - aa_true "Test4 cached value found." \ - ![catch {ns_cache get db_cache_pool test4} errmsg] - aa_equals "Test that cached db_list returns the right value from the cache" \ - [db_list -cache_key test4 test4 {select first_names from persons where person_id = 0}] \ - $not_cached - db_flush_cache - - # Check db_list_of_lists caching - - set not_cached \ - [db_list_of_lists test5 {select * from persons where person_id = 0}] - aa_equals "Test that caching and non-caching db_list_of_lists call return same result" \ - [db_list_of_lists -cache_key test5 test5 {select * from persons where person_id = 0}] \ - $not_cached - aa_true "Test5 cached value found." \ - ![catch {ns_cache get db_cache_pool test5} errmsg] - aa_equals "Test that cached db_list_of_lists returns the right value from the cache" \ - [db_list_of_lists -cache_key test5 test5 {select * from persons where person_id = 0}] \ - $not_cached - db_flush_cache - - # Check db_multirow caching - - db_multirow test6 test6 {select * from persons where person_id = 0} - set not_cached \ - [list test6:rowcount test6:columns [array get test6:1]] - db_multirow -cache_key test6 test6 test6 {select * from persons where person_id = 0} - set cached \ - [list test6:rowcount test6:columns [array get test6:1]] - aa_equals "Test that caching and non-caching db_multirow call return same result" \ - $cached $not_cached - aa_true "Test6 cached value found." \ - ![catch {ns_cache get db_cache_pool test6} errmsg] - db_multirow -cache_key test6 test6 test6 {select * from persons where person_id = 0} - set cached \ - [list test6:rowcount test6:columns [array get test6:1]] - aa_equals "Test that cached db_multirow returns the right value from the cache" \ - $cached $not_cached - db_flush_cache - - # Check db_0or1row caching - - set not_cached \ - [db_0or1row test7 {select * from persons where person_id = 0} -column_array test7] - lappend not_cached [array get test7] - set cached \ - [db_0or1row -cache_key test7 test7 {select * from persons where person_id = 0} -column_array test7] - lappend cached [array get test7] - aa_equals "Test that caching and non-caching db_0or1row call return same result for 1 row" \ - $cached $not_cached - aa_true "Test7 cached value found." \ - ![catch {ns_cache get db_cache_pool test7} errmsg] - set cached \ - [db_0or1row -cache_key test7 test7 {select * from persons where person_id = 0} -column_array test7] - lappend cached [array get test7] - aa_equals "Test that cached db_0or1row returns the right value from the cache for 1 row" \ - $cached $not_cached - db_flush_cache - - # Check db_0or1row caching returns 0 if query returns no values - - set not_cached \ - [db_0or1row test8 {select * from persons where person_id=1 and person_id=2} -column_array test8] - set cached \ - [db_0or1row -cache_key test8 test8 {select * from persons where person_id=1 and person_id=2} -column_array test8] - aa_equals "Test that caching and non-caching db_0or1row call return same result for 0 rows" \ - $cached $not_cached - aa_true "Test8 cached value found." \ - ![catch {ns_cache get db_cache_pool test8} errmsg] - set cached \ - [db_0or1row -cache_key test8 test8 {select * from persons where person_id=1 and person_id=2} -column_array test8] - aa_equals "Test that cached db_0or1row returns the right value from the cache for 0 rows" \ - $cached $not_cached - db_flush_cache - - # Won't check db_1row because it just calls db_0or1row - -} - -aa_register_case \ -cats {api smoke} \ -procs acs_object::package_id \ acs_object__package_id { Index: openacs-4/packages/acs-tcl/tcl/test/db-proc-test-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-tcl/tcl/test/db-proc-test-procs.tcl,v diff -u -r1.1.2.9 -r1.1.2.10 --- openacs-4/packages/acs-tcl/tcl/test/db-proc-test-procs.tcl 15 Feb 2021 17:53:27 -0000 1.1.2.9 +++ openacs-4/packages/acs-tcl/tcl/test/db-proc-test-procs.tcl 16 Feb 2021 20:59:03 -0000 1.1.2.10 @@ -7,6 +7,268 @@ } aa_register_case \ + -procs db_get_quote_indices \ + -cats {api} \ + db_get_quote_indices { + Test the proc db_get_quote_indices. + + @author Peter Marklund +} { + aa_equals "" [db_get_quote_indices {'a'}] {0 2} + aa_equals "" [db_get_quote_indices {'a''}] {} + aa_equals "" [db_get_quote_indices {'a'a'a'}] {0 2 4 6} + aa_equals "" [db_get_quote_indices {a'b'c'd''s'}] {1 3 5 10} + aa_equals "" [db_get_quote_indices {'}] {} + aa_equals "" [db_get_quote_indices {''}] {} + aa_equals "" [db_get_quote_indices {a''a}] {} + aa_equals "" [db_get_quote_indices {a'b'a}] {1 3} + aa_equals "" [db_get_quote_indices {'a''b'}] {0 5} +} + +aa_register_case \ + -cats {db smoke production_safe} \ + -procs { + db_foreach + + db_list_of_ns_sets + db_release_unused_handles + } \ + db__db_foreach { + Checks that db_foreach works as expected + } { + set results [list] + db_foreach query {SELECT a FROM (VALUES (1), (2), (3), (4), (5), (6), (7)) AS X(a)} { + lappend results $a + } + aa_equals "db_foreach collects correct values from query" \ + [list 1 2 3 4 5 6 7] \ + $results + + set results "" + db_foreach query {select 1 from dual where 1 = 2} { + set results "found" + } else { + set results "not found" + } + aa_equals "db_foreach executes the 'no row' code block using the 'else' syntax" \ + "not found" \ + $results + + set results "" + db_foreach query {select 1 from dual where 1 = 2} { + set results "found" + } if_no_rows { + set results "not found" + } + aa_equals "db_foreach executes the 'no row' code block using the 'if_no_rows' syntax" \ + "not found" \ + $results + } + +aa_register_case \ + -cats {api db} \ + -procs { + db_flush_cache + db_list + db_list_of_lists + db_multirow + db_0or1row + db_string + + db_list_of_ns_sets + db_release_unused_handles + } \ + db__caching { + test db_* API caching + } { + + # Check db_string caching + + # Check that cached and non-cached calls return the same value. We need to + # check the caching API call twice, once to fill the cache and return the + # value, and again to see that the call returns the proper value from the + # cache. This series ends by testing the flushing of db_cache_pool with an + # exact pattern. + + set not_cached \ + [db_string test1 {select first_names from persons where person_id = 0}] + aa_equals "Test that caching and non-caching db_string call return same result" \ + [db_string -cache_key test1 test1 {select first_names from persons where person_id = 0}] \ + $not_cached + aa_true "Test1 cached value found." \ + ![catch {ns_cache get db_cache_pool test1} errmsg] + aa_equals "Test that cached db_string returns the right value from the cache" \ + [db_string -cache_key test1 test1 {select first_names from persons where person_id = 0}] \ + $not_cached + db_flush_cache -cache_key_pattern test1 + aa_true "Flush of test1 from cache using the exact key" \ + [catch {ns_cache get db_cache_pool test1} errmsg] + + # Check that cached and non-cached calls return the same default if no value + # is returned by the query. This series ends by testing the flushing of the + # entire db_cache_pool cache. + + set not_cached \ + [db_string test2 {select first_names from persons where person_id=1 and person_id=2} \ + -default foo] + aa_equals "Test that caching and non-caching db_string call return same default value" \ + [db_string -cache_key test2 test2 {select first_names from persons where person_id=1 and person_id=2} \ + -default foo] \ + $not_cached + aa_true "Test2 cached value found." \ + ![catch {ns_cache get db_cache_pool test2} errmsg] + aa_equals "Test that caching and non-caching db_string call return same default value" \ + [db_string -cache_key test2 test2 {select first_names from persons where person_id=1 and person_id=2} \ + -default foo] \ + $not_cached + db_flush_cache + aa_true "Flush of test2 by flushing entire pool" \ + [catch {ns_cache get db_cache_pool test2} errmsg] + + # Check that cached and non-cached calls return an error if the query returns + # no data and no default is supplied. This series ends by testing cache flushing + # by "string match" pattern. + + aa_true "Uncached db_string call returns error if query returns no data" \ + [catch {db_string test3 "select first_names from persons where person_id=1 and person_id=2"}] + aa_true "Cached db_string call returns error if query returns no data" \ + [catch {db_string -cache_key test3 test3 "select first_names from persons where person_id=1 and person_id=2"}] + aa_true "db_string call returns error if caching call returned error" \ + [catch {db_string -cache_key test3 test3 "select first_names from persons where person_id=1 and person_id=2"}] + db_flush_cache -cache_key_pattern tes*3 + aa_true "Flush of test3 from cache using pattern" \ + [catch {ns_cache get db_cache_pool test3} errmsg] + + # Check db_list caching + + set not_cached \ + [db_list test4 {select first_names from persons where person_id = 0}] + aa_equals "Test that caching and non-caching db_list call return same result" \ + [db_list -cache_key test4 test4 {select first_names from persons where person_id = 0}] \ + $not_cached + aa_true "Test4 cached value found." \ + ![catch {ns_cache get db_cache_pool test4} errmsg] + aa_equals "Test that cached db_list returns the right value from the cache" \ + [db_list -cache_key test4 test4 {select first_names from persons where person_id = 0}] \ + $not_cached + db_flush_cache + + # Check db_list_of_lists caching + + set not_cached \ + [db_list_of_lists test5 {select * from persons where person_id = 0}] + aa_equals "Test that caching and non-caching db_list_of_lists call return same result" \ + [db_list_of_lists -cache_key test5 test5 {select * from persons where person_id = 0}] \ + $not_cached + aa_true "Test5 cached value found." \ + ![catch {ns_cache get db_cache_pool test5} errmsg] + aa_equals "Test that cached db_list_of_lists returns the right value from the cache" \ + [db_list_of_lists -cache_key test5 test5 {select * from persons where person_id = 0}] \ + $not_cached + db_flush_cache + + # Check db_multirow caching + + db_multirow test6 test6 {select * from persons where person_id = 0} + set not_cached \ + [list test6:rowcount test6:columns [array get test6:1]] + db_multirow -cache_key test6 test6 test6 {select * from persons where person_id = 0} + set cached \ + [list test6:rowcount test6:columns [array get test6:1]] + aa_equals "Test that caching and non-caching db_multirow call return same result" \ + $cached $not_cached + aa_true "Test6 cached value found." \ + ![catch {ns_cache get db_cache_pool test6} errmsg] + db_multirow -cache_key test6 test6 test6 {select * from persons where person_id = 0} + set cached \ + [list test6:rowcount test6:columns [array get test6:1]] + aa_equals "Test that cached db_multirow returns the right value from the cache" \ + $cached $not_cached + db_flush_cache + + # Check db_0or1row caching + + set not_cached \ + [db_0or1row test7 {select * from persons where person_id = 0} -column_array test7] + lappend not_cached [array get test7] + set cached \ + [db_0or1row -cache_key test7 test7 {select * from persons where person_id = 0} -column_array test7] + lappend cached [array get test7] + aa_equals "Test that caching and non-caching db_0or1row call return same result for 1 row" \ + $cached $not_cached + aa_true "Test7 cached value found." \ + ![catch {ns_cache get db_cache_pool test7} errmsg] + set cached \ + [db_0or1row -cache_key test7 test7 {select * from persons where person_id = 0} -column_array test7] + lappend cached [array get test7] + aa_equals "Test that cached db_0or1row returns the right value from the cache for 1 row" \ + $cached $not_cached + db_flush_cache + + # Check db_0or1row caching returns 0 if query returns no values + + set not_cached \ + [db_0or1row test8 {select * from persons where person_id=1 and person_id=2} -column_array test8] + set cached \ + [db_0or1row -cache_key test8 test8 {select * from persons where person_id=1 and person_id=2} -column_array test8] + aa_equals "Test that caching and non-caching db_0or1row call return same result for 0 rows" \ + $cached $not_cached + aa_true "Test8 cached value found." \ + ![catch {ns_cache get db_cache_pool test8} errmsg] + set cached \ + [db_0or1row -cache_key test8 test8 {select * from persons where person_id=1 and person_id=2} -column_array test8] + aa_equals "Test that cached db_0or1row returns the right value from the cache for 0 rows" \ + $cached $not_cached + db_flush_cache + + # Won't check db_1row because it just calls db_0or1row + +} + +aa_register_case \ + -procs { + db_bind_var_substitution + db_type + + db_exec_plsql + } \ + -cats {api} \ + db_bind_var_substitution { + Test the proc db_bind_var_substitution. + + @author Peter Marklund +} { + + # DRB: Not all of these test cases work for Oracle (select can't be used in + # db_exec_plsql) and bindvar substitution is done by Oracle, not the driver, + # anyway so there's not much point in testing. These tests really test + # Oracle bindvar emulation, in other words... + + if { [db_type] ne "oracle" } { + set sql {to_char(fm.posting_date, 'YYYY-MM-DD HH24:MI:SS')} + aa_equals "don't subst bind vars in quoted date" [db_bind_var_substitution $sql {SS 3 MI 4}] $sql + + set sql {to_char(fm.posting_date, :SS)} + aa_equals "don't subst bind vars in quoted date" [db_bind_var_substitution $sql {SS 3 MI 4}] {to_char(fm.posting_date, '3')} + + set sql {to_char(fm.posting_date, don''t subst ':SS', do subst :SS )} + aa_equals "don't subst bind vars in quoted date" [db_bind_var_substitution $sql {SS 3 MI 4}] {to_char(fm.posting_date, don''t subst ':SS', do subst '3' )} + + + set SS 3 + set db_value [db_exec_plsql test_bind { + select ':SS' + }] + aa_equals "db_exec_plsql should not bind quoted var" $db_value ":SS" + + set db_value [db_exec_plsql test_bind { + select :SS + }] + aa_equals "db_exec_plsql bind not quoted var" $db_value "3" + } +} + +aa_register_case \ -cats {api db smoke} \ -error_level "error" \ -procs { @@ -16,6 +278,9 @@ db_string db_transaction template::multirow + + db_list_of_ns_sets + db_release_unused_handles } \ db__transaction_bug_3440 { Index: openacs-4/packages/acs-tcl/tcl/test/html-conversion-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-tcl/tcl/test/html-conversion-procs.tcl,v diff -u -r1.20.2.7 -r1.20.2.8 --- openacs-4/packages/acs-tcl/tcl/test/html-conversion-procs.tcl 8 Aug 2020 11:19:23 -0000 1.20.2.7 +++ openacs-4/packages/acs-tcl/tcl/test/html-conversion-procs.tcl 16 Feb 2021 20:59:03 -0000 1.20.2.8 @@ -8,7 +8,11 @@ aa_register_case \ -cats {api smoke} \ - -procs {ad_html_to_text} \ + -procs { + ad_html_to_text + + ad_parse_html_attributes_upvar + } \ ad_html_to_text_bold { Test if it converts "b" tags correctly. @@ -21,7 +25,11 @@ aa_register_case \ -cats {api smoke} \ - -procs {ad_html_to_text} \ + -procs { + ad_html_to_text + + ad_parse_html_attributes_upvar + } \ ad_html_to_text_anchor { Test if it converts "a" tags correctly. @@ -42,7 +50,11 @@ aa_register_case \ -cats {api smoke} \ - -procs {ad_html_to_text} \ + -procs { + ad_html_to_text + + ad_parse_html_attributes_upvar + } \ ad_html_to_text_image { Test if it converts "img" tags correctly. @@ -96,7 +108,12 @@ aa_register_case \ -cats {api smoke} \ - -procs {ad_html_security_check} \ + -procs { + ad_html_security_check + + ad_parameter_all_values_as_list + ad_parse_html_attributes_upvar + } \ ad_html_security_check_href_allowed { tests is href attribute is allowed of A tags } { @@ -108,7 +125,12 @@ aa_register_case \ -cats {api smoke} \ - -procs {ad_html_security_check} \ + -procs { + ad_html_security_check + + ad_parameter_all_values_as_list + ad_parse_html_attributes_upvar + } \ ad_html_security_check_forbidden_protolcols { tests is href attribute is forbidden for certain tags } { @@ -138,7 +160,14 @@ aa_register_case \ -cats {api smoke} \ - -procs {ad_html_text_convert ad_enhanced_text_to_html} \ + -procs { + ad_html_text_convert + ad_enhanced_text_to_html + + ad_html_text_convertible_p + ad_enhanced_text_to_plain_text + ad_parse_html_attributes_upvar + } \ ad_html_text_convert { Testing ad_html_text_convert. } { Index: openacs-4/packages/categories/tcl/test/categories-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/categories/tcl/test/categories-procs.tcl,v diff -u -r1.3.2.6 -r1.3.2.7 --- openacs-4/packages/categories/tcl/test/categories-procs.tcl 12 Oct 2020 16:51:29 -0000 1.3.2.6 +++ openacs-4/packages/categories/tcl/test/categories-procs.tcl 16 Feb 2021 20:59:03 -0000 1.3.2.7 @@ -34,11 +34,12 @@ } aa_register_case -procs { - category_tree::add - } -cats { - api - } category_tree_add { - Test the category_tree::add proc. + category_tree::add + category_tree::exists_p +} -cats { + api +} category_tree_add { + Test the category_tree::add proc. } { aa_run_with_teardown \ @@ -53,12 +54,13 @@ } aa_register_case -procs { - category_tree::add - category::add - } -cats { - api - } category_add { - Test the category::add proc. + category_tree::add + category::add + category::exists_p +} -cats { + api +} category_add { + Test the category::add proc. } { aa_run_with_teardown \ @@ -79,13 +81,14 @@ } aa_register_case -procs { - category::add - category::delete - category_tree::add - } -cats { - api - } category_delete { - Test the category::delete proc. + category::add + category::delete + category_tree::add + category::exists_p +} -cats { + api +} category_delete { + Test the category::delete proc. } { aa_run_with_teardown \ @@ -203,24 +206,30 @@ } aa_register_case -procs { - category_tree::add - category_tree::get_name - category_tree::get_data - category_tree::get_id - category_tree::get_id_by_object_title - category_tree::get_categories - category_tree::map - category_tree::get_mapped_trees - category_tree::get_mapped_trees_from_object_list - category_tree::edit_mapping - category_tree::unmap - category_tree::copy - category_tree::update - category_tree::delete - } -cats { - api - } category_tree_procs { - Test different category_tree procs. + category_tree::add + category_tree::get_name + category_tree::get_data + category_tree::get_id + category_tree::get_id_by_object_title + category_tree::get_categories + category_tree::map + category_tree::get_mapped_trees + category_tree::get_mapped_trees_from_object_list + category_tree::edit_mapping + category_tree::unmap + category_tree::copy + category_tree::update + category_tree::delete + category::add + category::get_children + category::get_name + category::get_names + category_tree::exists_p + package_instantiate_object +} -cats { + api +} category_tree_procs { + Test different category_tree procs. } { aa_run_with_teardown -rollback -test_code { # Index: openacs-4/packages/file-storage/tcl/test/file-storage-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/file-storage/tcl/test/file-storage-procs.tcl,v diff -u -r1.10.2.3 -r1.10.2.4 --- openacs-4/packages/file-storage/tcl/test/file-storage-procs.tcl 14 Feb 2021 21:09:41 -0000 1.10.2.3 +++ openacs-4/packages/file-storage/tcl/test/file-storage-procs.tcl 16 Feb 2021 20:59:03 -0000 1.10.2.4 @@ -12,6 +12,12 @@ file_storage::test::create_new_folder file_storage::test::delete_current_folder acs::test::follow_link + + fs_get_root_folder + fs_context_bar_list + ad_form_new_p + ad_user_logout + ad_unset_cookie } \ fs_create_folder { @@ -68,7 +74,11 @@ file_storage::test::create_new_folder file_storage::test::edit_folder file_storage::test::delete_current_folder - acs::test::follow_link + acs::test::follow_link + + fs_get_root_folder + fs_context_bar_list + ad_form_new_p } \ fs_edit_folder { @@ -131,7 +141,7 @@ -cats {web smoke} \ -libraries tclwebtest \ -procs { - aa_display_result + aa_display_result file_storage::twt::call_fs_page file_storage::twt::create_new_folder file_storage::twt::add_file_to_folder Index: openacs-4/packages/forums/tcl/test/forums-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/forums/tcl/test/forums-procs.tcl,v diff -u -r1.11.2.2 -r1.11.2.3 --- openacs-4/packages/forums/tcl/test/forums-procs.tcl 10 Apr 2019 08:50:00 -0000 1.11.2.2 +++ openacs-4/packages/forums/tcl/test/forums-procs.tcl 16 Feb 2021 20:59:03 -0000 1.11.2.3 @@ -175,7 +175,15 @@ aa_register_case \ -cats {api web smoke} \ - -procs {forum::new forum::delete} \ + -procs { + forum::new + forum::delete + + aa_get_first_url + acs_community_member_admin_url + ds_adp_start_box + ds_adp_end_box + } \ -urls { /admin/forum-new } web_forum_new { @@ -214,7 +222,14 @@ aa_register_case \ -cats {api web smoke} \ - -procs {forum::new forum::get forum::delete} \ + -procs { + forum::new + forum::get forum::delete + + aa_get_first_url + acs_community_member_admin_url + ad_context_node_list + } \ -urls { /admin/forum-new /forum-view @@ -265,7 +280,18 @@ aa_register_case \ -cats {web smoke} \ - -procs {forum::new forum::get forum::edit forum::delete} \ + -procs { + forum::new + forum::get + forum::edit + forum::delete + + aa_get_first_url + acs_community_member_admin_url + ad_context_node_list + ds_adp_start_box + ds_adp_end_box + } \ -urls { /admin/forum-new /admin/forum-edit @@ -317,6 +343,13 @@ forum::message::set_state forum::new forum::security::require_post_forum + + aa_get_first_url + acs_community_member_admin_url + ad_context_node_list + ds_adp_start_box + ds_adp_end_box + ad_form } \ -urls { /message-post Index: openacs-4/packages/xowiki/tcl/test/xowiki-admin-tests-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/tcl/test/xowiki-admin-tests-procs.tcl,v diff -u -r1.1.2.12 -r1.1.2.13 --- openacs-4/packages/xowiki/tcl/test/xowiki-admin-tests-procs.tcl 16 Feb 2021 17:22:19 -0000 1.1.2.12 +++ openacs-4/packages/xowiki/tcl/test/xowiki-admin-tests-procs.tcl 16 Feb 2021 20:59:03 -0000 1.1.2.13 @@ -111,6 +111,7 @@ "::xo::db::CrClass proc get_name" "::xo::db::CrClass proc get_child_item_ids" "::xo::PackageMgr proc get_package_class_from_package_key" + ad_ns_set_to_tcl_vars } \ xowiki_test_cases { XoWiki Test Cases 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.41 -r1.1.2.42 --- openacs-4/packages/xowiki/tcl/test/xowiki-test-procs.tcl 16 Feb 2021 17:22:19 -0000 1.1.2.41 +++ openacs-4/packages/xowiki/tcl/test/xowiki-test-procs.tcl 16 Feb 2021 20:59:03 -0000 1.1.2.42 @@ -411,6 +411,8 @@ ::acs::test::xpath::get_form_values "::xo::PackageMgr proc get_package_class_from_package_key" "::xowiki::utility proc formCSSclass" + ad_parse_template + } create_form_with_form_instance { Create an xowiki form and an instance of this form. Here we