Skip to content

Feature/introduce testing with accurate grants #893

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 36 commits into from
Apr 3, 2019
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
133ecae
Adding new API user.
lwasylow Mar 22, 2019
9db8f4b
Separating tests.
lwasylow Mar 23, 2019
13f772a
Merge branch 'develop' of github.com:utPLSQL/utPLSQL into feature/int…
lwasylow Mar 24, 2019
c56943e
Update properties
lwasylow Mar 24, 2019
5afba10
Change user that executes tests as helper that is super user.
lwasylow Mar 24, 2019
7cd92e7
Adding next set of tests migrated.
lwasylow Mar 24, 2019
e2561bc
Adding next set of tests migrated.
lwasylow Mar 25, 2019
887e46a
Fixing test package
lwasylow Mar 25, 2019
28dbd1e
Added set of tests:
lwasylow Mar 25, 2019
d7eb125
Adding set of tests :
lwasylow Mar 25, 2019
99e1099
Adding schema prefix to failing tests from 12.1
lwasylow Mar 25, 2019
04cd36c
Fixing development scripts
lwasylow Mar 25, 2019
3e98723
Fixed bug for deployments with uninstall included.
jgebal Mar 25, 2019
ba83f8f
Merge branch 'feature/introduce_testing_with_accurate_grants' of gith…
lwasylow Mar 26, 2019
0bf1d9e
FIX : removal of non existing types from uninstall script
lwasylow Mar 26, 2019
e914d96
INSTALL:Is it too many monkeys ?:)
lwasylow Mar 26, 2019
174dcbc
Adding set of tests:
lwasylow Mar 26, 2019
0c05daf
Adding set of tests:
lwasylow Mar 26, 2019
80783c3
Adding set of tests:
lwasylow Mar 28, 2019
c4b08af
Adding set of tests:
lwasylow Mar 28, 2019
0618616
Adding set of tests:
lwasylow Mar 28, 2019
29295b7
Adding set of tests:
lwasylow Mar 29, 2019
30b0cfe
Adding set of tests:
lwasylow Mar 29, 2019
3cc34ea
Adding tests
lwasylow Mar 29, 2019
a6a848d
Adding tests:
lwasylow Mar 30, 2019
858372c
Adding set of tests:
lwasylow Mar 31, 2019
620fd61
Adding extra tests:
lwasylow Mar 31, 2019
e6b0673
Merge branch 'develop' of github.com:utPLSQL/utPLSQL into feature/int…
lwasylow Mar 31, 2019
c508e79
Adding tests:
lwasylow Apr 1, 2019
858a675
Fixing broken test.
lwasylow Apr 1, 2019
1642f47
Adding test:
lwasylow Apr 1, 2019
30d27fe
Adding global setup
lwasylow Apr 1, 2019
3b07c6a
Merge branch 'develop' of github.com:utPLSQL/utPLSQL into feature/int…
lwasylow Apr 2, 2019
a8dfa14
Merge branch 'develop' of github.com:utPLSQL/utPLSQL into feature/int…
lwasylow Apr 2, 2019
5d3b18c
Update cleanup script after branching from random order branch
lwasylow Apr 2, 2019
b56d27a
Fixed invalid suitepath in `core` package.
jgebal Apr 3, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Adding test:
unary/test_expect_to_be_not_null
  • Loading branch information
lwasylow committed Apr 1, 2019
commit 1642f478e2be5abcfd065df1e37874f3b085bf3c
2 changes: 2 additions & 0 deletions test/install_ut3_user_tests.sql
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ prompt Install user tests
@@ut3_user/expectations/unary/test_expect_to_be_empty.pks
@@ut3_user/expectations/unary/test_expect_to_have_count.pks
@@ut3_user/expectations/unary/test_expect_to_be_true_false.pks
@@ut3_user/expectations/unary/test_expect_to_be_not_null.pks
@@ut3_user/expectations/binary/test_equal.pks
@@ut3_user/expectations/binary/test_expect_to_be_less_than.pks
@@ut3_user/expectations/binary/test_be_less_or_equal.pks
Expand Down Expand Up @@ -47,6 +48,7 @@ set define off
@@ut3_user/expectations/unary/test_expect_to_be_empty.pkb
@@ut3_user/expectations/unary/test_expect_to_have_count.pkb
@@ut3_user/expectations/unary/test_expect_to_be_true_false.pkb
@@ut3_user/expectations/unary/test_expect_to_be_not_null.pkb
@@ut3_user/expectations/binary/test_equal.pkb
@@ut3_user/expectations/binary/test_expect_to_be_less_than.pkb
@@ut3_user/expectations/binary/test_be_less_or_equal.pkb
Expand Down
264 changes: 264 additions & 0 deletions test/ut3_user/expectations/unary/test_expect_to_be_not_null.pkb
Original file line number Diff line number Diff line change
@@ -0,0 +1,264 @@
create or replace package body test_expect_to_be_not_null
is
gc_object_name constant varchar2(30) := 't_to_be_not_null_test';
gc_nested_table_name constant varchar2(30) := 'tt_to_be_not_null_test';
gc_varray_name constant varchar2(30) := 'tv_to_be_not_null_test';

procedure cleanup_expectations is
begin
ut3_tester_helper.main_helper.clear_expectations( );
end;

procedure create_types is
pragma autonomous_transaction;
begin
execute immediate 'create type '||gc_object_name||' is object (dummy number)';
execute immediate 'create type '||gc_nested_table_name||' is table of number';
execute immediate 'create type '||gc_varray_name||' is varray(1) of number';
end;

procedure drop_types is
pragma autonomous_transaction;
begin
execute immediate 'drop type '||gc_object_name;
execute immediate 'drop type '||gc_nested_table_name;
execute immediate 'drop type '||gc_varray_name;
end;

procedure blob_not_null is
begin
--Act
execute immediate ut3_tester_helper.expectations_helper.unary_expectation_block('to_be_not_null', 'blob', 'to_blob(''abc'')');
--Assert
ut.expect(ut3_tester_helper.main_helper.get_failed_expectations_num).to_equal(0);
end;

procedure empty_blob is
begin
--Act
execute immediate ut3_tester_helper.expectations_helper.unary_expectation_block('to_be_not_null', 'blob', 'empty_blob()');
--Assert
ut.expect(ut3_tester_helper.main_helper.get_failed_expectations_num).to_equal(0);
end;

procedure boolean_not_null is
begin
--Act
execute immediate ut3_tester_helper.expectations_helper.unary_expectation_block('to_be_not_null', 'boolean', 'true');
--Assert
ut.expect(ut3_tester_helper.main_helper.get_failed_expectations_num).to_equal(0);
end;

procedure clob_not_null is
begin
--Act
execute immediate ut3_tester_helper.expectations_helper.unary_expectation_block('to_be_not_null', 'clob', 'to_clob(''abc'')');
--Assert
ut.expect(ut3_tester_helper.main_helper.get_failed_expectations_num).to_equal(0);
end;

procedure empty_clob is
begin
--Act
execute immediate ut3_tester_helper.expectations_helper.unary_expectation_block('to_be_not_null', 'clob', 'empty_clob()');
--Assert
ut.expect(ut3_tester_helper.main_helper.get_failed_expectations_num).to_equal(0);
end;

procedure date_not_null is
begin
--Act
execute immediate ut3_tester_helper.expectations_helper.unary_expectation_block('to_be_not_null', 'date', 'sysdate');
--Assert
ut.expect(ut3_tester_helper.main_helper.get_failed_expectations_num).to_equal(0);
end;

procedure number_not_null is
begin
--Act
execute immediate ut3_tester_helper.expectations_helper.unary_expectation_block('to_be_not_null', 'number', '1234');
--Assert
ut.expect(ut3_tester_helper.main_helper.get_failed_expectations_num).to_equal(0);
end;

procedure timestamp_not_null is
begin
--Act
execute immediate ut3_tester_helper.expectations_helper.unary_expectation_block('to_be_not_null', 'timestamp', 'systimestamp');
--Assert
ut.expect(ut3_tester_helper.main_helper.get_failed_expectations_num).to_equal(0);
end;

procedure timestamp_with_ltz_not_null is
begin
--Act
execute immediate ut3_tester_helper.expectations_helper.unary_expectation_block('to_be_not_null', 'timestamp with local time zone', 'systimestamp');
--Assert
ut.expect(ut3_tester_helper.main_helper.get_failed_expectations_num).to_equal(0);
end;

procedure timestamp_with_tz_not_null is
begin
--Act
execute immediate ut3_tester_helper.expectations_helper.unary_expectation_block('to_be_not_null', 'timestamp with time zone', 'systimestamp');
--Assert
ut.expect(ut3_tester_helper.main_helper.get_failed_expectations_num).to_equal(0);
end;

procedure varchar2_not_null is
begin
--Act
execute immediate ut3_tester_helper.expectations_helper.unary_expectation_block('to_be_not_null', 'varchar2(4000)', '''abc''');
--Assert
ut.expect(ut3_tester_helper.main_helper.get_failed_expectations_num).to_equal(0);
end;

procedure initialized_object is
begin
--Act
execute immediate ut3_tester_helper.expectations_helper.unary_expectation_object_block(
'to_be_not_null', gc_object_name, gc_object_name||'(1)', 'object'
);
--Assert
ut.expect(ut3_tester_helper.main_helper.get_failed_expectations_num).to_equal(0);
end;

procedure initialized_nested_table is
begin
--Act
execute immediate ut3_tester_helper.expectations_helper.unary_expectation_object_block(
'to_be_not_null', gc_nested_table_name, gc_nested_table_name||'()', 'collection'
);
--Assert
ut.expect(ut3_tester_helper.main_helper.get_failed_expectations_num).to_equal(0);
end;

procedure initialized_varray is
begin
--Act
execute immediate ut3_tester_helper.expectations_helper.unary_expectation_object_block(
'to_be_not_null', gc_varray_name, gc_varray_name||'()', 'collection'
);
--Assert
ut.expect(ut3_tester_helper.main_helper.get_failed_expectations_num).to_equal(0);
end;

procedure null_blob is
begin
--Act
execute immediate ut3_tester_helper.expectations_helper.unary_expectation_block('to_be_not_null', 'blob', 'null');
--Assert
ut.expect(ut3_tester_helper.main_helper.get_failed_expectations_num).to_be_greater_than(0);
end;

procedure null_boolean is
begin
--Act
execute immediate ut3_tester_helper.expectations_helper.unary_expectation_block('to_be_not_null', 'boolean', 'null');
--Assert
ut.expect(ut3_tester_helper.main_helper.get_failed_expectations_num).to_be_greater_than(0);
end;


procedure null_clob is
begin
--Act
execute immediate ut3_tester_helper.expectations_helper.unary_expectation_block('to_be_not_null', 'clob', 'null');
--Assert
ut.expect(ut3_tester_helper.main_helper.get_failed_expectations_num).to_be_greater_than(0);
end;


procedure null_date is
begin
--Act
execute immediate ut3_tester_helper.expectations_helper.unary_expectation_block('to_be_not_null', 'date', 'null');
--Assert
ut.expect(ut3_tester_helper.main_helper.get_failed_expectations_num).to_be_greater_than(0);
end;


procedure null_number is
begin
--Act
execute immediate ut3_tester_helper.expectations_helper.unary_expectation_block('to_be_not_null', 'number', 'null');
--Assert
ut.expect(ut3_tester_helper.main_helper.get_failed_expectations_num).to_be_greater_than(0);
end;


procedure null_timestamp is
begin
--Act
execute immediate ut3_tester_helper.expectations_helper.unary_expectation_block('to_be_not_null', 'timestamp', 'null');
--Assert
ut.expect(ut3_tester_helper.main_helper.get_failed_expectations_num).to_be_greater_than(0);
end;


procedure null_timestamp_with_ltz is
begin
--Act
execute immediate ut3_tester_helper.expectations_helper.unary_expectation_block('to_be_not_null', 'timestamp with local time zone', 'null');
--Assert
ut.expect(ut3_tester_helper.main_helper.get_failed_expectations_num).to_be_greater_than(0);
end;


procedure null_timestamp_with_tz is
begin
--Act
execute immediate ut3_tester_helper.expectations_helper.unary_expectation_block('to_be_not_null', 'timestamp with time zone', 'null');
--Assert
ut.expect(ut3_tester_helper.main_helper.get_failed_expectations_num).to_be_greater_than(0);
end;


procedure null_varchar2 is
begin
--Act
execute immediate ut3_tester_helper.expectations_helper.unary_expectation_block('to_be_not_null', 'varchar2(4000)', 'null');
--Assert
ut.expect(ut3_tester_helper.main_helper.get_failed_expectations_num).to_be_greater_than(0);
end;

procedure null_anydata is
begin
--Act
execute immediate ut3_tester_helper.expectations_helper.unary_expectation_block('to_be_not_null', 'anydata', 'null');
--Assert
ut.expect(ut3_tester_helper.main_helper.get_failed_expectations_num).to_be_greater_than(0);
end;

procedure uninit_object_in_anydata is
begin
--Act
execute immediate ut3_tester_helper.expectations_helper.unary_expectation_object_block(
'to_be_not_null', gc_object_name, 'null', 'object'
);
--Assert
ut.expect(ut3_tester_helper.main_helper.get_failed_expectations_num).to_be_greater_than(0);
end;

procedure uninit_nested_table_in_anydata is
begin
--Act
execute immediate ut3_tester_helper.expectations_helper.unary_expectation_object_block(
'to_be_not_null', gc_nested_table_name, 'null', 'collection'
);
--Assert
ut.expect(ut3_tester_helper.main_helper.get_failed_expectations_num).to_be_greater_than(0);
end;

procedure uninit_varray_in_anydata is
begin
--Act
execute immediate ut3_tester_helper.expectations_helper.unary_expectation_object_block(
'to_be_not_null', gc_varray_name, 'null', 'collection'
);
--Assert
ut.expect(ut3_tester_helper.main_helper.get_failed_expectations_num).to_be_greater_than(0);
end;

end test_expect_to_be_not_null;
/
97 changes: 97 additions & 0 deletions test/ut3_user/expectations/unary/test_expect_to_be_not_null.pks
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
create or replace package test_expect_to_be_not_null
is
--%suite(to_be_not_null)
--%suitepath(utplsql.test_user.expectations.unary)

--%aftereach
procedure cleanup_expectations;

--%beforeall
procedure create_types;

--%afterall
procedure drop_types;

--%test(Gives success for not null blob)
procedure blob_not_null;

--%test(Gives success for empty blob)
procedure empty_blob;

--%test(Gives success for not null boolean)
procedure boolean_not_null;

--%test(Gives success for not null clob)
procedure clob_not_null;

--%test(Gives success for empty clob)
procedure empty_clob;

--%test(Gives success for not null date)
procedure date_not_null;

--%test(Gives success for not null number)
procedure number_not_null;

--%test(Gives success for not null timestamp)
procedure timestamp_not_null;

--%test(Gives success for not null timestamp with local time zone)
procedure timestamp_with_ltz_not_null;

--%test(Gives success for not null timestamp with time zone)
procedure timestamp_with_tz_not_null;

--%test(Gives success for not null varchar2)
procedure varchar2_not_null;

--%test(Gives success for initialized object within anydata)
procedure initialized_object;

--%test(Gives success for initialized nested table within anydata)
procedure initialized_nested_table;

--%test(Gives success for initialized varray within anydata)
procedure initialized_varray;

--%test(Gives failure with null blob)
procedure null_blob;

--%test(Gives failure with null boolean)
procedure null_boolean;

--%test(Gives failure with null clob)
procedure null_clob;

--%test(Gives failure with null date)
procedure null_date;

--%test(Gives failure with null number)
procedure null_number;

--%test(Gives failure null timestamp)
procedure null_timestamp;

--%test(Gives failure with null timestamp with local time zone)
procedure null_timestamp_with_ltz;

--%test(Gives failure with null timestamp with time zone)
procedure null_timestamp_with_tz;

--%test(Gives failure with null varchar2)
procedure null_varchar2;

--%test(Gives failure with null anydata)
procedure null_anydata;

--%test(Gives failure with uninitialized object within anydata)
procedure uninit_object_in_anydata;

--%test(Gives failure with uninitialized nested table within anydata)
procedure uninit_nested_table_in_anydata;

--%test(Gives failure with uninitialized varray within anydata)
procedure uninit_varray_in_anydata;

end test_expect_to_be_not_null;
/
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy