Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
java-version: '21'
cache: 'maven'
- name: Build with Maven
run: ./mvnw -B verify javadoc:javadoc
run: ./mvnw -B verify
- name: Set up Node.js
uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
with:
Expand Down
1 change: 1 addition & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ To preview your changes, generate the site:
```

Then open `target/site/index.html` in a browser (the build prints the full `file://` URL at the end).
The build also generates the Javadoc and attaches it to the site, which the guide links to.
The preview only contains the AssertJ DB guide; the complete site is assembled from all AssertJ repositories by [docs.assertj.dev](https://github.com/assertj/docs.assertj.dev).
No Node.js installation is required: the first run downloads Node.js into `target/node` and the Antora packages into `node_modules`.
To use a Node.js installation from your `PATH` instead, add `-Dnode.executable=node`.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"private": true,
"devDependencies": {
"@antora/collector-extension": "1.0.3",
"@springio/antora-extensions": "1.14.13",
"antora": "3.2.2"
}
}
25 changes: 24 additions & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
</issueManagement>

<properties>
<assertj-core.version>3.27.7</assertj-core.version>
<!-- SonarCloud -->
<sonar.host.url>https://sonarcloud.io</sonar.host.url>
<sonar.organization>assertj-org</sonar.organization>
Expand All @@ -39,7 +40,7 @@
<dependency>
<groupId>org.assertj</groupId>
<artifactId>assertj-core</artifactId>
<version>3.27.7</version>
<version>${assertj-core.version}</version>
</dependency>
<dependency>
<groupId>junit</groupId>
Expand Down Expand Up @@ -205,6 +206,26 @@
<artifactId>antora-component-version-maven-plugin</artifactId>
<version>0.0.4</version>
</plugin>
<plugin>
<!-- provides assertj-core.parsedVersion.* for the versioned AssertJ Core Javadoc URL below -->
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<version>3.6.1</version>
<executions>
<execution>
<!-- the "antora" lifecycle does not include the validate phase -->
<id>parse-assertj-core-version</id>
<phase>pre-antora</phase>
<goals>
<goal>parse-version</goal>
</goals>
<configuration>
<versionString>${assertj-core.version}</versionString>
<propertyPrefix>assertj-core.parsedVersion</propertyPrefix>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.antora</groupId>
<artifactId>antora-maven-plugin</artifactId>
Expand All @@ -217,6 +238,8 @@
<playbookFile>src/docs/antora/antora-playbook.yml</playbookFile>
<options>
<option>log-level=info</option>
<!-- this standalone build has no assertj-core component for the xref in antora.yml to resolve against -->
<option>attribute=assertj-core-javadoc=https://docs.assertj.dev/assertj-core/${assertj-core.parsedVersion.majorVersion}.${assertj-core.parsedVersion.minorVersion}/api</option>
</options>
</configuration>
</plugin>
Expand Down
2 changes: 2 additions & 0 deletions src/docs/antora-resources/antora.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,6 @@ asciidoc:
tabsize: '3'
source-indent: '0'
assertj-db-version: '${project.version}'
assertj-db-javadoc: 'xref:attachment$api'
assertj-core-javadoc: 'xref:assertj-core::attachment$api'
assertj-examples-github: 'https://github.com/assertj/assertj-examples'
4 changes: 4 additions & 0 deletions src/docs/antora/antora-playbook.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
antora:
extensions:
- '@antora/collector-extension'
- '@springio/antora-extensions/root-attachments-extension'
site:
title: AssertJ Docs
start_page: assertj-db::index.adoc
Expand All @@ -9,6 +10,9 @@ content:
- url: ./../../.. # the local repository, relative to this playbook
branches: HEAD # use the worktree so that uncommitted changes are included
start_path: src/docs/antora
runtime:
log:
failure_level: warn
ui:
bundle:
url: https://github.com/assertj/antora-ui/releases/latest/download/ui-bundle.zip
Expand Down
5 changes: 4 additions & 1 deletion src/docs/antora/antora.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,12 @@ nav:
ext:
collector:
- run:
command: ./mvnw -q io.spring.maven.antora:antora-component-version-maven-plugin:antora-component-version resources:copy-resources@antora-resources
command: ./mvnw -q io.spring.maven.antora:antora-component-version-maven-plugin:antora-component-version resources:copy-resources@antora-resources javadoc:javadoc
local: true
scan:
- dir: target/antora
- dir: target/reports/apidocs
clean: true
into: modules/ROOT/attachments/api
- dir: src/test/java/example
into: modules/ROOT/examples/java/example
1 change: 1 addition & 0 deletions src/docs/antora/modules/ROOT/nav.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,4 @@
** xref:features/navigation.adoc[]
** xref:features/assertions.adoc[]
* https://github.com/assertj/assertj-db/releases[Release Notes]
* {assertj-db-javadoc}/index.html[Javadoc]
12 changes: 6 additions & 6 deletions src/docs/antora/modules/ROOT/pages/concepts/connection.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ It's also with a `AssertDbConnection` that you can instantiate the following ele
[[assertdbconnection]]
== AssertDbConnection

A https://www.javadoc.io/doc/org.assertj/assertj-db/latest/org/assertj/db/type/AssertDbConnection.html[AssertDbConnection]
is created with the factory https://www.javadoc.io/doc/org.assertj/assertj-db/latest/org/assertj/db/type/AssertDbConnectionFactory.html[AssertDbConnectionFactory].
A {assertj-db-javadoc}/org/assertj/db/type/AssertDbConnection.html[AssertDbConnection]
is created with the factory {assertj-db-javadoc}/org/assertj/db/type/AssertDbConnectionFactory.html[AssertDbConnectionFactory].

There are 2 way to begin the AssertDbConnectionFactory, with a https://docs.oracle.com/javase/6/docs/api/javax/sql/DataSource.html[DataSource] ( the classic Java way
to get a https://docs.oracle.com/javase/6/docs/api/java/sql/Connection.html[Connection] to a database ) or with JDBC connection information.
Expand All @@ -31,8 +31,8 @@ AssertDbConnection connection = AssertDbConnectionFactory.of(dataSource).create(
[[assertdbconnectionlettercase]]
== LetterCase setup

https://www.javadoc.io/doc/org.assertj/assertj-db/latest/org/assertj/db/type/AssertDbConnectionFactory.html[AssertDbConnectionFactory]
provide the capacity to indicate the https://www.javadoc.io/doc/org.assertj/assertj-db/latest/org/assertj/db/type/lettercase/LetterCase.html[LetterCase]
{assertj-db-javadoc}/org/assertj/db/type/AssertDbConnectionFactory.html[AssertDbConnectionFactory]
provide the capacity to indicate the {assertj-db-javadoc}/org/assertj/db/type/lettercase/LetterCase.html[LetterCase]
to use for the tables, columns and primary keys.

[source,java]
Expand All @@ -52,8 +52,8 @@ For many assertions, AssertJ-DB require to discover database schema metadata ( l
When the schema contains many tables this operation can slow down the tests executions.

To avoid that and when the database schema is not updated during the test session, you can use the option
https://www.javadoc.io/doc/org.assertj/assertj-db/latest/org/assertj/db/type/SchemaMetaDataMode.html[SchemaMetaDataMode] of
https://www.javadoc.io/doc/org.assertj/assertj-db/latest/org/assertj/db/type/AssertDbConnectionFactory.html[AssertDbConnectionFactory]
{assertj-db-javadoc}/org/assertj/db/type/SchemaMetaDataMode.html[SchemaMetaDataMode] of
{assertj-db-javadoc}/org/assertj/db/type/AssertDbConnectionFactory.html[AssertDbConnectionFactory]
to keep in memory the schema.

Available mode are :
Expand Down
6 changes: 3 additions & 3 deletions src/docs/antora/modules/ROOT/pages/concepts/datetime.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ AssertJ-DB baseline is Java 8. The preferred way to compare values with date, ti

But for the backward compatibility, it's always possible to use AssertJ-DB DateValue utilities.

So The https://www.javadoc.io/doc/org.assertj/assertj-db/latest/org/assertj/db/type/DateValue.html[DateValue],
https://www.javadoc.io/doc/org.assertj/assertj-db/latest/org/assertj/db/type/TimeValue.html[TimeValue] and
https://www.javadoc.io/doc/org.assertj/assertj-db/latest/org/assertj/db/type/DateTimeValue.html[DateTimeValue] classes are simpler but contain this kind of information.
So the {assertj-db-javadoc}/org/assertj/db/type/DateValue.html[DateValue],
{assertj-db-javadoc}/org/assertj/db/type/TimeValue.html[TimeValue] and
{assertj-db-javadoc}/org/assertj/db/type/DateTimeValue.html[DateTimeValue] classes are simpler but contain this kind of information.

There is 4 kinds of static methods to instantiate these values :

Expand Down
4 changes: 2 additions & 2 deletions src/docs/antora/modules/ROOT/pages/concepts/description.adoc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
= Default description

In assertj, it is possible to add a description with the methods of the https://www.javadoc.io/doc/org.assertj/assertj-core/latest/org/assertj/core/api/Descriptable.html[Descriptable] interface.
In assertj, it is possible to add a description with the methods of the {assertj-core-javadoc}/org/assertj/core/api/Descriptable.html[Descriptable] interface.
This description is used in the error message if the assertion fails.

Due to the navigation, it is more complicated in assertj-db to know on which element an error is thrown.
Expand All @@ -18,4 +18,4 @@ For example :
* `"Value at index 0 (column name : ID) of Row at end point of Change at index 0 (on table : MEMBERS and with primary key : [4]) of Changes on tables of 'sa/jdbc:h2:mem:test' source"`
for an assertion on a value of the row at end point of a change on a table

This default description can be replaced by the choice of the tester by using the methods of https://www.javadoc.io/doc/org.assertj/assertj-core/latest/org/assertj/core/api/Descriptable.html[Descriptable].
This default description can be replaced by the choice of the tester by using the methods of {assertj-core-javadoc}/org/assertj/core/api/Descriptable.html[Descriptable].
Loading