|
--%disabled
|
Suite / context / test will not execute
|
|
--%rollback(auto / manual)
|
|
|
--%displayname( description )
|
Description of context / test / suite
|
|
--%test(description)
|
Procedure is a test (with description)
|
|
--%beforetest(procedure [, ...])
|
Procedure(s) to run
before annotated test |
|
--%aftertest(procedure [, ...])
|
Procedure(s) to run
after annotated test |
|
--%beforeall
|
Procedure to run
before first test in suite/context |
|
--%afterall
|
Procedure to run
after last test in suite/context |
|
--%beforeeach
|
Procedure to run
before each test in suite/context |
|
--%aftereach
|
Procedure to run
after each test in suite/context |
|
--%throws(exception [, ...])
|
Test expects
exception(s) to be thrown |
|
--%suite(description)
|
Package is a test suite
(with description) |
|
--%suitepath(com.acme.bomb)
|
Similar to classpath (Java)
Group suites in namespaces |
|
--%context(name)
|
Starts sub-suite in a suite
|
|
--%endcontext
|
Ends sub-suite in a suite
|
|
--%beforeall(procedure [, ...])
|
Procedure(s) to run
before all tests in suite/context |
|
--%afterall(procedure [, ...])
|
Procedure(s) to run
after all tests in suite/context |
|
--%beforeeach(procedure [, ...])
|
Procedure(s) to run
before each tests in suite/context |
|
--%aftereach(procedure [, ...])
|
Procedure(s) to run
after each tests in suite/context |
|
equal
ut.expect( 'a dog' ).to_equal(a_nulls_are_equal is true by default |
|
equal with cursors
open l_expected for select * from all_objects;open l_actual for select * from all_objects;ut.expect( l_expected )
|
|
equal on objects
ut.expect(
|
|
equal on collections
ut.expect(
|
|
Base expectation
ut.expect( actual_value ).to_( matcher );
|
|
Negated expectation
ut.expect( actual_value ).not_to( matcher );
|
|
Shortcuts syntax
ut.expect( actual_value ).to_matcher;ut.expect( actual_value ).not_to_matcher;
|
exec ut.run(); |
All tests in my current schema
|
alter session set current_schema='HR';exec ut.run(); |
All tests in current schema after it was changed to HR
|
exec ut.run('HR'); |
All tests in specific schema
|
exec ut.run('test_betwnstr'); |
All tests in package of current schema
|
exec ut.run('hr.test_betwnstr.big_end_position'); |
Specific test only
|
exec ut.run( |
Run several items
|
exec ut.run(':com.my_org.my_project'); |
Run using suitepath
|
select * from table(ut.run()); |
All tests as a select statement
|
|
be_like
ut.expect( 'Lorem_impsum' ).to_be_like(ut.expect( 'Lorem_impsum' ).to_be_like( '%re%su' );a_mask, a_escape_char -> see Oracle like operator |
|
match
ut.expect( '123-456-ABcd' ).to_match(ut.expect( 'some value' ).to_match( '^some.*' );a_pattern, a_modifiers -> see regexp_like function |
|
be_between
ut.expect( 3 ).to_be_between( 1, 3 );
|
|
be_greater_or_equal
ut.expect( 3 ).to_be_greater_or_equal( 2 );
|
|
be_greater_than
ut.expect( 2 ).to_be_greater_than( 1 );
|
|
be_less_or_equal
ut.expect( 3 ).to_be_less_or_equal( 3 );
|
|
be_less_than
ut.expect( 3 ).to_be_less_than( 4 );
|
|
have_count
ut_expect( v_cursor ).to_have_count(10);
|
|
be_empty
open l_cursor for select * from dual where 1 = 0;ut.expect( l_cursor ).to_( be_empty() );
|
|
be_true
ut.expect( ( 1 = 1 ) ).to_( be_true() );
|
|
be_false
ut.expect( ( 1 = 0 ) ).to_( be_false() );
|
|
be_null
ut.expect( 1 ).to_( be_null() );
|
|
be_not_null
ut.expect( to_clob('ABC') ).to_( be_not_null() );
|
|
Color output
|
|
JUnit reporter
|
|
Coverage html reporter
exec ut.run(ut_coverage_html_reporter());Produces HTML coverage report |
No comments yet.
Cheatography n. The art of mapping complex subjects into clear, instantly navigable reference guides.