_xotcl-core__api__context (private)

 _xotcl-core__api__context

Defined in packages/xotcl-core/tcl/test/api-test-procs.tcl

Partial Call Graph (max 5 caller/called nodes):
%3 aa_equals aa_equals (public) aa_log aa_log (public) aa_log_result aa_log_result (public) ad_conn ad_conn (public) xo::update_query xo::update_query (private) _xotcl-core__api__context _xotcl-core__api__context _xotcl-core__api__context->aa_equals _xotcl-core__api__context->aa_log _xotcl-core__api__context->aa_log_result _xotcl-core__api__context->ad_conn _xotcl-core__api__context->xo::update_query

Testcases:
No testcase defined.
Source code:
        
        set _aa_export {}
        set body_count 1
        foreach testcase_body {{

    set cases {
        {a=1 a 2} "{a 2}"
        {a=1 b 2} "{b 2} {a 1}"
        {a=1&b=2&c=3 b 200} "{b 200} {a 1} {c 3}"
        {a=1&b=2&c=3 b """{b {}} {a 1} {c 3}"
        {a=1 a "hello world""{a {hello world}}"
        {a=1 a "a&b""{a a&b}"
        {a=a%26b&b=2 a 100} "{a 100} {b 2}"
        {a=1&b=2&c=3 c wörld} "{c wörld} {a 1} {b 2}"
        {a=1&w%c3%b6rld=nice&c=1 wörld beautiful} "{wörld beautiful} {a 1} {c 1}"
        {a&b=1 a x} "{a x} {b 1}"
        {a&b=1 b """{b {}} {a {}}"
    }

    foreach {input expected} $cases {
        lassign $input q k v
        aa_equals "update_query_variable $q $k $v"  [::xo::update_query_variable $q $k $v]  $expected
    }

    set cases {
        {a=1 a 2} "a=2"
        {a=1 b 2} "b=2&a=1"
        {a=1&b=2&c=3 b 200} "b=200&a=1&c=3"
        {a=1&b=2&c=3 b """b=&a=1&c=3"
        {a=1 a "hello world""a=hello+world"
        {a=1&b=2 a "a&b""a=a%26b&b=2"
        {a=a%26b&b=2 a 100} "a=100&b=2"
        {a=1&b=2&c=3 c wörld} "c=w%c3%b6rld&a=1&b=2"
        {a=1&w%c3%b6rld=nice&c=1 wörld beautiful} "w%c3%b6rld=beautiful&a=1&c=1"
        {a&b=1 a x} "a=x&b=1"
        {a&b=1 b """b=&a="
    }

    foreach {input expected} $cases {
        lassign $input q k v
        aa_equals "update_query $q $k $v"  [::xo::update_query $q $k $v]  $expected
    }

    xo::ConnectionContext create ::xo::tcc  -package_id [ad_conn package_id]  -parameter_declaration {{-m view} {-folder_id:integer 0}}  -user_id [ad_conn user_id]  -actual_query m=edit&a=1&b  -locale en_US  -url http://test.org
    ::xo::tcc destroy_on_cleanup

    ::xo::tcc process_query_parameter

    aa_log "connection context <pre>[ns_quotehtml [::xo::tcc serialize]]</pre>"
    set cases {
        m "edit"
        folder_id "0"
        a "1"
        b ""
    }
    foreach {p expected} $cases {
        aa_equals "get query variable $p from xo::tcc" [::xo::tcc query_parameter $p$expected
    }
}} {
          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" "api__context (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: