Skip to content

Commit eb5dad6

Browse files
committed
Changed the way session context is created.
1 parent 0793607 commit eb5dad6

File tree

3 files changed

+9
-14
lines changed

3 files changed

+9
-14
lines changed

docs/userguide/annotations.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2064,9 +2064,15 @@ When processing the test suite `test_employee_pkg` defined in [Example of annota
20642064
20652065
## sys_context
20662066

2067-
It is possible to access information about currently running suite, test and befire/after procedure form within PLSQL procedure using SYS_CONTEXT.
2068-
2067+
It is possible to access information about currently running suite.
20692068
The information is available by calling `sys_context( 'UT3_INFO', attribute )`.
2069+
It can be accessed from any procecure invoked as part of utPLSQL test execution.
2070+
2071+
**Note:**
2072+
> Context name is derived from schema name where utPLSQL is installed.
2073+
> The context name in below examples represents the default install schema -> `UT3`
2074+
> If you install utPLSQL into another schema the context name will be different.
2075+
> For example if utPLSQL is installed into `HR` schema, the context name will be `HR_INFO`
20702076
20712077
Following attributes are populated:
20722078
- Always:

source/core/session_context/ut_session_context.pkb

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,7 @@ create or replace package body ut_session_context as
1515
See the License for the specific language governing permissions and
1616
limitations under the License.
1717
*/
18-
$IF $$SELF_TESTING_INSTALL $THEN
1918
gc_context_name constant varchar2(30) := ut_utils.ut_owner()||'_INFO';
20-
$ELSE
21-
gc_context_name constant varchar2(30) := 'UT3_INFO';
22-
$END
2319

2420
procedure set_context(a_name varchar2, a_value varchar2) is
2521
begin

source/install.sql

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -34,14 +34,7 @@ alter session set current_schema = &&ut3_owner;
3434
@@check_sys_grants.sql "'CREATE TYPE','CREATE VIEW','CREATE SYNONYM','CREATE SEQUENCE','CREATE PROCEDURE','CREATE TABLE', 'CREATE CONTEXT'"
3535
--set define off
3636

37-
begin
38-
$if $$self_testing_install $then
39-
execute immediate 'create or replace context &&ut3_owner._info using &&ut3_owner..ut_session_context';
40-
$else
41-
execute immediate 'create or replace context ut3_info using &&ut3_owner..ut_session_context';
42-
$end
43-
end;
44-
/
37+
create or replace context &&ut3_owner._info using &&ut3_owner..ut_session_context;
4538

4639
--dbms_output buffer cache table
4740
@@install_component.sql 'core/ut_dbms_output_cache.sql'

0 commit comments

Comments
 (0)