|
--%suite(description)
|
Package is a test-suite (optional description). Mandatory
|
|
--%suitepath(org.utplsql)
|
Groups suites in hierarchical namespaces
|
|
--%rollback(auto|manual)
|
Automatic (default) / manual transaction control
|
|
--%context(description)
--%endcontext |
Starts/ends sub-suite in suite. Can be nested.
|
|
--%disabled
|
Tests of suite/context won't be executed
|
|
--%beforeall(procedure [, ...])
--%afterall... |
Procedure(s) to run before/after all tests in the suite/context
|
|
--%beforeeach(procedure [, ...])
--%aftereach... |
Procedure(s) to run before/after each test in the suite/context
|
|
--%tags(myTag[, ...)
|
Label a test/context/suite
|
|
--%test(description)
|
Procedure is a test (with optional description)
|
|
--%disabled
|
Test won't be executed
|
|
--%throws(exception [, ...])
|
Test expects exception(s) to be thrown
|
|
--%beforeall, --%afterall
--%beforeeach, --%aftereach |
Procedure to run before/after all/each tests in the suite/context
|
|
--%beforetest(procedure [, ...])
--%aftertest(procedure [, ...]) |
Procedure(s) to be run before/after annotated test
|
|
--%tags(myTag[, ...)
|
Label test
|
exec ut.run(); |
Run all tests to the default reporter (DBMS_OUTPUT)
|
select * from table( ut.run()); |
Run all tests and display output as result set
|
ut.run('my_suite_pckg') |
Run only the specified suite by name (current schema)
|
ut.run('HR') |
Run all tests in specific schema
|
ut.run('my_suite.test1, |
Run list of items
|
ut.run(':my.suite.path') |
Run specific suite path
|
a_force_manual_rollback |
True/False. Run specified test and don't rollback changes (leaves open transaction)
|
a_random_test_order |
True/False. Run tests in random order
|
a_color_console |
True/False. Color-code output (for Windows see ANSICON)
|
a_client_character_set |
Define report's character-set
|
a_tags |
exec ut.run(ut_junit_reporter());
UT_DOCUMENTATION_REPORTER |
Textual pretty-print of test results. Default
|
UT_COVERAGE_HTML_REPORTER |
HTML Coverage Report, includes SourceCode
|
UT_JUNIT_REPORTER |
Test results conforming to JUnit 4 and above
|
UT_REALTIME_REPORTER |
Test results and additional information as XML. Allows to show progress information
|
UT_SONAR_TEST_REPORTER |
JSON Test results designed for SonarQube
|
|
Base expectation
ut.expect( actual_value ).to_( matcher ); |
|
Negated expectation
ut.expect( actual_value ).not_to_( matcher ); |
|
Shortcut syntax (recommended)
ut.expect( actual_value ).to_matcher; |
ut.expect(1, 'Additional text').to_equal(3); |
ut.expect(1=1).to_be_true(); |
ut.expect(1 is null).to_be_false(); |
ut.expect(null).to_be_null(); |
ut.expect(to_clob('ABC')).to_be_not_null(); |
ut.expect( 3 ).to_be_between( 1, 3 ); |
ut.expect( 3 ).to_be_greater_or_equal( 2 ); |
ut.expect( 2 ).to_be_greater_than( 1 ); |
ut.expect( 3 ).to_be_less_or_equal( 3 ); |
ut.expect( 3 ).to_be_less_than( 4 ); |
ut.expect( 'a dog' ).to_equal('a dog',a_nulls_are_equal is true by default |
|
equal on objects
ut.expect(anydata.convertObject(l_expect)) |
|
equal on collections
ut.expect(anydata.convertCollection(l_expect)) |
table of record , select from them and use cursor comparsion
|
be_like
|
ut.expect( 'Lorem_impsum' ) |
|
be_like
with escape |
ut.expect( 'Lorem_impsum' )see Oracle like operator |
|
match
|
ut.expect('some value') |
|
match
with options |
ut.expect( '123-456-ABcd' )See regexp_like function |
|
Basic example
open l_expected for select * from all_objects; |
|
Special Matchers
ut.expect(l_actual).to_have_count(5);ut.expect(l_actual).to_be_empty(); |
|
Type: List of strings
ut_varchar2_list('String 1', 'String 2', ...) |
|
Type: List of reporters
ut_reporters(ut_documentation_reporter(), ut_junit_reporter()) |
|
Select all tests
select * from table( |
No comments yet.
Cheatography n. The art of mapping complex subjects into clear, instantly navigable reference guides.