Skip to content

Commit aff62aa

Browse files
committed
changed documentation to asciidoc
1 parent 93d0924 commit aff62aa

File tree

2 files changed

+43
-41
lines changed

2 files changed

+43
-41
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,4 @@
55
config.bat
66
config.sh
77
*.bak
8+
readme.html

readme.txt

Lines changed: 42 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,36 @@
1-
* plsql-codecoverage
1+
= plsql-codecoverage
22

33
plsqlcodecoverage is a program to do code coverages of Oracle PL/SQL code
44
running in the database. Currently only code coverage for packages is
55
supported.
66

7-
** How it works
7+
== How it works
88
The program creates the following database objects:
9-
the tables
10-
aaa_coverage
11-
aaa_coverage_statements
12-
13-
the sequence
14-
aaa_coverage_seq
15-
16-
and the package
17-
aaa_coverage_tool
9+
the tables +aaa_coverage+ and +aaa_coverage_statements+,
10+
the sequence +aaa_coverage_seq+ and the package +aaa_coverage_tool+.
1811

1912
The codecoverage process works by instrumenting the PL/SQL code, a logging
2013
statement is placed before each statement.
2114

2215
Example:
2316
A function
17+
----
2418
function f2(x varchar2) return varchar2 is
2519
begin
2620
return 'd'||x;
2721
end;
28-
22+
----
2923
becomes
30-
24+
----
3125
function f2(x varchar2) return varchar2 is
3226
begin
3327
"$log"(4);return 'd'||x;
3428
end;
29+
----
3530

36-
The execution of the statments is logged into the tables aaa_coverage and
37-
aaa_coverage_statements. Only the first execution of a statement is logged.
38-
The original package state is stored in a clob in table aaa_coverage.
31+
The execution of the statments is logged into the tables +aaa_coverage+ and
32+
+aaa_coverage_statements+. Only the first execution of a statement is logged.
33+
The original package state is stored in a clob in table +aaa_coverage+.
3934

4035
The codecoverage process is started for each package individually.
4136
The codecoverage process works for all sessions that use the instrumented
@@ -52,60 +47,65 @@ Each schema/user has its own version of the database objects.
5247
Needless to say that you should have a copy of your packages. Before instrumemting,
5348
the original source code is saved into a clob, but one never knows.
5449

55-
** How to build
50+
== How to build
5651

5752
plsqlodecoverage is currently developed as a netbeans project.
5853
The platform is java 7, but the root classes are still java 8.
5954
I use this setup for developing/debugging.
6055

6156
The system can also be build with a simple ant build file:
62-
build-plsqlcodecoverage.xml.
57+
+build-plsqlcodecoverage.xml+.
6358

6459
On windows you need an ant installation and you have to
65-
set JAVA_HOME correctly. I do this with a configuration script
60+
set +JAVA_HOME+ correctly. I do this with a configuration script
6661
which has these contents on my machine:
6762

63+
--------------------------
6864
set java_home=C:\Program Files\Java\jdk1.8.0_25
6965
set ant="C:\Program Files\NetBeans 8.0.1\extide\ant\bin\ant.bat"
7066
set orajdbclib=C:\oraclexe\app\oracle\product\11.2.0\server\jdbc\lib\ojdbc6.jar
7167
set jre7=C:\Program Files (x86)\Java\jre7
68+
--------------------------
7269

7370
The variables orajdbclib is used in the build for obvious reasons.
74-
The variable jre7 is used to set the bootclasspath.
71+
The variable +jre7+ is used to set the bootclasspath.
7572

7673
To build the system, run
77-
%ant% -f build-plsqlcodecoverage.xml dist|dist-fat|dist-lean
78-
79-
The target dist creates a jar file psqlcodecoverage.jar in the directory dist.
80-
The folder lib in the same directory contains the file ojdbc6.jar
81-
which is referenced in the manifest of psqlcodecoverage.jar.
82-
83-
The target dist-fat creates a jar file psqlcodecoverage.jar in the directory dist.
74+
----
75+
%ant% -f build-plsqlcodecoverage.xml target
76+
----
77+
where target is one of the following:
78+
79+
* +dist+: create a jar file +psqlcodecoverage.jar+ in the directory +dist+.
80+
The folder lib in the same directory contains the file +ojdbc6.jar+
81+
which is referenced in the manifest of +psqlcodecoverage.jar+.
82+
* +dist-fat+: create a jar file +psqlcodecoverage.jar+ in the directory dist.
8483
This jar file contains the class files of the project as well as the class files
8584
of the oracle jdbc library.
86-
87-
The target dist-lean creates a jar file psqlcodecoverage.jar in the directory dist.
85+
* +dist-lean+: create a jar file +psqlcodecoverage.jar+ in the directory dist.
8886
This jar file contains only the class files of the project. The user must supply the
8987
Oracle jdbc classes via the classpath variable or command line.
9088
If the oracle jdbc classes are not found during startup the user has to locate
9189
the oracle jdbc jar file. The location is stored in the preferences.
92-
If the program is started with the single argument "-clear-jdbc-file" the
93-
location in the preferences is deleted.
90+
If the program is started with the single argument +-clear-jdbc-file+ the
91+
location stored in the preferences is deleted.
9492

95-
** How to use
93+
== How to use
9694
Run the program with
95+
----
9796
java -jar psqlcodecoverage.jar
98-
97+
----
9998
If you are using the jar file created by the target dist, the lib directory
100-
with the oracle jar file must be in the same directory as psqlcodecoverage.jar.
99+
with the oracle jar file must be in the same directory as +psqlcodecoverage.jar+.
101100

102101
If you are using the jar file created by the dist-lean target, you are asked
103102
to locate the oracle jdbc jar file on first startup. The chosen location will
104103
be saved.
105104
Then you will be presented with a login dialog.
106-
You can use two kind conenctions
107-
fat: you just have to supply the tns name
108-
thin: you have to supply host, port and service for the database
105+
You can use two kind connections
106+
107+
* *fat* you just have to supply the tns name
108+
* *thin* you have to supply host, port and service for the database
109109

110110
In practice there are problems with the fat type connection.
111111
Using this kind of connection loads a dynamic link/shared library into the
@@ -115,9 +115,10 @@ The thin connection is implemented in pure java and does not have this problem.
115115

116116
The window shows the packages on the left.
117117
The letter in front of a package is
118-
V for packages that are valid but currently not covered.
119-
I for packages that are invalid
120-
C for packages that are covered
118+
119+
* *V* for packages that are valid but currently not covered.
120+
* *I* for packages that are invalid
121+
* *C* for packages that are covered
121122

122123
The red-to-green square in front of a package indicates the coverage state
123124
of a package, more green => more coverage.
@@ -135,4 +136,4 @@ The button stop/start coverage are used for starting code coverage and stopping
135136
code coverage of the currenty selected package.
136137
After a the code coverage of a package is stopped, the program still shows the
137138
state of the last code coverage session. Even if the source code of the package
138-
is changed.
139+
is changed.

0 commit comments

Comments
 (0)