Skip to content

Auto-rollback statements from the beforeall triggers does not work #506

@MickeVr

Description

@MickeVr

In version 3.0.3 I set up my test cases in a beforeall trigger in tables. I am not using any commit statement, however, the data in the beforeall is not removed after execution:

I created the following testcase:

create table testinserts (ts timestamp, col1 varchar2(1000));

CREATE OR REPLACE PACKAGE ut_TEST2 IS
   -- %suite(Test commits)
   -- %suitepath(commit_tests)

   --%beforeall
   PROCEDURE beforeall;

   --%afterall
   PROCEDURE afterall;

   --%beforeeach
   PROCEDURE beforeeach;

   --%aftereach
   PROCEDURE aftereach;

   -- %test(Functionality)
   PROCEDURE ut_TABLE_TYPE;
END ut_TEST2;
/

CREATE OR REPLACE PACKAGE BODY ut_TEST2 IS
   PROCEDURE beforeall IS
   BEGIN
      INSERT INTO testinserts VALUES (SYSTIMESTAMP, 'beforeall');
   END;

   PROCEDURE aftereach IS
   BEGIN
      INSERT INTO testinserts VALUES (SYSTIMESTAMP, 'aftereach');
   END;

   PROCEDURE afterall IS
   BEGIN
      INSERT INTO testinserts VALUES (SYSTIMESTAMP, 'afterall');
   END;

   PROCEDURE beforeeach IS
   BEGIN
      INSERT INTO testinserts VALUES (SYSTIMESTAMP, 'beforeeach');
   END;


   PROCEDURE ut_TABLE_TYPE IS
   BEGIN
      INSERT INTO testinserts VALUES (SYSTIMESTAMP, 'unit test run');
      ut.expect('X', a_message => 'String X').to_equal('X');
   END;
END ut_TEST2;
/


exec ut.run(USER||':commit_tests.'||'ut_TEST2');
commit;

If I query select * from testinserts, I expect nothing, but I get a record with
ts: 27-10-17 09:39:42,863000000 and col1: beforeall

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions