You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The majority of wtPLSQL testing is testing packages. In order to demonstrate wtPLSQL compatibility, this is an example from [utPLSQL V2.3.1 documentation]().
Demonstrations and examples assume successful connection to an [Oracle database](http://www.oracle.com/technetwork/database/database-technologies/express-edition/overview/index.html) with wtPLSQL installed. [wtPLSQL Installation instructions](https://github.com/DDieterich/wtPLSQL/releases) are available on the [wtPLSQL Releases page](https://github.com/DDieterich/wtPLSQL/releases).
1
+
[Website Home Page](../README.md)
4
2
5
-
## Simple Stuff
3
+
#Demonstrations and Examples
6
4
7
-
The simplest check for a wtPLSQL installation is to select the "version from dual".
5
+
---
8
6
9
-
Run this:
10
-
```
11
-
select wtplsql.show_version from dual;
12
-
```
13
-
and get this:
14
-
```
15
-
SHOW_VERSION
16
-
------------
17
-
1.1.0
18
-
```
7
+
Demonstrations and examples assume successful connection to an [Oracle database](http://www.oracle.com/technetwork/database/database-technologies/express-edition/overview/index.html) with wtPLSQL installed. [wtPLSQL Installation instructions](https://github.com/DDieterich/wtPLSQL/releases) are available on the [wtPLSQL Releases page](https://github.com/DDieterich/wtPLSQL/releases).
19
8
20
-
Another simple test is an ad-hoc assertion. This test requires DBMS_OUTPUT. The results of this test are not recorded.
9
+
Test results from assertions can be queried from a set of wtPLSQL tables. The examples here will use the default reporting package called WT_TEXT_REPORT. This package displays test results using DBMS_OUTPUT.
21
10
22
-
Run this:
23
-
```
24
-
set serveroutput on size unlimited format word_wrapped
25
11
26
-
begin
27
-
wt_assert.eq(msg_in => 'Ad-Hoc Test'
28
-
,check_this_in => 1
29
-
,against_this_in => '1');
30
-
end;
31
-
/
32
-
```
33
-
And get this:
34
-
```
35
-
PASS Ad-Hoc Test. EQ - Expected "1" and got "1"
36
-
```
12
+
## The Basics
37
13
38
-
Note: This ad-hoc test also demonstrates implicit data type conversion.
14
+
The [Simple Stuff](Simple-Stuff.md) page is a confidence builder, excellent for first time users of wtPLSQL.
39
15
40
-
The majority of wtPLSQL testing uses a Test Runner. A Test Runner is a PL/SQL package written by the tester. [This page](Test-Runner.md)has an example of a very simple [Test Runner](Test-Runner.md). All the examples below will use Test Runners.
16
+
The [Test Runner](Test-Runner.md)page covers all the basics of creating a Test Runner. wtPLSQL is all about creating and running Test Runners.
41
17
42
18
## Database Object Tests
43
19
More interesting examples actually test database objects. Here is an example test of each database object supported by wtPLSQL.
@@ -56,3 +32,6 @@ More interesting examples actually test database objects. Here is an example tes
56
32
*[Create and Run a Test Suite](Test-Suite.md) - Build a Test Suite package. (Not Ready)
A login, or database session, is required to interact with the Oracle database. The SQL below will create a user that can run these examples. If you already have a database login, this is not necessary.
8
+
9
+
```
10
+
create user wtp_demo identified by wtp_demo
11
+
default tablespace users
12
+
quota unlimited on users
13
+
temporary tablespace temp;
14
+
15
+
grant create session to wtp_demo;
16
+
grant create type to wtp_demo;
17
+
grant create sequence to wtp_demo;
18
+
grant create table to wtp_demo;
19
+
grant create trigger to wtp_demo;
20
+
grant create view to wtp_demo;
21
+
grant create procedure to wtp_demo;
22
+
```
23
+
24
+
The simplest check for a wtPLSQL installation is to select the "version from dual".
25
+
26
+
Run this:
27
+
```
28
+
select wtplsql.show_version from dual;
29
+
```
30
+
and get this:
31
+
```
32
+
SHOW_VERSION
33
+
------------
34
+
1.1.0
35
+
```
36
+
37
+
Another simple test is an ad-hoc assertion. This test requires DBMS_OUTPUT. The results of this test are not recorded.
38
+
39
+
Run this:
40
+
```
41
+
set serveroutput on size unlimited format word_wrapped
42
+
43
+
begin
44
+
wt_assert.eq(msg_in => 'Ad-Hoc Test'
45
+
,check_this_in => 1
46
+
,against_this_in => '1');
47
+
end;
48
+
/
49
+
```
50
+
And get this:
51
+
```
52
+
PASS Ad-Hoc Test. EQ - Expected "1" and got "1"
53
+
```
54
+
55
+
Note: This ad-hoc test also demonstrates implicit data type conversion.
0 commit comments