-- $Source: /commtar/monoBANK/CICS_INTF/tkc_c.ada,v $ -- $Revision: 1.2 $ $Date: 88/03/20 15:58:50 $ $Author: chris $ --------------------------- procedure Dummy_trasnaction --------------------------- is begin null; end; with CICS_Task_Control; use CICS_Task_Control; ------------------------------------ package Task_control_testing_utility ------------------------------------ is ----------------------- package Shared_data_pkg ----------------------- is subtype buffer_type is string(1..2); package Shared_data is new Communication_area_pkg ( Communication_area=>Buffer_type); end; end Task_control_testing_utility; with CICS_test_reporter; use CICS_test_reporter; with Task_control_testing_utility; use Task_control_testing_utility; with CICS_exceptions; use CICS_exceptions; with Trace; ----------------------------- procedure tkc_c_1_a_linked_to ----------------------------- is begin Trace.Mark("C2"); exception when Others => unexpected_exception("undocumented exception"); end; with CICS_test_reporter ; use CICS_test_reporter; with Task_control_testing_utility; use Task_control_testing_utility; with CICS_task_control; use CICS_task_control; with CICS_exceptions; use CICS_exceptions; with Trace; with tkc_c_1_a_linked_to; -------------------------- procedure tkc_c_1_a_driver -------------------------- is begin Link(Program=>"TKC1LKTO"); Trace.Mark("R1"); exception when Program_id_error => unexpected_exception("Program_id_error"); when Others => unexpected_exception("undocumented exception"); end; with CICS_test_reporter; use CICS_test_reporter; with Task_control_testing_utility; use Task_control_testing_utility; with CICS_exceptions; use CICS_exceptions; with Trace; -------------------------------- procedure tkc_c_1_b_tranferred_to -------------------------------- is begin Trace.Mark("C2"); exception when Others => unexpected_exception("undocumented exception"); end; with CICS_test_reporter ; use CICS_test_reporter; with Task_control_testing_utility; use Task_control_testing_utility; with CICS_task_control; use CICS_task_control; with CICS_exceptions; use CICS_exceptions; with Trace; with tkc_c_1_b_tranferred_to; -------------------------- procedure tkc_c_1_b_driver -------------------------- is begin Transfer_control(Program=>"TKC1XFTO"); Trace.Mark("R1"); exception when Program_id_error => unexpected_exception("Program_id_error"); when Others => unexpected_exception("undocumented exception"); end; with Trace; with CICS_test_reporter; use CICS_test_reporter; with Task_control_testing_utility; use Task_control_testing_utility; with CICS_exceptions; use CICS_exceptions; with tkc_c_1_a_driver; with tkc_c_1_b_driver; ----------------- procedure tkc_c_1 ----------------- is begin Start_module("tkc_c_1","program Control"); Start_test("tkc_c_1_a","linked to procedure returns control to caller"); Trace.Init; tkc_c_1_a_driver; -- run the test Trace.Mark("R0"); if Trace.Get(0) = "C2" and Trace.Get(1) = "R1" then Pass_test; else Fail_test; end if; Trace.Stop; Start_test("tkc_c_1_b","transferred to procedure does not return " & "control to caller"); Trace.Init; tkc_c_1_b_driver; -- run the test Trace.Mark("R0"); if Trace.Get(0) = "C2" and Trace.Get(1) = "R0" then Pass_test; else Fail_test; end if; Trace.Stop; End_module; exception when Others => unexpected_exception("undocumented exception"); end; with CICS_test_reporter; use CICS_test_reporter; with Task_control_testing_utility; use Task_control_testing_utility; with CICS_exceptions; use CICS_exceptions; with Trace; ----------------------------- procedure tkc_c_2_a_linked_to ----------------------------- is use Shared_data_pkg; package SD renames Shared_data; X : Buffer_type; begin X := SD.Comm_area.all; Trace.Mark(X); exception when Others => unexpected_exception("undocumented exception"); end; with CICS_test_reporter ; use CICS_test_reporter; with Task_control_testing_utility; use Task_control_testing_utility; with CICS_task_control; use CICS_task_control; with CICS_exceptions; use CICS_exceptions; with Trace; with tkc_c_2_a_linked_to; -------------------------- procedure tkc_c_2_a_driver -------------------------- is use Shared_data_pkg; package SD renames Shared_data; X : Buffer_type := "2A"; begin SD.Link(Program=>"TKC2LKTO", Comm_area=>X, Length=>X'Length); exception when Program_id_error => unexpected_exception("Program_id_error"); when Others => unexpected_exception("undocumented exception"); end; with CICS_test_reporter; use CICS_test_reporter; with Task_control_testing_utility; use Task_control_testing_utility; with CICS_exceptions; use CICS_exceptions; with Trace; -------------------------------- procedure tkc_c_2_b_tranferred_to -------------------------------- is use Shared_data_pkg; package SD renames Shared_data; X : Buffer_type; begin X := SD.Comm_area.all; Trace.Mark(X); exception when Others => unexpected_exception("undocumented exception"); end; with CICS_test_reporter ; use CICS_test_reporter; with Task_control_testing_utility; use Task_control_testing_utility; with CICS_task_control; use CICS_task_control; with CICS_exceptions; use CICS_exceptions; with Trace; with tkc_c_2_b_tranferred_to; -------------------------- procedure tkc_c_2_b_driver -------------------------- is use Shared_data_pkg; package SD renames Shared_data; X : Buffer_type := "2B"; begin SD.Transfer_control(Program=>"TKC2XFTO", Comm_area=>X, Length=>X'Length); exception when Program_id_error => unexpected_exception("Program_id_error"); when Others => unexpected_exception("undocumented exception"); end; with Trace; with CICS_test_reporter; use CICS_test_reporter; with Task_control_testing_utility; use Task_control_testing_utility; with CICS_exceptions; use CICS_exceptions; with tkc_c_2_a_driver; with tkc_c_2_b_driver; ----------------- procedure tkc_c_2 ----------------- is begin Start_module("tkc_c_2","passing data via program control and receiving " & "data via Comm_area function"); Start_test("tkc_c_2_a","passing data to linked to procedure"); Trace.Init; tkc_c_2_a_driver; -- run the test if Trace.Get(0) = "2A" then Pass_test; else Fail_test; end if; Trace.Stop; Start_test("tkc_c_2_b","passing data to transferred to procedure"); Trace.Init; tkc_c_2_b_driver; -- run the test if Trace.Get(0) = "2B" then Pass_test; else Fail_test; end if; Trace.Stop; End_module; exception when Others => unexpected_exception("undocumented exception"); end; with CICS_test_reporter; use CICS_test_reporter; with Task_control_testing_utility; use Task_control_testing_utility; with CICS_task_control; use CICS_task_control; with CICS_exceptions; use CICS_exceptions; ----------------- procedure tkc_c_3 ----------------- is begin Start_module("tkc_c_3","Suspend"); Start_test("tkc_c_3_a","issue suspend"); Suspend; Pass_test; End_module; exception when Others => unexpected_exception("undocumented exception"); end; with CICS_test_reporter; use CICS_test_reporter; with Task_control_testing_utility; use Task_control_testing_utility; with CICS_task_control; use CICS_task_control; with CICS_exceptions; use CICS_exceptions; ----------------- procedure tkc_c_4 ----------------- is R : Resource_spec(1..1) := "R"; begin Start_module("tkc_c_4","Enqueue and Dequeue Sequence"); declare begin Start_test("tkc_c_4_a","Enqueue the resource"); Enqueue(Resource=>R); Pass_test; exception when Enqueue_busy => unexpected_exception("Enqueue_busy"); when Others => unexpected_exception("undocumented exception"); end; declare begin Start_test("tkc_c_4_b","Enqueue the resource, expecting it to be busy"); Enqueue(Resource=>R); Fail_test; exception when Enqueue_busy => Pass_test; when Others => unexpected_exception("undocumented exception"); end; declare begin Start_test("tkc_c_4_c","Dequeue the resource then Enqueue, " & "it should still be busy);"); declare begin Dequeue(Resource=>R); exception when Enqueue_busy => unexpected_exception("Enqueue_busy"); when Others => unexpected_exception("undocumented exception"); end; Enqueue(Resource=>R); Fail_test; exception when Enqueue_busy => Pass_test; when Others => unexpected_exception("undocumented exception"); end; declare begin Start_test("tkc_c_4_d","Dequeue the resource then Enqueue, " & "it should be free);"); declare begin Dequeue(Resource=>R); exception when Enqueue_busy => unexpected_exception("Enqueue_busy"); when Others => unexpected_exception("undocumented exception"); end; Enqueue(Resource=>R); Pass_test; exception when Enqueue_busy => unexpected_exception("Enqueue_busy"); when Others => unexpected_exception("undocumented exception"); end; End_module; exception when Others => unexpected_exception("undocumented exception"); end; with CICS_test_reporter; use CICS_test_reporter; with Task_control_testing_utility; use Task_control_testing_utility; with CICS_task_control; use CICS_task_control; with CICS_exceptions; use CICS_exceptions; ----------------- procedure tkc_c_5 ----------------- is begin Start_module("tkc_c_5","Setup_return"); Start_test("tkc_c_5_a","issue Setup_return"); Setup_return(Trans_id=>"Dummy_Transaction"); Pass_test; End_module; exception when Others => unexpected_exception("undocumented exception"); end;