Skip to content

Commit

Permalink
Site: anchor link fine-tuning - closes #26
Browse files Browse the repository at this point in the history
  • Loading branch information
edrdo committed Jul 3, 2017
1 parent 52ed1cd commit 1c4c734
Show file tree
Hide file tree
Showing 9 changed files with 56 additions and 48 deletions.
6 changes: 3 additions & 3 deletions src/site/markdown/Compatibility.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

# Compatibility

&nbsp; <a name="Drivers"></a>
<a name="Drivers"></a>
## JDBC drivers

JDBDT is expected to work with any (sane) JDBC driver.
Expand All @@ -14,10 +14,10 @@ The JDBDT build currently tests integration with:
* [PostgreSQL](http://postgresql.org)
* [SQLite](https://www.sqlite.org) through [xerial's JDBC driver](https://github.com/xerial/sqlite-jdbc)

&nbsp; <a name="KnownIssues"></a>
<a name="KnownIssues"></a>
## Known issues

&nbsp; <a name="KnownIssues_PostgreSQL"></a>
<a name="KnownIssues_PostgreSQL"></a>
### PostgreSQL


Expand Down
8 changes: 4 additions & 4 deletions src/site/markdown/DB.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ The available options relate to logging and a few other features discussed below
DB db = database(...);
db.enable(Option.LOG_SETUP);

&nbsp; <a name="Logging"></a>
<a name="Logging"></a>
### Logging


Expand Down Expand Up @@ -80,7 +80,7 @@ Note that if you use a `.gz` extension for log files, they will be GZIP-compress

db.setLog(new File("MyLog.jdbdt.xml.gz"));

&nbsp; <a name="StatementReuse"></a>
<a name="StatementReuse"></a>
### Statement reuse

A database handle internally reuses `java.sql.PreparedStatement` objects
Expand All @@ -104,13 +104,13 @@ the `REUSE_STATEMENTS` option should be disabled as follows:
No problems were detected for [all other JDBC drivers tested in the JDBDT build](Compatibility.html#Drivers).


&nbsp; <a name="BatchUpdates"></a>
<a name="BatchUpdates"></a>
### Batch updates

The `BATCH_UPDATES` option indicates that database insertions should use the JDBC batch update mechanism, unless the JDBC driver in does not support this feature
(in this case the option will have no effect). The option is enabled by default.

&nbsp; <a name="SummaryOfMethods"></a>
<a name="SummaryOfMethods"></a>
## Summary of API methods

### `JDBDT`
Expand Down
14 changes: 7 additions & 7 deletions src/site/markdown/DBAssertions.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ to check for the existence of database tables.
&nbsp;<a name="DeltaAssertions"></a>
## Delta assertions

&nbsp; <a name="Delta_About"></a>
<a name="Delta_About"></a>
### &delta; assertions ? What do you mean ?

&delta;-assertions state the expected incremental changes made to the database,
Expand All @@ -30,7 +30,7 @@ The programming pattern in line with this scheme is as follows:
theSUT.changesTheDB();
Call delta assertion method(s)

&nbsp; <a name="Snapshots"></a>
<a name="Snapshots"></a>
### Snapshots

A data source **snapshot** is a data set that is used as reference for subsequent delta
Expand Down Expand Up @@ -58,7 +58,7 @@ will issue a fresh database query, and record the obtained data set as the snaps
DataSource s = ... ; // 's' can be a Table or Query
takeSnapshot(s); // --> internally takes and records a snapshot

&nbsp; <a name="Assertion_Methods"></a>
<a name="Assertion_Methods"></a>
### Assertion methods

The elementary &delta;-assertion method is `assertDelta`.
Expand Down Expand Up @@ -135,7 +135,7 @@ A number of other assertion methods are defined for convenience, all of which in
letTheSUT_updatePassword(999, "dontDoeIt")
assertDelta(before, after);

&nbsp; <a name="StateAssertions"></a>
<a name="StateAssertions"></a>
## State assertions

A state assertion checks that the database contents in full, and
Expand Down Expand Up @@ -174,10 +174,10 @@ it verifies that the given data source has no defined rows.
letTheSUT_insertOneUser( ... );
assertState(expected);

&nbsp; <a name="OtherAssertions"></a>
<a name="OtherAssertions"></a>
## Other assertions

&nbsp; <a name="DataSetAssertions"></a>
<a name="DataSetAssertions"></a>
### Data set comparison

Two given data sets can be verified as equivalent using the `assertEquals` method.
Expand All @@ -204,7 +204,7 @@ Note that an assertion of this kind will be insensitive to the order of rows in



&nbsp; <a name="TableExistenceAssertions"></a>
<a name="TableExistenceAssertions"></a>
## Table existence assertions

The `assertTableExists` assertion methods verifies if a given table exists in the database. Symmetrically, `assertTableDoesNotExist` verifies that a table does not
Expand Down
14 changes: 7 additions & 7 deletions src/site/markdown/DBSetup.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ but also for table row [insertions / updates / deletions](DBSetup.html#IUD);

These functionalities are described below, along with a discussion of a few [database setup patterns](DBSetup.html#Patterns) that can be implemented using these operations.

&nbsp; <a name="Populate"></a>
<a name="Populate"></a>
## Populating a table


Expand Down Expand Up @@ -84,12 +84,12 @@ More generally, you may query the changed status of data sources using the `chan
}


&nbsp; <a name="IUD"></a>
<a name="IUD"></a>
## Data set insertions, updates and deletes

Beyond `populate`, data sets may be used for insertions, updates and deletes.
Beyond `populate`, data sets may be used for table insertions, updates and deletes.

The `insert` method inserts a given data set, without clearing any previous contents (unlike `populate` that clears it first).
The `insert` method inserts a given data set onto a table, without deleting any previous contents (unlike `populate` that clears the table first).

Table t = ...
DataSet additionalData = data(t) ...
Expand All @@ -114,7 +114,7 @@ The `update` and `delete` method respectively update and delete a data set in th
delete(ds);


&nbsp; <a name="Clean"></a>
<a name="Clean"></a>
## Cleaning a table


Expand Down Expand Up @@ -154,7 +154,7 @@ for different database engines (e.g., <a href="https://en.wikipedia.org/wiki/Tru
// 4. Drop the table entirely.
drop(t); // alternatively: drop(db, "USERS")

&nbsp; <a name="SaveAndRestore"></a>
<a name="SaveAndRestore"></a>
## Saving and restoring database state


Expand Down Expand Up @@ -198,7 +198,7 @@ and discards the JDBDT save-point (or any other save-point set for the database
restore(db);


&nbsp; <a name="Patterns"></a>
<a name="Patterns"></a>
## Database setup patterns

A number of database test patterns can be implemented using JDBDT, as exemplified in the [JDBDT tutorial](Tutorial.html). The code skeleton below (assuming [JUnit](http://junit.org)-based tests)
Expand Down
20 changes: 14 additions & 6 deletions src/site/markdown/DataSets.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,17 @@
A `DataSet` object represents a collection of rows for a [data source](DataSources.html)
that may be used for database [setup](DBSetup.html) or [assertions](DBAssertions.html).

&nbsp; <a name="Creation"></a>
<a name="Creation"></a>

## Creation


The examples below define data sets for a [table](DataSources.html#Table) (`Table`) object,
but the definition of data sets works similarly for
[queries](DataSources.html#Query) (`Query`).

&nbsp; <a name="Creation.Plain"></a>
<a name="Creation.Plain"></a>

### Plain definition

In the simplest manner,
Expand All @@ -39,7 +41,8 @@ typically followed by a chained sequence of calls.
.row(103, "guest", "Guest User", "welcome", Date.valueOf("2016-01-02"));


&nbsp; <a name="Creation.Typed"></a>
<a name="Creation.Typed"></a>

### Typed data sets

`TypedDataSet` is a typed extension of `DataSet`. It allows for a simple
Expand Down Expand Up @@ -75,7 +78,9 @@ of column values.
.rows(john, harry, guest)
.rows(listOfOtherUsers);

&nbsp; <a name="Creation.Builder"></a>

<a name="Creation.Builder"></a>

### Data set builders

A `DataSetBuilder` instance can be used to define or augment a data set
Expand Down Expand Up @@ -124,13 +129,16 @@ set.
.nullValue("CREATED") // set to NULL
.generate(500);

&nbsp; <a name="ReadOnly"></a>

<a name="ReadOnly"></a>

## Read-only data sets

A data set is marked read-only when defined as a [database snapshot](DBAssertions.html#Snapshots).
Any attempt to modify it subsequently will cause an `InvalidOperationException`.

&nbsp; <a name="SummaryOfMethods"></a>
<a name="SummaryOfMethods"></a>

## Summary of API methods

### `JDBDT`
Expand Down
14 changes: 7 additions & 7 deletions src/site/markdown/DataSources.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
`DataSource` objects represent tables and queries that are used for database
[setup](DBSetup.html) or [assertions](DBAssertions.html).

&nbsp; <a name="Table"></a>
<a name="Table"></a>
## Tables

&nbsp; <a name="Table_Builder"></a>
<a name="Table_Builder"></a>
### Using table builders

Tables are represented by `Table`, a subclass of `DataSource`. A table is created
Expand All @@ -26,7 +26,7 @@ and the `build` method to build the actual `Table` object in association to a [d
.columns("LOGIN", "NAME", "PASSWORD", "CREATED")
.build(db);

&nbsp; <a name="Table_Key"></a>
<a name="Table_Key"></a>
### Key columns for a table
In addition, if you wish to perform updates and deletes using data sets, `key` can be used to define the columns that form
the table's primary key (or that in some other form identify each database row uniquely)
Expand All @@ -38,13 +38,13 @@ the table's primary key (or that in some other form identify each database row u
.key("LOGIN")
.build(db);

&nbsp; <a name="Query"></a>
<a name="Query"></a>
## Queries

Queries are represented by `Query`, a subclass of `DataSource`.
A `Query` object can be created from a raw SQL statements or using a `QueryBuilder`.

&nbsp; <a name="RawQuery"></a>
<a name="RawQuery"></a>
### Definition from raw SQL

The `query` facade method may be used to define a query using raw SQL.
Expand All @@ -60,7 +60,7 @@ The `query` facade method may be used to define a query using raw SQL.
int idArgument = ...;
Query q = query(db, "SELECT LOGIN, NAME FROM USER WHERE ID = ?", idArgument);

&nbsp; <a name="QueryBuilder"></a>
<a name="QueryBuilder"></a>
### Definition using `QueryBuilder`

`QueryBuilder` objects can be used to define queries programmatically.
Expand Down Expand Up @@ -117,7 +117,7 @@ to the order of query results, but the use of `orderBy` may make it easier to in
.where("u1.LOGIN <> u2.LOGIN AND u1.PASSWORD = u2.PASSWORD")
.build(db);
&nbsp; <a name="SummaryOfMethods"></a>
<a name="SummaryOfMethods"></a>
## Summary of API methods

### `JDBDT`
Expand Down
4 changes: 2 additions & 2 deletions src/site/markdown/Facade.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ The `org.jdbdt.JDBDT` class is the facade for the JDBDT API,
providing the core interface methods for database setup, verification,
and API object creation.

&nbsp; <a name="StaticImport"></a>
<a name="StaticImport"></a>
## Static import


Expand All @@ -15,7 +15,7 @@ may be convenient to refer to the API methods concisely.

import static org.jdbdt.JDBDT.*;

&nbsp; <a name="Overview"></a>
<a name="Overview"></a>
## Overview of functionality

[(browse Javadoc instead)](apidocs/index.html?org/jdbdt/JDBDT.html)
Expand Down
8 changes: 4 additions & 4 deletions src/site/markdown/Logs.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

An XML format is used for [JDBDT log files](DB.html#Logging) and for the output of calls to `JDBDT.dump`.

&nbsp; <a name="Generic"></a>
<a name="Generic"></a>
## Generic format

Every JDBDT log message is defined by a `jdbdt-log-message` XML node.
Expand Down Expand Up @@ -49,7 +49,7 @@ and SQL type (`sql-type`).
<sql><![CDATA[SELECT login, name, password, created FROM Users]]></sql>
</data-source>

&nbsp; <a name="DataSets"></a>
<a name="DataSets"></a>
## Data sets

A `data-set` node displays the contents of a [data set](DataSets.html) that associates
Expand Down Expand Up @@ -89,7 +89,7 @@ column label (`label` attribute) and Java type (`java-type`).
</rows>
</data-set>

&nbsp; <a name="StateAndDataSetAssertions"></a>
<a name="StateAndDataSetAssertions"></a>
## State and data set assertions

An `assertion` node refers to a [database state assertion](DBAssertions.html#StateAssertions) or a [data set assertion](DBAssertions.html#DataSetAssertions). It comprises:
Expand Down Expand Up @@ -150,7 +150,7 @@ The `steve` and `bill` "users" were matched.
</errors>
</assertion>

&nbsp; <a name="DeltaAssertions"></a>
<a name="DeltaAssertions"></a>
## Delta assertions

A `delta-assertion` node refers to a [database delta assertion](DBAssertions.html#DeltaAssertions). For an assertion
Expand Down
Loading

0 comments on commit 1c4c734

Please sign in to comment.