From 3ec04666add4c1e1d7fb6a3a5a08de348ec73744 Mon Sep 17 00:00:00 2001
From: Julien Roy
- * Example with a {@link Source} and a {@link Table} with test on the content on the first row of the {@code movie} + * Example with a {@link ConnectionProvider} and a {@link Table} with test on the content on the first row of the {@code movie} * table that the {@code title} column contains "Alien" like text and the next column contains 1979 like number : *
* *
*
- * Source source = new Source("jdbc:h2:mem:test", "sa", "");
- * Table table = new Table(source, "movie");
+ * ConnectionProvider connectionProvider = ConnectionProviderFactory.of("jdbc:h2:mem:test", "sa", "").create();
+ * Table table = new Table(connectionProvider, "movie");
* assertThat(table)
* .row()
* .value("title")
@@ -71,8 +71,8 @@
*
*
*
- * Source source = new Source("jdbc:h2:mem:test", "sa", "");
- * Table table = new Table(source, "movie");
+ * ConnectionProvider connectionProvider = ConnectionProviderFactory.of("jdbc:h2:mem:test", "sa", "").create();
+ * Table table = new Table(connectionProvider, "movie");
* assertThat(table)
* .row()
* .value("title")
diff --git a/src/main/java/org/assertj/db/api/BDDAssertions.java b/src/main/java/org/assertj/db/api/BDDAssertions.java
index 7cb7e902..175f605e 100644
--- a/src/main/java/org/assertj/db/api/BDDAssertions.java
+++ b/src/main/java/org/assertj/db/api/BDDAssertions.java
@@ -19,8 +19,8 @@
import org.assertj.db.exception.AssertJDBException;
import org.assertj.db.type.Changes;
+import org.assertj.db.type.ConnectionProvider;
import org.assertj.db.type.Request;
-import org.assertj.db.type.Source;
import org.assertj.db.type.Table;
/**
@@ -33,14 +33,14 @@
* The assertion methods are defined in assertions package.
*
*
- * Example with a {@link Source} and a {@link Table} with test on the content on the first row of the {@code movie}
+ * Example with a {@link ConnectionProvider} and a {@link Table} with test on the content on the first row of the {@code movie}
* table that the {@code title} column contains "Alien" as text and the next column contains 1979 as a number :
*
*
*
*
- * Source source = new Source("jdbc:h2:mem:test", "sa", "");
- * Table table = new Table(source, "movie");
+ * ConnectionProvider connectionProvider = ConnectionProviderFactory.of("jdbc:h2:mem:test", "sa", "").create();
+ * Table table = new Table(connectionProvider, "movie");
* then(table)
* .row()
* .value("title")
@@ -71,8 +71,8 @@
*
*
*
- * Source source = new Source("jdbc:h2:mem:test", "sa", "");
- * Table table = new Table(source, "movie");
+ * ConnectionProvider connectionProvider = ConnectionProviderFactory.of("jdbc:h2:mem:test", "sa", "").create();
+ * Table table = new Table(connectionProvider, "movie");
* then(table)
* .row()
* .value("title")
diff --git a/src/main/java/org/assertj/db/api/TableAssert.java b/src/main/java/org/assertj/db/api/TableAssert.java
index b9f6bb8e..89251021 100644
--- a/src/main/java/org/assertj/db/api/TableAssert.java
+++ b/src/main/java/org/assertj/db/api/TableAssert.java
@@ -48,7 +48,7 @@ public TableAssert(Table table) {
*/
@Override
public TableAssert exists() {
- return AssertionsOnTableExistence.exists(this, info, actual.getName(), actual.getSource(), actual.getDataSource());
+ return AssertionsOnTableExistence.exists(this, info, actual.getName(), actual.getConnectionProvider());
}
/**
@@ -65,6 +65,6 @@ public TableAssert exists() {
*/
@Override
public TableAssert doesNotExist() {
- return AssertionsOnTableExistence.doesNotExists(this, info, actual.getName(), actual.getSource(), actual.getDataSource());
+ return AssertionsOnTableExistence.doesNotExists(this, info, actual.getName(), actual.getConnectionProvider());
}
}
diff --git a/src/main/java/org/assertj/db/api/assertions/impl/AssertionsOnTableExistence.java b/src/main/java/org/assertj/db/api/assertions/impl/AssertionsOnTableExistence.java
index 770cf4c6..78d41951 100644
--- a/src/main/java/org/assertj/db/api/assertions/impl/AssertionsOnTableExistence.java
+++ b/src/main/java/org/assertj/db/api/assertions/impl/AssertionsOnTableExistence.java
@@ -17,16 +17,14 @@
import java.sql.Connection;
import java.sql.DatabaseMetaData;
-import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.SQLException;
-import javax.sql.DataSource;
import org.assertj.core.api.WritableAssertionInfo;
import org.assertj.core.internal.Failures;
import org.assertj.db.api.AbstractDbAssert;
import org.assertj.db.exception.AssertJDBException;
-import org.assertj.db.type.Source;
+import org.assertj.db.type.ConnectionProvider;
/**
* Implements the assertion method on the existence of a table.
@@ -47,18 +45,20 @@ private AssertionsOnTableExistence() {
/**
* Verifies that the table exists.
*
- * @param The type of the assertion which call this method.
- * @param assertion The assertion which call this method.
- * @param info Writable information about an assertion.
- * @param table The table name to search in DB.
- * @param source The source to connect to DB.
- * @param dataSource The source to connect to DB.
+ * @param The type of the assertion which call this method.
+ * @param assertion The assertion which call this method.
+ * @param info Writable information about an assertion.
+ * @param table The table name to search in DB.
+ * @param connectionProvider The provider to connect to DB.
* @return {@code this} assertion object.
* @throws AssertionError If the table does not exist.
*/
public static > A exists(A assertion, WritableAssertionInfo info,
- String table, Source source, DataSource dataSource) {
- try (Connection connection = getConnection(source, dataSource)) {
+ String table, ConnectionProvider connectionProvider) {
+ if (connectionProvider == null) {
+ throw new NullPointerException("connectionProvider must be not null");
+ }
+ try (Connection connection = connectionProvider.getConnection()) {
DatabaseMetaData metaData = connection.getMetaData();
ResultSet result = metaData.getTables(null, null, table, null);
if (!result.next()) {
@@ -75,18 +75,20 @@ private AssertionsOnTableExistence() {
/**
* Verifies that the database not contains the table.
*
- * @param The type of the assertion which call this method.
- * @param assertion The assertion which call this method.
- * @param info Writable information about an assertion.
- * @param table The table name to search in DB.
- * @param source The source to connect to DB.
- * @param dataSource The source to connect to DB.
+ * @param The type of the assertion which call this method.
+ * @param assertion The assertion which call this method.
+ * @param info Writable information about an assertion.
+ * @param table The table name to search in DB.
+ * @param connectionProvider The provider to connect to DB.
* @return {@code this} assertion object.
* @throws AssertionError If the table does not exist.
*/
public static > A doesNotExists(A assertion, WritableAssertionInfo info,
- String table, Source source, DataSource dataSource) {
- try (Connection connection = getConnection(source, dataSource)) {
+ String table, ConnectionProvider connectionProvider) {
+ if (connectionProvider == null) {
+ throw new NullPointerException("connectionProvider must be not null");
+ }
+ try (Connection connection = connectionProvider.getConnection()) {
DatabaseMetaData metaData = connection.getMetaData();
ResultSet result = metaData.getTables(null, null, table, null);
if (result.next()) {
@@ -98,14 +100,4 @@ private AssertionsOnTableExistence() {
}
return assertion;
}
-
- private static Connection getConnection(Source source, DataSource dataSource) throws SQLException {
- if (source == null && dataSource == null) {
- throw new NullPointerException("connection or dataSource must be not null");
- }
- if (dataSource != null) {
- return dataSource.getConnection();
- }
- return DriverManager.getConnection(source.getUrl(), source.getUser(), source.getPassword());
- }
}
diff --git a/src/main/java/org/assertj/db/type/SourceWithLetterCase.java b/src/main/java/org/assertj/db/type/AbstractConnectionProvider.java
similarity index 53%
rename from src/main/java/org/assertj/db/type/SourceWithLetterCase.java
rename to src/main/java/org/assertj/db/type/AbstractConnectionProvider.java
index 573a089a..caf322a9 100644
--- a/src/main/java/org/assertj/db/type/SourceWithLetterCase.java
+++ b/src/main/java/org/assertj/db/type/AbstractConnectionProvider.java
@@ -12,70 +12,56 @@
*/
package org.assertj.db.type;
+import java.lang.reflect.InvocationTargetException;
+
import org.assertj.db.type.lettercase.LetterCase;
-import org.assertj.db.type.lettercase.WithLetterCase;
/**
- * A source to indicates the information to connect to the database with letter case.
+ * Base implementation for ConnectionProvider that handle letter case and schema metadata management.
*
- * @author Régis Pouiller
- * @since 1.1.0
+ * @author Julien Roy
+ * @since 3.0.0
*/
-public class SourceWithLetterCase extends Source implements WithLetterCase {
+abstract class AbstractConnectionProvider implements ConnectionProvider {
+
+ private final SchemaMetadata schemaMetadata;
- /**
- * Letter case of the tables.
- */
private final LetterCase tableLetterCase;
- /**
- * Letter case of the columns.
- */
private final LetterCase columnLetterCase;
- /**
- * Letter case of the primary keys.
- */
private final LetterCase primaryKeyLetterCase;
- /**
- * Constructor with the information.
- *
- * @param url URL to the database.
- * @param user User to connect.
- * @param password Password to connect.
- * @param tableLetterCase Letter case of the tables.
- * @param columnLetterCase Letter case of the columns.
- * @param primaryKeyLetterCase Letter case of the primary keys.
- */
- public SourceWithLetterCase(String url, String user, String password,
- LetterCase tableLetterCase, LetterCase columnLetterCase, LetterCase primaryKeyLetterCase) {
-
- super(url, user, password);
+ protected AbstractConnectionProvider(Class extends SchemaMetadata> schemaMetadataType, LetterCase tableLetterCase, LetterCase columnLetterCase, LetterCase primaryKeyLetterCase) {
+ this.schemaMetadata = instantiateSchemaMetadata(schemaMetadataType);
this.tableLetterCase = tableLetterCase;
this.columnLetterCase = columnLetterCase;
this.primaryKeyLetterCase = primaryKeyLetterCase;
}
- /**
- * {@inheritDoc}
- */
+ private SchemaMetadata instantiateSchemaMetadata(Class extends SchemaMetadata> schemaMetadataType) {
+ try {
+ return schemaMetadataType.getConstructor(ConnectionProvider.class).newInstance(this);
+ } catch (InstantiationException | IllegalAccessException | InvocationTargetException | NoSuchMethodException e) {
+ throw new IllegalArgumentException("Schema metadata instantiation failure", e);
+ }
+ }
+
+ @Override
+ public LetterCase getTableLetterCase() {
+ return tableLetterCase;
+ }
+
@Override
public LetterCase getColumnLetterCase() {
return columnLetterCase;
}
- /**
- * {@inheritDoc}
- */
@Override
public LetterCase getPrimaryKeyLetterCase() {
return primaryKeyLetterCase;
}
- /**
- * {@inheritDoc}
- */
@Override
- public LetterCase getTableLetterCase() {
- return tableLetterCase;
+ public SchemaMetadata getMetaData() {
+ return this.schemaMetadata;
}
}
diff --git a/src/main/java/org/assertj/db/type/AbstractDbData.java b/src/main/java/org/assertj/db/type/AbstractDbData.java
index b52a8657..c31c1691 100644
--- a/src/main/java/org/assertj/db/type/AbstractDbData.java
+++ b/src/main/java/org/assertj/db/type/AbstractDbData.java
@@ -12,16 +12,19 @@
*/
package org.assertj.db.type;
+import java.sql.Connection;
+import java.sql.ResultSet;
+import java.sql.ResultSetMetaData;
+import java.sql.SQLException;
+import java.sql.Types;
+import java.util.ArrayList;
+import java.util.List;
+
import org.assertj.db.exception.AssertJDBException;
import org.assertj.db.type.lettercase.LetterCase;
import org.assertj.db.util.NameComparator;
import org.assertj.db.util.RowComparator;
-import javax.sql.DataSource;
-import java.sql.*;
-import java.util.ArrayList;
-import java.util.List;
-
/**
* This class represents data from the database (either a {@link Table} or a {@link Request}).
*
@@ -35,6 +38,7 @@
* @param Class of the subclass (an implementation of {@link AbstractDbData}) : useful for the fluent methods
* (setters).
* @author Régis Pouiller
+ * @author Julien Roy
*/
public abstract class AbstractDbData> extends AbstractDbElement {
@@ -63,7 +67,7 @@ public abstract class AbstractDbData> extends Abstra
* Default constructor.
*
* @param dataType The type of the data on which is the change.
- * @param selfType Class of this element : a sub-class of {@code AbstractDbData}.
+ * @param selfType Class of this element : a subclass of {@code AbstractDbData}.
*/
AbstractDbData(Class selfType, DataType dataType) {
super(selfType);
@@ -71,28 +75,15 @@ public abstract class AbstractDbData> extends Abstra
}
/**
- * Constructor with a {@link Source}.
- *
- * @param dataType The type of the data on which is the change.
- * @param selfType Class of this element : a sub-class of {@code AbstractDbData}.
- * @param source The {@link Source} to connect to the database (must be not {@code null}).
- * @throws NullPointerException If {@code source} is {@code null}.
- */
- AbstractDbData(Class selfType, DataType dataType, Source source) {
- super(selfType, source);
- this.dataType = dataType;
- }
-
- /**
- * Constructor with a {@link DataSource}.
+ * Constructor with a {@link JdbcUrlConnectionProvider}.
*
- * @param dataType The type of the data on which is the change.
- * @param selfType Class of this element : a sub-class of {@code AbstractDbData}.
- * @param dataSource The {@link DataSource} (must be not {@code null}).
- * @throws NullPointerException If {@code dataSource} is {@code null}.
+ * @param dataType The type of the data on which is the change.
+ * @param selfType Class of this element : a subclass of {@code AbstractDbData}.
+ * @param connectionProvider The {@link JdbcUrlConnectionProvider} to connect to the database (must be not {@code null}).
+ * @throws NullPointerException If {@code connectionProvider} is {@code null}.
*/
- AbstractDbData(Class selfType, DataType dataType, DataSource dataSource) {
- super(selfType, dataSource);
+ AbstractDbData(Class selfType, DataType dataType, ConnectionProvider connectionProvider) {
+ super(selfType, connectionProvider);
this.dataType = dataType;
}
@@ -121,12 +112,12 @@ public DataType getDataType() {
* depending of being a {@link Table} or a {@link Request}.
*
*
- * @throws NullPointerException If the {@link #dataSource} and {@link #source} fields are {@code null}.
+ * @throws NullPointerException If the {@code connectionProvider} fields are {@code null}.
* @throws AssertJDBException If triggered, this exception wrap a possible {@link SQLException} during the loading.
*/
private void load() {
try (Connection connection = getConnection()) {
- // Call the specific loading depending of Table or Request.
+ // Call the specific loading depending on Table or Request.
loadImpl(connection);
if (pksNameList == null) {
pksNameList = new ArrayList<>();
@@ -219,7 +210,7 @@ protected void collectRowsFromResultSet(ResultSet resultSet) throws SQLException
*
*
* @return The list of the columns name.
- * @throws NullPointerException If the {@link #dataSource} and {@link #source} fields are {@code null}.
+ * @throws NullPointerException If the {@code connectionProvider} fields are {@code null}.
* @throws AssertJDBException If triggered, this exception wrap a possible {@link SQLException} during the loading.
*/
public List getColumnsNameList() {
@@ -246,7 +237,7 @@ protected void setColumnsNameList(List columnsNameList) {
*
*
* @return The list of the primary key name.
- * @throws NullPointerException If the {@link #dataSource} and {@link #source} fields are {@code null}.
+ * @throws NullPointerException If the {@link #getConnectionProvider()} fields are {@code null}.
* @throws AssertJDBException If triggered, this exception wrap a possible {@link SQLException} during the loading.
*/
public List getPksNameList() {
@@ -296,7 +287,7 @@ protected void controlIfAllThePksNameExistInTheColumns() {
*
*
* @return The list of the values.
- * @throws NullPointerException If the {@link #dataSource} and {@link #source} fields are {@code null}.
+ * @throws NullPointerException If the {@code connectionProvider} fields are {@code null}.
* @throws AssertJDBException If triggered, this exception wrap a possible {@link SQLException} during the loading.
*/
public List getRowsList() {
@@ -316,7 +307,7 @@ public List getRowsList() {
*
*
* @return The list of the values in columns.
- * @throws NullPointerException If the {@link #dataSource} and {@link #source} fields are {@code null}.
+ * @throws NullPointerException If the {@code connectionProvider} fields are {@code null}.
* @throws AssertJDBException If triggered, this exception wrap a possible {@link SQLException} during the loading.
*/
public List getColumnsList() {
@@ -345,7 +336,7 @@ public List getColumnsList() {
*
* @param index The column index.
* @return The column and the values
- * @throws NullPointerException If the {@link #dataSource} and {@link #source} fields are {@code null}.
+ * @throws NullPointerException If the {@code connectionProvider} fields are {@code null}.
* @throws AssertJDBException If triggered, this exception wrap a possible {@link SQLException} during the loading.
*/
public Column getColumn(int index) {
@@ -362,7 +353,7 @@ public Column getColumn(int index) {
*
* @param index The index
* @return The {@link Row}
- * @throws NullPointerException If the {@link #dataSource} and {@link #source} fields are {@code null}.
+ * @throws NullPointerException If the {@code connectionProvider} fields are {@code null}.
* @throws AssertJDBException If triggered, this exception wrap a possible {@link SQLException} during the loading.
*/
public Row getRow(int index) {
@@ -379,7 +370,7 @@ public Row getRow(int index) {
*
* @param index The column index
* @return The values
- * @throws NullPointerException If the {@link #dataSource} and {@link #source} fields are {@code null}.
+ * @throws NullPointerException If the {@code connectionProvider} fields are {@code null}.
* @throws AssertJDBException If triggered, this exception wrap a possible {@link SQLException} during the loading.
*/
private List getValuesList(int index) {
diff --git a/src/main/java/org/assertj/db/type/AbstractDbElement.java b/src/main/java/org/assertj/db/type/AbstractDbElement.java
index dc4e46ad..d66d0c95 100644
--- a/src/main/java/org/assertj/db/type/AbstractDbElement.java
+++ b/src/main/java/org/assertj/db/type/AbstractDbElement.java
@@ -12,22 +12,20 @@
*/
package org.assertj.db.type;
-import org.assertj.db.type.lettercase.LetterCase;
-import org.assertj.db.type.lettercase.WithLetterCase;
-
-import javax.sql.DataSource;
import java.sql.Connection;
-import java.sql.DriverManager;
import java.sql.SQLException;
+import org.assertj.db.type.lettercase.LetterCase;
+import org.assertj.db.type.lettercase.WithLetterCase;
+
/**
* This class represents element from the database (either a {@link AbstractDbData} or a {@link Change}).
- * So this class contains : the way to access the database with {@link #getSource()} and {@link #getDataSource()} (one
- * of them need to be set before loading the data).
+ * So this class contains : the way to access the database with {@link #getConnectionProvider()}.
*
* @param Class of the subclass (an implementation of {@link AbstractDbElement}) : useful for the fluent methods
* (setters).
* @author Régis Pouiller
+ * @author Julien Roy
*/
public abstract class AbstractDbElement> implements DbElement, WithLetterCase {
@@ -36,31 +34,27 @@ public abstract class AbstractDbElement> implemen
*/
protected final D myself;
/**
- * Source of the data.
+ * Database connection provider.
*/
- private Source source;
- /**
- * Data source.
- */
- private DataSource dataSource;
+ private ConnectionProvider connectionProvider;
/**
* Letter case of the tables.
*
* @since 1.1.0
*/
- private LetterCase tableLetterCase;
+ private LetterCase tableLetterCase = LetterCase.TABLE_DEFAULT;
/**
* Letter case of the columns.
*
* @since 1.1.0
*/
- private LetterCase columnLetterCase;
+ private LetterCase columnLetterCase = LetterCase.COLUMN_DEFAULT;
/**
* Letter case of the primary keys.
*
* @since 1.1.0
*/
- private LetterCase primaryKeyLetterCase;
+ private LetterCase primaryKeyLetterCase = LetterCase.PRIMARY_KEY_DEFAULT;
/**
* Default constructor.
@@ -75,63 +69,16 @@ public abstract class AbstractDbElement> implemen
/**
* Constructor.
*
- * @param selfType Class of this element : a sub-class of {@code AbstractDbElement}.
- * @param source The {@link Source} to connect to the database (must be not {@code null}).
- * @throws NullPointerException If {@code source} is {@code null}.
+ * @param selfType Class of this element : a subclass of {@code AbstractDbElement}.
+ * @param connectionProvider The {@link ConnectionProvider} to connect to the database (must be not {@code null}).
+ * @throws NullPointerException If {@code connectionProvider} is {@code null}.
*/
- AbstractDbElement(Class selfType, Source source) {
+ AbstractDbElement(Class selfType, ConnectionProvider connectionProvider) {
this(selfType);
- this.source = source;
+ this.connectionProvider = connectionProvider;
setLetterCases();
}
- /**
- * Constructor.
- *
- * @param selfType Class of this element : a sub-class of {@code AbstractDbElement}.
- * @param dataSource The {@link DataSource} (must be not {@code null}).
- * @throws NullPointerException If {@code dataSource} is {@code null}.
- */
- AbstractDbElement(Class selfType, DataSource dataSource) {
- this(selfType);
- this.dataSource = dataSource;
- setLetterCases();
- }
-
- /**
- * Returns the catalog from a connection.
- *
- * @param connection The connection with the catalog
- * @return The catalog from a connection.
- * @throws SQLException SQL Exception
- */
- protected static String getCatalog(Connection connection) throws SQLException {
- try {
- return connection.getCatalog();
- } catch (SQLException exception) {
- throw exception;
- } catch (Exception throwable) {
- return null;
- }
- }
-
- /**
- * Returns the schema from a connection.
- *
- * @param connection The connection with the catalog
- * @return The schema from a connection.
- * @throws SQLException SQL Exception
- */
- protected static String getSchema(Connection connection) throws SQLException {
- try {
- return connection.getSchema();
- } catch (SQLException exception) {
- throw exception;
- } catch (Exception throwable) {
- return null;
- }
- }
-
/**
* Sets the letter cases from information in parameters.
*
@@ -148,24 +95,15 @@ D setLetterCases(LetterCase tableLetterCase, LetterCase columnLetterCase, Letter
}
/**
- * Sets the letter cases from information in {@code dataSource} and {@code source}.
+ * Sets the letter cases from information in {@code connectionProvider}.
*/
private void setLetterCases() {
- if (dataSource instanceof WithLetterCase) {
- WithLetterCase withLetterCase = (WithLetterCase) dataSource;
- tableLetterCase = withLetterCase.getTableLetterCase();
- columnLetterCase = withLetterCase.getColumnLetterCase();
- primaryKeyLetterCase = withLetterCase.getPrimaryKeyLetterCase();
- } else if (source instanceof WithLetterCase) {
- WithLetterCase withLetterCase = (WithLetterCase) source;
- tableLetterCase = withLetterCase.getTableLetterCase();
- columnLetterCase = withLetterCase.getColumnLetterCase();
- primaryKeyLetterCase = withLetterCase.getPrimaryKeyLetterCase();
- } else {
- tableLetterCase = LetterCase.TABLE_DEFAULT;
- columnLetterCase = LetterCase.COLUMN_DEFAULT;
- primaryKeyLetterCase = LetterCase.PRIMARY_KEY_DEFAULT;
+ if (connectionProvider == null) {
+ return;
}
+ tableLetterCase = connectionProvider.getTableLetterCase();
+ columnLetterCase = connectionProvider.getColumnLetterCase();
+ primaryKeyLetterCase = connectionProvider.getPrimaryKeyLetterCase();
}
/**
@@ -193,77 +131,55 @@ public LetterCase getTableLetterCase() {
}
/**
- * Return the source.
+ * Return the connectionProvider.
*
- * @return The {@link Source} to connect.
- * @see #setSource(Source)
+ * @return The {@link ConnectionProvider} to connect.
+ * @see #setConnectionProvider(ConnectionProvider)
*/
- public Source getSource() {
- return source;
+ public ConnectionProvider getConnectionProvider() {
+ return connectionProvider;
}
/**
- * Sets the source.
+ * Sets the connectionProvider.
*
- * @param source {@link Source} to connect to the database (must be not {@code null}).
+ * @param connectionProvider {@link ConnectionProvider} to connect to the database (must be not {@code null}).
* @return The actual instance.
- * @throws NullPointerException If {@code source} is {@code null}.
- * @see #getSource()
+ * @throws NullPointerException If {@code connectionProvider} is {@code null}.
*/
- public D setSource(Source source) {
- if (source == null) {
- throw new NullPointerException("source must be not null");
+ public D setConnectionProvider(ConnectionProvider connectionProvider) {
+ if (connectionProvider == null) {
+ throw new NullPointerException("connectionProvider must be not null");
}
- this.source = source;
- this.dataSource = null;
+ this.connectionProvider = connectionProvider;
setLetterCases();
return myself;
}
/**
- * Return the data source.
- *
- * @return The data source.
- * @see #setDataSource(DataSource)
- */
- public DataSource getDataSource() {
- return dataSource;
- }
-
- /**
- * Sets the data source.
+ * Returns a {@link Connection} from the {@link ConnectionProvider}
*
- * @param dataSource The {@link DataSource} (must be not {@code null}).
- * @return The actual instance.
- * @throws NullPointerException If {@code dataSource} is {@code null}.
- * @see #getDataSource()
+ * @return A {@link Connection} from connectionProvider
+ * @throws SQLException SQL Exception
+ * @throws NullPointerException this connection provider is null
*/
- public D setDataSource(DataSource dataSource) {
- if (dataSource == null) {
- throw new NullPointerException("dataSource must be not null");
+ protected Connection getConnection() throws SQLException {
+ if (connectionProvider == null) {
+ throw new NullPointerException("connectionProvider must be not null");
}
- this.source = null;
- this.dataSource = dataSource;
- setLetterCases();
- return myself;
+ return connectionProvider.getConnection();
}
/**
- * Returns a {@link Connection} from a {@link DataSource} or from a {@link Source}.
+ * Returns a {@link SchemaMetadata} from the {@link ConnectionProvider}
*
- * @return A {@link Connection} differently, depending if it is a {@link DataSource} or a {@link Source}.
- * @throws SQLException SQL Exception
+ * @return A {@link SchemaMetadata} from connectionProvider
+ * @throws NullPointerException this connection provider is null
*/
- protected Connection getConnection() throws SQLException {
- if (dataSource == null && source == null) {
- throw new NullPointerException("connection or dataSource must be not null");
- }
-
- // Get a Connection differently, depending if it is a DataSource or a Source.
- if (dataSource != null) {
- return dataSource.getConnection();
- } else {
- return DriverManager.getConnection(source.getUrl(), source.getUser(), source.getPassword());
+ protected SchemaMetadata getMetaData() {
+ if (connectionProvider == null) {
+ throw new NullPointerException("connectionProvider must be not null");
}
+ return connectionProvider.getMetaData();
}
}
diff --git a/src/main/java/org/assertj/db/type/CachedSchemaMetaData.java b/src/main/java/org/assertj/db/type/CachedSchemaMetaData.java
new file mode 100644
index 00000000..6b594733
--- /dev/null
+++ b/src/main/java/org/assertj/db/type/CachedSchemaMetaData.java
@@ -0,0 +1,57 @@
+/*
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
+ * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations under the License.
+ *
+ * Copyright 2015-2024 the original author or authors.
+ */
+package org.assertj.db.type;
+
+import java.util.Collection;
+import java.util.Map;
+import java.util.concurrent.ConcurrentHashMap;
+
+/**
+ * Implementation of SchemaMetadata that cache the metadata of the first request without any expiration.
+ *
+ * @author Julien Roy
+ * @since 3.0.0
+ */
+class CachedSchemaMetaData implements SchemaMetadata {
+
+ private final FromConnectionSchemaMetadata metadata;
+ private final Map> cache = new ConcurrentHashMap<>();
+
+ public CachedSchemaMetaData(ConnectionProvider connectionProvider) {
+ this.metadata = new FromConnectionSchemaMetadata(connectionProvider);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public Collection getTablesName() {
+ return cache.computeIfAbsent("TABLES", key -> this.metadata.getTablesName());
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public Collection getColumnsName(String tableName) {
+ return cache.computeIfAbsent("COLUMNS#" + tableName, key -> this.metadata.getColumnsName(tableName));
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public Collection getPrimaryKeys(String tableName) {
+ return cache.computeIfAbsent("PKS#" + tableName, key -> this.metadata.getPrimaryKeys(tableName));
+ }
+}
diff --git a/src/main/java/org/assertj/db/type/Changes.java b/src/main/java/org/assertj/db/type/Changes.java
index 3af50b2c..3eec5960 100644
--- a/src/main/java/org/assertj/db/type/Changes.java
+++ b/src/main/java/org/assertj/db/type/Changes.java
@@ -16,15 +16,10 @@
import static org.assertj.db.type.Change.createDeletionChange;
import static org.assertj.db.type.Change.createModificationChange;
-import java.sql.Connection;
-import java.sql.DatabaseMetaData;
-import java.sql.ResultSet;
-import java.sql.SQLException;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;
-import javax.sql.DataSource;
import org.assertj.db.exception.AssertJDBException;
import org.assertj.db.util.ChangeComparator;
@@ -33,6 +28,7 @@
* Changes in the database.
*
* @author Régis Pouiller
+ * @author Julien Roy
*/
public class Changes extends AbstractDbElement {
@@ -65,31 +61,15 @@ public class Changes extends AbstractDbElement {
*/
private List changesList;
- /**
- * Constructor.
- */
- public Changes() {
- super(Changes.class);
- }
-
- /**
- * Constructor.
- *
- * @param source The {@link Source} to connect to the database (must be not {@code null}).
- * @throws NullPointerException If {@code source} is {@code null}.
- */
- public Changes(Source source) {
- super(Changes.class, source);
- }
-
/**
* Constructor.
*
- * @param dataSource The {@link DataSource} (must be not {@code null}).
- * @throws NullPointerException If {@code dataSource} is {@code null}.
+ * @param connectionProvider The {@link ConnectionProvider} to connect to the database (must be not {@code null}).
+ * @throws NullPointerException If {@code connectionProvider} is {@code null}.
+ * @since 3.0.0
*/
- public Changes(DataSource dataSource) {
- super(Changes.class, dataSource);
+ public Changes(ConnectionProvider connectionProvider) {
+ super(Changes.class, connectionProvider);
}
/**
@@ -119,11 +99,8 @@ public Changes(Request request) {
* @param element The {@link AbstractDbElement} on which is the copy
*/
private static void copyElement(AbstractDbElement> elementToCopy, AbstractDbElement> element) {
- if (elementToCopy.getSource() != null) {
- element.setSource(elementToCopy.getSource());
- }
- if (elementToCopy.getDataSource() != null) {
- element.setDataSource(elementToCopy.getDataSource());
+ if (elementToCopy.getConnectionProvider() != null) {
+ element.setConnectionProvider(elementToCopy.getConnectionProvider());
}
}
@@ -277,20 +254,12 @@ public Request getRequestAtEndPoint() {
*/
public Changes setStartPointNow() {
if (request == null && tablesList == null) {
- try (Connection connection = getConnection()) {
- tablesList = new LinkedList<>();
- DatabaseMetaData metaData = connection.getMetaData();
- ResultSet resultSet = metaData.getTables(getCatalog(connection), getSchema(connection), null,
- new String[]{"TABLE"});
- while (resultSet.next()) {
- String tableName = resultSet.getString("TABLE_NAME");
- Table t = new Table().setLetterCases(getTableLetterCase(), getColumnLetterCase(), getPrimaryKeyLetterCase())
- .setName(getTableLetterCase().convert(tableName));
- copyElement(this, t);
- tablesList.add(t);
- }
- } catch (SQLException e) {
- throw new AssertJDBException(e);
+ tablesList = new LinkedList<>();
+ for (String tableName : getMetaData().getTablesName()) {
+ Table t = new Table().setLetterCases(getTableLetterCase(), getColumnLetterCase(), getPrimaryKeyLetterCase())
+ .setName(getTableLetterCase().convert(tableName));
+ copyElement(this, t);
+ tablesList.add(t);
}
}
@@ -538,7 +507,7 @@ public Changes getChangesOfType(ChangeType changeType) {
* @return The new instance.
*/
private Changes createChangesFromThis() {
- Changes changes = new Changes();
+ Changes changes = new Changes(this.getConnectionProvider());
if (request != null) {
changes.request = getDuplicatedRequest(request);
}
diff --git a/src/main/java/org/assertj/db/type/ConnectionProvider.java b/src/main/java/org/assertj/db/type/ConnectionProvider.java
new file mode 100644
index 00000000..de61548a
--- /dev/null
+++ b/src/main/java/org/assertj/db/type/ConnectionProvider.java
@@ -0,0 +1,43 @@
+/*
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
+ * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations under the License.
+ *
+ * Copyright 2015-2024 the original author or authors.
+ */
+package org.assertj.db.type;
+
+import java.sql.Connection;
+import java.sql.SQLException;
+
+import org.assertj.db.type.lettercase.WithLetterCase;
+
+/**
+ * Represent access to a database with capacity to return schema metadata and settings for letter case management.
+ *
+ * @author Julien Roy
+ * @since 3.0.0
+ */
+public interface ConnectionProvider extends WithLetterCase {
+
+ /**
+ * Return SQL connection to database.
+ *
+ * @return An active {@link Connection} to database.
+ * @throws SQLException When access to database fail.
+ */
+ Connection getConnection() throws SQLException;
+
+ /**
+ * Return a accessor to retrieve database schema metadata.
+ *
+ * @return An {@link SchemaMetadata} to access to database schema metadata.
+ */
+ SchemaMetadata getMetaData();
+
+}
diff --git a/src/main/java/org/assertj/db/type/ConnectionProviderFactory.java b/src/main/java/org/assertj/db/type/ConnectionProviderFactory.java
new file mode 100644
index 00000000..81abd7fa
--- /dev/null
+++ b/src/main/java/org/assertj/db/type/ConnectionProviderFactory.java
@@ -0,0 +1,175 @@
+/*
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
+ * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations under the License.
+ *
+ * Copyright 2015-2024 the original author or authors.
+ */
+package org.assertj.db.type;
+
+import javax.sql.DataSource;
+
+import org.assertj.db.type.lettercase.LetterCase;
+
+/**
+ * Fluent factory to create a connectionProvider from different input ( Jdbc URL or DataSource ).
+ * Allow to configure behavior of connection provider like letter case or schema metadata retrieval mode.
+ *
+ * For create with JDBC URL :
+ *
+ *
+ * ConnectionProvider connectionProvider = ConnectionProviderFactory.of("jdbc:h2:mem:test", "sa", "").create();
+ * Table table = new Table(connectionProvider, "movie");
+ *
+ *
+ *
+ * For create with JDBC URL :
+ *
+ *
+ * DataSource dataSource = ...;
+ * ConnectionProvider connectionProvider = ConnectionProviderFactory.of(dataSource).create();
+ * Table table = new Table(connectionProvider, "song", new String[] { "number", "title" }, null);
+ *
+ *
+ *
+ * @author Julien Roy
+ * @since 3.0.0
+ */
+public abstract class ConnectionProviderFactory {
+
+ private ConnectionProviderFactory() {
+ throw new UnsupportedOperationException();
+ }
+
+ /**
+ * Initiate factory with Java.sql.DataSource
+ *
+ * @param dataSource Datasource to retrieve data from database.
+ * @return Factory of ConnectionProvider
+ */
+ public static DataSourceConnectionProviderFactory of(DataSource dataSource) {
+ return new DataSourceConnectionProviderFactory(dataSource);
+ }
+
+ /**
+ * Initiate factory with JDBC connection information
+ *
+ * @param url JDBC url of database.
+ * @param user Connection username.
+ * @param password Connection password.
+ * @return Factory of ConnectionProvider
+ */
+ public static JdbcUrlConnectionProviderFactory of(String url, String user, String password) {
+ return new JdbcUrlConnectionProviderFactory(url, user, password);
+ }
+
+ /**
+ * DataSource variant of ConnectionProviderFactory
+ */
+ public static class DataSourceConnectionProviderFactory extends AbstractConnectionProviderFactory {
+ private final DataSource dataSource;
+
+ private DataSourceConnectionProviderFactory(DataSource dataSource) {
+ super();
+ this.dataSource = dataSource;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public ConnectionProvider create() {
+ return new DataSourceConnectionProvider(dataSource, this.schemaMetaDataMode.getType(), this.tableLetterCase, this.columnLetterCase, this.primaryKeyLetterCase);
+ }
+ }
+
+ /**
+ * Jdbc url variant of ConnectionProviderFactory
+ */
+ public static class JdbcUrlConnectionProviderFactory extends AbstractConnectionProviderFactory {
+ private final String url;
+ private final String user;
+ private final String password;
+
+ private JdbcUrlConnectionProviderFactory(String url, String user, String password) {
+ super();
+
+ this.url = url;
+ this.user = user;
+ this.password = password;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public ConnectionProvider create() {
+ return new JdbcUrlConnectionProvider(url, user, password, this.schemaMetaDataMode.getType(), this.tableLetterCase, this.columnLetterCase, this.primaryKeyLetterCase);
+ }
+ }
+
+ @SuppressWarnings("unchecked")
+ private abstract static class AbstractConnectionProviderFactory {
+
+ /**
+ * Schema metadata retrieval mode.
+ */
+ protected SchemaMetaDataMode schemaMetaDataMode = SchemaMetaDataMode.DYNAMIC;
+ /**
+ * Tables letter case.
+ */
+ protected LetterCase tableLetterCase = LetterCase.TABLE_DEFAULT;
+ /**
+ * Columns letter case.
+ */
+ protected LetterCase columnLetterCase = LetterCase.COLUMN_DEFAULT;
+ /**
+ * PKs letter case.
+ */
+ protected LetterCase primaryKeyLetterCase = LetterCase.PRIMARY_KEY_DEFAULT;
+
+ private AbstractConnectionProviderFactory() {
+ }
+
+ /**
+ * Modify the default letter case mode for connection provider.
+ *
+ * @param tableLetterCase Tables letter case.
+ * @param columnLetterCase Columns letter case.
+ * @param primaryKeyLetterCase PKs letter case.
+ * @return the current instance of factory.
+ */
+ public T letterCase(LetterCase tableLetterCase, LetterCase columnLetterCase, LetterCase primaryKeyLetterCase) {
+ this.tableLetterCase = tableLetterCase;
+ this.columnLetterCase = columnLetterCase;
+ this.primaryKeyLetterCase = primaryKeyLetterCase;
+ return (T) this;
+ }
+
+ /**
+ * Modify the current mode for schema metadata retrieval.
+ *
+ * @param mode The selected mode
+ * @return the current instance of factory.
+ */
+ public T schemaMetaDataMode(SchemaMetaDataMode mode) {
+ if (mode == null) {
+ throw new IllegalArgumentException("SchemaMetaDataMode cannot be null");
+ }
+ this.schemaMetaDataMode = mode;
+ return (T) this;
+ }
+
+ /**
+ * Build the Connection Provider
+ *
+ * @return Connection provider to use for Table, Request or Changes
+ */
+ public abstract ConnectionProvider create();
+ }
+}
diff --git a/src/main/java/org/assertj/db/type/DataSourceConnectionProvider.java b/src/main/java/org/assertj/db/type/DataSourceConnectionProvider.java
new file mode 100644
index 00000000..4f59e125
--- /dev/null
+++ b/src/main/java/org/assertj/db/type/DataSourceConnectionProvider.java
@@ -0,0 +1,55 @@
+/*
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
+ * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations under the License.
+ *
+ * Copyright 2015-2024 the original author or authors.
+ */
+package org.assertj.db.type;
+
+import java.sql.Connection;
+import java.sql.SQLException;
+import javax.sql.DataSource;
+
+import org.assertj.db.type.lettercase.LetterCase;
+
+/**
+ * The implementation of {@link ConnectionProvider} based on java.sql.DataSource.
+ * Use {@link ConnectionProviderFactory} for instantiate.
+ *
+ * @author Julien Roy
+ * @since 3.0.0
+ */
+public class DataSourceConnectionProvider extends AbstractConnectionProvider {
+
+ private final DataSource dataSource;
+
+ DataSourceConnectionProvider(DataSource dataSource,
+ Class extends SchemaMetadata> schemaMetadataType,
+ LetterCase tableLetterCase, LetterCase columnLetterCase, LetterCase primaryKeyLetterCase) {
+
+ super(schemaMetadataType, tableLetterCase, columnLetterCase, primaryKeyLetterCase);
+ this.dataSource = dataSource;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public Connection getConnection() throws SQLException {
+ return dataSource.getConnection();
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public String toString() {
+ return "data source";
+ }
+}
diff --git a/src/main/java/org/assertj/db/type/DataSourceWithLetterCase.java b/src/main/java/org/assertj/db/type/DataSourceWithLetterCase.java
deleted file mode 100644
index d39f43fb..00000000
--- a/src/main/java/org/assertj/db/type/DataSourceWithLetterCase.java
+++ /dev/null
@@ -1,162 +0,0 @@
-/*
- * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
- * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations under the License.
- *
- * Copyright 2015-2024 the original author or authors.
- */
-package org.assertj.db.type;
-
-import java.io.PrintWriter;
-import java.sql.Connection;
-import java.sql.SQLException;
-import java.sql.SQLFeatureNotSupportedException;
-import java.util.logging.Logger;
-import javax.sql.DataSource;
-
-import org.assertj.db.type.lettercase.LetterCase;
-import org.assertj.db.type.lettercase.WithLetterCase;
-
-/**
- * A data source to connect to the database with letter case.
- *
- * @author Régis Pouiller
- * @since 1.1.0
- */
-public class DataSourceWithLetterCase implements DataSource, WithLetterCase {
-
- /**
- * The data source.
- */
- private final DataSource dataSource;
- /**
- * Letter case of the tables.
- */
- private final LetterCase tableLetterCase;
- /**
- * Letter case of the columns.
- */
- private final LetterCase columnLetterCase;
- /**
- * Letter case of the primary keys.
- */
- private final LetterCase primaryKeyLetterCase;
-
- /**
- * Constructor.
- *
- * @param dataSource The data source.
- * @param tableLetterCase Letter case of the tables.
- * @param columnLetterCase Letter case of the columns.
- * @param primaryKeyLetterCase Letter case of the primary keys.
- */
- public DataSourceWithLetterCase(DataSource dataSource, LetterCase tableLetterCase,
- LetterCase columnLetterCase, LetterCase primaryKeyLetterCase) {
-
- this.dataSource = dataSource;
- this.tableLetterCase = tableLetterCase;
- this.columnLetterCase = columnLetterCase;
- this.primaryKeyLetterCase = primaryKeyLetterCase;
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public LetterCase getColumnLetterCase() {
- return columnLetterCase;
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public LetterCase getPrimaryKeyLetterCase() {
- return primaryKeyLetterCase;
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public LetterCase getTableLetterCase() {
- return tableLetterCase;
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public Connection getConnection() throws SQLException {
- return dataSource.getConnection();
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public Connection getConnection(String username, String password) throws SQLException {
- return dataSource.getConnection(username, password);
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public PrintWriter getLogWriter() throws SQLException {
- return dataSource.getLogWriter();
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public void setLogWriter(PrintWriter out) throws SQLException {
- dataSource.setLogWriter(out);
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public int getLoginTimeout() throws SQLException {
- return dataSource.getLoginTimeout();
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public void setLoginTimeout(int seconds) throws SQLException {
- dataSource.setLoginTimeout(seconds);
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public Logger getParentLogger() throws SQLFeatureNotSupportedException {
- return dataSource.getParentLogger();
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public T unwrap(Class iface) throws SQLException {
- return dataSource.unwrap(iface);
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public boolean isWrapperFor(Class> iface) throws SQLException {
- return dataSource.isWrapperFor(iface);
- }
-}
diff --git a/src/main/java/org/assertj/db/type/FromConnectionSchemaMetadata.java b/src/main/java/org/assertj/db/type/FromConnectionSchemaMetadata.java
new file mode 100644
index 00000000..1dd81208
--- /dev/null
+++ b/src/main/java/org/assertj/db/type/FromConnectionSchemaMetadata.java
@@ -0,0 +1,119 @@
+/*
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
+ * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations under the License.
+ *
+ * Copyright 2015-2024 the original author or authors.
+ */
+package org.assertj.db.type;
+
+import java.sql.Connection;
+import java.sql.DatabaseMetaData;
+import java.sql.ResultSet;
+import java.sql.SQLException;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.List;
+
+import org.assertj.db.exception.AssertJDBException;
+
+/**
+ * @author Julien Roy
+ * @since 3.0.0
+ */
+class FromConnectionSchemaMetadata implements SchemaMetadata {
+
+ private final ConnectionProvider connectionProvider;
+
+ public FromConnectionSchemaMetadata(ConnectionProvider connectionProvider) {
+ this.connectionProvider = connectionProvider;
+ }
+
+ /**
+ * Returns the catalog from a connection.
+ *
+ * @param connection The connection with the catalog
+ * @return The catalog from a connection.
+ * @throws SQLException SQL Exception
+ */
+ private static String getCatalog(Connection connection) throws SQLException {
+ try {
+ return connection.getCatalog();
+ } catch (SQLException exception) {
+ throw exception;
+ } catch (Exception throwable) {
+ return null;
+ }
+ }
+
+ /**
+ * Returns the schema from a connection.
+ *
+ * @param connection The connection with the catalog
+ * @return The schema from a connection.
+ * @throws SQLException SQL Exception
+ */
+ private static String getSchema(Connection connection) throws SQLException {
+ try {
+ return connection.getSchema();
+ } catch (SQLException exception) {
+ throw exception;
+ } catch (Exception throwable) {
+ return null;
+ }
+ }
+
+ @Override
+ public Collection getTablesName() {
+ try (Connection connection = connectionProvider.getConnection()) {
+ List tables = new ArrayList<>();
+ DatabaseMetaData metaData = connection.getMetaData();
+ try (ResultSet tableResultSet = metaData.getTables(getCatalog(connection), getSchema(connection), null, new String[]{"TABLE"})) {
+ while (tableResultSet.next()) {
+ String tableName = tableResultSet.getString("TABLE_NAME");
+ tables.add(tableName);
+ }
+ }
+ return tables;
+ } catch (SQLException e) {
+ throw new AssertJDBException(e);
+ }
+ }
+
+ @Override
+ public Collection getColumnsName(String tableName) {
+ try (Connection connection = connectionProvider.getConnection()) {
+ List columnsList = new ArrayList<>();
+ try (ResultSet columnsResultSet = connection.getMetaData().getColumns(getCatalog(connection), getSchema(connection), tableName, null)) {
+ while (columnsResultSet.next()) {
+ String column = columnsResultSet.getString("COLUMN_NAME");
+ columnsList.add(column);
+ }
+ }
+ return columnsList;
+ } catch (SQLException e) {
+ throw new AssertJDBException(e);
+ }
+ }
+
+ @Override
+ public Collection getPrimaryKeys(String tableName) {
+ try (Connection connection = connectionProvider.getConnection()) {
+ List pksNameList = new ArrayList<>();
+ try (ResultSet resultSet = connection.getMetaData().getPrimaryKeys(getCatalog(connection), getSchema(connection), tableName)) {
+ while (resultSet.next()) {
+ String pkName = resultSet.getString("COLUMN_NAME");
+ pksNameList.add(pkName);
+ }
+ }
+ return pksNameList;
+ } catch (SQLException e) {
+ throw new AssertJDBException(e);
+ }
+ }
+}
diff --git a/src/main/java/org/assertj/db/type/JdbcUrlConnectionProvider.java b/src/main/java/org/assertj/db/type/JdbcUrlConnectionProvider.java
new file mode 100644
index 00000000..a7795006
--- /dev/null
+++ b/src/main/java/org/assertj/db/type/JdbcUrlConnectionProvider.java
@@ -0,0 +1,59 @@
+/*
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
+ * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations under the License.
+ *
+ * Copyright 2015-2024 the original author or authors.
+ */
+package org.assertj.db.type;
+
+import java.sql.Connection;
+import java.sql.DriverManager;
+import java.sql.SQLException;
+
+import org.assertj.db.type.lettercase.LetterCase;
+
+/**
+ * The implementation of {@link ConnectionProvider} from JDBC url connection info.
+ * Use {@link ConnectionProviderFactory} for instantiate.
+ *
+ * @author Julien Roy
+ * @since 3.0.0
+ */
+public class JdbcUrlConnectionProvider extends AbstractConnectionProvider {
+
+ private final String url;
+ private final String user;
+ private final String password;
+
+ JdbcUrlConnectionProvider(String url, String user, String password,
+ Class extends SchemaMetadata> schemaMetadataType,
+ LetterCase tableLetterCase, LetterCase columnLetterCase, LetterCase primaryKeyLetterCase) {
+
+ super(schemaMetadataType, tableLetterCase, columnLetterCase, primaryKeyLetterCase);
+ this.url = url;
+ this.user = user;
+ this.password = password;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public Connection getConnection() throws SQLException {
+ return DriverManager.getConnection(this.url, this.user, this.password);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public String toString() {
+ return this.user + "/" + this.url;
+ }
+}
diff --git a/src/main/java/org/assertj/db/type/Request.java b/src/main/java/org/assertj/db/type/Request.java
index e4793557..41b4cd34 100644
--- a/src/main/java/org/assertj/db/type/Request.java
+++ b/src/main/java/org/assertj/db/type/Request.java
@@ -20,14 +20,13 @@
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
-import javax.sql.DataSource;
import org.assertj.db.type.lettercase.LetterCase;
/**
* A request in the database to get values.
*
- * The different information of the request are connection or data source, the SQL request and optionally the parameters
+ * The different information of the request are connectionProvider, the SQL request and optionally the parameters
* of the SQL request.
*
*
@@ -37,30 +36,32 @@
*
*
* This {@link Request} point to a request without parameter in a H2 database in memory like indicated in the
- * {@link Source}.
+ * {@link ConnectionProvider}.
*
*
*
- * Source source = new Source("jdbc:h2:mem:test", "sa", "");
- * Request request = new Request(source, "select title from movie;");
+ * ConnectionProvider connectionProvider = ConnectionProviderFactory.of("jdbc:h2:mem:test", "sa", "").create();
+ * Request request = new Request(connectionProvider, "select title from movie;");
*
*
*
*
*
* Below the {@link Request} point to a request with {@code 2000} in parameter.
- * The {@link Request} use a {@code DataSource} instead of a {@link Source} like above.
+ * The {@link Request} use a {@code DataSource} in the factory of {@link ConnectionProvider} like above.
*
*
*
* DataSource dataSource = ...;
- * Request request = new Request(dataSource, "select title from movie where year > ?;", 2000);
+ * ConnectionProvider connectionProvider = ConnectionProviderFactory.of(dataSource).create();
+ * Request request = new Request(connectionProvider, "select title from movie where year > ?;", 2000);
*
*
*
*
*
* @author Régis Pouiller
+ * @author Julien Roy
*/
public class Request extends AbstractDbData {
@@ -83,25 +84,13 @@ public Request() {
/**
* Constructor with a connection.
*
- * @param source Source to connect to the database.
- * @param request SQL Request to get the values.
- * @param parameters Parameters of the SQL request.
+ * @param connectionProvider Connection provider to connect to the database.
+ * @param request SQL Request to get the values.
+ * @param parameters Parameters of the SQL request.
+ * @since 3.0.0
*/
- public Request(Source source, String request, Object... parameters) {
- super(Request.class, DataType.REQUEST, source);
- setRequest(request);
- this.parameters = parameters;
- }
-
- /**
- * Constructor with a data source.
- *
- * @param dataSource Data source.
- * @param request SQL Request to get the values.
- * @param parameters Parameters of the SQL request.
- */
- public Request(DataSource dataSource, String request, Object... parameters) {
- super(Request.class, DataType.REQUEST, dataSource);
+ public Request(ConnectionProvider connectionProvider, String request, Object... parameters) {
+ super(Request.class, DataType.REQUEST, connectionProvider);
setRequest(request);
this.parameters = parameters;
}
diff --git a/src/main/java/org/assertj/db/type/SchemaMetaDataMode.java b/src/main/java/org/assertj/db/type/SchemaMetaDataMode.java
new file mode 100644
index 00000000..2f43930a
--- /dev/null
+++ b/src/main/java/org/assertj/db/type/SchemaMetaDataMode.java
@@ -0,0 +1,48 @@
+/*
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
+ * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations under the License.
+ *
+ * Copyright 2015-2024 the original author or authors.
+ */
+package org.assertj.db.type;
+
+/**
+ * Define existing schema metadata retrieval mode.
+ *
+ * @author Julien Roy
+ * @since 3.0.0
+ */
+public enum SchemaMetaDataMode {
+ /**
+ * Retrieve schema metadata only once and keep in memory for all duration of connection provider.
+ * To use when database schema is not modified during tests.
+ */
+ STATIC(CachedSchemaMetaData.class),
+ /**
+ * Retrieve schema metadata each time is required.
+ * To use when database schema is modified during tests.
+ */
+ DYNAMIC(FromConnectionSchemaMetadata.class);
+
+
+ private final Class extends SchemaMetadata> type;
+
+ SchemaMetaDataMode(Class extends SchemaMetadata> type) {
+ this.type = type;
+ }
+
+ /**
+ * Return the underline java type that implement the strategy.
+ *
+ * @return Class to use for instantiate the schema retriever.
+ */
+ Class extends SchemaMetadata> getType() {
+ return type;
+ }
+}
diff --git a/src/main/java/org/assertj/db/type/SchemaMetadata.java b/src/main/java/org/assertj/db/type/SchemaMetadata.java
new file mode 100644
index 00000000..ee02e8c0
--- /dev/null
+++ b/src/main/java/org/assertj/db/type/SchemaMetadata.java
@@ -0,0 +1,25 @@
+/*
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
+ * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations under the License.
+ *
+ * Copyright 2015-2024 the original author or authors.
+ */
+package org.assertj.db.type;
+
+import java.util.Collection;
+
+interface SchemaMetadata {
+
+ Collection getTablesName();
+
+ Collection getColumnsName(String tableName);
+
+ Collection getPrimaryKeys(String tableName);
+
+}
diff --git a/src/main/java/org/assertj/db/type/Source.java b/src/main/java/org/assertj/db/type/Source.java
deleted file mode 100644
index afee685e..00000000
--- a/src/main/java/org/assertj/db/type/Source.java
+++ /dev/null
@@ -1,80 +0,0 @@
-/*
- * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
- * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations under the License.
- *
- * Copyright 2015-2024 the original author or authors.
- */
-package org.assertj.db.type;
-
-/**
- * A source to indicates the information to connect to the database. It contains the url, user and password to the
- * database. A source is used by a {@link Table} or a {@link Request}.
- * Example of instantiation :
- *
- * Source source = new Source("jdbc:h2:mem:test", "sa", "");
- *
- * That creates a source to a H2 database in memory.
- *
- * @author Régis Pouiller
- */
-public class Source {
-
- /**
- * URL to the database.
- */
- private final String url;
- /**
- * User to connect.
- */
- private final String user;
- /**
- * Password to connect.
- */
- private final String password;
-
- /**
- * Constructor with the information.
- *
- * @param url URL to the database.
- * @param user User to connect.
- * @param password Password to connect.
- */
- public Source(String url, String user, String password) {
- this.url = url;
- this.user = user;
- this.password = password;
- }
-
- /**
- * Returns the URL to the database.
- *
- * @return The URL to the database.
- */
- public String getUrl() {
- return url;
- }
-
- /**
- * Returns the user to connect.
- *
- * @return The user to connect.
- */
- public String getUser() {
- return user;
- }
-
- /**
- * Returns the password to connect.
- *
- * @return The password to connect.
- */
- public String getPassword() {
- return password;
- }
-}
diff --git a/src/main/java/org/assertj/db/type/Table.java b/src/main/java/org/assertj/db/type/Table.java
index 8228ea68..a9186235 100644
--- a/src/main/java/org/assertj/db/type/Table.java
+++ b/src/main/java/org/assertj/db/type/Table.java
@@ -30,7 +30,7 @@
/**
* A table in the database to read to get the values.
*
- * The different information of the table are {@link Source} or {@link DataSource}, name of the table and optionally
+ * The different information of the table are {@link ConnectionProvider} or {@link DataSource}, name of the table and optionally
* the columns to check and to exclude.
*
*
@@ -40,13 +40,13 @@
*
*
* This {@link Table} point to a table called {@code movie} in a H2 database in memory like indicated in the
- * {@link Source}.
+ * {@link ConnectionProvider}.
*
*
*
*
- * Source source = new Source("jdbc:h2:mem:test", "sa", "");
- * Table table = new Table(source, "movie");
+ * ConnectionProvider connectionProvider = ConnectionProviderFactory.of("jdbc:h2:mem:test", "sa", "").create();
+ * Table table = new Table(connectionProvider, "movie");
*
*
*
@@ -57,14 +57,15 @@
* {@code number} and {@code title}).
* And the {@link Table} {@code table2} point to a table called {@code musician} (but ignore on the column called
* {@code birthday}).
- * The {@link Table} use a {@code DataSource} instead of a {@link Source} like above.
+ * The {@link Table} use a {@code DataSource} instead of a {@link ConnectionProvider} like above.
*
*
*
*
* DataSource dataSource = ...;
- * Table table1 = new Table(dataSource, "song", new String[] { "number", "title" }, null);
- * Table table2 = new Table(dataSource, "musician", null, new String[] { "birthday" });
+ * ConnectionProvider connectionProvider = ConnectionProviderFactory.of(dataSource).create();
+ * Table table1 = new Table(connectionProvider, "song", new String[] { "number", "title" }, null);
+ * Table table2 = new Table(connectionProvider, "musician", null, new String[] { "birthday" });
*
*
*
@@ -72,6 +73,7 @@
*
*
* @author Régis Pouiller
+ * @author Julien Roy
*/
public class Table extends AbstractDbData {
@@ -118,241 +120,121 @@ public Table() {
}
/**
- * Constructor with a {@link Source} and the name of the table.
+ * Constructor with a {@link ConnectionProvider} and the name of the table.
*
- * @param source {@link Source} to connect to the database.
- * @param name Name of the table.
+ * @param connectionProvider {@link ConnectionProvider} to connect to the database.
+ * @param name Name of the table.
+ * @since 3.0.0
*/
- public Table(Source source, String name) {
- this(source, name, null, (String[]) null);
+ public Table(ConnectionProvider connectionProvider, String name) {
+ this(connectionProvider, name, null, (String[]) null);
}
/**
- * Constructor with a {@link Source}, the name of the table and the columns to check and to exclude.
+ * Constructor with a {@link ConnectionProvider}, the name of the table and the columns to check and to exclude.
*
- * @param source {@link Source} to connect to the database.
- * @param name Name of the table.
- * @param columnsToCheck Array of the name of the columns to check. If {@code null} that means to check all the
- * columns.
- * @param columnsToExclude Array of the name of the columns to exclude. If {@code null} that means to exclude no
- * column.
- */
- public Table(Source source, String name, String[] columnsToCheck, String[] columnsToExclude) {
- this(source, name, null, columnsToCheck, columnsToExclude);
- }
-
- /**
- * Constructor with a dataSource and the name of the table.
- *
- * @param dataSource DataSource of the database.
- * @param name Name of the table.
- */
- public Table(DataSource dataSource, String name) {
- this(dataSource, name, null, (String[]) null);
- }
-
- /**
- * Constructor with a connection, the name of the table and the columns to check and to exclude.
- *
- * @param dataSource DataSource of the database.
- * @param name Name of the table.
- * @param columnsToCheck Array of the name of the columns to check. If {@code null} that means to check all the
- * columns.
- * @param columnsToExclude Array of the name of the columns to exclude. If {@code null} that means to exclude no
- * column.
- */
- public Table(DataSource dataSource, String name, String[] columnsToCheck, String[] columnsToExclude) {
- this(dataSource, name, null, columnsToCheck, columnsToExclude);
- }
-
- /**
- * Constructor with a {@link Source} and the name of the table.
- *
- * @param source {@link Source} to connect to the database.
- * @param name Name of the table.
- * @param columnsToOrder List of column to use as ORDER BY
- * @since 1.2.0
- */
- public Table(Source source, String name, Order[] columnsToOrder) {
- this(source, name, columnsToOrder, null, null);
- }
-
- /**
- * Constructor with a {@link Source}, the name of the table and the columns to check and to exclude.
- *
- * @param source {@link Source} to connect to the database.
- * @param name Name of the table.
- * @param columnsToOrder List of column to use as ORDER BY
- * @param columnsToCheck Array of the name of the columns to check. If {@code null} that means to check all the
- * columns.
- * @param columnsToExclude Array of the name of the columns to exclude. If {@code null} that means to exclude no
- * column.
- * @since 1.2.0
+ * @param connectionProvider {@link ConnectionProvider} to connect to the database.
+ * @param name Name of the table.
+ * @param columnsToCheck Array of the name of the columns to check. If {@code null} that means to check all the
+ * columns.
+ * @param columnsToExclude Array of the name of the columns to exclude. If {@code null} that means to exclude no
+ * column.
+ * @since 3.0.0
*/
- public Table(Source source, String name, Order[] columnsToOrder, String[] columnsToCheck, String[] columnsToExclude) {
- this(source, name, null, null, columnsToOrder, columnsToCheck, columnsToExclude);
+ public Table(ConnectionProvider connectionProvider, String name, String[] columnsToCheck, String[] columnsToExclude) {
+ this(connectionProvider, name, null, columnsToCheck, columnsToExclude);
}
/**
- * Constructor with a dataSource and the name of the table.
+ * Constructor with a {@link ConnectionProvider} and the name of the table.
*
- * @param dataSource DataSource of the database.
- * @param name Name of the table.
- * @param columnsToOrder List of column to use as ORDER BY
- * @since 1.2.0
+ * @param connectionProvider {@link ConnectionProvider} to connect to the database.
+ * @param name Name of the table.
+ * @param columnsToOrder List of column to use as ORDER BY
+ * @since 3.0.0
*/
- public Table(DataSource dataSource, String name, Order[] columnsToOrder) {
- this(dataSource, name, columnsToOrder, null, null);
+ public Table(ConnectionProvider connectionProvider, String name, Order[] columnsToOrder) {
+ this(connectionProvider, name, columnsToOrder, null, null);
}
/**
- * Constructor with a connection, the name of the table and the columns to check and to exclude.
+ * Constructor with a {@link ConnectionProvider}, the name of the table and the columns to check and to exclude.
*
- * @param dataSource DataSource of the database.
- * @param name Name of the table.
- * @param columnsToOrder List of column to use as ORDER BY
- * @param columnsToCheck Array of the name of the columns to check. If {@code null} that means to check all the
- * columns.
- * @param columnsToExclude Array of the name of the columns to exclude. If {@code null} that means to exclude no
- * column.
- * @since 1.2.0
+ * @param connectionProvider {@link ConnectionProvider} to connect to the database.
+ * @param name Name of the table.
+ * @param columnsToOrder List of column to use as ORDER BY
+ * @param columnsToCheck Array of the name of the columns to check. If {@code null} that means to check all the
+ * columns.
+ * @param columnsToExclude Array of the name of the columns to exclude. If {@code null} that means to exclude no
+ * column.
+ * @since 3.0.0
*/
- public Table(DataSource dataSource, String name, Order[] columnsToOrder, String[] columnsToCheck, String[] columnsToExclude) {
- this(dataSource, name, null, null, columnsToOrder, columnsToCheck, columnsToExclude);
+ public Table(ConnectionProvider connectionProvider, String name, Order[] columnsToOrder, String[] columnsToCheck, String[] columnsToExclude) {
+ this(connectionProvider, name, null, null, columnsToOrder, columnsToCheck, columnsToExclude);
}
/**
- * Constructor with a {@link Source} and the name of the table.
+ * Constructor with a {@link ConnectionProvider} and the name of the table.
*
- * @param source {@link Source} to connect to the database.
- * @param name Name of the table.
- * @param startDelimiter Start delimiter for column name and table name.
- * @param endDelimiter End delimiter for column name and table name.
- * @since 1.2.0
+ * @param connectionProvider {@link ConnectionProvider} to connect to the database.
+ * @param name Name of the table.
+ * @param startDelimiter Start delimiter for column name and table name.
+ * @param endDelimiter End delimiter for column name and table name.
+ * @since 3.0.0
*/
- public Table(Source source, String name, Character startDelimiter, Character endDelimiter) {
- this(source, name, startDelimiter, endDelimiter, null, null, null);
+ public Table(ConnectionProvider connectionProvider, String name, Character startDelimiter, Character endDelimiter) {
+ this(connectionProvider, name, startDelimiter, endDelimiter, null, null, null);
}
/**
- * Constructor with a {@link Source}, the name of the table and the columns to check and to exclude.
+ * Constructor with a {@link ConnectionProvider}, the name of the table and the columns to check and to exclude.
*
- * @param source {@link Source} to connect to the database.
- * @param name Name of the table.
- * @param startDelimiter Start delimiter for column name and table name.
- * @param endDelimiter End delimiter for column name and table name.
- * @param columnsToCheck Array of the name of the columns to check. If {@code null} that means to check all the
- * columns.
- * @param columnsToExclude Array of the name of the columns to exclude. If {@code null} that means to exclude no
- * column.
- * @since 1.2.0
+ * @param connectionProvider {@link ConnectionProvider} to connect to the database.
+ * @param name Name of the table.
+ * @param startDelimiter Start delimiter for column name and table name.
+ * @param endDelimiter End delimiter for column name and table name.
+ * @param columnsToCheck Array of the name of the columns to check. If {@code null} that means to check all the
+ * columns.
+ * @param columnsToExclude Array of the name of the columns to exclude. If {@code null} that means to exclude no
+ * column.
+ * @since 3.0.0
*/
- public Table(Source source, String name, Character startDelimiter, Character endDelimiter, String[] columnsToCheck,
+ public Table(ConnectionProvider connectionProvider, String name, Character startDelimiter, Character endDelimiter, String[] columnsToCheck,
String[] columnsToExclude) {
- this(source, name, startDelimiter, endDelimiter, null, columnsToCheck, columnsToExclude);
+ this(connectionProvider, name, startDelimiter, endDelimiter, null, columnsToCheck, columnsToExclude);
}
/**
- * Constructor with a dataSource and the name of the table.
+ * Constructor with a {@link ConnectionProvider} and the name of the table.
*
- * @param dataSource DataSource of the database.
- * @param name Name of the table.
- * @param startDelimiter Start delimiter for column name and table name.
- * @param endDelimiter End delimiter for column name and table name.
- * @since 1.2.0
+ * @param connectionProvider {@link ConnectionProvider} to connect to the database.
+ * @param name Name of the table.
+ * @param startDelimiter Start delimiter for column name and table name.
+ * @param endDelimiter End delimiter for column name and table name.
+ * @param columnsToOrder List of column to use as ORDER BY
+ * @since 3.0.0
*/
- public Table(DataSource dataSource, String name, Character startDelimiter, Character endDelimiter) {
- this(dataSource, name, startDelimiter, endDelimiter, null, null, null);
+ public Table(ConnectionProvider connectionProvider, String name, Character startDelimiter, Character endDelimiter, Order[] columnsToOrder) {
+ this(connectionProvider, name, startDelimiter, endDelimiter, columnsToOrder, null, null);
}
/**
- * Constructor with a connection, the name of the table and the columns to check and to exclude.
+ * Constructor with a {@link ConnectionProvider}, the name of the table and the columns to check and to exclude.
*
- * @param dataSource DataSource of the database.
- * @param name Name of the table.
- * @param startDelimiter Start delimiter for column name and table name.
- * @param endDelimiter End delimiter for column name and table name.
- * @param columnsToCheck Array of the name of the columns to check. If {@code null} that means to check all the
- * columns.
- * @param columnsToExclude Array of the name of the columns to exclude. If {@code null} that means to exclude no
- * column.
- * @since 1.2.0
+ * @param connectionProvider {@link ConnectionProvider} to connect to the database.
+ * @param name Name of the table.
+ * @param startDelimiter Start delimiter for column name and table name.
+ * @param endDelimiter End delimiter for column name and table name.
+ * @param columnsToOrder List of column to use as ORDER BY
+ * @param columnsToCheck Array of the name of the columns to check. If {@code null} that means to check all the
+ * columns.
+ * @param columnsToExclude Array of the name of the columns to exclude. If {@code null} that means to exclude no
+ * column.
+ * @since 3.0.0
*/
- public Table(DataSource dataSource, String name, Character startDelimiter, Character endDelimiter, String[] columnsToCheck,
- String[] columnsToExclude) {
- this(dataSource, name, startDelimiter, endDelimiter, null, columnsToCheck, columnsToExclude);
- }
-
- /**
- * Constructor with a {@link Source} and the name of the table.
- *
- * @param source {@link Source} to connect to the database.
- * @param name Name of the table.
- * @param startDelimiter Start delimiter for column name and table name.
- * @param endDelimiter End delimiter for column name and table name.
- * @param columnsToOrder List of column to use as ORDER BY
- * @since 1.2.0
- */
- public Table(Source source, String name, Character startDelimiter, Character endDelimiter, Order[] columnsToOrder) {
- this(source, name, startDelimiter, endDelimiter, columnsToOrder, null, null);
- }
-
- /**
- * Constructor with a {@link Source}, the name of the table and the columns to check and to exclude.
- *
- * @param source {@link Source} to connect to the database.
- * @param name Name of the table.
- * @param startDelimiter Start delimiter for column name and table name.
- * @param endDelimiter End delimiter for column name and table name.
- * @param columnsToOrder List of column to use as ORDER BY
- * @param columnsToCheck Array of the name of the columns to check. If {@code null} that means to check all the
- * columns.
- * @param columnsToExclude Array of the name of the columns to exclude. If {@code null} that means to exclude no
- * column.
- * @since 1.2.0
- */
- public Table(Source source, String name, Character startDelimiter, Character endDelimiter, Order[] columnsToOrder,
+ public Table(ConnectionProvider connectionProvider, String name, Character startDelimiter, Character endDelimiter, Order[] columnsToOrder,
String[] columnsToCheck, String[] columnsToExclude) {
- super(Table.class, DataType.TABLE, source);
- setName(name);
- setStartDelimiter(startDelimiter);
- setEndDelimiter(endDelimiter);
- setColumnsToOrder(columnsToOrder);
- setColumnsToCheck(columnsToCheck);
- setColumnsToExclude(columnsToExclude);
- }
-
- /**
- * Constructor with a dataSource and the name of the table.
- *
- * @param dataSource DataSource of the database.
- * @param name Name of the table.
- * @param startDelimiter Start delimiter for column name and table name.
- * @param endDelimiter End delimiter for column name and table name.
- * @param columnsToOrder List of column to use as ORDER BY
- * @since 1.2.0
- */
- public Table(DataSource dataSource, String name, Character startDelimiter, Character endDelimiter, Order[] columnsToOrder) {
- this(dataSource, name, startDelimiter, endDelimiter, columnsToOrder, null, null);
- }
-
- /**
- * Constructor with a connection, the name of the table and the columns to check and to exclude.
- *
- * @param dataSource DataSource of the database.
- * @param name Name of the table.
- * @param startDelimiter Start delimiter for column name and table name.
- * @param endDelimiter End delimiter for column name and table name.
- * @param columnsToOrder List of column to use as ORDER BY
- * @param columnsToCheck Array of the name of the columns to check. If {@code null} that means to check all the
- * columns.
- * @param columnsToExclude Array of the name of the columns to exclude. If {@code null} that means to exclude no
- * column.
- * @since 1.2.0
- */
- public Table(DataSource dataSource, String name, Character startDelimiter, Character endDelimiter, Order[] columnsToOrder,
- String[] columnsToCheck, String[] columnsToExclude) {
- super(Table.class, DataType.TABLE, dataSource);
+ super(Table.class, DataType.TABLE, connectionProvider);
setName(name);
setStartDelimiter(startDelimiter);
setEndDelimiter(endDelimiter);
@@ -391,18 +273,8 @@ public Table setName(String name) {
* {@inheritDoc}
*/
@Override
- public Table setDataSource(DataSource dataSource) {
- Table table = super.setDataSource(dataSource);
- setNameFromDb();
- return table;
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public Table setSource(Source source) {
- Table table = super.setSource(source);
+ public Table setConnectionProvider(ConnectionProvider connectionProvider) {
+ Table table = super.setConnectionProvider(connectionProvider);
setNameFromDb();
return table;
}
@@ -411,32 +283,21 @@ public Table setSource(Source source) {
* Set the name from the corresponding name in the database.
*/
private void setNameFromDb() {
- if (name != null && (getSource() != null || getDataSource() != null)) {
- try (Connection connection = getConnection()) {
- LetterCase tableLetterCase = getTableLetterCase();
- LetterCase columnLetterCase = getColumnLetterCase();
-
- DatabaseMetaData metaData = connection.getMetaData();
- try (ResultSet tableResultSet = metaData.getTables(getCatalog(connection), getSchema(connection), null,
- new String[]{"TABLE"})) {
- while (tableResultSet.next()) {
- String tableName = tableResultSet.getString("TABLE_NAME");
- if (tableLetterCase.isEqual(tableName, name)) {
- name = tableLetterCase.convert(tableName);
- break;
- }
- }
+ if (name != null && this.getConnectionProvider() != null) {
+
+ LetterCase tableLetterCase = getTableLetterCase();
+ LetterCase columnLetterCase = getColumnLetterCase();
+ SchemaMetadata metaData = getMetaData();
+ for (String tableName : metaData.getTablesName()) {
+ if (tableLetterCase.isEqual(tableName, name)) {
+ name = tableLetterCase.convert(tableName);
+ break;
}
+ }
- columnsList = new ArrayList<>();
- try (ResultSet columnsResultSet = metaData.getColumns(getCatalog(connection), getSchema(connection), name, null)) {
- while (columnsResultSet.next()) {
- String column = columnsResultSet.getString("COLUMN_NAME");
- columnsList.add(columnLetterCase.convert(column));
- }
- }
- } catch (SQLException e) {
- throw new AssertJDBException(e);
+ columnsList = new ArrayList<>();
+ for (String column : metaData.getColumnsName(name)) {
+ columnsList.add(columnLetterCase.convert(column));
}
}
}
@@ -465,7 +326,7 @@ public String[] getColumnsToCheck() {
*/
public Table setColumnsToCheck(String[] columnsToCheck) {
if (columnsList == null) {
- throw new AssertJDBException("The table name and the source or datasource must be set first");
+ throw new AssertJDBException("The table name and the connectionProvider must be set first");
}
if (columnsToCheck != null) {
LetterCase letterCase = getColumnLetterCase();
@@ -510,7 +371,7 @@ public String[] getColumnsToExclude() {
*/
public Table setColumnsToExclude(String[] columnsToExclude) {
if (columnsList == null) {
- throw new AssertJDBException("The table name and the source or datasource must be set first");
+ throw new AssertJDBException("The table name and the connectionProvider must be set first");
}
if (columnsToExclude != null) {
LetterCase letterCase = getColumnLetterCase();
@@ -554,7 +415,7 @@ public Order[] getColumnsToOrder() {
*/
public Table setColumnsToOrder(Order[] columnsToOrder) {
if (columnsList == null) {
- throw new AssertJDBException("The table name and the source or datasource must be set first");
+ throw new AssertJDBException("The table name and the connectionProvider must be set first");
}
if (columnsToOrder != null) {
LetterCase letterCase = getColumnLetterCase();
@@ -725,38 +586,28 @@ private void collectColumnsNameFromResultSet(ResultSet resultSet) throws SQLExce
* This method use the {@link DatabaseMetaData} from the {@code Connection} parameter to list the primary keys of the
* table.
*
- *
- * @param connection The {@code Connection} to the database.
- * @throws SQLException SQL Exception.
*/
- private void collectPrimaryKeyName(Connection connection) throws SQLException {
- String catalog = getCatalog(connection);
- String schema = getSchema(connection);
+ private void collectPrimaryKeyName() {
List pksNameList = new ArrayList<>();
- DatabaseMetaData metaData = connection.getMetaData();
+ SchemaMetadata metaData = getMetaData();
String tableName = name;
- try (ResultSet resultSet = metaData.getTables(catalog, schema, null, new String[]{"TABLE"})) {
- LetterCase letterCase = getTableLetterCase();
- while (resultSet.next()) {
- String tableResult = resultSet.getString("TABLE_NAME");
- if (letterCase.isEqual(tableName, tableResult)) {
- tableName = tableResult;
- break;
- }
+ LetterCase letterCase = getTableLetterCase();
+ for (String tableResult : metaData.getTablesName()) {
+ if (letterCase.isEqual(tableName, tableResult)) {
+ tableName = tableResult;
+ break;
}
}
- try (ResultSet resultSet = metaData.getPrimaryKeys(catalog, schema, tableName)) {
- LetterCase letterCase = getPrimaryKeyLetterCase();
- while (resultSet.next()) {
- String columnName = resultSet.getString("COLUMN_NAME");
- if (NameComparator.INSTANCE.contains(getColumnsNameList(), columnName, letterCase)) {
- String pkName = letterCase.convert(columnName);
- pksNameList.add(pkName);
- }
+ LetterCase pkLetterCase = getPrimaryKeyLetterCase();
+ for (String primaryKey : metaData.getPrimaryKeys(tableName)) {
+ if (NameComparator.INSTANCE.contains(getColumnsNameList(), primaryKey, pkLetterCase)) {
+ String pkName = pkLetterCase.convert(primaryKey);
+ pksNameList.add(pkName);
}
}
+
setPksNameList(pksNameList);
}
@@ -780,7 +631,7 @@ protected void loadImpl(Connection connection) throws SQLException {
collectRowsFromResultSet(resultSet);
}
}
- collectPrimaryKeyName(connection);
+ collectPrimaryKeyName();
if (columnsToOrder == null) {
sortRows();
}
diff --git a/src/main/java/org/assertj/db/util/Descriptions.java b/src/main/java/org/assertj/db/util/Descriptions.java
index 07a0ae04..e69f9d0e 100644
--- a/src/main/java/org/assertj/db/util/Descriptions.java
+++ b/src/main/java/org/assertj/db/util/Descriptions.java
@@ -20,7 +20,6 @@
import org.assertj.db.type.ChangeType;
import org.assertj.db.type.Changes;
import org.assertj.db.type.Request;
-import org.assertj.db.type.Source;
import org.assertj.db.type.Table;
import org.assertj.db.type.Value;
@@ -91,12 +90,7 @@ public static String getDescription(Changes changes) {
stringBuilder.append("Changes");
}
}
- if (changes.getSource() != null) {
- Source source = changes.getSource();
- stringBuilder.append(" of '").append(source.getUser()).append("/").append(source.getUrl()).append("' source");
- } else {
- stringBuilder.append(" of a data source");
- }
+ stringBuilder.append(" of '").append(changes.getConnectionProvider().toString()).append("'");
return stringBuilder.toString();
}
diff --git a/src/test/java/org/assertj/db/api/AssertOnColumnOfChangeEquality_HasValues_One_Character_Test.java b/src/test/java/org/assertj/db/api/AssertOnColumnOfChangeEquality_HasValues_One_Character_Test.java
index 1fb23ebd..e38f5048 100644
--- a/src/test/java/org/assertj/db/api/AssertOnColumnOfChangeEquality_HasValues_One_Character_Test.java
+++ b/src/test/java/org/assertj/db/api/AssertOnColumnOfChangeEquality_HasValues_One_Character_Test.java
@@ -26,6 +26,7 @@
* {@link org.assertj.db.api.assertions.AssertOnColumnOfChangeEquality#hasValues(Character)} method.
*
* @author Régis Pouiller
+ * @author Julien Roy
*/
public class AssertOnColumnOfChangeEquality_HasValues_One_Character_Test extends AbstractTest {
@@ -35,7 +36,7 @@ public class AssertOnColumnOfChangeEquality_HasValues_One_Character_Test extends
@Test
@NeedReload
public void test_have_values_equal_to() {
- Changes changes = new Changes(source).setStartPointNow();
+ Changes changes = new Changes(jdbcConnectionProvider).setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
changes.setEndPointNow();
@@ -51,7 +52,7 @@ public void test_have_values_equal_to() {
@Test
@NeedReload
public void should_fail_because_value_at_start_point_is_different() {
- Changes changes = new Changes(source).setStartPointNow();
+ Changes changes = new Changes(jdbcConnectionProvider).setStartPointNow();
update("insert into test(var1, var16) values(5, 'X')");
changes.setEndPointNow();
@@ -59,7 +60,7 @@ public void should_fail_because_value_at_start_point_is_different() {
assertThat(changes).change().column("var16").hasValues('X');
fail("An exception must be raised");
} catch (AssertionError e) {
- Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Column at index 15 (column name : VAR16) of Change at index 0 (on table : TEST and with primary key : [5]) of Changes on tables of 'sa/jdbc:h2:mem:test' source] %n"
+ Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Column at index 15 (column name : VAR16) of Change at index 0 (on table : TEST and with primary key : [5]) of Changes on tables of 'sa/jdbc:h2:mem:test'] %n"
+ "Expecting that start point:%n"
+ " %n"
+ "to be equal to: %n"
@@ -73,7 +74,7 @@ public void should_fail_because_value_at_start_point_is_different() {
@Test
@NeedReload
public void should_fail_because_value_at_end_point_is_different() {
- Changes changes = new Changes(source).setStartPointNow();
+ Changes changes = new Changes(jdbcConnectionProvider).setStartPointNow();
update("delete from test where var1 = 1");
changes.setEndPointNow();
@@ -81,7 +82,7 @@ public void should_fail_because_value_at_end_point_is_different() {
assertThat(changes).change().column("var16").hasValues('T');
fail("An exception must be raised");
} catch (AssertionError e) {
- Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Column at index 15 (column name : VAR16) of Change at index 0 (on table : TEST and with primary key : [1]) of Changes on tables of 'sa/jdbc:h2:mem:test' source] %n"
+ Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Column at index 15 (column name : VAR16) of Change at index 0 (on table : TEST and with primary key : [1]) of Changes on tables of 'sa/jdbc:h2:mem:test'] %n"
+ "Expecting that end point:%n"
+ " %n"
+ "to be equal to: %n"
diff --git a/src/test/java/org/assertj/db/api/DefaultDescription_Test.java b/src/test/java/org/assertj/db/api/DefaultDescription_Test.java
index 7aab2386..d7ba0120 100644
--- a/src/test/java/org/assertj/db/api/DefaultDescription_Test.java
+++ b/src/test/java/org/assertj/db/api/DefaultDescription_Test.java
@@ -12,6 +12,11 @@
*/
package org.assertj.db.api;
+import static org.assertj.core.api.Assertions.assertThat;
+import static org.assertj.db.api.Assertions.assertThat;
+
+import java.lang.reflect.Field;
+
import org.assertj.core.api.WritableAssertionInfo;
import org.assertj.db.common.AbstractTest;
import org.assertj.db.common.NeedReload;
@@ -21,15 +26,11 @@
import org.assertj.db.type.Table;
import org.junit.Test;
-import java.lang.reflect.Field;
-
-import static org.assertj.core.api.Assertions.assertThat;
-import static org.assertj.db.api.Assertions.assertThat;
-
/**
* Test on default descriptions.
*
* @author Régis Pouiller
+ * @author Julien Roy
*/
public class DefaultDescription_Test extends AbstractTest {
@@ -43,9 +44,9 @@ public void test_default_description_for_change_with_different_information() thr
field.setAccessible(true);
- Table actorTable = new Table(dataSource, "actor");
- Request request = new Request(dataSource, "select * from actor");
- Changes changes = new Changes(dataSource).setStartPointNow();
+ Table actorTable = new Table(dsConnectionProvider, "actor");
+ Request request = new Request(dsConnectionProvider, "select * from actor");
+ Changes changes = new Changes(dsConnectionProvider).setStartPointNow();
Changes changesOnActorTable = new Changes(actorTable).setStartPointNow();
Changes changesOnRequest = new Changes(request).setStartPointNow();
updateChangesForTests();
@@ -59,10 +60,10 @@ public void test_default_description_for_change_with_different_information() thr
WritableAssertionInfo infoOnActorTable = (WritableAssertionInfo) field.get(assertThat(changesOnActorTable).change());
WritableAssertionInfo infoOnTestTable = (WritableAssertionInfo) field.get(assertThat(changes).change(8));
WritableAssertionInfo infoOnRequest = (WritableAssertionInfo) field.get(assertThat(changesOnRequest).change());
- assertThat(info.descriptionText()).isEqualTo("Change at index 0 (on table : ACTOR and with primary key : [4]) of Changes on tables of a data source");
- assertThat(infoOnActorTable.descriptionText()).isEqualTo("Change at index 0 (with primary key : [4]) of Changes on ACTOR table of a data source");
- assertThat(infoOnTestTable.descriptionText()).isEqualTo("Change at index 8 (on table : TEST2) of Changes on tables of a data source");
- assertThat(infoOnRequest.descriptionText()).isEqualTo("Change at index 0 of Changes on 'select * from actor' request of a data source");
+ assertThat(info.descriptionText()).isEqualTo("Change at index 0 (on table : ACTOR and with primary key : [4]) of Changes on tables of 'data source'");
+ assertThat(infoOnActorTable.descriptionText()).isEqualTo("Change at index 0 (with primary key : [4]) of Changes on ACTOR table of 'data source'");
+ assertThat(infoOnTestTable.descriptionText()).isEqualTo("Change at index 8 (on table : TEST2) of Changes on tables of 'data source'");
+ assertThat(infoOnRequest.descriptionText()).isEqualTo("Change at index 0 of Changes on 'select * from actor' request of 'data source'");
}
/**
@@ -75,8 +76,8 @@ public void test_default_description_of_changes() throws Exception {
field.setAccessible(true);
- Changes changesFromSource = new Changes(source).setStartPointNow();
- Changes changesFromDataSource = new Changes(dataSource).setStartPointNow();
+ Changes changesFromSource = new Changes(jdbcConnectionProvider).setStartPointNow();
+ Changes changesFromDataSource = new Changes(dsConnectionProvider).setStartPointNow();
updateChangesForTests();
changesFromSource.setEndPointNow();
changesFromDataSource.setEndPointNow();
@@ -87,10 +88,10 @@ public void test_default_description_of_changes() throws Exception {
WritableAssertionInfo infoFromSource = (WritableAssertionInfo) field.get(assertionFromSource);
- assertThat(infoFromSource.descriptionText()).isEqualTo("Changes on tables of 'sa/jdbc:h2:mem:test' source");
+ assertThat(infoFromSource.descriptionText()).isEqualTo("Changes on tables of 'sa/jdbc:h2:mem:test'");
WritableAssertionInfo infoFromDataSource = (WritableAssertionInfo) field.get(assertionFromDataSource);
- assertThat(infoFromDataSource.descriptionText()).isEqualTo("Changes on tables of a data source");
+ assertThat(infoFromDataSource.descriptionText()).isEqualTo("Changes on tables of 'data source'");
}
/**
@@ -103,8 +104,8 @@ public void test_default_description_of_all_changes() throws Exception {
field.setAccessible(true);
- Changes changesFromSource = new Changes(source).setStartPointNow();
- Changes changesFromDataSource = new Changes(dataSource).setStartPointNow();
+ Changes changesFromSource = new Changes(jdbcConnectionProvider).setStartPointNow();
+ Changes changesFromDataSource = new Changes(dsConnectionProvider).setStartPointNow();
updateChangesForTests();
changesFromSource.setEndPointNow();
changesFromDataSource.setEndPointNow();
@@ -115,10 +116,10 @@ public void test_default_description_of_all_changes() throws Exception {
WritableAssertionInfo infoFromSource = (WritableAssertionInfo) field.get(assertionFromSource);
- assertThat(infoFromSource.descriptionText()).isEqualTo("Changes on tables of 'sa/jdbc:h2:mem:test' source");
+ assertThat(infoFromSource.descriptionText()).isEqualTo("Changes on tables of 'sa/jdbc:h2:mem:test'");
WritableAssertionInfo infoFromDataSource = (WritableAssertionInfo) field.get(assertionFromDataSource);
- assertThat(infoFromDataSource.descriptionText()).isEqualTo("Changes on tables of a data source");
+ assertThat(infoFromDataSource.descriptionText()).isEqualTo("Changes on tables of 'data source'");
}
/**
@@ -131,8 +132,8 @@ public void test_default_description_of_creation_changes() throws Exception {
field.setAccessible(true);
- Changes changesFromSource = new Changes(source).setStartPointNow();
- Changes changesFromDataSource = new Changes(dataSource).setStartPointNow();
+ Changes changesFromSource = new Changes(jdbcConnectionProvider).setStartPointNow();
+ Changes changesFromDataSource = new Changes(dsConnectionProvider).setStartPointNow();
updateChangesForTests();
changesFromSource.setEndPointNow();
changesFromDataSource.setEndPointNow();
@@ -143,10 +144,10 @@ public void test_default_description_of_creation_changes() throws Exception {
WritableAssertionInfo infoFromSource = (WritableAssertionInfo) field.get(assertionFromSource);
- assertThat(infoFromSource.descriptionText()).isEqualTo("Changes on tables of 'sa/jdbc:h2:mem:test' source (only creation changes)");
+ assertThat(infoFromSource.descriptionText()).isEqualTo("Changes on tables of 'sa/jdbc:h2:mem:test' (only creation changes)");
WritableAssertionInfo infoFromDataSource = (WritableAssertionInfo) field.get(assertionFromDataSource);
- assertThat(infoFromDataSource.descriptionText()).isEqualTo("Changes on tables of a data source (only creation changes)");
+ assertThat(infoFromDataSource.descriptionText()).isEqualTo("Changes on tables of 'data source' (only creation changes)");
}
/**
@@ -159,8 +160,8 @@ public void test_default_description_of_modification_changes() throws Exception
field.setAccessible(true);
- Changes changesFromSource = new Changes(source).setStartPointNow();
- Changes changesFromDataSource = new Changes(dataSource).setStartPointNow();
+ Changes changesFromSource = new Changes(jdbcConnectionProvider).setStartPointNow();
+ Changes changesFromDataSource = new Changes(dsConnectionProvider).setStartPointNow();
updateChangesForTests();
changesFromSource.setEndPointNow();
changesFromDataSource.setEndPointNow();
@@ -171,10 +172,10 @@ public void test_default_description_of_modification_changes() throws Exception
WritableAssertionInfo infoFromSource = (WritableAssertionInfo) field.get(assertionFromSource);
- assertThat(infoFromSource.descriptionText()).isEqualTo("Changes on tables of 'sa/jdbc:h2:mem:test' source (only modification changes)");
+ assertThat(infoFromSource.descriptionText()).isEqualTo("Changes on tables of 'sa/jdbc:h2:mem:test' (only modification changes)");
WritableAssertionInfo infoFromDataSource = (WritableAssertionInfo) field.get(assertionFromDataSource);
- assertThat(infoFromDataSource.descriptionText()).isEqualTo("Changes on tables of a data source (only modification changes)");
+ assertThat(infoFromDataSource.descriptionText()).isEqualTo("Changes on tables of 'data source' (only modification changes)");
}
/**
@@ -187,8 +188,8 @@ public void test_default_description_of_deletion_changes() throws Exception {
field.setAccessible(true);
- Changes changesFromSource = new Changes(source).setStartPointNow();
- Changes changesFromDataSource = new Changes(dataSource).setStartPointNow();
+ Changes changesFromSource = new Changes(jdbcConnectionProvider).setStartPointNow();
+ Changes changesFromDataSource = new Changes(dsConnectionProvider).setStartPointNow();
updateChangesForTests();
changesFromSource.setEndPointNow();
changesFromDataSource.setEndPointNow();
@@ -199,10 +200,10 @@ public void test_default_description_of_deletion_changes() throws Exception {
WritableAssertionInfo infoFromSource = (WritableAssertionInfo) field.get(assertionFromSource);
- assertThat(infoFromSource.descriptionText()).isEqualTo("Changes on tables of 'sa/jdbc:h2:mem:test' source (only deletion changes)");
+ assertThat(infoFromSource.descriptionText()).isEqualTo("Changes on tables of 'sa/jdbc:h2:mem:test' (only deletion changes)");
WritableAssertionInfo infoFromDataSource = (WritableAssertionInfo) field.get(assertionFromDataSource);
- assertThat(infoFromDataSource.descriptionText()).isEqualTo("Changes on tables of a data source (only deletion changes)");
+ assertThat(infoFromDataSource.descriptionText()).isEqualTo("Changes on tables of 'data source' (only deletion changes)");
}
/**
@@ -215,8 +216,8 @@ public void test_default_description_of_creation_on_table_changes() throws Excep
field.setAccessible(true);
- Changes changesFromSource = new Changes(source).setStartPointNow();
- Changes changesFromDataSource = new Changes(dataSource).setStartPointNow();
+ Changes changesFromSource = new Changes(jdbcConnectionProvider).setStartPointNow();
+ Changes changesFromDataSource = new Changes(dsConnectionProvider).setStartPointNow();
updateChangesForTests();
changesFromSource.setEndPointNow();
changesFromDataSource.setEndPointNow();
@@ -227,10 +228,10 @@ public void test_default_description_of_creation_on_table_changes() throws Excep
WritableAssertionInfo infoFromSource = (WritableAssertionInfo) field.get(assertionFromSource);
- assertThat(infoFromSource.descriptionText()).isEqualTo("Changes on tables of 'sa/jdbc:h2:mem:test' source (only creation changes on actor table)");
+ assertThat(infoFromSource.descriptionText()).isEqualTo("Changes on tables of 'sa/jdbc:h2:mem:test' (only creation changes on actor table)");
WritableAssertionInfo infoFromDataSource = (WritableAssertionInfo) field.get(assertionFromDataSource);
- assertThat(infoFromDataSource.descriptionText()).isEqualTo("Changes on tables of a data source (only creation changes on actor table)");
+ assertThat(infoFromDataSource.descriptionText()).isEqualTo("Changes on tables of 'data source' (only creation changes on actor table)");
}
/**
@@ -243,8 +244,8 @@ public void test_default_description_of_modification_on_table_changes() throws E
field.setAccessible(true);
- Changes changesFromSource = new Changes(source).setStartPointNow();
- Changes changesFromDataSource = new Changes(dataSource).setStartPointNow();
+ Changes changesFromSource = new Changes(jdbcConnectionProvider).setStartPointNow();
+ Changes changesFromDataSource = new Changes(dsConnectionProvider).setStartPointNow();
updateChangesForTests();
changesFromSource.setEndPointNow();
changesFromDataSource.setEndPointNow();
@@ -255,10 +256,10 @@ public void test_default_description_of_modification_on_table_changes() throws E
WritableAssertionInfo infoFromSource = (WritableAssertionInfo) field.get(assertionFromSource);
- assertThat(infoFromSource.descriptionText()).isEqualTo("Changes on tables of 'sa/jdbc:h2:mem:test' source (only modification changes on actor table)");
+ assertThat(infoFromSource.descriptionText()).isEqualTo("Changes on tables of 'sa/jdbc:h2:mem:test' (only modification changes on actor table)");
WritableAssertionInfo infoFromDataSource = (WritableAssertionInfo) field.get(assertionFromDataSource);
- assertThat(infoFromDataSource.descriptionText()).isEqualTo("Changes on tables of a data source (only modification changes on actor table)");
+ assertThat(infoFromDataSource.descriptionText()).isEqualTo("Changes on tables of 'data source' (only modification changes on actor table)");
}
/**
@@ -271,8 +272,8 @@ public void test_default_description_of_deletion_on_table_changes() throws Excep
field.setAccessible(true);
- Changes changesFromSource = new Changes(source).setStartPointNow();
- Changes changesFromDataSource = new Changes(dataSource).setStartPointNow();
+ Changes changesFromSource = new Changes(jdbcConnectionProvider).setStartPointNow();
+ Changes changesFromDataSource = new Changes(dsConnectionProvider).setStartPointNow();
updateChangesForTests();
changesFromSource.setEndPointNow();
changesFromDataSource.setEndPointNow();
@@ -283,10 +284,10 @@ public void test_default_description_of_deletion_on_table_changes() throws Excep
WritableAssertionInfo infoFromSource = (WritableAssertionInfo) field.get(assertionFromSource);
- assertThat(infoFromSource.descriptionText()).isEqualTo("Changes on tables of 'sa/jdbc:h2:mem:test' source (only deletion changes on actor table)");
+ assertThat(infoFromSource.descriptionText()).isEqualTo("Changes on tables of 'sa/jdbc:h2:mem:test' (only deletion changes on actor table)");
WritableAssertionInfo infoFromDataSource = (WritableAssertionInfo) field.get(assertionFromDataSource);
- assertThat(infoFromDataSource.descriptionText()).isEqualTo("Changes on tables of a data source (only deletion changes on actor table)");
+ assertThat(infoFromDataSource.descriptionText()).isEqualTo("Changes on tables of 'data source' (only deletion changes on actor table)");
}
/**
@@ -299,8 +300,8 @@ public void test_default_description_on_table_changes() throws Exception {
field.setAccessible(true);
- Changes changesFromSource = new Changes(source).setStartPointNow();
- Changes changesFromDataSource = new Changes(dataSource).setStartPointNow();
+ Changes changesFromSource = new Changes(jdbcConnectionProvider).setStartPointNow();
+ Changes changesFromDataSource = new Changes(dsConnectionProvider).setStartPointNow();
updateChangesForTests();
changesFromSource.setEndPointNow();
changesFromDataSource.setEndPointNow();
@@ -311,10 +312,10 @@ public void test_default_description_on_table_changes() throws Exception {
WritableAssertionInfo infoFromSource = (WritableAssertionInfo) field.get(assertionFromSource);
- assertThat(infoFromSource.descriptionText()).isEqualTo("Changes on tables of 'sa/jdbc:h2:mem:test' source (only changes on actor table)");
+ assertThat(infoFromSource.descriptionText()).isEqualTo("Changes on tables of 'sa/jdbc:h2:mem:test' (only changes on actor table)");
WritableAssertionInfo infoFromDataSource = (WritableAssertionInfo) field.get(assertionFromDataSource);
- assertThat(infoFromDataSource.descriptionText()).isEqualTo("Changes on tables of a data source (only changes on actor table)");
+ assertThat(infoFromDataSource.descriptionText()).isEqualTo("Changes on tables of 'data source' (only changes on actor table)");
}
/**
@@ -327,8 +328,8 @@ public void test_default_description_of_changes_on_table() throws Exception {
field.setAccessible(true);
- Table tableFromSource = new Table(source, "actor");
- Table tableFromDataSource = new Table(dataSource, "actor");
+ Table tableFromSource = new Table(jdbcConnectionProvider, "actor");
+ Table tableFromDataSource = new Table(dsConnectionProvider, "actor");
Changes changesFromSource = new Changes(tableFromSource).setStartPointNow();
Changes changesFromDataSource = new Changes(tableFromDataSource).setStartPointNow();
updateChangesForTests();
@@ -341,10 +342,10 @@ public void test_default_description_of_changes_on_table() throws Exception {
WritableAssertionInfo infoFromSource = (WritableAssertionInfo) field.get(assertionFromSource);
- assertThat(infoFromSource.descriptionText()).isEqualTo("Changes on ACTOR table of 'sa/jdbc:h2:mem:test' source");
+ assertThat(infoFromSource.descriptionText()).isEqualTo("Changes on ACTOR table of 'sa/jdbc:h2:mem:test'");
WritableAssertionInfo infoFromDataSource = (WritableAssertionInfo) field.get(assertionFromDataSource);
- assertThat(infoFromDataSource.descriptionText()).isEqualTo("Changes on ACTOR table of a data source");
+ assertThat(infoFromDataSource.descriptionText()).isEqualTo("Changes on ACTOR table of 'data source'");
}
/**
@@ -357,8 +358,8 @@ public void test_default_description_of_changes_on_request() throws Exception {
field.setAccessible(true);
- Request requestFromSource = new Request(source, "select * from actor").setPksName("ID");
- Request requestFromDataSource = new Request(dataSource, "select * from actor").setPksName("ID");
+ Request requestFromSource = new Request(jdbcConnectionProvider, "select * from actor").setPksName("ID");
+ Request requestFromDataSource = new Request(dsConnectionProvider, "select * from actor").setPksName("ID");
Changes changesFromSource = new Changes(requestFromSource).setStartPointNow();
Changes changesFromDataSource = new Changes(requestFromDataSource).setStartPointNow();
updateChangesForTests();
@@ -371,10 +372,10 @@ public void test_default_description_of_changes_on_request() throws Exception {
WritableAssertionInfo infoFromSource = (WritableAssertionInfo) field.get(assertionFromSource);
- assertThat(infoFromSource.descriptionText()).isEqualTo("Changes on 'select * from actor' request of 'sa/jdbc:h2:mem:test' source");
+ assertThat(infoFromSource.descriptionText()).isEqualTo("Changes on 'select * from actor' request of 'sa/jdbc:h2:mem:test'");
WritableAssertionInfo infoFromDataSource = (WritableAssertionInfo) field.get(assertionFromDataSource);
- assertThat(infoFromDataSource.descriptionText()).isEqualTo("Changes on 'select * from actor' request of a data source");
+ assertThat(infoFromDataSource.descriptionText()).isEqualTo("Changes on 'select * from actor' request of 'data source'");
}
/**
@@ -387,8 +388,8 @@ public void test_default_description_of_change_of_changes() throws Exception {
field.setAccessible(true);
- Changes changesFromSource = new Changes(source).setStartPointNow();
- Changes changesFromDataSource = new Changes(dataSource).setStartPointNow();
+ Changes changesFromSource = new Changes(jdbcConnectionProvider).setStartPointNow();
+ Changes changesFromDataSource = new Changes(dsConnectionProvider).setStartPointNow();
updateChangesForTests();
changesFromSource.setEndPointNow();
changesFromDataSource.setEndPointNow();
@@ -399,10 +400,10 @@ public void test_default_description_of_change_of_changes() throws Exception {
WritableAssertionInfo infoFromSource = (WritableAssertionInfo) field.get(assertionFromSource);
- assertThat(infoFromSource.descriptionText()).isEqualTo("Change at index 0 (on table : ACTOR and with primary key : [4]) of Changes on tables of 'sa/jdbc:h2:mem:test' source");
+ assertThat(infoFromSource.descriptionText()).isEqualTo("Change at index 0 (on table : ACTOR and with primary key : [4]) of Changes on tables of 'sa/jdbc:h2:mem:test'");
WritableAssertionInfo infoFromDataSource = (WritableAssertionInfo) field.get(assertionFromDataSource);
- assertThat(infoFromDataSource.descriptionText()).isEqualTo("Change at index 1 (on table : INTERPRETATION and with primary key : [6]) of Changes on tables of a data source");
+ assertThat(infoFromDataSource.descriptionText()).isEqualTo("Change at index 1 (on table : INTERPRETATION and with primary key : [6]) of Changes on tables of 'data source'");
}
/**
@@ -415,8 +416,8 @@ public void test_default_description_of_change_of_changes_on_table() throws Exce
field.setAccessible(true);
- Table tableFromSource = new Table(source, "actor");
- Table tableFromDataSource = new Table(dataSource, "actor");
+ Table tableFromSource = new Table(jdbcConnectionProvider, "actor");
+ Table tableFromDataSource = new Table(dsConnectionProvider, "actor");
Changes changesFromSource = new Changes(tableFromSource).setStartPointNow();
Changes changesFromDataSource = new Changes(tableFromDataSource).setStartPointNow();
updateChangesForTests();
@@ -428,10 +429,10 @@ public void test_default_description_of_change_of_changes_on_table() throws Exce
ChangeAssert assertionFromDataSource = assertThat(changesFromDataSource).change(2);
WritableAssertionInfo infoFromSource = (WritableAssertionInfo) field.get(assertionFromSource);
- assertThat(infoFromSource.descriptionText()).isEqualTo("Change at index 0 (with primary key : [4]) of Changes on ACTOR table of 'sa/jdbc:h2:mem:test' source");
+ assertThat(infoFromSource.descriptionText()).isEqualTo("Change at index 0 (with primary key : [4]) of Changes on ACTOR table of 'sa/jdbc:h2:mem:test'");
WritableAssertionInfo infoFromDataSource = (WritableAssertionInfo) field.get(assertionFromDataSource);
- assertThat(infoFromDataSource.descriptionText()).isEqualTo("Change at index 2 (with primary key : [3]) of Changes on ACTOR table of a data source");
+ assertThat(infoFromDataSource.descriptionText()).isEqualTo("Change at index 2 (with primary key : [3]) of Changes on ACTOR table of 'data source'");
}
/**
@@ -444,8 +445,8 @@ public void test_default_description_of_change_of_changes_on_request() throws Ex
field.setAccessible(true);
- Request requestFromSource = new Request(source, "select id, name, firstname, birth from actor where id = 1").setPksName("ID");
- Request requestFromDataSource = new Request(dataSource, "select * from actor").setPksName("ID");
+ Request requestFromSource = new Request(jdbcConnectionProvider, "select id, name, firstname, birth from actor where id = 1").setPksName("ID");
+ Request requestFromDataSource = new Request(dsConnectionProvider, "select * from actor").setPksName("ID");
Changes changesFromSource = new Changes(requestFromSource).setStartPointNow();
Changes changesFromDataSource = new Changes(requestFromDataSource).setStartPointNow();
updateChangesForTests();
@@ -458,10 +459,10 @@ public void test_default_description_of_change_of_changes_on_request() throws Ex
WritableAssertionInfo infoFromSource = (WritableAssertionInfo) field.get(assertionFromSource);
- assertThat(infoFromSource.descriptionText()).isEqualTo("Change at index 0 (with primary key : [1]) of Changes on 'select id, name, firstname, bi...' request of 'sa/jdbc:h2:mem:test' source");
+ assertThat(infoFromSource.descriptionText()).isEqualTo("Change at index 0 (with primary key : [1]) of Changes on 'select id, name, firstname, bi...' request of 'sa/jdbc:h2:mem:test'");
WritableAssertionInfo infoFromDataSource = (WritableAssertionInfo) field.get(assertionFromDataSource);
- assertThat(infoFromDataSource.descriptionText()).isEqualTo("Change at index 2 (with primary key : [3]) of Changes on 'select * from actor' request of a data source");
+ assertThat(infoFromDataSource.descriptionText()).isEqualTo("Change at index 2 (with primary key : [3]) of Changes on 'select * from actor' request of 'data source'");
}
/**
@@ -474,8 +475,8 @@ public void test_default_description_of_creation_change_of_changes() throws Exce
field.setAccessible(true);
- Changes changesFromSource = new Changes(source).setStartPointNow();
- Changes changesFromDataSource = new Changes(dataSource).setStartPointNow();
+ Changes changesFromSource = new Changes(jdbcConnectionProvider).setStartPointNow();
+ Changes changesFromDataSource = new Changes(dsConnectionProvider).setStartPointNow();
updateChangesForTests();
changesFromSource.setEndPointNow();
changesFromDataSource.setEndPointNow();
@@ -486,10 +487,10 @@ public void test_default_description_of_creation_change_of_changes() throws Exce
WritableAssertionInfo infoFromSource = (WritableAssertionInfo) field.get(assertionFromSource);
- assertThat(infoFromSource.descriptionText()).isEqualTo("Change at index 0 (on table : ACTOR and with primary key : [4]) of Changes on tables of 'sa/jdbc:h2:mem:test' source (only creation changes)");
+ assertThat(infoFromSource.descriptionText()).isEqualTo("Change at index 0 (on table : ACTOR and with primary key : [4]) of Changes on tables of 'sa/jdbc:h2:mem:test' (only creation changes)");
WritableAssertionInfo infoFromDataSource = (WritableAssertionInfo) field.get(assertionFromDataSource);
- assertThat(infoFromDataSource.descriptionText()).isEqualTo("Change at index 0 (on table : ACTOR and with primary key : [4]) of Changes on tables of a data source (only creation changes)");
+ assertThat(infoFromDataSource.descriptionText()).isEqualTo("Change at index 0 (on table : ACTOR and with primary key : [4]) of Changes on tables of 'data source' (only creation changes)");
}
/**
@@ -502,8 +503,8 @@ public void test_default_description_of_creation_change_of_changes_on_table() th
field.setAccessible(true);
- Table tableFromSource = new Table(source, "actor");
- Table tableFromDataSource = new Table(dataSource, "actor");
+ Table tableFromSource = new Table(jdbcConnectionProvider, "actor");
+ Table tableFromDataSource = new Table(dsConnectionProvider, "actor");
Changes changesFromSource = new Changes(tableFromSource).setStartPointNow();
Changes changesFromDataSource = new Changes(tableFromDataSource).setStartPointNow();
updateChangesForTests();
@@ -516,10 +517,10 @@ public void test_default_description_of_creation_change_of_changes_on_table() th
WritableAssertionInfo infoFromSource = (WritableAssertionInfo) field.get(assertionFromSource);
- assertThat(infoFromSource.descriptionText()).isEqualTo("Change at index 0 (with primary key : [4]) of Changes on ACTOR table of 'sa/jdbc:h2:mem:test' source (only creation changes)");
+ assertThat(infoFromSource.descriptionText()).isEqualTo("Change at index 0 (with primary key : [4]) of Changes on ACTOR table of 'sa/jdbc:h2:mem:test' (only creation changes)");
WritableAssertionInfo infoFromDataSource = (WritableAssertionInfo) field.get(assertionFromDataSource);
- assertThat(infoFromDataSource.descriptionText()).isEqualTo("Change at index 0 (with primary key : [4]) of Changes on ACTOR table of a data source (only creation changes)");
+ assertThat(infoFromDataSource.descriptionText()).isEqualTo("Change at index 0 (with primary key : [4]) of Changes on ACTOR table of 'data source' (only creation changes)");
}
/**
@@ -532,8 +533,8 @@ public void test_default_description_of_creation_change_of_changes_on_request()
field.setAccessible(true);
- Request requestFromSource = new Request(source, "select * from actor").setPksName("ID");
- Request requestFromDataSource = new Request(dataSource, "select * from actor").setPksName("ID");
+ Request requestFromSource = new Request(jdbcConnectionProvider, "select * from actor").setPksName("ID");
+ Request requestFromDataSource = new Request(dsConnectionProvider, "select * from actor").setPksName("ID");
Changes changesFromSource = new Changes(requestFromSource).setStartPointNow();
Changes changesFromDataSource = new Changes(requestFromDataSource).setStartPointNow();
updateChangesForTests();
@@ -546,10 +547,10 @@ public void test_default_description_of_creation_change_of_changes_on_request()
WritableAssertionInfo infoFromSource = (WritableAssertionInfo) field.get(assertionFromSource);
- assertThat(infoFromSource.descriptionText()).isEqualTo("Change at index 0 (with primary key : [4]) of Changes on 'select * from actor' request of 'sa/jdbc:h2:mem:test' source (only creation changes)");
+ assertThat(infoFromSource.descriptionText()).isEqualTo("Change at index 0 (with primary key : [4]) of Changes on 'select * from actor' request of 'sa/jdbc:h2:mem:test' (only creation changes)");
WritableAssertionInfo infoFromDataSource = (WritableAssertionInfo) field.get(assertionFromDataSource);
- assertThat(infoFromDataSource.descriptionText()).isEqualTo("Change at index 0 (with primary key : [4]) of Changes on 'select * from actor' request of a data source (only creation changes)");
+ assertThat(infoFromDataSource.descriptionText()).isEqualTo("Change at index 0 (with primary key : [4]) of Changes on 'select * from actor' request of 'data source' (only creation changes)");
}
/**
@@ -562,8 +563,8 @@ public void test_default_description_of_modification_change_of_changes() throws
field.setAccessible(true);
- Changes changesFromSource = new Changes(source).setStartPointNow();
- Changes changesFromDataSource = new Changes(dataSource).setStartPointNow();
+ Changes changesFromSource = new Changes(jdbcConnectionProvider).setStartPointNow();
+ Changes changesFromDataSource = new Changes(dsConnectionProvider).setStartPointNow();
updateChangesForTests();
changesFromSource.setEndPointNow();
changesFromDataSource.setEndPointNow();
@@ -574,10 +575,10 @@ public void test_default_description_of_modification_change_of_changes() throws
WritableAssertionInfo infoFromSource = (WritableAssertionInfo) field.get(assertionFromSource);
- assertThat(infoFromSource.descriptionText()).isEqualTo("Change at index 0 (on table : ACTOR and with primary key : [1]) of Changes on tables of 'sa/jdbc:h2:mem:test' source (only modification changes)");
+ assertThat(infoFromSource.descriptionText()).isEqualTo("Change at index 0 (on table : ACTOR and with primary key : [1]) of Changes on tables of 'sa/jdbc:h2:mem:test' (only modification changes)");
WritableAssertionInfo infoFromDataSource = (WritableAssertionInfo) field.get(assertionFromDataSource);
- assertThat(infoFromDataSource.descriptionText()).isEqualTo("Change at index 0 (on table : ACTOR and with primary key : [1]) of Changes on tables of a data source (only modification changes)");
+ assertThat(infoFromDataSource.descriptionText()).isEqualTo("Change at index 0 (on table : ACTOR and with primary key : [1]) of Changes on tables of 'data source' (only modification changes)");
}
/**
@@ -590,8 +591,8 @@ public void test_default_description_of_modification_change_of_changes_on_table(
field.setAccessible(true);
- Table tableFromSource = new Table(source, "actor");
- Table tableFromDataSource = new Table(dataSource, "actor");
+ Table tableFromSource = new Table(jdbcConnectionProvider, "actor");
+ Table tableFromDataSource = new Table(dsConnectionProvider, "actor");
Changes changesFromSource = new Changes(tableFromSource).setStartPointNow();
Changes changesFromDataSource = new Changes(tableFromDataSource).setStartPointNow();
updateChangesForTests();
@@ -604,10 +605,10 @@ public void test_default_description_of_modification_change_of_changes_on_table(
WritableAssertionInfo infoFromSource = (WritableAssertionInfo) field.get(assertionFromSource);
- assertThat(infoFromSource.descriptionText()).isEqualTo("Change at index 0 (with primary key : [1]) of Changes on ACTOR table of 'sa/jdbc:h2:mem:test' source (only modification changes)");
+ assertThat(infoFromSource.descriptionText()).isEqualTo("Change at index 0 (with primary key : [1]) of Changes on ACTOR table of 'sa/jdbc:h2:mem:test' (only modification changes)");
WritableAssertionInfo infoFromDataSource = (WritableAssertionInfo) field.get(assertionFromDataSource);
- assertThat(infoFromDataSource.descriptionText()).isEqualTo("Change at index 0 (with primary key : [1]) of Changes on ACTOR table of a data source (only modification changes)");
+ assertThat(infoFromDataSource.descriptionText()).isEqualTo("Change at index 0 (with primary key : [1]) of Changes on ACTOR table of 'data source' (only modification changes)");
}
/**
@@ -620,8 +621,8 @@ public void test_default_description_of_modification_change_of_changes_on_reques
field.setAccessible(true);
- Request requestFromSource = new Request(source, "select * from actor").setPksName("ID");
- Request requestFromDataSource = new Request(dataSource, "select * from actor").setPksName("ID");
+ Request requestFromSource = new Request(jdbcConnectionProvider, "select * from actor").setPksName("ID");
+ Request requestFromDataSource = new Request(dsConnectionProvider, "select * from actor").setPksName("ID");
Changes changesFromSource = new Changes(requestFromSource).setStartPointNow();
Changes changesFromDataSource = new Changes(requestFromDataSource).setStartPointNow();
updateChangesForTests();
@@ -633,10 +634,10 @@ public void test_default_description_of_modification_change_of_changes_on_reques
WritableAssertionInfo infoFromSource = (WritableAssertionInfo) field.get(assertionFromSource);
- assertThat(infoFromSource.descriptionText()).isEqualTo("Change at index 0 (with primary key : [1]) of Changes on 'select * from actor' request of 'sa/jdbc:h2:mem:test' source (only modification changes)");
+ assertThat(infoFromSource.descriptionText()).isEqualTo("Change at index 0 (with primary key : [1]) of Changes on 'select * from actor' request of 'sa/jdbc:h2:mem:test' (only modification changes)");
WritableAssertionInfo infoFromDataSource = (WritableAssertionInfo) field.get(assertionFromDataSource);
- assertThat(infoFromDataSource.descriptionText()).isEqualTo("Change at index 0 (with primary key : [1]) of Changes on 'select * from actor' request of a data source (only modification changes)");
+ assertThat(infoFromDataSource.descriptionText()).isEqualTo("Change at index 0 (with primary key : [1]) of Changes on 'select * from actor' request of 'data source' (only modification changes)");
}
/**
@@ -649,8 +650,8 @@ public void test_default_description_of_deletion_change_of_changes() throws Exce
field.setAccessible(true);
- Changes changesFromSource = new Changes(source).setStartPointNow();
- Changes changesFromDataSource = new Changes(dataSource).setStartPointNow();
+ Changes changesFromSource = new Changes(jdbcConnectionProvider).setStartPointNow();
+ Changes changesFromDataSource = new Changes(dsConnectionProvider).setStartPointNow();
updateChangesForTests();
changesFromSource.setEndPointNow();
changesFromDataSource.setEndPointNow();
@@ -661,10 +662,10 @@ public void test_default_description_of_deletion_change_of_changes() throws Exce
WritableAssertionInfo infoFromSource = (WritableAssertionInfo) field.get(assertionFromSource);
- assertThat(infoFromSource.descriptionText()).isEqualTo("Change at index 0 (on table : ACTOR and with primary key : [3]) of Changes on tables of 'sa/jdbc:h2:mem:test' source (only deletion changes)");
+ assertThat(infoFromSource.descriptionText()).isEqualTo("Change at index 0 (on table : ACTOR and with primary key : [3]) of Changes on tables of 'sa/jdbc:h2:mem:test' (only deletion changes)");
WritableAssertionInfo infoFromDataSource = (WritableAssertionInfo) field.get(assertionFromDataSource);
- assertThat(infoFromDataSource.descriptionText()).isEqualTo("Change at index 0 (on table : ACTOR and with primary key : [3]) of Changes on tables of a data source (only deletion changes)");
+ assertThat(infoFromDataSource.descriptionText()).isEqualTo("Change at index 0 (on table : ACTOR and with primary key : [3]) of Changes on tables of 'data source' (only deletion changes)");
}
/**
@@ -677,8 +678,8 @@ public void test_default_description_of_deletion_change_of_changes_on_table() th
field.setAccessible(true);
- Table tableFromSource = new Table(source, "actor");
- Table tableFromDataSource = new Table(dataSource, "actor");
+ Table tableFromSource = new Table(jdbcConnectionProvider, "actor");
+ Table tableFromDataSource = new Table(dsConnectionProvider, "actor");
Changes changesFromSource = new Changes(tableFromSource).setStartPointNow();
Changes changesFromDataSource = new Changes(tableFromDataSource).setStartPointNow();
updateChangesForTests();
@@ -691,10 +692,10 @@ public void test_default_description_of_deletion_change_of_changes_on_table() th
WritableAssertionInfo infoFromSource = (WritableAssertionInfo) field.get(assertionFromSource);
- assertThat(infoFromSource.descriptionText()).isEqualTo("Change at index 0 (with primary key : [3]) of Changes on ACTOR table of 'sa/jdbc:h2:mem:test' source (only deletion changes)");
+ assertThat(infoFromSource.descriptionText()).isEqualTo("Change at index 0 (with primary key : [3]) of Changes on ACTOR table of 'sa/jdbc:h2:mem:test' (only deletion changes)");
WritableAssertionInfo infoFromDataSource = (WritableAssertionInfo) field.get(assertionFromDataSource);
- assertThat(infoFromDataSource.descriptionText()).isEqualTo("Change at index 0 (with primary key : [3]) of Changes on ACTOR table of a data source (only deletion changes)");
+ assertThat(infoFromDataSource.descriptionText()).isEqualTo("Change at index 0 (with primary key : [3]) of Changes on ACTOR table of 'data source' (only deletion changes)");
}
/**
@@ -707,8 +708,8 @@ public void test_default_description_of_deletion_change_of_changes_on_request()
field.setAccessible(true);
- Request requestFromSource = new Request(source, "select * from actor").setPksName("ID");
- Request requestFromDataSource = new Request(dataSource, "select * from actor").setPksName("ID");
+ Request requestFromSource = new Request(jdbcConnectionProvider, "select * from actor").setPksName("ID");
+ Request requestFromDataSource = new Request(dsConnectionProvider, "select * from actor").setPksName("ID");
Changes changesFromSource = new Changes(requestFromSource).setStartPointNow();
Changes changesFromDataSource = new Changes(requestFromDataSource).setStartPointNow();
updateChangesForTests();
@@ -721,10 +722,10 @@ public void test_default_description_of_deletion_change_of_changes_on_request()
WritableAssertionInfo infoFromSource = (WritableAssertionInfo) field.get(assertionFromSource);
- assertThat(infoFromSource.descriptionText()).isEqualTo("Change at index 0 (with primary key : [3]) of Changes on 'select * from actor' request of 'sa/jdbc:h2:mem:test' source (only deletion changes)");
+ assertThat(infoFromSource.descriptionText()).isEqualTo("Change at index 0 (with primary key : [3]) of Changes on 'select * from actor' request of 'sa/jdbc:h2:mem:test' (only deletion changes)");
WritableAssertionInfo infoFromDataSource = (WritableAssertionInfo) field.get(assertionFromDataSource);
- assertThat(infoFromDataSource.descriptionText()).isEqualTo("Change at index 0 (with primary key : [3]) of Changes on 'select * from actor' request of a data source (only deletion changes)");
+ assertThat(infoFromDataSource.descriptionText()).isEqualTo("Change at index 0 (with primary key : [3]) of Changes on 'select * from actor' request of 'data source' (only deletion changes)");
}
/**
@@ -737,8 +738,8 @@ public void test_default_description_of_creation_change_on_table_of_changes() th
field.setAccessible(true);
- Changes changesFromSource = new Changes(source).setStartPointNow();
- Changes changesFromDataSource = new Changes(dataSource).setStartPointNow();
+ Changes changesFromSource = new Changes(jdbcConnectionProvider).setStartPointNow();
+ Changes changesFromDataSource = new Changes(dsConnectionProvider).setStartPointNow();
updateChangesForTests();
changesFromSource.setEndPointNow();
changesFromDataSource.setEndPointNow();
@@ -749,10 +750,10 @@ public void test_default_description_of_creation_change_on_table_of_changes() th
WritableAssertionInfo infoFromSource = (WritableAssertionInfo) field.get(assertionFromSource);
- assertThat(infoFromSource.descriptionText()).isEqualTo("Change at index 0 (on table : ACTOR and with primary key : [4]) of Changes on tables of 'sa/jdbc:h2:mem:test' source (only creation changes on actor table)");
+ assertThat(infoFromSource.descriptionText()).isEqualTo("Change at index 0 (on table : ACTOR and with primary key : [4]) of Changes on tables of 'sa/jdbc:h2:mem:test' (only creation changes on actor table)");
WritableAssertionInfo infoFromDataSource = (WritableAssertionInfo) field.get(assertionFromDataSource);
- assertThat(infoFromDataSource.descriptionText()).isEqualTo("Change at index 0 (on table : ACTOR and with primary key : [4]) of Changes on tables of a data source (only creation changes on actor table)");
+ assertThat(infoFromDataSource.descriptionText()).isEqualTo("Change at index 0 (on table : ACTOR and with primary key : [4]) of Changes on tables of 'data source' (only creation changes on actor table)");
}
/**
@@ -765,8 +766,8 @@ public void test_default_description_of_creation_change_on_table_of_changes_on_t
field.setAccessible(true);
- Table tableFromSource = new Table(source, "actor");
- Table tableFromDataSource = new Table(dataSource, "actor");
+ Table tableFromSource = new Table(jdbcConnectionProvider, "actor");
+ Table tableFromDataSource = new Table(dsConnectionProvider, "actor");
Changes changesFromSource = new Changes(tableFromSource).setStartPointNow();
Changes changesFromDataSource = new Changes(tableFromDataSource).setStartPointNow();
updateChangesForTests();
@@ -779,10 +780,10 @@ public void test_default_description_of_creation_change_on_table_of_changes_on_t
WritableAssertionInfo infoFromSource = (WritableAssertionInfo) field.get(assertionFromSource);
- assertThat(infoFromSource.descriptionText()).isEqualTo("Change at index 0 (with primary key : [4]) of Changes on ACTOR table of 'sa/jdbc:h2:mem:test' source (only creation changes on actor table)");
+ assertThat(infoFromSource.descriptionText()).isEqualTo("Change at index 0 (with primary key : [4]) of Changes on ACTOR table of 'sa/jdbc:h2:mem:test' (only creation changes on actor table)");
WritableAssertionInfo infoFromDataSource = (WritableAssertionInfo) field.get(assertionFromDataSource);
- assertThat(infoFromDataSource.descriptionText()).isEqualTo("Change at index 0 (with primary key : [4]) of Changes on ACTOR table of a data source (only creation changes on actor table)");
+ assertThat(infoFromDataSource.descriptionText()).isEqualTo("Change at index 0 (with primary key : [4]) of Changes on ACTOR table of 'data source' (only creation changes on actor table)");
}
/**
@@ -795,8 +796,8 @@ public void test_default_description_of_modification_change_on_table_of_changes(
field.setAccessible(true);
- Changes changesFromSource = new Changes(source).setStartPointNow();
- Changes changesFromDataSource = new Changes(dataSource).setStartPointNow();
+ Changes changesFromSource = new Changes(jdbcConnectionProvider).setStartPointNow();
+ Changes changesFromDataSource = new Changes(dsConnectionProvider).setStartPointNow();
updateChangesForTests();
changesFromSource.setEndPointNow();
changesFromDataSource.setEndPointNow();
@@ -807,10 +808,10 @@ public void test_default_description_of_modification_change_on_table_of_changes(
WritableAssertionInfo infoFromSource = (WritableAssertionInfo) field.get(assertionFromSource);
- assertThat(infoFromSource.descriptionText()).isEqualTo("Change at index 0 (on table : ACTOR and with primary key : [1]) of Changes on tables of 'sa/jdbc:h2:mem:test' source (only modification changes on actor table)");
+ assertThat(infoFromSource.descriptionText()).isEqualTo("Change at index 0 (on table : ACTOR and with primary key : [1]) of Changes on tables of 'sa/jdbc:h2:mem:test' (only modification changes on actor table)");
WritableAssertionInfo infoFromDataSource = (WritableAssertionInfo) field.get(assertionFromDataSource);
- assertThat(infoFromDataSource.descriptionText()).isEqualTo("Change at index 0 (on table : ACTOR and with primary key : [1]) of Changes on tables of a data source (only modification changes on actor table)");
+ assertThat(infoFromDataSource.descriptionText()).isEqualTo("Change at index 0 (on table : ACTOR and with primary key : [1]) of Changes on tables of 'data source' (only modification changes on actor table)");
}
/**
@@ -823,8 +824,8 @@ public void test_default_description_of_modification_change_on_table_of_changes_
field.setAccessible(true);
- Table tableFromSource = new Table(source, "actor");
- Table tableFromDataSource = new Table(dataSource, "actor");
+ Table tableFromSource = new Table(jdbcConnectionProvider, "actor");
+ Table tableFromDataSource = new Table(dsConnectionProvider, "actor");
Changes changesFromSource = new Changes(tableFromSource).setStartPointNow();
Changes changesFromDataSource = new Changes(tableFromDataSource).setStartPointNow();
updateChangesForTests();
@@ -837,10 +838,10 @@ public void test_default_description_of_modification_change_on_table_of_changes_
WritableAssertionInfo infoFromSource = (WritableAssertionInfo) field.get(assertionFromSource);
- assertThat(infoFromSource.descriptionText()).isEqualTo("Change at index 0 (with primary key : [1]) of Changes on ACTOR table of 'sa/jdbc:h2:mem:test' source (only modification changes on actor table)");
+ assertThat(infoFromSource.descriptionText()).isEqualTo("Change at index 0 (with primary key : [1]) of Changes on ACTOR table of 'sa/jdbc:h2:mem:test' (only modification changes on actor table)");
WritableAssertionInfo infoFromDataSource = (WritableAssertionInfo) field.get(assertionFromDataSource);
- assertThat(infoFromDataSource.descriptionText()).isEqualTo("Change at index 0 (with primary key : [1]) of Changes on ACTOR table of a data source (only modification changes on actor table)");
+ assertThat(infoFromDataSource.descriptionText()).isEqualTo("Change at index 0 (with primary key : [1]) of Changes on ACTOR table of 'data source' (only modification changes on actor table)");
}
/**
@@ -853,8 +854,8 @@ public void test_default_description_of_deletion_change_on_table_of_changes() th
field.setAccessible(true);
- Changes changesFromSource = new Changes(source).setStartPointNow();
- Changes changesFromDataSource = new Changes(dataSource).setStartPointNow();
+ Changes changesFromSource = new Changes(jdbcConnectionProvider).setStartPointNow();
+ Changes changesFromDataSource = new Changes(dsConnectionProvider).setStartPointNow();
updateChangesForTests();
changesFromSource.setEndPointNow();
changesFromDataSource.setEndPointNow();
@@ -865,10 +866,10 @@ public void test_default_description_of_deletion_change_on_table_of_changes() th
WritableAssertionInfo infoFromSource = (WritableAssertionInfo) field.get(assertionFromSource);
- assertThat(infoFromSource.descriptionText()).isEqualTo("Change at index 0 (on table : ACTOR and with primary key : [3]) of Changes on tables of 'sa/jdbc:h2:mem:test' source (only deletion changes on actor table)");
+ assertThat(infoFromSource.descriptionText()).isEqualTo("Change at index 0 (on table : ACTOR and with primary key : [3]) of Changes on tables of 'sa/jdbc:h2:mem:test' (only deletion changes on actor table)");
WritableAssertionInfo infoFromDataSource = (WritableAssertionInfo) field.get(assertionFromDataSource);
- assertThat(infoFromDataSource.descriptionText()).isEqualTo("Change at index 0 (on table : ACTOR and with primary key : [3]) of Changes on tables of a data source (only deletion changes on actor table)");
+ assertThat(infoFromDataSource.descriptionText()).isEqualTo("Change at index 0 (on table : ACTOR and with primary key : [3]) of Changes on tables of 'data source' (only deletion changes on actor table)");
}
/**
@@ -881,8 +882,8 @@ public void test_default_description_of_deletion_change_on_table_of_changes_on_t
field.setAccessible(true);
- Table tableFromSource = new Table(source, "actor");
- Table tableFromDataSource = new Table(dataSource, "actor");
+ Table tableFromSource = new Table(jdbcConnectionProvider, "actor");
+ Table tableFromDataSource = new Table(dsConnectionProvider, "actor");
Changes changesFromSource = new Changes(tableFromSource).setStartPointNow();
Changes changesFromDataSource = new Changes(tableFromDataSource).setStartPointNow();
updateChangesForTests();
@@ -895,10 +896,10 @@ public void test_default_description_of_deletion_change_on_table_of_changes_on_t
WritableAssertionInfo infoFromSource = (WritableAssertionInfo) field.get(assertionFromSource);
- assertThat(infoFromSource.descriptionText()).isEqualTo("Change at index 0 (with primary key : [3]) of Changes on ACTOR table of 'sa/jdbc:h2:mem:test' source (only deletion changes on actor table)");
+ assertThat(infoFromSource.descriptionText()).isEqualTo("Change at index 0 (with primary key : [3]) of Changes on ACTOR table of 'sa/jdbc:h2:mem:test' (only deletion changes on actor table)");
WritableAssertionInfo infoFromDataSource = (WritableAssertionInfo) field.get(assertionFromDataSource);
- assertThat(infoFromDataSource.descriptionText()).isEqualTo("Change at index 0 (with primary key : [3]) of Changes on ACTOR table of a data source (only deletion changes on actor table)");
+ assertThat(infoFromDataSource.descriptionText()).isEqualTo("Change at index 0 (with primary key : [3]) of Changes on ACTOR table of 'data source' (only deletion changes on actor table)");
}
/**
@@ -911,8 +912,8 @@ public void test_default_description_of_change_on_table_of_changes() throws Exce
field.setAccessible(true);
- Changes changesFromSource = new Changes(source).setStartPointNow();
- Changes changesFromDataSource = new Changes(dataSource).setStartPointNow();
+ Changes changesFromSource = new Changes(jdbcConnectionProvider).setStartPointNow();
+ Changes changesFromDataSource = new Changes(dsConnectionProvider).setStartPointNow();
updateChangesForTests();
changesFromSource.setEndPointNow();
changesFromDataSource.setEndPointNow();
@@ -922,10 +923,10 @@ public void test_default_description_of_change_on_table_of_changes() throws Exce
ChangeAssert assertionFromDataSource = assertThat(changesFromDataSource).changeOnTable("actor", 0);
WritableAssertionInfo infoFromSource = (WritableAssertionInfo) field.get(assertionFromSource);
- assertThat(infoFromSource.descriptionText()).isEqualTo("Change at index 0 (on table : ACTOR and with primary key : [4]) of Changes on tables of 'sa/jdbc:h2:mem:test' source (only changes on actor table)");
+ assertThat(infoFromSource.descriptionText()).isEqualTo("Change at index 0 (on table : ACTOR and with primary key : [4]) of Changes on tables of 'sa/jdbc:h2:mem:test' (only changes on actor table)");
WritableAssertionInfo infoFromDataSource = (WritableAssertionInfo) field.get(assertionFromDataSource);
- assertThat(infoFromDataSource.descriptionText()).isEqualTo("Change at index 0 (on table : ACTOR and with primary key : [4]) of Changes on tables of a data source (only changes on actor table)");
+ assertThat(infoFromDataSource.descriptionText()).isEqualTo("Change at index 0 (on table : ACTOR and with primary key : [4]) of Changes on tables of 'data source' (only changes on actor table)");
}
/**
@@ -938,8 +939,8 @@ public void test_default_description_of_change_on_table_of_changes_on_table() th
field.setAccessible(true);
- Table tableFromSource = new Table(source, "actor");
- Table tableFromDataSource = new Table(dataSource, "actor");
+ Table tableFromSource = new Table(jdbcConnectionProvider, "actor");
+ Table tableFromDataSource = new Table(dsConnectionProvider, "actor");
Changes changesFromSource = new Changes(tableFromSource).setStartPointNow();
Changes changesFromDataSource = new Changes(tableFromDataSource).setStartPointNow();
updateChangesForTests();
@@ -952,10 +953,10 @@ public void test_default_description_of_change_on_table_of_changes_on_table() th
WritableAssertionInfo infoFromSource = (WritableAssertionInfo) field.get(assertionFromSource);
- assertThat(infoFromSource.descriptionText()).isEqualTo("Change at index 0 (with primary key : [4]) of Changes on ACTOR table of 'sa/jdbc:h2:mem:test' source (only changes on actor table)");
+ assertThat(infoFromSource.descriptionText()).isEqualTo("Change at index 0 (with primary key : [4]) of Changes on ACTOR table of 'sa/jdbc:h2:mem:test' (only changes on actor table)");
WritableAssertionInfo infoFromDataSource = (WritableAssertionInfo) field.get(assertionFromDataSource);
- assertThat(infoFromDataSource.descriptionText()).isEqualTo("Change at index 0 (with primary key : [4]) of Changes on ACTOR table of a data source (only changes on actor table)");
+ assertThat(infoFromDataSource.descriptionText()).isEqualTo("Change at index 0 (with primary key : [4]) of Changes on ACTOR table of 'data source' (only changes on actor table)");
}
/**
@@ -968,8 +969,8 @@ public void test_default_description_of_change_on_table_with_pks_of_changes() th
field.setAccessible(true);
- Changes changesFromSource = new Changes(source).setStartPointNow();
- Changes changesFromDataSource = new Changes(dataSource).setStartPointNow();
+ Changes changesFromSource = new Changes(jdbcConnectionProvider).setStartPointNow();
+ Changes changesFromDataSource = new Changes(dsConnectionProvider).setStartPointNow();
updateChangesForTests();
changesFromSource.setEndPointNow();
changesFromDataSource.setEndPointNow();
@@ -980,10 +981,10 @@ public void test_default_description_of_change_on_table_with_pks_of_changes() th
WritableAssertionInfo infoFromSource = (WritableAssertionInfo) field.get(assertionFromSource);
- assertThat(infoFromSource.descriptionText()).isEqualTo("Change at index 1 (on table : ACTOR and with primary key : [1]) of Changes on tables of 'sa/jdbc:h2:mem:test' source (only changes on actor table)");
+ assertThat(infoFromSource.descriptionText()).isEqualTo("Change at index 1 (on table : ACTOR and with primary key : [1]) of Changes on tables of 'sa/jdbc:h2:mem:test' (only changes on actor table)");
WritableAssertionInfo infoFromDataSource = (WritableAssertionInfo) field.get(assertionFromDataSource);
- assertThat(infoFromDataSource.descriptionText()).isEqualTo("Change at index 1 (on table : ACTOR and with primary key : [1]) of Changes on tables of a data source (only changes on actor table)");
+ assertThat(infoFromDataSource.descriptionText()).isEqualTo("Change at index 1 (on table : ACTOR and with primary key : [1]) of Changes on tables of 'data source' (only changes on actor table)");
}
/**
@@ -996,8 +997,8 @@ public void test_default_description_of_change_on_table_with_pks_of_changes_on_t
field.setAccessible(true);
- Table tableFromSource = new Table(source, "actor");
- Table tableFromDataSource = new Table(dataSource, "actor");
+ Table tableFromSource = new Table(jdbcConnectionProvider, "actor");
+ Table tableFromDataSource = new Table(dsConnectionProvider, "actor");
Changes changesFromSource = new Changes(tableFromSource).setStartPointNow();
Changes changesFromDataSource = new Changes(tableFromDataSource).setStartPointNow();
updateChangesForTests();
@@ -1010,10 +1011,10 @@ public void test_default_description_of_change_on_table_with_pks_of_changes_on_t
WritableAssertionInfo infoFromSource = (WritableAssertionInfo) field.get(assertionFromSource);
- assertThat(infoFromSource.descriptionText()).isEqualTo("Change at index 1 (with primary key : [1]) of Changes on ACTOR table of 'sa/jdbc:h2:mem:test' source (only changes on actor table)");
+ assertThat(infoFromSource.descriptionText()).isEqualTo("Change at index 1 (with primary key : [1]) of Changes on ACTOR table of 'sa/jdbc:h2:mem:test' (only changes on actor table)");
WritableAssertionInfo infoFromDataSource = (WritableAssertionInfo) field.get(assertionFromDataSource);
- assertThat(infoFromDataSource.descriptionText()).isEqualTo("Change at index 1 (with primary key : [1]) of Changes on ACTOR table of a data source (only changes on actor table)");
+ assertThat(infoFromDataSource.descriptionText()).isEqualTo("Change at index 1 (with primary key : [1]) of Changes on ACTOR table of 'data source' (only changes on actor table)");
}
/**
@@ -1026,8 +1027,8 @@ public void test_default_description_column_of_change_of_changes() throws Except
field.setAccessible(true);
- Changes changesFromSource = new Changes(source).setStartPointNow();
- Changes changesFromDataSource = new Changes(dataSource).setStartPointNow();
+ Changes changesFromSource = new Changes(jdbcConnectionProvider).setStartPointNow();
+ Changes changesFromDataSource = new Changes(dsConnectionProvider).setStartPointNow();
updateChangesForTests();
changesFromSource.setEndPointNow();
changesFromDataSource.setEndPointNow();
@@ -1038,10 +1039,10 @@ public void test_default_description_column_of_change_of_changes() throws Except
WritableAssertionInfo infoFromSource = (WritableAssertionInfo) field.get(assertionFromSource);
- assertThat(infoFromSource.descriptionText()).isEqualTo("Column at index 0 (column name : ID) of Change at index 0 (on table : ACTOR and with primary key : [4]) of Changes on tables of 'sa/jdbc:h2:mem:test' source");
+ assertThat(infoFromSource.descriptionText()).isEqualTo("Column at index 0 (column name : ID) of Change at index 0 (on table : ACTOR and with primary key : [4]) of Changes on tables of 'sa/jdbc:h2:mem:test'");
WritableAssertionInfo infoFromDataSource = (WritableAssertionInfo) field.get(assertionFromDataSource);
- assertThat(infoFromDataSource.descriptionText()).isEqualTo("Column at index 0 (column name : ID) of Change at index 1 (on table : INTERPRETATION and with primary key : [6]) of Changes on tables of a data source");
+ assertThat(infoFromDataSource.descriptionText()).isEqualTo("Column at index 0 (column name : ID) of Change at index 1 (on table : INTERPRETATION and with primary key : [6]) of Changes on tables of 'data source'");
}
/**
@@ -1054,8 +1055,8 @@ public void test_default_description_row_at_start_point_of_change_of_changes() t
field.setAccessible(true);
- Changes changesFromSource = new Changes(source).setStartPointNow();
- Changes changesFromDataSource = new Changes(dataSource).setStartPointNow();
+ Changes changesFromSource = new Changes(jdbcConnectionProvider).setStartPointNow();
+ Changes changesFromDataSource = new Changes(dsConnectionProvider).setStartPointNow();
updateChangesForTests();
changesFromSource.setEndPointNow();
changesFromDataSource.setEndPointNow();
@@ -1066,10 +1067,10 @@ public void test_default_description_row_at_start_point_of_change_of_changes() t
WritableAssertionInfo infoFromSource = (WritableAssertionInfo) field.get(assertionFromSource);
- assertThat(infoFromSource.descriptionText()).isEqualTo("Row at start point of Change at index 0 (on table : ACTOR and with primary key : [4]) of Changes on tables of 'sa/jdbc:h2:mem:test' source");
+ assertThat(infoFromSource.descriptionText()).isEqualTo("Row at start point of Change at index 0 (on table : ACTOR and with primary key : [4]) of Changes on tables of 'sa/jdbc:h2:mem:test'");
WritableAssertionInfo infoFromDataSource = (WritableAssertionInfo) field.get(assertionFromDataSource);
- assertThat(infoFromDataSource.descriptionText()).isEqualTo("Row at start point of Change at index 1 (on table : INTERPRETATION and with primary key : [6]) of Changes on tables of a data source");
+ assertThat(infoFromDataSource.descriptionText()).isEqualTo("Row at start point of Change at index 1 (on table : INTERPRETATION and with primary key : [6]) of Changes on tables of 'data source'");
}
/**
@@ -1082,8 +1083,8 @@ public void test_default_description_row_at_end_point_of_change_of_changes() thr
field.setAccessible(true);
- Changes changesFromSource = new Changes(source).setStartPointNow();
- Changes changesFromDataSource = new Changes(dataSource).setStartPointNow();
+ Changes changesFromSource = new Changes(jdbcConnectionProvider).setStartPointNow();
+ Changes changesFromDataSource = new Changes(dsConnectionProvider).setStartPointNow();
updateChangesForTests();
changesFromSource.setEndPointNow();
changesFromDataSource.setEndPointNow();
@@ -1094,10 +1095,10 @@ public void test_default_description_row_at_end_point_of_change_of_changes() thr
WritableAssertionInfo infoFromSource = (WritableAssertionInfo) field.get(assertionFromSource);
- assertThat(infoFromSource.descriptionText()).isEqualTo("Row at end point of Change at index 0 (on table : ACTOR and with primary key : [4]) of Changes on tables of 'sa/jdbc:h2:mem:test' source");
+ assertThat(infoFromSource.descriptionText()).isEqualTo("Row at end point of Change at index 0 (on table : ACTOR and with primary key : [4]) of Changes on tables of 'sa/jdbc:h2:mem:test'");
WritableAssertionInfo infoFromDataSource = (WritableAssertionInfo) field.get(assertionFromDataSource);
- assertThat(infoFromDataSource.descriptionText()).isEqualTo("Row at end point of Change at index 1 (on table : INTERPRETATION and with primary key : [6]) of Changes on tables of a data source");
+ assertThat(infoFromDataSource.descriptionText()).isEqualTo("Row at end point of Change at index 1 (on table : INTERPRETATION and with primary key : [6]) of Changes on tables of 'data source'");
}
/**
@@ -1110,8 +1111,8 @@ public void test_default_description_value_at_start_point_of_column_of_change_of
field.setAccessible(true);
- Changes changesFromSource = new Changes(source).setStartPointNow();
- Changes changesFromDataSource = new Changes(dataSource).setStartPointNow();
+ Changes changesFromSource = new Changes(jdbcConnectionProvider).setStartPointNow();
+ Changes changesFromDataSource = new Changes(dsConnectionProvider).setStartPointNow();
updateChangesForTests();
changesFromSource.setEndPointNow();
changesFromDataSource.setEndPointNow();
@@ -1123,10 +1124,10 @@ public void test_default_description_value_at_start_point_of_column_of_change_of
WritableAssertionInfo infoFromSource = (WritableAssertionInfo) field.get(assertionFromSource);
- assertThat(infoFromSource.descriptionText()).isEqualTo("Value at start point of Column at index 0 (column name : ID) of Change at index 0 (on table : ACTOR and with primary key : [4]) of Changes on tables of 'sa/jdbc:h2:mem:test' source");
+ assertThat(infoFromSource.descriptionText()).isEqualTo("Value at start point of Column at index 0 (column name : ID) of Change at index 0 (on table : ACTOR and with primary key : [4]) of Changes on tables of 'sa/jdbc:h2:mem:test'");
WritableAssertionInfo infoFromDataSource = (WritableAssertionInfo) field.get(assertionFromDataSource);
- assertThat(infoFromDataSource.descriptionText()).isEqualTo("Value at start point of Column at index 0 (column name : ID) of Change at index 1 (on table : INTERPRETATION and with primary key : [6]) of Changes on tables of a data source");
+ assertThat(infoFromDataSource.descriptionText()).isEqualTo("Value at start point of Column at index 0 (column name : ID) of Change at index 1 (on table : INTERPRETATION and with primary key : [6]) of Changes on tables of 'data source'");
}
/**
@@ -1139,8 +1140,8 @@ public void test_default_description_value_at_end_point_of_column_of_change_of_c
field.setAccessible(true);
- Changes changesFromSource = new Changes(source).setStartPointNow();
- Changes changesFromDataSource = new Changes(dataSource).setStartPointNow();
+ Changes changesFromSource = new Changes(jdbcConnectionProvider).setStartPointNow();
+ Changes changesFromDataSource = new Changes(dsConnectionProvider).setStartPointNow();
updateChangesForTests();
changesFromSource.setEndPointNow();
changesFromDataSource.setEndPointNow();
@@ -1152,10 +1153,10 @@ public void test_default_description_value_at_end_point_of_column_of_change_of_c
WritableAssertionInfo infoFromSource = (WritableAssertionInfo) field.get(assertionFromSource);
- assertThat(infoFromSource.descriptionText()).isEqualTo("Value at end point of Column at index 0 (column name : ID) of Change at index 0 (on table : ACTOR and with primary key : [4]) of Changes on tables of 'sa/jdbc:h2:mem:test' source");
+ assertThat(infoFromSource.descriptionText()).isEqualTo("Value at end point of Column at index 0 (column name : ID) of Change at index 0 (on table : ACTOR and with primary key : [4]) of Changes on tables of 'sa/jdbc:h2:mem:test'");
WritableAssertionInfo infoFromDataSource = (WritableAssertionInfo) field.get(assertionFromDataSource);
- assertThat(infoFromDataSource.descriptionText()).isEqualTo("Value at end point of Column at index 0 (column name : ID) of Change at index 1 (on table : INTERPRETATION and with primary key : [6]) of Changes on tables of a data source");
+ assertThat(infoFromDataSource.descriptionText()).isEqualTo("Value at end point of Column at index 0 (column name : ID) of Change at index 1 (on table : INTERPRETATION and with primary key : [6]) of Changes on tables of 'data source'");
}
/**
@@ -1168,8 +1169,8 @@ public void test_default_description_value_of_row_at_start_point_of_change_of_ch
field.setAccessible(true);
- Changes changesFromSource = new Changes(source).setStartPointNow();
- Changes changesFromDataSource = new Changes(dataSource).setStartPointNow();
+ Changes changesFromSource = new Changes(jdbcConnectionProvider).setStartPointNow();
+ Changes changesFromDataSource = new Changes(dsConnectionProvider).setStartPointNow();
updateChangesForTests();
changesFromSource.setEndPointNow();
changesFromDataSource.setEndPointNow();
@@ -1180,10 +1181,10 @@ public void test_default_description_value_of_row_at_start_point_of_change_of_ch
WritableAssertionInfo infoFromSource = (WritableAssertionInfo) field.get(assertionFromSource);
- assertThat(infoFromSource.descriptionText()).isEqualTo("Value at index 0 (column name : ID) of Row at start point of Change at index 3 (on table : ACTOR and with primary key : [1]) of Changes on tables of 'sa/jdbc:h2:mem:test' source");
+ assertThat(infoFromSource.descriptionText()).isEqualTo("Value at index 0 (column name : ID) of Row at start point of Change at index 3 (on table : ACTOR and with primary key : [1]) of Changes on tables of 'sa/jdbc:h2:mem:test'");
WritableAssertionInfo infoFromDataSource = (WritableAssertionInfo) field.get(assertionFromDataSource);
- assertThat(infoFromDataSource.descriptionText()).isEqualTo("Value at index 0 (column name : ID) of Row at start point of Change at index 3 (on table : ACTOR and with primary key : [1]) of Changes on tables of a data source");
+ assertThat(infoFromDataSource.descriptionText()).isEqualTo("Value at index 0 (column name : ID) of Row at start point of Change at index 3 (on table : ACTOR and with primary key : [1]) of Changes on tables of 'data source'");
}
/**
@@ -1196,8 +1197,8 @@ public void test_default_description_value_of_row_at_end_point_of_change_of_chan
field.setAccessible(true);
- Changes changesFromSource = new Changes(source).setStartPointNow();
- Changes changesFromDataSource = new Changes(dataSource).setStartPointNow();
+ Changes changesFromSource = new Changes(jdbcConnectionProvider).setStartPointNow();
+ Changes changesFromDataSource = new Changes(dsConnectionProvider).setStartPointNow();
updateChangesForTests();
changesFromSource.setEndPointNow();
changesFromDataSource.setEndPointNow();
@@ -1208,10 +1209,10 @@ public void test_default_description_value_of_row_at_end_point_of_change_of_chan
WritableAssertionInfo infoFromSource = (WritableAssertionInfo) field.get(assertionFromSource);
- assertThat(infoFromSource.descriptionText()).isEqualTo("Value at index 0 (column name : ID) of Row at end point of Change at index 0 (on table : ACTOR and with primary key : [4]) of Changes on tables of 'sa/jdbc:h2:mem:test' source");
+ assertThat(infoFromSource.descriptionText()).isEqualTo("Value at index 0 (column name : ID) of Row at end point of Change at index 0 (on table : ACTOR and with primary key : [4]) of Changes on tables of 'sa/jdbc:h2:mem:test'");
WritableAssertionInfo infoFromDataSource = (WritableAssertionInfo) field.get(assertionFromDataSource);
- assertThat(infoFromDataSource.descriptionText()).isEqualTo("Value at index 0 (column name : ID) of Row at end point of Change at index 1 (on table : INTERPRETATION and with primary key : [6]) of Changes on tables of a data source");
+ assertThat(infoFromDataSource.descriptionText()).isEqualTo("Value at index 0 (column name : ID) of Row at end point of Change at index 1 (on table : INTERPRETATION and with primary key : [6]) of Changes on tables of 'data source'");
}
/**
@@ -1223,8 +1224,8 @@ public void test_default_description_of_table() throws Exception {
field.setAccessible(true);
- Table tableFromSource = new Table(source, "actor");
- Table tableFromDataSource = new Table(dataSource, "actor");
+ Table tableFromSource = new Table(jdbcConnectionProvider, "actor");
+ Table tableFromDataSource = new Table(dsConnectionProvider, "actor");
TableAssert assertionFromSource = assertThat(tableFromSource);
@@ -1247,8 +1248,8 @@ public void test_default_description_of_request() throws Exception {
field.setAccessible(true);
- Request requestFromSource = new Request(source, "select id, name, firstname, birth from actor where id = 1").setPksName("ID");
- Request requestFromDataSource = new Request(dataSource, "select * from actor").setPksName("ID");
+ Request requestFromSource = new Request(jdbcConnectionProvider, "select id, name, firstname, birth from actor where id = 1").setPksName("ID");
+ Request requestFromDataSource = new Request(dsConnectionProvider, "select * from actor").setPksName("ID");
RequestAssert assertionFromSource = assertThat(requestFromSource);
@@ -1271,8 +1272,8 @@ public void test_default_description_of_column_of_table() throws Exception {
field.setAccessible(true);
- Table tableFromSource = new Table(source, "actor");
- Table tableFromDataSource = new Table(dataSource, "actor");
+ Table tableFromSource = new Table(jdbcConnectionProvider, "actor");
+ Table tableFromDataSource = new Table(dsConnectionProvider, "actor");
TableColumnAssert assertionFromSource = assertThat(tableFromSource).column();
@@ -1295,8 +1296,8 @@ public void test_default_description_of_row_of_table() throws Exception {
field.setAccessible(true);
- Table tableFromSource = new Table(source, "actor");
- Table tableFromDataSource = new Table(dataSource, "actor");
+ Table tableFromSource = new Table(jdbcConnectionProvider, "actor");
+ Table tableFromDataSource = new Table(dsConnectionProvider, "actor");
TableRowAssert assertionFromSource = assertThat(tableFromSource).row();
@@ -1319,8 +1320,8 @@ public void test_default_description_of_column_of_request() throws Exception {
field.setAccessible(true);
- Request requestFromSource = new Request(source, "select * from actor").setPksName("ID");
- Request requestFromDataSource = new Request(dataSource, "select * from actor").setPksName("ID");
+ Request requestFromSource = new Request(jdbcConnectionProvider, "select * from actor").setPksName("ID");
+ Request requestFromDataSource = new Request(dsConnectionProvider, "select * from actor").setPksName("ID");
RequestColumnAssert assertionFromSource = assertThat(requestFromSource).column();
@@ -1343,8 +1344,8 @@ public void test_default_description_of_row_of_request() throws Exception {
field.setAccessible(true);
- Request requestFromSource = new Request(source, "select * from actor").setPksName("ID");
- Request requestFromDataSource = new Request(dataSource, "select * from actor").setPksName("ID");
+ Request requestFromSource = new Request(jdbcConnectionProvider, "select * from actor").setPksName("ID");
+ Request requestFromDataSource = new Request(dsConnectionProvider, "select * from actor").setPksName("ID");
RequestRowAssert assertionFromSource = assertThat(requestFromSource).row();
@@ -1367,8 +1368,8 @@ public void test_default_description_of_value_of_column_of_table() throws Except
field.setAccessible(true);
- Table tableFromSource = new Table(source, "actor");
- Table tableFromDataSource = new Table(dataSource, "actor");
+ Table tableFromSource = new Table(jdbcConnectionProvider, "actor");
+ Table tableFromDataSource = new Table(dsConnectionProvider, "actor");
TableColumnValueAssert assertionFromSource = assertThat(tableFromSource).column().value();
@@ -1391,8 +1392,8 @@ public void test_default_description_of_value_of_row_of_table() throws Exception
field.setAccessible(true);
- Table tableFromSource = new Table(source, "actor");
- Table tableFromDataSource = new Table(dataSource, "actor");
+ Table tableFromSource = new Table(jdbcConnectionProvider, "actor");
+ Table tableFromDataSource = new Table(dsConnectionProvider, "actor");
TableRowValueAssert assertionFromSource = assertThat(tableFromSource).row().value();
@@ -1415,8 +1416,8 @@ public void test_default_description_of_value_of_column_of_request() throws Exce
field.setAccessible(true);
- Request requestFromSource = new Request(source, "select * from actor").setPksName("ID");
- Request requestFromDataSource = new Request(dataSource, "select * from actor").setPksName("ID");
+ Request requestFromSource = new Request(jdbcConnectionProvider, "select * from actor").setPksName("ID");
+ Request requestFromDataSource = new Request(dsConnectionProvider, "select * from actor").setPksName("ID");
RequestColumnValueAssert assertionFromSource = assertThat(requestFromSource).column().value();
@@ -1439,8 +1440,8 @@ public void test_default_description_of_value_of_row_of_request() throws Excepti
field.setAccessible(true);
- Request requestFromSource = new Request(source, "select * from actor").setPksName("ID");
- Request requestFromDataSource = new Request(dataSource, "select * from actor").setPksName("ID");
+ Request requestFromSource = new Request(jdbcConnectionProvider, "select * from actor").setPksName("ID");
+ Request requestFromDataSource = new Request(dsConnectionProvider, "select * from actor").setPksName("ID");
RequestRowValueAssert assertionFromSource = assertThat(requestFromSource).row().value();
diff --git a/src/test/java/org/assertj/db/api/Descriptable_Test.java b/src/test/java/org/assertj/db/api/Descriptable_Test.java
index b0484cfd..9cca5d4a 100644
--- a/src/test/java/org/assertj/db/api/Descriptable_Test.java
+++ b/src/test/java/org/assertj/db/api/Descriptable_Test.java
@@ -29,6 +29,7 @@
* Test on {@code Descriptable} interface methods.
*
* @author Régis Pouiller
+ * @author Julien Roy
*/
public class Descriptable_Test extends AbstractTest {
@@ -39,7 +40,7 @@ public class Descriptable_Test extends AbstractTest {
public void test_as() throws Exception {
Field field = AbstractElement.class.getDeclaredField("info");
field.setAccessible(true);
- Table table = new Table(source, "actor");
+ Table table = new Table(jdbcConnectionProvider, "actor");
TableRowAssert assertion = assertThat(table).row();
WritableAssertionInfo info1 = (WritableAssertionInfo) field.get(assertion);
diff --git a/src/test/java/org/assertj/db/api/SoftAssertions_Test.java b/src/test/java/org/assertj/db/api/SoftAssertions_Test.java
index 5c64be6d..06707c51 100644
--- a/src/test/java/org/assertj/db/api/SoftAssertions_Test.java
+++ b/src/test/java/org/assertj/db/api/SoftAssertions_Test.java
@@ -12,6 +12,9 @@
*/
package org.assertj.db.api;
+import static org.assertj.core.api.Assertions.assertThat;
+import static org.assertj.core.api.Assertions.assertThatThrownBy;
+
import org.assertj.core.api.SoftAssertionError;
import org.assertj.core.api.ThrowableAssert;
import org.assertj.db.common.AbstractTest;
@@ -21,9 +24,6 @@
import org.assertj.db.type.Table;
import org.junit.Test;
-import static org.assertj.core.api.Assertions.assertThat;
-import static org.assertj.core.api.Assertions.assertThatThrownBy;
-
/**
* Test on the utility class {@code SoftAssertions}.
*
@@ -37,7 +37,7 @@ public class SoftAssertions_Test extends AbstractTest {
@Test
@NeedReload
public void test_soft_assert_table() {
- Table table = new Table(source, "test");
+ Table table = new Table(jdbcConnectionProvider, "test");
final SoftAssertions softly = new SoftAssertions();
softly.assertThat(table).as("Show be Zero").column("var1").value().isEqualTo(0);
softly.assertThat(table).column("var2").value().isFalse();
@@ -67,7 +67,7 @@ public void call() {
@Test
@NeedReload
public void test_soft_assert_request() {
- Request request = new Request(source, "select * from test");
+ Request request = new Request(jdbcConnectionProvider, "select * from test");
final SoftAssertions softly = new SoftAssertions();
softly.assertThat(request).column("var1").value(0).isEqualTo(0);
softly.assertThat(request).column("var2").value(0).isFalse();
@@ -97,7 +97,7 @@ public void call() {
@Test
@NeedReload
public void test_soft_assert_changes() {
- Changes changes = new Changes(source);
+ Changes changes = new Changes(jdbcConnectionProvider);
changes.setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
changes.setEndPointNow();
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnChangeType_IsCreation_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnChangeType_IsCreation_Test.java
index b75fc10e..fba5f299 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnChangeType_IsCreation_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnChangeType_IsCreation_Test.java
@@ -27,6 +27,7 @@
* {@link AssertOnChangeType#isCreation()}} method.
*
* @author Régis Pouiller
+ * @author Julien Roy
*/
public class AssertOnChangeType_IsCreation_Test extends AbstractTest {
@@ -36,7 +37,7 @@ public class AssertOnChangeType_IsCreation_Test extends AbstractTest {
@Test
@NeedReload
public void test_is_creation() throws Exception {
- Changes changes = new Changes(source).setStartPointNow();
+ Changes changes = new Changes(jdbcConnectionProvider).setStartPointNow();
updateChangesForTests();
changes.setEndPointNow();
@@ -51,7 +52,7 @@ public void test_is_creation() throws Exception {
@Test
@NeedReload
public void should_fail_because_type_of_change_is_different() throws Exception {
- Changes changes = new Changes(source).setStartPointNow();
+ Changes changes = new Changes(jdbcConnectionProvider).setStartPointNow();
updateChangesForTests();
changes.setEndPointNow();
@@ -59,7 +60,7 @@ public void should_fail_because_type_of_change_is_different() throws Exception {
assertThat(changes).change(3).isCreation();
fail("An exception must be raised");
} catch (AssertionError e) {
- Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Change at index 3 (on table : ACTOR and with primary key : [1]) of Changes on tables of 'sa/jdbc:h2:mem:test' source] %n"
+ Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Change at index 3 (on table : ACTOR and with primary key : [1]) of Changes on tables of 'sa/jdbc:h2:mem:test'] %n"
+ "Expecting:%n"
+ "to be of type%n"
+ " %n"
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnChangeType_IsDeletion_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnChangeType_IsDeletion_Test.java
index 7af6e086..ccbfa0cd 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnChangeType_IsDeletion_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnChangeType_IsDeletion_Test.java
@@ -27,6 +27,7 @@
* {@link AssertOnChangeType#isDeletion()}} method.
*
* @author Régis Pouiller
+ * @author Julien Roy
*/
public class AssertOnChangeType_IsDeletion_Test extends AbstractTest {
@@ -36,7 +37,7 @@ public class AssertOnChangeType_IsDeletion_Test extends AbstractTest {
@Test
@NeedReload
public void test_is_deletion() throws Exception {
- Changes changes = new Changes(source).setStartPointNow();
+ Changes changes = new Changes(jdbcConnectionProvider).setStartPointNow();
updateChangesForTests();
changes.setEndPointNow();
@@ -51,7 +52,7 @@ public void test_is_deletion() throws Exception {
@Test
@NeedReload
public void should_fail_because_type_of_change_is_different() throws Exception {
- Changes changes = new Changes(source).setStartPointNow();
+ Changes changes = new Changes(jdbcConnectionProvider).setStartPointNow();
updateChangesForTests();
changes.setEndPointNow();
@@ -59,7 +60,7 @@ public void should_fail_because_type_of_change_is_different() throws Exception {
assertThat(changes).change(3).isDeletion();
fail("An exception must be raised");
} catch (AssertionError e) {
- Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Change at index 3 (on table : ACTOR and with primary key : [1]) of Changes on tables of 'sa/jdbc:h2:mem:test' source] %n"
+ Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Change at index 3 (on table : ACTOR and with primary key : [1]) of Changes on tables of 'sa/jdbc:h2:mem:test'] %n"
+ "Expecting:%n"
+ "to be of type%n"
+ " %n"
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnChangeType_IsModification_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnChangeType_IsModification_Test.java
index c5bd83fb..8192788d 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnChangeType_IsModification_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnChangeType_IsModification_Test.java
@@ -12,9 +12,6 @@
*/
package org.assertj.db.api.assertions;
-import static org.assertj.db.api.Assertions.assertThat;
-import static org.junit.Assert.fail;
-
import org.assertj.core.api.Assertions;
import org.assertj.db.api.ChangeAssert;
import org.assertj.db.common.AbstractTest;
@@ -22,49 +19,53 @@
import org.assertj.db.type.Changes;
import org.junit.Test;
+import static org.assertj.db.api.Assertions.assertThat;
+import static org.junit.Assert.fail;
+
/**
* Tests on {@link AssertOnChangeType} class :
* {@link AssertOnChangeType#isModification()}} method.
*
* @author Régis Pouiller
+ * @author Julien Roy
*/
public class AssertOnChangeType_IsModification_Test extends AbstractTest {
- /**
- * This method tests the {@code isModification} assertion method.
- */
- @Test
- @NeedReload
- public void test_is_modification() throws Exception {
- Changes changes = new Changes(source).setStartPointNow();
- updateChangesForTests();
- changes.setEndPointNow();
+ /**
+ * This method tests the {@code isModification} assertion method.
+ */
+ @Test
+ @NeedReload
+ public void test_is_modification() throws Exception {
+ Changes changes = new Changes(jdbcConnectionProvider).setStartPointNow();
+ updateChangesForTests();
+ changes.setEndPointNow();
- ChangeAssert changeAssert = assertThat(changes).change(3);
- ChangeAssert changeAssert2 = changeAssert.isModification();
- Assertions.assertThat(changeAssert).isSameAs(changeAssert2);
- }
+ ChangeAssert changeAssert = assertThat(changes).change(3);
+ ChangeAssert changeAssert2 = changeAssert.isModification();
+ Assertions.assertThat(changeAssert).isSameAs(changeAssert2);
+ }
- /**
- * This method should fail because the type of change is different.
- */
- @Test
- @NeedReload
- public void should_fail_because_type_of_change_is_different() throws Exception {
- Changes changes = new Changes(source).setStartPointNow();
- updateChangesForTests();
- changes.setEndPointNow();
+ /**
+ * This method should fail because the type of change is different.
+ */
+ @Test
+ @NeedReload
+ public void should_fail_because_type_of_change_is_different() throws Exception {
+ Changes changes = new Changes(jdbcConnectionProvider).setStartPointNow();
+ updateChangesForTests();
+ changes.setEndPointNow();
- try {
- assertThat(changes).change().isModification();
- fail("An exception must be raised");
- } catch (AssertionError e) {
- Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Change at index 0 (on table : ACTOR and with primary key : [4]) of Changes on tables of 'sa/jdbc:h2:mem:test' source] %n"
- + "Expecting:%n"
- + "to be of type%n"
- + " %n"
- + "but was of type%n"
- + " "));
+ try {
+ assertThat(changes).change().isModification();
+ fail("An exception must be raised");
+ } catch (AssertionError e) {
+ Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Change at index 0 (on table : ACTOR and with primary key : [4]) of Changes on tables of 'sa/jdbc:h2:mem:test'] %n"
+ + "Expecting:%n"
+ + "to be of type%n"
+ + " %n"
+ + "but was of type%n"
+ + " "));
+ }
}
- }
}
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnChangeType_IsOfType_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnChangeType_IsOfType_Test.java
index 4dce3796..3d372386 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnChangeType_IsOfType_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnChangeType_IsOfType_Test.java
@@ -28,6 +28,7 @@
* {@link AssertOnChangeType#isOfType(org.assertj.db.type.ChangeType)} method.
*
* @author Régis Pouiller
+ * @author Julien Roy
*/
public class AssertOnChangeType_IsOfType_Test extends AbstractTest {
@@ -37,7 +38,7 @@ public class AssertOnChangeType_IsOfType_Test extends AbstractTest {
@Test
@NeedReload
public void test_is_of_type() throws Exception {
- Changes changes = new Changes(source).setStartPointNow();
+ Changes changes = new Changes(jdbcConnectionProvider).setStartPointNow();
updateChangesForTests();
changes.setEndPointNow();
@@ -52,7 +53,7 @@ public void test_is_of_type() throws Exception {
@Test
@NeedReload
public void should_fail_because_type_of_change_is_different() throws Exception {
- Changes changes = new Changes(source).setStartPointNow();
+ Changes changes = new Changes(jdbcConnectionProvider).setStartPointNow();
updateChangesForTests();
changes.setEndPointNow();
@@ -60,7 +61,7 @@ public void should_fail_because_type_of_change_is_different() throws Exception {
assertThat(changes).change(3).isOfType(ChangeType.CREATION);
fail("An exception must be raised");
} catch (AssertionError e) {
- Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Change at index 3 (on table : ACTOR and with primary key : [1]) of Changes on tables of 'sa/jdbc:h2:mem:test' source] %n"
+ Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Change at index 3 (on table : ACTOR and with primary key : [1]) of Changes on tables of 'sa/jdbc:h2:mem:test'] %n"
+ "Expecting:%n"
+ "to be of type%n"
+ " %n"
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnColumnClass_IsOfClass_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnColumnClass_IsOfClass_Test.java
index 0c9f1d90..35abedfe 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnColumnClass_IsOfClass_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnColumnClass_IsOfClass_Test.java
@@ -29,6 +29,7 @@
* {@link AssertOnColumnClass#isOfClass(Class, boolean)} method.
*
* @author Régis Pouiller
+ * @author Julien Roy
*/
public class AssertOnColumnClass_IsOfClass_Test extends AbstractTest {
@@ -38,12 +39,12 @@ public class AssertOnColumnClass_IsOfClass_Test extends AbstractTest {
@Test
@NeedReload
public void test_is_of_type() {
- Changes changes = new Changes(source).setStartPointNow();
+ Changes changes = new Changes(jdbcConnectionProvider).setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
update("insert into test(var1, var2, var11, var10, var9, var3, var12, var8) values(5, true, FILE_READ('classpath:h2-logo-2.png'), '2014-05-24 09:46:30', '2014-05-24', 3, 'test', '09:46:30')");
changes.setEndPointNow();
- Table table = new Table(source, "test");
- Table table2 = new Table(source, "test2");
+ Table table = new Table(jdbcConnectionProvider, "test");
+ Table table2 = new Table(jdbcConnectionProvider, "test2");
ChangeColumnAssert changeColumnAssert1 = assertThat(changes).change().column("var2");
ChangeColumnAssert changeColumnAssertReturn1 = changeColumnAssert1.isOfClass(Boolean.class, true);
@@ -65,18 +66,18 @@ public void test_is_of_type() {
@Test
@NeedReload
public void should_fail_because_value_have_different_type() {
- Changes changes = new Changes(source).setStartPointNow();
+ Changes changes = new Changes(jdbcConnectionProvider).setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
update("insert into test(var1, var2, var11, var10, var9, var3, var12, var8) values(5, true, FILE_READ('classpath:h2-logo-2.png'), '2014-05-24 09:46:30', '2014-05-24', 3, 'test', '09:46:30')");
changes.setEndPointNow();
- Table table = new Table(source, "test");
- Table table2 = new Table(source, "test2");
+ Table table = new Table(jdbcConnectionProvider, "test");
+ Table table2 = new Table(jdbcConnectionProvider, "test2");
try {
assertThat(changes).change().column("var2").isOfClass(Boolean.class, false);
fail("An exception must be raised");
} catch (AssertionError e) {
- Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Column at index 1 (column name : VAR2) of Change at index 0 (on table : TEST and with primary key : [5]) of Changes on tables of 'sa/jdbc:h2:mem:test' source] %n"
+ Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Column at index 1 (column name : VAR2) of Change at index 0 (on table : TEST and with primary key : [5]) of Changes on tables of 'sa/jdbc:h2:mem:test'] %n"
+ "Expecting that the value at start point:%n"
+ " %n"
+ "to be of class%n"
@@ -86,7 +87,7 @@ public void should_fail_because_value_have_different_type() {
assertThat(changes).change(1).column("var1").isOfClass(Boolean.class, true);
fail("An exception must be raised");
} catch (AssertionError e) {
- Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Column at index 0 (column name : VAR1) of Change at index 1 (on table : TEST and with primary key : [1]) of Changes on tables of 'sa/jdbc:h2:mem:test' source] %n"
+ Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Column at index 0 (column name : VAR1) of Change at index 1 (on table : TEST and with primary key : [1]) of Changes on tables of 'sa/jdbc:h2:mem:test'] %n"
+ "Expecting that the value at start point:%n"
+ " <1>%n"
+ "to be of class%n"
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnColumnContent_ContainsValues_Boolean_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnColumnContent_ContainsValues_Boolean_Test.java
index 9382938a..947be5d0 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnColumnContent_ContainsValues_Boolean_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnColumnContent_ContainsValues_Boolean_Test.java
@@ -26,6 +26,7 @@
* {@link AssertOnColumnContent#containsValues(Boolean...)} method.
*
* @author Régis Pouiller
+ * @author Julien Roy
*/
public class AssertOnColumnContent_ContainsValues_Boolean_Test extends AbstractTest {
@@ -34,12 +35,12 @@ public class AssertOnColumnContent_ContainsValues_Boolean_Test extends AbstractT
*/
@Test
public void test_has_values() throws Exception {
- Table table = new Table(source, "test");
+ Table table = new Table(jdbcConnectionProvider, "test");
TableColumnAssert tableColumnAssert = assertThat(table).column("var2");
TableColumnAssert tableColumnAssertReturn = tableColumnAssert.containsValues(true, false, false, false);
Assertions.assertThat(tableColumnAssert).isSameAs(tableColumnAssertReturn);
- Table table2 = new Table(source, "test2");
+ Table table2 = new Table(jdbcConnectionProvider, "test2");
TableColumnAssert tableColumnAssert2 = assertThat(table2).column("var2");
TableColumnAssert tableColumnAssertReturn2 = tableColumnAssert2.containsValues(true, null);
Assertions.assertThat(tableColumnAssert2).isSameAs(tableColumnAssertReturn2);
@@ -50,7 +51,7 @@ public void test_has_values() throws Exception {
*/
@Test
public void should_fail_because_values_are_different() throws Exception {
- Table table = new Table(source, "test");
+ Table table = new Table(jdbcConnectionProvider, "test");
TableColumnAssert tableColumnAssert = assertThat(table).column("var2");
try {
tableColumnAssert.containsValues(true, false, true, false);
@@ -63,7 +64,7 @@ public void should_fail_because_values_are_different() throws Exception {
+ " <[true, false, true, false]>%n"
+ " (parameter at index 2 is not found)"));
}
- Table table2 = new Table(source, "test2");
+ Table table2 = new Table(jdbcConnectionProvider, "test2");
TableColumnAssert tableColumnAssert2 = assertThat(table2).column("var2");
try {
tableColumnAssert2.containsValues(true, true);
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnColumnContent_ContainsValues_Bytes_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnColumnContent_ContainsValues_Bytes_Test.java
index ce578d1f..85f332cc 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnColumnContent_ContainsValues_Bytes_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnColumnContent_ContainsValues_Bytes_Test.java
@@ -27,6 +27,7 @@
* {@link AssertOnColumnContent#containsValues(byte[]...)} method.
*
* @author Régis Pouiller
+ * @author Julien Roy
*/
public class AssertOnColumnContent_ContainsValues_Bytes_Test extends AbstractTest {
@@ -38,12 +39,12 @@ public void test_has_values() throws Exception {
byte[] bytesH2 = bytesContentFromClassPathOf("h2-logo-2.png");
byte[] bytesDev = bytesContentFromClassPathOf("logo-dev.jpg");
- Table table = new Table(source, "test");
+ Table table = new Table(jdbcConnectionProvider, "test");
TableColumnAssert tableColumnAssert = assertThat(table).column("var11");
TableColumnAssert tableColumnAssertReturn = tableColumnAssert.containsValues(bytesH2, bytesDev, bytesDev, bytesDev);
Assertions.assertThat(tableColumnAssert).isSameAs(tableColumnAssertReturn);
- Table table2 = new Table(source, "test2");
+ Table table2 = new Table(jdbcConnectionProvider, "test2");
TableColumnAssert tableColumnAssert2 = assertThat(table2).column("var11");
TableColumnAssert tableColumnAssertReturn2 = tableColumnAssert2.containsValues(bytesH2, null);
Assertions.assertThat(tableColumnAssert2).isSameAs(tableColumnAssertReturn2);
@@ -56,7 +57,7 @@ public void test_has_values() throws Exception {
public void should_fail_because_values_are_different() throws Exception {
byte[] bytesH2 = bytesContentFromClassPathOf("h2-logo-2.png");
- Table table = new Table(source, "test");
+ Table table = new Table(jdbcConnectionProvider, "test");
TableColumnAssert tableColumnAssert = assertThat(table).column("var11");
try {
tableColumnAssert.containsValues(bytesH2, bytesH2, bytesH2, bytesH2);
@@ -67,7 +68,7 @@ public void should_fail_because_values_are_different() throws Exception {
+ " (parameter at index 1 is not found)"));
}
- Table table2 = new Table(source, "test2");
+ Table table2 = new Table(jdbcConnectionProvider, "test2");
TableColumnAssert tableColumnAssert2 = assertThat(table2).column("var11");
try {
tableColumnAssert2.containsValues(bytesH2, bytesH2);
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnColumnContent_ContainsValues_Character_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnColumnContent_ContainsValues_Character_Test.java
index 7144dfd4..fd67e39c 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnColumnContent_ContainsValues_Character_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnColumnContent_ContainsValues_Character_Test.java
@@ -26,6 +26,7 @@
* {@link AssertOnColumnContent#containsValues(Character...)} method.
*
* @author Régis Pouiller
+ * @author Julien Roy
*/
public class AssertOnColumnContent_ContainsValues_Character_Test extends AbstractTest {
@@ -34,12 +35,12 @@ public class AssertOnColumnContent_ContainsValues_Character_Test extends Abstrac
*/
@Test
public void test_has_values() throws Exception {
- Table table = new Table(source, "test");
+ Table table = new Table(jdbcConnectionProvider, "test");
TableColumnAssert tableColumnAssert = assertThat(table).column("var16");
TableColumnAssert tableColumnAssertReturn = tableColumnAssert.containsValues('T', 'e', 's', 't');
Assertions.assertThat(tableColumnAssert).isSameAs(tableColumnAssertReturn);
- Table table2 = new Table(source, "test2");
+ Table table2 = new Table(jdbcConnectionProvider, "test2");
TableColumnAssert tableColumnAssert2 = assertThat(table2).column("var17");
TableColumnAssert tableColumnAssertReturn2 = tableColumnAssert2.containsValues(null, 'T');
Assertions.assertThat(tableColumnAssert2).isSameAs(tableColumnAssertReturn2);
@@ -50,7 +51,7 @@ public void test_has_values() throws Exception {
*/
@Test
public void should_fail_because_values_are_different() throws Exception {
- Table table = new Table(source, "test");
+ Table table = new Table(jdbcConnectionProvider, "test");
TableColumnAssert tableColumnAssert = assertThat(table).column("var16");
try {
tableColumnAssert.containsValues('t', 'e', 's', 't');
@@ -63,7 +64,7 @@ public void should_fail_because_values_are_different() throws Exception {
+ " <['t', 'e', 's', 't']>%n"
+ " (parameter <'t'> at index 3 is not found)"));
}
- Table table2 = new Table(source, "test2");
+ Table table2 = new Table(jdbcConnectionProvider, "test2");
TableColumnAssert tableColumnAssert2 = assertThat(table2).column("var17");
try {
tableColumnAssert2.containsValues('T', 'T');
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnColumnContent_ContainsValues_DateTimeValue_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnColumnContent_ContainsValues_DateTimeValue_Test.java
index d0cd0dc5..36167327 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnColumnContent_ContainsValues_DateTimeValue_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnColumnContent_ContainsValues_DateTimeValue_Test.java
@@ -29,6 +29,7 @@
* {@link AssertOnColumnContent#containsValues(org.assertj.db.type.DateTimeValue...)} method.
*
* @author Régis Pouiller
+ * @author Julien Roy
*/
public class AssertOnColumnContent_ContainsValues_DateTimeValue_Test extends AbstractTest {
@@ -37,7 +38,7 @@ public class AssertOnColumnContent_ContainsValues_DateTimeValue_Test extends Abs
*/
@Test
public void test_has_values() throws Exception {
- Table table = new Table(source, "test");
+ Table table = new Table(jdbcConnectionProvider, "test");
TableColumnAssert tableColumnAssert = assertThat(table).column("var10");
TableColumnAssert tableColumnAssertReturn = tableColumnAssert.containsValues(
DateTimeValue.of(DateValue.of(2014, 5, 24), TimeValue.of(9, 46, 30)),
@@ -46,7 +47,7 @@ public void test_has_values() throws Exception {
DateTimeValue.of(DateValue.of(2014, 5, 30)));
Assertions.assertThat(tableColumnAssert).isSameAs(tableColumnAssertReturn);
- Table table2 = new Table(source, "test2");
+ Table table2 = new Table(jdbcConnectionProvider, "test2");
TableColumnAssert tableColumnAssert2 = assertThat(table2).column("var10");
TableColumnAssert tableColumnAssertReturn2 = tableColumnAssert2.containsValues(
DateTimeValue.of(DateValue.of(2014, 5, 24), TimeValue.of(9, 46, 30)),
@@ -73,7 +74,7 @@ public void test_has_values() throws Exception {
*/
@Test
public void should_fail_because_values_are_different() throws Exception {
- Table table = new Table(source, "test");
+ Table table = new Table(jdbcConnectionProvider, "test");
TableColumnAssert tableColumnAssert = assertThat(table).column("var10");
try {
tableColumnAssert.containsValues(DateTimeValue.of(DateValue.of(2014, 5, 24), TimeValue.of(9, 46, 30)),
@@ -95,7 +96,7 @@ public void should_fail_because_values_are_different() throws Exception {
+ " 2014-05-30T00:00:00.000000000]>%n"
+ " (parameter <2014-05-30T13:29:49.000000000> at index 1 is not found)"));
}
- Table table2 = new Table(source, "test2");
+ Table table2 = new Table(jdbcConnectionProvider, "test2");
TableColumnAssert tableColumnAssert2 = assertThat(table2).column("var10");
try {
tableColumnAssert2.containsValues(DateTimeValue.of(DateValue.of(2014, 5, 24), TimeValue.of(9, 46, 30)),
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnColumnContent_ContainsValues_DateValue_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnColumnContent_ContainsValues_DateValue_Test.java
index b75ecddd..2987b77c 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnColumnContent_ContainsValues_DateValue_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnColumnContent_ContainsValues_DateValue_Test.java
@@ -28,6 +28,7 @@
* {@link AssertOnColumnContent#containsValues(org.assertj.db.type.DateValue...)} method.
*
* @author Régis Pouiller
+ * @author Julien Roy
*/
public class AssertOnColumnContent_ContainsValues_DateValue_Test extends AbstractTest {
@@ -38,7 +39,7 @@ public class AssertOnColumnContent_ContainsValues_DateValue_Test extends Abstrac
@NeedReload
public void test_has_values() throws Exception {
update("update test2 set var10 = '2014-05-24' where var1 = 1");
- Table table = new Table(source, "test");
+ Table table = new Table(jdbcConnectionProvider, "test");
TableColumnAssert tableColumnAssert = assertThat(table).column("var9");
TableColumnAssert tableColumnAssertReturn = tableColumnAssert.containsValues(
DateValue.of(2014, 5, 24),
@@ -47,7 +48,7 @@ public void test_has_values() throws Exception {
DateValue.of(2014, 5, 30));
Assertions.assertThat(tableColumnAssert).isSameAs(tableColumnAssertReturn);
- Table table2 = new Table(source, "test2");
+ Table table2 = new Table(jdbcConnectionProvider, "test2");
TableColumnAssert tableColumnAssert2 = assertThat(table2).column("var9");
TableColumnAssert tableColumnAssertReturn2 = tableColumnAssert2.containsValues(DateValue.of(2014, 5, 24),
null);
@@ -63,7 +64,7 @@ public void test_has_values() throws Exception {
*/
@Test
public void should_fail_because_values_are_different() throws Exception {
- Table table = new Table(source, "test");
+ Table table = new Table(jdbcConnectionProvider, "test");
TableColumnAssert tableColumnAssert = assertThat(table).column("var9");
try {
tableColumnAssert.containsValues(DateValue.of(2014, 5, 24),
@@ -82,7 +83,7 @@ public void should_fail_because_values_are_different() throws Exception {
+ " <[2014-05-24, 2014-05-29, 2014-05-30, 2014-05-30]>%n"
+ " (parameter <2014-05-29> at index 1 is not found)"));
}
- Table table2 = new Table(source, "test2");
+ Table table2 = new Table(jdbcConnectionProvider, "test2");
TableColumnAssert tableColumnAssert2 = assertThat(table2).column("var9");
try {
tableColumnAssert2.containsValues(DateValue.of(2014, 5, 24),
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnColumnContent_ContainsValues_Number_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnColumnContent_ContainsValues_Number_Test.java
index e3b6d3cb..6dc649a5 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnColumnContent_ContainsValues_Number_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnColumnContent_ContainsValues_Number_Test.java
@@ -26,6 +26,7 @@
* {@link AssertOnColumnContent#containsValues(Number...)} method.
*
* @author Régis Pouiller
+ * @author Julien Roy
*/
public class AssertOnColumnContent_ContainsValues_Number_Test extends AbstractTest {
@@ -34,12 +35,12 @@ public class AssertOnColumnContent_ContainsValues_Number_Test extends AbstractTe
*/
@Test
public void test_has_values() throws Exception {
- Table table = new Table(source, "test");
+ Table table = new Table(jdbcConnectionProvider, "test");
TableColumnAssert tableColumnAssert = assertThat(table).column("var3");
TableColumnAssert tableColumnAssertReturn = tableColumnAssert.containsValues(2, 20, 25, 0);
Assertions.assertThat(tableColumnAssert).isSameAs(tableColumnAssertReturn);
- Table table2 = new Table(source, "test2");
+ Table table2 = new Table(jdbcConnectionProvider, "test2");
TableColumnAssert tableColumnAssert2 = assertThat(table2).column("var3");
TableColumnAssert tableColumnAssertReturn2 = tableColumnAssert2.containsValues(2, null);
Assertions.assertThat(tableColumnAssert2).isSameAs(tableColumnAssertReturn2);
@@ -98,7 +99,7 @@ public void test_has_values() throws Exception {
*/
@Test
public void should_fail_because_values_are_different() throws Exception {
- Table table = new Table(source, "test");
+ Table table = new Table(jdbcConnectionProvider, "test");
TableColumnAssert tableColumnAssert = assertThat(table).column("var3");
try {
tableColumnAssert.containsValues(2, 20, 35, 0);
@@ -111,7 +112,7 @@ public void should_fail_because_values_are_different() throws Exception {
+ " <[2, 20, 35, 0]>%n"
+ " (parameter <35> at index 2 is not found)"));
}
- Table table2 = new Table(source, "test2");
+ Table table2 = new Table(jdbcConnectionProvider, "test2");
TableColumnAssert tableColumnAssert2 = assertThat(table2).column("var3");
try {
tableColumnAssert2.containsValues(2, 2);
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnColumnContent_ContainsValues_String_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnColumnContent_ContainsValues_String_Test.java
index 3ac469c7..d81c2e8e 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnColumnContent_ContainsValues_String_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnColumnContent_ContainsValues_String_Test.java
@@ -27,6 +27,7 @@
* {@link AssertOnColumnContent#containsValues(String...)} method.
*
* @author Régis Pouiller
+ * @author Julien Roy
*/
public class AssertOnColumnContent_ContainsValues_String_Test extends AbstractTest {
@@ -36,12 +37,12 @@ public class AssertOnColumnContent_ContainsValues_String_Test extends AbstractTe
@Test
@NeedReload
public void test_has_values() throws Exception {
- Table table = new Table(source, "test");
+ Table table = new Table(jdbcConnectionProvider, "test");
TableColumnAssert tableColumnAssert = assertThat(table).column("var3");
TableColumnAssert tableColumnAssertReturn = tableColumnAssert.containsValues("2", "20", "25", "0");
Assertions.assertThat(tableColumnAssert).isSameAs(tableColumnAssertReturn);
- Table table2 = new Table(source, "test2");
+ Table table2 = new Table(jdbcConnectionProvider, "test2");
TableColumnAssert tableColumnAssert2 = assertThat(table2).column("var3");
TableColumnAssert tableColumnAssertReturn2 = tableColumnAssert2.containsValues("2", null);
Assertions.assertThat(tableColumnAssert2).isSameAs(tableColumnAssertReturn2);
@@ -154,7 +155,7 @@ public void test_has_values() throws Exception {
Assertions.assertThat(tableColumnAssert18).isSameAs(tableColumnAssertReturn18);
update("update test2 set var10 = '2014-05-24' where var1 = 1");
- table2 = new Table(source, "test2");
+ table2 = new Table(jdbcConnectionProvider, "test2");
TableColumnAssert tableColumnAssert19 = assertThat(table2).column("var10");
TableColumnAssert tableColumnAssertReturn19 = tableColumnAssert19.containsValues("2014-05-24",
null);
@@ -172,7 +173,7 @@ public void test_has_values() throws Exception {
*/
@Test
public void should_fail_because_values_are_different() throws Exception {
- Table table = new Table(source, "test");
+ Table table = new Table(jdbcConnectionProvider, "test");
TableColumnAssert tableColumnAssert = assertThat(table).column("var3");
try {
tableColumnAssert.containsValues("2", "20", "35", "0");
@@ -185,7 +186,7 @@ public void should_fail_because_values_are_different() throws Exception {
+ " <[\"2\", \"20\", \"35\", \"0\"]>%n"
+ " (parameter <\"35\"> at index 2 is not found)"));
}
- Table table2 = new Table(source, "test2");
+ Table table2 = new Table(jdbcConnectionProvider, "test2");
TableColumnAssert tableColumnAssert2 = assertThat(table2).column("var3");
try {
tableColumnAssert2.containsValues("2", "2");
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnColumnContent_HasValues_TimeValue_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnColumnContent_HasValues_TimeValue_Test.java
index 99f7336a..e2a07984 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnColumnContent_HasValues_TimeValue_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnColumnContent_HasValues_TimeValue_Test.java
@@ -27,6 +27,7 @@
* {@link AssertOnColumnContent#containsValues(org.assertj.db.type.TimeValue...)} method.
*
* @author Régis Pouiller
+ * @author Julien Roy
*/
public class AssertOnColumnContent_HasValues_TimeValue_Test extends AbstractTest {
@@ -35,7 +36,7 @@ public class AssertOnColumnContent_HasValues_TimeValue_Test extends AbstractTest
*/
@Test
public void test_has_values() throws Exception {
- Table table = new Table(source, "test");
+ Table table = new Table(jdbcConnectionProvider, "test");
TableColumnAssert tableColumnAssert = assertThat(table).column("var8");
TableColumnAssert tableColumnAssertReturn = tableColumnAssert.containsValues(TimeValue.of(9, 46, 30),
TimeValue.of(12, 29, 49),
@@ -43,7 +44,7 @@ public void test_has_values() throws Exception {
TimeValue.of(12, 29, 49));
Assertions.assertThat(tableColumnAssert).isSameAs(tableColumnAssertReturn);
- Table table2 = new Table(source, "test2");
+ Table table2 = new Table(jdbcConnectionProvider, "test2");
TableColumnAssert tableColumnAssert2 = assertThat(table2).column("var8");
TableColumnAssert tableColumnAssertReturn2 = tableColumnAssert2.containsValues(TimeValue.of(9, 46, 30), null);
Assertions.assertThat(tableColumnAssert2).isSameAs(tableColumnAssertReturn2);
@@ -54,7 +55,7 @@ public void test_has_values() throws Exception {
*/
@Test
public void should_fail_because_values_are_different() throws Exception {
- Table table = new Table(source, "test");
+ Table table = new Table(jdbcConnectionProvider, "test");
TableColumnAssert tableColumnAssert = assertThat(table).column("var8");
try {
tableColumnAssert.containsValues(TimeValue.of(12, 29, 49),
@@ -76,7 +77,7 @@ public void should_fail_because_values_are_different() throws Exception {
+ "12:29:49.000000000]>%n"
+ " (parameter <12:29:49.000000000> at index 3 is not found)"));
}
- Table table2 = new Table(source, "test2");
+ Table table2 = new Table(jdbcConnectionProvider, "test2");
TableColumnAssert tableColumnAssert2 = assertThat(table2).column("var8");
try {
tableColumnAssert2.containsValues(TimeValue.of(9, 46, 30),
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnColumnContent_HasValues_UUID_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnColumnContent_HasValues_UUID_Test.java
index b1d87aeb..9deb4bec 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnColumnContent_HasValues_UUID_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnColumnContent_HasValues_UUID_Test.java
@@ -36,7 +36,7 @@ public class AssertOnColumnContent_HasValues_UUID_Test extends AbstractTest {
*/
@Test
public void test_has_values() throws Exception {
- Table table = new Table(source, "test");
+ Table table = new Table(jdbcConnectionProvider, "test");
TableColumnAssert tableColumnAssert = assertThat(table).column("var15");
TableColumnAssert tableColumnAssertReturn = tableColumnAssert.containsValues(
UUID.fromString("30B443AE-C0C9-4790-9BEC-CE1380808435"),
@@ -46,7 +46,7 @@ public void test_has_values() throws Exception {
);
Assertions.assertThat(tableColumnAssert).isSameAs(tableColumnAssertReturn);
- Table table2 = new Table(source, "test2");
+ Table table2 = new Table(jdbcConnectionProvider, "test2");
TableColumnAssert tableColumnAssert2 = assertThat(table2).column("var16");
TableColumnAssert tableColumnAssertReturn2 = tableColumnAssert2
.containsValues(UUID.fromString("30B443AE-C0C9-4790-9BEC-CE1380808435"), null);
@@ -58,7 +58,7 @@ public void test_has_values() throws Exception {
*/
@Test
public void should_fail_because_values_are_different() throws Exception {
- Table table = new Table(source, "test");
+ Table table = new Table(jdbcConnectionProvider, "test");
TableColumnAssert tableColumnAssert = assertThat(table).column("var15");
try {
tableColumnAssert.containsValues(UUID.fromString("F96EC595-CE91-47CC-9152-CCC8AC48AAD6"),
@@ -81,7 +81,7 @@ public void should_fail_because_values_are_different() throws Exception {
+ " f96ec595-ce91-47cc-9152-ccc8ac48aad6]>%n"
+ " (parameter at index 0 is not found)"));
}
- Table table2 = new Table(source, "test2");
+ Table table2 = new Table(jdbcConnectionProvider, "test2");
TableColumnAssert tableColumnAssert2 = assertThat(table2).column("var16");
try {
tableColumnAssert2.containsValues(UUID.fromString("30B443AE-C0C9-4790-9BEC-CE1380808435"),
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnColumnEquality_HasValues_Boolean_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnColumnEquality_HasValues_Boolean_Test.java
index ee0a4c2b..35ccfe9c 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnColumnEquality_HasValues_Boolean_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnColumnEquality_HasValues_Boolean_Test.java
@@ -26,6 +26,7 @@
* {@link org.assertj.db.api.assertions.AssertOnColumnEquality#hasValues(Boolean...)} method.
*
* @author Régis Pouiller
+ * @author Julien Roy
*/
public class AssertOnColumnEquality_HasValues_Boolean_Test extends AbstractTest {
@@ -34,12 +35,12 @@ public class AssertOnColumnEquality_HasValues_Boolean_Test extends AbstractTest
*/
@Test
public void test_has_values() throws Exception {
- Table table = new Table(source, "test");
+ Table table = new Table(jdbcConnectionProvider, "test");
TableColumnAssert tableColumnAssert = assertThat(table).column("var2");
TableColumnAssert tableColumnAssertReturn = tableColumnAssert.hasValues(true, false, false, false);
Assertions.assertThat(tableColumnAssert).isSameAs(tableColumnAssertReturn);
- Table table2 = new Table(source, "test2");
+ Table table2 = new Table(jdbcConnectionProvider, "test2");
TableColumnAssert tableColumnAssert2 = assertThat(table2).column("var2");
TableColumnAssert tableColumnAssertReturn2 = tableColumnAssert2.hasValues(true, null);
Assertions.assertThat(tableColumnAssert2).isSameAs(tableColumnAssertReturn2);
@@ -50,7 +51,7 @@ public void test_has_values() throws Exception {
*/
@Test
public void should_fail_because_values_are_different() throws Exception {
- Table table = new Table(source, "test");
+ Table table = new Table(jdbcConnectionProvider, "test");
TableColumnAssert tableColumnAssert = assertThat(table).column("var2");
try {
tableColumnAssert.hasValues(true, false, true, false);
@@ -62,7 +63,7 @@ public void should_fail_because_values_are_different() throws Exception {
+ "to be equal to: %n"
+ " "));
}
- Table table2 = new Table(source, "test2");
+ Table table2 = new Table(jdbcConnectionProvider, "test2");
TableColumnAssert tableColumnAssert2 = assertThat(table2).column("var2");
try {
tableColumnAssert2.hasValues(true, true);
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnColumnEquality_HasValues_Bytes_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnColumnEquality_HasValues_Bytes_Test.java
index dbc74e51..22c901c4 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnColumnEquality_HasValues_Bytes_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnColumnEquality_HasValues_Bytes_Test.java
@@ -27,6 +27,7 @@
* {@link org.assertj.db.api.assertions.AssertOnColumnEquality#hasValues(byte[]...)} method.
*
* @author Régis Pouiller
+ * @author Julien Roy
*/
public class AssertOnColumnEquality_HasValues_Bytes_Test extends AbstractTest {
@@ -38,12 +39,12 @@ public void test_has_values() throws Exception {
byte[] bytesH2 = bytesContentFromClassPathOf("h2-logo-2.png");
byte[] bytesDev = bytesContentFromClassPathOf("logo-dev.jpg");
- Table table = new Table(source, "test");
+ Table table = new Table(jdbcConnectionProvider, "test");
TableColumnAssert tableColumnAssert = assertThat(table).column("var11");
TableColumnAssert tableColumnAssertReturn = tableColumnAssert.hasValues(bytesH2, bytesDev, bytesDev, bytesDev);
Assertions.assertThat(tableColumnAssert).isSameAs(tableColumnAssertReturn);
- Table table2 = new Table(source, "test2");
+ Table table2 = new Table(jdbcConnectionProvider, "test2");
TableColumnAssert tableColumnAssert2 = assertThat(table2).column("var11");
TableColumnAssert tableColumnAssertReturn2 = tableColumnAssert2.hasValues(bytesH2, null);
Assertions.assertThat(tableColumnAssert2).isSameAs(tableColumnAssertReturn2);
@@ -56,7 +57,7 @@ public void test_has_values() throws Exception {
public void should_fail_because_values_are_different() throws Exception {
byte[] bytesH2 = bytesContentFromClassPathOf("h2-logo-2.png");
- Table table = new Table(source, "test");
+ Table table = new Table(jdbcConnectionProvider, "test");
TableColumnAssert tableColumnAssert = assertThat(table).column("var11");
try {
tableColumnAssert.hasValues(bytesH2, bytesH2, bytesH2, bytesH2);
@@ -66,7 +67,7 @@ public void should_fail_because_values_are_different() throws Exception {
+ "Expecting that the value at index 1 to be equal to the expected value but was not equal"));
}
- Table table2 = new Table(source, "test2");
+ Table table2 = new Table(jdbcConnectionProvider, "test2");
TableColumnAssert tableColumnAssert2 = assertThat(table2).column("var11");
try {
tableColumnAssert2.hasValues(bytesH2, bytesH2);
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnColumnEquality_HasValues_Character_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnColumnEquality_HasValues_Character_Test.java
index 5e0ddc2d..f14313e1 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnColumnEquality_HasValues_Character_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnColumnEquality_HasValues_Character_Test.java
@@ -26,6 +26,7 @@
* {@link org.assertj.db.api.assertions.AssertOnColumnEquality#hasValues(Character...)} method.
*
* @author Régis Pouiller
+ * @author Julien Roy
*/
public class AssertOnColumnEquality_HasValues_Character_Test extends AbstractTest {
@@ -34,12 +35,12 @@ public class AssertOnColumnEquality_HasValues_Character_Test extends AbstractTes
*/
@Test
public void test_has_values() throws Exception {
- Table table = new Table(source, "test");
+ Table table = new Table(jdbcConnectionProvider, "test");
TableColumnAssert tableColumnAssert = assertThat(table).column("var16");
TableColumnAssert tableColumnAssertReturn = tableColumnAssert.hasValues('T', 'e', 's', 't');
Assertions.assertThat(tableColumnAssert).isSameAs(tableColumnAssertReturn);
- Table table2 = new Table(source, "test2");
+ Table table2 = new Table(jdbcConnectionProvider, "test2");
TableColumnAssert tableColumnAssert2 = assertThat(table2).column("var17");
TableColumnAssert tableColumnAssertReturn2 = tableColumnAssert2.hasValues('T', null);
Assertions.assertThat(tableColumnAssert2).isSameAs(tableColumnAssertReturn2);
@@ -50,7 +51,7 @@ public void test_has_values() throws Exception {
*/
@Test
public void should_fail_because_values_are_different() throws Exception {
- Table table = new Table(source, "test");
+ Table table = new Table(jdbcConnectionProvider, "test");
TableColumnAssert tableColumnAssert = assertThat(table).column("var16");
try {
tableColumnAssert.hasValues('t', 'e', 's', 'T');
@@ -62,7 +63,7 @@ public void should_fail_because_values_are_different() throws Exception {
+ "to be equal to: %n"
+ " <'t'>"));
}
- Table table2 = new Table(source, "test2");
+ Table table2 = new Table(jdbcConnectionProvider, "test2");
TableColumnAssert tableColumnAssert2 = assertThat(table2).column("var17");
try {
tableColumnAssert2.hasValues('T', 'T');
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnColumnEquality_HasValues_DateTimeValue_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnColumnEquality_HasValues_DateTimeValue_Test.java
index 5b5d454e..08fcdcbe 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnColumnEquality_HasValues_DateTimeValue_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnColumnEquality_HasValues_DateTimeValue_Test.java
@@ -29,6 +29,7 @@
* {@link org.assertj.db.api.assertions.AssertOnColumnEquality#hasValues(org.assertj.db.type.DateTimeValue...)} method.
*
* @author Régis Pouiller
+ * @author Julien Roy
*/
public class AssertOnColumnEquality_HasValues_DateTimeValue_Test extends AbstractTest {
@@ -37,7 +38,7 @@ public class AssertOnColumnEquality_HasValues_DateTimeValue_Test extends Abstrac
*/
@Test
public void test_has_values() throws Exception {
- Table table = new Table(source, "test");
+ Table table = new Table(jdbcConnectionProvider, "test");
TableColumnAssert tableColumnAssert = assertThat(table).column("var10");
TableColumnAssert tableColumnAssertReturn = tableColumnAssert.hasValues(
DateTimeValue.of(DateValue.of(2014, 5, 24), TimeValue.of(9, 46, 30)),
@@ -46,7 +47,7 @@ public void test_has_values() throws Exception {
DateTimeValue.of(DateValue.of(2014, 5, 30)));
Assertions.assertThat(tableColumnAssert).isSameAs(tableColumnAssertReturn);
- Table table2 = new Table(source, "test2");
+ Table table2 = new Table(jdbcConnectionProvider, "test2");
TableColumnAssert tableColumnAssert2 = assertThat(table2).column("var10");
TableColumnAssert tableColumnAssertReturn2 = tableColumnAssert2.hasValues(
DateTimeValue.of(DateValue.of(2014, 5, 24), TimeValue.of(9, 46, 30)),
@@ -73,7 +74,7 @@ public void test_has_values() throws Exception {
*/
@Test
public void should_fail_because_values_are_different() throws Exception {
- Table table = new Table(source, "test");
+ Table table = new Table(jdbcConnectionProvider, "test");
TableColumnAssert tableColumnAssert = assertThat(table).column("var10");
try {
tableColumnAssert.hasValues(DateTimeValue.of(DateValue.of(2014, 5, 24), TimeValue.of(9, 46, 30)),
@@ -88,7 +89,7 @@ public void should_fail_because_values_are_different() throws Exception {
+ "to be equal to: %n"
+ " <2014-05-30T13:29:49.000000000>"));
}
- Table table2 = new Table(source, "test2");
+ Table table2 = new Table(jdbcConnectionProvider, "test2");
TableColumnAssert tableColumnAssert2 = assertThat(table2).column("var10");
try {
tableColumnAssert2.hasValues(DateTimeValue.of(DateValue.of(2014, 5, 24), TimeValue.of(9, 46, 30)),
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnColumnEquality_HasValues_DateValue_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnColumnEquality_HasValues_DateValue_Test.java
index a25c480c..08de07ff 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnColumnEquality_HasValues_DateValue_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnColumnEquality_HasValues_DateValue_Test.java
@@ -28,6 +28,7 @@
* {@link org.assertj.db.api.assertions.AssertOnColumnEquality#hasValues(org.assertj.db.type.DateValue...)} method.
*
* @author Régis Pouiller
+ * @author Julien Roy
*/
public class AssertOnColumnEquality_HasValues_DateValue_Test extends AbstractTest {
@@ -38,7 +39,7 @@ public class AssertOnColumnEquality_HasValues_DateValue_Test extends AbstractTes
@NeedReload
public void test_has_values() throws Exception {
update("update test2 set var10 = '2014-05-24' where var1 = 1");
- Table table = new Table(source, "test");
+ Table table = new Table(jdbcConnectionProvider, "test");
TableColumnAssert tableColumnAssert = assertThat(table).column("var9");
TableColumnAssert tableColumnAssertReturn = tableColumnAssert.hasValues(
DateValue.of(2014, 5, 24),
@@ -47,7 +48,7 @@ public void test_has_values() throws Exception {
DateValue.of(2014, 5, 30));
Assertions.assertThat(tableColumnAssert).isSameAs(tableColumnAssertReturn);
- Table table2 = new Table(source, "test2");
+ Table table2 = new Table(jdbcConnectionProvider, "test2");
TableColumnAssert tableColumnAssert2 = assertThat(table2).column("var9");
TableColumnAssert tableColumnAssertReturn2 = tableColumnAssert2.hasValues(DateValue.of(2014, 5, 24),
null);
@@ -63,7 +64,7 @@ public void test_has_values() throws Exception {
*/
@Test
public void should_fail_because_values_are_different() throws Exception {
- Table table = new Table(source, "test");
+ Table table = new Table(jdbcConnectionProvider, "test");
TableColumnAssert tableColumnAssert = assertThat(table).column("var9");
try {
tableColumnAssert.hasValues(DateValue.of(2014, 5, 24),
@@ -78,7 +79,7 @@ public void should_fail_because_values_are_different() throws Exception {
+ "to be equal to: %n"
+ " <2014-05-29>"));
}
- Table table2 = new Table(source, "test2");
+ Table table2 = new Table(jdbcConnectionProvider, "test2");
TableColumnAssert tableColumnAssert2 = assertThat(table2).column("var9");
try {
tableColumnAssert2.hasValues(DateValue.of(2014, 5, 24),
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnColumnEquality_HasValues_Number_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnColumnEquality_HasValues_Number_Test.java
index ca13e0f5..22ea82e0 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnColumnEquality_HasValues_Number_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnColumnEquality_HasValues_Number_Test.java
@@ -26,6 +26,7 @@
* {@link org.assertj.db.api.assertions.AssertOnColumnEquality#hasValues(Number...)} method.
*
* @author Régis Pouiller
+ * @author Julien Roy
*/
public class AssertOnColumnEquality_HasValues_Number_Test extends AbstractTest {
@@ -34,12 +35,12 @@ public class AssertOnColumnEquality_HasValues_Number_Test extends AbstractTest {
*/
@Test
public void test_has_values() throws Exception {
- Table table = new Table(source, "test");
+ Table table = new Table(jdbcConnectionProvider, "test");
TableColumnAssert tableColumnAssert = assertThat(table).column("var3");
TableColumnAssert tableColumnAssertReturn = tableColumnAssert.hasValues(2, 20, 25, 0);
Assertions.assertThat(tableColumnAssert).isSameAs(tableColumnAssertReturn);
- Table table2 = new Table(source, "test2");
+ Table table2 = new Table(jdbcConnectionProvider, "test2");
TableColumnAssert tableColumnAssert2 = assertThat(table2).column("var3");
TableColumnAssert tableColumnAssertReturn2 = tableColumnAssert2.hasValues(2, null);
Assertions.assertThat(tableColumnAssert2).isSameAs(tableColumnAssertReturn2);
@@ -98,7 +99,7 @@ public void test_has_values() throws Exception {
*/
@Test
public void should_fail_because_values_are_different() throws Exception {
- Table table = new Table(source, "test");
+ Table table = new Table(jdbcConnectionProvider, "test");
TableColumnAssert tableColumnAssert = assertThat(table).column("var3");
try {
tableColumnAssert.hasValues(2, 20, 35, 0);
@@ -110,7 +111,7 @@ public void should_fail_because_values_are_different() throws Exception {
+ "to be equal to: %n"
+ " <35>"));
}
- Table table2 = new Table(source, "test2");
+ Table table2 = new Table(jdbcConnectionProvider, "test2");
TableColumnAssert tableColumnAssert2 = assertThat(table2).column("var3");
try {
tableColumnAssert2.hasValues(2, 2);
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnColumnEquality_HasValues_String_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnColumnEquality_HasValues_String_Test.java
index 2829f3ba..6a06df36 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnColumnEquality_HasValues_String_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnColumnEquality_HasValues_String_Test.java
@@ -27,6 +27,7 @@
* {@link org.assertj.db.api.assertions.AssertOnColumnEquality#hasValues(String...)} method.
*
* @author Régis Pouiller
+ * @author Julien Roy
*/
public class AssertOnColumnEquality_HasValues_String_Test extends AbstractTest {
@@ -36,12 +37,12 @@ public class AssertOnColumnEquality_HasValues_String_Test extends AbstractTest {
@Test
@NeedReload
public void test_has_values() throws Exception {
- Table table = new Table(source, "test");
+ Table table = new Table(jdbcConnectionProvider, "test");
TableColumnAssert tableColumnAssert = assertThat(table).column("var3");
TableColumnAssert tableColumnAssertReturn = tableColumnAssert.hasValues("2", "20", "25", "0");
Assertions.assertThat(tableColumnAssert).isSameAs(tableColumnAssertReturn);
- Table table2 = new Table(source, "test2");
+ Table table2 = new Table(jdbcConnectionProvider, "test2");
TableColumnAssert tableColumnAssert2 = assertThat(table2).column("var3");
TableColumnAssert tableColumnAssertReturn2 = tableColumnAssert2.hasValues("2", null);
Assertions.assertThat(tableColumnAssert2).isSameAs(tableColumnAssertReturn2);
@@ -154,7 +155,7 @@ public void test_has_values() throws Exception {
Assertions.assertThat(tableColumnAssert18).isSameAs(tableColumnAssertReturn18);
update("update test2 set var10 = '2014-05-24' where var1 = 1");
- table2 = new Table(source, "test2");
+ table2 = new Table(jdbcConnectionProvider, "test2");
TableColumnAssert tableColumnAssert19 = assertThat(table2).column("var10");
TableColumnAssert tableColumnAssertReturn19 = tableColumnAssert19.hasValues("2014-05-24",
null);
@@ -171,7 +172,7 @@ public void test_has_values() throws Exception {
*/
@Test
public void should_fail_because_values_are_different() throws Exception {
- Table table = new Table(source, "test");
+ Table table = new Table(jdbcConnectionProvider, "test");
TableColumnAssert tableColumnAssert = assertThat(table).column("var3");
try {
tableColumnAssert.hasValues("2", "20", "35", "0");
@@ -183,7 +184,7 @@ public void should_fail_because_values_are_different() throws Exception {
+ "to be equal to: %n"
+ " <\"35\">"));
}
- Table table2 = new Table(source, "test2");
+ Table table2 = new Table(jdbcConnectionProvider, "test2");
TableColumnAssert tableColumnAssert2 = assertThat(table2).column("var3");
try {
tableColumnAssert2.hasValues("2", "2");
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnColumnEquality_HasValues_TimeValue_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnColumnEquality_HasValues_TimeValue_Test.java
index 16bdbf15..df1b4b2e 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnColumnEquality_HasValues_TimeValue_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnColumnEquality_HasValues_TimeValue_Test.java
@@ -27,6 +27,7 @@
* {@link org.assertj.db.api.assertions.AssertOnColumnEquality#hasValues(org.assertj.db.type.TimeValue...)} method.
*
* @author Régis Pouiller
+ * @author Julien Roy
*/
public class AssertOnColumnEquality_HasValues_TimeValue_Test extends AbstractTest {
@@ -35,7 +36,7 @@ public class AssertOnColumnEquality_HasValues_TimeValue_Test extends AbstractTes
*/
@Test
public void test_has_values() throws Exception {
- Table table = new Table(source, "test");
+ Table table = new Table(jdbcConnectionProvider, "test");
TableColumnAssert tableColumnAssert = assertThat(table).column("var8");
TableColumnAssert tableColumnAssertReturn = tableColumnAssert.hasValues(TimeValue.of(9, 46, 30),
TimeValue.of(12, 29, 49),
@@ -43,7 +44,7 @@ public void test_has_values() throws Exception {
TimeValue.of(12, 29, 49));
Assertions.assertThat(tableColumnAssert).isSameAs(tableColumnAssertReturn);
- Table table2 = new Table(source, "test2");
+ Table table2 = new Table(jdbcConnectionProvider, "test2");
TableColumnAssert tableColumnAssert2 = assertThat(table2).column("var8");
TableColumnAssert tableColumnAssertReturn2 = tableColumnAssert2.hasValues(TimeValue.of(9, 46, 30), null);
Assertions.assertThat(tableColumnAssert2).isSameAs(tableColumnAssertReturn2);
@@ -54,7 +55,7 @@ public void test_has_values() throws Exception {
*/
@Test
public void should_fail_because_values_are_different() throws Exception {
- Table table = new Table(source, "test");
+ Table table = new Table(jdbcConnectionProvider, "test");
TableColumnAssert tableColumnAssert = assertThat(table).column("var8");
try {
tableColumnAssert.hasValues(TimeValue.of(12, 29, 49),
@@ -69,7 +70,7 @@ public void should_fail_because_values_are_different() throws Exception {
+ "to be equal to: %n"
+ " <12:29:49.000000000>"));
}
- Table table2 = new Table(source, "test2");
+ Table table2 = new Table(jdbcConnectionProvider, "test2");
TableColumnAssert tableColumnAssert2 = assertThat(table2).column("var8");
try {
tableColumnAssert2.hasValues(TimeValue.of(9, 46, 30),
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnColumnEquality_HasValues_UUID_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnColumnEquality_HasValues_UUID_Test.java
index d69796ff..adfc7262 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnColumnEquality_HasValues_UUID_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnColumnEquality_HasValues_UUID_Test.java
@@ -36,7 +36,7 @@ public class AssertOnColumnEquality_HasValues_UUID_Test extends AbstractTest {
*/
@Test
public void test_has_values() throws Exception {
- Table table = new Table(source, "test");
+ Table table = new Table(jdbcConnectionProvider, "test");
TableColumnAssert tableColumnAssert = assertThat(table).column("var15");
TableColumnAssert tableColumnAssertReturn = tableColumnAssert.hasValues(
UUID.fromString("30B443AE-C0C9-4790-9BEC-CE1380808435"),
@@ -46,7 +46,7 @@ public void test_has_values() throws Exception {
);
Assertions.assertThat(tableColumnAssert).isSameAs(tableColumnAssertReturn);
- Table table2 = new Table(source, "test2");
+ Table table2 = new Table(jdbcConnectionProvider, "test2");
TableColumnAssert tableColumnAssert2 = assertThat(table2).column("var16");
TableColumnAssert tableColumnAssertReturn2 = tableColumnAssert2
.hasValues(UUID.fromString("30B443AE-C0C9-4790-9BEC-CE1380808435"), null);
@@ -58,7 +58,7 @@ public void test_has_values() throws Exception {
*/
@Test
public void should_fail_because_values_are_different() throws Exception {
- Table table = new Table(source, "test");
+ Table table = new Table(jdbcConnectionProvider, "test");
TableColumnAssert tableColumnAssert = assertThat(table).column("var15");
try {
tableColumnAssert.hasValues(UUID.fromString("F96EC595-CE91-47CC-9152-CCC8AC48AAD6"),
@@ -74,7 +74,7 @@ public void should_fail_because_values_are_different() throws Exception {
+ "to be equal to: %n"
+ " "));
}
- Table table2 = new Table(source, "test2");
+ Table table2 = new Table(jdbcConnectionProvider, "test2");
TableColumnAssert tableColumnAssert2 = assertThat(table2).column("var16");
try {
tableColumnAssert2.hasValues(UUID.fromString("30B443AE-C0C9-4790-9BEC-CE1380808435"),
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnColumnName_HasColumnName_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnColumnName_HasColumnName_Test.java
index 4ca2e35b..7132241d 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnColumnName_HasColumnName_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnColumnName_HasColumnName_Test.java
@@ -33,6 +33,7 @@
* {@link AssertOnColumnName#hasColumnName(String)} method.
*
* @author Régis Pouiller
+ * @author Julien Roy
*/
public class AssertOnColumnName_HasColumnName_Test extends AbstractTest {
@@ -42,7 +43,7 @@ public class AssertOnColumnName_HasColumnName_Test extends AbstractTest {
@Test
@NeedReload
public void test_has_column_name() throws Exception {
- Changes changes = new Changes(source).setStartPointNow();
+ Changes changes = new Changes(jdbcConnectionProvider).setStartPointNow();
updateChangesForTests();
changes.setEndPointNow();
@@ -54,7 +55,7 @@ public void test_has_column_name() throws Exception {
ChangeRowValueAssert changeRowValueAssert2 = changeRowValueAssert.hasColumnName("id");
Assertions.assertThat(changeRowValueAssert).isSameAs(changeRowValueAssert2);
- Table table = new Table(source, "actor");
+ Table table = new Table(jdbcConnectionProvider, "actor");
TableAssert tableAssert = assertThat(table);
TableColumnAssert tableColumnAssert = tableAssert.column();
TableColumnAssert tableColumnAssert2 = tableColumnAssert.hasColumnName("id");
@@ -70,7 +71,7 @@ public void test_has_column_name() throws Exception {
@Test
@NeedReload
public void should_fail_because_column_name_is_different() throws Exception {
- Changes changes = new Changes(source).setStartPointNow();
+ Changes changes = new Changes(jdbcConnectionProvider).setStartPointNow();
updateChangesForTests();
changes.setEndPointNow();
@@ -79,7 +80,7 @@ public void should_fail_because_column_name_is_different() throws Exception {
changeAssert.column().hasColumnName("ID2");
fail("An exception must be raised");
} catch (AssertionError e) {
- Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Column at index 0 (column name : ID) of Change at index 0 (on table : ACTOR and with primary key : [4]) of Changes on tables of 'sa/jdbc:h2:mem:test' source] %n"
+ Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Column at index 0 (column name : ID) of Change at index 0 (on table : ACTOR and with primary key : [4]) of Changes on tables of 'sa/jdbc:h2:mem:test'] %n"
+ "Expecting :%n"
+ " \"ID2\"%n"
+ "to be the name of the column but was:%n"
@@ -89,14 +90,14 @@ public void should_fail_because_column_name_is_different() throws Exception {
changeAssert.rowAtEndPoint().value().hasColumnName("ID2");
fail("An exception must be raised");
} catch (AssertionError e) {
- Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Value at index 0 (column name : ID) of Row at end point of Change at index 0 (on table : ACTOR and with primary key : [4]) of Changes on tables of 'sa/jdbc:h2:mem:test' source] %n"
+ Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Value at index 0 (column name : ID) of Row at end point of Change at index 0 (on table : ACTOR and with primary key : [4]) of Changes on tables of 'sa/jdbc:h2:mem:test'] %n"
+ "Expecting :%n"
+ " \"ID2\"%n"
+ "to be the name of the column but was:%n"
+ " \"ID\""));
}
- Table table = new Table(source, "actor");
+ Table table = new Table(jdbcConnectionProvider, "actor");
TableAssert tableAssert = assertThat(table);
try {
tableAssert.column().hasColumnName("ID2");
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnColumnNullity_HasOnlyNotNullValues_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnColumnNullity_HasOnlyNotNullValues_Test.java
index b56dc5bb..6ff53c24 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnColumnNullity_HasOnlyNotNullValues_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnColumnNullity_HasOnlyNotNullValues_Test.java
@@ -26,6 +26,7 @@
* {@link org.assertj.db.api.assertions.AssertOnColumnNullity#hasOnlyNotNullValues()} method.
*
* @author Régis Pouiller
+ * @author Julien Roy
*/
public class AssertOnColumnNullity_HasOnlyNotNullValues_Test extends AbstractTest {
@@ -34,7 +35,7 @@ public class AssertOnColumnNullity_HasOnlyNotNullValues_Test extends AbstractTes
*/
@Test
public void test_has_only_not_null_values() {
- Table table = new Table(source, "test");
+ Table table = new Table(jdbcConnectionProvider, "test");
TableColumnAssert tableColumnAssert = assertThat(table).column("var14");
TableColumnAssert tableColumnAssert2 = tableColumnAssert.hasOnlyNotNullValues();
Assertions.assertThat(tableColumnAssert).isSameAs(tableColumnAssert2);
@@ -45,7 +46,7 @@ public void test_has_only_not_null_values() {
*/
@Test
public void should_fail_because_column_has_null_value() throws Exception {
- Table table = new Table(source, "test2");
+ Table table = new Table(jdbcConnectionProvider, "test2");
TableColumnAssert tableColumnAssert = assertThat(table).column("var14");
try {
tableColumnAssert.hasOnlyNotNullValues();
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnColumnNullity_HasOnlyNullValues_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnColumnNullity_HasOnlyNullValues_Test.java
index a5df95af..c8a6d2cd 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnColumnNullity_HasOnlyNullValues_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnColumnNullity_HasOnlyNullValues_Test.java
@@ -26,6 +26,7 @@
* {@link org.assertj.db.api.assertions.AssertOnColumnNullity#hasOnlyNullValues()} method.
*
* @author Régis Pouiller
+ * @author Julien Roy
*/
public class AssertOnColumnNullity_HasOnlyNullValues_Test extends AbstractTest {
@@ -34,7 +35,7 @@ public class AssertOnColumnNullity_HasOnlyNullValues_Test extends AbstractTest {
*/
@Test
public void test_has_only_null_values() {
- Table table = new Table(source, "test2");
+ Table table = new Table(jdbcConnectionProvider, "test2");
TableColumnAssert tableColumnAssert = assertThat(table).column("var15");
TableColumnAssert tableColumnAssert2 = tableColumnAssert.hasOnlyNullValues();
Assertions.assertThat(tableColumnAssert).isSameAs(tableColumnAssert2);
@@ -45,7 +46,7 @@ public void test_has_only_null_values() {
*/
@Test
public void should_fail_because_column_has_not_null_value() throws Exception {
- Table table = new Table(source, "test2");
+ Table table = new Table(jdbcConnectionProvider, "test2");
TableColumnAssert tableColumnAssert = assertThat(table).column("var14");
try {
tableColumnAssert.hasOnlyNullValues();
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnColumnOfChangeEquality_HasValues_One_Boolean_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnColumnOfChangeEquality_HasValues_One_Boolean_Test.java
index e501d5e3..07b192f9 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnColumnOfChangeEquality_HasValues_One_Boolean_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnColumnOfChangeEquality_HasValues_One_Boolean_Test.java
@@ -28,6 +28,7 @@
* {@link org.assertj.db.api.assertions.AssertOnColumnOfChangeEquality#hasValues(Boolean)} method.
*
* @author Régis Pouiller
+ * @author Julien Roy
*/
public class AssertOnColumnOfChangeEquality_HasValues_One_Boolean_Test extends AbstractTest {
@@ -37,7 +38,7 @@ public class AssertOnColumnOfChangeEquality_HasValues_One_Boolean_Test extends A
@Test
@NeedReload
public void test_have_values_equal_to() {
- Changes changes = new Changes(source).setStartPointNow();
+ Changes changes = new Changes(jdbcConnectionProvider).setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
changes.setEndPointNow();
@@ -53,7 +54,7 @@ public void test_have_values_equal_to() {
@Test
@NeedReload
public void should_fail_because_value_at_start_point_is_different() {
- Changes changes = new Changes(source).setStartPointNow();
+ Changes changes = new Changes(jdbcConnectionProvider).setStartPointNow();
update("insert into test(var1, var2) values(5, true)");
changes.setEndPointNow();
@@ -61,7 +62,7 @@ public void should_fail_because_value_at_start_point_is_different() {
assertThat(changes).change().column("var2").hasValues(true);
fail("An exception must be raised");
} catch (AssertionError e) {
- Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Column at index 1 (column name : VAR2) of Change at index 0 (on table : TEST and with primary key : [5]) of Changes on tables of 'sa/jdbc:h2:mem:test' source] %n"
+ Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Column at index 1 (column name : VAR2) of Change at index 0 (on table : TEST and with primary key : [5]) of Changes on tables of 'sa/jdbc:h2:mem:test'] %n"
+ "Expecting that start point:%n"
+ " %n"
+ "to be equal to: %n"
@@ -75,7 +76,7 @@ public void should_fail_because_value_at_start_point_is_different() {
@Test
@NeedReload
public void should_fail_because_value_at_end_point_is_different() {
- Changes changes = new Changes(source).setStartPointNow();
+ Changes changes = new Changes(jdbcConnectionProvider).setStartPointNow();
update("delete from test where var1 = 1");
changes.setEndPointNow();
@@ -83,7 +84,7 @@ public void should_fail_because_value_at_end_point_is_different() {
assertThat(changes).change().column("var2").hasValues(true);
fail("An exception must be raised");
} catch (AssertionError e) {
- Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Column at index 1 (column name : VAR2) of Change at index 0 (on table : TEST and with primary key : [1]) of Changes on tables of 'sa/jdbc:h2:mem:test' source] %n"
+ Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Column at index 1 (column name : VAR2) of Change at index 0 (on table : TEST and with primary key : [1]) of Changes on tables of 'sa/jdbc:h2:mem:test'] %n"
+ "Expecting that end point:%n"
+ " %n"
+ "to be equal to: %n"
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnColumnOfChangeEquality_HasValues_One_Bytes_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnColumnOfChangeEquality_HasValues_One_Bytes_Test.java
index d8d8ea74..4a76ede4 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnColumnOfChangeEquality_HasValues_One_Bytes_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnColumnOfChangeEquality_HasValues_One_Bytes_Test.java
@@ -29,6 +29,7 @@
* {@link org.assertj.db.api.assertions.AssertOnColumnOfChangeEquality#hasValues(byte[])} method.
*
* @author Régis Pouiller
+ * @author Julien Roy
*/
public class AssertOnColumnOfChangeEquality_HasValues_One_Bytes_Test extends AbstractTest {
@@ -40,7 +41,7 @@ public class AssertOnColumnOfChangeEquality_HasValues_One_Bytes_Test extends Abs
public void test_have_values_equal_to() {
byte[] bytesH2 = bytesContentFromClassPathOf("h2-logo-2.png");
- Changes changes = new Changes(source).setStartPointNow();
+ Changes changes = new Changes(jdbcConnectionProvider).setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
changes.setEndPointNow();
@@ -58,7 +59,7 @@ public void test_have_values_equal_to() {
public void should_fail_because_value_at_start_point_is_different() {
byte[] bytesH2 = bytesContentFromClassPathOf("h2-logo-2.png");
- Changes changes = new Changes(source).setStartPointNow();
+ Changes changes = new Changes(jdbcConnectionProvider).setStartPointNow();
update("insert into test(var1, var11) values(5, FILE_READ('classpath:h2-logo-2.png'))");
changes.setEndPointNow();
@@ -66,7 +67,7 @@ public void should_fail_because_value_at_start_point_is_different() {
assertThat(changes).change().column("var11").hasValues(bytesH2);
fail("An exception must be raised");
} catch (AssertionError e) {
- Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Column at index 10 (column name : VAR11) of Change at index 0 (on table : TEST and with primary key : [5]) of Changes on tables of 'sa/jdbc:h2:mem:test' source] %n"
+ Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Column at index 10 (column name : VAR11) of Change at index 0 (on table : TEST and with primary key : [5]) of Changes on tables of 'sa/jdbc:h2:mem:test'] %n"
+ "Expecting that start point to be equal to the expected value but was not equal"));
}
}
@@ -79,7 +80,7 @@ public void should_fail_because_value_at_start_point_is_different() {
public void should_fail_because_value_at_end_point_is_different() {
byte[] bytesH2 = bytesContentFromClassPathOf("h2-logo-2.png");
- Changes changes = new Changes(source).setStartPointNow();
+ Changes changes = new Changes(jdbcConnectionProvider).setStartPointNow();
update("delete from test where var1 = 1");
changes.setEndPointNow();
@@ -87,7 +88,7 @@ public void should_fail_because_value_at_end_point_is_different() {
assertThat(changes).change().column("var11").hasValues(bytesH2);
fail("An exception must be raised");
} catch (AssertionError e) {
- Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Column at index 10 (column name : VAR11) of Change at index 0 (on table : TEST and with primary key : [1]) of Changes on tables of 'sa/jdbc:h2:mem:test' source] %n"
+ Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Column at index 10 (column name : VAR11) of Change at index 0 (on table : TEST and with primary key : [1]) of Changes on tables of 'sa/jdbc:h2:mem:test'] %n"
+ "Expecting that end point to be equal to the expected value but was not equal"));
}
}
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnColumnOfChangeEquality_HasValues_One_DateTimeValue_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnColumnOfChangeEquality_HasValues_One_DateTimeValue_Test.java
index dc0b14c9..459de5c2 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnColumnOfChangeEquality_HasValues_One_DateTimeValue_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnColumnOfChangeEquality_HasValues_One_DateTimeValue_Test.java
@@ -31,6 +31,7 @@
* {@link org.assertj.db.api.assertions.AssertOnColumnOfChangeEquality#hasValues(org.assertj.db.type.DateTimeValue)} method.
*
* @author Régis Pouiller
+ * @author Julien Roy
*/
public class AssertOnColumnOfChangeEquality_HasValues_One_DateTimeValue_Test extends AbstractTest {
@@ -40,7 +41,7 @@ public class AssertOnColumnOfChangeEquality_HasValues_One_DateTimeValue_Test ext
@Test
@NeedReload
public void test_have_values_equal_to() {
- Changes changes = new Changes(source).setStartPointNow();
+ Changes changes = new Changes(jdbcConnectionProvider).setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
changes.setEndPointNow();
@@ -57,7 +58,7 @@ public void test_have_values_equal_to() {
@Test
@NeedReload
public void should_fail_because_value_at_start_point_is_different() {
- Changes changes = new Changes(source).setStartPointNow();
+ Changes changes = new Changes(jdbcConnectionProvider).setStartPointNow();
update("insert into test(var1, var10) values(5, '2014-05-24 09:46:30')");
changes.setEndPointNow();
@@ -66,7 +67,7 @@ public void should_fail_because_value_at_start_point_is_different() {
DateValue.of(2014, 5, 24), TimeValue.of(9, 46, 30)));
fail("An exception must be raised");
} catch (AssertionError e) {
- Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Column at index 9 (column name : VAR10) of Change at index 0 (on table : TEST and with primary key : [5]) of Changes on tables of 'sa/jdbc:h2:mem:test' source] %n"
+ Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Column at index 9 (column name : VAR10) of Change at index 0 (on table : TEST and with primary key : [5]) of Changes on tables of 'sa/jdbc:h2:mem:test'] %n"
+ "Expecting that start point:%n"
+ " %n"
+ "to be equal to: %n"
@@ -80,7 +81,7 @@ public void should_fail_because_value_at_start_point_is_different() {
@Test
@NeedReload
public void should_fail_because_value_at_end_point_is_different() {
- Changes changes = new Changes(source).setStartPointNow();
+ Changes changes = new Changes(jdbcConnectionProvider).setStartPointNow();
update("delete from test where var1 = 1");
changes.setEndPointNow();
@@ -89,7 +90,7 @@ public void should_fail_because_value_at_end_point_is_different() {
DateValue.of(2014, 5, 24), TimeValue.of(9, 46, 30)));
fail("An exception must be raised");
} catch (AssertionError e) {
- Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Column at index 9 (column name : VAR10) of Change at index 0 (on table : TEST and with primary key : [1]) of Changes on tables of 'sa/jdbc:h2:mem:test' source] %n"
+ Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Column at index 9 (column name : VAR10) of Change at index 0 (on table : TEST and with primary key : [1]) of Changes on tables of 'sa/jdbc:h2:mem:test'] %n"
+ "Expecting that end point:%n"
+ " %n"
+ "to be equal to: %n"
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnColumnOfChangeEquality_HasValues_One_DateValue_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnColumnOfChangeEquality_HasValues_One_DateValue_Test.java
index b8e868db..baac0c38 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnColumnOfChangeEquality_HasValues_One_DateValue_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnColumnOfChangeEquality_HasValues_One_DateValue_Test.java
@@ -29,6 +29,7 @@
* {@link org.assertj.db.api.assertions.AssertOnColumnOfChangeEquality#hasValues(org.assertj.db.type.DateValue)} method.
*
* @author Régis Pouiller
+ * @author Julien Roy
*/
public class AssertOnColumnOfChangeEquality_HasValues_One_DateValue_Test extends AbstractTest {
@@ -38,7 +39,7 @@ public class AssertOnColumnOfChangeEquality_HasValues_One_DateValue_Test extends
@Test
@NeedReload
public void test_have_values_equal_to() {
- Changes changes = new Changes(source).setStartPointNow();
+ Changes changes = new Changes(jdbcConnectionProvider).setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
changes.setEndPointNow();
@@ -54,7 +55,7 @@ public void test_have_values_equal_to() {
@Test
@NeedReload
public void should_fail_because_value_at_start_point_is_different() {
- Changes changes = new Changes(source).setStartPointNow();
+ Changes changes = new Changes(jdbcConnectionProvider).setStartPointNow();
update("insert into test(var1, var9) values(5, '2014-05-24')");
changes.setEndPointNow();
@@ -62,7 +63,7 @@ public void should_fail_because_value_at_start_point_is_different() {
assertThat(changes).change().column("var9").hasValues(DateValue.of(2014, 5, 24));
fail("An exception must be raised");
} catch (AssertionError e) {
- Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Column at index 8 (column name : VAR9) of Change at index 0 (on table : TEST and with primary key : [5]) of Changes on tables of 'sa/jdbc:h2:mem:test' source] %n"
+ Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Column at index 8 (column name : VAR9) of Change at index 0 (on table : TEST and with primary key : [5]) of Changes on tables of 'sa/jdbc:h2:mem:test'] %n"
+ "Expecting that start point:%n"
+ " %n"
+ "to be equal to: %n"
@@ -76,7 +77,7 @@ public void should_fail_because_value_at_start_point_is_different() {
@Test
@NeedReload
public void should_fail_because_value_at_end_point_is_different() {
- Changes changes = new Changes(source).setStartPointNow();
+ Changes changes = new Changes(jdbcConnectionProvider).setStartPointNow();
update("delete from test where var1 = 1");
changes.setEndPointNow();
@@ -84,7 +85,7 @@ public void should_fail_because_value_at_end_point_is_different() {
assertThat(changes).change().column("var9").hasValues(DateValue.of(2014, 5, 24));
fail("An exception must be raised");
} catch (AssertionError e) {
- Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Column at index 8 (column name : VAR9) of Change at index 0 (on table : TEST and with primary key : [1]) of Changes on tables of 'sa/jdbc:h2:mem:test' source] %n"
+ Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Column at index 8 (column name : VAR9) of Change at index 0 (on table : TEST and with primary key : [1]) of Changes on tables of 'sa/jdbc:h2:mem:test'] %n"
+ "Expecting that end point:%n"
+ " %n"
+ "to be equal to: %n"
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnColumnOfChangeEquality_HasValues_One_Number_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnColumnOfChangeEquality_HasValues_One_Number_Test.java
index 30dd2f4d..de0ede87 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnColumnOfChangeEquality_HasValues_One_Number_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnColumnOfChangeEquality_HasValues_One_Number_Test.java
@@ -28,6 +28,7 @@
* {@link org.assertj.db.api.assertions.AssertOnColumnOfChangeEquality#hasValues(Number)} method.
*
* @author Régis Pouiller
+ * @author Julien Roy
*/
public class AssertOnColumnOfChangeEquality_HasValues_One_Number_Test extends AbstractTest {
@@ -37,7 +38,7 @@ public class AssertOnColumnOfChangeEquality_HasValues_One_Number_Test extends Ab
@Test
@NeedReload
public void test_has_values() {
- Changes changes = new Changes(source).setStartPointNow();
+ Changes changes = new Changes(jdbcConnectionProvider).setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
changes.setEndPointNow();
@@ -53,7 +54,7 @@ public void test_has_values() {
@Test
@NeedReload
public void should_fail_because_value_at_start_point_is_different() {
- Changes changes = new Changes(source).setStartPointNow();
+ Changes changes = new Changes(jdbcConnectionProvider).setStartPointNow();
update("insert into test(var1, var3) values(5, 3)");
changes.setEndPointNow();
@@ -61,7 +62,7 @@ public void should_fail_because_value_at_start_point_is_different() {
assertThat(changes).change().column("var3").hasValues(3);
fail("An exception must be raised");
} catch (AssertionError e) {
- Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Column at index 2 (column name : VAR3) of Change at index 0 (on table : TEST and with primary key : [5]) of Changes on tables of 'sa/jdbc:h2:mem:test' source] %n"
+ Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Column at index 2 (column name : VAR3) of Change at index 0 (on table : TEST and with primary key : [5]) of Changes on tables of 'sa/jdbc:h2:mem:test'] %n"
+ "Expecting that start point:%n"
+ " %n"
+ "to be equal to: %n"
@@ -75,7 +76,7 @@ public void should_fail_because_value_at_start_point_is_different() {
@Test
@NeedReload
public void should_fail_because_value_at_end_point_is_different() {
- Changes changes = new Changes(source).setStartPointNow();
+ Changes changes = new Changes(jdbcConnectionProvider).setStartPointNow();
update("delete from test where var1 = 1");
changes.setEndPointNow();
@@ -83,7 +84,7 @@ public void should_fail_because_value_at_end_point_is_different() {
assertThat(changes).change().column("var3").hasValues(2);
fail("An exception must be raised");
} catch (AssertionError e) {
- Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Column at index 2 (column name : VAR3) of Change at index 0 (on table : TEST and with primary key : [1]) of Changes on tables of 'sa/jdbc:h2:mem:test' source] %n"
+ Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Column at index 2 (column name : VAR3) of Change at index 0 (on table : TEST and with primary key : [1]) of Changes on tables of 'sa/jdbc:h2:mem:test'] %n"
+ "Expecting that end point:%n"
+ " %n"
+ "to be equal to: %n"
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnColumnOfChangeEquality_HasValues_One_String_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnColumnOfChangeEquality_HasValues_One_String_Test.java
index 8a559f5d..213c162b 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnColumnOfChangeEquality_HasValues_One_String_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnColumnOfChangeEquality_HasValues_One_String_Test.java
@@ -28,6 +28,7 @@
* {@link org.assertj.db.api.assertions.AssertOnColumnOfChangeEquality#hasValues(String)} method.
*
* @author Régis Pouiller
+ * @author Julien Roy
*/
public class AssertOnColumnOfChangeEquality_HasValues_One_String_Test extends AbstractTest {
@@ -37,7 +38,7 @@ public class AssertOnColumnOfChangeEquality_HasValues_One_String_Test extends Ab
@Test
@NeedReload
public void test_has_values() {
- Changes changes = new Changes(source).setStartPointNow();
+ Changes changes = new Changes(jdbcConnectionProvider).setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
changes.setEndPointNow();
@@ -56,7 +57,7 @@ public void test_has_values() {
@Test
@NeedReload
public void should_fail_because_value_at_start_point_is_different() {
- Changes changes = new Changes(source).setStartPointNow();
+ Changes changes = new Changes(jdbcConnectionProvider).setStartPointNow();
update("insert into test(var1, var12, var15) values(5, 'test', '88838129-291E-40A9-A94C-A15BE36CF7C3')");
changes.setEndPointNow();
@@ -64,7 +65,7 @@ public void should_fail_because_value_at_start_point_is_different() {
assertThat(changes).change().column("var12").hasValues("test");
fail("An exception must be raised");
} catch (AssertionError e) {
- Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Column at index 11 (column name : VAR12) of Change at index 0 (on table : TEST and with primary key : [5]) of Changes on tables of 'sa/jdbc:h2:mem:test' source] %n"
+ Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Column at index 11 (column name : VAR12) of Change at index 0 (on table : TEST and with primary key : [5]) of Changes on tables of 'sa/jdbc:h2:mem:test'] %n"
+ "Expecting that start point:%n"
+ " %n"
+ "to be equal to: %n"
@@ -74,7 +75,7 @@ public void should_fail_because_value_at_start_point_is_different() {
assertThat(changes).change().column("var15").hasValues("88838129-291E-40A9-A94C-A15BE36CF7C3");
fail("An exception must be raised");
} catch (AssertionError e) {
- Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Column at index 14 (column name : VAR15) of Change at index 0 (on table : TEST and with primary key : [5]) of Changes on tables of 'sa/jdbc:h2:mem:test' source] %n"
+ Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Column at index 14 (column name : VAR15) of Change at index 0 (on table : TEST and with primary key : [5]) of Changes on tables of 'sa/jdbc:h2:mem:test'] %n"
+ "Expecting that start point:%n"
+ " %n"
+ "to be equal to: %n"
@@ -88,7 +89,7 @@ public void should_fail_because_value_at_start_point_is_different() {
@Test
@NeedReload
public void should_fail_because_value_at_end_point_is_different() {
- Changes changes = new Changes(source).setStartPointNow();
+ Changes changes = new Changes(jdbcConnectionProvider).setStartPointNow();
update("delete from test where var1 = 1");
changes.setEndPointNow();
@@ -96,7 +97,7 @@ public void should_fail_because_value_at_end_point_is_different() {
assertThat(changes).change().column("var12").hasValues("text");
fail("An exception must be raised");
} catch (AssertionError e) {
- Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Column at index 11 (column name : VAR12) of Change at index 0 (on table : TEST and with primary key : [1]) of Changes on tables of 'sa/jdbc:h2:mem:test' source] %n"
+ Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Column at index 11 (column name : VAR12) of Change at index 0 (on table : TEST and with primary key : [1]) of Changes on tables of 'sa/jdbc:h2:mem:test'] %n"
+ "Expecting that end point:%n"
+ " %n"
+ "to be equal to: %n"
@@ -106,7 +107,7 @@ public void should_fail_because_value_at_end_point_is_different() {
assertThat(changes).change().column("var15").hasValues("30B443AE-C0C9-4790-9BEC-CE1380808435");
fail("An exception must be raised");
} catch (AssertionError e) {
- Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Column at index 14 (column name : VAR15) of Change at index 0 (on table : TEST and with primary key : [1]) of Changes on tables of 'sa/jdbc:h2:mem:test' source] %n"
+ Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Column at index 14 (column name : VAR15) of Change at index 0 (on table : TEST and with primary key : [1]) of Changes on tables of 'sa/jdbc:h2:mem:test'] %n"
+ "Expecting that end point:%n"
+ " %n"
+ "to be equal to: %n"
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnColumnOfChangeEquality_HasValues_One_TimeValue_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnColumnOfChangeEquality_HasValues_One_TimeValue_Test.java
index 9a9410f4..eec9e11c 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnColumnOfChangeEquality_HasValues_One_TimeValue_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnColumnOfChangeEquality_HasValues_One_TimeValue_Test.java
@@ -29,6 +29,7 @@
* {@link org.assertj.db.api.assertions.AssertOnColumnOfChangeEquality#hasValues(org.assertj.db.type.TimeValue)} method.
*
* @author Régis Pouiller
+ * @author Julien Roy
*/
public class AssertOnColumnOfChangeEquality_HasValues_One_TimeValue_Test extends AbstractTest {
@@ -38,7 +39,7 @@ public class AssertOnColumnOfChangeEquality_HasValues_One_TimeValue_Test extends
@Test
@NeedReload
public void test_has_values() {
- Changes changes = new Changes(source).setStartPointNow();
+ Changes changes = new Changes(jdbcConnectionProvider).setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
changes.setEndPointNow();
@@ -54,7 +55,7 @@ public void test_has_values() {
@Test
@NeedReload
public void should_fail_because_value_at_start_point_is_different() {
- Changes changes = new Changes(source).setStartPointNow();
+ Changes changes = new Changes(jdbcConnectionProvider).setStartPointNow();
update("insert into test(var1, var8) values(5, '09:46:30')");
changes.setEndPointNow();
@@ -62,7 +63,7 @@ public void should_fail_because_value_at_start_point_is_different() {
assertThat(changes).change().column("var8").hasValues(TimeValue.of(9, 46, 30));
fail("An exception must be raised");
} catch (AssertionError e) {
- Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Column at index 7 (column name : VAR8) of Change at index 0 (on table : TEST and with primary key : [5]) of Changes on tables of 'sa/jdbc:h2:mem:test' source] %n"
+ Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Column at index 7 (column name : VAR8) of Change at index 0 (on table : TEST and with primary key : [5]) of Changes on tables of 'sa/jdbc:h2:mem:test'] %n"
+ "Expecting that start point:%n"
+ " %n"
+ "to be equal to: %n"
@@ -76,7 +77,7 @@ public void should_fail_because_value_at_start_point_is_different() {
@Test
@NeedReload
public void should_fail_because_value_at_end_point_is_different() {
- Changes changes = new Changes(source).setStartPointNow();
+ Changes changes = new Changes(jdbcConnectionProvider).setStartPointNow();
update("delete from test where var1 = 1");
changes.setEndPointNow();
@@ -84,7 +85,7 @@ public void should_fail_because_value_at_end_point_is_different() {
assertThat(changes).change().column("var8").hasValues(TimeValue.of(9, 46, 30));
fail("An exception must be raised");
} catch (AssertionError e) {
- Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Column at index 7 (column name : VAR8) of Change at index 0 (on table : TEST and with primary key : [1]) of Changes on tables of 'sa/jdbc:h2:mem:test' source] %n"
+ Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Column at index 7 (column name : VAR8) of Change at index 0 (on table : TEST and with primary key : [1]) of Changes on tables of 'sa/jdbc:h2:mem:test'] %n"
+ "Expecting that end point:%n"
+ " %n"
+ "to be equal to: %n"
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnColumnOfChangeEquality_HasValues_One_UUID_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnColumnOfChangeEquality_HasValues_One_UUID_Test.java
index f032a2c9..e06b9b27 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnColumnOfChangeEquality_HasValues_One_UUID_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnColumnOfChangeEquality_HasValues_One_UUID_Test.java
@@ -39,7 +39,7 @@ public class AssertOnColumnOfChangeEquality_HasValues_One_UUID_Test extends Abst
@Test
@NeedReload
public void test_have_values_equal_to() {
- Changes changes = new Changes(source).setStartPointNow();
+ Changes changes = new Changes(jdbcConnectionProvider).setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
changes.setEndPointNow();
@@ -56,7 +56,7 @@ public void test_have_values_equal_to() {
@Test
@NeedReload
public void should_fail_because_value_at_start_point_is_different() {
- Changes changes = new Changes(source).setStartPointNow();
+ Changes changes = new Changes(jdbcConnectionProvider).setStartPointNow();
update("insert into test(var1, var15) values(5, 'F96EC595-CE91-47CC-9152-CCC8AC48AAD6')");
changes.setEndPointNow();
@@ -65,7 +65,7 @@ public void should_fail_because_value_at_start_point_is_different() {
fail("An exception must be raised");
} catch (AssertionError e) {
Assertions.assertThat(e.getMessage()).isEqualTo(String.format(
- "[Column at index 14 (column name : VAR15) of Change at index 0 (on table : TEST and with primary key : [5]) of Changes on tables of 'sa/jdbc:h2:mem:test' source] %n"
+ "[Column at index 14 (column name : VAR15) of Change at index 0 (on table : TEST and with primary key : [5]) of Changes on tables of 'sa/jdbc:h2:mem:test'] %n"
+ "Expecting that start point:%n"
+ " %n"
+ "to be equal to: %n"
@@ -79,7 +79,7 @@ public void should_fail_because_value_at_start_point_is_different() {
@Test
@NeedReload
public void should_fail_because_value_at_end_point_is_different() {
- Changes changes = new Changes(source).setStartPointNow();
+ Changes changes = new Changes(jdbcConnectionProvider).setStartPointNow();
update("delete from test where var1 = 1");
changes.setEndPointNow();
@@ -88,7 +88,7 @@ public void should_fail_because_value_at_end_point_is_different() {
fail("An exception must be raised");
} catch (AssertionError e) {
Assertions.assertThat(e.getMessage()).isEqualTo(String.format(
- "[Column at index 14 (column name : VAR15) of Change at index 0 (on table : TEST and with primary key : [1]) of Changes on tables of 'sa/jdbc:h2:mem:test' source] %n"
+ "[Column at index 14 (column name : VAR15) of Change at index 0 (on table : TEST and with primary key : [1]) of Changes on tables of 'sa/jdbc:h2:mem:test'] %n"
+ "Expecting that end point:%n"
+ " %n"
+ "to be equal to: %n"
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnColumnOfChangeEquality_HasValues_Two_Boolean_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnColumnOfChangeEquality_HasValues_Two_Boolean_Test.java
index 5842676e..d1ddbf52 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnColumnOfChangeEquality_HasValues_Two_Boolean_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnColumnOfChangeEquality_HasValues_Two_Boolean_Test.java
@@ -12,9 +12,6 @@
*/
package org.assertj.db.api.assertions;
-import static org.assertj.db.api.Assertions.assertThat;
-import static org.junit.Assert.fail;
-
import org.assertj.core.api.Assertions;
import org.assertj.db.api.ChangeAssert;
import org.assertj.db.api.ChangeColumnAssert;
@@ -23,11 +20,15 @@
import org.assertj.db.type.Changes;
import org.junit.Test;
+import static org.assertj.db.api.Assertions.assertThat;
+import static org.junit.Assert.fail;
+
/**
* Tests on {@link org.assertj.db.api.assertions.AssertOnColumnOfChangeEquality} class :
* {@link org.assertj.db.api.assertions.AssertOnColumnOfChangeEquality#hasValues(Boolean, Boolean)} method.
*
* @author Régis Pouiller
+ * @author Julien Roy
*/
public class AssertOnColumnOfChangeEquality_HasValues_Two_Boolean_Test extends AbstractTest {
@@ -37,7 +38,7 @@ public class AssertOnColumnOfChangeEquality_HasValues_Two_Boolean_Test extends A
@Test
@NeedReload
public void test_has_values() {
- Changes changes = new Changes(source).setStartPointNow();
+ Changes changes = new Changes(jdbcConnectionProvider).setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
changes.setEndPointNow();
@@ -53,7 +54,7 @@ public void test_has_values() {
@Test
@NeedReload
public void should_fail_because_value_at_start_point_is_different() {
- Changes changes = new Changes(source).setStartPointNow();
+ Changes changes = new Changes(jdbcConnectionProvider).setStartPointNow();
update("insert into test(var1, var2) values(5, true)");
changes.setEndPointNow();
@@ -61,7 +62,7 @@ public void should_fail_because_value_at_start_point_is_different() {
assertThat(changes).change().column("var2").hasValues(true, true);
fail("An exception must be raised");
} catch (AssertionError e) {
- Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Column at index 1 (column name : VAR2) of Change at index 0 (on table : TEST and with primary key : [5]) of Changes on tables of 'sa/jdbc:h2:mem:test' source] %n"
+ Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Column at index 1 (column name : VAR2) of Change at index 0 (on table : TEST and with primary key : [5]) of Changes on tables of 'sa/jdbc:h2:mem:test'] %n"
+ "Expecting that start point:%n"
+ " %n"
+ "to be equal to: %n"
@@ -75,7 +76,7 @@ public void should_fail_because_value_at_start_point_is_different() {
@Test
@NeedReload
public void should_fail_because_value_at_end_point_is_different() {
- Changes changes = new Changes(source).setStartPointNow();
+ Changes changes = new Changes(jdbcConnectionProvider).setStartPointNow();
update("delete from test where var1 = 1");
changes.setEndPointNow();
@@ -83,7 +84,7 @@ public void should_fail_because_value_at_end_point_is_different() {
assertThat(changes).change().column("var2").hasValues(true, true);
fail("An exception must be raised");
} catch (AssertionError e) {
- Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Column at index 1 (column name : VAR2) of Change at index 0 (on table : TEST and with primary key : [1]) of Changes on tables of 'sa/jdbc:h2:mem:test' source] %n"
+ Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Column at index 1 (column name : VAR2) of Change at index 0 (on table : TEST and with primary key : [1]) of Changes on tables of 'sa/jdbc:h2:mem:test'] %n"
+ "Expecting that end point:%n"
+ " %n"
+ "to be equal to: %n"
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnColumnOfChangeEquality_HasValues_Two_Bytes_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnColumnOfChangeEquality_HasValues_Two_Bytes_Test.java
index 6c94a8fa..642704d0 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnColumnOfChangeEquality_HasValues_Two_Bytes_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnColumnOfChangeEquality_HasValues_Two_Bytes_Test.java
@@ -29,6 +29,7 @@
* {@link org.assertj.db.api.assertions.AssertOnColumnOfChangeEquality#hasValues(byte[], byte[])} method.
*
* @author Régis Pouiller
+ * @author Julien Roy
*/
public class AssertOnColumnOfChangeEquality_HasValues_Two_Bytes_Test extends AbstractTest {
@@ -40,7 +41,7 @@ public class AssertOnColumnOfChangeEquality_HasValues_Two_Bytes_Test extends Abs
public void test_has_values() {
byte[] bytesH2 = bytesContentFromClassPathOf("h2-logo-2.png");
- Changes changes = new Changes(source).setStartPointNow();
+ Changes changes = new Changes(jdbcConnectionProvider).setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
changes.setEndPointNow();
@@ -58,7 +59,7 @@ public void test_has_values() {
public void should_fail_because_value_at_start_point_is_different() {
byte[] bytesH2 = bytesContentFromClassPathOf("h2-logo-2.png");
- Changes changes = new Changes(source).setStartPointNow();
+ Changes changes = new Changes(jdbcConnectionProvider).setStartPointNow();
update("insert into test(var1, var11) values(5, FILE_READ('classpath:h2-logo-2.png'))");
changes.setEndPointNow();
@@ -66,7 +67,7 @@ public void should_fail_because_value_at_start_point_is_different() {
assertThat(changes).change().column("var11").hasValues(bytesH2, bytesH2);
fail("An exception must be raised");
} catch (AssertionError e) {
- Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Column at index 10 (column name : VAR11) of Change at index 0 (on table : TEST and with primary key : [5]) of Changes on tables of 'sa/jdbc:h2:mem:test' source] %n"
+ Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Column at index 10 (column name : VAR11) of Change at index 0 (on table : TEST and with primary key : [5]) of Changes on tables of 'sa/jdbc:h2:mem:test'] %n"
+ "Expecting that start point to be equal to the expected value but was not equal"));
}
}
@@ -79,7 +80,7 @@ public void should_fail_because_value_at_start_point_is_different() {
public void should_fail_because_value_at_end_point_is_different() {
byte[] bytesH2 = bytesContentFromClassPathOf("h2-logo-2.png");
- Changes changes = new Changes(source).setStartPointNow();
+ Changes changes = new Changes(jdbcConnectionProvider).setStartPointNow();
update("delete from test where var1 = 1");
changes.setEndPointNow();
@@ -87,7 +88,7 @@ public void should_fail_because_value_at_end_point_is_different() {
assertThat(changes).change().column("var11").hasValues(bytesH2, bytesH2);
fail("An exception must be raised");
} catch (AssertionError e) {
- Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Column at index 10 (column name : VAR11) of Change at index 0 (on table : TEST and with primary key : [1]) of Changes on tables of 'sa/jdbc:h2:mem:test' source] %n"
+ Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Column at index 10 (column name : VAR11) of Change at index 0 (on table : TEST and with primary key : [1]) of Changes on tables of 'sa/jdbc:h2:mem:test'] %n"
+ "Expecting that end point to be equal to the expected value but was not equal"));
}
}
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnColumnOfChangeEquality_HasValues_Two_Character_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnColumnOfChangeEquality_HasValues_Two_Character_Test.java
index 85e1623e..9a2b29e6 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnColumnOfChangeEquality_HasValues_Two_Character_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnColumnOfChangeEquality_HasValues_Two_Character_Test.java
@@ -28,6 +28,7 @@
* {@link org.assertj.db.api.assertions.AssertOnColumnOfChangeEquality#hasValues(Character, Character)} method.
*
* @author Régis Pouiller
+ * @author Julien Roy
*/
public class AssertOnColumnOfChangeEquality_HasValues_Two_Character_Test extends AbstractTest {
@@ -37,7 +38,7 @@ public class AssertOnColumnOfChangeEquality_HasValues_Two_Character_Test extends
@Test
@NeedReload
public void test_has_values() {
- Changes changes = new Changes(source).setStartPointNow();
+ Changes changes = new Changes(jdbcConnectionProvider).setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
changes.setEndPointNow();
@@ -53,7 +54,7 @@ public void test_has_values() {
@Test
@NeedReload
public void should_fail_because_value_at_start_point_is_different() {
- Changes changes = new Changes(source).setStartPointNow();
+ Changes changes = new Changes(jdbcConnectionProvider).setStartPointNow();
update("insert into test(var1, var2) values(5, true)");
changes.setEndPointNow();
@@ -61,7 +62,7 @@ public void should_fail_because_value_at_start_point_is_different() {
assertThat(changes).change().column("var16").hasValues('T', 'T');
fail("An exception must be raised");
} catch (AssertionError e) {
- Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Column at index 15 (column name : VAR16) of Change at index 0 (on table : TEST and with primary key : [5]) of Changes on tables of 'sa/jdbc:h2:mem:test' source] %n"
+ Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Column at index 15 (column name : VAR16) of Change at index 0 (on table : TEST and with primary key : [5]) of Changes on tables of 'sa/jdbc:h2:mem:test'] %n"
+ "Expecting that start point:%n"
+ " %n"
+ "to be equal to: %n"
@@ -75,7 +76,7 @@ public void should_fail_because_value_at_start_point_is_different() {
@Test
@NeedReload
public void should_fail_because_value_at_end_point_is_different() {
- Changes changes = new Changes(source).setStartPointNow();
+ Changes changes = new Changes(jdbcConnectionProvider).setStartPointNow();
update("delete from test where var1 = 1");
changes.setEndPointNow();
@@ -83,7 +84,7 @@ public void should_fail_because_value_at_end_point_is_different() {
assertThat(changes).change().column("var16").hasValues('T', 'T');
fail("An exception must be raised");
} catch (AssertionError e) {
- Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Column at index 15 (column name : VAR16) of Change at index 0 (on table : TEST and with primary key : [1]) of Changes on tables of 'sa/jdbc:h2:mem:test' source] %n"
+ Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Column at index 15 (column name : VAR16) of Change at index 0 (on table : TEST and with primary key : [1]) of Changes on tables of 'sa/jdbc:h2:mem:test'] %n"
+ "Expecting that end point:%n"
+ " %n"
+ "to be equal to: %n"
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnColumnOfChangeEquality_HasValues_Two_DateTimeValue_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnColumnOfChangeEquality_HasValues_Two_DateTimeValue_Test.java
index 224914e0..67f70f2c 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnColumnOfChangeEquality_HasValues_Two_DateTimeValue_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnColumnOfChangeEquality_HasValues_Two_DateTimeValue_Test.java
@@ -31,6 +31,7 @@
* {@link org.assertj.db.api.assertions.AssertOnColumnOfChangeEquality#hasValues(org.assertj.db.type.DateTimeValue, org.assertj.db.type.DateTimeValue)} method.
*
* @author Régis Pouiller
+ * @author Julien Roy
*/
public class AssertOnColumnOfChangeEquality_HasValues_Two_DateTimeValue_Test extends AbstractTest {
@@ -40,7 +41,7 @@ public class AssertOnColumnOfChangeEquality_HasValues_Two_DateTimeValue_Test ext
@Test
@NeedReload
public void test_has_values() {
- Changes changes = new Changes(source).setStartPointNow();
+ Changes changes = new Changes(jdbcConnectionProvider).setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
changes.setEndPointNow();
@@ -58,7 +59,7 @@ public void test_has_values() {
@Test
@NeedReload
public void should_fail_because_value_at_start_point_is_different() {
- Changes changes = new Changes(source).setStartPointNow();
+ Changes changes = new Changes(jdbcConnectionProvider).setStartPointNow();
update("insert into test(var1, var10) values(5, '2014-05-24 09:46:30')");
changes.setEndPointNow();
@@ -68,7 +69,7 @@ public void should_fail_because_value_at_start_point_is_different() {
DateValue.of(2014, 5, 24), TimeValue.of(9, 46, 30)));
fail("An exception must be raised");
} catch (AssertionError e) {
- Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Column at index 9 (column name : VAR10) of Change at index 0 (on table : TEST and with primary key : [5]) of Changes on tables of 'sa/jdbc:h2:mem:test' source] %n"
+ Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Column at index 9 (column name : VAR10) of Change at index 0 (on table : TEST and with primary key : [5]) of Changes on tables of 'sa/jdbc:h2:mem:test'] %n"
+ "Expecting that start point:%n"
+ " %n"
+ "to be equal to: %n"
@@ -82,7 +83,7 @@ public void should_fail_because_value_at_start_point_is_different() {
@Test
@NeedReload
public void should_fail_because_value_at_end_point_is_different() {
- Changes changes = new Changes(source).setStartPointNow();
+ Changes changes = new Changes(jdbcConnectionProvider).setStartPointNow();
update("delete from test where var1 = 1");
changes.setEndPointNow();
@@ -92,7 +93,7 @@ public void should_fail_because_value_at_end_point_is_different() {
DateValue.of(2014, 5, 24), TimeValue.of(9, 46, 30)));
fail("An exception must be raised");
} catch (AssertionError e) {
- Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Column at index 9 (column name : VAR10) of Change at index 0 (on table : TEST and with primary key : [1]) of Changes on tables of 'sa/jdbc:h2:mem:test' source] %n"
+ Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Column at index 9 (column name : VAR10) of Change at index 0 (on table : TEST and with primary key : [1]) of Changes on tables of 'sa/jdbc:h2:mem:test'] %n"
+ "Expecting that end point:%n"
+ " %n"
+ "to be equal to: %n"
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnColumnOfChangeEquality_HasValues_Two_DateValue_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnColumnOfChangeEquality_HasValues_Two_DateValue_Test.java
index 985a407b..097ccc59 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnColumnOfChangeEquality_HasValues_Two_DateValue_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnColumnOfChangeEquality_HasValues_Two_DateValue_Test.java
@@ -29,6 +29,7 @@
* {@link org.assertj.db.api.assertions.AssertOnColumnOfChangeEquality#hasValues(org.assertj.db.type.DateValue, org.assertj.db.type.DateValue)} method.
*
* @author Régis Pouiller
+ * @author Julien Roy
*/
public class AssertOnColumnOfChangeEquality_HasValues_Two_DateValue_Test extends AbstractTest {
@@ -38,7 +39,7 @@ public class AssertOnColumnOfChangeEquality_HasValues_Two_DateValue_Test extends
@Test
@NeedReload
public void test_has_values() {
- Changes changes = new Changes(source).setStartPointNow();
+ Changes changes = new Changes(jdbcConnectionProvider).setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
changes.setEndPointNow();
@@ -55,7 +56,7 @@ public void test_has_values() {
@Test
@NeedReload
public void should_fail_because_value_at_start_point_is_different() {
- Changes changes = new Changes(source).setStartPointNow();
+ Changes changes = new Changes(jdbcConnectionProvider).setStartPointNow();
update("insert into test(var1, var9) values(5, '2014-05-24')");
changes.setEndPointNow();
@@ -63,7 +64,7 @@ public void should_fail_because_value_at_start_point_is_different() {
assertThat(changes).change().column("var9").hasValues(DateValue.of(2014, 5, 24), DateValue.of(2014, 5, 24));
fail("An exception must be raised");
} catch (AssertionError e) {
- Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Column at index 8 (column name : VAR9) of Change at index 0 (on table : TEST and with primary key : [5]) of Changes on tables of 'sa/jdbc:h2:mem:test' source] %n"
+ Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Column at index 8 (column name : VAR9) of Change at index 0 (on table : TEST and with primary key : [5]) of Changes on tables of 'sa/jdbc:h2:mem:test'] %n"
+ "Expecting that start point:%n"
+ " %n"
+ "to be equal to: %n"
@@ -77,7 +78,7 @@ public void should_fail_because_value_at_start_point_is_different() {
@Test
@NeedReload
public void should_fail_because_value_at_end_point_is_different() {
- Changes changes = new Changes(source).setStartPointNow();
+ Changes changes = new Changes(jdbcConnectionProvider).setStartPointNow();
update("delete from test where var1 = 1");
changes.setEndPointNow();
@@ -85,7 +86,7 @@ public void should_fail_because_value_at_end_point_is_different() {
assertThat(changes).change().column("var9").hasValues(DateValue.of(2014, 5, 24), DateValue.of(2014, 5, 24));
fail("An exception must be raised");
} catch (AssertionError e) {
- Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Column at index 8 (column name : VAR9) of Change at index 0 (on table : TEST and with primary key : [1]) of Changes on tables of 'sa/jdbc:h2:mem:test' source] %n"
+ Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Column at index 8 (column name : VAR9) of Change at index 0 (on table : TEST and with primary key : [1]) of Changes on tables of 'sa/jdbc:h2:mem:test'] %n"
+ "Expecting that end point:%n"
+ " %n"
+ "to be equal to: %n"
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnColumnOfChangeEquality_HasValues_Two_Number_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnColumnOfChangeEquality_HasValues_Two_Number_Test.java
index 599e8c80..756b4a11 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnColumnOfChangeEquality_HasValues_Two_Number_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnColumnOfChangeEquality_HasValues_Two_Number_Test.java
@@ -28,6 +28,7 @@
* {@link org.assertj.db.api.assertions.AssertOnColumnOfChangeEquality#hasValues(Number, Number)} method.
*
* @author Régis Pouiller
+ * @author Julien Roy
*/
public class AssertOnColumnOfChangeEquality_HasValues_Two_Number_Test extends AbstractTest {
@@ -37,7 +38,7 @@ public class AssertOnColumnOfChangeEquality_HasValues_Two_Number_Test extends Ab
@Test
@NeedReload
public void test_has_values() {
- Changes changes = new Changes(source).setStartPointNow();
+ Changes changes = new Changes(jdbcConnectionProvider).setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
changes.setEndPointNow();
@@ -53,7 +54,7 @@ public void test_has_values() {
@Test
@NeedReload
public void should_fail_because_value_at_start_point_is_different() {
- Changes changes = new Changes(source).setStartPointNow();
+ Changes changes = new Changes(jdbcConnectionProvider).setStartPointNow();
update("insert into test(var1, var3) values(5, 3)");
changes.setEndPointNow();
@@ -61,7 +62,7 @@ public void should_fail_because_value_at_start_point_is_different() {
assertThat(changes).change().column("var3").hasValues(3, 3);
fail("An exception must be raised");
} catch (AssertionError e) {
- Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Column at index 2 (column name : VAR3) of Change at index 0 (on table : TEST and with primary key : [5]) of Changes on tables of 'sa/jdbc:h2:mem:test' source] %n"
+ Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Column at index 2 (column name : VAR3) of Change at index 0 (on table : TEST and with primary key : [5]) of Changes on tables of 'sa/jdbc:h2:mem:test'] %n"
+ "Expecting that start point:%n"
+ " %n"
+ "to be equal to: %n"
@@ -75,7 +76,7 @@ public void should_fail_because_value_at_start_point_is_different() {
@Test
@NeedReload
public void should_fail_because_value_at_end_point_is_different() {
- Changes changes = new Changes(source).setStartPointNow();
+ Changes changes = new Changes(jdbcConnectionProvider).setStartPointNow();
update("delete from test where var1 = 1");
changes.setEndPointNow();
@@ -83,7 +84,7 @@ public void should_fail_because_value_at_end_point_is_different() {
assertThat(changes).change().column("var3").hasValues(2, 2);
fail("An exception must be raised");
} catch (AssertionError e) {
- Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Column at index 2 (column name : VAR3) of Change at index 0 (on table : TEST and with primary key : [1]) of Changes on tables of 'sa/jdbc:h2:mem:test' source] %n"
+ Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Column at index 2 (column name : VAR3) of Change at index 0 (on table : TEST and with primary key : [1]) of Changes on tables of 'sa/jdbc:h2:mem:test'] %n"
+ "Expecting that end point:%n"
+ " %n"
+ "to be equal to: %n"
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnColumnOfChangeEquality_HasValues_Two_String_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnColumnOfChangeEquality_HasValues_Two_String_Test.java
index 1718cc24..e0193752 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnColumnOfChangeEquality_HasValues_Two_String_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnColumnOfChangeEquality_HasValues_Two_String_Test.java
@@ -28,6 +28,7 @@
* {@link org.assertj.db.api.assertions.AssertOnColumnOfChangeEquality#hasValues(String, String)} method.
*
* @author Régis Pouiller
+ * @author Julien Roy
*/
public class AssertOnColumnOfChangeEquality_HasValues_Two_String_Test extends AbstractTest {
@@ -37,7 +38,7 @@ public class AssertOnColumnOfChangeEquality_HasValues_Two_String_Test extends Ab
@Test
@NeedReload
public void test_has_values() {
- Changes changes = new Changes(source).setStartPointNow();
+ Changes changes = new Changes(jdbcConnectionProvider).setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
changes.setEndPointNow();
@@ -56,7 +57,7 @@ public void test_has_values() {
@Test
@NeedReload
public void should_fail_because_value_at_start_point_is_different() {
- Changes changes = new Changes(source).setStartPointNow();
+ Changes changes = new Changes(jdbcConnectionProvider).setStartPointNow();
update("insert into test(var1, var12, var15) values(5, 'test', '88838129-291E-40A9-A94C-A15BE36CF7C3')");
changes.setEndPointNow();
@@ -64,7 +65,7 @@ public void should_fail_because_value_at_start_point_is_different() {
assertThat(changes).change().column("var12").hasValues("test", "test");
fail("An exception must be raised");
} catch (AssertionError e) {
- Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Column at index 11 (column name : VAR12) of Change at index 0 (on table : TEST and with primary key : [5]) of Changes on tables of 'sa/jdbc:h2:mem:test' source] %n"
+ Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Column at index 11 (column name : VAR12) of Change at index 0 (on table : TEST and with primary key : [5]) of Changes on tables of 'sa/jdbc:h2:mem:test'] %n"
+ "Expecting that start point:%n"
+ " %n"
+ "to be equal to: %n"
@@ -74,7 +75,7 @@ public void should_fail_because_value_at_start_point_is_different() {
assertThat(changes).change().column("var15").hasValues("88838129-291E-40A9-A94C-A15BE36CF7C3", "88838129-291E-40A9-A94C-A15BE36CF7C3");
fail("An exception must be raised");
} catch (AssertionError e) {
- Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Column at index 14 (column name : VAR15) of Change at index 0 (on table : TEST and with primary key : [5]) of Changes on tables of 'sa/jdbc:h2:mem:test' source] %n"
+ Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Column at index 14 (column name : VAR15) of Change at index 0 (on table : TEST and with primary key : [5]) of Changes on tables of 'sa/jdbc:h2:mem:test'] %n"
+ "Expecting that start point:%n"
+ " %n"
+ "to be equal to: %n"
@@ -88,7 +89,7 @@ public void should_fail_because_value_at_start_point_is_different() {
@Test
@NeedReload
public void should_fail_because_value_at_end_point_is_different() {
- Changes changes = new Changes(source).setStartPointNow();
+ Changes changes = new Changes(jdbcConnectionProvider).setStartPointNow();
update("delete from test where var1 = 1");
changes.setEndPointNow();
@@ -96,7 +97,7 @@ public void should_fail_because_value_at_end_point_is_different() {
assertThat(changes).change().column("var12").hasValues("text", "text");
fail("An exception must be raised");
} catch (AssertionError e) {
- Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Column at index 11 (column name : VAR12) of Change at index 0 (on table : TEST and with primary key : [1]) of Changes on tables of 'sa/jdbc:h2:mem:test' source] %n"
+ Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Column at index 11 (column name : VAR12) of Change at index 0 (on table : TEST and with primary key : [1]) of Changes on tables of 'sa/jdbc:h2:mem:test'] %n"
+ "Expecting that end point:%n"
+ " %n"
+ "to be equal to: %n"
@@ -106,7 +107,7 @@ public void should_fail_because_value_at_end_point_is_different() {
assertThat(changes).change().column("var15").hasValues("30B443AE-C0C9-4790-9BEC-CE1380808435", "30B443AE-C0C9-4790-9BEC-CE1380808435");
fail("An exception must be raised");
} catch (AssertionError e) {
- Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Column at index 14 (column name : VAR15) of Change at index 0 (on table : TEST and with primary key : [1]) of Changes on tables of 'sa/jdbc:h2:mem:test' source] %n"
+ Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Column at index 14 (column name : VAR15) of Change at index 0 (on table : TEST and with primary key : [1]) of Changes on tables of 'sa/jdbc:h2:mem:test'] %n"
+ "Expecting that end point:%n"
+ " %n"
+ "to be equal to: %n"
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnColumnOfChangeEquality_HasValues_Two_TimeValue_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnColumnOfChangeEquality_HasValues_Two_TimeValue_Test.java
index aa8f046b..6d07f3b5 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnColumnOfChangeEquality_HasValues_Two_TimeValue_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnColumnOfChangeEquality_HasValues_Two_TimeValue_Test.java
@@ -29,6 +29,7 @@
* {@link org.assertj.db.api.assertions.AssertOnColumnOfChangeEquality#hasValues(org.assertj.db.type.TimeValue, org.assertj.db.type.TimeValue)} method.
*
* @author Régis Pouiller
+ * @author Julien Roy
*/
public class AssertOnColumnOfChangeEquality_HasValues_Two_TimeValue_Test extends AbstractTest {
@@ -38,7 +39,7 @@ public class AssertOnColumnOfChangeEquality_HasValues_Two_TimeValue_Test extends
@Test
@NeedReload
public void test_has_values() {
- Changes changes = new Changes(source).setStartPointNow();
+ Changes changes = new Changes(jdbcConnectionProvider).setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
changes.setEndPointNow();
@@ -55,7 +56,7 @@ public void test_has_values() {
@Test
@NeedReload
public void should_fail_because_value_at_start_point_is_different() {
- Changes changes = new Changes(source).setStartPointNow();
+ Changes changes = new Changes(jdbcConnectionProvider).setStartPointNow();
update("insert into test(var1, var8) values(5, '09:46:30')");
changes.setEndPointNow();
@@ -63,7 +64,7 @@ public void should_fail_because_value_at_start_point_is_different() {
assertThat(changes).change().column("var8").hasValues(TimeValue.of(9, 46, 30), TimeValue.of(9, 46, 30));
fail("An exception must be raised");
} catch (AssertionError e) {
- Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Column at index 7 (column name : VAR8) of Change at index 0 (on table : TEST and with primary key : [5]) of Changes on tables of 'sa/jdbc:h2:mem:test' source] %n"
+ Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Column at index 7 (column name : VAR8) of Change at index 0 (on table : TEST and with primary key : [5]) of Changes on tables of 'sa/jdbc:h2:mem:test'] %n"
+ "Expecting that start point:%n"
+ " %n"
+ "to be equal to: %n"
@@ -77,7 +78,7 @@ public void should_fail_because_value_at_start_point_is_different() {
@Test
@NeedReload
public void should_fail_because_value_at_end_point_is_different() {
- Changes changes = new Changes(source).setStartPointNow();
+ Changes changes = new Changes(jdbcConnectionProvider).setStartPointNow();
update("delete from test where var1 = 1");
changes.setEndPointNow();
@@ -85,7 +86,7 @@ public void should_fail_because_value_at_end_point_is_different() {
assertThat(changes).change().column("var8").hasValues(TimeValue.of(9, 46, 30), TimeValue.of(9, 46, 30));
fail("An exception must be raised");
} catch (AssertionError e) {
- Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Column at index 7 (column name : VAR8) of Change at index 0 (on table : TEST and with primary key : [1]) of Changes on tables of 'sa/jdbc:h2:mem:test' source] %n"
+ Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Column at index 7 (column name : VAR8) of Change at index 0 (on table : TEST and with primary key : [1]) of Changes on tables of 'sa/jdbc:h2:mem:test'] %n"
+ "Expecting that end point:%n"
+ " %n"
+ "to be equal to: %n"
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnColumnOfChangeEquality_HasValues_Two_UUID_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnColumnOfChangeEquality_HasValues_Two_UUID_Test.java
index 50ff516e..a8e4c693 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnColumnOfChangeEquality_HasValues_Two_UUID_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnColumnOfChangeEquality_HasValues_Two_UUID_Test.java
@@ -39,7 +39,7 @@ public class AssertOnColumnOfChangeEquality_HasValues_Two_UUID_Test extends Abst
@Test
@NeedReload
public void test_has_values() {
- Changes changes = new Changes(source).setStartPointNow();
+ Changes changes = new Changes(jdbcConnectionProvider).setStartPointNow();
update("update test set var15 = '0E2A1269-EFF0-4233-B87B-B53E8B6F164D' where var1 = 1");
changes.setEndPointNow();
@@ -57,7 +57,7 @@ public void test_has_values() {
@Test
@NeedReload
public void should_fail_because_value_at_start_point_is_different() {
- Changes changes = new Changes(source).setStartPointNow();
+ Changes changes = new Changes(jdbcConnectionProvider).setStartPointNow();
update("insert into test(var1, var15) values(5, '0E2A1269-EFF0-4233-B87B-B53E8B6F164D')");
changes.setEndPointNow();
@@ -67,7 +67,7 @@ public void should_fail_because_value_at_start_point_is_different() {
fail("An exception must be raised");
} catch (AssertionError e) {
Assertions.assertThat(e.getMessage()).isEqualTo(String.format(
- "[Column at index 14 (column name : VAR15) of Change at index 0 (on table : TEST and with primary key : [5]) of Changes on tables of 'sa/jdbc:h2:mem:test' source] %n"
+ "[Column at index 14 (column name : VAR15) of Change at index 0 (on table : TEST and with primary key : [5]) of Changes on tables of 'sa/jdbc:h2:mem:test'] %n"
+ "Expecting that start point:%n"
+ " %n"
+ "to be equal to: %n"
@@ -81,7 +81,7 @@ public void should_fail_because_value_at_start_point_is_different() {
@Test
@NeedReload
public void should_fail_because_value_at_end_point_is_different() {
- Changes changes = new Changes(source).setStartPointNow();
+ Changes changes = new Changes(jdbcConnectionProvider).setStartPointNow();
update("delete from test where var1 = 1");
changes.setEndPointNow();
@@ -91,7 +91,7 @@ public void should_fail_because_value_at_end_point_is_different() {
fail("An exception must be raised");
} catch (AssertionError e) {
Assertions.assertThat(e.getMessage()).isEqualTo(String.format(
- "[Column at index 14 (column name : VAR15) of Change at index 0 (on table : TEST and with primary key : [1]) of Changes on tables of 'sa/jdbc:h2:mem:test' source] %n"
+ "[Column at index 14 (column name : VAR15) of Change at index 0 (on table : TEST and with primary key : [1]) of Changes on tables of 'sa/jdbc:h2:mem:test'] %n"
+ "Expecting that end point:%n"
+ " %n"
+ "to be equal to: %n"
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnColumnType_IsBoolean_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnColumnType_IsBoolean_Test.java
index 39d2555e..faa1c5e0 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnColumnType_IsBoolean_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnColumnType_IsBoolean_Test.java
@@ -29,6 +29,7 @@
* {@link org.assertj.db.api.assertions.AssertOnColumnType#isBoolean(boolean)} method.
*
* @author Régis Pouiller
+ * @author Julien Roy
*/
public class AssertOnColumnType_IsBoolean_Test extends AbstractTest {
@@ -38,12 +39,12 @@ public class AssertOnColumnType_IsBoolean_Test extends AbstractTest {
@Test
@NeedReload
public void test_is_boolean() {
- Changes changes = new Changes(source).setStartPointNow();
+ Changes changes = new Changes(jdbcConnectionProvider).setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
update("insert into test(var1, var2, var11, var10, var9, var3, var12, var8) values(5, true, FILE_READ('classpath:h2-logo-2.png'), '2014-05-24 09:46:30', '2014-05-24', 3, 'test', '09:46:30')");
changes.setEndPointNow();
- Table table = new Table(source, "test");
- Table table2 = new Table(source, "test2");
+ Table table = new Table(jdbcConnectionProvider, "test");
+ Table table2 = new Table(jdbcConnectionProvider, "test2");
ChangeColumnAssert changeColumnAssert1 = assertThat(changes).change().column("var2");
ChangeColumnAssert changeColumnAssertReturn1 = changeColumnAssert1.isBoolean(true);
@@ -65,18 +66,18 @@ public void test_is_boolean() {
@Test
@NeedReload
public void should_fail_because_value_have_different_type() {
- Changes changes = new Changes(source).setStartPointNow();
+ Changes changes = new Changes(jdbcConnectionProvider).setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
update("insert into test(var1, var2, var11, var10, var9, var3, var12, var8) values(5, true, FILE_READ('classpath:h2-logo-2.png'), '2014-05-24 09:46:30', '2014-05-24', 3, 'test', '09:46:30')");
changes.setEndPointNow();
- Table table = new Table(source, "test");
- Table table2 = new Table(source, "test2");
+ Table table = new Table(jdbcConnectionProvider, "test");
+ Table table2 = new Table(jdbcConnectionProvider, "test2");
try {
assertThat(changes).change().column("var2").isBoolean(false);
fail("An exception must be raised");
} catch (AssertionError e) {
- Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Column at index 1 (column name : VAR2) of Change at index 0 (on table : TEST and with primary key : [5]) of Changes on tables of 'sa/jdbc:h2:mem:test' source] %n"
+ Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Column at index 1 (column name : VAR2) of Change at index 0 (on table : TEST and with primary key : [5]) of Changes on tables of 'sa/jdbc:h2:mem:test'] %n"
+ "Expecting that the value at start point:%n"
+ " %n"
+ "to be of type%n"
@@ -88,7 +89,7 @@ public void should_fail_because_value_have_different_type() {
assertThat(changes).change(1).column("var1").isBoolean(true);
fail("An exception must be raised");
} catch (AssertionError e) {
- Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Column at index 0 (column name : VAR1) of Change at index 1 (on table : TEST and with primary key : [1]) of Changes on tables of 'sa/jdbc:h2:mem:test' source] %n"
+ Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Column at index 0 (column name : VAR1) of Change at index 1 (on table : TEST and with primary key : [1]) of Changes on tables of 'sa/jdbc:h2:mem:test'] %n"
+ "Expecting that the value at start point:%n"
+ " <1>%n"
+ "to be of type%n"
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnColumnType_IsBytes_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnColumnType_IsBytes_Test.java
index 28386c6f..3bca0c4f 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnColumnType_IsBytes_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnColumnType_IsBytes_Test.java
@@ -29,6 +29,7 @@
* {@link org.assertj.db.api.assertions.AssertOnColumnType#isBytes(boolean)} method.
*
* @author Régis Pouiller
+ * @author Julien Roy
*/
public class AssertOnColumnType_IsBytes_Test extends AbstractTest {
@@ -38,12 +39,12 @@ public class AssertOnColumnType_IsBytes_Test extends AbstractTest {
@Test
@NeedReload
public void test_is_bytes() {
- Changes changes = new Changes(source).setStartPointNow();
+ Changes changes = new Changes(jdbcConnectionProvider).setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
update("insert into test(var1, var2, var11, var10, var9, var3, var12, var8) values(5, true, FILE_READ('classpath:h2-logo-2.png'), '2014-05-24 09:46:30', '2014-05-24', 3, 'test', '09:46:30')");
changes.setEndPointNow();
- Table table = new Table(source, "test");
- Table table2 = new Table(source, "test2");
+ Table table = new Table(jdbcConnectionProvider, "test");
+ Table table2 = new Table(jdbcConnectionProvider, "test2");
ChangeColumnAssert changeColumnAssert1 = assertThat(changes).change().column("var11");
ChangeColumnAssert changeColumnAssertReturn1 = changeColumnAssert1.isBytes(true);
@@ -65,18 +66,18 @@ public void test_is_bytes() {
@Test
@NeedReload
public void should_fail_because_value_have_different_type() {
- Changes changes = new Changes(source).setStartPointNow();
+ Changes changes = new Changes(jdbcConnectionProvider).setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
update("insert into test(var1, var2, var11, var10, var9, var3, var12, var8) values(5, true, FILE_READ('classpath:h2-logo-2.png'), '2014-05-24 09:46:30', '2014-05-24', 3, 'test', '09:46:30')");
changes.setEndPointNow();
- Table table = new Table(source, "test");
- Table table2 = new Table(source, "test2");
+ Table table = new Table(jdbcConnectionProvider, "test");
+ Table table2 = new Table(jdbcConnectionProvider, "test2");
try {
assertThat(changes).change().column("var11").isBytes(false);
fail("An exception must be raised");
} catch (AssertionError e) {
- Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Column at index 10 (column name : VAR11) of Change at index 0 (on table : TEST and with primary key : [5]) of Changes on tables of 'sa/jdbc:h2:mem:test' source] %n"
+ Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Column at index 10 (column name : VAR11) of Change at index 0 (on table : TEST and with primary key : [5]) of Changes on tables of 'sa/jdbc:h2:mem:test'] %n"
+ "Expecting that the value at start point:%n"
+ " %n"
+ "to be of type%n"
@@ -88,7 +89,7 @@ public void should_fail_because_value_have_different_type() {
assertThat(changes).change(1).column("var1").isBytes(true);
fail("An exception must be raised");
} catch (AssertionError e) {
- Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Column at index 0 (column name : VAR1) of Change at index 1 (on table : TEST and with primary key : [1]) of Changes on tables of 'sa/jdbc:h2:mem:test' source] %n"
+ Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Column at index 0 (column name : VAR1) of Change at index 1 (on table : TEST and with primary key : [1]) of Changes on tables of 'sa/jdbc:h2:mem:test'] %n"
+ "Expecting that the value at start point:%n"
+ " <1>%n"
+ "to be of type%n"
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnColumnType_IsDateTime_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnColumnType_IsDateTime_Test.java
index e3e5d0ac..6f251b44 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnColumnType_IsDateTime_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnColumnType_IsDateTime_Test.java
@@ -29,6 +29,7 @@
* {@link org.assertj.db.api.assertions.AssertOnColumnType#isDateTime(boolean)} method.
*
* @author Régis Pouiller
+ * @author Julien Roy
*/
public class AssertOnColumnType_IsDateTime_Test extends AbstractTest {
@@ -38,12 +39,12 @@ public class AssertOnColumnType_IsDateTime_Test extends AbstractTest {
@Test
@NeedReload
public void test_is_date_time() {
- Changes changes = new Changes(source).setStartPointNow();
+ Changes changes = new Changes(jdbcConnectionProvider).setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
update("insert into test(var1, var2, var11, var10, var9, var3, var12, var8) values(5, true, FILE_READ('classpath:h2-logo-2.png'), '2014-05-24 09:46:30', '2014-05-24', 3, 'test', '09:46:30')");
changes.setEndPointNow();
- Table table = new Table(source, "test");
- Table table2 = new Table(source, "test2");
+ Table table = new Table(jdbcConnectionProvider, "test");
+ Table table2 = new Table(jdbcConnectionProvider, "test2");
ChangeColumnAssert changeColumnAssert1 = assertThat(changes).change().column("var10");
ChangeColumnAssert changeColumnAssertReturn1 = changeColumnAssert1.isDateTime(true);
@@ -65,18 +66,18 @@ public void test_is_date_time() {
@Test
@NeedReload
public void should_fail_because_value_have_different_type() {
- Changes changes = new Changes(source).setStartPointNow();
+ Changes changes = new Changes(jdbcConnectionProvider).setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
update("insert into test(var1, var2, var11, var10, var9, var3, var12, var8) values(5, true, FILE_READ('classpath:h2-logo-2.png'), '2014-05-24 09:46:30', '2014-05-24', 3, 'test', '09:46:30')");
changes.setEndPointNow();
- Table table = new Table(source, "test");
- Table table2 = new Table(source, "test2");
+ Table table = new Table(jdbcConnectionProvider, "test");
+ Table table2 = new Table(jdbcConnectionProvider, "test2");
try {
assertThat(changes).change().column("var10").isDateTime(false);
fail("An exception must be raised");
} catch (AssertionError e) {
- Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Column at index 9 (column name : VAR10) of Change at index 0 (on table : TEST and with primary key : [5]) of Changes on tables of 'sa/jdbc:h2:mem:test' source] %n"
+ Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Column at index 9 (column name : VAR10) of Change at index 0 (on table : TEST and with primary key : [5]) of Changes on tables of 'sa/jdbc:h2:mem:test'] %n"
+ "Expecting that the value at start point:%n"
+ " %n"
+ "to be of type%n"
@@ -88,7 +89,7 @@ public void should_fail_because_value_have_different_type() {
assertThat(changes).change(1).column("var1").isDateTime(true);
fail("An exception must be raised");
} catch (AssertionError e) {
- Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Column at index 0 (column name : VAR1) of Change at index 1 (on table : TEST and with primary key : [1]) of Changes on tables of 'sa/jdbc:h2:mem:test' source] %n"
+ Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Column at index 0 (column name : VAR1) of Change at index 1 (on table : TEST and with primary key : [1]) of Changes on tables of 'sa/jdbc:h2:mem:test'] %n"
+ "Expecting that the value at start point:%n"
+ " <1>%n"
+ "to be of type%n"
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnColumnType_IsDate_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnColumnType_IsDate_Test.java
index cbcf2687..9b50336e 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnColumnType_IsDate_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnColumnType_IsDate_Test.java
@@ -29,6 +29,7 @@
* {@link org.assertj.db.api.assertions.AssertOnColumnType#isDate(boolean)} method.
*
* @author Régis Pouiller
+ * @author Julien Roy
*/
public class AssertOnColumnType_IsDate_Test extends AbstractTest {
@@ -38,12 +39,12 @@ public class AssertOnColumnType_IsDate_Test extends AbstractTest {
@Test
@NeedReload
public void test_is_date() {
- Changes changes = new Changes(source).setStartPointNow();
+ Changes changes = new Changes(jdbcConnectionProvider).setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
update("insert into test(var1, var2, var11, var10, var9, var3, var12, var8) values(5, true, FILE_READ('classpath:h2-logo-2.png'), '2014-05-24 09:46:30', '2014-05-24', 3, 'test', '09:46:30')");
changes.setEndPointNow();
- Table table = new Table(source, "test");
- Table table2 = new Table(source, "test2");
+ Table table = new Table(jdbcConnectionProvider, "test");
+ Table table2 = new Table(jdbcConnectionProvider, "test2");
ChangeColumnAssert changeColumnAssert1 = assertThat(changes).change().column("var9");
ChangeColumnAssert changeColumnAssertReturn1 = changeColumnAssert1.isDate(true);
@@ -65,18 +66,18 @@ public void test_is_date() {
@Test
@NeedReload
public void should_fail_because_value_have_different_type() {
- Changes changes = new Changes(source).setStartPointNow();
+ Changes changes = new Changes(jdbcConnectionProvider).setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
update("insert into test(var1, var2, var11, var10, var9, var3, var12, var8) values(5, true, FILE_READ('classpath:h2-logo-2.png'), '2014-05-24 09:46:30', '2014-05-24', 3, 'test', '09:46:30')");
changes.setEndPointNow();
- Table table = new Table(source, "test");
- Table table2 = new Table(source, "test2");
+ Table table = new Table(jdbcConnectionProvider, "test");
+ Table table2 = new Table(jdbcConnectionProvider, "test2");
try {
assertThat(changes).change().column("var9").isDate(false);
fail("An exception must be raised");
} catch (AssertionError e) {
- Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Column at index 8 (column name : VAR9) of Change at index 0 (on table : TEST and with primary key : [5]) of Changes on tables of 'sa/jdbc:h2:mem:test' source] %n"
+ Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Column at index 8 (column name : VAR9) of Change at index 0 (on table : TEST and with primary key : [5]) of Changes on tables of 'sa/jdbc:h2:mem:test'] %n"
+ "Expecting that the value at start point:%n"
+ " %n"
+ "to be of type%n"
@@ -88,7 +89,7 @@ public void should_fail_because_value_have_different_type() {
assertThat(changes).change(1).column("var1").isDate(true);
fail("An exception must be raised");
} catch (AssertionError e) {
- Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Column at index 0 (column name : VAR1) of Change at index 1 (on table : TEST and with primary key : [1]) of Changes on tables of 'sa/jdbc:h2:mem:test' source] %n"
+ Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Column at index 0 (column name : VAR1) of Change at index 1 (on table : TEST and with primary key : [1]) of Changes on tables of 'sa/jdbc:h2:mem:test'] %n"
+ "Expecting that the value at start point:%n"
+ " <1>%n"
+ "to be of type%n"
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnColumnType_IsNumber_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnColumnType_IsNumber_Test.java
index 477754fd..570a5f8b 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnColumnType_IsNumber_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnColumnType_IsNumber_Test.java
@@ -29,6 +29,7 @@
* {@link org.assertj.db.api.assertions.AssertOnColumnType#isNumber(boolean)} method.
*
* @author Régis Pouiller
+ * @author Julien Roy
*/
public class AssertOnColumnType_IsNumber_Test extends AbstractTest {
@@ -38,12 +39,12 @@ public class AssertOnColumnType_IsNumber_Test extends AbstractTest {
@Test
@NeedReload
public void test_is_number() {
- Changes changes = new Changes(source).setStartPointNow();
+ Changes changes = new Changes(jdbcConnectionProvider).setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
update("insert into test(var1, var2, var11, var10, var9, var3, var12, var8) values(5, true, FILE_READ('classpath:h2-logo-2.png'), '2014-05-24 09:46:30', '2014-05-24', 3, 'test', '09:46:30')");
changes.setEndPointNow();
- Table table = new Table(source, "test");
- Table table2 = new Table(source, "test2");
+ Table table = new Table(jdbcConnectionProvider, "test");
+ Table table2 = new Table(jdbcConnectionProvider, "test2");
ChangeColumnAssert changeColumnAssert1 = assertThat(changes).change().column("var3");
ChangeColumnAssert changeColumnAssertReturn1 = changeColumnAssert1.isNumber(true);
@@ -65,18 +66,18 @@ public void test_is_number() {
@Test
@NeedReload
public void should_fail_because_value_have_different_type() {
- Changes changes = new Changes(source).setStartPointNow();
+ Changes changes = new Changes(jdbcConnectionProvider).setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
update("insert into test(var1, var2, var11, var10, var9, var3, var12, var8) values(5, true, FILE_READ('classpath:h2-logo-2.png'), '2014-05-24 09:46:30', '2014-05-24', 3, 'test', '09:46:30')");
changes.setEndPointNow();
- Table table = new Table(source, "test");
- Table table2 = new Table(source, "test2");
+ Table table = new Table(jdbcConnectionProvider, "test");
+ Table table2 = new Table(jdbcConnectionProvider, "test2");
try {
assertThat(changes).change().column("var3").isNumber(false);
fail("An exception must be raised");
} catch (AssertionError e) {
- Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Column at index 2 (column name : VAR3) of Change at index 0 (on table : TEST and with primary key : [5]) of Changes on tables of 'sa/jdbc:h2:mem:test' source] %n"
+ Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Column at index 2 (column name : VAR3) of Change at index 0 (on table : TEST and with primary key : [5]) of Changes on tables of 'sa/jdbc:h2:mem:test'] %n"
+ "Expecting that the value at start point:%n"
+ " %n"
+ "to be of type%n"
@@ -88,7 +89,7 @@ public void should_fail_because_value_have_different_type() {
assertThat(changes).change(1).column("var2").isNumber(true);
fail("An exception must be raised");
} catch (AssertionError e) {
- Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Column at index 1 (column name : VAR2) of Change at index 1 (on table : TEST and with primary key : [1]) of Changes on tables of 'sa/jdbc:h2:mem:test' source] %n"
+ Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Column at index 1 (column name : VAR2) of Change at index 1 (on table : TEST and with primary key : [1]) of Changes on tables of 'sa/jdbc:h2:mem:test'] %n"
+ "Expecting that the value at start point:%n"
+ " %n"
+ "to be of type%n"
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnColumnType_IsOfAnyTypeIn_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnColumnType_IsOfAnyTypeIn_Test.java
index ea1e7432..de35075a 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnColumnType_IsOfAnyTypeIn_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnColumnType_IsOfAnyTypeIn_Test.java
@@ -30,6 +30,7 @@
* {@link org.assertj.db.api.assertions.AssertOnColumnType#isOfAnyTypeIn(org.assertj.db.type.ValueType...)} method.
*
* @author Régis Pouiller
+ * @author Julien Roy
*/
public class AssertOnColumnType_IsOfAnyTypeIn_Test extends AbstractTest {
@@ -39,12 +40,12 @@ public class AssertOnColumnType_IsOfAnyTypeIn_Test extends AbstractTest {
@Test
@NeedReload
public void test_is_of_any_of_types() {
- Changes changes = new Changes(source).setStartPointNow();
+ Changes changes = new Changes(jdbcConnectionProvider).setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
update("insert into test(var1, var2, var11, var10, var9, var3, var12, var8) values(5, true, FILE_READ('classpath:h2-logo-2.png'), '2014-05-24 09:46:30', '2014-05-24', 3, 'test', '09:46:30')");
changes.setEndPointNow();
- Table table = new Table(source, "test");
- Table table2 = new Table(source, "test2");
+ Table table = new Table(jdbcConnectionProvider, "test");
+ Table table2 = new Table(jdbcConnectionProvider, "test2");
ChangeColumnAssert changeColumnAssert1 = assertThat(changes).change().column("var2");
ChangeColumnAssert changeColumnAssertReturn1 = changeColumnAssert1.isOfAnyTypeIn(ValueType.BOOLEAN,
@@ -68,18 +69,18 @@ public void test_is_of_any_of_types() {
@Test
@NeedReload
public void should_fail_because_value_have_different_type() {
- Changes changes = new Changes(source).setStartPointNow();
+ Changes changes = new Changes(jdbcConnectionProvider).setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
update("insert into test(var1, var2, var11, var10, var9, var3, var12, var8) values(5, true, FILE_READ('classpath:h2-logo-2.png'), '2014-05-24 09:46:30', '2014-05-24', 3, 'test', '09:46:30')");
changes.setEndPointNow();
- Table table = new Table(source, "test");
- Table table2 = new Table(source, "test2");
+ Table table = new Table(jdbcConnectionProvider, "test");
+ Table table2 = new Table(jdbcConnectionProvider, "test2");
try {
assertThat(changes).change().column("var2").isOfAnyTypeIn(ValueType.BOOLEAN, ValueType.TEXT);
fail("An exception must be raised");
} catch (AssertionError e) {
- Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Column at index 1 (column name : VAR2) of Change at index 0 (on table : TEST and with primary key : [5]) of Changes on tables of 'sa/jdbc:h2:mem:test' source] %n"
+ Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Column at index 1 (column name : VAR2) of Change at index 0 (on table : TEST and with primary key : [5]) of Changes on tables of 'sa/jdbc:h2:mem:test'] %n"
+ "Expecting that the value at start point:%n"
+ " %n"
+ "to be of type%n"
@@ -92,7 +93,7 @@ public void should_fail_because_value_have_different_type() {
ValueType.NOT_IDENTIFIED);
fail("An exception must be raised");
} catch (AssertionError e) {
- Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Column at index 0 (column name : VAR1) of Change at index 1 (on table : TEST and with primary key : [1]) of Changes on tables of 'sa/jdbc:h2:mem:test' source] %n"
+ Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Column at index 0 (column name : VAR1) of Change at index 1 (on table : TEST and with primary key : [1]) of Changes on tables of 'sa/jdbc:h2:mem:test'] %n"
+ "Expecting that the value at start point:%n"
+ " <1>%n"
+ "to be of type%n"
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnColumnType_IsOfType_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnColumnType_IsOfType_Test.java
index df82c6f9..50160006 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnColumnType_IsOfType_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnColumnType_IsOfType_Test.java
@@ -30,6 +30,7 @@
* {@link org.assertj.db.api.assertions.AssertOnColumnType#isOfType(org.assertj.db.type.ValueType, boolean)} method.
*
* @author Régis Pouiller
+ * @author Julien Roy
*/
public class AssertOnColumnType_IsOfType_Test extends AbstractTest {
@@ -39,12 +40,12 @@ public class AssertOnColumnType_IsOfType_Test extends AbstractTest {
@Test
@NeedReload
public void test_is_of_type() {
- Changes changes = new Changes(source).setStartPointNow();
+ Changes changes = new Changes(jdbcConnectionProvider).setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
update("insert into test(var1, var2, var11, var10, var9, var3, var12, var8) values(5, true, FILE_READ('classpath:h2-logo-2.png'), '2014-05-24 09:46:30', '2014-05-24', 3, 'test', '09:46:30')");
changes.setEndPointNow();
- Table table = new Table(source, "test");
- Table table2 = new Table(source, "test2");
+ Table table = new Table(jdbcConnectionProvider, "test");
+ Table table2 = new Table(jdbcConnectionProvider, "test2");
ChangeColumnAssert changeColumnAssert1 = assertThat(changes).change().column("var2");
ChangeColumnAssert changeColumnAssertReturn1 = changeColumnAssert1.isOfType(ValueType.BOOLEAN, true);
@@ -66,18 +67,18 @@ public void test_is_of_type() {
@Test
@NeedReload
public void should_fail_because_value_have_different_type() {
- Changes changes = new Changes(source).setStartPointNow();
+ Changes changes = new Changes(jdbcConnectionProvider).setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
update("insert into test(var1, var2, var11, var10, var9, var3, var12, var8) values(5, true, FILE_READ('classpath:h2-logo-2.png'), '2014-05-24 09:46:30', '2014-05-24', 3, 'test', '09:46:30')");
changes.setEndPointNow();
- Table table = new Table(source, "test");
- Table table2 = new Table(source, "test2");
+ Table table = new Table(jdbcConnectionProvider, "test");
+ Table table2 = new Table(jdbcConnectionProvider, "test2");
try {
assertThat(changes).change().column("var2").isOfType(ValueType.BOOLEAN, false);
fail("An exception must be raised");
} catch (AssertionError e) {
- Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Column at index 1 (column name : VAR2) of Change at index 0 (on table : TEST and with primary key : [5]) of Changes on tables of 'sa/jdbc:h2:mem:test' source] %n"
+ Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Column at index 1 (column name : VAR2) of Change at index 0 (on table : TEST and with primary key : [5]) of Changes on tables of 'sa/jdbc:h2:mem:test'] %n"
+ "Expecting that the value at start point:%n"
+ " %n"
+ "to be of type%n"
@@ -89,7 +90,7 @@ public void should_fail_because_value_have_different_type() {
assertThat(changes).change(1).column("var1").isOfType(ValueType.BOOLEAN, true);
fail("An exception must be raised");
} catch (AssertionError e) {
- Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Column at index 0 (column name : VAR1) of Change at index 1 (on table : TEST and with primary key : [1]) of Changes on tables of 'sa/jdbc:h2:mem:test' source] %n"
+ Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Column at index 0 (column name : VAR1) of Change at index 1 (on table : TEST and with primary key : [1]) of Changes on tables of 'sa/jdbc:h2:mem:test'] %n"
+ "Expecting that the value at start point:%n"
+ " <1>%n"
+ "to be of type%n"
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnColumnType_IsText_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnColumnType_IsText_Test.java
index 78456154..ddc1a9f5 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnColumnType_IsText_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnColumnType_IsText_Test.java
@@ -29,6 +29,7 @@
* {@link org.assertj.db.api.assertions.AssertOnColumnType#isText(boolean)} method.
*
* @author Régis Pouiller
+ * @author Julien Roy
*/
public class AssertOnColumnType_IsText_Test extends AbstractTest {
@@ -38,12 +39,12 @@ public class AssertOnColumnType_IsText_Test extends AbstractTest {
@Test
@NeedReload
public void test_is_text() {
- Changes changes = new Changes(source).setStartPointNow();
+ Changes changes = new Changes(jdbcConnectionProvider).setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
update("insert into test(var1, var2, var11, var10, var9, var3, var12, var8) values(5, true, FILE_READ('classpath:h2-logo-2.png'), '2014-05-24 09:46:30', '2014-05-24', 3, 'test', '09:46:30')");
changes.setEndPointNow();
- Table table = new Table(source, "test");
- Table table2 = new Table(source, "test2");
+ Table table = new Table(jdbcConnectionProvider, "test");
+ Table table2 = new Table(jdbcConnectionProvider, "test2");
ChangeColumnAssert changeColumnAssert1 = assertThat(changes).change().column("var12");
ChangeColumnAssert changeColumnAssertReturn1 = changeColumnAssert1.isText(true);
@@ -65,18 +66,18 @@ public void test_is_text() {
@Test
@NeedReload
public void should_fail_because_value_have_different_type() {
- Changes changes = new Changes(source).setStartPointNow();
+ Changes changes = new Changes(jdbcConnectionProvider).setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
update("insert into test(var1, var2, var11, var10, var9, var3, var12, var8) values(5, true, FILE_READ('classpath:h2-logo-2.png'), '2014-05-24 09:46:30', '2014-05-24', 3, 'test', '09:46:30')");
changes.setEndPointNow();
- Table table = new Table(source, "test");
- Table table2 = new Table(source, "test2");
+ Table table = new Table(jdbcConnectionProvider, "test");
+ Table table2 = new Table(jdbcConnectionProvider, "test2");
try {
assertThat(changes).change().column("var12").isText(false);
fail("An exception must be raised");
} catch (AssertionError e) {
- Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Column at index 11 (column name : VAR12) of Change at index 0 (on table : TEST and with primary key : [5]) of Changes on tables of 'sa/jdbc:h2:mem:test' source] %n"
+ Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Column at index 11 (column name : VAR12) of Change at index 0 (on table : TEST and with primary key : [5]) of Changes on tables of 'sa/jdbc:h2:mem:test'] %n"
+ "Expecting that the value at start point:%n"
+ " %n"
+ "to be of type%n"
@@ -88,7 +89,7 @@ public void should_fail_because_value_have_different_type() {
assertThat(changes).change(1).column("var1").isText(true);
fail("An exception must be raised");
} catch (AssertionError e) {
- Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Column at index 0 (column name : VAR1) of Change at index 1 (on table : TEST and with primary key : [1]) of Changes on tables of 'sa/jdbc:h2:mem:test' source] %n"
+ Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Column at index 0 (column name : VAR1) of Change at index 1 (on table : TEST and with primary key : [1]) of Changes on tables of 'sa/jdbc:h2:mem:test'] %n"
+ "Expecting that the value at start point:%n"
+ " <1>%n"
+ "to be of type%n"
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnColumnType_IsTime_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnColumnType_IsTime_Test.java
index ae9d13d5..8b12a6e2 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnColumnType_IsTime_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnColumnType_IsTime_Test.java
@@ -29,6 +29,7 @@
* {@link org.assertj.db.api.assertions.AssertOnColumnType#isTime(boolean)} method.
*
* @author Régis Pouiller
+ * @author Julien Roy
*/
public class AssertOnColumnType_IsTime_Test extends AbstractTest {
@@ -38,12 +39,12 @@ public class AssertOnColumnType_IsTime_Test extends AbstractTest {
@Test
@NeedReload
public void test_is_time() {
- Changes changes = new Changes(source).setStartPointNow();
+ Changes changes = new Changes(jdbcConnectionProvider).setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
update("insert into test(var1, var2, var11, var10, var9, var3, var12, var8) values(5, true, FILE_READ('classpath:h2-logo-2.png'), '2014-05-24 09:46:30', '2014-05-24', 3, 'test', '09:46:30')");
changes.setEndPointNow();
- Table table = new Table(source, "test");
- Table table2 = new Table(source, "test2");
+ Table table = new Table(jdbcConnectionProvider, "test");
+ Table table2 = new Table(jdbcConnectionProvider, "test2");
ChangeColumnAssert changeColumnAssert1 = assertThat(changes).change().column("var8");
ChangeColumnAssert changeColumnAssertReturn1 = changeColumnAssert1.isTime(true);
@@ -65,18 +66,18 @@ public void test_is_time() {
@Test
@NeedReload
public void should_fail_because_value_have_different_type() {
- Changes changes = new Changes(source).setStartPointNow();
+ Changes changes = new Changes(jdbcConnectionProvider).setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
update("insert into test(var1, var2, var11, var10, var9, var3, var12, var8) values(5, true, FILE_READ('classpath:h2-logo-2.png'), '2014-05-24 09:46:30', '2014-05-24', 3, 'test', '09:46:30')");
changes.setEndPointNow();
- Table table = new Table(source, "test");
- Table table2 = new Table(source, "test2");
+ Table table = new Table(jdbcConnectionProvider, "test");
+ Table table2 = new Table(jdbcConnectionProvider, "test2");
try {
assertThat(changes).change().column("var8").isTime(false);
fail("An exception must be raised");
} catch (AssertionError e) {
- Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Column at index 7 (column name : VAR8) of Change at index 0 (on table : TEST and with primary key : [5]) of Changes on tables of 'sa/jdbc:h2:mem:test' source] %n"
+ Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Column at index 7 (column name : VAR8) of Change at index 0 (on table : TEST and with primary key : [5]) of Changes on tables of 'sa/jdbc:h2:mem:test'] %n"
+ "Expecting that the value at start point:%n"
+ " %n"
+ "to be of type%n"
@@ -88,7 +89,7 @@ public void should_fail_because_value_have_different_type() {
assertThat(changes).change(1).column("var1").isTime(true);
fail("An exception must be raised");
} catch (AssertionError e) {
- Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Column at index 0 (column name : VAR1) of Change at index 1 (on table : TEST and with primary key : [1]) of Changes on tables of 'sa/jdbc:h2:mem:test' source] %n"
+ Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Column at index 0 (column name : VAR1) of Change at index 1 (on table : TEST and with primary key : [1]) of Changes on tables of 'sa/jdbc:h2:mem:test'] %n"
+ "Expecting that the value at start point:%n"
+ " <1>%n"
+ "to be of type%n"
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnColumnType_IsUUID_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnColumnType_IsUUID_Test.java
index 57876eff..50b7fcc1 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnColumnType_IsUUID_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnColumnType_IsUUID_Test.java
@@ -38,13 +38,13 @@ public class AssertOnColumnType_IsUUID_Test extends AbstractTest {
@Test
@NeedReload
public void test_is_UUID() {
- Changes changes = new Changes(source).setStartPointNow();
+ Changes changes = new Changes(jdbcConnectionProvider).setStartPointNow();
update("update test set var15 = '0E2A1269-EFF0-4233-B87B-B53E8B6F164D' where var1 = 1");
update(
"insert into test(var1, var2, var11, var10, var9, var3, var12, var8, var15) values(5, true, FILE_READ('classpath:h2-logo-2.png'), '2014-05-24 09:46:30', '2014-05-24', 3, 'test', '09:46:30', '2B0D1BDD-909E-4362-BA10-C930BA82718D')");
changes.setEndPointNow();
- Table table = new Table(source, "test");
- Table table2 = new Table(source, "test2");
+ Table table = new Table(jdbcConnectionProvider, "test");
+ Table table2 = new Table(jdbcConnectionProvider, "test2");
ChangeColumnAssert changeColumnAssert1 = assertThat(changes).change().column("var15");
ChangeColumnAssert changeColumnAssertReturn1 = changeColumnAssert1.isUUID(true);
@@ -66,20 +66,20 @@ public void test_is_UUID() {
@Test
@NeedReload
public void should_fail_because_value_have_different_type() {
- Changes changes = new Changes(source).setStartPointNow();
+ Changes changes = new Changes(jdbcConnectionProvider).setStartPointNow();
update("update test set var15 = null where var1 = 1");
update(
"insert into test(var1, var2, var11, var10, var9, var3, var12, var8, var15) values(5, true, FILE_READ('classpath:h2-logo-2.png'), '2014-05-24 09:46:30', '2014-05-24', 3, 'test', '09:46:30', null)");
changes.setEndPointNow();
- Table table = new Table(source, "test");
- Table table2 = new Table(source, "test2");
+ Table table = new Table(jdbcConnectionProvider, "test");
+ Table table2 = new Table(jdbcConnectionProvider, "test2");
try {
assertThat(changes).change().column("var15").isUUID(false);
fail("An exception must be raised");
} catch (AssertionError e) {
Assertions.assertThat(e.getMessage()).isEqualTo(String.format(
- "[Column at index 14 (column name : VAR15) of Change at index 0 (on table : TEST and with primary key : [5]) of Changes on tables of 'sa/jdbc:h2:mem:test' source] %n"
+ "[Column at index 14 (column name : VAR15) of Change at index 0 (on table : TEST and with primary key : [5]) of Changes on tables of 'sa/jdbc:h2:mem:test'] %n"
+ "Expecting that the value at start point:%n"
+ " %n"
+ "to be of type%n"
@@ -92,7 +92,7 @@ public void should_fail_because_value_have_different_type() {
fail("An exception must be raised");
} catch (AssertionError e) {
Assertions.assertThat(e.getMessage()).isEqualTo(String.format(
- "[Column at index 0 (column name : VAR1) of Change at index 1 (on table : TEST and with primary key : [1]) of Changes on tables of 'sa/jdbc:h2:mem:test' source] %n"
+ "[Column at index 0 (column name : VAR1) of Change at index 1 (on table : TEST and with primary key : [1]) of Changes on tables of 'sa/jdbc:h2:mem:test'] %n"
+ "Expecting that the value at start point:%n"
+ " <1>%n"
+ "to be of type%n"
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnDataType_IsOnDataType_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnDataType_IsOnDataType_Test.java
index 300b4bcb..f54e0a4b 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnDataType_IsOnDataType_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnDataType_IsOnDataType_Test.java
@@ -30,6 +30,7 @@
* {@link org.assertj.db.api.assertions.AssertOnDataType#isOnDataType(org.assertj.db.type.DataType)} method.
*
* @author Régis Pouiller
+ * @author Julien Roy
*/
public class AssertOnDataType_IsOnDataType_Test extends AbstractTest {
@@ -39,7 +40,7 @@ public class AssertOnDataType_IsOnDataType_Test extends AbstractTest {
@Test
@NeedReload
public void test_is_on_data_type() throws Exception {
- Table table = new Table(source, "actor");
+ Table table = new Table(jdbcConnectionProvider, "actor");
Changes changes = new Changes(table).setStartPointNow();
updateChangesForTests();
changes.setEndPointNow();
@@ -55,7 +56,7 @@ public void test_is_on_data_type() throws Exception {
@Test
@NeedReload
public void should_fail_because_data_type_is_different() throws Exception {
- Request request = new Request(source, "select * from actor");
+ Request request = new Request(jdbcConnectionProvider, "select * from actor");
Changes changes = new Changes(request).setStartPointNow();
updateChangesForTests();
changes.setEndPointNow();
@@ -64,7 +65,7 @@ public void should_fail_because_data_type_is_different() throws Exception {
assertThat(changes).change().isOnDataType(DataType.TABLE);
fail("An exception must be raised");
} catch (AssertionError e) {
- Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Change at index 0 of Changes on 'select * from actor' request of 'sa/jdbc:h2:mem:test' source] %n"
+ Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Change at index 0 of Changes on 'select * from actor' request of 'sa/jdbc:h2:mem:test'] %n"
+ "Expecting:%n"
+ "to be on data type%n"
+ " %n"
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnDataType_IsOnRequest_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnDataType_IsOnRequest_Test.java
index ae68b6e2..2307acf1 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnDataType_IsOnRequest_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnDataType_IsOnRequest_Test.java
@@ -29,6 +29,7 @@
* {@link org.assertj.db.api.assertions.AssertOnDataType#isOnRequest()} method.
*
* @author Régis Pouiller
+ * @author Julien Roy
*/
public class AssertOnDataType_IsOnRequest_Test extends AbstractTest {
@@ -38,7 +39,7 @@ public class AssertOnDataType_IsOnRequest_Test extends AbstractTest {
@Test
@NeedReload
public void test_is_on_request() throws Exception {
- Request request = new Request(source, "select * from actor");
+ Request request = new Request(jdbcConnectionProvider, "select * from actor");
Changes changes = new Changes(request).setStartPointNow();
updateChangesForTests();
changes.setEndPointNow();
@@ -54,7 +55,7 @@ public void test_is_on_request() throws Exception {
@Test
@NeedReload
public void should_fail_because_data_type_is_different() throws Exception {
- Table table = new Table(source, "actor");
+ Table table = new Table(jdbcConnectionProvider, "actor");
Changes changes = new Changes(table).setStartPointNow();
updateChangesForTests();
changes.setEndPointNow();
@@ -63,7 +64,7 @@ public void should_fail_because_data_type_is_different() throws Exception {
assertThat(changes).change().isOnRequest();
fail("An exception must be raised");
} catch (AssertionError e) {
- Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Change at index 0 (with primary key : [4]) of Changes on ACTOR table of 'sa/jdbc:h2:mem:test' source] %n"
+ Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Change at index 0 (with primary key : [4]) of Changes on ACTOR table of 'sa/jdbc:h2:mem:test'] %n"
+ "Expecting:%n"
+ "to be on data type%n"
+ " %n"
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnDataType_IsOnTable_Name_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnDataType_IsOnTable_Name_Test.java
index 5cb2a755..fe9260ea 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnDataType_IsOnTable_Name_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnDataType_IsOnTable_Name_Test.java
@@ -12,9 +12,6 @@
*/
package org.assertj.db.api.assertions;
-import static org.assertj.db.api.Assertions.assertThat;
-import static org.junit.Assert.fail;
-
import org.assertj.core.api.Assertions;
import org.assertj.db.api.ChangeAssert;
import org.assertj.db.common.AbstractTest;
@@ -24,11 +21,15 @@
import org.assertj.db.type.Table;
import org.junit.Test;
+import static org.assertj.db.api.Assertions.assertThat;
+import static org.junit.Assert.fail;
+
/**
* Tests on {@link org.assertj.db.api.assertions.AssertOnDataType} class :
* {@link org.assertj.db.api.assertions.AssertOnDataType#isOnTable(String)} method.
*
* @author Régis Pouiller
+ * @author Julien Roy
*/
public class AssertOnDataType_IsOnTable_Name_Test extends AbstractTest {
@@ -38,7 +39,7 @@ public class AssertOnDataType_IsOnTable_Name_Test extends AbstractTest {
@Test
@NeedReload
public void test_is_on_table() throws Exception {
- Table table = new Table(source, "actor");
+ Table table = new Table(jdbcConnectionProvider, "actor");
Changes changes = new Changes(table).setStartPointNow();
updateChangesForTests();
changes.setEndPointNow();
@@ -54,7 +55,7 @@ public void test_is_on_table() throws Exception {
@Test
@NeedReload
public void should_fail_because_data_type_is_different() throws Exception {
- Request request = new Request(source, "select * from actor");
+ Request request = new Request(jdbcConnectionProvider, "select * from actor");
Changes changes = new Changes(request).setStartPointNow();
updateChangesForTests();
changes.setEndPointNow();
@@ -63,7 +64,7 @@ public void should_fail_because_data_type_is_different() throws Exception {
assertThat(changes).change().isOnTable("actor");
fail("An exception must be raised");
} catch (AssertionError e) {
- Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Change at index 0 of Changes on 'select * from actor' request of 'sa/jdbc:h2:mem:test' source] %n"
+ Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Change at index 0 of Changes on 'select * from actor' request of 'sa/jdbc:h2:mem:test'] %n"
+ "Expecting:%n"
+ "to be on data type%n"
+ " %n"
@@ -78,7 +79,7 @@ public void should_fail_because_data_type_is_different() throws Exception {
@Test
@NeedReload
public void should_fail_because_table_name_is_different() throws Exception {
- Table table = new Table(source, "actor");
+ Table table = new Table(jdbcConnectionProvider, "actor");
Changes changes = new Changes(table).setStartPointNow();
updateChangesForTests();
changes.setEndPointNow();
@@ -87,7 +88,7 @@ public void should_fail_because_table_name_is_different() throws Exception {
assertThat(changes).change().isOnTable("movie");
fail("An exception must be raised");
} catch (AssertionError e) {
- Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Change at index 0 (with primary key : [4]) of Changes on ACTOR table of 'sa/jdbc:h2:mem:test' source] %n"
+ Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Change at index 0 (with primary key : [4]) of Changes on ACTOR table of 'sa/jdbc:h2:mem:test'] %n"
+ "Expecting to be on the table:%n"
+ " <\"movie\">%n"
+ "but was on the table:%n"
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnDataType_IsOnTable_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnDataType_IsOnTable_Test.java
index b42898c0..c1bcba49 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnDataType_IsOnTable_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnDataType_IsOnTable_Test.java
@@ -29,6 +29,7 @@
* {@link org.assertj.db.api.assertions.AssertOnDataType#isOnTable()} method.
*
* @author Régis Pouiller
+ * @author Julien Roy
*/
public class AssertOnDataType_IsOnTable_Test extends AbstractTest {
@@ -38,7 +39,7 @@ public class AssertOnDataType_IsOnTable_Test extends AbstractTest {
@Test
@NeedReload
public void test_is_on_table() throws Exception {
- Table table = new Table(source, "actor");
+ Table table = new Table(jdbcConnectionProvider, "actor");
Changes changes = new Changes(table).setStartPointNow();
updateChangesForTests();
changes.setEndPointNow();
@@ -54,7 +55,7 @@ public void test_is_on_table() throws Exception {
@Test
@NeedReload
public void should_fail_because_data_type_is_different() throws Exception {
- Request request = new Request(source, "select * from actor");
+ Request request = new Request(jdbcConnectionProvider, "select * from actor");
Changes changes = new Changes(request).setStartPointNow();
updateChangesForTests();
changes.setEndPointNow();
@@ -63,7 +64,7 @@ public void should_fail_because_data_type_is_different() throws Exception {
assertThat(changes).change().isOnTable();
fail("An exception must be raised");
} catch (AssertionError e) {
- Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Change at index 0 of Changes on 'select * from actor' request of 'sa/jdbc:h2:mem:test' source] %n"
+ Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Change at index 0 of Changes on 'select * from actor' request of 'sa/jdbc:h2:mem:test'] %n"
+ "Expecting:%n"
+ "to be on data type%n"
+ " %n"
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnExistence_DoesNotExist_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnExistence_DoesNotExist_Test.java
index 2b8b1c98..a03dadef 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnExistence_DoesNotExist_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnExistence_DoesNotExist_Test.java
@@ -36,7 +36,7 @@ public class AssertOnExistence_DoesNotExist_Test extends AbstractTest {
@Test
@NeedReload
public void test_table_does_not_exist() {
- Table table = new Table(source, "not-exist-test");
+ Table table = new Table(jdbcConnectionProvider, "not-exist-test");
TableAssert tableAssert = assertThat(table);
TableAssert tableAssertExistReturn = tableAssert.doesNotExist();
Assertions.assertThat(tableAssert).isSameAs(tableAssertExistReturn);
@@ -48,7 +48,7 @@ public void test_table_does_not_exist() {
@Test
@NeedReload
public void should_fail_because_table_exist() {
- Table table = new Table(source, "test");
+ Table table = new Table(jdbcConnectionProvider, "test");
try {
assertThat(table).doesNotExist();
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnExistence_Exists_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnExistence_Exists_Test.java
index 42fa7ead..2260b6be 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnExistence_Exists_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnExistence_Exists_Test.java
@@ -36,7 +36,7 @@ public class AssertOnExistence_Exists_Test extends AbstractTest {
@Test
@NeedReload
public void test_table_exists() {
- Table table = new Table(source, "test");
+ Table table = new Table(jdbcConnectionProvider, "test");
TableAssert tableAssert = assertThat(table);
TableAssert tableAssertExistReturn = tableAssert.exists();
Assertions.assertThat(tableAssert).isSameAs(tableAssertExistReturn);
@@ -48,7 +48,7 @@ public void test_table_exists() {
@Test
@NeedReload
public void should_fail_because_table_not_exist() {
- Table table = new Table(source, "not-exist-test");
+ Table table = new Table(jdbcConnectionProvider, "not-exist-test");
try {
assertThat(table).exists();
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnModifiedColumn_IsModified_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnModifiedColumn_IsModified_Test.java
index d9dd743c..44ede8e8 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnModifiedColumn_IsModified_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnModifiedColumn_IsModified_Test.java
@@ -27,6 +27,7 @@
* {@link org.assertj.db.api.assertions.AssertOnModifiedColumn#isModified()} method.
*
* @author Régis Pouiller
+ * @author Julien Roy
*/
public class AssertOnModifiedColumn_IsModified_Test extends AbstractTest {
@@ -36,7 +37,7 @@ public class AssertOnModifiedColumn_IsModified_Test extends AbstractTest {
@Test
@NeedReload
public void test_is_modified() {
- Changes changes = new Changes(source).setStartPointNow();
+ Changes changes = new Changes(jdbcConnectionProvider).setStartPointNow();
updateChangesForTests();
changes.setEndPointNow();
@@ -51,7 +52,7 @@ public void test_is_modified() {
@Test
@NeedReload
public void should_fail_because_column_is_not_modified() {
- Changes changes = new Changes(source).setStartPointNow();
+ Changes changes = new Changes(jdbcConnectionProvider).setStartPointNow();
updateChangesForTests();
changes.setEndPointNow();
@@ -59,7 +60,7 @@ public void should_fail_because_column_is_not_modified() {
assertThat(changes).change(3).column().isModified();
fail("An exception must be raised");
} catch (AssertionError e) {
- Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Column at index 0 (column name : ID) of Change at index 3 (on table : ACTOR and with primary key : [1]) of Changes on tables of 'sa/jdbc:h2:mem:test' source] %n"
+ Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Column at index 0 (column name : ID) of Change at index 3 (on table : ACTOR and with primary key : [1]) of Changes on tables of 'sa/jdbc:h2:mem:test'] %n"
+ "Expecting :%n"
+ " <1>%n"
+ "is modified but is still:%n"
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnModifiedColumn_IsNotModified_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnModifiedColumn_IsNotModified_Test.java
index 6883bb31..bb56e7ce 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnModifiedColumn_IsNotModified_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnModifiedColumn_IsNotModified_Test.java
@@ -27,6 +27,7 @@
* {@link org.assertj.db.api.assertions.AssertOnModifiedColumn#isNotModified()} method.
*
* @author Régis Pouiller
+ * @author Julien Roy
*/
public class AssertOnModifiedColumn_IsNotModified_Test extends AbstractTest {
@@ -36,7 +37,7 @@ public class AssertOnModifiedColumn_IsNotModified_Test extends AbstractTest {
@Test
@NeedReload
public void test_is_not_modified() {
- Changes changes = new Changes(source).setStartPointNow();
+ Changes changes = new Changes(jdbcConnectionProvider).setStartPointNow();
updateChangesForTests();
changes.setEndPointNow();
@@ -51,7 +52,7 @@ public void test_is_not_modified() {
@Test
@NeedReload
public void should_fail_because_column_is_modified() {
- Changes changes = new Changes(source).setStartPointNow();
+ Changes changes = new Changes(jdbcConnectionProvider).setStartPointNow();
updateChangesForTests();
changes.setEndPointNow();
@@ -59,7 +60,7 @@ public void should_fail_because_column_is_modified() {
assertThat(changes).change().column().isNotModified();
fail("An exception must be raised");
} catch (AssertionError e) {
- Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Column at index 0 (column name : ID) of Change at index 0 (on table : ACTOR and with primary key : [4]) of Changes on tables of 'sa/jdbc:h2:mem:test' source] %n"
+ Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Column at index 0 (column name : ID) of Change at index 0 (on table : ACTOR and with primary key : [4]) of Changes on tables of 'sa/jdbc:h2:mem:test'] %n"
+ "Expecting :%n"
+ " %n"
+ "is not modified but is :%n"
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnModifiedColumns_HasModifiedColumns_Integer_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnModifiedColumns_HasModifiedColumns_Integer_Test.java
index 6b91bc06..c23be81e 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnModifiedColumns_HasModifiedColumns_Integer_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnModifiedColumns_HasModifiedColumns_Integer_Test.java
@@ -27,6 +27,7 @@
* {@link org.assertj.db.api.assertions.AssertOnModifiedColumns#hasModifiedColumns(Integer...)} method.
*
* @author Régis Pouiller
+ * @author Julien Roy
*/
public class AssertOnModifiedColumns_HasModifiedColumns_Integer_Test extends AbstractTest {
@@ -36,7 +37,7 @@ public class AssertOnModifiedColumns_HasModifiedColumns_Integer_Test extends Abs
@Test
@NeedReload
public void test_has_modified_columns() throws Exception {
- Changes changes = new Changes(source).setStartPointNow();
+ Changes changes = new Changes(jdbcConnectionProvider).setStartPointNow();
updateChangesForTests();
changes.setEndPointNow();
@@ -51,7 +52,7 @@ public void test_has_modified_columns() throws Exception {
@Test
@NeedReload
public void should_fail_because_modified_columns_are_different() throws Exception {
- Changes changes = new Changes(source).setStartPointNow();
+ Changes changes = new Changes(jdbcConnectionProvider).setStartPointNow();
updateChangesForTests();
changes.setEndPointNow();
@@ -59,7 +60,7 @@ public void should_fail_because_modified_columns_are_different() throws Exceptio
assertThat(changes).change(3).hasModifiedColumns(1);
fail("An exception must be raised");
} catch (AssertionError e) {
- Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Change at index 3 (on table : ACTOR and with primary key : [1]) of Changes on tables of 'sa/jdbc:h2:mem:test' source] %n"
+ Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Change at index 3 (on table : ACTOR and with primary key : [1]) of Changes on tables of 'sa/jdbc:h2:mem:test'] %n"
+ "Expecting :%n"
+ " [1]%n"
+ "as indexes of modified columns but was:%n"
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnModifiedColumns_HasModifiedColumns_String_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnModifiedColumns_HasModifiedColumns_String_Test.java
index 697039f7..7acb7bd1 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnModifiedColumns_HasModifiedColumns_String_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnModifiedColumns_HasModifiedColumns_String_Test.java
@@ -27,6 +27,7 @@
* {@link org.assertj.db.api.assertions.AssertOnModifiedColumns(String...)} method.
*
* @author Régis Pouiller
+ * @author Julien Roy
*/
public class AssertOnModifiedColumns_HasModifiedColumns_String_Test extends AbstractTest {
@@ -36,7 +37,7 @@ public class AssertOnModifiedColumns_HasModifiedColumns_String_Test extends Abst
@Test
@NeedReload
public void test_has_modified_columns() throws Exception {
- Changes changes = new Changes(source).setStartPointNow();
+ Changes changes = new Changes(jdbcConnectionProvider).setStartPointNow();
updateChangesForTests();
changes.setEndPointNow();
@@ -51,7 +52,7 @@ public void test_has_modified_columns() throws Exception {
@Test
@NeedReload
public void should_fail_because_modified_columns_are_different() throws Exception {
- Changes changes = new Changes(source).setStartPointNow();
+ Changes changes = new Changes(jdbcConnectionProvider).setStartPointNow();
updateChangesForTests();
changes.setEndPointNow();
@@ -59,7 +60,7 @@ public void should_fail_because_modified_columns_are_different() throws Exceptio
assertThat(changes).change(3).hasModifiedColumns("ID");
fail("An exception must be raised");
} catch (AssertionError e) {
- Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Change at index 3 (on table : ACTOR and with primary key : [1]) of Changes on tables of 'sa/jdbc:h2:mem:test' source] %n"
+ Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Change at index 3 (on table : ACTOR and with primary key : [1]) of Changes on tables of 'sa/jdbc:h2:mem:test'] %n"
+ "Expecting :%n"
+ " [\"ID\"]%n"
+ "as modified columns but was:%n"
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnModifiedColumns_HasNumberOfModifiedColumnsGreaterThanOrEqualTo_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnModifiedColumns_HasNumberOfModifiedColumnsGreaterThanOrEqualTo_Test.java
index 065c1f0d..e6e24dba 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnModifiedColumns_HasNumberOfModifiedColumnsGreaterThanOrEqualTo_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnModifiedColumns_HasNumberOfModifiedColumnsGreaterThanOrEqualTo_Test.java
@@ -27,6 +27,7 @@
* {@link org.assertj.db.api.assertions.AssertOnModifiedColumns#hasNumberOfModifiedColumnsGreaterThanOrEqualTo(int)} method.
*
* @author Régis Pouiller
+ * @author Julien Roy
*/
public class AssertOnModifiedColumns_HasNumberOfModifiedColumnsGreaterThanOrEqualTo_Test extends AbstractTest {
@@ -36,7 +37,7 @@ public class AssertOnModifiedColumns_HasNumberOfModifiedColumnsGreaterThanOrEqua
@Test
@NeedReload
public void test_has_number_of_modified_columns_greater_than_or_equal_to() throws Exception {
- Changes changes = new Changes(source).setStartPointNow();
+ Changes changes = new Changes(jdbcConnectionProvider).setStartPointNow();
updateChangesForTests();
changes.setEndPointNow();
@@ -51,7 +52,7 @@ public void test_has_number_of_modified_columns_greater_than_or_equal_to() throw
@Test
@NeedReload
public void should_fail_because_number_of_modified_columns_is_less() throws Exception {
- Changes changes = new Changes(source).setStartPointNow();
+ Changes changes = new Changes(jdbcConnectionProvider).setStartPointNow();
updateChangesForTests();
changes.setEndPointNow();
@@ -59,7 +60,7 @@ public void should_fail_because_number_of_modified_columns_is_less() throws Exce
assertThat(changes).change(3).hasNumberOfModifiedColumnsGreaterThanOrEqualTo(2);
fail("An exception must be raised");
} catch (AssertionError e) {
- Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Change at index 3 (on table : ACTOR and with primary key : [1]) of Changes on tables of 'sa/jdbc:h2:mem:test' source] %n"
+ Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Change at index 3 (on table : ACTOR and with primary key : [1]) of Changes on tables of 'sa/jdbc:h2:mem:test'] %n"
+ "Expecting :%n"
+ " number of modifications is greater than or equal to 2%n"
+ "but was:%n"
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnModifiedColumns_HasNumberOfModifiedColumnsGreaterThan_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnModifiedColumns_HasNumberOfModifiedColumnsGreaterThan_Test.java
index 660899b0..7e9ef9af 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnModifiedColumns_HasNumberOfModifiedColumnsGreaterThan_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnModifiedColumns_HasNumberOfModifiedColumnsGreaterThan_Test.java
@@ -27,6 +27,7 @@
* {@link org.assertj.db.api.assertions.AssertOnModifiedColumns#hasNumberOfModifiedColumnsGreaterThan(int)} method.
*
* @author Régis Pouiller
+ * @author Julien Roy
*/
public class AssertOnModifiedColumns_HasNumberOfModifiedColumnsGreaterThan_Test extends AbstractTest {
@@ -36,7 +37,7 @@ public class AssertOnModifiedColumns_HasNumberOfModifiedColumnsGreaterThan_Test
@Test
@NeedReload
public void test_has_number_of_modified_columns_greater_than() throws Exception {
- Changes changes = new Changes(source).setStartPointNow();
+ Changes changes = new Changes(jdbcConnectionProvider).setStartPointNow();
updateChangesForTests();
changes.setEndPointNow();
@@ -51,7 +52,7 @@ public void test_has_number_of_modified_columns_greater_than() throws Exception
@Test
@NeedReload
public void should_fail_because_number_of_modified_columns_is_less_or_equal() throws Exception {
- Changes changes = new Changes(source).setStartPointNow();
+ Changes changes = new Changes(jdbcConnectionProvider).setStartPointNow();
updateChangesForTests();
changes.setEndPointNow();
@@ -59,7 +60,7 @@ public void should_fail_because_number_of_modified_columns_is_less_or_equal() th
assertThat(changes).change(3).hasNumberOfModifiedColumnsGreaterThan(1);
fail("An exception must be raised");
} catch (AssertionError e) {
- Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Change at index 3 (on table : ACTOR and with primary key : [1]) of Changes on tables of 'sa/jdbc:h2:mem:test' source] %n"
+ Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Change at index 3 (on table : ACTOR and with primary key : [1]) of Changes on tables of 'sa/jdbc:h2:mem:test'] %n"
+ "Expecting :%n"
+ " number of modifications is greater than 1%n"
+ "but was:%n"
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnModifiedColumns_HasNumberOfModifiedColumnsLessThanOrEqualTo_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnModifiedColumns_HasNumberOfModifiedColumnsLessThanOrEqualTo_Test.java
index 0086442c..fc2f954f 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnModifiedColumns_HasNumberOfModifiedColumnsLessThanOrEqualTo_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnModifiedColumns_HasNumberOfModifiedColumnsLessThanOrEqualTo_Test.java
@@ -27,6 +27,7 @@
* {@link org.assertj.db.api.assertions.AssertOnModifiedColumns#hasNumberOfModifiedColumnsLessThanOrEqualTo(int)} method.
*
* @author Régis Pouiller
+ * @author Julien Roy
*/
public class AssertOnModifiedColumns_HasNumberOfModifiedColumnsLessThanOrEqualTo_Test extends AbstractTest {
@@ -36,7 +37,7 @@ public class AssertOnModifiedColumns_HasNumberOfModifiedColumnsLessThanOrEqualTo
@Test
@NeedReload
public void test_has_number_of_modified_columns_less_than_or_equal_to() throws Exception {
- Changes changes = new Changes(source).setStartPointNow();
+ Changes changes = new Changes(jdbcConnectionProvider).setStartPointNow();
updateChangesForTests();
changes.setEndPointNow();
@@ -51,7 +52,7 @@ public void test_has_number_of_modified_columns_less_than_or_equal_to() throws E
@Test
@NeedReload
public void should_fail_because_number_of_modified_columns_is_greater() throws Exception {
- Changes changes = new Changes(source).setStartPointNow();
+ Changes changes = new Changes(jdbcConnectionProvider).setStartPointNow();
updateChangesForTests();
changes.setEndPointNow();
@@ -59,7 +60,7 @@ public void should_fail_because_number_of_modified_columns_is_greater() throws E
assertThat(changes).change(3).hasNumberOfModifiedColumnsLessThanOrEqualTo(0);
fail("An exception must be raised");
} catch (AssertionError e) {
- Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Change at index 3 (on table : ACTOR and with primary key : [1]) of Changes on tables of 'sa/jdbc:h2:mem:test' source] %n"
+ Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Change at index 3 (on table : ACTOR and with primary key : [1]) of Changes on tables of 'sa/jdbc:h2:mem:test'] %n"
+ "Expecting :%n"
+ " number of modifications is less than or equal to 0%n"
+ "but was:%n"
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnModifiedColumns_HasNumberOfModifiedColumnsLessThan_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnModifiedColumns_HasNumberOfModifiedColumnsLessThan_Test.java
index a285a6ef..952d2122 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnModifiedColumns_HasNumberOfModifiedColumnsLessThan_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnModifiedColumns_HasNumberOfModifiedColumnsLessThan_Test.java
@@ -27,6 +27,7 @@
* {@link org.assertj.db.api.assertions.AssertOnModifiedColumns#hasNumberOfModifiedColumnsLessThan(int)} method.
*
* @author Régis Pouiller
+ * @author Julien Roy
*/
public class AssertOnModifiedColumns_HasNumberOfModifiedColumnsLessThan_Test extends AbstractTest {
@@ -36,7 +37,7 @@ public class AssertOnModifiedColumns_HasNumberOfModifiedColumnsLessThan_Test ext
@Test
@NeedReload
public void test_has_number_of_modified_columns_less_than() throws Exception {
- Changes changes = new Changes(source).setStartPointNow();
+ Changes changes = new Changes(jdbcConnectionProvider).setStartPointNow();
updateChangesForTests();
changes.setEndPointNow();
@@ -51,7 +52,7 @@ public void test_has_number_of_modified_columns_less_than() throws Exception {
@Test
@NeedReload
public void should_fail_because_number_of_modified_columns_is_greater_or_equal() throws Exception {
- Changes changes = new Changes(source).setStartPointNow();
+ Changes changes = new Changes(jdbcConnectionProvider).setStartPointNow();
updateChangesForTests();
changes.setEndPointNow();
@@ -59,7 +60,7 @@ public void should_fail_because_number_of_modified_columns_is_greater_or_equal()
assertThat(changes).change(3).hasNumberOfModifiedColumnsLessThan(1);
fail("An exception must be raised");
} catch (AssertionError e) {
- Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Change at index 3 (on table : ACTOR and with primary key : [1]) of Changes on tables of 'sa/jdbc:h2:mem:test' source] %n"
+ Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Change at index 3 (on table : ACTOR and with primary key : [1]) of Changes on tables of 'sa/jdbc:h2:mem:test'] %n"
+ "Expecting :%n"
+ " number of modifications is less than 1%n"
+ "but was:%n"
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnModifiedColumns_HasNumberOfModifiedColumns_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnModifiedColumns_HasNumberOfModifiedColumns_Test.java
index f902b90f..54ab0e04 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnModifiedColumns_HasNumberOfModifiedColumns_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnModifiedColumns_HasNumberOfModifiedColumns_Test.java
@@ -27,6 +27,7 @@
* {@link org.assertj.db.api.assertions.AssertOnModifiedColumns#hasNumberOfModifiedColumns(int)} method.
*
* @author Régis Pouiller
+ * @author Julien Roy
*/
public class AssertOnModifiedColumns_HasNumberOfModifiedColumns_Test extends AbstractTest {
@@ -36,7 +37,7 @@ public class AssertOnModifiedColumns_HasNumberOfModifiedColumns_Test extends Abs
@Test
@NeedReload
public void test_has_number_of_modified_columns() throws Exception {
- Changes changes = new Changes(source).setStartPointNow();
+ Changes changes = new Changes(jdbcConnectionProvider).setStartPointNow();
updateChangesForTests();
changes.setEndPointNow();
@@ -51,7 +52,7 @@ public void test_has_number_of_modified_columns() throws Exception {
@Test
@NeedReload
public void should_fail_because_number_of_modified_columns_is_different() throws Exception {
- Changes changes = new Changes(source).setStartPointNow();
+ Changes changes = new Changes(jdbcConnectionProvider).setStartPointNow();
updateChangesForTests();
changes.setEndPointNow();
@@ -59,7 +60,7 @@ public void should_fail_because_number_of_modified_columns_is_different() throws
assertThat(changes).change(3).hasNumberOfModifiedColumns(2);
fail("An exception must be raised");
} catch (AssertionError e) {
- Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Change at index 3 (on table : ACTOR and with primary key : [1]) of Changes on tables of 'sa/jdbc:h2:mem:test' source] %n"
+ Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Change at index 3 (on table : ACTOR and with primary key : [1]) of Changes on tables of 'sa/jdbc:h2:mem:test'] %n"
+ "Expecting :%n"
+ " 2 modifications%n"
+ "but was:%n"
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnNumberOfChanges_HasNumberOfChangesGreaterThanOrEqualTo_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnNumberOfChanges_HasNumberOfChangesGreaterThanOrEqualTo_Test.java
index 78c3e623..7d1f467f 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnNumberOfChanges_HasNumberOfChangesGreaterThanOrEqualTo_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnNumberOfChanges_HasNumberOfChangesGreaterThanOrEqualTo_Test.java
@@ -29,6 +29,7 @@
* {@link org.assertj.db.api.assertions.AssertOnNumberOfChanges#hasNumberOfChangesGreaterThanOrEqualTo(int)} method.
*
* @author Régis Pouiller
+ * @author Julien Roy
*/
public class AssertOnNumberOfChanges_HasNumberOfChangesGreaterThanOrEqualTo_Test extends AbstractTest {
@@ -38,7 +39,7 @@ public class AssertOnNumberOfChanges_HasNumberOfChangesGreaterThanOrEqualTo_Test
@Test
@NeedReload
public void test_has_number_of_changes_greater_than_or_equal_to() throws Exception {
- Table table = new Table(source, "actor");
+ Table table = new Table(jdbcConnectionProvider, "actor");
Changes changes = new Changes(table).setStartPointNow();
updateChangesForTests();
changes.setEndPointNow();
@@ -54,7 +55,7 @@ public void test_has_number_of_changes_greater_than_or_equal_to() throws Excepti
@Test
@NeedReload
public void should_fail_because_number_of_changes_is_less() throws Exception {
- Request request = new Request(source, "select * from actor");
+ Request request = new Request(jdbcConnectionProvider, "select * from actor");
Changes changes = new Changes(request).setStartPointNow();
updateChangesForTests();
changes.setEndPointNow();
@@ -63,7 +64,7 @@ public void should_fail_because_number_of_changes_is_less() throws Exception {
assertThat(changes).hasNumberOfChangesGreaterThanOrEqualTo(9);
fail("An exception must be raised");
} catch (AssertionError e) {
- Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Changes on 'select * from actor' request of 'sa/jdbc:h2:mem:test' source] %n"
+ Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Changes on 'select * from actor' request of 'sa/jdbc:h2:mem:test'] %n"
+ "Expecting size (number of changes) to be greater than or equal to :%n"
+ " <9>%n"
+ "but was:%n"
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnNumberOfChanges_HasNumberOfChangesGreaterThan_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnNumberOfChanges_HasNumberOfChangesGreaterThan_Test.java
index f66b834c..455ca024 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnNumberOfChanges_HasNumberOfChangesGreaterThan_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnNumberOfChanges_HasNumberOfChangesGreaterThan_Test.java
@@ -29,6 +29,7 @@
* {@link org.assertj.db.api.assertions.AssertOnNumberOfChanges#hasNumberOfChangesGreaterThan(int)} method.
*
* @author Régis Pouiller
+ * @author Julien Roy
*/
public class AssertOnNumberOfChanges_HasNumberOfChangesGreaterThan_Test extends AbstractTest {
@@ -38,7 +39,7 @@ public class AssertOnNumberOfChanges_HasNumberOfChangesGreaterThan_Test extends
@Test
@NeedReload
public void test_has_number_of_changes_greater_than() throws Exception {
- Table table = new Table(source, "actor");
+ Table table = new Table(jdbcConnectionProvider, "actor");
Changes changes = new Changes(table).setStartPointNow();
updateChangesForTests();
changes.setEndPointNow();
@@ -54,7 +55,7 @@ public void test_has_number_of_changes_greater_than() throws Exception {
@Test
@NeedReload
public void should_fail_because_number_of_changes_is_less_or_equal() throws Exception {
- Request request = new Request(source, "select * from actor");
+ Request request = new Request(jdbcConnectionProvider, "select * from actor");
Changes changes = new Changes(request).setStartPointNow();
updateChangesForTests();
changes.setEndPointNow();
@@ -63,7 +64,7 @@ public void should_fail_because_number_of_changes_is_less_or_equal() throws Exce
assertThat(changes).hasNumberOfChangesGreaterThan(4);
fail("An exception must be raised");
} catch (AssertionError e) {
- Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Changes on 'select * from actor' request of 'sa/jdbc:h2:mem:test' source] %n"
+ Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Changes on 'select * from actor' request of 'sa/jdbc:h2:mem:test'] %n"
+ "Expecting size (number of changes) to be greater than :%n"
+ " <4>%n"
+ "but was:%n"
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnNumberOfChanges_HasNumberOfChangesLessThanOrEqualTo_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnNumberOfChanges_HasNumberOfChangesLessThanOrEqualTo_Test.java
index 7e72be01..413f80b8 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnNumberOfChanges_HasNumberOfChangesLessThanOrEqualTo_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnNumberOfChanges_HasNumberOfChangesLessThanOrEqualTo_Test.java
@@ -29,6 +29,7 @@
* {@link org.assertj.db.api.assertions.AssertOnNumberOfChanges#hasNumberOfChangesLessThanOrEqualTo(int)} method.
*
* @author Régis Pouiller
+ * @author Julien Roy
*/
public class AssertOnNumberOfChanges_HasNumberOfChangesLessThanOrEqualTo_Test extends AbstractTest {
@@ -38,7 +39,7 @@ public class AssertOnNumberOfChanges_HasNumberOfChangesLessThanOrEqualTo_Test ex
@Test
@NeedReload
public void test_has_number_of_changes_greater_than_or_equal_to() throws Exception {
- Table table = new Table(source, "actor");
+ Table table = new Table(jdbcConnectionProvider, "actor");
Changes changes = new Changes(table).setStartPointNow();
updateChangesForTests();
changes.setEndPointNow();
@@ -54,7 +55,7 @@ public void test_has_number_of_changes_greater_than_or_equal_to() throws Excepti
@Test
@NeedReload
public void should_fail_because_number_of_changes_is_greater() throws Exception {
- Request request = new Request(source, "select * from actor");
+ Request request = new Request(jdbcConnectionProvider, "select * from actor");
Changes changes = new Changes(request).setStartPointNow();
updateChangesForTests();
changes.setEndPointNow();
@@ -63,7 +64,7 @@ public void should_fail_because_number_of_changes_is_greater() throws Exception
assertThat(changes).hasNumberOfChangesLessThanOrEqualTo(2);
fail("An exception must be raised");
} catch (AssertionError e) {
- Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Changes on 'select * from actor' request of 'sa/jdbc:h2:mem:test' source] %n"
+ Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Changes on 'select * from actor' request of 'sa/jdbc:h2:mem:test'] %n"
+ "Expecting size (number of changes) to be less than or equal to :%n"
+ " <2>%n"
+ "but was:%n"
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnNumberOfChanges_HasNumberOfChangesLessThan_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnNumberOfChanges_HasNumberOfChangesLessThan_Test.java
index ca8bfef4..3388ff65 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnNumberOfChanges_HasNumberOfChangesLessThan_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnNumberOfChanges_HasNumberOfChangesLessThan_Test.java
@@ -29,6 +29,7 @@
* {@link org.assertj.db.api.assertions.AssertOnNumberOfChanges#hasNumberOfChangesLessThan(int)} method.
*
* @author Régis Pouiller
+ * @author Julien Roy
*/
public class AssertOnNumberOfChanges_HasNumberOfChangesLessThan_Test extends AbstractTest {
@@ -38,7 +39,7 @@ public class AssertOnNumberOfChanges_HasNumberOfChangesLessThan_Test extends Abs
@Test
@NeedReload
public void test_has_number_of_changes_greater_than() throws Exception {
- Table table = new Table(source, "actor");
+ Table table = new Table(jdbcConnectionProvider, "actor");
Changes changes = new Changes(table).setStartPointNow();
updateChangesForTests();
changes.setEndPointNow();
@@ -54,7 +55,7 @@ public void test_has_number_of_changes_greater_than() throws Exception {
@Test
@NeedReload
public void should_fail_because_number_of_changes_is_greater_or_equal() throws Exception {
- Request request = new Request(source, "select * from actor");
+ Request request = new Request(jdbcConnectionProvider, "select * from actor");
Changes changes = new Changes(request).setStartPointNow();
updateChangesForTests();
changes.setEndPointNow();
@@ -63,7 +64,7 @@ public void should_fail_because_number_of_changes_is_greater_or_equal() throws E
assertThat(changes).hasNumberOfChangesLessThan(2);
fail("An exception must be raised");
} catch (AssertionError e) {
- Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Changes on 'select * from actor' request of 'sa/jdbc:h2:mem:test' source] %n"
+ Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Changes on 'select * from actor' request of 'sa/jdbc:h2:mem:test'] %n"
+ "Expecting size (number of changes) to be less than :%n"
+ " <2>%n"
+ "but was:%n"
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnNumberOfChanges_HasNumberOfChanges_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnNumberOfChanges_HasNumberOfChanges_Test.java
index def35ac6..5ec3713e 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnNumberOfChanges_HasNumberOfChanges_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnNumberOfChanges_HasNumberOfChanges_Test.java
@@ -29,6 +29,7 @@
* {@link org.assertj.db.api.assertions.AssertOnNumberOfChanges#hasNumberOfChanges(int)} method.
*
* @author Régis Pouiller
+ * @author Julien Roy
*/
public class AssertOnNumberOfChanges_HasNumberOfChanges_Test extends AbstractTest {
@@ -38,7 +39,7 @@ public class AssertOnNumberOfChanges_HasNumberOfChanges_Test extends AbstractTes
@Test
@NeedReload
public void test_has_number_of_changes() throws Exception {
- Table table = new Table(source, "actor");
+ Table table = new Table(jdbcConnectionProvider, "actor");
Changes changes = new Changes(table).setStartPointNow();
updateChangesForTests();
changes.setEndPointNow();
@@ -56,7 +57,7 @@ public void test_has_number_of_changes() throws Exception {
@Test
@NeedReload
public void should_fail_because_number_of_changes_is_different() throws Exception {
- Request request = new Request(source, "select * from actor");
+ Request request = new Request(jdbcConnectionProvider, "select * from actor");
Changes changes = new Changes(request).setStartPointNow();
updateChangesForTests();
changes.setEndPointNow();
@@ -65,7 +66,7 @@ public void should_fail_because_number_of_changes_is_different() throws Exceptio
assertThat(changes).hasNumberOfChanges(9);
fail("An exception must be raised");
} catch (AssertionError e) {
- Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Changes on 'select * from actor' request of 'sa/jdbc:h2:mem:test' source] %n"
+ Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Changes on 'select * from actor' request of 'sa/jdbc:h2:mem:test'] %n"
+ "Expecting size (number of changes) to be equal to :%n"
+ " <9>%n"
+ "but was:%n"
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnNumberOfColumns_HasNumberOfColumnsGreaterThanOrEqualTo_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnNumberOfColumns_HasNumberOfColumnsGreaterThanOrEqualTo_Test.java
index d2d495d2..31c353a8 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnNumberOfColumns_HasNumberOfColumnsGreaterThanOrEqualTo_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnNumberOfColumns_HasNumberOfColumnsGreaterThanOrEqualTo_Test.java
@@ -32,6 +32,7 @@
* {@link org.assertj.db.api.assertions.AssertOnNumberOfColumns#hasNumberOfColumnsGreaterThanOrEqualTo(int)} method.
*
* @author Régis Pouiller
+ * @author Julien Roy
*/
public class AssertOnNumberOfColumns_HasNumberOfColumnsGreaterThanOrEqualTo_Test extends AbstractTest {
@@ -41,7 +42,7 @@ public class AssertOnNumberOfColumns_HasNumberOfColumnsGreaterThanOrEqualTo_Test
@Test
@NeedReload
public void test_has_number_of_columns() {
- Table table = new Table(source, "actor");
+ Table table = new Table(jdbcConnectionProvider, "actor");
Changes changes = new Changes(table).setStartPointNow();
updateChangesForTests();
changes.setEndPointNow();
@@ -69,7 +70,7 @@ public void test_has_number_of_columns() {
@Test
@NeedReload
public void should_fail_because_number_of_columns_is_greater() {
- Request request = new Request(source, "select * from actor");
+ Request request = new Request(jdbcConnectionProvider, "select * from actor");
Changes changes = new Changes(request).setStartPointNow();
updateChangesForTests();
changes.setEndPointNow();
@@ -78,7 +79,7 @@ public void should_fail_because_number_of_columns_is_greater() {
assertThat(changes).change().hasNumberOfColumnsGreaterThanOrEqualTo(6);
fail("An exception must be raised");
} catch (AssertionError e) {
- Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Change at index 0 of Changes on 'select * from actor' request of 'sa/jdbc:h2:mem:test' source] %n"
+ Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Change at index 0 of Changes on 'select * from actor' request of 'sa/jdbc:h2:mem:test'] %n"
+ "Expecting size (number of columns) to be greater than or equal to :%n"
+ " <6>%n"
+ "but was:%n"
@@ -88,7 +89,7 @@ public void should_fail_because_number_of_columns_is_greater() {
assertThat(changes).change().rowAtEndPoint().hasNumberOfColumnsGreaterThanOrEqualTo(6);
fail("An exception must be raised");
} catch (AssertionError e) {
- Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Row at end point of Change at index 0 of Changes on 'select * from actor' request of 'sa/jdbc:h2:mem:test' source] %n"
+ Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Row at end point of Change at index 0 of Changes on 'select * from actor' request of 'sa/jdbc:h2:mem:test'] %n"
+ "Expecting size (number of columns) to be greater than or equal to :%n"
+ " <6>%n"
+ "but was:%n"
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnNumberOfColumns_HasNumberOfColumnsGreaterThan_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnNumberOfColumns_HasNumberOfColumnsGreaterThan_Test.java
index d93b8201..d89e1a12 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnNumberOfColumns_HasNumberOfColumnsGreaterThan_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnNumberOfColumns_HasNumberOfColumnsGreaterThan_Test.java
@@ -32,6 +32,7 @@
* {@link org.assertj.db.api.assertions.AssertOnNumberOfColumns#hasNumberOfColumnsGreaterThan(int)} method.
*
* @author Régis Pouiller
+ * @author Julien Roy
*/
public class AssertOnNumberOfColumns_HasNumberOfColumnsGreaterThan_Test extends AbstractTest {
@@ -41,7 +42,7 @@ public class AssertOnNumberOfColumns_HasNumberOfColumnsGreaterThan_Test extends
@Test
@NeedReload
public void test_has_number_of_columns() {
- Table table = new Table(source, "actor");
+ Table table = new Table(jdbcConnectionProvider, "actor");
Changes changes = new Changes(table).setStartPointNow();
updateChangesForTests();
changes.setEndPointNow();
@@ -69,7 +70,7 @@ public void test_has_number_of_columns() {
@Test
@NeedReload
public void should_fail_because_number_of_columns_is_different() {
- Request request = new Request(source, "select * from actor");
+ Request request = new Request(jdbcConnectionProvider, "select * from actor");
Changes changes = new Changes(request).setStartPointNow();
updateChangesForTests();
changes.setEndPointNow();
@@ -78,7 +79,7 @@ public void should_fail_because_number_of_columns_is_different() {
assertThat(changes).change().hasNumberOfColumnsGreaterThan(9);
fail("An exception must be raised");
} catch (AssertionError e) {
- Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Change at index 0 of Changes on 'select * from actor' request of 'sa/jdbc:h2:mem:test' source] %n"
+ Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Change at index 0 of Changes on 'select * from actor' request of 'sa/jdbc:h2:mem:test'] %n"
+ "Expecting size (number of columns) to be greater than :%n"
+ " <9>%n"
+ "but was:%n"
@@ -88,7 +89,7 @@ public void should_fail_because_number_of_columns_is_different() {
assertThat(changes).change().rowAtEndPoint().hasNumberOfColumnsGreaterThan(9);
fail("An exception must be raised");
} catch (AssertionError e) {
- Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Row at end point of Change at index 0 of Changes on 'select * from actor' request of 'sa/jdbc:h2:mem:test' source] %n"
+ Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Row at end point of Change at index 0 of Changes on 'select * from actor' request of 'sa/jdbc:h2:mem:test'] %n"
+ "Expecting size (number of columns) to be greater than :%n"
+ " <9>%n"
+ "but was:%n"
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnNumberOfColumns_HasNumberOfColumnsLessThanOrEqualTo_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnNumberOfColumns_HasNumberOfColumnsLessThanOrEqualTo_Test.java
index df96b2ea..f18270f7 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnNumberOfColumns_HasNumberOfColumnsLessThanOrEqualTo_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnNumberOfColumns_HasNumberOfColumnsLessThanOrEqualTo_Test.java
@@ -32,6 +32,7 @@
* {@link org.assertj.db.api.assertions.AssertOnNumberOfColumns#hasNumberOfColumnsLessThanOrEqualTo(int)} method.
*
* @author Régis Pouiller
+ * @author Julien Roy
*/
public class AssertOnNumberOfColumns_HasNumberOfColumnsLessThanOrEqualTo_Test extends AbstractTest {
@@ -41,7 +42,7 @@ public class AssertOnNumberOfColumns_HasNumberOfColumnsLessThanOrEqualTo_Test ex
@Test
@NeedReload
public void test_has_number_of_columns_less_than_or_equal() {
- Table table = new Table(source, "actor");
+ Table table = new Table(jdbcConnectionProvider, "actor");
Changes changes = new Changes(table).setStartPointNow();
updateChangesForTests();
changes.setEndPointNow();
@@ -69,7 +70,7 @@ public void test_has_number_of_columns_less_than_or_equal() {
@Test
@NeedReload
public void should_fail_because_number_of_columns_is_less() {
- Request request = new Request(source, "select * from actor");
+ Request request = new Request(jdbcConnectionProvider, "select * from actor");
Changes changes = new Changes(request).setStartPointNow();
updateChangesForTests();
changes.setEndPointNow();
@@ -78,7 +79,7 @@ public void should_fail_because_number_of_columns_is_less() {
assertThat(changes).change().hasNumberOfColumnsLessThanOrEqualTo(4);
fail("An exception must be raised");
} catch (AssertionError e) {
- Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Change at index 0 of Changes on 'select * from actor' request of 'sa/jdbc:h2:mem:test' source] %n"
+ Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Change at index 0 of Changes on 'select * from actor' request of 'sa/jdbc:h2:mem:test'] %n"
+ "Expecting size (number of columns) to be less than or equal to :%n"
+ " <4>%n"
+ "but was:%n"
@@ -88,7 +89,7 @@ public void should_fail_because_number_of_columns_is_less() {
assertThat(changes).change().rowAtEndPoint().hasNumberOfColumnsLessThanOrEqualTo(4);
fail("An exception must be raised");
} catch (AssertionError e) {
- Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Row at end point of Change at index 0 of Changes on 'select * from actor' request of 'sa/jdbc:h2:mem:test' source] %n"
+ Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Row at end point of Change at index 0 of Changes on 'select * from actor' request of 'sa/jdbc:h2:mem:test'] %n"
+ "Expecting size (number of columns) to be less than or equal to :%n"
+ " <4>%n"
+ "but was:%n"
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnNumberOfColumns_HasNumberOfColumnsLessThan_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnNumberOfColumns_HasNumberOfColumnsLessThan_Test.java
index ace13f09..60a360f8 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnNumberOfColumns_HasNumberOfColumnsLessThan_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnNumberOfColumns_HasNumberOfColumnsLessThan_Test.java
@@ -32,6 +32,7 @@
* {@link org.assertj.db.api.assertions.AssertOnNumberOfColumns#hasNumberOfColumnsLessThan(int)} method.
*
* @author Régis Pouiller
+ * @author Julien Roy
*/
public class AssertOnNumberOfColumns_HasNumberOfColumnsLessThan_Test extends AbstractTest {
@@ -41,7 +42,7 @@ public class AssertOnNumberOfColumns_HasNumberOfColumnsLessThan_Test extends Abs
@Test
@NeedReload
public void test_has_number_of_columns_less_than() {
- Table table = new Table(source, "actor");
+ Table table = new Table(jdbcConnectionProvider, "actor");
Changes changes = new Changes(table).setStartPointNow();
updateChangesForTests();
changes.setEndPointNow();
@@ -69,7 +70,7 @@ public void test_has_number_of_columns_less_than() {
@Test
@NeedReload
public void should_fail_because_number_of_columns_is_greater_or_equal() {
- Request request = new Request(source, "select * from actor");
+ Request request = new Request(jdbcConnectionProvider, "select * from actor");
Changes changes = new Changes(request).setStartPointNow();
updateChangesForTests();
changes.setEndPointNow();
@@ -78,7 +79,7 @@ public void should_fail_because_number_of_columns_is_greater_or_equal() {
assertThat(changes).change().hasNumberOfColumnsLessThan(5);
fail("An exception must be raised");
} catch (AssertionError e) {
- Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Change at index 0 of Changes on 'select * from actor' request of 'sa/jdbc:h2:mem:test' source] %n"
+ Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Change at index 0 of Changes on 'select * from actor' request of 'sa/jdbc:h2:mem:test'] %n"
+ "Expecting size (number of columns) to be less than :%n"
+ " <5>%n"
+ "but was:%n"
@@ -88,7 +89,7 @@ public void should_fail_because_number_of_columns_is_greater_or_equal() {
assertThat(changes).change().rowAtEndPoint().hasNumberOfColumnsLessThan(4);
fail("An exception must be raised");
} catch (AssertionError e) {
- Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Row at end point of Change at index 0 of Changes on 'select * from actor' request of 'sa/jdbc:h2:mem:test' source] %n"
+ Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Row at end point of Change at index 0 of Changes on 'select * from actor' request of 'sa/jdbc:h2:mem:test'] %n"
+ "Expecting size (number of columns) to be less than :%n"
+ " <4>%n"
+ "but was:%n"
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnNumberOfColumns_HasNumberOfColumns_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnNumberOfColumns_HasNumberOfColumns_Test.java
index 2ce8c180..2faca76c 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnNumberOfColumns_HasNumberOfColumns_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnNumberOfColumns_HasNumberOfColumns_Test.java
@@ -32,6 +32,7 @@
* {@link org.assertj.db.api.assertions.AssertOnNumberOfColumns#hasNumberOfColumns(int)} method.
*
* @author Régis Pouiller
+ * @author Julien Roy
*/
public class AssertOnNumberOfColumns_HasNumberOfColumns_Test extends AbstractTest {
@@ -41,7 +42,7 @@ public class AssertOnNumberOfColumns_HasNumberOfColumns_Test extends AbstractTes
@Test
@NeedReload
public void test_has_number_of_columns() {
- Table table = new Table(source, "actor");
+ Table table = new Table(jdbcConnectionProvider, "actor");
Changes changes = new Changes(table).setStartPointNow();
updateChangesForTests();
changes.setEndPointNow();
@@ -69,7 +70,7 @@ public void test_has_number_of_columns() {
@Test
@NeedReload
public void should_fail_because_number_of_columns_is_different() {
- Request request = new Request(source, "select * from actor");
+ Request request = new Request(jdbcConnectionProvider, "select * from actor");
Changes changes = new Changes(request).setStartPointNow();
updateChangesForTests();
changes.setEndPointNow();
@@ -78,7 +79,7 @@ public void should_fail_because_number_of_columns_is_different() {
assertThat(changes).change().hasNumberOfColumns(9);
fail("An exception must be raised");
} catch (AssertionError e) {
- Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Change at index 0 of Changes on 'select * from actor' request of 'sa/jdbc:h2:mem:test' source] %n"
+ Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Change at index 0 of Changes on 'select * from actor' request of 'sa/jdbc:h2:mem:test'] %n"
+ "Expecting size (number of columns) to be equal to :%n"
+ " <9>%n"
+ "but was:%n"
@@ -88,7 +89,7 @@ public void should_fail_because_number_of_columns_is_different() {
assertThat(changes).change().rowAtEndPoint().hasNumberOfColumns(9);
fail("An exception must be raised");
} catch (AssertionError e) {
- Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Row at end point of Change at index 0 of Changes on 'select * from actor' request of 'sa/jdbc:h2:mem:test' source] %n"
+ Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Row at end point of Change at index 0 of Changes on 'select * from actor' request of 'sa/jdbc:h2:mem:test'] %n"
+ "Expecting size (number of columns) to be equal to :%n"
+ " <9>%n"
+ "but was:%n"
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnNumberOfRows_HasNumberOfRowsGreaterThanOrEqualTo_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnNumberOfRows_HasNumberOfRowsGreaterThanOrEqualTo_Test.java
index a4fd5c97..6e0b2c9a 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnNumberOfRows_HasNumberOfRowsGreaterThanOrEqualTo_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnNumberOfRows_HasNumberOfRowsGreaterThanOrEqualTo_Test.java
@@ -28,6 +28,7 @@
* {@link org.assertj.db.api.assertions.AssertOnNumberOfRows#hasNumberOfRowsGreaterThanOrEqualTo(int)} method.
*
* @author Régis Pouiller
+ * @author Julien Roy
*/
public class AssertOnNumberOfRows_HasNumberOfRowsGreaterThanOrEqualTo_Test extends AbstractTest {
@@ -36,7 +37,7 @@ public class AssertOnNumberOfRows_HasNumberOfRowsGreaterThanOrEqualTo_Test exten
*/
@Test
public void test_has_number_of_rows_greater_than_or_equal_to() {
- Table table = new Table(source, "actor");
+ Table table = new Table(jdbcConnectionProvider, "actor");
TableAssert tableAssert = assertThat(table);
TableAssert tableAssert2 = tableAssert.hasNumberOfRowsGreaterThanOrEqualTo(3);
Assertions.assertThat(tableAssert).isSameAs(tableAssert2);
@@ -50,7 +51,7 @@ public void test_has_number_of_rows_greater_than_or_equal_to() {
*/
@Test
public void should_fail_because_number_of_rows_is_less() {
- Request request = new Request(source, "select * from actor");
+ Request request = new Request(jdbcConnectionProvider, "select * from actor");
try {
assertThat(request).hasNumberOfRowsGreaterThanOrEqualTo(9);
fail("An exception must be raised");
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnNumberOfRows_HasNumberOfRowsGreaterThan_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnNumberOfRows_HasNumberOfRowsGreaterThan_Test.java
index fb6b4563..a1398277 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnNumberOfRows_HasNumberOfRowsGreaterThan_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnNumberOfRows_HasNumberOfRowsGreaterThan_Test.java
@@ -28,6 +28,7 @@
* {@link org.assertj.db.api.assertions.AssertOnNumberOfRows#hasNumberOfRowsGreaterThan(int)} method.
*
* @author Régis Pouiller
+ * @author Julien Roy
*/
public class AssertOnNumberOfRows_HasNumberOfRowsGreaterThan_Test extends AbstractTest {
@@ -36,7 +37,7 @@ public class AssertOnNumberOfRows_HasNumberOfRowsGreaterThan_Test extends Abstra
*/
@Test
public void test_has_number_of_rows_greater_than() {
- Table table = new Table(source, "actor");
+ Table table = new Table(jdbcConnectionProvider, "actor");
TableAssert tableAssert = assertThat(table);
TableAssert tableAssert2 = tableAssert.hasNumberOfRowsGreaterThan(2);
Assertions.assertThat(tableAssert).isSameAs(tableAssert2);
@@ -50,7 +51,7 @@ public void test_has_number_of_rows_greater_than() {
*/
@Test
public void should_fail_because_number_of_rows_is_less_or_equal() {
- Request request = new Request(source, "select * from actor");
+ Request request = new Request(jdbcConnectionProvider, "select * from actor");
try {
assertThat(request).hasNumberOfRowsGreaterThan(9);
fail("An exception must be raised");
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnNumberOfRows_HasNumberOfRowsLessThanOrEqualTo_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnNumberOfRows_HasNumberOfRowsLessThanOrEqualTo_Test.java
index 29c51993..148c8cbe 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnNumberOfRows_HasNumberOfRowsLessThanOrEqualTo_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnNumberOfRows_HasNumberOfRowsLessThanOrEqualTo_Test.java
@@ -28,6 +28,7 @@
* {@link org.assertj.db.api.assertions.AssertOnNumberOfRows#hasNumberOfRowsLessThanOrEqualTo(int)} method.
*
* @author Régis Pouiller
+ * @author Julien Roy
*/
public class AssertOnNumberOfRows_HasNumberOfRowsLessThanOrEqualTo_Test extends AbstractTest {
@@ -36,7 +37,7 @@ public class AssertOnNumberOfRows_HasNumberOfRowsLessThanOrEqualTo_Test extends
*/
@Test
public void test_has_number_of_rows_less_than_or_equal_to() {
- Table table = new Table(source, "actor");
+ Table table = new Table(jdbcConnectionProvider, "actor");
TableAssert tableAssert = assertThat(table);
TableAssert tableAssert2 = tableAssert.hasNumberOfRowsLessThanOrEqualTo(3);
Assertions.assertThat(tableAssert).isSameAs(tableAssert2);
@@ -50,7 +51,7 @@ public void test_has_number_of_rows_less_than_or_equal_to() {
*/
@Test
public void should_fail_because_number_of_rows_is_greater() {
- Request request = new Request(source, "select * from actor");
+ Request request = new Request(jdbcConnectionProvider, "select * from actor");
try {
assertThat(request).hasNumberOfRowsLessThanOrEqualTo(2);
fail("An exception must be raised");
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnNumberOfRows_HasNumberOfRowsLessThan_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnNumberOfRows_HasNumberOfRowsLessThan_Test.java
index aae43606..4669ee4e 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnNumberOfRows_HasNumberOfRowsLessThan_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnNumberOfRows_HasNumberOfRowsLessThan_Test.java
@@ -28,6 +28,7 @@
* {@link org.assertj.db.api.assertions.AssertOnNumberOfRows#hasNumberOfRowsLessThan(int)} method.
*
* @author Régis Pouiller
+ * @author Julien Roy
*/
public class AssertOnNumberOfRows_HasNumberOfRowsLessThan_Test extends AbstractTest {
@@ -36,7 +37,7 @@ public class AssertOnNumberOfRows_HasNumberOfRowsLessThan_Test extends AbstractT
*/
@Test
public void test_has_number_of_rows_less_than() {
- Table table = new Table(source, "actor");
+ Table table = new Table(jdbcConnectionProvider, "actor");
TableAssert tableAssert = assertThat(table);
TableAssert tableAssert2 = tableAssert.hasNumberOfRowsLessThan(4);
Assertions.assertThat(tableAssert).isSameAs(tableAssert2);
@@ -50,7 +51,7 @@ public void test_has_number_of_rows_less_than() {
*/
@Test
public void should_fail_because_number_of_rows_is_greater_or_equal() {
- Request request = new Request(source, "select * from actor");
+ Request request = new Request(jdbcConnectionProvider, "select * from actor");
try {
assertThat(request).hasNumberOfRowsLessThan(2);
fail("An exception must be raised");
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnNumberOfRows_HasNumberOfRows_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnNumberOfRows_HasNumberOfRows_Test.java
index aec45441..76cdf01a 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnNumberOfRows_HasNumberOfRows_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnNumberOfRows_HasNumberOfRows_Test.java
@@ -28,6 +28,7 @@
* {@link org.assertj.db.api.assertions.AssertOnNumberOfRows#hasNumberOfRows(int)} method.
*
* @author Régis Pouiller
+ * @author Julien Roy
*/
public class AssertOnNumberOfRows_HasNumberOfRows_Test extends AbstractTest {
@@ -36,7 +37,7 @@ public class AssertOnNumberOfRows_HasNumberOfRows_Test extends AbstractTest {
*/
@Test
public void test_has_number_of_rows() {
- Table table = new Table(source, "actor");
+ Table table = new Table(jdbcConnectionProvider, "actor");
TableAssert tableAssert = assertThat(table);
TableAssert tableAssert2 = tableAssert.hasNumberOfRows(3);
Assertions.assertThat(tableAssert).isSameAs(tableAssert2);
@@ -50,7 +51,7 @@ public void test_has_number_of_rows() {
*/
@Test
public void should_fail_because_number_of_rows_is_different() {
- Request request = new Request(source, "select * from actor");
+ Request request = new Request(jdbcConnectionProvider, "select * from actor");
try {
assertThat(request).hasNumberOfRows(9);
fail("An exception must be raised");
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnNumberOfRows_IsEmpty_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnNumberOfRows_IsEmpty_Test.java
index f9752ca0..f9a3e927 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnNumberOfRows_IsEmpty_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnNumberOfRows_IsEmpty_Test.java
@@ -37,7 +37,7 @@ public class AssertOnNumberOfRows_IsEmpty_Test extends AbstractTest {
@Test
public void test_is_empty() {
update("delete from test");
- Table table = new Table(source, "test");
+ Table table = new Table(jdbcConnectionProvider, "test");
TableAssert tableAssert = assertThat(table);
TableAssert tableAssert2 = tableAssert.isEmpty();
Assertions.assertThat(tableAssert).isSameAs(tableAssert2);
@@ -51,7 +51,7 @@ public void test_is_empty() {
*/
@Test
public void should_fail_because_table_is_not_empty() {
- Request request = new Request(source, "select * from actor");
+ Request request = new Request(jdbcConnectionProvider, "select * from actor");
try {
assertThat(request).isEmpty();
fail("An exception must be raised");
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnPrimaryKey_HasPksNames_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnPrimaryKey_HasPksNames_Test.java
index 06e8a4b2..6292ab5f 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnPrimaryKey_HasPksNames_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnPrimaryKey_HasPksNames_Test.java
@@ -27,6 +27,7 @@
* {@link org.assertj.db.api.assertions.AssertOnPrimaryKey#hasPksNames(String...)} method.
*
* @author Régis Pouiller
+ * @author Julien Roy
*/
public class AssertOnPrimaryKey_HasPksNames_Test extends AbstractTest {
@@ -36,7 +37,7 @@ public class AssertOnPrimaryKey_HasPksNames_Test extends AbstractTest {
@Test
@NeedReload
public void test_has_pks_names() throws Exception {
- Changes changes = new Changes(source).setStartPointNow();
+ Changes changes = new Changes(jdbcConnectionProvider).setStartPointNow();
updateChangesForTests();
changes.setEndPointNow();
@@ -51,7 +52,7 @@ public void test_has_pks_names() throws Exception {
@Test
@NeedReload
public void should_fail_because_pks_names_are_different() throws Exception {
- Changes changes = new Changes(source).setStartPointNow();
+ Changes changes = new Changes(jdbcConnectionProvider).setStartPointNow();
updateChangesForTests();
changes.setEndPointNow();
@@ -59,7 +60,7 @@ public void should_fail_because_pks_names_are_different() throws Exception {
assertThat(changes).change().hasPksNames("ID2");
fail("An exception must be raised");
} catch (AssertionError e) {
- Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Change at index 0 (on table : ACTOR and with primary key : [4]) of Changes on tables of 'sa/jdbc:h2:mem:test' source] %n"
+ Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Change at index 0 (on table : ACTOR and with primary key : [4]) of Changes on tables of 'sa/jdbc:h2:mem:test'] %n"
+ "Expecting :%n"
+ " [\"ID2\"]%n"
+ "to be the name of the columns of the primary keys but was:%n"
@@ -73,7 +74,7 @@ public void should_fail_because_pks_names_are_different() throws Exception {
@Test
@NeedReload
public void should_fail_because_number_of_pks_names_are_different() throws Exception {
- Changes changes = new Changes(source).setStartPointNow();
+ Changes changes = new Changes(jdbcConnectionProvider).setStartPointNow();
updateChangesForTests();
changes.setEndPointNow();
@@ -81,7 +82,7 @@ public void should_fail_because_number_of_pks_names_are_different() throws Excep
assertThat(changes).change().hasPksNames("ID", "ID2");
fail("An exception must be raised");
} catch (AssertionError e) {
- Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Change at index 0 (on table : ACTOR and with primary key : [4]) of Changes on tables of 'sa/jdbc:h2:mem:test' source] %n"
+ Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Change at index 0 (on table : ACTOR and with primary key : [4]) of Changes on tables of 'sa/jdbc:h2:mem:test'] %n"
+ "Expecting :%n"
+ " [\"ID\", \"ID2\"]%n"
+ "to be the name of the columns of the primary keys but was:%n"
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnPrimaryKey_HasPksValues_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnPrimaryKey_HasPksValues_Test.java
index c3b19419..049b9c90 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnPrimaryKey_HasPksValues_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnPrimaryKey_HasPksValues_Test.java
@@ -12,9 +12,6 @@
*/
package org.assertj.db.api.assertions;
-import static org.assertj.db.api.Assertions.assertThat;
-import static org.junit.Assert.fail;
-
import org.assertj.core.api.Assertions;
import org.assertj.db.api.ChangeAssert;
import org.assertj.db.common.AbstractTest;
@@ -22,11 +19,15 @@
import org.assertj.db.type.Changes;
import org.junit.Test;
+import static org.assertj.db.api.Assertions.assertThat;
+import static org.junit.Assert.fail;
+
/**
* Tests on {@link org.assertj.db.api.assertions.AssertOnPrimaryKey} class :
* {@link org.assertj.db.api.assertions.AssertOnPrimaryKey#hasPksValues(Object...)} method.
*
* @author Régis Pouiller
+ * @author Julien Roy
*/
public class AssertOnPrimaryKey_HasPksValues_Test extends AbstractTest {
@@ -36,7 +37,7 @@ public class AssertOnPrimaryKey_HasPksValues_Test extends AbstractTest {
@Test
@NeedReload
public void test_has_pks_values() throws Exception {
- Changes changes = new Changes(source).setStartPointNow();
+ Changes changes = new Changes(jdbcConnectionProvider).setStartPointNow();
updateChangesForTests();
changes.setEndPointNow();
@@ -51,7 +52,7 @@ public void test_has_pks_values() throws Exception {
@Test
@NeedReload
public void should_fail_because_pks_values_are_different() throws Exception {
- Changes changes = new Changes(source).setStartPointNow();
+ Changes changes = new Changes(jdbcConnectionProvider).setStartPointNow();
updateChangesForTests();
changes.setEndPointNow();
@@ -59,7 +60,7 @@ public void should_fail_because_pks_values_are_different() throws Exception {
assertThat(changes).change().hasPksValues(5);
fail("An exception must be raised");
} catch (AssertionError e) {
- Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Change at index 0 (on table : ACTOR and with primary key : [4]) of Changes on tables of 'sa/jdbc:h2:mem:test' source] %n"
+ Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Change at index 0 (on table : ACTOR and with primary key : [4]) of Changes on tables of 'sa/jdbc:h2:mem:test'] %n"
+ "Expecting :%n"
+ " [5]%n"
+ "to be the values of the columns of the primary keys but was:%n"
@@ -73,7 +74,7 @@ public void should_fail_because_pks_values_are_different() throws Exception {
@Test
@NeedReload
public void should_fail_because_number_of_pks_values_are_different() throws Exception {
- Changes changes = new Changes(source).setStartPointNow();
+ Changes changes = new Changes(jdbcConnectionProvider).setStartPointNow();
updateChangesForTests();
changes.setEndPointNow();
@@ -81,7 +82,7 @@ public void should_fail_because_number_of_pks_values_are_different() throws Exce
assertThat(changes).change().hasPksValues(4, "ID2");
fail("An exception must be raised");
} catch (AssertionError e) {
- Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Change at index 0 (on table : ACTOR and with primary key : [4]) of Changes on tables of 'sa/jdbc:h2:mem:test' source] %n"
+ Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Change at index 0 (on table : ACTOR and with primary key : [4]) of Changes on tables of 'sa/jdbc:h2:mem:test'] %n"
+ "Expecting :%n"
+ " [4, \"ID2\"]%n"
+ "to be the values of the columns of the primary keys but was:%n"
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnRowCondition_HasValuesSatisfying_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnRowCondition_HasValuesSatisfying_Test.java
index 5dc3b4a9..16cdc3e4 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnRowCondition_HasValuesSatisfying_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnRowCondition_HasValuesSatisfying_Test.java
@@ -42,7 +42,7 @@ public class AssertOnRowCondition_HasValuesSatisfying_Test extends AbstractTest
@Test
@NeedReload
public void test_has_values() {
- Table table = new Table(source, "actor");
+ Table table = new Table(jdbcConnectionProvider, "actor");
Changes changes = new Changes(table).setStartPointNow();
updateChangesForTests();
changes.setEndPointNow();
@@ -90,7 +90,7 @@ public void test_has_values() {
@Test
@NeedReload
public void should_fail_because_values_are_different() {
- Table table = new Table(source, "actor");
+ Table table = new Table(jdbcConnectionProvider, "actor");
Changes changes = new Changes(table).setStartPointNow();
updateChangesForTests();
changes.setEndPointNow();
@@ -106,7 +106,7 @@ public void should_fail_because_values_are_different() {
);
} catch (AssertionError e) {
Assertions.assertThat(e.getMessage()).isEqualTo(String.format(
- "[Row at end point of Change at index 0 (with primary key : [4]) of Changes on ACTOR table of 'sa/jdbc:h2:mem:test' source] %n"
+ "[Row at end point of Change at index 0 (with primary key : [4]) of Changes on ACTOR table of 'sa/jdbc:h2:mem:test'] %n"
+ "Expecting that the value at index 2:%n"
+ " \"Bill\"%n"
+ "to satisfy: %n"
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnRowEquality_HasValues_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnRowEquality_HasValues_Test.java
index dc37ea4f..63a6dc52 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnRowEquality_HasValues_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnRowEquality_HasValues_Test.java
@@ -30,6 +30,7 @@
* {@link org.assertj.db.api.assertions.AssertOnRowEquality#hasValues(Object...)} method.
*
* @author Régis Pouiller
+ * @author Julien Roy
*/
public class AssertOnRowEquality_HasValues_Test extends AbstractTest {
@@ -39,7 +40,7 @@ public class AssertOnRowEquality_HasValues_Test extends AbstractTest {
@Test
@NeedReload
public void test_has_values() {
- Table table = new Table(source, "actor");
+ Table table = new Table(jdbcConnectionProvider, "actor");
Changes changes = new Changes(table).setStartPointNow();
updateChangesForTests();
changes.setEndPointNow();
@@ -62,7 +63,7 @@ public void test_has_values() {
@Test
@NeedReload
public void should_fail_because_values_are_different() {
- Table table = new Table(source, "actor");
+ Table table = new Table(jdbcConnectionProvider, "actor");
Changes changes = new Changes(table).setStartPointNow();
updateChangesForTests();
changes.setEndPointNow();
@@ -70,7 +71,7 @@ public void should_fail_because_values_are_different() {
try {
assertThat(changes).change().rowAtEndPoint().hasValues(4, "Murray", "Billy", "1950-09-21", UUID.fromString("30B443AE-C0C9-4790-9BEC-CE1380808435"));
} catch (AssertionError e) {
- Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Row at end point of Change at index 0 (with primary key : [4]) of Changes on ACTOR table of 'sa/jdbc:h2:mem:test' source] %n"
+ Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Row at end point of Change at index 0 (with primary key : [4]) of Changes on ACTOR table of 'sa/jdbc:h2:mem:test'] %n"
+ "Expecting that the value at index 2:%n"
+ " <\"Bill\">%n"
+ "to be equal to: %n"
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnRowNullity_HasOnlyNotNullValues_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnRowNullity_HasOnlyNotNullValues_Test.java
index 8d9418be..13b1343e 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnRowNullity_HasOnlyNotNullValues_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnRowNullity_HasOnlyNotNullValues_Test.java
@@ -32,7 +32,7 @@ public class AssertOnRowNullity_HasOnlyNotNullValues_Test extends AbstractTest {
*/
@Test
public void test_has_only_not_null_values() {
- Table table = new Table(source, "test");
+ Table table = new Table(jdbcConnectionProvider, "test");
TableRowAssert tableRowAssert = assertThat(table).row();
TableRowAssert tableRowAssert2 = tableRowAssert.hasOnlyNotNullValues();
Assertions.assertThat(tableRowAssert).isSameAs(tableRowAssert2);
@@ -43,7 +43,7 @@ public void test_has_only_not_null_values() {
*/
@Test
public void should_fail_because_row_has_null_value() throws Exception {
- Table table = new Table(source, "test2");
+ Table table = new Table(jdbcConnectionProvider, "test2");
TableRowAssert tableRowAssert = assertThat(table).row().row();
try {
tableRowAssert.hasOnlyNotNullValues();
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnRowOfChangeExistence_DoesNotExist_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnRowOfChangeExistence_DoesNotExist_Test.java
index 341399db..e90fa6a6 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnRowOfChangeExistence_DoesNotExist_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnRowOfChangeExistence_DoesNotExist_Test.java
@@ -26,6 +26,7 @@
* {@link org.assertj.db.api.assertions.AssertOnRowOfChangeExistence#doesNotExist()} method.
*
* @author Régis Pouiller
+ * @author Julien Roy
*/
public class AssertOnRowOfChangeExistence_DoesNotExist_Test extends AbstractTest {
@@ -35,7 +36,7 @@ public class AssertOnRowOfChangeExistence_DoesNotExist_Test extends AbstractTest
@Test
@NeedReload
public void test_does_not_exists() throws Exception {
- Changes changes = new Changes(source).setStartPointNow();
+ Changes changes = new Changes(jdbcConnectionProvider).setStartPointNow();
updateChangesForTests();
changes.setEndPointNow();
@@ -50,14 +51,14 @@ public void test_does_not_exists() throws Exception {
@Test
@NeedReload
public void should_fail_because_row_exists() throws Exception {
- Changes changes = new Changes(source).setStartPointNow();
+ Changes changes = new Changes(jdbcConnectionProvider).setStartPointNow();
updateChangesForTests();
changes.setEndPointNow();
try {
assertThat(changes).change().rowAtEndPoint().doesNotExist();
} catch (AssertionError e) {
- Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Row at end point of Change at index 0 (on table : ACTOR and with primary key : [4]) of Changes on tables of 'sa/jdbc:h2:mem:test' source] %n"
+ Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Row at end point of Change at index 0 (on table : ACTOR and with primary key : [4]) of Changes on tables of 'sa/jdbc:h2:mem:test'] %n"
+ "Expecting not exist but exists"));
}
}
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnRowOfChangeExistence_Exists_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnRowOfChangeExistence_Exists_Test.java
index f14aad04..d76ee90a 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnRowOfChangeExistence_Exists_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnRowOfChangeExistence_Exists_Test.java
@@ -26,6 +26,7 @@
* {@link org.assertj.db.api.assertions.AssertOnRowOfChangeExistence#exists()} method.
*
* @author Régis Pouiller
+ * @author Julien Roy
*/
public class AssertOnRowOfChangeExistence_Exists_Test extends AbstractTest {
@@ -35,7 +36,7 @@ public class AssertOnRowOfChangeExistence_Exists_Test extends AbstractTest {
@Test
@NeedReload
public void test_exists() throws Exception {
- Changes changes = new Changes(source).setStartPointNow();
+ Changes changes = new Changes(jdbcConnectionProvider).setStartPointNow();
updateChangesForTests();
changes.setEndPointNow();
@@ -50,14 +51,14 @@ public void test_exists() throws Exception {
@Test
@NeedReload
public void should_fail_because_row_does_not_exist() throws Exception {
- Changes changes = new Changes(source).setStartPointNow();
+ Changes changes = new Changes(jdbcConnectionProvider).setStartPointNow();
updateChangesForTests();
changes.setEndPointNow();
try {
assertThat(changes).change().rowAtStartPoint().exists();
} catch (AssertionError e) {
- Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Row at start point of Change at index 0 (on table : ACTOR and with primary key : [4]) of Changes on tables of 'sa/jdbc:h2:mem:test' source] %n"
+ Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Row at start point of Change at index 0 (on table : ACTOR and with primary key : [4]) of Changes on tables of 'sa/jdbc:h2:mem:test'] %n"
+ "Expecting exist but do not exist"));
}
}
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnValueChronology_IsAfterOrEqualTo_DateTimeValue_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnValueChronology_IsAfterOrEqualTo_DateTimeValue_Test.java
index d6320924..68b7dc6c 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnValueChronology_IsAfterOrEqualTo_DateTimeValue_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnValueChronology_IsAfterOrEqualTo_DateTimeValue_Test.java
@@ -32,6 +32,7 @@
* {@link org.assertj.db.api.assertions.AssertOnValueChronology#isAfterOrEqualTo(org.assertj.db.type.DateTimeValue)} method.
*
* @author Régis Pouiller
+ * @author Julien Roy
*/
public class AssertOnValueChronology_IsAfterOrEqualTo_DateTimeValue_Test extends AbstractTest {
@@ -41,7 +42,7 @@ public class AssertOnValueChronology_IsAfterOrEqualTo_DateTimeValue_Test extends
@Test
@NeedReload
public void test_is_after_or_equal_to() throws ParseException {
- Table table = new Table(source, "test");
+ Table table = new Table(jdbcConnectionProvider, "test");
Changes changes = new Changes(table).setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
changes.setEndPointNow();
@@ -63,7 +64,7 @@ public void test_is_after_or_equal_to() throws ParseException {
@Test
@NeedReload
public void should_fail_because_value_is_before() throws ParseException {
- Table table = new Table(source, "test");
+ Table table = new Table(jdbcConnectionProvider, "test");
Changes changes = new Changes(table).setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
changes.setEndPointNow();
@@ -73,7 +74,7 @@ public void should_fail_because_value_is_before() throws ParseException {
DateTimeValue.parse("2014-05-24T09:46:31"));
fail("An exception must be raised");
} catch (AssertionError e) {
- Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Value at end point of Column at index 9 (column name : VAR10) of Change at index 0 (with primary key : [1]) of Changes on TEST table of 'sa/jdbc:h2:mem:test' source] %n"
+ Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Value at end point of Column at index 9 (column name : VAR10) of Change at index 0 (with primary key : [1]) of Changes on TEST table of 'sa/jdbc:h2:mem:test'] %n"
+ "Expecting:%n"
+ " <2014-05-24T09:46:30.000000000>%n"
+ "to be after or equal to %n"
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnValueChronology_IsAfterOrEqualTo_DateValue_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnValueChronology_IsAfterOrEqualTo_DateValue_Test.java
index 41cb9189..909e154b 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnValueChronology_IsAfterOrEqualTo_DateValue_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnValueChronology_IsAfterOrEqualTo_DateValue_Test.java
@@ -32,6 +32,7 @@
* {@link org.assertj.db.api.assertions.AssertOnValueChronology#isAfterOrEqualTo(org.assertj.db.type.DateValue)} method.
*
* @author Régis Pouiller
+ * @author Julien Roy
*/
public class AssertOnValueChronology_IsAfterOrEqualTo_DateValue_Test extends AbstractTest {
@@ -41,7 +42,7 @@ public class AssertOnValueChronology_IsAfterOrEqualTo_DateValue_Test extends Abs
@Test
@NeedReload
public void test_is_after_or_equal_to() throws ParseException {
- Table table = new Table(source, "test");
+ Table table = new Table(jdbcConnectionProvider, "test");
Changes changes = new Changes(table).setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
changes.setEndPointNow();
@@ -63,7 +64,7 @@ public void test_is_after_or_equal_to() throws ParseException {
@Test
@NeedReload
public void should_fail_because_value_is_before() throws ParseException {
- Table table = new Table(source, "test");
+ Table table = new Table(jdbcConnectionProvider, "test");
Changes changes = new Changes(table).setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
changes.setEndPointNow();
@@ -72,7 +73,7 @@ public void should_fail_because_value_is_before() throws ParseException {
assertThat(changes).change().column("var10").valueAtEndPoint().isAfterOrEqualTo(DateValue.parse("2014-05-25"));
fail("An exception must be raised");
} catch (AssertionError e) {
- Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Value at end point of Column at index 9 (column name : VAR10) of Change at index 0 (with primary key : [1]) of Changes on TEST table of 'sa/jdbc:h2:mem:test' source] %n"
+ Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Value at end point of Column at index 9 (column name : VAR10) of Change at index 0 (with primary key : [1]) of Changes on TEST table of 'sa/jdbc:h2:mem:test'] %n"
+ "Expecting:%n"
+ " <2014-05-24T09:46:30.000000000>%n"
+ "to be after or equal to %n"
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnValueChronology_IsAfterOrEqualTo_LocalDateTime_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnValueChronology_IsAfterOrEqualTo_LocalDateTime_Test.java
index c9ccb311..63dedeb3 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnValueChronology_IsAfterOrEqualTo_LocalDateTime_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnValueChronology_IsAfterOrEqualTo_LocalDateTime_Test.java
@@ -40,7 +40,7 @@ public class AssertOnValueChronology_IsAfterOrEqualTo_LocalDateTime_Test extends
@Test
@NeedReload
public void test_is_after_or_equal_to() {
- Table table = new Table(source, "test");
+ Table table = new Table(jdbcConnectionProvider, "test");
Changes changes = new Changes(table).setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
changes.setEndPointNow();
@@ -60,7 +60,7 @@ public void test_is_after_or_equal_to() {
@Test
@NeedReload
public void should_fail_because_value_is_before() {
- Table table = new Table(source, "test");
+ Table table = new Table(jdbcConnectionProvider, "test");
Changes changes = new Changes(table).setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
changes.setEndPointNow();
@@ -69,7 +69,7 @@ public void should_fail_because_value_is_before() {
assertThat(changes).change().column("var10").valueAtEndPoint().isAfterOrEqualTo(LocalDateTime.of(2014, 5, 24, 9, 46, 31));
fail("An exception must be raised");
} catch (AssertionError e) {
- Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Value at end point of Column at index 9 (column name : VAR10) of Change at index 0 (with primary key : [1]) of Changes on TEST table of 'sa/jdbc:h2:mem:test' source] %n"
+ Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Value at end point of Column at index 9 (column name : VAR10) of Change at index 0 (with primary key : [1]) of Changes on TEST table of 'sa/jdbc:h2:mem:test'] %n"
+ "Expecting:%n"
+ " <2014-05-24T09:46:30.000000000>%n"
+ "to be after or equal to %n"
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnValueChronology_IsAfterOrEqualTo_LocalDate_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnValueChronology_IsAfterOrEqualTo_LocalDate_Test.java
index b4068fe9..099bc8f8 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnValueChronology_IsAfterOrEqualTo_LocalDate_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnValueChronology_IsAfterOrEqualTo_LocalDate_Test.java
@@ -40,7 +40,7 @@ public class AssertOnValueChronology_IsAfterOrEqualTo_LocalDate_Test extends Abs
@Test
@NeedReload
public void test_is_after_or_equal_to() {
- Table table = new Table(source, "test");
+ Table table = new Table(jdbcConnectionProvider, "test");
Changes changes = new Changes(table).setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
changes.setEndPointNow();
@@ -60,7 +60,7 @@ public void test_is_after_or_equal_to() {
@Test
@NeedReload
public void should_fail_because_value_is_before() {
- Table table = new Table(source, "test");
+ Table table = new Table(jdbcConnectionProvider, "test");
Changes changes = new Changes(table).setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
changes.setEndPointNow();
@@ -69,7 +69,7 @@ public void should_fail_because_value_is_before() {
assertThat(changes).change().column("var10").valueAtEndPoint().isAfterOrEqualTo(LocalDate.of(2014, 5, 25));
fail("An exception must be raised");
} catch (AssertionError e) {
- Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Value at end point of Column at index 9 (column name : VAR10) of Change at index 0 (with primary key : [1]) of Changes on TEST table of 'sa/jdbc:h2:mem:test' source] %n"
+ Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Value at end point of Column at index 9 (column name : VAR10) of Change at index 0 (with primary key : [1]) of Changes on TEST table of 'sa/jdbc:h2:mem:test'] %n"
+ "Expecting:%n"
+ " <2014-05-24T09:46:30.000000000>%n"
+ "to be after or equal to %n"
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnValueChronology_IsAfterOrEqualTo_LocalTime_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnValueChronology_IsAfterOrEqualTo_LocalTime_Test.java
index 9e27a4fe..04af4ae3 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnValueChronology_IsAfterOrEqualTo_LocalTime_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnValueChronology_IsAfterOrEqualTo_LocalTime_Test.java
@@ -40,7 +40,7 @@ public class AssertOnValueChronology_IsAfterOrEqualTo_LocalTime_Test extends Abs
@Test
@NeedReload
public void test_is_after_or_equal_to() {
- Table table = new Table(source, "test");
+ Table table = new Table(jdbcConnectionProvider, "test");
Changes changes = new Changes(table).setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
changes.setEndPointNow();
@@ -60,7 +60,7 @@ public void test_is_after_or_equal_to() {
@Test
@NeedReload
public void should_fail_because_value_is_before() {
- Table table = new Table(source, "test");
+ Table table = new Table(jdbcConnectionProvider, "test");
Changes changes = new Changes(table).setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
changes.setEndPointNow();
@@ -69,7 +69,7 @@ public void should_fail_because_value_is_before() {
assertThat(changes).change().column("var8").valueAtEndPoint().isAfterOrEqualTo(LocalTime.of(9, 46, 31));
fail("An exception must be raised");
} catch (AssertionError e) {
- Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Value at end point of Column at index 7 (column name : VAR8) of Change at index 0 (with primary key : [1]) of Changes on TEST table of 'sa/jdbc:h2:mem:test' source] %n"
+ Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Value at end point of Column at index 7 (column name : VAR8) of Change at index 0 (with primary key : [1]) of Changes on TEST table of 'sa/jdbc:h2:mem:test'] %n"
+ "Expecting:%n"
+ " <09:46:30.000000000>%n"
+ "to be after or equal to %n"
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnValueChronology_IsAfterOrEqualTo_String_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnValueChronology_IsAfterOrEqualTo_String_Test.java
index 508ebe6c..9c60dca2 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnValueChronology_IsAfterOrEqualTo_String_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnValueChronology_IsAfterOrEqualTo_String_Test.java
@@ -29,6 +29,7 @@
* {@link org.assertj.db.api.assertions.AssertOnValueChronology#isAfterOrEqualTo(org.assertj.db.type.DateTimeValue)} method.
*
* @author Régis Pouiller
+ * @author Julien Roy
*/
public class AssertOnValueChronology_IsAfterOrEqualTo_String_Test extends AbstractTest {
@@ -38,7 +39,7 @@ public class AssertOnValueChronology_IsAfterOrEqualTo_String_Test extends Abstra
@Test
@NeedReload
public void test_is_after_or_equal_to() {
- Table table = new Table(source, "test");
+ Table table = new Table(jdbcConnectionProvider, "test");
Changes changes = new Changes(table).setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
changes.setEndPointNow();
@@ -58,7 +59,7 @@ public void test_is_after_or_equal_to() {
@Test
@NeedReload
public void should_fail_because_value_is_before() {
- Table table = new Table(source, "test");
+ Table table = new Table(jdbcConnectionProvider, "test");
Changes changes = new Changes(table).setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
changes.setEndPointNow();
@@ -67,7 +68,7 @@ public void should_fail_because_value_is_before() {
assertThat(changes).change().column("var10").valueAtEndPoint().isAfterOrEqualTo("2014-05-25");
fail("An exception must be raised");
} catch (AssertionError e) {
- Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Value at end point of Column at index 9 (column name : VAR10) of Change at index 0 (with primary key : [1]) of Changes on TEST table of 'sa/jdbc:h2:mem:test' source] %n"
+ Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Value at end point of Column at index 9 (column name : VAR10) of Change at index 0 (with primary key : [1]) of Changes on TEST table of 'sa/jdbc:h2:mem:test'] %n"
+ "Expecting:%n"
+ " <2014-05-24T09:46:30.000000000>%n"
+ "to be after or equal to %n"
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnValueChronology_IsAfterOrEqualTo_TimeValue_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnValueChronology_IsAfterOrEqualTo_TimeValue_Test.java
index 9c754458..6ee24bdb 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnValueChronology_IsAfterOrEqualTo_TimeValue_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnValueChronology_IsAfterOrEqualTo_TimeValue_Test.java
@@ -32,6 +32,7 @@
* {@link org.assertj.db.api.assertions.AssertOnValueChronology#isAfterOrEqualTo(org.assertj.db.type.TimeValue)} method.
*
* @author Régis Pouiller
+ * @author Julien Roy
*/
public class AssertOnValueChronology_IsAfterOrEqualTo_TimeValue_Test extends AbstractTest {
@@ -41,7 +42,7 @@ public class AssertOnValueChronology_IsAfterOrEqualTo_TimeValue_Test extends Abs
@Test
@NeedReload
public void test_is_after_or_equal_to() throws ParseException {
- Table table = new Table(source, "test");
+ Table table = new Table(jdbcConnectionProvider, "test");
Changes changes = new Changes(table).setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
changes.setEndPointNow();
@@ -63,7 +64,7 @@ public void test_is_after_or_equal_to() throws ParseException {
@Test
@NeedReload
public void should_fail_because_value_is_before() throws ParseException {
- Table table = new Table(source, "test");
+ Table table = new Table(jdbcConnectionProvider, "test");
Changes changes = new Changes(table).setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
changes.setEndPointNow();
@@ -72,7 +73,7 @@ public void should_fail_because_value_is_before() throws ParseException {
assertThat(changes).change().column("var8").valueAtEndPoint().isAfterOrEqualTo(TimeValue.parse("09:46:31"));
fail("An exception must be raised");
} catch (AssertionError e) {
- Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Value at end point of Column at index 7 (column name : VAR8) of Change at index 0 (with primary key : [1]) of Changes on TEST table of 'sa/jdbc:h2:mem:test' source] %n"
+ Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Value at end point of Column at index 7 (column name : VAR8) of Change at index 0 (with primary key : [1]) of Changes on TEST table of 'sa/jdbc:h2:mem:test'] %n"
+ "Expecting:%n"
+ " <09:46:30.000000000>%n"
+ "to be after or equal to %n"
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnValueChronology_IsAfter_DateTimeValue_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnValueChronology_IsAfter_DateTimeValue_Test.java
index fc7dc21b..9fada804 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnValueChronology_IsAfter_DateTimeValue_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnValueChronology_IsAfter_DateTimeValue_Test.java
@@ -32,6 +32,7 @@
* {@link org.assertj.db.api.assertions.AssertOnValueChronology#isAfter(org.assertj.db.type.DateTimeValue)} method.
*
* @author Régis Pouiller
+ * @author Julien Roy
*/
public class AssertOnValueChronology_IsAfter_DateTimeValue_Test extends AbstractTest {
@@ -41,7 +42,7 @@ public class AssertOnValueChronology_IsAfter_DateTimeValue_Test extends Abstract
@Test
@NeedReload
public void test_is_after() throws ParseException {
- Table table = new Table(source, "test");
+ Table table = new Table(jdbcConnectionProvider, "test");
Changes changes = new Changes(table).setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
changes.setEndPointNow();
@@ -61,7 +62,7 @@ public void test_is_after() throws ParseException {
@Test
@NeedReload
public void should_fail_because_value_is_before_or_equal_to() throws ParseException {
- Table table = new Table(source, "test");
+ Table table = new Table(jdbcConnectionProvider, "test");
Changes changes = new Changes(table).setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
changes.setEndPointNow();
@@ -70,7 +71,7 @@ public void should_fail_because_value_is_before_or_equal_to() throws ParseExcept
assertThat(changes).change().column("var10").valueAtEndPoint().isAfter(DateTimeValue.parse("2014-05-24T09:46:30"));
fail("An exception must be raised");
} catch (AssertionError e) {
- Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Value at end point of Column at index 9 (column name : VAR10) of Change at index 0 (with primary key : [1]) of Changes on TEST table of 'sa/jdbc:h2:mem:test' source] %n"
+ Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Value at end point of Column at index 9 (column name : VAR10) of Change at index 0 (with primary key : [1]) of Changes on TEST table of 'sa/jdbc:h2:mem:test'] %n"
+ "Expecting:%n"
+ " <2014-05-24T09:46:30.000000000>%n"
+ "to be after %n"
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnValueChronology_IsAfter_DateValue_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnValueChronology_IsAfter_DateValue_Test.java
index f7e3d1ba..67f12022 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnValueChronology_IsAfter_DateValue_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnValueChronology_IsAfter_DateValue_Test.java
@@ -32,6 +32,7 @@
* {@link org.assertj.db.api.assertions.AssertOnValueChronology#isAfter(org.assertj.db.type.DateValue)} method.
*
* @author Régis Pouiller
+ * @author Julien Roy
*/
public class AssertOnValueChronology_IsAfter_DateValue_Test extends AbstractTest {
@@ -41,7 +42,7 @@ public class AssertOnValueChronology_IsAfter_DateValue_Test extends AbstractTest
@Test
@NeedReload
public void test_is_after() throws ParseException {
- Table table = new Table(source, "test");
+ Table table = new Table(jdbcConnectionProvider, "test");
Changes changes = new Changes(table).setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
changes.setEndPointNow();
@@ -62,7 +63,7 @@ public void test_is_after() throws ParseException {
@Test
@NeedReload
public void should_fail_because_value_is_before_or_equal_to() throws ParseException {
- Table table = new Table(source, "test");
+ Table table = new Table(jdbcConnectionProvider, "test");
Changes changes = new Changes(table).setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
changes.setEndPointNow();
@@ -71,7 +72,7 @@ public void should_fail_because_value_is_before_or_equal_to() throws ParseExcept
assertThat(changes).change().column("var10").valueAtEndPoint().isAfter(DateValue.parse("2014-05-25"));
fail("An exception must be raised");
} catch (AssertionError e) {
- Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Value at end point of Column at index 9 (column name : VAR10) of Change at index 0 (with primary key : [1]) of Changes on TEST table of 'sa/jdbc:h2:mem:test' source] %n"
+ Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Value at end point of Column at index 9 (column name : VAR10) of Change at index 0 (with primary key : [1]) of Changes on TEST table of 'sa/jdbc:h2:mem:test'] %n"
+ "Expecting:%n"
+ " <2014-05-24T09:46:30.000000000>%n"
+ "to be after %n"
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnValueChronology_IsAfter_LocalDateTime_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnValueChronology_IsAfter_LocalDateTime_Test.java
index 1d73a65d..50c76b8e 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnValueChronology_IsAfter_LocalDateTime_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnValueChronology_IsAfter_LocalDateTime_Test.java
@@ -40,7 +40,7 @@ public class AssertOnValueChronology_IsAfter_LocalDateTime_Test extends Abstract
@Test
@NeedReload
public void test_is_after() {
- Table table = new Table(source, "test");
+ Table table = new Table(jdbcConnectionProvider, "test");
Changes changes = new Changes(table).setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
changes.setEndPointNow();
@@ -60,7 +60,7 @@ public void test_is_after() {
@Test
@NeedReload
public void should_fail_because_value_is_before_or_equal_to() {
- Table table = new Table(source, "test");
+ Table table = new Table(jdbcConnectionProvider, "test");
Changes changes = new Changes(table).setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
changes.setEndPointNow();
@@ -69,7 +69,7 @@ public void should_fail_because_value_is_before_or_equal_to() {
assertThat(changes).change().column("var10").valueAtEndPoint().isAfter(LocalDateTime.of(2014, 5, 24, 9, 46, 30));
fail("An exception must be raised");
} catch (AssertionError e) {
- Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Value at end point of Column at index 9 (column name : VAR10) of Change at index 0 (with primary key : [1]) of Changes on TEST table of 'sa/jdbc:h2:mem:test' source] %n"
+ Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Value at end point of Column at index 9 (column name : VAR10) of Change at index 0 (with primary key : [1]) of Changes on TEST table of 'sa/jdbc:h2:mem:test'] %n"
+ "Expecting:%n"
+ " <2014-05-24T09:46:30.000000000>%n"
+ "to be after %n"
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnValueChronology_IsAfter_LocalDate_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnValueChronology_IsAfter_LocalDate_Test.java
index 09e9a9f3..58408a0d 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnValueChronology_IsAfter_LocalDate_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnValueChronology_IsAfter_LocalDate_Test.java
@@ -40,7 +40,7 @@ public class AssertOnValueChronology_IsAfter_LocalDate_Test extends AbstractTest
@Test
@NeedReload
public void test_is_after() {
- Table table = new Table(source, "test");
+ Table table = new Table(jdbcConnectionProvider, "test");
Changes changes = new Changes(table).setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
changes.setEndPointNow();
@@ -60,7 +60,7 @@ public void test_is_after() {
@Test
@NeedReload
public void should_fail_because_value_is_before_or_equal_to() {
- Table table = new Table(source, "test");
+ Table table = new Table(jdbcConnectionProvider, "test");
Changes changes = new Changes(table).setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
changes.setEndPointNow();
@@ -69,7 +69,7 @@ public void should_fail_because_value_is_before_or_equal_to() {
assertThat(changes).change().column("var10").valueAtEndPoint().isAfter(LocalDate.of(2014, 5, 25));
fail("An exception must be raised");
} catch (AssertionError e) {
- Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Value at end point of Column at index 9 (column name : VAR10) of Change at index 0 (with primary key : [1]) of Changes on TEST table of 'sa/jdbc:h2:mem:test' source] %n"
+ Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Value at end point of Column at index 9 (column name : VAR10) of Change at index 0 (with primary key : [1]) of Changes on TEST table of 'sa/jdbc:h2:mem:test'] %n"
+ "Expecting:%n"
+ " <2014-05-24T09:46:30.000000000>%n"
+ "to be after %n"
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnValueChronology_IsAfter_LocalTime_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnValueChronology_IsAfter_LocalTime_Test.java
index 54f60a52..e9d4f258 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnValueChronology_IsAfter_LocalTime_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnValueChronology_IsAfter_LocalTime_Test.java
@@ -40,7 +40,7 @@ public class AssertOnValueChronology_IsAfter_LocalTime_Test extends AbstractTest
@Test
@NeedReload
public void test_is_after() {
- Table table = new Table(source, "test");
+ Table table = new Table(jdbcConnectionProvider, "test");
Changes changes = new Changes(table).setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
changes.setEndPointNow();
@@ -60,7 +60,7 @@ public void test_is_after() {
@Test
@NeedReload
public void should_fail_because_value_is_before_or_equal_to() {
- Table table = new Table(source, "test");
+ Table table = new Table(jdbcConnectionProvider, "test");
Changes changes = new Changes(table).setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
changes.setEndPointNow();
@@ -69,7 +69,7 @@ public void should_fail_because_value_is_before_or_equal_to() {
assertThat(changes).change().column("var8").valueAtEndPoint().isAfter(LocalTime.of(9, 46, 30));
fail("An exception must be raised");
} catch (AssertionError e) {
- Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Value at end point of Column at index 7 (column name : VAR8) of Change at index 0 (with primary key : [1]) of Changes on TEST table of 'sa/jdbc:h2:mem:test' source] %n"
+ Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Value at end point of Column at index 7 (column name : VAR8) of Change at index 0 (with primary key : [1]) of Changes on TEST table of 'sa/jdbc:h2:mem:test'] %n"
+ "Expecting:%n"
+ " <09:46:30.000000000>%n"
+ "to be after %n"
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnValueChronology_IsAfter_String_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnValueChronology_IsAfter_String_Test.java
index 7160cb78..3b084e6b 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnValueChronology_IsAfter_String_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnValueChronology_IsAfter_String_Test.java
@@ -29,6 +29,7 @@
* {@link org.assertj.db.api.assertions.AssertOnValueChronology#isAfter(org.assertj.db.type.DateTimeValue)} method.
*
* @author Régis Pouiller
+ * @author Julien Roy
*/
public class AssertOnValueChronology_IsAfter_String_Test extends AbstractTest {
@@ -38,7 +39,7 @@ public class AssertOnValueChronology_IsAfter_String_Test extends AbstractTest {
@Test
@NeedReload
public void test_is_after() {
- Table table = new Table(source, "test");
+ Table table = new Table(jdbcConnectionProvider, "test");
Changes changes = new Changes(table).setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
changes.setEndPointNow();
@@ -58,7 +59,7 @@ public void test_is_after() {
@Test
@NeedReload
public void should_fail_because_value_is_before_or_equal_to() {
- Table table = new Table(source, "test");
+ Table table = new Table(jdbcConnectionProvider, "test");
Changes changes = new Changes(table).setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
changes.setEndPointNow();
@@ -67,7 +68,7 @@ public void should_fail_because_value_is_before_or_equal_to() {
assertThat(changes).change().column("var10").valueAtEndPoint().isAfter("2014-05-25");
fail("An exception must be raised");
} catch (AssertionError e) {
- Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Value at end point of Column at index 9 (column name : VAR10) of Change at index 0 (with primary key : [1]) of Changes on TEST table of 'sa/jdbc:h2:mem:test' source] %n"
+ Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Value at end point of Column at index 9 (column name : VAR10) of Change at index 0 (with primary key : [1]) of Changes on TEST table of 'sa/jdbc:h2:mem:test'] %n"
+ "Expecting:%n"
+ " <2014-05-24T09:46:30.000000000>%n"
+ "to be after %n"
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnValueChronology_IsAfter_TimeValue_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnValueChronology_IsAfter_TimeValue_Test.java
index aa3498fe..65a77924 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnValueChronology_IsAfter_TimeValue_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnValueChronology_IsAfter_TimeValue_Test.java
@@ -32,6 +32,7 @@
* {@link org.assertj.db.api.assertions.AssertOnValueChronology#isAfter(org.assertj.db.type.TimeValue)} method.
*
* @author Régis Pouiller
+ * @author Julien Roy
*/
public class AssertOnValueChronology_IsAfter_TimeValue_Test extends AbstractTest {
@@ -41,7 +42,7 @@ public class AssertOnValueChronology_IsAfter_TimeValue_Test extends AbstractTest
@Test
@NeedReload
public void test_is_after() throws ParseException {
- Table table = new Table(source, "test");
+ Table table = new Table(jdbcConnectionProvider, "test");
Changes changes = new Changes(table).setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
changes.setEndPointNow();
@@ -61,7 +62,7 @@ public void test_is_after() throws ParseException {
@Test
@NeedReload
public void should_fail_because_value_is_before_or_equal_to() throws ParseException {
- Table table = new Table(source, "test");
+ Table table = new Table(jdbcConnectionProvider, "test");
Changes changes = new Changes(table).setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
changes.setEndPointNow();
@@ -70,7 +71,7 @@ public void should_fail_because_value_is_before_or_equal_to() throws ParseExcept
assertThat(changes).change().column("var8").valueAtEndPoint().isAfter(TimeValue.parse("09:46:30"));
fail("An exception must be raised");
} catch (AssertionError e) {
- Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Value at end point of Column at index 7 (column name : VAR8) of Change at index 0 (with primary key : [1]) of Changes on TEST table of 'sa/jdbc:h2:mem:test' source] %n"
+ Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Value at end point of Column at index 7 (column name : VAR8) of Change at index 0 (with primary key : [1]) of Changes on TEST table of 'sa/jdbc:h2:mem:test'] %n"
+ "Expecting:%n"
+ " <09:46:30.000000000>%n"
+ "to be after %n"
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnValueChronology_IsBeforeOrEqualTo_DateTimeValue_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnValueChronology_IsBeforeOrEqualTo_DateTimeValue_Test.java
index a2751337..3acd718b 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnValueChronology_IsBeforeOrEqualTo_DateTimeValue_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnValueChronology_IsBeforeOrEqualTo_DateTimeValue_Test.java
@@ -32,6 +32,7 @@
* {@link org.assertj.db.api.assertions.AssertOnValueChronology#isBeforeOrEqualTo(org.assertj.db.type.DateTimeValue)} method.
*
* @author Régis Pouiller
+ * @author Julien Roy
*/
public class AssertOnValueChronology_IsBeforeOrEqualTo_DateTimeValue_Test extends AbstractTest {
@@ -41,7 +42,7 @@ public class AssertOnValueChronology_IsBeforeOrEqualTo_DateTimeValue_Test extend
@Test
@NeedReload
public void test_is_before_or_equal_to() throws ParseException {
- Table table = new Table(source, "test");
+ Table table = new Table(jdbcConnectionProvider, "test");
Changes changes = new Changes(table).setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
changes.setEndPointNow();
@@ -62,7 +63,7 @@ public void test_is_before_or_equal_to() throws ParseException {
@Test
@NeedReload
public void should_fail_because_value_is_after() throws ParseException {
- Table table = new Table(source, "test");
+ Table table = new Table(jdbcConnectionProvider, "test");
Changes changes = new Changes(table).setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
changes.setEndPointNow();
@@ -71,7 +72,7 @@ public void should_fail_because_value_is_after() throws ParseException {
assertThat(changes).change().column("var10").valueAtEndPoint().isBeforeOrEqualTo(DateTimeValue.parse("2014-05-24T09:46:29"));
fail("An exception must be raised");
} catch (AssertionError e) {
- Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Value at end point of Column at index 9 (column name : VAR10) of Change at index 0 (with primary key : [1]) of Changes on TEST table of 'sa/jdbc:h2:mem:test' source] %n"
+ Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Value at end point of Column at index 9 (column name : VAR10) of Change at index 0 (with primary key : [1]) of Changes on TEST table of 'sa/jdbc:h2:mem:test'] %n"
+ "Expecting:%n"
+ " <2014-05-24T09:46:30.000000000>%n"
+ "to be before or equal to %n"
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnValueChronology_IsBeforeOrEqualTo_DateValue_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnValueChronology_IsBeforeOrEqualTo_DateValue_Test.java
index aedf5558..396dcff9 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnValueChronology_IsBeforeOrEqualTo_DateValue_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnValueChronology_IsBeforeOrEqualTo_DateValue_Test.java
@@ -32,6 +32,7 @@
* {@link org.assertj.db.api.assertions.AssertOnValueChronology#isBeforeOrEqualTo(org.assertj.db.type.DateValue)} method.
*
* @author Régis Pouiller
+ * @author Julien Roy
*/
public class AssertOnValueChronology_IsBeforeOrEqualTo_DateValue_Test extends AbstractTest {
@@ -41,7 +42,7 @@ public class AssertOnValueChronology_IsBeforeOrEqualTo_DateValue_Test extends Ab
@Test
@NeedReload
public void test_is_before_or_equal_to() throws ParseException {
- Table table = new Table(source, "test");
+ Table table = new Table(jdbcConnectionProvider, "test");
Changes changes = new Changes(table).setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
changes.setEndPointNow();
@@ -63,7 +64,7 @@ public void test_is_before_or_equal_to() throws ParseException {
@Test
@NeedReload
public void should_fail_because_value_is_after() throws ParseException {
- Table table = new Table(source, "test");
+ Table table = new Table(jdbcConnectionProvider, "test");
Changes changes = new Changes(table).setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
changes.setEndPointNow();
@@ -72,7 +73,7 @@ public void should_fail_because_value_is_after() throws ParseException {
assertThat(changes).change().column("var10").valueAtEndPoint().isBeforeOrEqualTo(DateValue.parse("2014-05-24"));
fail("An exception must be raised");
} catch (AssertionError e) {
- Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Value at end point of Column at index 9 (column name : VAR10) of Change at index 0 (with primary key : [1]) of Changes on TEST table of 'sa/jdbc:h2:mem:test' source] %n"
+ Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Value at end point of Column at index 9 (column name : VAR10) of Change at index 0 (with primary key : [1]) of Changes on TEST table of 'sa/jdbc:h2:mem:test'] %n"
+ "Expecting:%n"
+ " <2014-05-24T09:46:30.000000000>%n"
+ "to be before or equal to %n"
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnValueChronology_IsBeforeOrEqualTo_LocalDateTime_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnValueChronology_IsBeforeOrEqualTo_LocalDateTime_Test.java
index 271d1783..c9d05b93 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnValueChronology_IsBeforeOrEqualTo_LocalDateTime_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnValueChronology_IsBeforeOrEqualTo_LocalDateTime_Test.java
@@ -40,7 +40,7 @@ public class AssertOnValueChronology_IsBeforeOrEqualTo_LocalDateTime_Test extend
@Test
@NeedReload
public void test_is_before_or_equal_to() {
- Table table = new Table(source, "test");
+ Table table = new Table(jdbcConnectionProvider, "test");
Changes changes = new Changes(table).setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
changes.setEndPointNow();
@@ -60,7 +60,7 @@ public void test_is_before_or_equal_to() {
@Test
@NeedReload
public void should_fail_because_value_is_after() {
- Table table = new Table(source, "test");
+ Table table = new Table(jdbcConnectionProvider, "test");
Changes changes = new Changes(table).setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
changes.setEndPointNow();
@@ -69,7 +69,7 @@ public void should_fail_because_value_is_after() {
assertThat(changes).change().column("var10").valueAtEndPoint().isBeforeOrEqualTo(LocalDateTime.of(2014, 5, 24, 9, 46, 29));
fail("An exception must be raised");
} catch (AssertionError e) {
- Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Value at end point of Column at index 9 (column name : VAR10) of Change at index 0 (with primary key : [1]) of Changes on TEST table of 'sa/jdbc:h2:mem:test' source] %n"
+ Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Value at end point of Column at index 9 (column name : VAR10) of Change at index 0 (with primary key : [1]) of Changes on TEST table of 'sa/jdbc:h2:mem:test'] %n"
+ "Expecting:%n"
+ " <2014-05-24T09:46:30.000000000>%n"
+ "to be before or equal to %n"
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnValueChronology_IsBeforeOrEqualTo_LocalDate_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnValueChronology_IsBeforeOrEqualTo_LocalDate_Test.java
index fe45307f..dc209045 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnValueChronology_IsBeforeOrEqualTo_LocalDate_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnValueChronology_IsBeforeOrEqualTo_LocalDate_Test.java
@@ -40,7 +40,7 @@ public class AssertOnValueChronology_IsBeforeOrEqualTo_LocalDate_Test extends Ab
@Test
@NeedReload
public void test_is_before_or_equal_to() {
- Table table = new Table(source, "test");
+ Table table = new Table(jdbcConnectionProvider, "test");
Changes changes = new Changes(table).setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
changes.setEndPointNow();
@@ -60,7 +60,7 @@ public void test_is_before_or_equal_to() {
@Test
@NeedReload
public void should_fail_because_value_is_after() {
- Table table = new Table(source, "test");
+ Table table = new Table(jdbcConnectionProvider, "test");
Changes changes = new Changes(table).setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
changes.setEndPointNow();
@@ -69,7 +69,7 @@ public void should_fail_because_value_is_after() {
assertThat(changes).change().column("var10").valueAtEndPoint().isBeforeOrEqualTo(LocalDate.of(2014, 5, 24));
fail("An exception must be raised");
} catch (AssertionError e) {
- Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Value at end point of Column at index 9 (column name : VAR10) of Change at index 0 (with primary key : [1]) of Changes on TEST table of 'sa/jdbc:h2:mem:test' source] %n"
+ Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Value at end point of Column at index 9 (column name : VAR10) of Change at index 0 (with primary key : [1]) of Changes on TEST table of 'sa/jdbc:h2:mem:test'] %n"
+ "Expecting:%n"
+ " <2014-05-24T09:46:30.000000000>%n"
+ "to be before or equal to %n"
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnValueChronology_IsBeforeOrEqualTo_LocalTime_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnValueChronology_IsBeforeOrEqualTo_LocalTime_Test.java
index 3b5f9e22..de667aed 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnValueChronology_IsBeforeOrEqualTo_LocalTime_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnValueChronology_IsBeforeOrEqualTo_LocalTime_Test.java
@@ -40,7 +40,7 @@ public class AssertOnValueChronology_IsBeforeOrEqualTo_LocalTime_Test extends Ab
@Test
@NeedReload
public void test_is_before_or_equal_to() {
- Table table = new Table(source, "test");
+ Table table = new Table(jdbcConnectionProvider, "test");
Changes changes = new Changes(table).setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
changes.setEndPointNow();
@@ -60,7 +60,7 @@ public void test_is_before_or_equal_to() {
@Test
@NeedReload
public void should_fail_because_value_is_after() {
- Table table = new Table(source, "test");
+ Table table = new Table(jdbcConnectionProvider, "test");
Changes changes = new Changes(table).setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
changes.setEndPointNow();
@@ -69,7 +69,7 @@ public void should_fail_because_value_is_after() {
assertThat(changes).change().column("var8").valueAtEndPoint().isBeforeOrEqualTo(LocalTime.of(9, 46, 29));
fail("An exception must be raised");
} catch (AssertionError e) {
- Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Value at end point of Column at index 7 (column name : VAR8) of Change at index 0 (with primary key : [1]) of Changes on TEST table of 'sa/jdbc:h2:mem:test' source] %n"
+ Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Value at end point of Column at index 7 (column name : VAR8) of Change at index 0 (with primary key : [1]) of Changes on TEST table of 'sa/jdbc:h2:mem:test'] %n"
+ "Expecting:%n"
+ " <09:46:30.000000000>%n"
+ "to be before or equal to %n"
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnValueChronology_IsBeforeOrEqualTo_String_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnValueChronology_IsBeforeOrEqualTo_String_Test.java
index c8492dc6..27045cc5 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnValueChronology_IsBeforeOrEqualTo_String_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnValueChronology_IsBeforeOrEqualTo_String_Test.java
@@ -29,6 +29,7 @@
* {@link org.assertj.db.api.assertions.AssertOnValueChronology#isBeforeOrEqualTo(org.assertj.db.type.DateTimeValue)} method.
*
* @author Régis Pouiller
+ * @author Julien Roy
*/
public class AssertOnValueChronology_IsBeforeOrEqualTo_String_Test extends AbstractTest {
@@ -38,7 +39,7 @@ public class AssertOnValueChronology_IsBeforeOrEqualTo_String_Test extends Abstr
@Test
@NeedReload
public void test_is_before_or_equal_to() {
- Table table = new Table(source, "test");
+ Table table = new Table(jdbcConnectionProvider, "test");
Changes changes = new Changes(table).setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
changes.setEndPointNow();
@@ -58,7 +59,7 @@ public void test_is_before_or_equal_to() {
@Test
@NeedReload
public void should_fail_because_value_is_after() {
- Table table = new Table(source, "test");
+ Table table = new Table(jdbcConnectionProvider, "test");
Changes changes = new Changes(table).setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
changes.setEndPointNow();
@@ -67,7 +68,7 @@ public void should_fail_because_value_is_after() {
assertThat(changes).change().column("var10").valueAtEndPoint().isBeforeOrEqualTo("2014-05-24");
fail("An exception must be raised");
} catch (AssertionError e) {
- Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Value at end point of Column at index 9 (column name : VAR10) of Change at index 0 (with primary key : [1]) of Changes on TEST table of 'sa/jdbc:h2:mem:test' source] %n"
+ Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Value at end point of Column at index 9 (column name : VAR10) of Change at index 0 (with primary key : [1]) of Changes on TEST table of 'sa/jdbc:h2:mem:test'] %n"
+ "Expecting:%n"
+ " <2014-05-24T09:46:30.000000000>%n"
+ "to be before or equal to %n"
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnValueChronology_IsBeforeOrEqualTo_TimeValue_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnValueChronology_IsBeforeOrEqualTo_TimeValue_Test.java
index 1d3e2d44..78a7a45f 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnValueChronology_IsBeforeOrEqualTo_TimeValue_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnValueChronology_IsBeforeOrEqualTo_TimeValue_Test.java
@@ -32,6 +32,7 @@
* {@link org.assertj.db.api.assertions.AssertOnValueChronology#isBeforeOrEqualTo(org.assertj.db.type.TimeValue)} method.
*
* @author Régis Pouiller
+ * @author Julien Roy
*/
public class AssertOnValueChronology_IsBeforeOrEqualTo_TimeValue_Test extends AbstractTest {
@@ -41,7 +42,7 @@ public class AssertOnValueChronology_IsBeforeOrEqualTo_TimeValue_Test extends Ab
@Test
@NeedReload
public void test_is_before_or_equal_to() throws ParseException {
- Table table = new Table(source, "test");
+ Table table = new Table(jdbcConnectionProvider, "test");
Changes changes = new Changes(table).setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
changes.setEndPointNow();
@@ -63,7 +64,7 @@ public void test_is_before_or_equal_to() throws ParseException {
@Test
@NeedReload
public void should_fail_because_value_is_after() throws ParseException {
- Table table = new Table(source, "test");
+ Table table = new Table(jdbcConnectionProvider, "test");
Changes changes = new Changes(table).setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
changes.setEndPointNow();
@@ -72,7 +73,7 @@ public void should_fail_because_value_is_after() throws ParseException {
assertThat(changes).change().column("var8").valueAtEndPoint().isBeforeOrEqualTo(TimeValue.parse("09:46:29"));
fail("An exception must be raised");
} catch (AssertionError e) {
- Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Value at end point of Column at index 7 (column name : VAR8) of Change at index 0 (with primary key : [1]) of Changes on TEST table of 'sa/jdbc:h2:mem:test' source] %n"
+ Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Value at end point of Column at index 7 (column name : VAR8) of Change at index 0 (with primary key : [1]) of Changes on TEST table of 'sa/jdbc:h2:mem:test'] %n"
+ "Expecting:%n"
+ " <09:46:30.000000000>%n"
+ "to be before or equal to %n"
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnValueChronology_IsBefore_DateTimeValue_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnValueChronology_IsBefore_DateTimeValue_Test.java
index 840d67a3..dee9c3f0 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnValueChronology_IsBefore_DateTimeValue_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnValueChronology_IsBefore_DateTimeValue_Test.java
@@ -32,6 +32,7 @@
* {@link org.assertj.db.api.assertions.AssertOnValueChronology#isBefore(org.assertj.db.type.DateTimeValue)} method.
*
* @author Régis Pouiller
+ * @author Julien Roy
*/
public class AssertOnValueChronology_IsBefore_DateTimeValue_Test extends AbstractTest {
@@ -41,7 +42,7 @@ public class AssertOnValueChronology_IsBefore_DateTimeValue_Test extends Abstrac
@Test
@NeedReload
public void test_is_before() throws ParseException {
- Table table = new Table(source, "test");
+ Table table = new Table(jdbcConnectionProvider, "test");
Changes changes = new Changes(table).setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
changes.setEndPointNow();
@@ -63,7 +64,7 @@ public void test_is_before() throws ParseException {
@Test
@NeedReload
public void should_fail_because_value_is_after_or_equal_to() throws ParseException {
- Table table = new Table(source, "test");
+ Table table = new Table(jdbcConnectionProvider, "test");
Changes changes = new Changes(table).setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
changes.setEndPointNow();
@@ -73,7 +74,7 @@ public void should_fail_because_value_is_after_or_equal_to() throws ParseExcepti
DateTimeValue.parse("2014-05-24T09:46:30"));
fail("An exception must be raised");
} catch (AssertionError e) {
- Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Value at end point of Column at index 9 (column name : VAR10) of Change at index 0 (with primary key : [1]) of Changes on TEST table of 'sa/jdbc:h2:mem:test' source] %n"
+ Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Value at end point of Column at index 9 (column name : VAR10) of Change at index 0 (with primary key : [1]) of Changes on TEST table of 'sa/jdbc:h2:mem:test'] %n"
+ "Expecting:%n"
+ " <2014-05-24T09:46:30.000000000>%n"
+ "to be before %n"
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnValueChronology_IsBefore_DateValue_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnValueChronology_IsBefore_DateValue_Test.java
index 57812d72..8dc6ec1d 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnValueChronology_IsBefore_DateValue_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnValueChronology_IsBefore_DateValue_Test.java
@@ -32,6 +32,7 @@
* {@link org.assertj.db.api.assertions.AssertOnValueChronology#isBefore(org.assertj.db.type.DateValue)} method.
*
* @author Régis Pouiller
+ * @author Julien Roy
*/
public class AssertOnValueChronology_IsBefore_DateValue_Test extends AbstractTest {
@@ -41,7 +42,7 @@ public class AssertOnValueChronology_IsBefore_DateValue_Test extends AbstractTes
@Test
@NeedReload
public void test_is_before() throws ParseException {
- Table table = new Table(source, "test");
+ Table table = new Table(jdbcConnectionProvider, "test");
Changes changes = new Changes(table).setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
changes.setEndPointNow();
@@ -62,7 +63,7 @@ public void test_is_before() throws ParseException {
@Test
@NeedReload
public void should_fail_because_value_is_after_or_equal_to() throws ParseException {
- Table table = new Table(source, "test");
+ Table table = new Table(jdbcConnectionProvider, "test");
Changes changes = new Changes(table).setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
changes.setEndPointNow();
@@ -71,7 +72,7 @@ public void should_fail_because_value_is_after_or_equal_to() throws ParseExcepti
assertThat(changes).change().column("var10").valueAtEndPoint().isBefore(DateValue.parse("2014-05-24"));
fail("An exception must be raised");
} catch (AssertionError e) {
- Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Value at end point of Column at index 9 (column name : VAR10) of Change at index 0 (with primary key : [1]) of Changes on TEST table of 'sa/jdbc:h2:mem:test' source] %n"
+ Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Value at end point of Column at index 9 (column name : VAR10) of Change at index 0 (with primary key : [1]) of Changes on TEST table of 'sa/jdbc:h2:mem:test'] %n"
+ "Expecting:%n"
+ " <2014-05-24T09:46:30.000000000>%n"
+ "to be before %n"
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnValueChronology_IsBefore_LocalDateTime_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnValueChronology_IsBefore_LocalDateTime_Test.java
index ee80bc61..032bcd4d 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnValueChronology_IsBefore_LocalDateTime_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnValueChronology_IsBefore_LocalDateTime_Test.java
@@ -40,7 +40,7 @@ public class AssertOnValueChronology_IsBefore_LocalDateTime_Test extends Abstrac
@Test
@NeedReload
public void test_is_before() {
- Table table = new Table(source, "test");
+ Table table = new Table(jdbcConnectionProvider, "test");
Changes changes = new Changes(table).setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
changes.setEndPointNow();
@@ -60,7 +60,7 @@ public void test_is_before() {
@Test
@NeedReload
public void should_fail_because_value_is_after_or_equal_to() {
- Table table = new Table(source, "test");
+ Table table = new Table(jdbcConnectionProvider, "test");
Changes changes = new Changes(table).setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
changes.setEndPointNow();
@@ -69,7 +69,7 @@ public void should_fail_because_value_is_after_or_equal_to() {
assertThat(changes).change().column("var10").valueAtEndPoint().isBefore(LocalDateTime.of(2014, 5, 24, 9, 46, 30));
fail("An exception must be raised");
} catch (AssertionError e) {
- Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Value at end point of Column at index 9 (column name : VAR10) of Change at index 0 (with primary key : [1]) of Changes on TEST table of 'sa/jdbc:h2:mem:test' source] %n"
+ Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Value at end point of Column at index 9 (column name : VAR10) of Change at index 0 (with primary key : [1]) of Changes on TEST table of 'sa/jdbc:h2:mem:test'] %n"
+ "Expecting:%n"
+ " <2014-05-24T09:46:30.000000000>%n"
+ "to be before %n"
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnValueChronology_IsBefore_LocalDate_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnValueChronology_IsBefore_LocalDate_Test.java
index fcc5fd82..1a75cb7a 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnValueChronology_IsBefore_LocalDate_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnValueChronology_IsBefore_LocalDate_Test.java
@@ -40,7 +40,7 @@ public class AssertOnValueChronology_IsBefore_LocalDate_Test extends AbstractTes
@Test
@NeedReload
public void test_is_before() {
- Table table = new Table(source, "test");
+ Table table = new Table(jdbcConnectionProvider, "test");
Changes changes = new Changes(table).setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
changes.setEndPointNow();
@@ -60,7 +60,7 @@ public void test_is_before() {
@Test
@NeedReload
public void should_fail_because_value_is_after_or_equal_to() {
- Table table = new Table(source, "test");
+ Table table = new Table(jdbcConnectionProvider, "test");
Changes changes = new Changes(table).setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
changes.setEndPointNow();
@@ -69,7 +69,7 @@ public void should_fail_because_value_is_after_or_equal_to() {
assertThat(changes).change().column("var10").valueAtEndPoint().isBefore(LocalDate.of(2014, 5, 24));
fail("An exception must be raised");
} catch (AssertionError e) {
- Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Value at end point of Column at index 9 (column name : VAR10) of Change at index 0 (with primary key : [1]) of Changes on TEST table of 'sa/jdbc:h2:mem:test' source] %n"
+ Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Value at end point of Column at index 9 (column name : VAR10) of Change at index 0 (with primary key : [1]) of Changes on TEST table of 'sa/jdbc:h2:mem:test'] %n"
+ "Expecting:%n"
+ " <2014-05-24T09:46:30.000000000>%n"
+ "to be before %n"
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnValueChronology_IsBefore_LocalTime_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnValueChronology_IsBefore_LocalTime_Test.java
index 5f4bfa40..97afce5c 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnValueChronology_IsBefore_LocalTime_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnValueChronology_IsBefore_LocalTime_Test.java
@@ -40,7 +40,7 @@ public class AssertOnValueChronology_IsBefore_LocalTime_Test extends AbstractTes
@Test
@NeedReload
public void test_is_before() {
- Table table = new Table(source, "test");
+ Table table = new Table(jdbcConnectionProvider, "test");
Changes changes = new Changes(table).setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
changes.setEndPointNow();
@@ -60,7 +60,7 @@ public void test_is_before() {
@Test
@NeedReload
public void should_fail_because_value_is_after_or_equal_to() {
- Table table = new Table(source, "test");
+ Table table = new Table(jdbcConnectionProvider, "test");
Changes changes = new Changes(table).setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
changes.setEndPointNow();
@@ -69,7 +69,7 @@ public void should_fail_because_value_is_after_or_equal_to() {
assertThat(changes).change().column("var8").valueAtEndPoint().isBefore(LocalTime.of(9, 46, 30));
fail("An exception must be raised");
} catch (AssertionError e) {
- Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Value at end point of Column at index 7 (column name : VAR8) of Change at index 0 (with primary key : [1]) of Changes on TEST table of 'sa/jdbc:h2:mem:test' source] %n"
+ Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Value at end point of Column at index 7 (column name : VAR8) of Change at index 0 (with primary key : [1]) of Changes on TEST table of 'sa/jdbc:h2:mem:test'] %n"
+ "Expecting:%n"
+ " <09:46:30.000000000>%n"
+ "to be before %n"
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnValueChronology_IsBefore_String_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnValueChronology_IsBefore_String_Test.java
index 70e34457..56f1d69d 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnValueChronology_IsBefore_String_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnValueChronology_IsBefore_String_Test.java
@@ -29,6 +29,7 @@
* {@link org.assertj.db.api.assertions.AssertOnValueChronology#isBefore(org.assertj.db.type.DateTimeValue)} method.
*
* @author Régis Pouiller
+ * @author Julien Roy
*/
public class AssertOnValueChronology_IsBefore_String_Test extends AbstractTest {
@@ -38,7 +39,7 @@ public class AssertOnValueChronology_IsBefore_String_Test extends AbstractTest {
@Test
@NeedReload
public void test_is_before() {
- Table table = new Table(source, "test");
+ Table table = new Table(jdbcConnectionProvider, "test");
Changes changes = new Changes(table).setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
changes.setEndPointNow();
@@ -58,7 +59,7 @@ public void test_is_before() {
@Test
@NeedReload
public void should_fail_because_value_is_after_or_equal_to() {
- Table table = new Table(source, "test");
+ Table table = new Table(jdbcConnectionProvider, "test");
Changes changes = new Changes(table).setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
changes.setEndPointNow();
@@ -67,7 +68,7 @@ public void should_fail_because_value_is_after_or_equal_to() {
assertThat(changes).change().column("var10").valueAtEndPoint().isBefore("2014-05-24");
fail("An exception must be raised");
} catch (AssertionError e) {
- Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Value at end point of Column at index 9 (column name : VAR10) of Change at index 0 (with primary key : [1]) of Changes on TEST table of 'sa/jdbc:h2:mem:test' source] %n"
+ Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Value at end point of Column at index 9 (column name : VAR10) of Change at index 0 (with primary key : [1]) of Changes on TEST table of 'sa/jdbc:h2:mem:test'] %n"
+ "Expecting:%n"
+ " <2014-05-24T09:46:30.000000000>%n"
+ "to be before %n"
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnValueChronology_IsBefore_TimeValue_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnValueChronology_IsBefore_TimeValue_Test.java
index 1a00d7d5..baa7f6b7 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnValueChronology_IsBefore_TimeValue_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnValueChronology_IsBefore_TimeValue_Test.java
@@ -32,6 +32,7 @@
* {@link org.assertj.db.api.assertions.AssertOnValueChronology#isBefore(org.assertj.db.type.TimeValue)} method.
*
* @author Régis Pouiller
+ * @author Julien Roy
*/
public class AssertOnValueChronology_IsBefore_TimeValue_Test extends AbstractTest {
@@ -41,7 +42,7 @@ public class AssertOnValueChronology_IsBefore_TimeValue_Test extends AbstractTes
@Test
@NeedReload
public void test_is_before() throws ParseException {
- Table table = new Table(source, "test");
+ Table table = new Table(jdbcConnectionProvider, "test");
Changes changes = new Changes(table).setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
changes.setEndPointNow();
@@ -61,7 +62,7 @@ public void test_is_before() throws ParseException {
@Test
@NeedReload
public void should_fail_because_value_is_after_or_equal_to() throws ParseException {
- Table table = new Table(source, "test");
+ Table table = new Table(jdbcConnectionProvider, "test");
Changes changes = new Changes(table).setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
changes.setEndPointNow();
@@ -70,7 +71,7 @@ public void should_fail_because_value_is_after_or_equal_to() throws ParseExcepti
assertThat(changes).change().column("var8").valueAtEndPoint().isBefore(TimeValue.parse("09:46:30"));
fail("An exception must be raised");
} catch (AssertionError e) {
- Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Value at end point of Column at index 7 (column name : VAR8) of Change at index 0 (with primary key : [1]) of Changes on TEST table of 'sa/jdbc:h2:mem:test' source] %n"
+ Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Value at end point of Column at index 7 (column name : VAR8) of Change at index 0 (with primary key : [1]) of Changes on TEST table of 'sa/jdbc:h2:mem:test'] %n"
+ "Expecting:%n"
+ " <09:46:30.000000000>%n"
+ "to be before %n"
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnValueClass_IsOfClass_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnValueClass_IsOfClass_Test.java
index f5d61c90..aaa71923 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnValueClass_IsOfClass_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnValueClass_IsOfClass_Test.java
@@ -29,6 +29,7 @@
* {@link org.assertj.db.api.assertions.AssertOnValueClass#isOfClass(Class)} method.
*
* @author Régis Pouiller
+ * @author Julien Roy
*/
public class AssertOnValueClass_IsOfClass_Test extends AbstractTest {
@@ -38,7 +39,7 @@ public class AssertOnValueClass_IsOfClass_Test extends AbstractTest {
@Test
@NeedReload
public void test_is_of_type() {
- Table table = new Table(source, "test");
+ Table table = new Table(jdbcConnectionProvider, "test");
Changes changes = new Changes(table).setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
changes.setEndPointNow();
@@ -58,7 +59,7 @@ public void test_is_of_type() {
@Test
@NeedReload
public void should_fail_because_value_is_not_of_type() {
- Table table = new Table(source, "test");
+ Table table = new Table(jdbcConnectionProvider, "test");
Changes changes = new Changes(table).setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
changes.setEndPointNow();
@@ -67,7 +68,7 @@ public void should_fail_because_value_is_not_of_type() {
assertThat(changes).change().column("var1").valueAtEndPoint().isOfClass(Boolean.class);
fail("An exception must be raised");
} catch (AssertionError e) {
- Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Value at end point of Column at index 0 (column name : VAR1) of Change at index 0 (with primary key : [1]) of Changes on TEST table of 'sa/jdbc:h2:mem:test' source] %n"
+ Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Value at end point of Column at index 0 (column name : VAR1) of Change at index 0 (with primary key : [1]) of Changes on TEST table of 'sa/jdbc:h2:mem:test'] %n"
+ "Expecting:%n"
+ " <1>%n"
+ "to be of class%n"
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnValueCloseness_IsCloseTo_DateTimeValue_DateTimeValue_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnValueCloseness_IsCloseTo_DateTimeValue_DateTimeValue_Test.java
index c1e89d53..250d5b81 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnValueCloseness_IsCloseTo_DateTimeValue_DateTimeValue_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnValueCloseness_IsCloseTo_DateTimeValue_DateTimeValue_Test.java
@@ -32,6 +32,7 @@
* {@link org.assertj.db.api.assertions.AssertOnValueCloseness#isCloseTo(org.assertj.db.type.DateTimeValue, org.assertj.db.type.DateTimeValue)} method.
*
* @author Régis Pouiller
+ * @author Julien Roy
*/
public class AssertOnValueCloseness_IsCloseTo_DateTimeValue_DateTimeValue_Test extends AbstractTest {
@@ -41,7 +42,7 @@ public class AssertOnValueCloseness_IsCloseTo_DateTimeValue_DateTimeValue_Test e
@Test
@NeedReload
public void test_is_close_to() {
- Table table = new Table(source, "test");
+ Table table = new Table(jdbcConnectionProvider, "test");
Changes changes = new Changes(table).setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
changes.setEndPointNow();
@@ -64,7 +65,7 @@ public void test_is_close_to() {
@Test
@NeedReload
public void should_fail_because_value_is_not_close_to() {
- Table table = new Table(source, "test");
+ Table table = new Table(jdbcConnectionProvider, "test");
Changes changes = new Changes(table).setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
changes.setEndPointNow();
@@ -74,7 +75,7 @@ public void should_fail_because_value_is_not_close_to() {
DateTimeValue.of(DateValue.of(2014, 5, 24), TimeValue.of(9, 46, 31)), DateTimeValue.of(DateValue.of(0, 0, 0)));
fail("An exception must be raised");
} catch (AssertionError e) {
- Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Value at end point of Column at index 9 (column name : VAR10) of Change at index 0 (with primary key : [1]) of Changes on TEST table of 'sa/jdbc:h2:mem:test' source] %n"
+ Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Value at end point of Column at index 9 (column name : VAR10) of Change at index 0 (with primary key : [1]) of Changes on TEST table of 'sa/jdbc:h2:mem:test'] %n"
+ "Expecting:%n"
+ " <2014-05-24T09:46:30.000000000>%n"
+ "to be close to: %n"
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnValueCloseness_IsCloseTo_DateTimeValue_DateValue_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnValueCloseness_IsCloseTo_DateTimeValue_DateValue_Test.java
index dd91b910..bdba0fde 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnValueCloseness_IsCloseTo_DateTimeValue_DateValue_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnValueCloseness_IsCloseTo_DateTimeValue_DateValue_Test.java
@@ -32,6 +32,7 @@
* {@link org.assertj.db.api.assertions.AssertOnValueCloseness#isCloseTo(org.assertj.db.type.DateTimeValue, org.assertj.db.type.DateValue)} method.
*
* @author Régis Pouiller
+ * @author Julien Roy
*/
public class AssertOnValueCloseness_IsCloseTo_DateTimeValue_DateValue_Test extends AbstractTest {
@@ -41,7 +42,7 @@ public class AssertOnValueCloseness_IsCloseTo_DateTimeValue_DateValue_Test exten
@Test
@NeedReload
public void test_is_close_to() {
- Table table = new Table(source, "test");
+ Table table = new Table(jdbcConnectionProvider, "test");
Changes changes = new Changes(table).setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
changes.setEndPointNow();
@@ -64,7 +65,7 @@ public void test_is_close_to() {
@Test
@NeedReload
public void should_fail_because_value_is_not_close_to() {
- Table table = new Table(source, "test");
+ Table table = new Table(jdbcConnectionProvider, "test");
Changes changes = new Changes(table).setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
changes.setEndPointNow();
@@ -74,7 +75,7 @@ public void should_fail_because_value_is_not_close_to() {
DateTimeValue.of(DateValue.of(2014, 5, 24), TimeValue.of(9, 46, 31)), DateValue.of(0, 0, 0));
fail("An exception must be raised");
} catch (AssertionError e) {
- Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Value at end point of Column at index 9 (column name : VAR10) of Change at index 0 (with primary key : [1]) of Changes on TEST table of 'sa/jdbc:h2:mem:test' source] %n"
+ Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Value at end point of Column at index 9 (column name : VAR10) of Change at index 0 (with primary key : [1]) of Changes on TEST table of 'sa/jdbc:h2:mem:test'] %n"
+ "Expecting:%n"
+ " <2014-05-24T09:46:30.000000000>%n"
+ "to be close to: %n"
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnValueCloseness_IsCloseTo_DateTimeValue_TimeValue_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnValueCloseness_IsCloseTo_DateTimeValue_TimeValue_Test.java
index 6a12db9d..1411a3a4 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnValueCloseness_IsCloseTo_DateTimeValue_TimeValue_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnValueCloseness_IsCloseTo_DateTimeValue_TimeValue_Test.java
@@ -32,6 +32,7 @@
* {@link org.assertj.db.api.assertions.AssertOnValueCloseness#isCloseTo(org.assertj.db.type.DateTimeValue, org.assertj.db.type.TimeValue)} method.
*
* @author Régis Pouiller
+ * @author Julien Roy
*/
public class AssertOnValueCloseness_IsCloseTo_DateTimeValue_TimeValue_Test extends AbstractTest {
@@ -41,7 +42,7 @@ public class AssertOnValueCloseness_IsCloseTo_DateTimeValue_TimeValue_Test exten
@Test
@NeedReload
public void test_is_close_to() {
- Table table = new Table(source, "test");
+ Table table = new Table(jdbcConnectionProvider, "test");
Changes changes = new Changes(table).setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
changes.setEndPointNow();
@@ -64,7 +65,7 @@ public void test_is_close_to() {
@Test
@NeedReload
public void should_fail_because_value_is_not_close_to() {
- Table table = new Table(source, "test");
+ Table table = new Table(jdbcConnectionProvider, "test");
Changes changes = new Changes(table).setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
changes.setEndPointNow();
@@ -74,7 +75,7 @@ public void should_fail_because_value_is_not_close_to() {
DateTimeValue.of(DateValue.of(2014, 5, 24), TimeValue.of(9, 46, 31)), TimeValue.of(0, 0, 0, 1));
fail("An exception must be raised");
} catch (AssertionError e) {
- Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Value at end point of Column at index 9 (column name : VAR10) of Change at index 0 (with primary key : [1]) of Changes on TEST table of 'sa/jdbc:h2:mem:test' source] %n"
+ Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Value at end point of Column at index 9 (column name : VAR10) of Change at index 0 (with primary key : [1]) of Changes on TEST table of 'sa/jdbc:h2:mem:test'] %n"
+ "Expecting:%n"
+ " <2014-05-24T09:46:30.000000000>%n"
+ "to be close to: %n"
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnValueCloseness_IsCloseTo_DateValue_DateTimeValue_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnValueCloseness_IsCloseTo_DateValue_DateTimeValue_Test.java
index eab13dea..f3739bc4 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnValueCloseness_IsCloseTo_DateValue_DateTimeValue_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnValueCloseness_IsCloseTo_DateValue_DateTimeValue_Test.java
@@ -31,6 +31,7 @@
* {@link org.assertj.db.api.assertions.AssertOnValueCloseness#isCloseTo(org.assertj.db.type.DateValue, org.assertj.db.type.DateTimeValue)} method.
*
* @author Régis Pouiller
+ * @author Julien Roy
*/
public class AssertOnValueCloseness_IsCloseTo_DateValue_DateTimeValue_Test extends AbstractTest {
@@ -40,7 +41,7 @@ public class AssertOnValueCloseness_IsCloseTo_DateValue_DateTimeValue_Test exten
@Test
@NeedReload
public void test_is_close_to() {
- Table table = new Table(source, "test");
+ Table table = new Table(jdbcConnectionProvider, "test");
Changes changes = new Changes(table).setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
changes.setEndPointNow();
@@ -61,7 +62,7 @@ public void test_is_close_to() {
@Test
@NeedReload
public void should_fail_because_value_is_not_close_to() {
- Table table = new Table(source, "test");
+ Table table = new Table(jdbcConnectionProvider, "test");
Changes changes = new Changes(table).setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
changes.setEndPointNow();
@@ -70,7 +71,7 @@ public void should_fail_because_value_is_not_close_to() {
assertThat(changes).change().column("var9").valueAtEndPoint().isCloseTo(DateValue.of(2014, 5, 23), DateTimeValue.of(DateValue.of(0, 0, 0)));
fail("An exception must be raised");
} catch (AssertionError e) {
- Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Value at end point of Column at index 8 (column name : VAR9) of Change at index 0 (with primary key : [1]) of Changes on TEST table of 'sa/jdbc:h2:mem:test' source] %n"
+ Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Value at end point of Column at index 8 (column name : VAR9) of Change at index 0 (with primary key : [1]) of Changes on TEST table of 'sa/jdbc:h2:mem:test'] %n"
+ "Expecting:%n"
+ " <2014-05-24>%n"
+ "to be close to: %n"
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnValueCloseness_IsCloseTo_DateValue_DateValue_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnValueCloseness_IsCloseTo_DateValue_DateValue_Test.java
index f7c95a9d..f8e1ece9 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnValueCloseness_IsCloseTo_DateValue_DateValue_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnValueCloseness_IsCloseTo_DateValue_DateValue_Test.java
@@ -30,6 +30,7 @@
* {@link org.assertj.db.api.assertions.AssertOnValueCloseness#isCloseTo(org.assertj.db.type.DateValue, org.assertj.db.type.DateValue)} method.
*
* @author Régis Pouiller
+ * @author Julien Roy
*/
public class AssertOnValueCloseness_IsCloseTo_DateValue_DateValue_Test extends AbstractTest {
@@ -39,7 +40,7 @@ public class AssertOnValueCloseness_IsCloseTo_DateValue_DateValue_Test extends A
@Test
@NeedReload
public void test_is_close_to() {
- Table table = new Table(source, "test");
+ Table table = new Table(jdbcConnectionProvider, "test");
Changes changes = new Changes(table).setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
changes.setEndPointNow();
@@ -59,7 +60,7 @@ public void test_is_close_to() {
@Test
@NeedReload
public void should_fail_because_value_is_not_close_to() {
- Table table = new Table(source, "test");
+ Table table = new Table(jdbcConnectionProvider, "test");
Changes changes = new Changes(table).setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
changes.setEndPointNow();
@@ -68,7 +69,7 @@ public void should_fail_because_value_is_not_close_to() {
assertThat(changes).change().column("var9").valueAtEndPoint().isCloseTo(DateValue.of(2014, 5, 23), DateValue.of(0, 0, 0));
fail("An exception must be raised");
} catch (AssertionError e) {
- Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Value at end point of Column at index 8 (column name : VAR9) of Change at index 0 (with primary key : [1]) of Changes on TEST table of 'sa/jdbc:h2:mem:test' source] %n"
+ Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Value at end point of Column at index 8 (column name : VAR9) of Change at index 0 (with primary key : [1]) of Changes on TEST table of 'sa/jdbc:h2:mem:test'] %n"
+ "Expecting:%n"
+ " <2014-05-24>%n"
+ "to be close to: %n"
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnValueCloseness_IsCloseTo_DateValue_TimeValue_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnValueCloseness_IsCloseTo_DateValue_TimeValue_Test.java
index 12fadb2b..044b71d5 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnValueCloseness_IsCloseTo_DateValue_TimeValue_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnValueCloseness_IsCloseTo_DateValue_TimeValue_Test.java
@@ -31,6 +31,7 @@
* {@link org.assertj.db.api.assertions.AssertOnValueCloseness#isCloseTo(org.assertj.db.type.DateValue, org.assertj.db.type.TimeValue)} method.
*
* @author Régis Pouiller
+ * @author Julien Roy
*/
public class AssertOnValueCloseness_IsCloseTo_DateValue_TimeValue_Test extends AbstractTest {
@@ -40,7 +41,7 @@ public class AssertOnValueCloseness_IsCloseTo_DateValue_TimeValue_Test extends A
@Test
@NeedReload
public void test_is_close_to() {
- Table table = new Table(source, "test");
+ Table table = new Table(jdbcConnectionProvider, "test");
Changes changes = new Changes(table).setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
changes.setEndPointNow();
@@ -60,7 +61,7 @@ public void test_is_close_to() {
@Test
@NeedReload
public void should_fail_because_value_is_not_close_to() {
- Table table = new Table(source, "test");
+ Table table = new Table(jdbcConnectionProvider, "test");
Changes changes = new Changes(table).setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
changes.setEndPointNow();
@@ -70,7 +71,7 @@ public void should_fail_because_value_is_not_close_to() {
.of(0, 1, 0));
fail("An exception must be raised");
} catch (AssertionError e) {
- Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Value at end point of Column at index 8 (column name : VAR9) of Change at index 0 (with primary key : [1]) of Changes on TEST table of 'sa/jdbc:h2:mem:test' source] %n"
+ Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Value at end point of Column at index 8 (column name : VAR9) of Change at index 0 (with primary key : [1]) of Changes on TEST table of 'sa/jdbc:h2:mem:test'] %n"
+ "Expecting:%n"
+ " <2014-05-24>%n"
+ "to be close to: %n"
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnValueCloseness_IsCloseTo_Number_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnValueCloseness_IsCloseTo_Number_Test.java
index 03f64d2e..3e4de844 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnValueCloseness_IsCloseTo_Number_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnValueCloseness_IsCloseTo_Number_Test.java
@@ -29,6 +29,7 @@
* {@link org.assertj.db.api.assertions.AssertOnValueCloseness#isCloseTo(Number, Number)} method.
*
* @author Régis Pouiller
+ * @author Julien Roy
*/
public class AssertOnValueCloseness_IsCloseTo_Number_Test extends AbstractTest {
@@ -38,7 +39,7 @@ public class AssertOnValueCloseness_IsCloseTo_Number_Test extends AbstractTest {
@Test
@NeedReload
public void test_is_close_to() {
- Table table = new Table(source, "test");
+ Table table = new Table(jdbcConnectionProvider, "test");
Changes changes = new Changes(table).setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
changes.setEndPointNow();
@@ -58,7 +59,7 @@ public void test_is_close_to() {
@Test
@NeedReload
public void should_fail_because_value_is_not_close_to() {
- Table table = new Table(source, "test");
+ Table table = new Table(jdbcConnectionProvider, "test");
Changes changes = new Changes(table).setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
changes.setEndPointNow();
@@ -67,7 +68,7 @@ public void should_fail_because_value_is_not_close_to() {
assertThat(changes).change().column("var3").valueAtEndPoint().isCloseTo(3, 0.5);
fail("An exception must be raised");
} catch (AssertionError e) {
- Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Value at end point of Column at index 2 (column name : VAR3) of Change at index 0 (with primary key : [1]) of Changes on TEST table of 'sa/jdbc:h2:mem:test' source] %n"
+ Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Value at end point of Column at index 2 (column name : VAR3) of Change at index 0 (with primary key : [1]) of Changes on TEST table of 'sa/jdbc:h2:mem:test'] %n"
+ "Expecting:%n"
+ " <2>%n"
+ "to be close to: %n"
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnValueCloseness_IsCloseTo_TimeValue_TimeValue_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnValueCloseness_IsCloseTo_TimeValue_TimeValue_Test.java
index a0b5a6f9..9b70bdbb 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnValueCloseness_IsCloseTo_TimeValue_TimeValue_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnValueCloseness_IsCloseTo_TimeValue_TimeValue_Test.java
@@ -30,6 +30,7 @@
* {@link org.assertj.db.api.assertions.AssertOnValueCloseness#isCloseTo(org.assertj.db.type.TimeValue, org.assertj.db.type.TimeValue)} method.
*
* @author Régis Pouiller
+ * @author Julien Roy
*/
public class AssertOnValueCloseness_IsCloseTo_TimeValue_TimeValue_Test extends AbstractTest {
@@ -39,7 +40,7 @@ public class AssertOnValueCloseness_IsCloseTo_TimeValue_TimeValue_Test extends A
@Test
@NeedReload
public void test_is_close_to() {
- Table table = new Table(source, "test");
+ Table table = new Table(jdbcConnectionProvider, "test");
Changes changes = new Changes(table).setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
changes.setEndPointNow();
@@ -59,7 +60,7 @@ public void test_is_close_to() {
@Test
@NeedReload
public void should_fail_because_value_is_not_close_to() {
- Table table = new Table(source, "test");
+ Table table = new Table(jdbcConnectionProvider, "test");
Changes changes = new Changes(table).setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
changes.setEndPointNow();
@@ -69,7 +70,7 @@ public void should_fail_because_value_is_not_close_to() {
fail("An exception must be raised");
} catch (AssertionError e) {
Assertions.assertThat(e.getMessage()).isEqualTo(String.format(
- "[Value at end point of Column at index 7 (column name : VAR8) of Change at index 0 (with primary key : [1]) of Changes on TEST table of 'sa/jdbc:h2:mem:test' source] %n"
+ "[Value at end point of Column at index 7 (column name : VAR8) of Change at index 0 (with primary key : [1]) of Changes on TEST table of 'sa/jdbc:h2:mem:test'] %n"
+ "Expecting:%n"
+ " <09:46:30.000000000>%n"
+ "to be close to: %n"
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnValueComparison_IsGreaterThanOrEqualTo_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnValueComparison_IsGreaterThanOrEqualTo_Test.java
index 89a284ed..a1e7612d 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnValueComparison_IsGreaterThanOrEqualTo_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnValueComparison_IsGreaterThanOrEqualTo_Test.java
@@ -29,6 +29,7 @@
* {@link org.assertj.db.api.assertions.AssertOnValueComparison#isGreaterThanOrEqualTo(Number)} method.
*
* @author Régis Pouiller
+ * @author Julien Roy
*/
public class AssertOnValueComparison_IsGreaterThanOrEqualTo_Test extends AbstractTest {
@@ -39,7 +40,7 @@ public class AssertOnValueComparison_IsGreaterThanOrEqualTo_Test extends Abstrac
@Test
@NeedReload
public void test_is_greater_than_or_equal_to() {
- Table table = new Table(source, "test");
+ Table table = new Table(jdbcConnectionProvider, "test");
Changes changes = new Changes(table).setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
changes.setEndPointNow();
@@ -59,7 +60,7 @@ public void test_is_greater_than_or_equal_to() {
@Test
@NeedReload
public void should_fail_because_value_is_less_than() {
- Table table = new Table(source, "test");
+ Table table = new Table(jdbcConnectionProvider, "test");
Changes changes = new Changes(table).setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
changes.setEndPointNow();
@@ -68,7 +69,7 @@ public void should_fail_because_value_is_less_than() {
assertThat(changes).change().column("var3").valueAtEndPoint().isGreaterThanOrEqualTo(3);
fail("An exception must be raised");
} catch (AssertionError e) {
- Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Value at end point of Column at index 2 (column name : VAR3) of Change at index 0 (with primary key : [1]) of Changes on TEST table of 'sa/jdbc:h2:mem:test' source] %n"
+ Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Value at end point of Column at index 2 (column name : VAR3) of Change at index 0 (with primary key : [1]) of Changes on TEST table of 'sa/jdbc:h2:mem:test'] %n"
+ "Expecting:%n"
+ " <2>%n"
+ "to be greater than or equal to %n"
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnValueComparison_IsGreaterThan_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnValueComparison_IsGreaterThan_Test.java
index 6e6812d8..c76b1c67 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnValueComparison_IsGreaterThan_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnValueComparison_IsGreaterThan_Test.java
@@ -29,6 +29,7 @@
* {@link org.assertj.db.api.assertions.AssertOnValueComparison#isGreaterThan(Number)} method.
*
* @author Régis Pouiller
+ * @author Julien Roy
*/
public class AssertOnValueComparison_IsGreaterThan_Test extends AbstractTest {
@@ -39,7 +40,7 @@ public class AssertOnValueComparison_IsGreaterThan_Test extends AbstractTest {
@Test
@NeedReload
public void test_is_less_than() {
- Table table = new Table(source, "test");
+ Table table = new Table(jdbcConnectionProvider, "test");
Changes changes = new Changes(table).setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
changes.setEndPointNow();
@@ -59,7 +60,7 @@ public void test_is_less_than() {
@Test
@NeedReload
public void should_fail_because_value_is_greater_than_or_equal_to() {
- Table table = new Table(source, "test");
+ Table table = new Table(jdbcConnectionProvider, "test");
Changes changes = new Changes(table).setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
changes.setEndPointNow();
@@ -68,7 +69,7 @@ public void should_fail_because_value_is_greater_than_or_equal_to() {
assertThat(changes).change().column("var3").valueAtEndPoint().isGreaterThan(2);
fail("An exception must be raised");
} catch (AssertionError e) {
- Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Value at end point of Column at index 2 (column name : VAR3) of Change at index 0 (with primary key : [1]) of Changes on TEST table of 'sa/jdbc:h2:mem:test' source] %n"
+ Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Value at end point of Column at index 2 (column name : VAR3) of Change at index 0 (with primary key : [1]) of Changes on TEST table of 'sa/jdbc:h2:mem:test'] %n"
+ "Expecting:%n"
+ " <2>%n"
+ "to be greater than %n"
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnValueComparison_IsLessThanOrEqualTo_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnValueComparison_IsLessThanOrEqualTo_Test.java
index 0f67f5e8..ddd01fda 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnValueComparison_IsLessThanOrEqualTo_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnValueComparison_IsLessThanOrEqualTo_Test.java
@@ -29,6 +29,7 @@
* {@link org.assertj.db.api.assertions.AssertOnValueComparison#isLessThanOrEqualTo(Number)} method.
*
* @author Régis Pouiller
+ * @author Julien Roy
*/
public class AssertOnValueComparison_IsLessThanOrEqualTo_Test extends AbstractTest {
@@ -39,7 +40,7 @@ public class AssertOnValueComparison_IsLessThanOrEqualTo_Test extends AbstractTe
@Test
@NeedReload
public void test_is_less_than_or_equal_to() {
- Table table = new Table(source, "test");
+ Table table = new Table(jdbcConnectionProvider, "test");
Changes changes = new Changes(table).setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
changes.setEndPointNow();
@@ -59,7 +60,7 @@ public void test_is_less_than_or_equal_to() {
@Test
@NeedReload
public void should_fail_because_value_is_greater_than() {
- Table table = new Table(source, "test");
+ Table table = new Table(jdbcConnectionProvider, "test");
Changes changes = new Changes(table).setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
changes.setEndPointNow();
@@ -68,7 +69,7 @@ public void should_fail_because_value_is_greater_than() {
assertThat(changes).change().column("var3").valueAtEndPoint().isLessThanOrEqualTo(1);
fail("An exception must be raised");
} catch (AssertionError e) {
- Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Value at end point of Column at index 2 (column name : VAR3) of Change at index 0 (with primary key : [1]) of Changes on TEST table of 'sa/jdbc:h2:mem:test' source] %n"
+ Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Value at end point of Column at index 2 (column name : VAR3) of Change at index 0 (with primary key : [1]) of Changes on TEST table of 'sa/jdbc:h2:mem:test'] %n"
+ "Expecting:%n"
+ " <2>%n"
+ "to be less than or equal to %n"
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnValueComparison_IsLessThan_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnValueComparison_IsLessThan_Test.java
index de5bff08..24e58102 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnValueComparison_IsLessThan_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnValueComparison_IsLessThan_Test.java
@@ -29,6 +29,7 @@
* {@link org.assertj.db.api.assertions.AssertOnValueComparison#isLessThan(Number)} method.
*
* @author Régis Pouiller
+ * @author Julien Roy
*/
public class AssertOnValueComparison_IsLessThan_Test extends AbstractTest {
@@ -39,7 +40,7 @@ public class AssertOnValueComparison_IsLessThan_Test extends AbstractTest {
@Test
@NeedReload
public void test_is_less_than() {
- Table table = new Table(source, "test");
+ Table table = new Table(jdbcConnectionProvider, "test");
Changes changes = new Changes(table).setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
changes.setEndPointNow();
@@ -59,7 +60,7 @@ public void test_is_less_than() {
@Test
@NeedReload
public void should_fail_because_value_is_greater_than_or_equal_to() {
- Table table = new Table(source, "test");
+ Table table = new Table(jdbcConnectionProvider, "test");
Changes changes = new Changes(table).setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
changes.setEndPointNow();
@@ -68,7 +69,7 @@ public void should_fail_because_value_is_greater_than_or_equal_to() {
assertThat(changes).change().column("var3").valueAtEndPoint().isLessThan(2);
fail("An exception must be raised");
} catch (AssertionError e) {
- Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Value at end point of Column at index 2 (column name : VAR3) of Change at index 0 (with primary key : [1]) of Changes on TEST table of 'sa/jdbc:h2:mem:test' source] %n"
+ Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Value at end point of Column at index 2 (column name : VAR3) of Change at index 0 (with primary key : [1]) of Changes on TEST table of 'sa/jdbc:h2:mem:test'] %n"
+ "Expecting:%n"
+ " <2>%n"
+ "to be less than %n"
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnValueCondition_DoesNotHave_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnValueCondition_DoesNotHave_Test.java
index 031300dd..44b8b430 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnValueCondition_DoesNotHave_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnValueCondition_DoesNotHave_Test.java
@@ -46,7 +46,7 @@ public boolean matches(Byte value) {
@Test
@NeedReload
public void test_does_not_have() {
- Table table = new Table(source, "test");
+ Table table = new Table(jdbcConnectionProvider, "test");
Changes changes = new Changes(table).setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
changes.setEndPointNow();
@@ -66,7 +66,7 @@ public void test_does_not_have() {
@Test
@NeedReload
public void should_fail_because_value_not_match_with_condition() {
- Table table = new Table(source, "test");
+ Table table = new Table(jdbcConnectionProvider, "test");
Changes changes = new Changes(table).setStartPointNow();
update("update test set var14 = 1 where var1 = 1000");
changes.setEndPointNow();
@@ -77,7 +77,7 @@ public void should_fail_because_value_not_match_with_condition() {
} catch (AssertionError e) {
Assertions.assertThat(e.getMessage()).isEqualTo(String.format(
"[Value at end point of Column at index 2 (column name : VAR3) of Change at index 0 (with primary key : [1000]) of "
- + "Changes on TEST table of 'sa/jdbc:h2:mem:test' source] %n"
+ + "Changes on TEST table of 'sa/jdbc:h2:mem:test'] %n"
+ "Expecting actual:%n"
+ " 0%n"
+ "not to be isZero"));
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnValueCondition_Has_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnValueCondition_Has_Test.java
index 12e4e905..7c2acfba 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnValueCondition_Has_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnValueCondition_Has_Test.java
@@ -46,7 +46,7 @@ public boolean matches(Byte value) {
@Test
@NeedReload
public void test_has() {
- Table table = new Table(source, "test");
+ Table table = new Table(jdbcConnectionProvider, "test");
Changes changes = new Changes(table).setStartPointNow();
update("update test set var14 = 1 where var1 = 1000");
changes.setEndPointNow();
@@ -66,7 +66,7 @@ public void test_has() {
@Test
@NeedReload
public void should_fail_because_value_not_match_with_condition() {
- Table table = new Table(source, "test");
+ Table table = new Table(jdbcConnectionProvider, "test");
Changes changes = new Changes(table).setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
changes.setEndPointNow();
@@ -77,7 +77,7 @@ public void should_fail_because_value_not_match_with_condition() {
} catch (AssertionError e) {
Assertions.assertThat(e.getMessage()).isEqualTo(String.format(
"[Value at end point of Column at index 2 (column name : VAR3) of Change at index 0 (with primary key : [1]) of "
- + "Changes on TEST table of 'sa/jdbc:h2:mem:test' source] %n"
+ + "Changes on TEST table of 'sa/jdbc:h2:mem:test'] %n"
+ "Expecting actual:%n"
+ " 2%n"
+ "to be isZero"));
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnValueCondition_IsNot_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnValueCondition_IsNot_Test.java
index 340eb1a3..b9951e6b 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnValueCondition_IsNot_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnValueCondition_IsNot_Test.java
@@ -46,7 +46,7 @@ public boolean matches(Byte value) {
@Test
@NeedReload
public void test_is_not() {
- Table table = new Table(source, "test");
+ Table table = new Table(jdbcConnectionProvider, "test");
Changes changes = new Changes(table).setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
changes.setEndPointNow();
@@ -66,7 +66,7 @@ public void test_is_not() {
@Test
@NeedReload
public void should_fail_because_value_not_match_with_condition() {
- Table table = new Table(source, "test");
+ Table table = new Table(jdbcConnectionProvider, "test");
Changes changes = new Changes(table).setStartPointNow();
update("update test set var14 = 1 where var1 = 1000");
changes.setEndPointNow();
@@ -77,7 +77,7 @@ public void should_fail_because_value_not_match_with_condition() {
} catch (AssertionError e) {
Assertions.assertThat(e.getMessage()).isEqualTo(String.format(
"[Value at end point of Column at index 2 (column name : VAR3) of Change at index 0 (with primary key : [1000]) of "
- + "Changes on TEST table of 'sa/jdbc:h2:mem:test' source] %n"
+ + "Changes on TEST table of 'sa/jdbc:h2:mem:test'] %n"
+ "Expecting actual:%n"
+ " 0%n"
+ "not to be isZero"));
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnValueCondition_Is_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnValueCondition_Is_Test.java
index 2f4786e1..77722515 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnValueCondition_Is_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnValueCondition_Is_Test.java
@@ -46,7 +46,7 @@ public boolean matches(Byte value) {
@Test
@NeedReload
public void test_is() {
- Table table = new Table(source, "test");
+ Table table = new Table(jdbcConnectionProvider, "test");
Changes changes = new Changes(table).setStartPointNow();
update("update test set var14 = 1 where var1 = 1000");
changes.setEndPointNow();
@@ -66,7 +66,7 @@ public void test_is() {
@Test
@NeedReload
public void should_fail_because_value_not_match_with_condition() {
- Table table = new Table(source, "test");
+ Table table = new Table(jdbcConnectionProvider, "test");
Changes changes = new Changes(table).setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
changes.setEndPointNow();
@@ -77,7 +77,7 @@ public void should_fail_because_value_not_match_with_condition() {
} catch (AssertionError e) {
Assertions.assertThat(e.getMessage()).isEqualTo(String.format(
"[Value at end point of Column at index 2 (column name : VAR3) of Change at index 0 (with primary key : [1]) of "
- + "Changes on TEST table of 'sa/jdbc:h2:mem:test' source] %n"
+ + "Changes on TEST table of 'sa/jdbc:h2:mem:test'] %n"
+ "Expecting actual:%n"
+ " 2%n"
+ "to be isZero"));
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnValueCondition_Satisfies_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnValueCondition_Satisfies_Test.java
index b7a31cb5..ddc1eab8 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnValueCondition_Satisfies_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnValueCondition_Satisfies_Test.java
@@ -46,7 +46,7 @@ public boolean matches(Byte value) {
@Test
@NeedReload
public void test_satisfies() {
- Table table = new Table(source, "test");
+ Table table = new Table(jdbcConnectionProvider, "test");
Changes changes = new Changes(table).setStartPointNow();
update("update test set var14 = 1 where var1 = 1000");
changes.setEndPointNow();
@@ -66,7 +66,7 @@ public void test_satisfies() {
@Test
@NeedReload
public void should_fail_because_value_not_match_with_condition() {
- Table table = new Table(source, "test");
+ Table table = new Table(jdbcConnectionProvider, "test");
Changes changes = new Changes(table).setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
changes.setEndPointNow();
@@ -77,7 +77,7 @@ public void should_fail_because_value_not_match_with_condition() {
} catch (AssertionError e) {
Assertions.assertThat(e.getMessage()).isEqualTo(String.format(
"[Value at end point of Column at index 2 (column name : VAR3) of Change at index 0 (with primary key : [1]) of "
- + "Changes on TEST table of 'sa/jdbc:h2:mem:test' source] %n"
+ + "Changes on TEST table of 'sa/jdbc:h2:mem:test'] %n"
+ "Expecting actual:%n"
+ " 2%n"
+ "to satisfy:%n"
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnValueEquality_IsEqualTo_Boolean_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnValueEquality_IsEqualTo_Boolean_Test.java
index 7d1659c1..576fa572 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnValueEquality_IsEqualTo_Boolean_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnValueEquality_IsEqualTo_Boolean_Test.java
@@ -29,6 +29,7 @@
* {@link org.assertj.db.api.assertions.AssertOnValueEquality#isEqualTo(Boolean)} method.
*
* @author Régis Pouiller
+ * @author Julien Roy
*/
public class AssertOnValueEquality_IsEqualTo_Boolean_Test extends AbstractTest {
@@ -38,7 +39,7 @@ public class AssertOnValueEquality_IsEqualTo_Boolean_Test extends AbstractTest {
@Test
@NeedReload
public void test_is_equal_to() {
- Table table = new Table(source, "test");
+ Table table = new Table(jdbcConnectionProvider, "test");
Changes changes = new Changes(table).setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
changes.setEndPointNow();
@@ -58,7 +59,7 @@ public void test_is_equal_to() {
@Test
@NeedReload
public void should_fail_because_value_is_not_equal_to() {
- Table table = new Table(source, "test");
+ Table table = new Table(jdbcConnectionProvider, "test");
Changes changes = new Changes(table).setStartPointNow();
update("update test set var14 = 1 where var1 = 10");
changes.setEndPointNow();
@@ -67,7 +68,7 @@ public void should_fail_because_value_is_not_equal_to() {
assertThat(changes).change().column("var2").valueAtEndPoint().isEqualTo(true);
fail("An exception must be raised");
} catch (AssertionError e) {
- Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Value at end point of Column at index 1 (column name : VAR2) of Change at index 0 (with primary key : [10]) of Changes on TEST table of 'sa/jdbc:h2:mem:test' source] %n"
+ Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Value at end point of Column at index 1 (column name : VAR2) of Change at index 0 (with primary key : [10]) of Changes on TEST table of 'sa/jdbc:h2:mem:test'] %n"
+ "Expecting:%n"
+ " %n"
+ "to be equal to: %n"
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnValueEquality_IsEqualTo_Bytes_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnValueEquality_IsEqualTo_Bytes_Test.java
index 271edcd9..3c862cdd 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnValueEquality_IsEqualTo_Bytes_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnValueEquality_IsEqualTo_Bytes_Test.java
@@ -30,6 +30,7 @@
* {@link org.assertj.db.api.assertions.AssertOnValueEquality#isEqualTo(byte[])} method.
*
* @author Régis Pouiller
+ * @author Julien Roy
*/
public class AssertOnValueEquality_IsEqualTo_Bytes_Test extends AbstractTest {
@@ -41,7 +42,7 @@ public class AssertOnValueEquality_IsEqualTo_Bytes_Test extends AbstractTest {
public void test_is_equal_to() {
byte[] bytesH2 = bytesContentFromClassPathOf("h2-logo-2.png");
- Table table = new Table(source, "test");
+ Table table = new Table(jdbcConnectionProvider, "test");
Changes changes = new Changes(table).setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
changes.setEndPointNow();
@@ -61,7 +62,7 @@ public void test_is_equal_to() {
@Test
@NeedReload
public void should_fail_because_value_is_not_equal_to() {
- Table table = new Table(source, "test");
+ Table table = new Table(jdbcConnectionProvider, "test");
Changes changes = new Changes(table).setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
changes.setEndPointNow();
@@ -70,7 +71,7 @@ public void should_fail_because_value_is_not_equal_to() {
assertThat(changes).change().column("var11").valueAtEndPoint().isEqualTo(new byte[0]);
fail("An exception must be raised");
} catch (AssertionError e) {
- Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Value at end point of Column at index 10 (column name : VAR11) of Change at index 0 (with primary key : [1]) of Changes on TEST table of 'sa/jdbc:h2:mem:test' source] %n"
+ Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Value at end point of Column at index 10 (column name : VAR11) of Change at index 0 (with primary key : [1]) of Changes on TEST table of 'sa/jdbc:h2:mem:test'] %n"
+ "Expecting to be equal to the expected value but was not equal"));
}
try {
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnValueEquality_IsEqualTo_Character_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnValueEquality_IsEqualTo_Character_Test.java
index 11003d17..6ab020ff 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnValueEquality_IsEqualTo_Character_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnValueEquality_IsEqualTo_Character_Test.java
@@ -29,6 +29,7 @@
* {@link org.assertj.db.api.assertions.AssertOnValueEquality#isEqualTo(Character)} method.
*
* @author Régis Pouiller
+ * @author Julien Roy
*/
public class AssertOnValueEquality_IsEqualTo_Character_Test extends AbstractTest {
@@ -38,7 +39,7 @@ public class AssertOnValueEquality_IsEqualTo_Character_Test extends AbstractTest
@Test
@NeedReload
public void test_is_equal_to() {
- Table table = new Table(source, "test");
+ Table table = new Table(jdbcConnectionProvider, "test");
Changes changes = new Changes(table).setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
changes.setEndPointNow();
@@ -58,7 +59,7 @@ public void test_is_equal_to() {
@Test
@NeedReload
public void should_fail_because_value_is_not_equal_to() {
- Table table = new Table(source, "test");
+ Table table = new Table(jdbcConnectionProvider, "test");
Changes changes = new Changes(table).setStartPointNow();
update("update test set var14 = 1 where var1 = 10");
changes.setEndPointNow();
@@ -67,7 +68,7 @@ public void should_fail_because_value_is_not_equal_to() {
assertThat(changes).change().column("var16").valueAtEndPoint().isEqualTo('t');
fail("An exception must be raised");
} catch (AssertionError e) {
- Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Value at end point of Column at index 15 (column name : VAR16) of Change at index 0 (with primary key : [10]) of Changes on TEST table of 'sa/jdbc:h2:mem:test' source] %n"
+ Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Value at end point of Column at index 15 (column name : VAR16) of Change at index 0 (with primary key : [10]) of Changes on TEST table of 'sa/jdbc:h2:mem:test'] %n"
+ "Expecting:%n"
+ " <\"e\">%n"
+ "to be equal to: %n"
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnValueEquality_IsEqualTo_DateTimeValue_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnValueEquality_IsEqualTo_DateTimeValue_Test.java
index 5c50f530..e2fd68ff 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnValueEquality_IsEqualTo_DateTimeValue_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnValueEquality_IsEqualTo_DateTimeValue_Test.java
@@ -32,6 +32,7 @@
* {@link org.assertj.db.api.assertions.AssertOnValueEquality#isEqualTo(org.assertj.db.type.DateTimeValue)} method.
*
* @author Régis Pouiller
+ * @author Julien Roy
*/
public class AssertOnValueEquality_IsEqualTo_DateTimeValue_Test extends AbstractTest {
@@ -41,7 +42,7 @@ public class AssertOnValueEquality_IsEqualTo_DateTimeValue_Test extends Abstract
@Test
@NeedReload
public void test_is_equal_to() {
- Table table = new Table(source, "test");
+ Table table = new Table(jdbcConnectionProvider, "test");
Changes changes = new Changes(table).setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
changes.setEndPointNow();
@@ -62,7 +63,7 @@ public void test_is_equal_to() {
@Test
@NeedReload
public void should_fail_because_value_is_not_equal_to() {
- Table table = new Table(source, "test");
+ Table table = new Table(jdbcConnectionProvider, "test");
Changes changes = new Changes(table).setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
changes.setEndPointNow();
@@ -72,7 +73,7 @@ public void should_fail_because_value_is_not_equal_to() {
DateTimeValue.of(DateValue.of(2014, 5, 24), TimeValue.of(9, 46, 31)));
fail("An exception must be raised");
} catch (AssertionError e) {
- Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Value at end point of Column at index 9 (column name : VAR10) of Change at index 0 (with primary key : [1]) of Changes on TEST table of 'sa/jdbc:h2:mem:test' source] %n"
+ Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Value at end point of Column at index 9 (column name : VAR10) of Change at index 0 (with primary key : [1]) of Changes on TEST table of 'sa/jdbc:h2:mem:test'] %n"
+ "Expecting:%n"
+ " <2014-05-24T09:46:30.000000000>%n"
+ "to be equal to: %n"
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnValueEquality_IsEqualTo_DateValue_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnValueEquality_IsEqualTo_DateValue_Test.java
index 26636b2c..7d0b9c2d 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnValueEquality_IsEqualTo_DateValue_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnValueEquality_IsEqualTo_DateValue_Test.java
@@ -12,6 +12,9 @@
*/
package org.assertj.db.api.assertions;
+import static org.assertj.db.api.Assertions.assertThat;
+import static org.junit.Assert.fail;
+
import org.assertj.core.api.Assertions;
import org.assertj.db.api.ChangeColumnValueAssert;
import org.assertj.db.api.TableColumnValueAssert;
@@ -22,14 +25,12 @@
import org.assertj.db.type.Table;
import org.junit.Test;
-import static org.assertj.db.api.Assertions.assertThat;
-import static org.junit.Assert.fail;
-
/**
* Tests on {@link org.assertj.db.api.assertions.AssertOnValueEquality} class :
* {@link org.assertj.db.api.assertions.AssertOnValueEquality#isEqualTo(org.assertj.db.type.DateValue)} method.
*
* @author Régis Pouiller
+ * @author Julien Roy
*/
public class AssertOnValueEquality_IsEqualTo_DateValue_Test extends AbstractTest {
@@ -39,7 +40,7 @@ public class AssertOnValueEquality_IsEqualTo_DateValue_Test extends AbstractTest
@Test
@NeedReload
public void test_is_equal_to() {
- Table table = new Table(source, "test");
+ Table table = new Table(jdbcConnectionProvider, "test");
Changes changes = new Changes(table).setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
changes.setEndPointNow();
@@ -59,7 +60,7 @@ public void test_is_equal_to() {
@Test
@NeedReload
public void should_fail_because_value_is_not_equal_to() {
- Table table = new Table(source, "test");
+ Table table = new Table(jdbcConnectionProvider, "test");
Changes changes = new Changes(table).setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
changes.setEndPointNow();
@@ -68,7 +69,7 @@ public void should_fail_because_value_is_not_equal_to() {
assertThat(changes).change().column("var9").valueAtEndPoint().isEqualTo(DateValue.of(2014, 5, 23));
fail("An exception must be raised");
} catch (AssertionError e) {
- Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Value at end point of Column at index 8 (column name : VAR9) of Change at index 0 (with primary key : [1]) of Changes on TEST table of 'sa/jdbc:h2:mem:test' source] %n"
+ Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Value at end point of Column at index 8 (column name : VAR9) of Change at index 0 (with primary key : [1]) of Changes on TEST table of 'sa/jdbc:h2:mem:test'] %n"
+ "Expecting:%n"
+ " <2014-05-24>%n"
+ "to be equal to: %n"
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnValueEquality_IsEqualTo_LocalDateTime_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnValueEquality_IsEqualTo_LocalDateTime_Test.java
index a9d99854..a5564720 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnValueEquality_IsEqualTo_LocalDateTime_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnValueEquality_IsEqualTo_LocalDateTime_Test.java
@@ -40,7 +40,7 @@ public class AssertOnValueEquality_IsEqualTo_LocalDateTime_Test extends Abstract
@Test
@NeedReload
public void test_is_equal_to() {
- Table table = new Table(source, "test");
+ Table table = new Table(jdbcConnectionProvider, "test");
Changes changes = new Changes(table).setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
changes.setEndPointNow();
@@ -60,7 +60,7 @@ public void test_is_equal_to() {
@Test
@NeedReload
public void should_fail_because_value_is_not_equal_to() {
- Table table = new Table(source, "test");
+ Table table = new Table(jdbcConnectionProvider, "test");
Changes changes = new Changes(table).setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
changes.setEndPointNow();
@@ -69,7 +69,7 @@ public void should_fail_because_value_is_not_equal_to() {
assertThat(changes).change().column("var10").valueAtEndPoint().isEqualTo(LocalDateTime.of(2014, 5, 24, 9, 46, 31));
fail("An exception must be raised");
} catch (AssertionError e) {
- Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Value at end point of Column at index 9 (column name : VAR10) of Change at index 0 (with primary key : [1]) of Changes on TEST table of 'sa/jdbc:h2:mem:test' source] %n"
+ Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Value at end point of Column at index 9 (column name : VAR10) of Change at index 0 (with primary key : [1]) of Changes on TEST table of 'sa/jdbc:h2:mem:test'] %n"
+ "Expecting:%n"
+ " <2014-05-24T09:46:30.000000000>%n"
+ "to be equal to: %n"
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnValueEquality_IsEqualTo_LocalDate_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnValueEquality_IsEqualTo_LocalDate_Test.java
index 9782936f..cd2692b4 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnValueEquality_IsEqualTo_LocalDate_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnValueEquality_IsEqualTo_LocalDate_Test.java
@@ -12,6 +12,11 @@
*/
package org.assertj.db.api.assertions;
+import static org.assertj.db.api.Assertions.assertThat;
+import static org.junit.Assert.fail;
+
+import java.time.LocalDate;
+
import org.assertj.core.api.Assertions;
import org.assertj.db.api.ChangeColumnValueAssert;
import org.assertj.db.api.TableColumnValueAssert;
@@ -21,11 +26,6 @@
import org.assertj.db.type.Table;
import org.junit.Test;
-import java.time.LocalDate;
-
-import static org.assertj.db.api.Assertions.assertThat;
-import static org.junit.Assert.fail;
-
/**
* Tests on {@link org.assertj.db.api.assertions.AssertOnValueEquality} class :
* {@link org.assertj.db.api.assertions.AssertOnValueEquality#isEqualTo(java.time.LocalDate)} method.
@@ -40,7 +40,7 @@ public class AssertOnValueEquality_IsEqualTo_LocalDate_Test extends AbstractTest
@Test
@NeedReload
public void test_is_equal_to() {
- Table table = new Table(source, "test");
+ Table table = new Table(jdbcConnectionProvider, "test");
Changes changes = new Changes(table).setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
changes.setEndPointNow();
@@ -60,7 +60,7 @@ public void test_is_equal_to() {
@Test
@NeedReload
public void should_fail_because_value_is_not_equal_to() {
- Table table = new Table(source, "test");
+ Table table = new Table(jdbcConnectionProvider, "test");
Changes changes = new Changes(table).setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
changes.setEndPointNow();
@@ -69,7 +69,7 @@ public void should_fail_because_value_is_not_equal_to() {
assertThat(changes).change().column("var9").valueAtEndPoint().isEqualTo(LocalDate.of(2014, 5, 23));
fail("An exception must be raised");
} catch (AssertionError e) {
- Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Value at end point of Column at index 8 (column name : VAR9) of Change at index 0 (with primary key : [1]) of Changes on TEST table of 'sa/jdbc:h2:mem:test' source] %n"
+ Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Value at end point of Column at index 8 (column name : VAR9) of Change at index 0 (with primary key : [1]) of Changes on TEST table of 'sa/jdbc:h2:mem:test'] %n"
+ "Expecting:%n"
+ " <2014-05-24>%n"
+ "to be equal to: %n"
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnValueEquality_IsEqualTo_LocalTime_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnValueEquality_IsEqualTo_LocalTime_Test.java
index f5e6fff4..916bf203 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnValueEquality_IsEqualTo_LocalTime_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnValueEquality_IsEqualTo_LocalTime_Test.java
@@ -40,7 +40,7 @@ public class AssertOnValueEquality_IsEqualTo_LocalTime_Test extends AbstractTest
@Test
@NeedReload
public void test_is_equal_to() {
- Table table = new Table(source, "test");
+ Table table = new Table(jdbcConnectionProvider, "test");
Changes changes = new Changes(table).setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
changes.setEndPointNow();
@@ -60,7 +60,7 @@ public void test_is_equal_to() {
@Test
@NeedReload
public void should_fail_because_value_is_not_equal_to() {
- Table table = new Table(source, "test");
+ Table table = new Table(jdbcConnectionProvider, "test");
Changes changes = new Changes(table).setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
changes.setEndPointNow();
@@ -69,7 +69,7 @@ public void should_fail_because_value_is_not_equal_to() {
assertThat(changes).change().column("var8").valueAtEndPoint().isEqualTo(LocalTime.of(9, 46, 31));
fail("An exception must be raised");
} catch (AssertionError e) {
- Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Value at end point of Column at index 7 (column name : VAR8) of Change at index 0 (with primary key : [1]) of Changes on TEST table of 'sa/jdbc:h2:mem:test' source] %n"
+ Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Value at end point of Column at index 7 (column name : VAR8) of Change at index 0 (with primary key : [1]) of Changes on TEST table of 'sa/jdbc:h2:mem:test'] %n"
+ "Expecting:%n"
+ " <09:46:30.000000000>%n"
+ "to be equal to: %n"
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnValueEquality_IsEqualTo_Number_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnValueEquality_IsEqualTo_Number_Test.java
index 1c1c9a07..81bf99ee 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnValueEquality_IsEqualTo_Number_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnValueEquality_IsEqualTo_Number_Test.java
@@ -29,6 +29,7 @@
* {@link org.assertj.db.api.assertions.AssertOnValueEquality#isEqualTo(Number)} method.
*
* @author Régis Pouiller
+ * @author Julien Roy
*/
public class AssertOnValueEquality_IsEqualTo_Number_Test extends AbstractTest {
@@ -38,7 +39,7 @@ public class AssertOnValueEquality_IsEqualTo_Number_Test extends AbstractTest {
@Test
@NeedReload
public void test_is_equal_to() {
- Table table = new Table(source, "test");
+ Table table = new Table(jdbcConnectionProvider, "test");
Changes changes = new Changes(table).setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
changes.setEndPointNow();
@@ -58,7 +59,7 @@ public void test_is_equal_to() {
@Test
@NeedReload
public void should_fail_because_value_is_not_equal_to() {
- Table table = new Table(source, "test");
+ Table table = new Table(jdbcConnectionProvider, "test");
Changes changes = new Changes(table).setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
changes.setEndPointNow();
@@ -67,7 +68,7 @@ public void should_fail_because_value_is_not_equal_to() {
assertThat(changes).change().column("var3").valueAtEndPoint().isEqualTo(3);
fail("An exception must be raised");
} catch (AssertionError e) {
- Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Value at end point of Column at index 2 (column name : VAR3) of Change at index 0 (with primary key : [1]) of Changes on TEST table of 'sa/jdbc:h2:mem:test' source] %n"
+ Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Value at end point of Column at index 2 (column name : VAR3) of Change at index 0 (with primary key : [1]) of Changes on TEST table of 'sa/jdbc:h2:mem:test'] %n"
+ "Expecting:%n"
+ " <2>%n"
+ "to be equal to: %n"
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnValueEquality_IsEqualTo_Object_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnValueEquality_IsEqualTo_Object_Test.java
index e1f881cd..990d4d49 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnValueEquality_IsEqualTo_Object_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnValueEquality_IsEqualTo_Object_Test.java
@@ -29,6 +29,7 @@
* {@link org.assertj.db.api.assertions.AssertOnValueEquality#isEqualTo(Object)} method.
*
* @author Régis Pouiller
+ * @author Julien Roy
*/
public class AssertOnValueEquality_IsEqualTo_Object_Test extends AbstractTest {
@@ -38,7 +39,7 @@ public class AssertOnValueEquality_IsEqualTo_Object_Test extends AbstractTest {
@Test
@NeedReload
public void test_is_null() {
- Table table = new Table(source, "test2");
+ Table table = new Table(jdbcConnectionProvider, "test2");
Changes changes = new Changes(table).setStartPointNow();
update("update test2 set var14 = 1 where var1 is null");
changes.setEndPointNow();
@@ -58,7 +59,7 @@ public void test_is_null() {
@Test
@NeedReload
public void should_fail_because_value_is_not_null() {
- Table table = new Table(source, "test");
+ Table table = new Table(jdbcConnectionProvider, "test");
Changes changes = new Changes(table).setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
changes.setEndPointNow();
@@ -67,7 +68,7 @@ public void should_fail_because_value_is_not_null() {
assertThat(changes).change().column("var3").valueAtEndPoint().isEqualTo((Object) null);
fail("An exception must be raised");
} catch (AssertionError e) {
- Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Value at end point of Column at index 2 (column name : VAR3) of Change at index 0 (with primary key : [1]) of Changes on TEST table of 'sa/jdbc:h2:mem:test' source] %n"
+ Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Value at end point of Column at index 2 (column name : VAR3) of Change at index 0 (with primary key : [1]) of Changes on TEST table of 'sa/jdbc:h2:mem:test'] %n"
+ "Expecting:%n"
+ " <2>%n"
+ "to be equal to: %n"
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnValueEquality_IsEqualTo_String_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnValueEquality_IsEqualTo_String_Test.java
index 9ad380f7..f1aae8a9 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnValueEquality_IsEqualTo_String_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnValueEquality_IsEqualTo_String_Test.java
@@ -29,6 +29,7 @@
* {@link org.assertj.db.api.assertions.AssertOnValueEquality#isEqualTo(String)} method.
*
* @author Régis Pouiller
+ * @author Julien Roy
*/
public class AssertOnValueEquality_IsEqualTo_String_Test extends AbstractTest {
@@ -38,7 +39,7 @@ public class AssertOnValueEquality_IsEqualTo_String_Test extends AbstractTest {
@Test
@NeedReload
public void test_is_equal_to() {
- Table table = new Table(source, "test");
+ Table table = new Table(jdbcConnectionProvider, "test");
Changes changes = new Changes(table).setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
changes.setEndPointNow();
@@ -58,7 +59,7 @@ public void test_is_equal_to() {
@Test
@NeedReload
public void should_fail_because_value_is_not_equal_to() {
- Table table = new Table(source, "test");
+ Table table = new Table(jdbcConnectionProvider, "test");
Changes changes = new Changes(table).setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
changes.setEndPointNow();
@@ -67,7 +68,7 @@ public void should_fail_because_value_is_not_equal_to() {
assertThat(changes).change().column("var12").valueAtEndPoint().isEqualTo("-");
fail("An exception must be raised");
} catch (AssertionError e) {
- Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Value at end point of Column at index 11 (column name : VAR12) of Change at index 0 (with primary key : [1]) of Changes on TEST table of 'sa/jdbc:h2:mem:test' source] %n"
+ Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Value at end point of Column at index 11 (column name : VAR12) of Change at index 0 (with primary key : [1]) of Changes on TEST table of 'sa/jdbc:h2:mem:test'] %n"
+ "Expecting:%n"
+ " <\"text\">%n"
+ "to be equal to: %n"
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnValueEquality_IsEqualTo_TimeValue_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnValueEquality_IsEqualTo_TimeValue_Test.java
index 95ac1ff5..12f5e628 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnValueEquality_IsEqualTo_TimeValue_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnValueEquality_IsEqualTo_TimeValue_Test.java
@@ -30,6 +30,7 @@
* {@link org.assertj.db.api.assertions.AssertOnValueEquality#isEqualTo(org.assertj.db.type.TimeValue)} method.
*
* @author Régis Pouiller
+ * @author Julien Roy
*/
public class AssertOnValueEquality_IsEqualTo_TimeValue_Test extends AbstractTest {
@@ -39,7 +40,7 @@ public class AssertOnValueEquality_IsEqualTo_TimeValue_Test extends AbstractTest
@Test
@NeedReload
public void test_is_equal_to() {
- Table table = new Table(source, "test");
+ Table table = new Table(jdbcConnectionProvider, "test");
Changes changes = new Changes(table).setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
changes.setEndPointNow();
@@ -59,7 +60,7 @@ public void test_is_equal_to() {
@Test
@NeedReload
public void should_fail_because_value_is_not_equal_to() {
- Table table = new Table(source, "test");
+ Table table = new Table(jdbcConnectionProvider, "test");
Changes changes = new Changes(table).setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
changes.setEndPointNow();
@@ -68,7 +69,7 @@ public void should_fail_because_value_is_not_equal_to() {
assertThat(changes).change().column("var8").valueAtEndPoint().isEqualTo(TimeValue.of(9, 46, 31));
fail("An exception must be raised");
} catch (AssertionError e) {
- Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Value at end point of Column at index 7 (column name : VAR8) of Change at index 0 (with primary key : [1]) of Changes on TEST table of 'sa/jdbc:h2:mem:test' source] %n"
+ Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Value at end point of Column at index 7 (column name : VAR8) of Change at index 0 (with primary key : [1]) of Changes on TEST table of 'sa/jdbc:h2:mem:test'] %n"
+ "Expecting:%n"
+ " <09:46:30.000000000>%n"
+ "to be equal to: %n"
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnValueEquality_IsEqualTo_UUID_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnValueEquality_IsEqualTo_UUID_Test.java
index 37b1b79d..f8d676f1 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnValueEquality_IsEqualTo_UUID_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnValueEquality_IsEqualTo_UUID_Test.java
@@ -40,7 +40,7 @@ public class AssertOnValueEquality_IsEqualTo_UUID_Test extends AbstractTest {
@Test
@NeedReload
public void test_is_equal_to() {
- Table table = new Table(source, "test");
+ Table table = new Table(jdbcConnectionProvider, "test");
Changes changes = new Changes(table).setStartPointNow();
update("update test set var15 = '2B0D1BDD-909E-4362-BA10-C930BA82718D' where var1 = 1");
changes.setEndPointNow();
@@ -62,7 +62,7 @@ public void test_is_equal_to() {
@Test
@NeedReload
public void should_fail_because_value_is_not_equal_to() {
- Table table = new Table(source, "test");
+ Table table = new Table(jdbcConnectionProvider, "test");
Changes changes = new Changes(table).setStartPointNow();
update("update test set var15 = '2B0D1BDD-909E-4362-BA10-C930BA82718D' where var1 = 10");
changes.setEndPointNow();
@@ -73,7 +73,7 @@ public void should_fail_because_value_is_not_equal_to() {
fail("An exception must be raised");
} catch (AssertionError e) {
Assertions.assertThat(e.getMessage()).isEqualTo(String.format(
- "[Value at end point of Column at index 14 (column name : VAR15) of Change at index 0 (with primary key : [10]) of Changes on TEST table of 'sa/jdbc:h2:mem:test' source] %n"
+ "[Value at end point of Column at index 14 (column name : VAR15) of Change at index 0 (with primary key : [10]) of Changes on TEST table of 'sa/jdbc:h2:mem:test'] %n"
+ "Expecting:%n"
+ " <2b0d1bdd-909e-4362-ba10-c930ba82718d>%n"
+ "to be equal to: %n"
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnValueEquality_IsFalse_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnValueEquality_IsFalse_Test.java
index 4141fadb..bbe14623 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnValueEquality_IsFalse_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnValueEquality_IsFalse_Test.java
@@ -29,6 +29,7 @@
* {@link org.assertj.db.api.assertions.AssertOnValueEquality#isFalse()} method.
*
* @author Régis Pouiller
+ * @author Julien Roy
*/
public class AssertOnValueEquality_IsFalse_Test extends AbstractTest {
@@ -38,7 +39,7 @@ public class AssertOnValueEquality_IsFalse_Test extends AbstractTest {
@Test
@NeedReload
public void test_is_false() {
- Table table = new Table(source, "test");
+ Table table = new Table(jdbcConnectionProvider, "test");
Changes changes = new Changes(table).setStartPointNow();
update("update test set var14 = 1 where var1 = 10");
changes.setEndPointNow();
@@ -58,7 +59,7 @@ public void test_is_false() {
@Test
@NeedReload
public void should_fail_because_value_is_true() {
- Table table = new Table(source, "test");
+ Table table = new Table(jdbcConnectionProvider, "test");
Changes changes = new Changes(table).setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
changes.setEndPointNow();
@@ -67,7 +68,7 @@ public void should_fail_because_value_is_true() {
assertThat(changes).change().column("var2").valueAtEndPoint().isFalse();
fail("An exception must be raised");
} catch (AssertionError e) {
- Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Value at end point of Column at index 1 (column name : VAR2) of Change at index 0 (with primary key : [1]) of Changes on TEST table of 'sa/jdbc:h2:mem:test' source] %n"
+ Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Value at end point of Column at index 1 (column name : VAR2) of Change at index 0 (with primary key : [1]) of Changes on TEST table of 'sa/jdbc:h2:mem:test'] %n"
+ "Expecting:%n"
+ " %n"
+ "to be equal to: %n"
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnValueEquality_IsTrue_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnValueEquality_IsTrue_Test.java
index d3749bf5..003f7dd0 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnValueEquality_IsTrue_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnValueEquality_IsTrue_Test.java
@@ -29,6 +29,7 @@
* {@link org.assertj.db.api.assertions.AssertOnValueEquality#isTrue()} method.
*
* @author Régis Pouiller
+ * @author Julien Roy
*/
public class AssertOnValueEquality_IsTrue_Test extends AbstractTest {
@@ -38,7 +39,7 @@ public class AssertOnValueEquality_IsTrue_Test extends AbstractTest {
@Test
@NeedReload
public void test_is_true() {
- Table table = new Table(source, "test");
+ Table table = new Table(jdbcConnectionProvider, "test");
Changes changes = new Changes(table).setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
changes.setEndPointNow();
@@ -58,7 +59,7 @@ public void test_is_true() {
@Test
@NeedReload
public void should_fail_because_value_is_false() {
- Table table = new Table(source, "test");
+ Table table = new Table(jdbcConnectionProvider, "test");
Changes changes = new Changes(table).setStartPointNow();
update("update test set var14 = 1 where var1 = 10");
changes.setEndPointNow();
@@ -67,7 +68,7 @@ public void should_fail_because_value_is_false() {
assertThat(changes).change().column("var2").valueAtEndPoint().isTrue();
fail("An exception must be raised");
} catch (AssertionError e) {
- Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Value at end point of Column at index 1 (column name : VAR2) of Change at index 0 (with primary key : [10]) of Changes on TEST table of 'sa/jdbc:h2:mem:test' source] %n"
+ Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Value at end point of Column at index 1 (column name : VAR2) of Change at index 0 (with primary key : [10]) of Changes on TEST table of 'sa/jdbc:h2:mem:test'] %n"
+ "Expecting:%n"
+ " %n"
+ "to be equal to: %n"
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnValueEquality_IsZero_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnValueEquality_IsZero_Test.java
index cedb3d5e..0a59d8b9 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnValueEquality_IsZero_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnValueEquality_IsZero_Test.java
@@ -29,6 +29,7 @@
* {@link org.assertj.db.api.assertions.AssertOnValueEquality#isZero()} method.
*
* @author Régis Pouiller
+ * @author Julien Roy
*/
public class AssertOnValueEquality_IsZero_Test extends AbstractTest {
@@ -38,7 +39,7 @@ public class AssertOnValueEquality_IsZero_Test extends AbstractTest {
@Test
@NeedReload
public void test_is_zero() {
- Table table = new Table(source, "test");
+ Table table = new Table(jdbcConnectionProvider, "test");
Changes changes = new Changes(table).setStartPointNow();
update("update test set var14 = 1 where var1 = 1000");
changes.setEndPointNow();
@@ -58,7 +59,7 @@ public void test_is_zero() {
@Test
@NeedReload
public void should_fail_because_value_is_not_zero() {
- Table table = new Table(source, "test");
+ Table table = new Table(jdbcConnectionProvider, "test");
Changes changes = new Changes(table).setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
changes.setEndPointNow();
@@ -67,7 +68,7 @@ public void should_fail_because_value_is_not_zero() {
assertThat(changes).change().column("var3").valueAtEndPoint().isZero();
fail("An exception must be raised");
} catch (AssertionError e) {
- Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Value at end point of Column at index 2 (column name : VAR3) of Change at index 0 (with primary key : [1]) of Changes on TEST table of 'sa/jdbc:h2:mem:test' source] %n"
+ Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Value at end point of Column at index 2 (column name : VAR3) of Change at index 0 (with primary key : [1]) of Changes on TEST table of 'sa/jdbc:h2:mem:test'] %n"
+ "Expecting:%n"
+ " <2>%n"
+ "to be equal to: %n"
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnValueInequality_IsNotEqualTo_Boolean_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnValueInequality_IsNotEqualTo_Boolean_Test.java
index 9e944944..9dcb4cf5 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnValueInequality_IsNotEqualTo_Boolean_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnValueInequality_IsNotEqualTo_Boolean_Test.java
@@ -29,6 +29,7 @@
* {@link org.assertj.db.api.assertions.AssertOnValueInequality#isNotEqualTo(Boolean)} method.
*
* @author Régis Pouiller
+ * @author Julien Roy
*/
public class AssertOnValueInequality_IsNotEqualTo_Boolean_Test extends AbstractTest {
@@ -38,7 +39,7 @@ public class AssertOnValueInequality_IsNotEqualTo_Boolean_Test extends AbstractT
@Test
@NeedReload
public void test_is_not_equal_to() {
- Table table = new Table(source, "test");
+ Table table = new Table(jdbcConnectionProvider, "test");
Changes changes = new Changes(table).setStartPointNow();
update("update test set var14 = 1 where var1 = 10");
changes.setEndPointNow();
@@ -58,7 +59,7 @@ public void test_is_not_equal_to() {
@Test
@NeedReload
public void should_fail_because_value_is_equal_to() {
- Table table = new Table(source, "test");
+ Table table = new Table(jdbcConnectionProvider, "test");
Changes changes = new Changes(table).setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
changes.setEndPointNow();
@@ -67,7 +68,7 @@ public void should_fail_because_value_is_equal_to() {
assertThat(changes).change().column("var2").valueAtEndPoint().isNotEqualTo(true);
fail("An exception must be raised");
} catch (AssertionError e) {
- Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Value at end point of Column at index 1 (column name : VAR2) of Change at index 0 (with primary key : [1]) of Changes on TEST table of 'sa/jdbc:h2:mem:test' source] %n"
+ Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Value at end point of Column at index 1 (column name : VAR2) of Change at index 0 (with primary key : [1]) of Changes on TEST table of 'sa/jdbc:h2:mem:test'] %n"
+ "Expecting:%n"
+ " %n"
+ "not to be equal to: %n"
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnValueInequality_IsNotEqualTo_Bytes_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnValueInequality_IsNotEqualTo_Bytes_Test.java
index cc72a6d0..779fe075 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnValueInequality_IsNotEqualTo_Bytes_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnValueInequality_IsNotEqualTo_Bytes_Test.java
@@ -30,6 +30,7 @@
* {@link org.assertj.db.api.assertions.AssertOnValueInequality#isNotEqualTo(byte[])} method.
*
* @author Régis Pouiller
+ * @author Julien Roy
*/
public class AssertOnValueInequality_IsNotEqualTo_Bytes_Test extends AbstractTest {
@@ -39,7 +40,7 @@ public class AssertOnValueInequality_IsNotEqualTo_Bytes_Test extends AbstractTes
@Test
@NeedReload
public void test_is_not_equal_to() {
- Table table = new Table(source, "test");
+ Table table = new Table(jdbcConnectionProvider, "test");
Changes changes = new Changes(table).setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
changes.setEndPointNow();
@@ -61,7 +62,7 @@ public void test_is_not_equal_to() {
public void should_fail_because_value_is_equal_to() {
byte[] bytesH2 = bytesContentFromClassPathOf("h2-logo-2.png");
- Table table = new Table(source, "test");
+ Table table = new Table(jdbcConnectionProvider, "test");
Changes changes = new Changes(table).setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
changes.setEndPointNow();
@@ -70,7 +71,7 @@ public void should_fail_because_value_is_equal_to() {
assertThat(changes).change().column("var11").valueAtEndPoint().isNotEqualTo(bytesH2);
fail("An exception must be raised");
} catch (AssertionError e) {
- Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Value at end point of Column at index 10 (column name : VAR11) of Change at index 0 (with primary key : [1]) of Changes on TEST table of 'sa/jdbc:h2:mem:test' source] %n"
+ Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Value at end point of Column at index 10 (column name : VAR11) of Change at index 0 (with primary key : [1]) of Changes on TEST table of 'sa/jdbc:h2:mem:test'] %n"
+ "Expecting to be not equal to the value but was equal"));
}
try {
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnValueInequality_IsNotEqualTo_Character_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnValueInequality_IsNotEqualTo_Character_Test.java
index 6f967c46..348ef178 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnValueInequality_IsNotEqualTo_Character_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnValueInequality_IsNotEqualTo_Character_Test.java
@@ -29,6 +29,7 @@
* {@link org.assertj.db.api.assertions.AssertOnValueInequality#isNotEqualTo(Character)} method.
*
* @author Régis Pouiller
+ * @author Julien Roy
*/
public class AssertOnValueInequality_IsNotEqualTo_Character_Test extends AbstractTest {
@@ -38,7 +39,7 @@ public class AssertOnValueInequality_IsNotEqualTo_Character_Test extends Abstrac
@Test
@NeedReload
public void test_is_not_equal_to() {
- Table table = new Table(source, "test");
+ Table table = new Table(jdbcConnectionProvider, "test");
Changes changes = new Changes(table).setStartPointNow();
update("update test set var14 = 1 where var1 = 10");
changes.setEndPointNow();
@@ -58,7 +59,7 @@ public void test_is_not_equal_to() {
@Test
@NeedReload
public void should_fail_because_value_is_equal_to() {
- Table table = new Table(source, "test");
+ Table table = new Table(jdbcConnectionProvider, "test");
Changes changes = new Changes(table).setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
changes.setEndPointNow();
@@ -67,7 +68,7 @@ public void should_fail_because_value_is_equal_to() {
assertThat(changes).change().column("var16").valueAtEndPoint().isNotEqualTo('T');
fail("An exception must be raised");
} catch (AssertionError e) {
- Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Value at end point of Column at index 15 (column name : VAR16) of Change at index 0 (with primary key : [1]) of Changes on TEST table of 'sa/jdbc:h2:mem:test' source] %n"
+ Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Value at end point of Column at index 15 (column name : VAR16) of Change at index 0 (with primary key : [1]) of Changes on TEST table of 'sa/jdbc:h2:mem:test'] %n"
+ "Expecting:%n"
+ " <\"T\">%n"
+ "not to be equal to: %n"
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnValueInequality_IsNotEqualTo_DateTimeValue_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnValueInequality_IsNotEqualTo_DateTimeValue_Test.java
index abda9f4c..79d4204e 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnValueInequality_IsNotEqualTo_DateTimeValue_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnValueInequality_IsNotEqualTo_DateTimeValue_Test.java
@@ -32,6 +32,7 @@
* {@link org.assertj.db.api.assertions.AssertOnValueInequality#isNotEqualTo(org.assertj.db.type.DateTimeValue)} method.
*
* @author Régis Pouiller
+ * @author Julien Roy
*/
public class AssertOnValueInequality_IsNotEqualTo_DateTimeValue_Test extends AbstractTest {
@@ -41,7 +42,7 @@ public class AssertOnValueInequality_IsNotEqualTo_DateTimeValue_Test extends Abs
@Test
@NeedReload
public void test_is_not_equal_to() {
- Table table = new Table(source, "test");
+ Table table = new Table(jdbcConnectionProvider, "test");
Changes changes = new Changes(table).setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
changes.setEndPointNow();
@@ -63,7 +64,7 @@ public void test_is_not_equal_to() {
@Test
@NeedReload
public void should_fail_because_value_is_equal_to() {
- Table table = new Table(source, "test");
+ Table table = new Table(jdbcConnectionProvider, "test");
Changes changes = new Changes(table).setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
changes.setEndPointNow();
@@ -73,7 +74,7 @@ public void should_fail_because_value_is_equal_to() {
.of(9, 46, 30)));
fail("An exception must be raised");
} catch (AssertionError e) {
- Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Value at end point of Column at index 9 (column name : VAR10) of Change at index 0 (with primary key : [1]) of Changes on TEST table of 'sa/jdbc:h2:mem:test' source] %n"
+ Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Value at end point of Column at index 9 (column name : VAR10) of Change at index 0 (with primary key : [1]) of Changes on TEST table of 'sa/jdbc:h2:mem:test'] %n"
+ "Expecting:%n"
+ " <2014-05-24T09:46:30.000000000>%n"
+ "not to be equal to: %n"
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnValueInequality_IsNotEqualTo_DateValue_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnValueInequality_IsNotEqualTo_DateValue_Test.java
index aee43532..897957ee 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnValueInequality_IsNotEqualTo_DateValue_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnValueInequality_IsNotEqualTo_DateValue_Test.java
@@ -30,6 +30,7 @@
* {@link org.assertj.db.api.assertions.AssertOnValueInequality#isNotEqualTo(org.assertj.db.type.DateValue)} method.
*
* @author Régis Pouiller
+ * @author Julien Roy
*/
public class AssertOnValueInequality_IsNotEqualTo_DateValue_Test extends AbstractTest {
@@ -39,7 +40,7 @@ public class AssertOnValueInequality_IsNotEqualTo_DateValue_Test extends Abstrac
@Test
@NeedReload
public void test_is_not_equal_to() {
- Table table = new Table(source, "test");
+ Table table = new Table(jdbcConnectionProvider, "test");
Changes changes = new Changes(table).setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
changes.setEndPointNow();
@@ -59,7 +60,7 @@ public void test_is_not_equal_to() {
@Test
@NeedReload
public void should_fail_because_value_is_equal_to() {
- Table table = new Table(source, "test");
+ Table table = new Table(jdbcConnectionProvider, "test");
Changes changes = new Changes(table).setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
changes.setEndPointNow();
@@ -68,7 +69,7 @@ public void should_fail_because_value_is_equal_to() {
assertThat(changes).change().column("var9").valueAtEndPoint().isNotEqualTo(DateValue.of(2014, 5, 24));
fail("An exception must be raised");
} catch (AssertionError e) {
- Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Value at end point of Column at index 8 (column name : VAR9) of Change at index 0 (with primary key : [1]) of Changes on TEST table of 'sa/jdbc:h2:mem:test' source] %n"
+ Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Value at end point of Column at index 8 (column name : VAR9) of Change at index 0 (with primary key : [1]) of Changes on TEST table of 'sa/jdbc:h2:mem:test'] %n"
+ "Expecting:%n"
+ " <2014-05-24>%n"
+ "not to be equal to: %n"
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnValueInequality_IsNotEqualTo_LocalDateTime_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnValueInequality_IsNotEqualTo_LocalDateTime_Test.java
index dd5f978a..2f5be9d5 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnValueInequality_IsNotEqualTo_LocalDateTime_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnValueInequality_IsNotEqualTo_LocalDateTime_Test.java
@@ -40,7 +40,7 @@ public class AssertOnValueInequality_IsNotEqualTo_LocalDateTime_Test extends Abs
@Test
@NeedReload
public void test_is_not_equal_to() {
- Table table = new Table(source, "test");
+ Table table = new Table(jdbcConnectionProvider, "test");
Changes changes = new Changes(table).setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
changes.setEndPointNow();
@@ -60,7 +60,7 @@ public void test_is_not_equal_to() {
@Test
@NeedReload
public void should_fail_because_value_is_equal_to() {
- Table table = new Table(source, "test");
+ Table table = new Table(jdbcConnectionProvider, "test");
Changes changes = new Changes(table).setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
changes.setEndPointNow();
@@ -69,7 +69,7 @@ public void should_fail_because_value_is_equal_to() {
assertThat(changes).change().column("var10").valueAtEndPoint().isNotEqualTo(LocalDateTime.of(2014, 5, 24, 9, 46, 30));
fail("An exception must be raised");
} catch (AssertionError e) {
- Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Value at end point of Column at index 9 (column name : VAR10) of Change at index 0 (with primary key : [1]) of Changes on TEST table of 'sa/jdbc:h2:mem:test' source] %n"
+ Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Value at end point of Column at index 9 (column name : VAR10) of Change at index 0 (with primary key : [1]) of Changes on TEST table of 'sa/jdbc:h2:mem:test'] %n"
+ "Expecting:%n"
+ " <2014-05-24T09:46:30.000000000>%n"
+ "not to be equal to: %n"
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnValueInequality_IsNotEqualTo_LocalDate_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnValueInequality_IsNotEqualTo_LocalDate_Test.java
index e8b2ad2b..75c85962 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnValueInequality_IsNotEqualTo_LocalDate_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnValueInequality_IsNotEqualTo_LocalDate_Test.java
@@ -40,7 +40,7 @@ public class AssertOnValueInequality_IsNotEqualTo_LocalDate_Test extends Abstrac
@Test
@NeedReload
public void test_is_not_equal_to() {
- Table table = new Table(source, "test");
+ Table table = new Table(jdbcConnectionProvider, "test");
Changes changes = new Changes(table).setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
changes.setEndPointNow();
@@ -60,7 +60,7 @@ public void test_is_not_equal_to() {
@Test
@NeedReload
public void should_fail_because_value_is_equal_to() {
- Table table = new Table(source, "test");
+ Table table = new Table(jdbcConnectionProvider, "test");
Changes changes = new Changes(table).setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
changes.setEndPointNow();
@@ -69,7 +69,7 @@ public void should_fail_because_value_is_equal_to() {
assertThat(changes).change().column("var9").valueAtEndPoint().isNotEqualTo(LocalDate.of(2014, 5, 24));
fail("An exception must be raised");
} catch (AssertionError e) {
- Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Value at end point of Column at index 8 (column name : VAR9) of Change at index 0 (with primary key : [1]) of Changes on TEST table of 'sa/jdbc:h2:mem:test' source] %n"
+ Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Value at end point of Column at index 8 (column name : VAR9) of Change at index 0 (with primary key : [1]) of Changes on TEST table of 'sa/jdbc:h2:mem:test'] %n"
+ "Expecting:%n"
+ " <2014-05-24>%n"
+ "not to be equal to: %n"
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnValueInequality_IsNotEqualTo_LocalTime_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnValueInequality_IsNotEqualTo_LocalTime_Test.java
index 742cfbd4..6612d846 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnValueInequality_IsNotEqualTo_LocalTime_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnValueInequality_IsNotEqualTo_LocalTime_Test.java
@@ -40,7 +40,7 @@ public class AssertOnValueInequality_IsNotEqualTo_LocalTime_Test extends Abstrac
@Test
@NeedReload
public void test_is_not_equal_to() {
- Table table = new Table(source, "test");
+ Table table = new Table(jdbcConnectionProvider, "test");
Changes changes = new Changes(table).setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
changes.setEndPointNow();
@@ -60,7 +60,7 @@ public void test_is_not_equal_to() {
@Test
@NeedReload
public void should_fail_because_value_is_equal_to() {
- Table table = new Table(source, "test");
+ Table table = new Table(jdbcConnectionProvider, "test");
Changes changes = new Changes(table).setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
changes.setEndPointNow();
@@ -69,7 +69,7 @@ public void should_fail_because_value_is_equal_to() {
assertThat(changes).change().column("var8").valueAtEndPoint().isNotEqualTo(LocalTime.of(9, 46, 30));
fail("An exception must be raised");
} catch (AssertionError e) {
- Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Value at end point of Column at index 7 (column name : VAR8) of Change at index 0 (with primary key : [1]) of Changes on TEST table of 'sa/jdbc:h2:mem:test' source] %n"
+ Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Value at end point of Column at index 7 (column name : VAR8) of Change at index 0 (with primary key : [1]) of Changes on TEST table of 'sa/jdbc:h2:mem:test'] %n"
+ "Expecting:%n"
+ " <09:46:30.000000000>%n"
+ "not to be equal to: %n"
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnValueInequality_IsNotEqualTo_Number_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnValueInequality_IsNotEqualTo_Number_Test.java
index 17c12660..c8186b75 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnValueInequality_IsNotEqualTo_Number_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnValueInequality_IsNotEqualTo_Number_Test.java
@@ -29,6 +29,7 @@
* {@link org.assertj.db.api.assertions.AssertOnValueInequality#isNotEqualTo(Number)} method.
*
* @author Régis Pouiller
+ * @author Julien Roy
*/
public class AssertOnValueInequality_IsNotEqualTo_Number_Test extends AbstractTest {
@@ -38,7 +39,7 @@ public class AssertOnValueInequality_IsNotEqualTo_Number_Test extends AbstractTe
@Test
@NeedReload
public void test_is_not_equal_to() {
- Table table = new Table(source, "test");
+ Table table = new Table(jdbcConnectionProvider, "test");
Changes changes = new Changes(table).setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
changes.setEndPointNow();
@@ -58,7 +59,7 @@ public void test_is_not_equal_to() {
@Test
@NeedReload
public void should_fail_because_value_is_equal_to() {
- Table table = new Table(source, "test");
+ Table table = new Table(jdbcConnectionProvider, "test");
Changes changes = new Changes(table).setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
changes.setEndPointNow();
@@ -67,7 +68,7 @@ public void should_fail_because_value_is_equal_to() {
assertThat(changes).change().column("var3").valueAtEndPoint().isNotEqualTo(2);
fail("An exception must be raised");
} catch (AssertionError e) {
- Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Value at end point of Column at index 2 (column name : VAR3) of Change at index 0 (with primary key : [1]) of Changes on TEST table of 'sa/jdbc:h2:mem:test' source] %n"
+ Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Value at end point of Column at index 2 (column name : VAR3) of Change at index 0 (with primary key : [1]) of Changes on TEST table of 'sa/jdbc:h2:mem:test'] %n"
+ "Expecting:%n"
+ " <2>%n"
+ "not to be equal to: %n"
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnValueInequality_IsNotEqualTo_Object_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnValueInequality_IsNotEqualTo_Object_Test.java
index b925765c..b8aa4663 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnValueInequality_IsNotEqualTo_Object_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnValueInequality_IsNotEqualTo_Object_Test.java
@@ -29,6 +29,7 @@
* {@link org.assertj.db.api.assertions.AssertOnValueInequality#isNotEqualTo(Object)} method.
*
* @author Régis Pouiller
+ * @author Julien Roy
*/
public class AssertOnValueInequality_IsNotEqualTo_Object_Test extends AbstractTest {
@@ -38,7 +39,7 @@ public class AssertOnValueInequality_IsNotEqualTo_Object_Test extends AbstractTe
@Test
@NeedReload
public void test_is_not_equal_to() {
- Table table = new Table(source, "test");
+ Table table = new Table(jdbcConnectionProvider, "test");
Changes changes = new Changes(table).setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
changes.setEndPointNow();
@@ -58,7 +59,7 @@ public void test_is_not_equal_to() {
@Test
@NeedReload
public void should_fail_because_value_is_equal_to() {
- Table table = new Table(source, "test2");
+ Table table = new Table(jdbcConnectionProvider, "test2");
Changes changes = new Changes(table).setStartPointNow();
update("update test2 set var14 = 1 where var1 is null");
changes.setEndPointNow();
@@ -67,7 +68,7 @@ public void should_fail_because_value_is_equal_to() {
assertThat(changes).change().column("var3").valueAtEndPoint().isNotEqualTo((Object) null);
fail("An exception must be raised");
} catch (AssertionError e) {
- Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Value at end point of Column at index 2 (column name : VAR3) of Change at index 0 of Changes on TEST2 table of 'sa/jdbc:h2:mem:test' source] %n"
+ Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Value at end point of Column at index 2 (column name : VAR3) of Change at index 0 of Changes on TEST2 table of 'sa/jdbc:h2:mem:test'] %n"
+ "Expecting:%n"
+ " %n"
+ "not to be equal to: %n"
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnValueInequality_IsNotEqualTo_String_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnValueInequality_IsNotEqualTo_String_Test.java
index c491f36a..948928d2 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnValueInequality_IsNotEqualTo_String_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnValueInequality_IsNotEqualTo_String_Test.java
@@ -29,6 +29,7 @@
* {@link org.assertj.db.api.assertions.AssertOnValueInequality#isNotEqualTo(String)} method.
*
* @author Régis Pouiller
+ * @author Julien Roy
*/
public class AssertOnValueInequality_IsNotEqualTo_String_Test extends AbstractTest {
@@ -38,7 +39,7 @@ public class AssertOnValueInequality_IsNotEqualTo_String_Test extends AbstractTe
@Test
@NeedReload
public void test_is_not_equal_to() {
- Table table = new Table(source, "test");
+ Table table = new Table(jdbcConnectionProvider, "test");
Changes changes = new Changes(table).setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
changes.setEndPointNow();
@@ -58,7 +59,7 @@ public void test_is_not_equal_to() {
@Test
@NeedReload
public void should_fail_because_value_is_equal_to() {
- Table table = new Table(source, "test");
+ Table table = new Table(jdbcConnectionProvider, "test");
Changes changes = new Changes(table).setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
changes.setEndPointNow();
@@ -67,7 +68,7 @@ public void should_fail_because_value_is_equal_to() {
assertThat(changes).change().column("var12").valueAtEndPoint().isNotEqualTo("text");
fail("An exception must be raised");
} catch (AssertionError e) {
- Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Value at end point of Column at index 11 (column name : VAR12) of Change at index 0 (with primary key : [1]) of Changes on TEST table of 'sa/jdbc:h2:mem:test' source] %n"
+ Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Value at end point of Column at index 11 (column name : VAR12) of Change at index 0 (with primary key : [1]) of Changes on TEST table of 'sa/jdbc:h2:mem:test'] %n"
+ "Expecting:%n"
+ " <\"text\">%n"
+ "not to be equal to: %n"
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnValueInequality_IsNotEqualTo_TimeValue_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnValueInequality_IsNotEqualTo_TimeValue_Test.java
index 7fdc6825..11ea8036 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnValueInequality_IsNotEqualTo_TimeValue_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnValueInequality_IsNotEqualTo_TimeValue_Test.java
@@ -30,6 +30,7 @@
* {@link org.assertj.db.api.assertions.AssertOnValueInequality#isNotEqualTo(org.assertj.db.type.TimeValue)} method.
*
* @author Régis Pouiller
+ * @author Julien Roy
*/
public class AssertOnValueInequality_IsNotEqualTo_TimeValue_Test extends AbstractTest {
@@ -39,7 +40,7 @@ public class AssertOnValueInequality_IsNotEqualTo_TimeValue_Test extends Abstrac
@Test
@NeedReload
public void test_is_not_equal_to() {
- Table table = new Table(source, "test");
+ Table table = new Table(jdbcConnectionProvider, "test");
Changes changes = new Changes(table).setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
changes.setEndPointNow();
@@ -59,7 +60,7 @@ public void test_is_not_equal_to() {
@Test
@NeedReload
public void should_fail_because_value_is_equal_to() {
- Table table = new Table(source, "test");
+ Table table = new Table(jdbcConnectionProvider, "test");
Changes changes = new Changes(table).setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
changes.setEndPointNow();
@@ -68,7 +69,7 @@ public void should_fail_because_value_is_equal_to() {
assertThat(changes).change().column("var8").valueAtEndPoint().isNotEqualTo(TimeValue.of(9, 46, 30));
fail("An exception must be raised");
} catch (AssertionError e) {
- Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Value at end point of Column at index 7 (column name : VAR8) of Change at index 0 (with primary key : [1]) of Changes on TEST table of 'sa/jdbc:h2:mem:test' source] %n"
+ Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Value at end point of Column at index 7 (column name : VAR8) of Change at index 0 (with primary key : [1]) of Changes on TEST table of 'sa/jdbc:h2:mem:test'] %n"
+ "Expecting:%n"
+ " <09:46:30.000000000>%n"
+ "not to be equal to: %n"
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnValueInequality_IsNotEqualTo_UUID_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnValueInequality_IsNotEqualTo_UUID_Test.java
index 9774ce14..c53aff5f 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnValueInequality_IsNotEqualTo_UUID_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnValueInequality_IsNotEqualTo_UUID_Test.java
@@ -40,7 +40,7 @@ public class AssertOnValueInequality_IsNotEqualTo_UUID_Test extends AbstractTest
@Test
@NeedReload
public void test_is_not_equal_to() {
- Table table = new Table(source, "test");
+ Table table = new Table(jdbcConnectionProvider, "test");
Changes changes = new Changes(table).setStartPointNow();
update("update test set var15 = 'F96EC595-CE91-47CC-9152-CCC8AC48AAD6' where var1 = 10");
changes.setEndPointNow();
@@ -62,7 +62,7 @@ public void test_is_not_equal_to() {
@Test
@NeedReload
public void should_fail_because_value_is_equal_to() {
- Table table = new Table(source, "test");
+ Table table = new Table(jdbcConnectionProvider, "test");
Changes changes = new Changes(table).setStartPointNow();
update("update test set var15 = 'F96EC595-CE91-47CC-9152-CCC8AC48AAD6' where var1 = 1");
changes.setEndPointNow();
@@ -73,7 +73,7 @@ public void should_fail_because_value_is_equal_to() {
fail("An exception must be raised");
} catch (AssertionError e) {
Assertions.assertThat(e.getMessage()).isEqualTo(String.format(
- "[Value at end point of Column at index 14 (column name : VAR15) of Change at index 0 (with primary key : [1]) of Changes on TEST table of 'sa/jdbc:h2:mem:test' source] %n"
+ "[Value at end point of Column at index 14 (column name : VAR15) of Change at index 0 (with primary key : [1]) of Changes on TEST table of 'sa/jdbc:h2:mem:test'] %n"
+ "Expecting:%n"
+ " %n"
+ "not to be equal to: %n"
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnValueInequality_IsNotZero_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnValueInequality_IsNotZero_Test.java
index 316670d0..262fe947 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnValueInequality_IsNotZero_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnValueInequality_IsNotZero_Test.java
@@ -29,6 +29,7 @@
* {@link org.assertj.db.api.assertions.AssertOnValueInequality#isNotZero()} method.
*
* @author Régis Pouiller
+ * @author Julien Roy
*/
public class AssertOnValueInequality_IsNotZero_Test extends AbstractTest {
@@ -38,7 +39,7 @@ public class AssertOnValueInequality_IsNotZero_Test extends AbstractTest {
@Test
@NeedReload
public void test_is_not_zero() {
- Table table = new Table(source, "test");
+ Table table = new Table(jdbcConnectionProvider, "test");
Changes changes = new Changes(table).setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
changes.setEndPointNow();
@@ -58,7 +59,7 @@ public void test_is_not_zero() {
@Test
@NeedReload
public void should_fail_because_value_is_zero() {
- Table table = new Table(source, "test");
+ Table table = new Table(jdbcConnectionProvider, "test");
Changes changes = new Changes(table).setStartPointNow();
update("update test set var14 = 1 where var1 = 1000");
changes.setEndPointNow();
@@ -67,7 +68,7 @@ public void should_fail_because_value_is_zero() {
assertThat(changes).change().column("var3").valueAtEndPoint().isNotZero();
fail("An exception must be raised");
} catch (AssertionError e) {
- Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Value at end point of Column at index 2 (column name : VAR3) of Change at index 0 (with primary key : [1000]) of Changes on TEST table of 'sa/jdbc:h2:mem:test' source] %n"
+ Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Value at end point of Column at index 2 (column name : VAR3) of Change at index 0 (with primary key : [1000]) of Changes on TEST table of 'sa/jdbc:h2:mem:test'] %n"
+ "Expecting:%n"
+ " <0>%n"
+ "not to be equal to: %n"
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnValueNullity_IsNotNull_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnValueNullity_IsNotNull_Test.java
index 2d878b8f..93067a89 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnValueNullity_IsNotNull_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnValueNullity_IsNotNull_Test.java
@@ -12,9 +12,6 @@
*/
package org.assertj.db.api.assertions;
-import static org.assertj.db.api.Assertions.assertThat;
-import static org.junit.Assert.fail;
-
import org.assertj.core.api.Assertions;
import org.assertj.db.api.ChangeColumnValueAssert;
import org.assertj.db.api.TableColumnValueAssert;
@@ -24,11 +21,15 @@
import org.assertj.db.type.Table;
import org.junit.Test;
+import static org.assertj.db.api.Assertions.assertThat;
+import static org.junit.Assert.fail;
+
/**
* Tests on {@link org.assertj.db.api.assertions.AssertOnValueNullity} class :
* {@link org.assertj.db.api.assertions.AssertOnValueNullity#isNotNull()} method.
*
* @author Régis Pouiller
+ * @author Julien Roy
*/
public class AssertOnValueNullity_IsNotNull_Test extends AbstractTest {
@@ -38,7 +39,7 @@ public class AssertOnValueNullity_IsNotNull_Test extends AbstractTest {
@Test
@NeedReload
public void test_is_not_null() {
- Table table = new Table(source, "test");
+ Table table = new Table(jdbcConnectionProvider, "test");
Changes changes = new Changes(table).setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
changes.setEndPointNow();
@@ -58,7 +59,7 @@ public void test_is_not_null() {
@Test
@NeedReload
public void should_fail_because_value_is_null() {
- Table table = new Table(source, "test2");
+ Table table = new Table(jdbcConnectionProvider, "test2");
Changes changes = new Changes(table).setStartPointNow();
update("update test2 set var14 = 1 where var1 is null");
changes.setEndPointNow();
@@ -67,7 +68,7 @@ public void should_fail_because_value_is_null() {
assertThat(changes).change().column("var3").valueAtEndPoint().isNotNull();
fail("An exception must be raised");
} catch (AssertionError e) {
- Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Value at end point of Column at index 2 (column name : VAR3) of Change at index 0 of Changes on TEST2 table of 'sa/jdbc:h2:mem:test' source] %n"
+ Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Value at end point of Column at index 2 (column name : VAR3) of Change at index 0 of Changes on TEST2 table of 'sa/jdbc:h2:mem:test'] %n"
+ "Expecting actual not to be null"));
}
try {
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnValueNullity_IsNull_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnValueNullity_IsNull_Test.java
index b786ed8c..bb58a844 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnValueNullity_IsNull_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnValueNullity_IsNull_Test.java
@@ -29,6 +29,7 @@
* {@link org.assertj.db.api.assertions.AssertOnValueNullity#isNull()} method.
*
* @author Régis Pouiller
+ * @author Julien Roy
*/
public class AssertOnValueNullity_IsNull_Test extends AbstractTest {
@@ -38,7 +39,7 @@ public class AssertOnValueNullity_IsNull_Test extends AbstractTest {
@Test
@NeedReload
public void test_is_null() {
- Table table = new Table(source, "test2");
+ Table table = new Table(jdbcConnectionProvider, "test2");
Changes changes = new Changes(table).setStartPointNow();
update("update test2 set var14 = 1 where var1 is null");
changes.setEndPointNow();
@@ -58,7 +59,7 @@ public void test_is_null() {
@Test
@NeedReload
public void should_fail_because_value_is_not_null() {
- Table table = new Table(source, "test");
+ Table table = new Table(jdbcConnectionProvider, "test");
Changes changes = new Changes(table).setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
changes.setEndPointNow();
@@ -67,7 +68,7 @@ public void should_fail_because_value_is_not_null() {
assertThat(changes).change().column("var3").valueAtEndPoint().isNull();
fail("An exception must be raised");
} catch (AssertionError e) {
- Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Value at end point of Column at index 2 (column name : VAR3) of Change at index 0 (with primary key : [1]) of Changes on TEST table of 'sa/jdbc:h2:mem:test' source] expected: but was:<2>"));
+ Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Value at end point of Column at index 2 (column name : VAR3) of Change at index 0 (with primary key : [1]) of Changes on TEST table of 'sa/jdbc:h2:mem:test'] expected: but was:<2>"));
}
try {
assertThat(table).column("var3").value().isNull();
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnValueType_IsBoolean_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnValueType_IsBoolean_Test.java
index 4d583307..739dc3f3 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnValueType_IsBoolean_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnValueType_IsBoolean_Test.java
@@ -29,6 +29,7 @@
* {@link org.assertj.db.api.assertions.AssertOnValueType#isBoolean()} method.
*
* @author Régis Pouiller
+ * @author Julien Roy
*/
public class AssertOnValueType_IsBoolean_Test extends AbstractTest {
@@ -38,7 +39,7 @@ public class AssertOnValueType_IsBoolean_Test extends AbstractTest {
@Test
@NeedReload
public void test_is_boolean() {
- Table table = new Table(source, "test");
+ Table table = new Table(jdbcConnectionProvider, "test");
Changes changes = new Changes(table).setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
changes.setEndPointNow();
@@ -58,7 +59,7 @@ public void test_is_boolean() {
@Test
@NeedReload
public void should_fail_because_value_is_not_a_boolean() {
- Table table = new Table(source, "test");
+ Table table = new Table(jdbcConnectionProvider, "test");
Changes changes = new Changes(table).setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
changes.setEndPointNow();
@@ -67,7 +68,7 @@ public void should_fail_because_value_is_not_a_boolean() {
assertThat(changes).change().column("var1").valueAtEndPoint().isBoolean();
fail("An exception must be raised");
} catch (AssertionError e) {
- Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Value at end point of Column at index 0 (column name : VAR1) of Change at index 0 (with primary key : [1]) of Changes on TEST table of 'sa/jdbc:h2:mem:test' source] %n"
+ Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Value at end point of Column at index 0 (column name : VAR1) of Change at index 0 (with primary key : [1]) of Changes on TEST table of 'sa/jdbc:h2:mem:test'] %n"
+ "Expecting:%n"
+ " <1>%n"
+ "to be of type%n"
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnValueType_IsBytes_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnValueType_IsBytes_Test.java
index f1551b72..01142997 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnValueType_IsBytes_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnValueType_IsBytes_Test.java
@@ -29,6 +29,7 @@
* {@link org.assertj.db.api.assertions.AssertOnValueType#isBytes()} method.
*
* @author Régis Pouiller
+ * @author Julien Roy
*/
public class AssertOnValueType_IsBytes_Test extends AbstractTest {
@@ -38,7 +39,7 @@ public class AssertOnValueType_IsBytes_Test extends AbstractTest {
@Test
@NeedReload
public void test_is_bytes() {
- Table table = new Table(source, "test");
+ Table table = new Table(jdbcConnectionProvider, "test");
Changes changes = new Changes(table).setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
changes.setEndPointNow();
@@ -58,7 +59,7 @@ public void test_is_bytes() {
@Test
@NeedReload
public void should_fail_because_value_is_not_bytes() {
- Table table = new Table(source, "test");
+ Table table = new Table(jdbcConnectionProvider, "test");
Changes changes = new Changes(table).setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
changes.setEndPointNow();
@@ -67,7 +68,7 @@ public void should_fail_because_value_is_not_bytes() {
assertThat(changes).change().column("var1").valueAtEndPoint().isBytes();
fail("An exception must be raised");
} catch (AssertionError e) {
- Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Value at end point of Column at index 0 (column name : VAR1) of Change at index 0 (with primary key : [1]) of Changes on TEST table of 'sa/jdbc:h2:mem:test' source] %n"
+ Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Value at end point of Column at index 0 (column name : VAR1) of Change at index 0 (with primary key : [1]) of Changes on TEST table of 'sa/jdbc:h2:mem:test'] %n"
+ "Expecting:%n"
+ " <1>%n"
+ "to be of type%n"
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnValueType_IsDateTime_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnValueType_IsDateTime_Test.java
index f9ddc273..43cca907 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnValueType_IsDateTime_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnValueType_IsDateTime_Test.java
@@ -29,6 +29,7 @@
* {@link org.assertj.db.api.assertions.AssertOnValueType#isDateTime()} method.
*
* @author Régis Pouiller
+ * @author Julien Roy
*/
public class AssertOnValueType_IsDateTime_Test extends AbstractTest {
@@ -38,7 +39,7 @@ public class AssertOnValueType_IsDateTime_Test extends AbstractTest {
@Test
@NeedReload
public void test_is_date_time() {
- Table table = new Table(source, "test");
+ Table table = new Table(jdbcConnectionProvider, "test");
Changes changes = new Changes(table).setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
changes.setEndPointNow();
@@ -58,7 +59,7 @@ public void test_is_date_time() {
@Test
@NeedReload
public void should_fail_because_value_is_not_a_date_time() {
- Table table = new Table(source, "test");
+ Table table = new Table(jdbcConnectionProvider, "test");
Changes changes = new Changes(table).setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
changes.setEndPointNow();
@@ -67,7 +68,7 @@ public void should_fail_because_value_is_not_a_date_time() {
assertThat(changes).change().column("var1").valueAtEndPoint().isDateTime();
fail("An exception must be raised");
} catch (AssertionError e) {
- Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Value at end point of Column at index 0 (column name : VAR1) of Change at index 0 (with primary key : [1]) of Changes on TEST table of 'sa/jdbc:h2:mem:test' source] %n"
+ Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Value at end point of Column at index 0 (column name : VAR1) of Change at index 0 (with primary key : [1]) of Changes on TEST table of 'sa/jdbc:h2:mem:test'] %n"
+ "Expecting:%n"
+ " <1>%n"
+ "to be of type%n"
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnValueType_IsDate_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnValueType_IsDate_Test.java
index 84296047..af5400a6 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnValueType_IsDate_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnValueType_IsDate_Test.java
@@ -29,6 +29,7 @@
* {@link org.assertj.db.api.assertions.AssertOnValueType#isDate()} method.
*
* @author Régis Pouiller
+ * @author Julien Roy
*/
public class AssertOnValueType_IsDate_Test extends AbstractTest {
@@ -38,7 +39,7 @@ public class AssertOnValueType_IsDate_Test extends AbstractTest {
@Test
@NeedReload
public void test_is_date() {
- Table table = new Table(source, "test");
+ Table table = new Table(jdbcConnectionProvider, "test");
Changes changes = new Changes(table).setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
changes.setEndPointNow();
@@ -58,7 +59,7 @@ public void test_is_date() {
@Test
@NeedReload
public void should_fail_because_value_is_not_a_date() {
- Table table = new Table(source, "test");
+ Table table = new Table(jdbcConnectionProvider, "test");
Changes changes = new Changes(table).setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
changes.setEndPointNow();
@@ -67,7 +68,7 @@ public void should_fail_because_value_is_not_a_date() {
assertThat(changes).change().column("var1").valueAtEndPoint().isDate();
fail("An exception must be raised");
} catch (AssertionError e) {
- Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Value at end point of Column at index 0 (column name : VAR1) of Change at index 0 (with primary key : [1]) of Changes on TEST table of 'sa/jdbc:h2:mem:test' source] %n"
+ Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Value at end point of Column at index 0 (column name : VAR1) of Change at index 0 (with primary key : [1]) of Changes on TEST table of 'sa/jdbc:h2:mem:test'] %n"
+ "Expecting:%n"
+ " <1>%n"
+ "to be of type%n"
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnValueType_IsNumber_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnValueType_IsNumber_Test.java
index 7f8789d9..a0acdb49 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnValueType_IsNumber_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnValueType_IsNumber_Test.java
@@ -29,6 +29,7 @@
* {@link org.assertj.db.api.assertions.AssertOnValueType#isNumber()} method.
*
* @author Régis Pouiller
+ * @author Julien Roy
*/
public class AssertOnValueType_IsNumber_Test extends AbstractTest {
@@ -38,7 +39,7 @@ public class AssertOnValueType_IsNumber_Test extends AbstractTest {
@Test
@NeedReload
public void test_is_number() {
- Table table = new Table(source, "test");
+ Table table = new Table(jdbcConnectionProvider, "test");
Changes changes = new Changes(table).setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
changes.setEndPointNow();
@@ -58,7 +59,7 @@ public void test_is_number() {
@Test
@NeedReload
public void should_fail_because_value_is_not_a_number() {
- Table table = new Table(source, "test");
+ Table table = new Table(jdbcConnectionProvider, "test");
Changes changes = new Changes(table).setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
changes.setEndPointNow();
@@ -67,7 +68,7 @@ public void should_fail_because_value_is_not_a_number() {
assertThat(changes).change().column("var2").valueAtEndPoint().isNumber();
fail("An exception must be raised");
} catch (AssertionError e) {
- Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Value at end point of Column at index 1 (column name : VAR2) of Change at index 0 (with primary key : [1]) of Changes on TEST table of 'sa/jdbc:h2:mem:test' source] %n"
+ Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Value at end point of Column at index 1 (column name : VAR2) of Change at index 0 (with primary key : [1]) of Changes on TEST table of 'sa/jdbc:h2:mem:test'] %n"
+ "Expecting:%n"
+ " %n"
+ "to be of type%n"
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnValueType_IsOfAnyTypeIn_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnValueType_IsOfAnyTypeIn_Test.java
index 1f67c697..7149a422 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnValueType_IsOfAnyTypeIn_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnValueType_IsOfAnyTypeIn_Test.java
@@ -12,9 +12,6 @@
*/
package org.assertj.db.api.assertions;
-import static org.assertj.db.api.Assertions.assertThat;
-import static org.junit.Assert.fail;
-
import org.assertj.core.api.Assertions;
import org.assertj.db.api.ChangeColumnValueAssert;
import org.assertj.db.api.TableColumnValueAssert;
@@ -25,11 +22,15 @@
import org.assertj.db.type.ValueType;
import org.junit.Test;
+import static org.assertj.db.api.Assertions.assertThat;
+import static org.junit.Assert.fail;
+
/**
* Tests on {@link org.assertj.db.api.assertions.AssertOnValueType} class :
* {@link org.assertj.db.api.assertions.AssertOnValueType#isOfAnyTypeIn(org.assertj.db.type.ValueType...)} method.
*
* @author Régis Pouiller
+ * @author Julien Roy
*/
public class AssertOnValueType_IsOfAnyTypeIn_Test extends AbstractTest {
@@ -39,7 +40,7 @@ public class AssertOnValueType_IsOfAnyTypeIn_Test extends AbstractTest {
@Test
@NeedReload
public void test_is_of_any_of_types() {
- Table table = new Table(source, "test");
+ Table table = new Table(jdbcConnectionProvider, "test");
Changes changes = new Changes(table).setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
changes.setEndPointNow();
@@ -59,7 +60,7 @@ public void test_is_of_any_of_types() {
@Test
@NeedReload
public void should_fail_because_value_is_not_of_any_of_types() {
- Table table = new Table(source, "test");
+ Table table = new Table(jdbcConnectionProvider, "test");
Changes changes = new Changes(table).setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
changes.setEndPointNow();
@@ -68,7 +69,7 @@ public void should_fail_because_value_is_not_of_any_of_types() {
assertThat(changes).change().column("var1").valueAtEndPoint().isOfAnyTypeIn(ValueType.BOOLEAN);
fail("An exception must be raised");
} catch (AssertionError e) {
- Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Value at end point of Column at index 0 (column name : VAR1) of Change at index 0 (with primary key : [1]) of Changes on TEST table of 'sa/jdbc:h2:mem:test' source] %n"
+ Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Value at end point of Column at index 0 (column name : VAR1) of Change at index 0 (with primary key : [1]) of Changes on TEST table of 'sa/jdbc:h2:mem:test'] %n"
+ "Expecting:%n"
+ " <1>%n"
+ "to be of type%n"
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnValueType_IsOfType_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnValueType_IsOfType_Test.java
index d59e7677..96e468e3 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnValueType_IsOfType_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnValueType_IsOfType_Test.java
@@ -30,6 +30,7 @@
* {@link org.assertj.db.api.assertions.AssertOnValueType#isOfType(org.assertj.db.type.ValueType)} method.
*
* @author Régis Pouiller
+ * @author Julien Roy
*/
public class AssertOnValueType_IsOfType_Test extends AbstractTest {
@@ -39,7 +40,7 @@ public class AssertOnValueType_IsOfType_Test extends AbstractTest {
@Test
@NeedReload
public void test_is_of_type() {
- Table table = new Table(source, "test");
+ Table table = new Table(jdbcConnectionProvider, "test");
Changes changes = new Changes(table).setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
changes.setEndPointNow();
@@ -59,7 +60,7 @@ public void test_is_of_type() {
@Test
@NeedReload
public void should_fail_because_value_is_not_of_type() {
- Table table = new Table(source, "test");
+ Table table = new Table(jdbcConnectionProvider, "test");
Changes changes = new Changes(table).setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
changes.setEndPointNow();
@@ -68,7 +69,7 @@ public void should_fail_because_value_is_not_of_type() {
assertThat(changes).change().column("var1").valueAtEndPoint().isOfType(ValueType.BOOLEAN);
fail("An exception must be raised");
} catch (AssertionError e) {
- Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Value at end point of Column at index 0 (column name : VAR1) of Change at index 0 (with primary key : [1]) of Changes on TEST table of 'sa/jdbc:h2:mem:test' source] %n"
+ Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Value at end point of Column at index 0 (column name : VAR1) of Change at index 0 (with primary key : [1]) of Changes on TEST table of 'sa/jdbc:h2:mem:test'] %n"
+ "Expecting:%n"
+ " <1>%n"
+ "to be of type%n"
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnValueType_IsText_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnValueType_IsText_Test.java
index bd67720a..1eb9a74e 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnValueType_IsText_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnValueType_IsText_Test.java
@@ -29,6 +29,7 @@
* {@link org.assertj.db.api.assertions.AssertOnValueType#isText()} method.
*
* @author Régis Pouiller
+ * @author Julien Roy
*/
public class AssertOnValueType_IsText_Test extends AbstractTest {
@@ -38,7 +39,7 @@ public class AssertOnValueType_IsText_Test extends AbstractTest {
@Test
@NeedReload
public void test_is_text() {
- Table table = new Table(source, "test");
+ Table table = new Table(jdbcConnectionProvider, "test");
Changes changes = new Changes(table).setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
changes.setEndPointNow();
@@ -58,7 +59,7 @@ public void test_is_text() {
@Test
@NeedReload
public void should_fail_because_value_is_not_a_text() {
- Table table = new Table(source, "test");
+ Table table = new Table(jdbcConnectionProvider, "test");
Changes changes = new Changes(table).setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
changes.setEndPointNow();
@@ -67,7 +68,7 @@ public void should_fail_because_value_is_not_a_text() {
assertThat(changes).change().column("var1").valueAtEndPoint().isText();
fail("An exception must be raised");
} catch (AssertionError e) {
- Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Value at end point of Column at index 0 (column name : VAR1) of Change at index 0 (with primary key : [1]) of Changes on TEST table of 'sa/jdbc:h2:mem:test' source] %n"
+ Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Value at end point of Column at index 0 (column name : VAR1) of Change at index 0 (with primary key : [1]) of Changes on TEST table of 'sa/jdbc:h2:mem:test'] %n"
+ "Expecting:%n"
+ " <1>%n"
+ "to be of type%n"
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnValueType_IsTime_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnValueType_IsTime_Test.java
index f2f09360..3b4a9d6f 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnValueType_IsTime_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnValueType_IsTime_Test.java
@@ -29,6 +29,7 @@
* {@link org.assertj.db.api.assertions.AssertOnValueType#isTime()} method.
*
* @author Régis Pouiller
+ * @author Julien Roy
*/
public class AssertOnValueType_IsTime_Test extends AbstractTest {
@@ -38,7 +39,7 @@ public class AssertOnValueType_IsTime_Test extends AbstractTest {
@Test
@NeedReload
public void test_is_time() {
- Table table = new Table(source, "test");
+ Table table = new Table(jdbcConnectionProvider, "test");
Changes changes = new Changes(table).setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
changes.setEndPointNow();
@@ -58,7 +59,7 @@ public void test_is_time() {
@Test
@NeedReload
public void should_fail_because_value_is_not_a_time() {
- Table table = new Table(source, "test");
+ Table table = new Table(jdbcConnectionProvider, "test");
Changes changes = new Changes(table).setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
changes.setEndPointNow();
@@ -67,7 +68,7 @@ public void should_fail_because_value_is_not_a_time() {
assertThat(changes).change().column("var1").valueAtEndPoint().isTime();
fail("An exception must be raised");
} catch (AssertionError e) {
- Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Value at end point of Column at index 0 (column name : VAR1) of Change at index 0 (with primary key : [1]) of Changes on TEST table of 'sa/jdbc:h2:mem:test' source] %n"
+ Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Value at end point of Column at index 0 (column name : VAR1) of Change at index 0 (with primary key : [1]) of Changes on TEST table of 'sa/jdbc:h2:mem:test'] %n"
+ "Expecting:%n"
+ " <1>%n"
+ "to be of type%n"
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnValueType_IsUUID_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnValueType_IsUUID_Test.java
index 7ccc1627..657b567d 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnValueType_IsUUID_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnValueType_IsUUID_Test.java
@@ -38,7 +38,7 @@ public class AssertOnValueType_IsUUID_Test extends AbstractTest {
@Test
@NeedReload
public void test_is_UUID() {
- Table table = new Table(source, "test");
+ Table table = new Table(jdbcConnectionProvider, "test");
Changes changes = new Changes(table).setStartPointNow();
update("update test set var15 = 'F96EC595-CE91-47CC-9152-CCC8AC48AAD6' where var1 = 1");
changes.setEndPointNow();
@@ -58,7 +58,7 @@ public void test_is_UUID() {
@Test
@NeedReload
public void should_fail_because_value_is_not_a_UUID() {
- Table table = new Table(source, "test");
+ Table table = new Table(jdbcConnectionProvider, "test");
Changes changes = new Changes(table).setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
changes.setEndPointNow();
@@ -68,7 +68,7 @@ public void should_fail_because_value_is_not_a_UUID() {
fail("An exception must be raised");
} catch (AssertionError e) {
Assertions.assertThat(e.getMessage()).isEqualTo(String.format(
- "[Value at end point of Column at index 0 (column name : VAR1) of Change at index 0 (with primary key : [1]) of Changes on TEST table of 'sa/jdbc:h2:mem:test' source] %n"
+ "[Value at end point of Column at index 0 (column name : VAR1) of Change at index 0 (with primary key : [1]) of Changes on TEST table of 'sa/jdbc:h2:mem:test'] %n"
+ "Expecting:%n"
+ " <1>%n"
+ "to be of type%n"
diff --git a/src/test/java/org/assertj/db/api/assertions/BDDAssertions_Test.java b/src/test/java/org/assertj/db/api/assertions/BDDAssertions_Test.java
index 1f5cb668..1cab257a 100644
--- a/src/test/java/org/assertj/db/api/assertions/BDDAssertions_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/BDDAssertions_Test.java
@@ -28,6 +28,7 @@
* Test on {@code BDDAssertions} methods.
*
* @author Régis Pouiller
+ * @author Julien Roy
*/
public class BDDAssertions_Test extends AbstractTest {
@@ -36,7 +37,7 @@ public class BDDAssertions_Test extends AbstractTest {
*/
@Test
public void test_then_for_table() throws Exception {
- Table table = new Table(source, "test");
+ Table table = new Table(jdbcConnectionProvider, "test");
Assertions.assertThat(then(table)).isInstanceOf(TableAssert.class);
}
@@ -45,7 +46,7 @@ public void test_then_for_table() throws Exception {
*/
@Test
public void test_then_for_request() throws Exception {
- Request request = new Request(source, "select * from test");
+ Request request = new Request(jdbcConnectionProvider, "select * from test");
Assertions.assertThat(then(request)).isInstanceOf(RequestAssert.class);
}
@@ -54,7 +55,7 @@ public void test_then_for_request() throws Exception {
*/
@Test
public void test_then_for_changes() throws Exception {
- Changes changes = new Changes(source);
+ Changes changes = new Changes(jdbcConnectionProvider);
Assertions.assertThat(then(changes)).isInstanceOf(ChangesAssert.class);
}
}
diff --git a/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnColumnOfChangeEquality_HasValues_One_TimeValue_Test.java b/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnColumnOfChangeEquality_HasValues_One_TimeValue_Test.java
index 23f5f2f7..0cefbf3a 100644
--- a/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnColumnOfChangeEquality_HasValues_One_TimeValue_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnColumnOfChangeEquality_HasValues_One_TimeValue_Test.java
@@ -12,6 +12,11 @@
*/
package org.assertj.db.api.assertions.impl;
+import static org.assertj.db.api.Assertions.assertThat;
+import static org.junit.Assert.fail;
+
+import java.sql.Time;
+
import org.assertj.core.api.Assertions;
import org.assertj.core.api.WritableAssertionInfo;
import org.assertj.db.api.TableAssert;
@@ -20,11 +25,6 @@
import org.assertj.db.type.TimeValue;
import org.junit.Test;
-import java.sql.Time;
-
-import static org.assertj.db.api.Assertions.assertThat;
-import static org.junit.Assert.fail;
-
/**
* Tests on {@link org.assertj.db.api.assertions.impl.AssertionsOnColumnOfChangeEquality} class :
* {@link org.assertj.db.api.assertions.impl.AssertionsOnColumnOfChangeEquality#hasValues(org.assertj.db.api.AbstractAssert, org.assertj.core.api.WritableAssertionInfo, org.assertj.db.type.Value, org.assertj.db.type.Value, TimeValue)} method.
diff --git a/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnColumnOfChangeType_IsBoolean_Test.java b/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnColumnOfChangeType_IsBoolean_Test.java
index ff1291f1..202f5a6b 100644
--- a/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnColumnOfChangeType_IsBoolean_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnColumnOfChangeType_IsBoolean_Test.java
@@ -12,6 +12,9 @@
*/
package org.assertj.db.api.assertions.impl;
+import static org.assertj.db.api.Assertions.assertThat;
+import static org.junit.Assert.fail;
+
import org.assertj.core.api.Assertions;
import org.assertj.core.api.WritableAssertionInfo;
import org.assertj.db.api.TableAssert;
@@ -19,9 +22,6 @@
import org.assertj.db.type.Table;
import org.junit.Test;
-import static org.assertj.db.api.Assertions.assertThat;
-import static org.junit.Assert.fail;
-
/**
* Tests on {@link AssertionsOnColumnOfChangeType} class :
* {@link AssertionsOnColumnOfChangeType#isBoolean(org.assertj.db.api.AbstractAssert, org.assertj.core.api.WritableAssertionInfo, org.assertj.db.type.Value, org.assertj.db.type.Value, boolean)} method.
diff --git a/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnColumnOfChangeType_IsNumber_Test.java b/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnColumnOfChangeType_IsNumber_Test.java
index 6a315543..2b0ead39 100644
--- a/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnColumnOfChangeType_IsNumber_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnColumnOfChangeType_IsNumber_Test.java
@@ -12,6 +12,9 @@
*/
package org.assertj.db.api.assertions.impl;
+import static org.assertj.db.api.Assertions.assertThat;
+import static org.junit.Assert.fail;
+
import org.assertj.core.api.Assertions;
import org.assertj.core.api.WritableAssertionInfo;
import org.assertj.db.api.TableAssert;
@@ -19,9 +22,6 @@
import org.assertj.db.type.Table;
import org.junit.Test;
-import static org.assertj.db.api.Assertions.assertThat;
-import static org.junit.Assert.fail;
-
/**
* Tests on {@link org.assertj.db.api.assertions.impl.AssertionsOnColumnOfChangeType} class :
* {@link org.assertj.db.api.assertions.impl.AssertionsOnColumnOfChangeType#isNumber(org.assertj.db.api.AbstractAssert, org.assertj.core.api.WritableAssertionInfo, org.assertj.db.type.Value, org.assertj.db.type.Value, boolean)} method.
diff --git a/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnColumnOfChangeType_IsOfType_Test.java b/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnColumnOfChangeType_IsOfType_Test.java
index 08f60803..3d33b807 100644
--- a/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnColumnOfChangeType_IsOfType_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnColumnOfChangeType_IsOfType_Test.java
@@ -12,6 +12,11 @@
*/
package org.assertj.db.api.assertions.impl;
+import static org.assertj.db.api.Assertions.assertThat;
+import static org.junit.Assert.fail;
+
+import java.util.Locale;
+
import org.assertj.core.api.Assertions;
import org.assertj.core.api.WritableAssertionInfo;
import org.assertj.db.api.TableAssert;
@@ -20,11 +25,6 @@
import org.assertj.db.type.ValueType;
import org.junit.Test;
-import java.util.Locale;
-
-import static org.assertj.db.api.Assertions.assertThat;
-import static org.junit.Assert.fail;
-
/**
* Tests on {@link AssertionsOnColumnOfChangeType} class :
* {@link AssertionsOnColumnOfChangeType#isOfType(org.assertj.db.api.AbstractAssert, org.assertj.core.api.WritableAssertionInfo, org.assertj.db.type.Value, org.assertj.db.type.Value, org.assertj.db.type.ValueType, boolean)} method.
diff --git a/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnRowOfChangeExistence_Exists_Test.java b/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnRowOfChangeExistence_Exists_Test.java
index 10404e16..07fdc600 100644
--- a/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnRowOfChangeExistence_Exists_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnRowOfChangeExistence_Exists_Test.java
@@ -12,6 +12,12 @@
*/
package org.assertj.db.api.assertions.impl;
+import static org.assertj.db.api.Assertions.assertThat;
+import static org.junit.Assert.fail;
+
+import java.sql.Date;
+import java.util.Arrays;
+
import org.assertj.core.api.Assertions;
import org.assertj.core.api.WritableAssertionInfo;
import org.assertj.db.api.TableAssert;
@@ -20,12 +26,6 @@
import org.assertj.db.type.Table;
import org.junit.Test;
-import java.sql.Date;
-import java.util.Arrays;
-
-import static org.assertj.db.api.Assertions.assertThat;
-import static org.junit.Assert.fail;
-
/**
* Tests on {@link AssertionsOnRowOfChangeExistence} class :
* {@link AssertionsOnRowOfChangeExistence#exists(org.assertj.db.api.AbstractAssert, org.assertj.core.api.WritableAssertionInfo, org.assertj.db.type.Row)} method.
diff --git a/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnTableExistence_DoesNotExist_Test.java b/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnTableExistence_DoesNotExist_Test.java
index f75c6b3c..3c18f841 100644
--- a/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnTableExistence_DoesNotExist_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnTableExistence_DoesNotExist_Test.java
@@ -12,23 +12,23 @@
*/
package org.assertj.db.api.assertions.impl;
+import static org.assertj.db.api.Assertions.assertThat;
+import static org.junit.Assert.fail;
+
+import javax.sql.DataSource;
+
import org.assertj.core.api.Assertions;
import org.assertj.core.api.WritableAssertionInfo;
import org.assertj.db.api.AbstractDbAssert;
import org.assertj.db.api.TableAssert;
import org.assertj.db.common.AbstractTest;
-import org.assertj.db.type.Source;
+import org.assertj.db.type.JdbcUrlConnectionProvider;
import org.assertj.db.type.Table;
import org.junit.Test;
-import javax.sql.DataSource;
-
-import static org.assertj.db.api.Assertions.assertThat;
-import static org.junit.Assert.fail;
-
/**
* Tests on {@link AssertionsOnTableExistence} class :
- * {@link AssertionsOnTableExistence#doesNotExists(AbstractDbAssert, WritableAssertionInfo, String, Source, DataSource)} method.
+ * {@link AssertionsOnTableExistence#doesNotExists(AbstractDbAssert, WritableAssertionInfo, String, JdbcUrlConnectionProvider, DataSource)} method.
*
* @author Julien Roy
*/
@@ -42,9 +42,9 @@ public void test_does_not_exists() {
WritableAssertionInfo info = new WritableAssertionInfo();
Table table = new Table();
TableAssert tableAssert = assertThat(table);
- TableAssert tableAssert2 = AssertionsOnTableExistence.doesNotExists(tableAssert, info, "not-exist-test", source, null);
+ TableAssert tableAssert2 = AssertionsOnTableExistence.doesNotExists(tableAssert, info, "not-exist-test", jdbcConnectionProvider);
Assertions.assertThat(tableAssert2).isSameAs(tableAssert);
- TableAssert tableAssert3 = AssertionsOnTableExistence.doesNotExists(tableAssert, info, "not-exist-test", null, dataSource);
+ TableAssert tableAssert3 = AssertionsOnTableExistence.doesNotExists(tableAssert, info, "not-exist-test", dsConnectionProvider);
Assertions.assertThat(tableAssert3).isSameAs(tableAssert);
}
@@ -58,7 +58,7 @@ public void should_fail_because_table_exists() {
Table table = new Table();
TableAssert tableAssert = assertThat(table);
try {
- AssertionsOnTableExistence.doesNotExists(tableAssert, info, "TEST", source, null);
+ AssertionsOnTableExistence.doesNotExists(tableAssert, info, "TEST", jdbcConnectionProvider);
fail("An exception must be raised");
} catch (AssertionError e) {
Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[description] %n"
@@ -66,7 +66,7 @@ public void should_fail_because_table_exists() {
}
try {
- AssertionsOnTableExistence.doesNotExists(tableAssert, info, "TEST", null, dataSource);
+ AssertionsOnTableExistence.doesNotExists(tableAssert, info, "TEST", dsConnectionProvider);
fail("An exception must be raised");
} catch (AssertionError e) {
Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[description] %n"
diff --git a/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnTableExistence_Exists_Test.java b/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnTableExistence_Exists_Test.java
index 8f77159f..1bb0e369 100644
--- a/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnTableExistence_Exists_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnTableExistence_Exists_Test.java
@@ -22,13 +22,13 @@
import org.assertj.db.api.AbstractDbAssert;
import org.assertj.db.api.TableAssert;
import org.assertj.db.common.AbstractTest;
-import org.assertj.db.type.Source;
+import org.assertj.db.type.JdbcUrlConnectionProvider;
import org.assertj.db.type.Table;
import org.junit.Test;
/**
* Tests on {@link AssertionsOnTableExistence} class :
- * {@link AssertionsOnTableExistence#exists(AbstractDbAssert, WritableAssertionInfo, String, Source, DataSource)} method.
+ * {@link AssertionsOnTableExistence#exists(AbstractDbAssert, WritableAssertionInfo, String, JdbcUrlConnectionProvider, DataSource)} method.
*
* @author Julien Roy
*/
@@ -42,9 +42,9 @@ public void test_exists() {
WritableAssertionInfo info = new WritableAssertionInfo();
Table table = new Table();
TableAssert tableAssert = assertThat(table);
- TableAssert tableAssert2 = AssertionsOnTableExistence.exists(tableAssert, info, "TEST", source, null);
+ TableAssert tableAssert2 = AssertionsOnTableExistence.exists(tableAssert, info, "TEST", jdbcConnectionProvider);
Assertions.assertThat(tableAssert2).isSameAs(tableAssert);
- TableAssert tableAssert3 = AssertionsOnTableExistence.exists(tableAssert, info, "TEST", null, dataSource);
+ TableAssert tableAssert3 = AssertionsOnTableExistence.exists(tableAssert, info, "TEST", dsConnectionProvider);
Assertions.assertThat(tableAssert3).isSameAs(tableAssert);
}
@@ -58,7 +58,7 @@ public void should_fail_because_table_does_not_exist() {
Table table = new Table();
TableAssert tableAssert = assertThat(table);
try {
- AssertionsOnTableExistence.exists(tableAssert, info, "not-exist-test", source, null);
+ AssertionsOnTableExistence.exists(tableAssert, info, "not-exist-test", jdbcConnectionProvider);
fail("An exception must be raised");
} catch (AssertionError e) {
Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[description] %n"
@@ -66,7 +66,7 @@ public void should_fail_because_table_does_not_exist() {
}
try {
- AssertionsOnTableExistence.exists(tableAssert, info, "not-exist-test", null, dataSource);
+ AssertionsOnTableExistence.exists(tableAssert, info, "not-exist-test", dsConnectionProvider);
fail("An exception must be raised");
} catch (AssertionError e) {
Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[description] %n"
diff --git a/src/test/java/org/assertj/db/common/AbstractTest.java b/src/test/java/org/assertj/db/common/AbstractTest.java
index a28ceb67..3290ca42 100644
--- a/src/test/java/org/assertj/db/common/AbstractTest.java
+++ b/src/test/java/org/assertj/db/common/AbstractTest.java
@@ -37,10 +37,11 @@
import org.assertj.db.type.ChangeType;
import org.assertj.db.type.Changes;
import org.assertj.db.type.Column;
+import org.assertj.db.type.ConnectionProvider;
+import org.assertj.db.type.ConnectionProviderFactory;
import org.assertj.db.type.DataType;
import org.assertj.db.type.Request;
import org.assertj.db.type.Row;
-import org.assertj.db.type.Source;
import org.assertj.db.type.Table;
import org.assertj.db.type.Value;
import org.assertj.db.type.lettercase.LetterCase;
@@ -60,9 +61,10 @@
import com.ninja_squad.dbsetup.operation.Operation;
/**
- * Parent for all the tests. It contains the variables like a {@code DataSource} and a {@code Source}.
+ * Parent for all the tests. It contains the variables like a {@code DataSource} and a {@code ConnectionProvider}.
*
* @author Régis Pouiller
+ * @author Julien Roy
*/
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(classes = {TestsConfiguration.class})
@@ -129,11 +131,44 @@ public abstract class AbstractTest {
private static final DbSetup DB_SETUP = new DbSetup(new DriverManagerDestination("jdbc:h2:mem:test", "SA", ""),
OPERATIONS);
private static final DbSetupTracker DB_SETUP_TRACKER = new DbSetupTracker();
- protected final Source source = new Source("jdbc:h2:mem:test", "sa", "");
+ protected final ConnectionProvider jdbcConnectionProvider = ConnectionProviderFactory.of("jdbc:h2:mem:test", "sa", "").create();
@Rule
public TestName testNameRule = new TestName();
@Autowired
protected DataSource dataSource;
+ protected ConnectionProvider dsConnectionProvider;
+
+ /**
+ * Returns an instance of a {@code Value}.
+ *
+ * @param columnName The name of the column.
+ * @param object The object in the value.
+ * @return An instance.
+ * @throws Exception Exception
+ */
+ protected static Value getValue(String columnName, Object object) throws Exception {
+ Constructor constructor = Value.class.getDeclaredConstructor(String.class, Object.class, LetterCase.class);
+ constructor.setAccessible(true);
+ Value value = constructor.newInstance(columnName, object, LetterCase.COLUMN_DEFAULT);
+ return value;
+ }
+
+ /**
+ * Returns an instance of a {@code Changes}.
+ *
+ * @param changesList The list of changes.
+ * @return An instance.
+ * @throws Exception Exception
+ */
+ protected static Changes getChanges(List changesList) throws Exception {
+ Constructor constructor = Changes.class.getDeclaredConstructor(ConnectionProvider.class);
+ constructor.setAccessible(true);
+ Changes changes = constructor.newInstance((ConnectionProvider) null);
+ Field field = Changes.class.getDeclaredField("changesList");
+ field.setAccessible(true);
+ field.set(changes, changesList);
+ return changes;
+ }
/**
* Returns an instance of a {@code Column}.
@@ -225,38 +260,6 @@ protected static Request getRequest(List columnsNameList, List p
return request;
}
- /**
- * Returns an instance of a {@code Value}.
- *
- * @param columnName The name of the column.
- * @param object The object in the value.
- * @return An instance.
- * @throws Exception Exception
- */
- protected static Value getValue(String columnName, Object object) throws Exception {
- Constructor constructor = Value.class.getDeclaredConstructor(String.class, Object.class, LetterCase.class);
- constructor.setAccessible(true);
- Value value = constructor.newInstance(columnName, object, LetterCase.COLUMN_DEFAULT);
- return value;
- }
-
- /**
- * Returns an instance of a {@code Changes}.
- *
- * @param changesList The list of changes.
- * @return An instance.
- * @throws Exception Exception
- */
- protected static Changes getChanges(List changesList) throws Exception {
- Constructor constructor = Changes.class.getDeclaredConstructor();
- constructor.setAccessible(true);
- Changes changes = constructor.newInstance();
- Field field = Changes.class.getDeclaredField("changesList");
- field.setAccessible(true);
- field.set(changes, changesList);
- return changes;
- }
-
/**
* Returns an instance of a {@code Change}.
*
@@ -317,6 +320,11 @@ protected static Change getTableDeletionChange(String dataName, Row rowAtStartPo
return getChange(DataType.TABLE, dataName, ChangeType.DELETION, rowAtStartPoint, null);
}
+ @Before
+ public void initDsConnection() {
+ this.dsConnectionProvider = ConnectionProviderFactory.of(dataSource).create();
+ }
+
@Before
public void initiate() {
DB_SETUP_TRACKER.launchIfNecessary(DB_SETUP);
@@ -344,7 +352,7 @@ public void determineIfReloadIsNeeded() throws NoSuchMethodException, SecurityEx
* @param parameters The parameters of the request.
*/
protected void update(String request, Object... parameters) {
- try (Connection connection = dataSource.getConnection()) {
+ try (Connection connection = dsConnectionProvider.getConnection()) {
try (PreparedStatement statement = connection.prepareStatement(request)) {
for (int i = 0; i < parameters.length; i++) {
statement.setObject(i + 1, parameters[i]);
diff --git a/src/test/java/org/assertj/db/common/NeedReload.java b/src/test/java/org/assertj/db/common/NeedReload.java
index a895fb63..f3199008 100644
--- a/src/test/java/org/assertj/db/common/NeedReload.java
+++ b/src/test/java/org/assertj/db/common/NeedReload.java
@@ -19,7 +19,7 @@
import java.lang.annotation.Target;
/**
- * Indicates that after the tests it need to reload the data.
+ * Indicates that after the tests it needs to reload the data.
*
* @author Régis Pouiller
*/
diff --git a/src/test/java/org/assertj/db/database/h2/AbstractH2Test.java b/src/test/java/org/assertj/db/database/h2/AbstractH2Test.java
index df53df8f..13dbe121 100644
--- a/src/test/java/org/assertj/db/database/h2/AbstractH2Test.java
+++ b/src/test/java/org/assertj/db/database/h2/AbstractH2Test.java
@@ -24,8 +24,8 @@
import javax.sql.DataSource;
import org.assertj.db.database.AbstractDatabaseTest;
-import org.assertj.db.type.DataSourceWithLetterCase;
-import org.assertj.db.type.SourceWithLetterCase;
+import org.assertj.db.type.ConnectionProvider;
+import org.assertj.db.type.ConnectionProviderFactory;
import org.assertj.db.type.lettercase.LetterCase;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.context.ContextConfiguration;
@@ -39,6 +39,7 @@
* Parent for all the tests which are specific for H2 database.
*
* @author Régis Pouiller
+ * @author Julien Roy
*/
@ContextConfiguration(classes = {H2Configuration.class})
public abstract class AbstractH2Test extends AbstractDatabaseTest {
@@ -77,22 +78,22 @@ public abstract class AbstractH2Test extends AbstractDatabaseTest {
private static final Operation OPERATIONS = sequenceOf(DELETE_ALL, INSERT_TEST, SQL);
private static final DbSetup DB_SETUP = new DbSetup(new DriverManagerDestination("jdbc:h2:mem:testH2", "SA", ""), OPERATIONS);
private static final DbSetupTracker DB_SETUP_TRACKER = new DbSetupTracker();
- protected final SourceWithLetterCase sourceDDD = new SourceWithLetterCase("jdbc:h2:mem:testH2", "sa", "",
+ protected final ConnectionProvider jdbcConnectionDDD = ConnectionProviderFactory.of("jdbc:h2:mem:testH2", "sa", "").letterCase(
LetterCase.TABLE_DEFAULT,
LetterCase.COLUMN_DEFAULT,
- LetterCase.PRIMARY_KEY_DEFAULT);
- protected final SourceWithLetterCase sourceUIUIUI = new SourceWithLetterCase("jdbc:h2:mem:testH2", "sa", "",
+ LetterCase.PRIMARY_KEY_DEFAULT).create();
+ protected final ConnectionProvider jdbcConnectionUIUIUI = ConnectionProviderFactory.of("jdbc:h2:mem:testH2", "sa", "").letterCase(
letterCaseUI,
letterCaseUI,
- letterCaseUI);
- protected final SourceWithLetterCase sourceNSNSNS = new SourceWithLetterCase("jdbc:h2:mem:testH2", "sa", "",
+ letterCaseUI).create();
+ protected final ConnectionProvider jdbcConnectionNSNSNS = ConnectionProviderFactory.of("jdbc:h2:mem:testH2", "sa", "").letterCase(
letterCaseNS,
letterCaseNS,
- letterCaseNS);
+ letterCaseNS).create();
protected DataSource dataSource;
- protected DataSourceWithLetterCase dataSourceDDD;
- protected DataSourceWithLetterCase dataSourceUIUIUI;
- protected DataSourceWithLetterCase dataSourceNSNSNS;
+ protected ConnectionProvider dsConnectionDDD;
+ protected ConnectionProvider dsConnectionUIUIUI;
+ protected ConnectionProvider dsConnectionNSNSNS;
protected DbSetup getDbSetup() {
return DB_SETUP;
@@ -105,11 +106,9 @@ protected DbSetupTracker getDbSetupTracker() {
@Autowired
protected void setDataSource(DataSource dataSource) {
this.dataSource = dataSource;
- this.dataSourceDDD = new DataSourceWithLetterCase(dataSource, LetterCase.TABLE_DEFAULT,
- LetterCase.COLUMN_DEFAULT,
- LetterCase.PRIMARY_KEY_DEFAULT);
- this.dataSourceUIUIUI = new DataSourceWithLetterCase(dataSource, letterCaseUI, letterCaseUI, letterCaseUI);
- this.dataSourceNSNSNS = new DataSourceWithLetterCase(dataSource, letterCaseNS, letterCaseNS, letterCaseNS);
+ this.dsConnectionDDD = ConnectionProviderFactory.of(dataSource).letterCase(LetterCase.TABLE_DEFAULT, LetterCase.COLUMN_DEFAULT, LetterCase.PRIMARY_KEY_DEFAULT).create();
+ this.dsConnectionUIUIUI = ConnectionProviderFactory.of(dataSource).letterCase(letterCaseUI, letterCaseUI, letterCaseUI).create();
+ this.dsConnectionNSNSNS = ConnectionProviderFactory.of(dataSource).letterCase(letterCaseNS, letterCaseNS, letterCaseNS).create();
}
protected void update() {
diff --git a/src/test/java/org/assertj/db/database/h2/AbstractReservedH2Test.java b/src/test/java/org/assertj/db/database/h2/AbstractReservedH2Test.java
index f3a5a31b..dee9034e 100644
--- a/src/test/java/org/assertj/db/database/h2/AbstractReservedH2Test.java
+++ b/src/test/java/org/assertj/db/database/h2/AbstractReservedH2Test.java
@@ -19,8 +19,8 @@
import javax.sql.DataSource;
import org.assertj.db.database.AbstractDatabaseTest;
-import org.assertj.db.type.DataSourceWithLetterCase;
-import org.assertj.db.type.SourceWithLetterCase;
+import org.assertj.db.type.ConnectionProvider;
+import org.assertj.db.type.ConnectionProviderFactory;
import org.assertj.db.type.lettercase.LetterCase;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.context.ContextConfiguration;
@@ -34,6 +34,7 @@
* Parent for all the tests which are specific for H2 database with reserved names in SQL structure.
*
* @author Régis Pouiller
+ * @author Julien Roy
*/
@ContextConfiguration(classes = {ReservedH2Configuration.class})
public abstract class AbstractReservedH2Test extends AbstractDatabaseTest {
@@ -50,22 +51,22 @@ public abstract class AbstractReservedH2Test extends AbstractDatabaseTest {
private static final DbSetup DB_SETUP = new DbSetup(new DriverManagerDestination("jdbc:h2:mem:testReservedH2", "SA", ""),
OPERATIONS);
private static final DbSetupTracker DB_SETUP_TRACKER = new DbSetupTracker();
- protected final SourceWithLetterCase sourceDDD = new SourceWithLetterCase("jdbc:h2:mem:testReservedH2", "sa", "",
+ protected final ConnectionProvider jdbcConnectionDDD = ConnectionProviderFactory.of("jdbc:h2:mem:testReservedH2", "sa", "").letterCase(
LetterCase.TABLE_DEFAULT,
LetterCase.COLUMN_DEFAULT,
- LetterCase.PRIMARY_KEY_DEFAULT);
- protected final SourceWithLetterCase sourceUIUIUI = new SourceWithLetterCase("jdbc:h2:mem:testReservedH2", "sa", "",
+ LetterCase.PRIMARY_KEY_DEFAULT).create();
+ protected final ConnectionProvider jdbcConnectionUIUIUI = ConnectionProviderFactory.of("jdbc:h2:mem:testReservedH2", "sa", "").letterCase(
letterCaseUI,
letterCaseUI,
- letterCaseUI);
- protected final SourceWithLetterCase sourceNSNSNS = new SourceWithLetterCase("jdbc:h2:mem:testReservedH2", "sa", "",
+ letterCaseUI).create();
+ protected final ConnectionProvider jdbcConnectionNSNSNS = ConnectionProviderFactory.of("jdbc:h2:mem:testReservedH2", "sa", "").letterCase(
letterCaseNS,
letterCaseNS,
- letterCaseNS);
+ letterCaseNS).create();
protected DataSource dataSource;
- protected DataSourceWithLetterCase dataSourceDDD;
- protected DataSourceWithLetterCase dataSourceUIUIUI;
- protected DataSourceWithLetterCase dataSourceNSNSNS;
+ protected ConnectionProvider dsConnectionDDD;
+ protected ConnectionProvider dsConnectionUIUIUI;
+ protected ConnectionProvider dsConnectionNSNSNS;
protected DbSetup getDbSetup() {
return DB_SETUP;
@@ -78,11 +79,9 @@ protected DbSetupTracker getDbSetupTracker() {
@Autowired
protected void setDataSource(DataSource dataSource) {
this.dataSource = dataSource;
- this.dataSourceDDD = new DataSourceWithLetterCase(dataSource, LetterCase.TABLE_DEFAULT,
- LetterCase.COLUMN_DEFAULT,
- LetterCase.PRIMARY_KEY_DEFAULT);
- this.dataSourceUIUIUI = new DataSourceWithLetterCase(dataSource, letterCaseUI, letterCaseUI, letterCaseUI);
- this.dataSourceNSNSNS = new DataSourceWithLetterCase(dataSource, letterCaseNS, letterCaseNS, letterCaseNS);
+ this.dsConnectionDDD = ConnectionProviderFactory.of(dataSource).letterCase(LetterCase.TABLE_DEFAULT, LetterCase.COLUMN_DEFAULT, LetterCase.PRIMARY_KEY_DEFAULT).create();
+ this.dsConnectionUIUIUI = ConnectionProviderFactory.of(dataSource).letterCase(letterCaseUI, letterCaseUI, letterCaseUI).create();
+ this.dsConnectionNSNSNS = ConnectionProviderFactory.of(dataSource).letterCase(letterCaseNS, letterCaseNS, letterCaseNS).create();
}
protected void update() {
diff --git a/src/test/java/org/assertj/db/database/h2/H2DataBase_Source_DDD_Test.java b/src/test/java/org/assertj/db/database/h2/H2DataBase_JdbcUrl_DDD_Test.java
similarity index 98%
rename from src/test/java/org/assertj/db/database/h2/H2DataBase_Source_DDD_Test.java
rename to src/test/java/org/assertj/db/database/h2/H2DataBase_JdbcUrl_DDD_Test.java
index e4febd3e..5946663a 100644
--- a/src/test/java/org/assertj/db/database/h2/H2DataBase_Source_DDD_Test.java
+++ b/src/test/java/org/assertj/db/database/h2/H2DataBase_JdbcUrl_DDD_Test.java
@@ -30,12 +30,11 @@
import org.assertj.db.type.Change;
import org.assertj.db.type.Changes;
import org.assertj.db.type.Column;
+import org.assertj.db.type.ConnectionProvider;
import org.assertj.db.type.DateTimeValue;
import org.assertj.db.type.DateValue;
import org.assertj.db.type.Request;
import org.assertj.db.type.Row;
-import org.assertj.db.type.Source;
-import org.assertj.db.type.SourceWithLetterCase;
import org.assertj.db.type.Table;
import org.assertj.db.type.TimeValue;
import org.assertj.db.type.Value;
@@ -48,20 +47,21 @@
* Test on the H2 database.
*
* @author Régis Pouiller
+ * @author Julien Roy
*/
-public class H2DataBase_Source_DDD_Test extends AbstractH2Test {
+public class H2DataBase_JdbcUrl_DDD_Test extends AbstractH2Test {
- private Source source;
+ private ConnectionProvider connectionProvider;
@Before
public void init() {
- source = sourceDDD;
+ connectionProvider = jdbcConnectionDDD;
}
@Test
@NeedReload
public void test_Outputs_output() {
- Table table = new Table(source, "test");
+ Table table = new Table(connectionProvider, "test");
Changes changes = new Changes(table).setStartPointNow();
update();
changes.setEndPointNow();
@@ -129,7 +129,7 @@ public void test_Outputs_output() {
+ "|----------|%n"
+ "| 1 |%n"
+ "|----------|%n"));
- Assertions.assertThat(byteArrayOutputStream5.toString()).isEqualTo(String.format("[Changes on TEST table of 'sa/jdbc:h2:mem:testH2' source]%n"
+ Assertions.assertThat(byteArrayOutputStream5.toString()).isEqualTo(String.format("[Changes on TEST table of 'sa/jdbc:h2:mem:testH2']%n"
+ "|-----------|--------------|-------|---------|----------------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|--------------------|------------|-------------------------------|-------------------------------|-------------------------------|------------|------------|------------|------------|------------|-------------------------------------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|--------------------------------------|------------------|------------------|%n"
+ "| | | | | | * | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |%n"
+ "| | TYPE | TABLE | PRIMARY | | VAR1 | VAR2 | VAR3 | VAR4 | VAR5 | VAR6 | VAR7 | VAR8 | VAR9 | VAR10 | VAR11 | VAR12 | VAR13 | VAR14 | VAR15 | VAR16 | VAR17 | VAR18 | VAR19 | VAR20 | VAR21 | VAR22 | VAR23 | VAR24 | VAR25 | VAR26 | VAR27 | VAR28 | VAR29 | VAR30 | VAR31 | VAR32 | VAR33 | VAR34 | VAR35 | VAR36 | VAR37 | VAR38 | VAR39 | VAR40 | VAR41 | VAR42 | VAR43 | VAR44 | VAR45 | VAR46 | VAR47 | VAR48 | VAR49 | VAR50 | VAR51 | VAR52 | VAR53 | VAR54 | VAR55 | VAR56 | VAR57 | VAR58 | VAR59 | VAR60 | VAR61 |%n"
@@ -140,7 +140,7 @@ public void test_Outputs_output() {
+ "| Index : 0 | MODIFICATION | TEST | 1 |----------------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|--------------------|------------|-------------------------------|-------------------------------|-------------------------------|------------|------------|------------|------------|------------|-------------------------------------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|--------------------------------------|------------------|------------------|%n"
+ "| | | | | At end point | 1 | 20 | 3 | 4 | 5 | 6 | true | false | true | 7 | 8 | 9 | 10 | 11 | 12 | 13.13 | 14.14 | 15.15 | 16.16 | 17.17 | 18.18 | 19.19 | 20.2 | 21.21 | 09:01:00.000000000 | 2007-12-23 | 2007-12-23T09:01:00.000000000 | 2007-12-23T09:01:00.000000000 | 2007-12-23T09:01:00.000000000 | ... | ... | ... | ... | ... | fr | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | ... | ... | ... | ... | ... | ... | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 30b443ae-c0c9-4790-9bec-ce1380808435 | null | null |%n"
+ "|-----------|--------------|-------|---------|----------------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|--------------------|------------|-------------------------------|-------------------------------|-------------------------------|------------|------------|------------|------------|------------|-------------------------------------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|--------------------------------------|------------------|------------------|%n"));
- Assertions.assertThat(byteArrayOutputStream6.toString()).isEqualTo(String.format("[Change at index 0 (with primary key : [1]) of Changes on TEST table of 'sa/jdbc:h2:mem:testH2' source]%n"
+ Assertions.assertThat(byteArrayOutputStream6.toString()).isEqualTo(String.format("[Change at index 0 (with primary key : [1]) of Changes on TEST table of 'sa/jdbc:h2:mem:testH2']%n"
+ "|--------------|-------|---------|----------------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|--------------------|------------|-------------------------------|-------------------------------|-------------------------------|------------|------------|------------|------------|------------|-------------------------------------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|--------------------------------------|------------------|------------------|%n"
+ "| | | | | * | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |%n"
+ "| TYPE | TABLE | PRIMARY | | VAR1 | VAR2 | VAR3 | VAR4 | VAR5 | VAR6 | VAR7 | VAR8 | VAR9 | VAR10 | VAR11 | VAR12 | VAR13 | VAR14 | VAR15 | VAR16 | VAR17 | VAR18 | VAR19 | VAR20 | VAR21 | VAR22 | VAR23 | VAR24 | VAR25 | VAR26 | VAR27 | VAR28 | VAR29 | VAR30 | VAR31 | VAR32 | VAR33 | VAR34 | VAR35 | VAR36 | VAR37 | VAR38 | VAR39 | VAR40 | VAR41 | VAR42 | VAR43 | VAR44 | VAR45 | VAR46 | VAR47 | VAR48 | VAR49 | VAR50 | VAR51 | VAR52 | VAR53 | VAR54 | VAR55 | VAR56 | VAR57 | VAR58 | VAR59 | VAR60 | VAR61 |%n"
@@ -151,7 +151,7 @@ public void test_Outputs_output() {
+ "| MODIFICATION | TEST | 1 |----------------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|--------------------|------------|-------------------------------|-------------------------------|-------------------------------|------------|------------|------------|------------|------------|-------------------------------------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|--------------------------------------|------------------|------------------|%n"
+ "| | | | At end point | 1 | 20 | 3 | 4 | 5 | 6 | true | false | true | 7 | 8 | 9 | 10 | 11 | 12 | 13.13 | 14.14 | 15.15 | 16.16 | 17.17 | 18.18 | 19.19 | 20.2 | 21.21 | 09:01:00.000000000 | 2007-12-23 | 2007-12-23T09:01:00.000000000 | 2007-12-23T09:01:00.000000000 | 2007-12-23T09:01:00.000000000 | ... | ... | ... | ... | ... | fr | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | ... | ... | ... | ... | ... | ... | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 30b443ae-c0c9-4790-9bec-ce1380808435 | null | null |%n"
+ "|--------------|-------|---------|----------------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|--------------------|------------|-------------------------------|-------------------------------|-------------------------------|------------|------------|------------|------------|------------|-------------------------------------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|--------------------------------------|------------------|------------------|%n"));
- Assertions.assertThat(byteArrayOutputStream7.toString()).isEqualTo(String.format("[Row at end point of Change at index 0 (with primary key : [1]) of Changes on TEST table of 'sa/jdbc:h2:mem:testH2' source]%n"
+ Assertions.assertThat(byteArrayOutputStream7.toString()).isEqualTo(String.format("[Row at end point of Change at index 0 (with primary key : [1]) of Changes on TEST table of 'sa/jdbc:h2:mem:testH2']%n"
+ "|---------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|--------------------|------------|-------------------------------|-------------------------------|-------------------------------|------------|------------|------------|------------|------------|-------------------------------------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|--------------------------------------|------------------|------------------|%n"
+ "| | * | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |%n"
+ "| PRIMARY | VAR1 | VAR2 | VAR3 | VAR4 | VAR5 | VAR6 | VAR7 | VAR8 | VAR9 | VAR10 | VAR11 | VAR12 | VAR13 | VAR14 | VAR15 | VAR16 | VAR17 | VAR18 | VAR19 | VAR20 | VAR21 | VAR22 | VAR23 | VAR24 | VAR25 | VAR26 | VAR27 | VAR28 | VAR29 | VAR30 | VAR31 | VAR32 | VAR33 | VAR34 | VAR35 | VAR36 | VAR37 | VAR38 | VAR39 | VAR40 | VAR41 | VAR42 | VAR43 | VAR44 | VAR45 | VAR46 | VAR47 | VAR48 | VAR49 | VAR50 | VAR51 | VAR52 | VAR53 | VAR54 | VAR55 | VAR56 | VAR57 | VAR58 | VAR59 | VAR60 | VAR61 |%n"
@@ -160,14 +160,14 @@ public void test_Outputs_output() {
+ "|---------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|--------------------|------------|-------------------------------|-------------------------------|-------------------------------|------------|------------|------------|------------|------------|-------------------------------------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|--------------------------------------|------------------|------------------|%n"
+ "| 1 | 1 | 20 | 3 | 4 | 5 | 6 | true | false | true | 7 | 8 | 9 | 10 | 11 | 12 | 13.13 | 14.14 | 15.15 | 16.16 | 17.17 | 18.18 | 19.19 | 20.2 | 21.21 | 09:01:00.000000000 | 2007-12-23 | 2007-12-23T09:01:00.000000000 | 2007-12-23T09:01:00.000000000 | 2007-12-23T09:01:00.000000000 | ... | ... | ... | ... | ... | fr | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | ... | ... | ... | ... | ... | ... | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 30b443ae-c0c9-4790-9bec-ce1380808435 | null | null |%n"
+ "|---------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|--------------------|------------|-------------------------------|-------------------------------|-------------------------------|------------|------------|------------|------------|------------|-------------------------------------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|--------------------------------------|------------------|------------------|%n"));
- Assertions.assertThat(byteArrayOutputStream8.toString()).isEqualTo(String.format("[Value at index 0 (column name : VAR1) of Row at end point of Change at index 0 (with primary key : [1]) of Changes on TEST table of 'sa/jdbc:h2:mem:testH2' source]%n"
+ Assertions.assertThat(byteArrayOutputStream8.toString()).isEqualTo(String.format("[Value at index 0 (column name : VAR1) of Row at end point of Change at index 0 (with primary key : [1]) of Changes on TEST table of 'sa/jdbc:h2:mem:testH2']%n"
+ "|----------|%n"
+ "| VAR1 |%n"
+ "| (NUMBER) |%n"
+ "|----------|%n"
+ "| 1 |%n"
+ "|----------|%n"));
- Assertions.assertThat(byteArrayOutputStream9.toString()).isEqualTo(String.format("[Column at index 0 (column name : VAR1) of Change at index 0 (with primary key : [1]) of Changes on TEST table of 'sa/jdbc:h2:mem:testH2' source]%n"
+ Assertions.assertThat(byteArrayOutputStream9.toString()).isEqualTo(String.format("[Column at index 0 (column name : VAR1) of Change at index 0 (with primary key : [1]) of Changes on TEST table of 'sa/jdbc:h2:mem:testH2']%n"
+ "|----------------|----------|%n"
+ "| | VAR1 |%n"
+ "| | (NUMBER) |%n"
@@ -176,7 +176,7 @@ public void test_Outputs_output() {
+ "|----------------|----------|%n"
+ "| At end point | 1 |%n"
+ "|----------------|----------|%n"));
- Assertions.assertThat(byteArrayOutputStream10.toString()).isEqualTo(String.format("[Value at end point of Column at index 0 (column name : VAR1) of Change at index 0 (with primary key : [1]) of Changes on TEST table of 'sa/jdbc:h2:mem:testH2' source]%n"
+ Assertions.assertThat(byteArrayOutputStream10.toString()).isEqualTo(String.format("[Value at end point of Column at index 0 (column name : VAR1) of Change at index 0 (with primary key : [1]) of Changes on TEST table of 'sa/jdbc:h2:mem:testH2']%n"
+ "|----------|%n"
+ "| VAR1 |%n"
+ "| (NUMBER) |%n"
@@ -188,7 +188,7 @@ public void test_Outputs_output() {
@Test
@NeedReload
public void test_PrimaryKey_hasPksNames() {
- Table table = new Table(source, "test");
+ Table table = new Table(connectionProvider, "test");
Changes changes = new Changes(table).setStartPointNow();
update();
changes.setEndPointNow();
@@ -200,7 +200,7 @@ public void test_PrimaryKey_hasPksNames() {
@Test
@NeedReload
public void test_ColumnName_hasColumnName() {
- Table table = new Table(source, "test");
+ Table table = new Table(connectionProvider, "test");
Changes changes = new Changes(table).setStartPointNow();
update();
changes.setEndPointNow();
@@ -337,7 +337,7 @@ public void test_ColumnName_hasColumnName() {
@Test
@NeedReload
public void test_ColumnClass_isOfClass() {
- Table table = new Table(source, "test");
+ Table table = new Table(connectionProvider, "test");
Changes changes = new Changes(table).setStartPointNow();
update();
changes.setEndPointNow();
@@ -474,7 +474,7 @@ public void test_ColumnClass_isOfClass() {
@Test
@NeedReload
public void test_ColumnEquality_hasValues() {
- Table table = new Table(source, "test");
+ Table table = new Table(connectionProvider, "test");
Changes changes = new Changes(table).setStartPointNow();
update();
changes.setEndPointNow();
@@ -610,7 +610,7 @@ public void test_ColumnEquality_hasValues() {
@Test
@NeedReload
public void test_ColumnEquality_containsValues() {
- Table table = new Table(source, "test");
+ Table table = new Table(connectionProvider, "test");
Changes changes = new Changes(table).setStartPointNow();
update();
changes.setEndPointNow();
@@ -682,7 +682,7 @@ public void test_ColumnEquality_containsValues() {
@Test
@NeedReload
public void test_ColumnType_isOfType() {
- Table table = new Table(source, "test");
+ Table table = new Table(connectionProvider, "test");
Changes changes = new Changes(table).setStartPointNow();
update();
changes.setEndPointNow();
@@ -818,7 +818,7 @@ public void test_ColumnType_isOfType() {
@Test
@NeedReload
public void test_ColumnOfChangeEquality_hasValues() {
- Table table = new Table(source, "test");
+ Table table = new Table(connectionProvider, "test");
Changes changes = new Changes(table).setStartPointNow();
update();
changes.setEndPointNow();
@@ -970,7 +970,7 @@ public void test_ColumnOfChangeEquality_hasValues() {
@Test
@NeedReload
public void test_RowEquality_hasValues() {
- Table table = new Table(source, "test");
+ Table table = new Table(connectionProvider, "test");
Changes changes = new Changes(table).setStartPointNow();
update();
changes.setEndPointNow();
@@ -1107,7 +1107,7 @@ public void test_RowEquality_hasValues() {
@Test
@NeedReload
public void test_ValueClass_isOfClass() {
- Table table = new Table(source, "test");
+ Table table = new Table(connectionProvider, "test");
Changes changes = new Changes(table).setStartPointNow();
update();
changes.setEndPointNow();
@@ -1244,7 +1244,7 @@ public void test_ValueClass_isOfClass() {
@Test
@NeedReload
public void test_ValueEquality_isEqualTo() {
- Table table = new Table(source, "test");
+ Table table = new Table(connectionProvider, "test");
Changes changes = new Changes(table).setStartPointNow();
update();
changes.setEndPointNow();
@@ -1381,7 +1381,7 @@ public void test_ValueEquality_isEqualTo() {
@Test
@NeedReload
public void test_ValueNonEquality_isNotEqualTo() {
- Table table = new Table(source, "test");
+ Table table = new Table(connectionProvider, "test");
Changes changes = new Changes(table).setStartPointNow();
update();
changes.setEndPointNow();
@@ -1518,7 +1518,7 @@ public void test_ValueNonEquality_isNotEqualTo() {
@Test
@NeedReload
public void test_ValueType_isOfType() {
- Table table = new Table(source, "test");
+ Table table = new Table(connectionProvider, "test");
Changes changes = new Changes(table).setStartPointNow();
update();
changes.setEndPointNow();
@@ -1655,11 +1655,9 @@ public void test_ValueType_isOfType() {
@Test
@NeedReload
public void test_getTableLetterCase() {
- SourceWithLetterCase sourceWithLetterCase = (SourceWithLetterCase) source;
+ Table table = new Table(connectionProvider, "test");
- Table table = new Table(source, "test");
-
- Request request = new Request(source, "select * from test");
+ Request request = new Request(connectionProvider, "select * from test");
Changes changes = new Changes(table).setStartPointNow();
update();
@@ -1667,7 +1665,7 @@ public void test_getTableLetterCase() {
Change change = changes.getChangesList().get(0);
- Assertions.assertThat(sourceWithLetterCase.getTableLetterCase().getConversionName()).isSameAs(LetterCase.TABLE_DEFAULT.getConversionName());
+ Assertions.assertThat(connectionProvider.getTableLetterCase().getConversionName()).isSameAs(LetterCase.TABLE_DEFAULT.getConversionName());
Assertions.assertThat(table.getTableLetterCase().getConversionName()).isSameAs(LetterCase.TABLE_DEFAULT.getConversionName());
@@ -1677,7 +1675,7 @@ public void test_getTableLetterCase() {
Assertions.assertThat(change.getTableLetterCase().getConversionName()).isSameAs(LetterCase.TABLE_DEFAULT.getConversionName());
- Assertions.assertThat(sourceWithLetterCase.getTableLetterCase().getComparisonName()).isSameAs(LetterCase.TABLE_DEFAULT.getComparisonName());
+ Assertions.assertThat(connectionProvider.getTableLetterCase().getComparisonName()).isSameAs(LetterCase.TABLE_DEFAULT.getComparisonName());
Assertions.assertThat(table.getTableLetterCase().getComparisonName()).isSameAs(LetterCase.TABLE_DEFAULT.getComparisonName());
@@ -1690,15 +1688,13 @@ public void test_getTableLetterCase() {
@Test
@NeedReload
public void test_getColumnLetterCase() {
- SourceWithLetterCase sourceWithLetterCase = (SourceWithLetterCase) source;
-
- Table table = new Table(source, "test");
+ Table table = new Table(connectionProvider, "test");
Row tableRow = table.getRow(0);
Column tableColumn = table.getColumn(0);
Value tableRowValue = tableRow.getColumnValue(0);
Value tableColumnValue = tableColumn.getRowValue(0);
- Request request = new Request(source, "select * from test");
+ Request request = new Request(connectionProvider, "select * from test");
Row requestRow = request.getRow(0);
Column requestColumn = request.getColumn(0);
Value requestRowValue = requestRow.getColumnValue(0);
@@ -1714,7 +1710,7 @@ public void test_getColumnLetterCase() {
Value valueAtEndPoint = rowAtEndPoint.getColumnValue(0);
- Assertions.assertThat(sourceWithLetterCase.getColumnLetterCase().getConversionName()).isSameAs(LetterCase.COLUMN_DEFAULT.getConversionName());
+ Assertions.assertThat(connectionProvider.getColumnLetterCase().getConversionName()).isSameAs(LetterCase.COLUMN_DEFAULT.getConversionName());
Assertions.assertThat(table.getColumnLetterCase().getConversionName()).isSameAs(LetterCase.COLUMN_DEFAULT.getConversionName());
Assertions.assertThat(tableRow.getColumnLetterCase().getConversionName()).isSameAs(LetterCase.COLUMN_DEFAULT.getConversionName());
@@ -1736,7 +1732,7 @@ public void test_getColumnLetterCase() {
Assertions.assertThat(valueAtEndPoint.getColumnLetterCase().getConversionName()).isSameAs(LetterCase.COLUMN_DEFAULT.getConversionName());
- Assertions.assertThat(sourceWithLetterCase.getColumnLetterCase().getComparisonName()).isSameAs(LetterCase.COLUMN_DEFAULT.getComparisonName());
+ Assertions.assertThat(connectionProvider.getColumnLetterCase().getComparisonName()).isSameAs(LetterCase.COLUMN_DEFAULT.getComparisonName());
Assertions.assertThat(table.getColumnLetterCase().getComparisonName()).isSameAs(LetterCase.COLUMN_DEFAULT.getComparisonName());
Assertions.assertThat(tableRow.getColumnLetterCase().getComparisonName()).isSameAs(LetterCase.COLUMN_DEFAULT.getComparisonName());
@@ -1761,12 +1757,10 @@ public void test_getColumnLetterCase() {
@Test
@NeedReload
public void test_getPrimaryKeyLetterCase() {
- SourceWithLetterCase sourceWithLetterCase = (SourceWithLetterCase) source;
-
- Table table = new Table(source, "test");
+ Table table = new Table(connectionProvider, "test");
Row tableRow = table.getRow(0);
- Request request = new Request(source, "select * from test");
+ Request request = new Request(connectionProvider, "select * from test");
Row requestRow = request.getRow(0);
Changes changes = new Changes(table).setStartPointNow();
@@ -1777,7 +1771,7 @@ public void test_getPrimaryKeyLetterCase() {
Row rowAtEndPoint = change.getRowAtEndPoint();
- Assertions.assertThat(sourceWithLetterCase.getPrimaryKeyLetterCase().getConversionName()).isSameAs(LetterCase.PRIMARY_KEY_DEFAULT.getConversionName());
+ Assertions.assertThat(connectionProvider.getPrimaryKeyLetterCase().getConversionName()).isSameAs(LetterCase.PRIMARY_KEY_DEFAULT.getConversionName());
Assertions.assertThat(table.getPrimaryKeyLetterCase().getConversionName()).isSameAs(LetterCase.PRIMARY_KEY_DEFAULT.getConversionName());
Assertions.assertThat(tableRow.getPrimaryKeyLetterCase().getConversionName()).isSameAs(LetterCase.PRIMARY_KEY_DEFAULT.getConversionName());
@@ -1791,7 +1785,7 @@ public void test_getPrimaryKeyLetterCase() {
Assertions.assertThat(rowAtEndPoint.getPrimaryKeyLetterCase().getConversionName()).isSameAs(LetterCase.PRIMARY_KEY_DEFAULT.getConversionName());
- Assertions.assertThat(sourceWithLetterCase.getPrimaryKeyLetterCase().getComparisonName()).isSameAs(LetterCase.PRIMARY_KEY_DEFAULT.getComparisonName());
+ Assertions.assertThat(connectionProvider.getPrimaryKeyLetterCase().getComparisonName()).isSameAs(LetterCase.PRIMARY_KEY_DEFAULT.getComparisonName());
Assertions.assertThat(table.getPrimaryKeyLetterCase().getComparisonName()).isSameAs(LetterCase.PRIMARY_KEY_DEFAULT.getComparisonName());
Assertions.assertThat(tableRow.getPrimaryKeyLetterCase().getComparisonName()).isSameAs(LetterCase.PRIMARY_KEY_DEFAULT.getComparisonName());
diff --git a/src/test/java/org/assertj/db/database/h2/H2DataBase_Test.java b/src/test/java/org/assertj/db/database/h2/H2DataBase_Test.java
index b0514fe7..ae8fc8ce 100644
--- a/src/test/java/org/assertj/db/database/h2/H2DataBase_Test.java
+++ b/src/test/java/org/assertj/db/database/h2/H2DataBase_Test.java
@@ -44,7 +44,7 @@ public void test_catalog_for_data_source() throws SQLException {
}
@Test
- public void test_catalog_for_source() throws SQLException {
+ public void test_catalogfor_jdbc_connection() throws SQLException {
try (Connection connection = DriverManager.getConnection(URL, USER, PASSWORD)) {
String catalog = connection.getCatalog();
assertThat(catalog).isEqualTo("TESTH2");
@@ -60,7 +60,7 @@ public void test_schema_for_data_source() throws SQLException {
}
@Test
- public void test_schema_for_source() throws SQLException {
+ public void test_schemafor_jdbc_connection() throws SQLException {
try (Connection connection = DriverManager.getConnection(URL, USER, PASSWORD)) {
String schema = connection.getSchema();
assertThat(schema).isEqualTo("PUBLIC");
@@ -79,7 +79,7 @@ public void test_tables_for_data_source() throws SQLException {
}
@Test
- public void test_tables_for_source() throws SQLException {
+ public void test_tablesfor_jdbc_connection() throws SQLException {
try (Connection connection = DriverManager.getConnection(URL, USER, PASSWORD)) {
DatabaseMetaData databaseMetaData = connection.getMetaData();
ResultSet resultSet = databaseMetaData.getTables("TESTH2", null, null, new String[]{"TABLE"});
@@ -107,7 +107,7 @@ public void test_table_primary_keys_for_data_source() throws SQLException {
}
@Test
- public void test_table_primary_keys_for_source() throws SQLException {
+ public void test_table_primary_keysfor_jdbc_connection() throws SQLException {
try (Connection connection = DriverManager.getConnection(URL, USER, PASSWORD)) {
DatabaseMetaData databaseMetaData = connection.getMetaData();
{
@@ -261,7 +261,7 @@ public void test_table_columns_for_data_source() throws SQLException {
}
@Test
- public void test_table_columns_for_source() throws SQLException {
+ public void test_table_columnsfor_jdbc_connection() throws SQLException {
try (Connection connection = DriverManager.getConnection(URL, USER, PASSWORD)) {
DatabaseMetaData databaseMetaData = connection.getMetaData();
{
@@ -471,7 +471,7 @@ public void test_request_columns_for_data_source() throws SQLException {
}
@Test
- public void test_request_columns_for_source() throws SQLException {
+ public void test_request_columnsfor_jdbc_connection() throws SQLException {
try (Connection connection = DriverManager.getConnection(URL, USER, PASSWORD)) {
try (Statement statement = connection.createStatement()) {
try (ResultSet resultSet1 = statement.executeQuery("select * from test")) {
diff --git a/src/test/java/org/assertj/db/database/h2/H2Database_DataSource_DDD_Test.java b/src/test/java/org/assertj/db/database/h2/H2Database_DataSource_DDD_Test.java
index f8babf80..11be7e6e 100644
--- a/src/test/java/org/assertj/db/database/h2/H2Database_DataSource_DDD_Test.java
+++ b/src/test/java/org/assertj/db/database/h2/H2Database_DataSource_DDD_Test.java
@@ -23,7 +23,6 @@
import java.sql.Timestamp;
import java.util.Locale;
import java.util.UUID;
-import javax.sql.DataSource;
import org.assertj.core.api.Assertions;
import org.assertj.db.common.NeedReload;
@@ -31,7 +30,7 @@
import org.assertj.db.type.Change;
import org.assertj.db.type.Changes;
import org.assertj.db.type.Column;
-import org.assertj.db.type.DataSourceWithLetterCase;
+import org.assertj.db.type.ConnectionProvider;
import org.assertj.db.type.DateTimeValue;
import org.assertj.db.type.DateValue;
import org.assertj.db.type.Request;
@@ -48,20 +47,21 @@
* Test on the H2 database.
*
* @author Régis Pouiller
+ * @author Julien Roy
*/
public class H2Database_DataSource_DDD_Test extends AbstractH2Test {
- private DataSource dataSource;
+ private ConnectionProvider connectionProvider;
@Before
public void init() {
- dataSource = dataSourceDDD;
+ connectionProvider = dsConnectionDDD;
}
@Test
@NeedReload
public void test_Outputs_output() {
- Table table = new Table(dataSource, "test");
+ Table table = new Table(connectionProvider, "test");
Changes changes = new Changes(table).setStartPointNow();
update();
changes.setEndPointNow();
@@ -129,7 +129,7 @@ public void test_Outputs_output() {
+ "|----------|%n"
+ "| 1 |%n"
+ "|----------|%n"));
- Assertions.assertThat(byteArrayOutputStream5.toString()).isEqualTo(String.format("[Changes on TEST table of a data source]%n"
+ Assertions.assertThat(byteArrayOutputStream5.toString()).isEqualTo(String.format("[Changes on TEST table of 'data source']%n"
+ "|-----------|--------------|-------|---------|----------------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|--------------------|------------|-------------------------------|-------------------------------|-------------------------------|------------|------------|------------|------------|------------|-------------------------------------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|--------------------------------------|------------------|------------------|%n"
+ "| | | | | | * | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |%n"
+ "| | TYPE | TABLE | PRIMARY | | VAR1 | VAR2 | VAR3 | VAR4 | VAR5 | VAR6 | VAR7 | VAR8 | VAR9 | VAR10 | VAR11 | VAR12 | VAR13 | VAR14 | VAR15 | VAR16 | VAR17 | VAR18 | VAR19 | VAR20 | VAR21 | VAR22 | VAR23 | VAR24 | VAR25 | VAR26 | VAR27 | VAR28 | VAR29 | VAR30 | VAR31 | VAR32 | VAR33 | VAR34 | VAR35 | VAR36 | VAR37 | VAR38 | VAR39 | VAR40 | VAR41 | VAR42 | VAR43 | VAR44 | VAR45 | VAR46 | VAR47 | VAR48 | VAR49 | VAR50 | VAR51 | VAR52 | VAR53 | VAR54 | VAR55 | VAR56 | VAR57 | VAR58 | VAR59 | VAR60 | VAR61 |%n"
@@ -140,7 +140,7 @@ public void test_Outputs_output() {
+ "| Index : 0 | MODIFICATION | TEST | 1 |----------------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|--------------------|------------|-------------------------------|-------------------------------|-------------------------------|------------|------------|------------|------------|------------|-------------------------------------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|--------------------------------------|------------------|------------------|%n"
+ "| | | | | At end point | 1 | 20 | 3 | 4 | 5 | 6 | true | false | true | 7 | 8 | 9 | 10 | 11 | 12 | 13.13 | 14.14 | 15.15 | 16.16 | 17.17 | 18.18 | 19.19 | 20.2 | 21.21 | 09:01:00.000000000 | 2007-12-23 | 2007-12-23T09:01:00.000000000 | 2007-12-23T09:01:00.000000000 | 2007-12-23T09:01:00.000000000 | ... | ... | ... | ... | ... | fr | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | ... | ... | ... | ... | ... | ... | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 30b443ae-c0c9-4790-9bec-ce1380808435 | null | null |%n"
+ "|-----------|--------------|-------|---------|----------------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|--------------------|------------|-------------------------------|-------------------------------|-------------------------------|------------|------------|------------|------------|------------|-------------------------------------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|--------------------------------------|------------------|------------------|%n"));
- Assertions.assertThat(byteArrayOutputStream6.toString()).isEqualTo(String.format("[Change at index 0 (with primary key : [1]) of Changes on TEST table of a data source]%n"
+ Assertions.assertThat(byteArrayOutputStream6.toString()).isEqualTo(String.format("[Change at index 0 (with primary key : [1]) of Changes on TEST table of 'data source']%n"
+ "|--------------|-------|---------|----------------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|--------------------|------------|-------------------------------|-------------------------------|-------------------------------|------------|------------|------------|------------|------------|-------------------------------------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|--------------------------------------|------------------|------------------|%n"
+ "| | | | | * | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |%n"
+ "| TYPE | TABLE | PRIMARY | | VAR1 | VAR2 | VAR3 | VAR4 | VAR5 | VAR6 | VAR7 | VAR8 | VAR9 | VAR10 | VAR11 | VAR12 | VAR13 | VAR14 | VAR15 | VAR16 | VAR17 | VAR18 | VAR19 | VAR20 | VAR21 | VAR22 | VAR23 | VAR24 | VAR25 | VAR26 | VAR27 | VAR28 | VAR29 | VAR30 | VAR31 | VAR32 | VAR33 | VAR34 | VAR35 | VAR36 | VAR37 | VAR38 | VAR39 | VAR40 | VAR41 | VAR42 | VAR43 | VAR44 | VAR45 | VAR46 | VAR47 | VAR48 | VAR49 | VAR50 | VAR51 | VAR52 | VAR53 | VAR54 | VAR55 | VAR56 | VAR57 | VAR58 | VAR59 | VAR60 | VAR61 |%n"
@@ -151,7 +151,7 @@ public void test_Outputs_output() {
+ "| MODIFICATION | TEST | 1 |----------------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|--------------------|------------|-------------------------------|-------------------------------|-------------------------------|------------|------------|------------|------------|------------|-------------------------------------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|--------------------------------------|------------------|------------------|%n"
+ "| | | | At end point | 1 | 20 | 3 | 4 | 5 | 6 | true | false | true | 7 | 8 | 9 | 10 | 11 | 12 | 13.13 | 14.14 | 15.15 | 16.16 | 17.17 | 18.18 | 19.19 | 20.2 | 21.21 | 09:01:00.000000000 | 2007-12-23 | 2007-12-23T09:01:00.000000000 | 2007-12-23T09:01:00.000000000 | 2007-12-23T09:01:00.000000000 | ... | ... | ... | ... | ... | fr | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | ... | ... | ... | ... | ... | ... | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 30b443ae-c0c9-4790-9bec-ce1380808435 | null | null |%n"
+ "|--------------|-------|---------|----------------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|--------------------|------------|-------------------------------|-------------------------------|-------------------------------|------------|------------|------------|------------|------------|-------------------------------------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|--------------------------------------|------------------|------------------|%n"));
- Assertions.assertThat(byteArrayOutputStream7.toString()).isEqualTo(String.format("[Row at end point of Change at index 0 (with primary key : [1]) of Changes on TEST table of a data source]%n"
+ Assertions.assertThat(byteArrayOutputStream7.toString()).isEqualTo(String.format("[Row at end point of Change at index 0 (with primary key : [1]) of Changes on TEST table of 'data source']%n"
+ "|---------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|--------------------|------------|-------------------------------|-------------------------------|-------------------------------|------------|------------|------------|------------|------------|-------------------------------------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|--------------------------------------|------------------|------------------|%n"
+ "| | * | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |%n"
+ "| PRIMARY | VAR1 | VAR2 | VAR3 | VAR4 | VAR5 | VAR6 | VAR7 | VAR8 | VAR9 | VAR10 | VAR11 | VAR12 | VAR13 | VAR14 | VAR15 | VAR16 | VAR17 | VAR18 | VAR19 | VAR20 | VAR21 | VAR22 | VAR23 | VAR24 | VAR25 | VAR26 | VAR27 | VAR28 | VAR29 | VAR30 | VAR31 | VAR32 | VAR33 | VAR34 | VAR35 | VAR36 | VAR37 | VAR38 | VAR39 | VAR40 | VAR41 | VAR42 | VAR43 | VAR44 | VAR45 | VAR46 | VAR47 | VAR48 | VAR49 | VAR50 | VAR51 | VAR52 | VAR53 | VAR54 | VAR55 | VAR56 | VAR57 | VAR58 | VAR59 | VAR60 | VAR61 |%n"
@@ -160,14 +160,14 @@ public void test_Outputs_output() {
+ "|---------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|--------------------|------------|-------------------------------|-------------------------------|-------------------------------|------------|------------|------------|------------|------------|-------------------------------------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|--------------------------------------|------------------|------------------|%n"
+ "| 1 | 1 | 20 | 3 | 4 | 5 | 6 | true | false | true | 7 | 8 | 9 | 10 | 11 | 12 | 13.13 | 14.14 | 15.15 | 16.16 | 17.17 | 18.18 | 19.19 | 20.2 | 21.21 | 09:01:00.000000000 | 2007-12-23 | 2007-12-23T09:01:00.000000000 | 2007-12-23T09:01:00.000000000 | 2007-12-23T09:01:00.000000000 | ... | ... | ... | ... | ... | fr | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | ... | ... | ... | ... | ... | ... | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 30b443ae-c0c9-4790-9bec-ce1380808435 | null | null |%n"
+ "|---------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|--------------------|------------|-------------------------------|-------------------------------|-------------------------------|------------|------------|------------|------------|------------|-------------------------------------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|--------------------------------------|------------------|------------------|%n"));
- Assertions.assertThat(byteArrayOutputStream8.toString()).isEqualTo(String.format("[Value at index 0 (column name : VAR1) of Row at end point of Change at index 0 (with primary key : [1]) of Changes on TEST table of a data source]%n"
+ Assertions.assertThat(byteArrayOutputStream8.toString()).isEqualTo(String.format("[Value at index 0 (column name : VAR1) of Row at end point of Change at index 0 (with primary key : [1]) of Changes on TEST table of 'data source']%n"
+ "|----------|%n"
+ "| VAR1 |%n"
+ "| (NUMBER) |%n"
+ "|----------|%n"
+ "| 1 |%n"
+ "|----------|%n"));
- Assertions.assertThat(byteArrayOutputStream9.toString()).isEqualTo(String.format("[Column at index 0 (column name : VAR1) of Change at index 0 (with primary key : [1]) of Changes on TEST table of a data source]%n"
+ Assertions.assertThat(byteArrayOutputStream9.toString()).isEqualTo(String.format("[Column at index 0 (column name : VAR1) of Change at index 0 (with primary key : [1]) of Changes on TEST table of 'data source']%n"
+ "|----------------|----------|%n"
+ "| | VAR1 |%n"
+ "| | (NUMBER) |%n"
@@ -176,7 +176,7 @@ public void test_Outputs_output() {
+ "|----------------|----------|%n"
+ "| At end point | 1 |%n"
+ "|----------------|----------|%n"));
- Assertions.assertThat(byteArrayOutputStream10.toString()).isEqualTo(String.format("[Value at end point of Column at index 0 (column name : VAR1) of Change at index 0 (with primary key : [1]) of Changes on TEST table of a data source]%n"
+ Assertions.assertThat(byteArrayOutputStream10.toString()).isEqualTo(String.format("[Value at end point of Column at index 0 (column name : VAR1) of Change at index 0 (with primary key : [1]) of Changes on TEST table of 'data source']%n"
+ "|----------|%n"
+ "| VAR1 |%n"
+ "| (NUMBER) |%n"
@@ -188,7 +188,7 @@ public void test_Outputs_output() {
@Test
@NeedReload
public void test_PrimaryKey_hasPksNames() {
- Table table = new Table(dataSource, "test");
+ Table table = new Table(connectionProvider, "test");
Changes changes = new Changes(table).setStartPointNow();
update();
changes.setEndPointNow();
@@ -200,7 +200,7 @@ public void test_PrimaryKey_hasPksNames() {
@Test
@NeedReload
public void test_ColumnName_hasColumnName() {
- Table table = new Table(dataSource, "test");
+ Table table = new Table(connectionProvider, "test");
Changes changes = new Changes(table).setStartPointNow();
update();
changes.setEndPointNow();
@@ -337,7 +337,7 @@ public void test_ColumnName_hasColumnName() {
@Test
@NeedReload
public void test_ColumnClass_isOfClass() {
- Table table = new Table(dataSource, "test");
+ Table table = new Table(connectionProvider, "test");
Changes changes = new Changes(table).setStartPointNow();
update();
changes.setEndPointNow();
@@ -474,7 +474,7 @@ public void test_ColumnClass_isOfClass() {
@Test
@NeedReload
public void test_ColumnEquality_hasValues() {
- Table table = new Table(dataSource, "test");
+ Table table = new Table(connectionProvider, "test");
Changes changes = new Changes(table).setStartPointNow();
update();
changes.setEndPointNow();
@@ -610,7 +610,7 @@ public void test_ColumnEquality_hasValues() {
@Test
@NeedReload
public void test_ColumnEquality_containsValues() {
- Table table = new Table(dataSource, "test");
+ Table table = new Table(connectionProvider, "test");
Changes changes = new Changes(table).setStartPointNow();
update();
changes.setEndPointNow();
@@ -682,7 +682,7 @@ public void test_ColumnEquality_containsValues() {
@Test
@NeedReload
public void test_ColumnType_isOfType() {
- Table table = new Table(dataSource, "test");
+ Table table = new Table(connectionProvider, "test");
Changes changes = new Changes(table).setStartPointNow();
update();
changes.setEndPointNow();
@@ -818,7 +818,7 @@ public void test_ColumnType_isOfType() {
@Test
@NeedReload
public void test_ColumnOfChangeEquality_hasValues() {
- Table table = new Table(dataSource, "test");
+ Table table = new Table(connectionProvider, "test");
Changes changes = new Changes(table).setStartPointNow();
update();
changes.setEndPointNow();
@@ -970,7 +970,7 @@ public void test_ColumnOfChangeEquality_hasValues() {
@Test
@NeedReload
public void test_RowEquality_hasValues() {
- Table table = new Table(dataSource, "test");
+ Table table = new Table(connectionProvider, "test");
Changes changes = new Changes(table).setStartPointNow();
update();
changes.setEndPointNow();
@@ -1107,7 +1107,7 @@ public void test_RowEquality_hasValues() {
@Test
@NeedReload
public void test_ValueClass_isOfClass() {
- Table table = new Table(dataSource, "test");
+ Table table = new Table(connectionProvider, "test");
Changes changes = new Changes(table).setStartPointNow();
update();
changes.setEndPointNow();
@@ -1244,7 +1244,7 @@ public void test_ValueClass_isOfClass() {
@Test
@NeedReload
public void test_ValueEquality_isEqualTo() {
- Table table = new Table(dataSource, "test");
+ Table table = new Table(connectionProvider, "test");
Changes changes = new Changes(table).setStartPointNow();
update();
changes.setEndPointNow();
@@ -1381,7 +1381,7 @@ public void test_ValueEquality_isEqualTo() {
@Test
@NeedReload
public void test_ValueNonEquality_isNotEqualTo() {
- Table table = new Table(dataSource, "test");
+ Table table = new Table(connectionProvider, "test");
Changes changes = new Changes(table).setStartPointNow();
update();
changes.setEndPointNow();
@@ -1518,7 +1518,7 @@ public void test_ValueNonEquality_isNotEqualTo() {
@Test
@NeedReload
public void test_ValueType_isOfType() {
- Table table = new Table(dataSource, "test");
+ Table table = new Table(connectionProvider, "test");
Changes changes = new Changes(table).setStartPointNow();
update();
changes.setEndPointNow();
@@ -1655,11 +1655,9 @@ public void test_ValueType_isOfType() {
@Test
@NeedReload
public void test_getTableLetterCase() {
- DataSourceWithLetterCase datasourceWithLetterCase = (DataSourceWithLetterCase) dataSource;
+ Table table = new Table(connectionProvider, "test");
- Table table = new Table(dataSource, "test");
-
- Request request = new Request(dataSource, "select * from test");
+ Request request = new Request(connectionProvider, "select * from test");
Changes changes = new Changes(table).setStartPointNow();
update();
@@ -1667,7 +1665,7 @@ public void test_getTableLetterCase() {
Change change = changes.getChangesList().get(0);
- Assertions.assertThat(datasourceWithLetterCase.getTableLetterCase().getConversionName()).isSameAs(LetterCase.TABLE_DEFAULT.getConversionName());
+ Assertions.assertThat(connectionProvider.getTableLetterCase().getConversionName()).isSameAs(LetterCase.TABLE_DEFAULT.getConversionName());
Assertions.assertThat(table.getTableLetterCase().getConversionName()).isSameAs(LetterCase.TABLE_DEFAULT.getConversionName());
@@ -1677,7 +1675,7 @@ public void test_getTableLetterCase() {
Assertions.assertThat(change.getTableLetterCase().getConversionName()).isSameAs(LetterCase.TABLE_DEFAULT.getConversionName());
- Assertions.assertThat(datasourceWithLetterCase.getTableLetterCase().getComparisonName()).isSameAs(LetterCase.TABLE_DEFAULT.getComparisonName());
+ Assertions.assertThat(connectionProvider.getTableLetterCase().getComparisonName()).isSameAs(LetterCase.TABLE_DEFAULT.getComparisonName());
Assertions.assertThat(table.getTableLetterCase().getComparisonName()).isSameAs(LetterCase.TABLE_DEFAULT.getComparisonName());
@@ -1690,15 +1688,13 @@ public void test_getTableLetterCase() {
@Test
@NeedReload
public void test_getColumnLetterCase() {
- DataSourceWithLetterCase datasourceWithLetterCase = (DataSourceWithLetterCase) dataSource;
-
- Table table = new Table(dataSource, "test");
+ Table table = new Table(connectionProvider, "test");
Row tableRow = table.getRow(0);
Column tableColumn = table.getColumn(0);
Value tableRowValue = tableRow.getColumnValue(0);
Value tableColumnValue = tableColumn.getRowValue(0);
- Request request = new Request(dataSource, "select * from test");
+ Request request = new Request(connectionProvider, "select * from test");
Row requestRow = request.getRow(0);
Column requestColumn = request.getColumn(0);
Value requestRowValue = requestRow.getColumnValue(0);
@@ -1714,7 +1710,7 @@ public void test_getColumnLetterCase() {
Value valueAtEndPoint = rowAtEndPoint.getColumnValue(0);
- Assertions.assertThat(datasourceWithLetterCase.getColumnLetterCase().getConversionName()).isSameAs(LetterCase.COLUMN_DEFAULT.getConversionName());
+ Assertions.assertThat(connectionProvider.getColumnLetterCase().getConversionName()).isSameAs(LetterCase.COLUMN_DEFAULT.getConversionName());
Assertions.assertThat(table.getColumnLetterCase().getConversionName()).isSameAs(LetterCase.COLUMN_DEFAULT.getConversionName());
Assertions.assertThat(tableRow.getColumnLetterCase().getConversionName()).isSameAs(LetterCase.COLUMN_DEFAULT.getConversionName());
@@ -1736,7 +1732,7 @@ public void test_getColumnLetterCase() {
Assertions.assertThat(valueAtEndPoint.getColumnLetterCase().getConversionName()).isSameAs(LetterCase.COLUMN_DEFAULT.getConversionName());
- Assertions.assertThat(datasourceWithLetterCase.getColumnLetterCase().getComparisonName()).isSameAs(LetterCase.COLUMN_DEFAULT.getComparisonName());
+ Assertions.assertThat(connectionProvider.getColumnLetterCase().getComparisonName()).isSameAs(LetterCase.COLUMN_DEFAULT.getComparisonName());
Assertions.assertThat(table.getColumnLetterCase().getComparisonName()).isSameAs(LetterCase.COLUMN_DEFAULT.getComparisonName());
Assertions.assertThat(tableRow.getColumnLetterCase().getComparisonName()).isSameAs(LetterCase.COLUMN_DEFAULT.getComparisonName());
@@ -1761,12 +1757,10 @@ public void test_getColumnLetterCase() {
@Test
@NeedReload
public void test_getPrimaryKeyLetterCase() {
- DataSourceWithLetterCase datasourceWithLetterCase = (DataSourceWithLetterCase) dataSource;
-
- Table table = new Table(dataSource, "test");
+ Table table = new Table(connectionProvider, "test");
Row tableRow = table.getRow(0);
- Request request = new Request(dataSource, "select * from test");
+ Request request = new Request(connectionProvider, "select * from test");
Row requestRow = request.getRow(0);
Changes changes = new Changes(table).setStartPointNow();
@@ -1777,7 +1771,7 @@ public void test_getPrimaryKeyLetterCase() {
Row rowAtEndPoint = change.getRowAtEndPoint();
- Assertions.assertThat(datasourceWithLetterCase.getPrimaryKeyLetterCase().getConversionName()).isSameAs(LetterCase.PRIMARY_KEY_DEFAULT.getConversionName());
+ Assertions.assertThat(connectionProvider.getPrimaryKeyLetterCase().getConversionName()).isSameAs(LetterCase.PRIMARY_KEY_DEFAULT.getConversionName());
Assertions.assertThat(table.getPrimaryKeyLetterCase().getConversionName()).isSameAs(LetterCase.PRIMARY_KEY_DEFAULT.getConversionName());
Assertions.assertThat(tableRow.getPrimaryKeyLetterCase().getConversionName()).isSameAs(LetterCase.PRIMARY_KEY_DEFAULT.getConversionName());
@@ -1791,7 +1785,7 @@ public void test_getPrimaryKeyLetterCase() {
Assertions.assertThat(rowAtEndPoint.getPrimaryKeyLetterCase().getConversionName()).isSameAs(LetterCase.PRIMARY_KEY_DEFAULT.getConversionName());
- Assertions.assertThat(datasourceWithLetterCase.getPrimaryKeyLetterCase().getComparisonName()).isSameAs(LetterCase.PRIMARY_KEY_DEFAULT.getComparisonName());
+ Assertions.assertThat(connectionProvider.getPrimaryKeyLetterCase().getComparisonName()).isSameAs(LetterCase.PRIMARY_KEY_DEFAULT.getComparisonName());
Assertions.assertThat(table.getPrimaryKeyLetterCase().getComparisonName()).isSameAs(LetterCase.PRIMARY_KEY_DEFAULT.getComparisonName());
Assertions.assertThat(tableRow.getPrimaryKeyLetterCase().getComparisonName()).isSameAs(LetterCase.PRIMARY_KEY_DEFAULT.getComparisonName());
diff --git a/src/test/java/org/assertj/db/database/h2/H2Database_DataSource_NSNSNS_Test.java b/src/test/java/org/assertj/db/database/h2/H2Database_DataSource_NSNSNS_Test.java
index 3076c32d..bb20827f 100644
--- a/src/test/java/org/assertj/db/database/h2/H2Database_DataSource_NSNSNS_Test.java
+++ b/src/test/java/org/assertj/db/database/h2/H2Database_DataSource_NSNSNS_Test.java
@@ -17,7 +17,6 @@
import static org.junit.Assert.fail;
import java.io.ByteArrayOutputStream;
-import javax.sql.DataSource;
import org.assertj.core.api.Assertions;
import org.assertj.db.common.NeedReload;
@@ -27,7 +26,7 @@
import org.assertj.db.type.ChangeType;
import org.assertj.db.type.Changes;
import org.assertj.db.type.Column;
-import org.assertj.db.type.DataSourceWithLetterCase;
+import org.assertj.db.type.ConnectionProvider;
import org.assertj.db.type.Request;
import org.assertj.db.type.Row;
import org.assertj.db.type.Table;
@@ -41,23 +40,24 @@
* Test on the H2 database.
*
* @author Régis Pouiller
+ * @author Julien Roy
*/
public class H2Database_DataSource_NSNSNS_Test extends AbstractH2Test {
- private DataSource dataSource;
+ private ConnectionProvider connectionProvider;
@Before
public void init() {
- dataSource = dataSourceNSNSNS;
+ connectionProvider = dsConnectionNSNSNS;
}
@Test
@NeedReload
public void test_Outputs_output() {
- Table table = new Table(dataSource, "test");
+ Table table = new Table(connectionProvider, "test");
Changes changes = new Changes(table).setStartPointNow();
- Changes changes2 = new Changes(dataSource).setStartPointNow();
+ Changes changes2 = new Changes(connectionProvider).setStartPointNow();
update();
changes.setEndPointNow();
changes2.setEndPointNow();
@@ -136,7 +136,7 @@ public void test_Outputs_output() {
+ "|----------|%n"
+ "| 1 |%n"
+ "|----------|%n"));
- Assertions.assertThat(byteArrayOutputStream5.toString()).as("display6").isEqualTo(String.format("[Changes on test table of a data source]%n"
+ Assertions.assertThat(byteArrayOutputStream5.toString()).as("display6").isEqualTo(String.format("[Changes on test table of 'data source']%n"
+ "|-----------|----------|-------|---------|----------------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|--------------------|------------|-------------------------------|-------------------------------|-------------------------------|------------|------------|------------|------------|------------|-------------------------------------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|--------------------------------------|------------------|------------------|%n"
+ "| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |%n"
+ "| | TYPE | TABLE | PRIMARY | | VAR1 | VAR2 | VAR3 | VAR4 | VAR5 | VAR6 | VAR7 | VAR8 | VAR9 | VAR10 | VAR11 | VAR12 | VAR13 | VAR14 | VAR15 | VAR16 | VAR17 | VAR18 | VAR19 | VAR20 | VAR21 | VAR22 | VAR23 | VAR24 | VAR25 | VAR26 | VAR27 | VAR28 | VAR29 | VAR30 | VAR31 | VAR32 | VAR33 | VAR34 | VAR35 | VAR36 | VAR37 | VAR38 | VAR39 | VAR40 | VAR41 | VAR42 | VAR43 | VAR44 | VAR45 | VAR46 | VAR47 | VAR48 | VAR49 | VAR50 | VAR51 | VAR52 | VAR53 | VAR54 | VAR55 | VAR56 | VAR57 | VAR58 | VAR59 | VAR60 | VAR61 |%n"
@@ -157,7 +157,7 @@ public void test_Outputs_output() {
+ "| Index : 1 | DELETION | test | |----------------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|--------------------|------------|-------------------------------|-------------------------------|-------------------------------|------------|------------|------------|------------|------------|-------------------------------------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|--------------------------------------|------------------|------------------|%n"
+ "| | | | | At end point | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |%n"
+ "|-----------|----------|-------|---------|----------------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|--------------------|------------|-------------------------------|-------------------------------|-------------------------------|------------|------------|------------|------------|------------|-------------------------------------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|--------------------------------------|------------------|------------------|%n"));
- Assertions.assertThat(byteArrayOutputStream6.toString()).as("display7").isEqualTo(String.format("[Change at index 0 of Changes on test table of a data source]%n"
+ Assertions.assertThat(byteArrayOutputStream6.toString()).as("display7").isEqualTo(String.format("[Change at index 0 of Changes on test table of 'data source']%n"
+ "|----------|-------|---------|----------------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|--------------------|------------|-------------------------------|-------------------------------|-------------------------------|------------|------------|------------|------------|------------|-------------------------------------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|--------------------------------------|------------------|------------------|%n"
+ "| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |%n"
+ "| TYPE | TABLE | PRIMARY | | VAR1 | VAR2 | VAR3 | VAR4 | VAR5 | VAR6 | VAR7 | VAR8 | VAR9 | VAR10 | VAR11 | VAR12 | VAR13 | VAR14 | VAR15 | VAR16 | VAR17 | VAR18 | VAR19 | VAR20 | VAR21 | VAR22 | VAR23 | VAR24 | VAR25 | VAR26 | VAR27 | VAR28 | VAR29 | VAR30 | VAR31 | VAR32 | VAR33 | VAR34 | VAR35 | VAR36 | VAR37 | VAR38 | VAR39 | VAR40 | VAR41 | VAR42 | VAR43 | VAR44 | VAR45 | VAR46 | VAR47 | VAR48 | VAR49 | VAR50 | VAR51 | VAR52 | VAR53 | VAR54 | VAR55 | VAR56 | VAR57 | VAR58 | VAR59 | VAR60 | VAR61 |%n"
@@ -168,7 +168,7 @@ public void test_Outputs_output() {
+ "| CREATION | test | |----------------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|--------------------|------------|-------------------------------|-------------------------------|-------------------------------|------------|------------|------------|------------|------------|-------------------------------------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|--------------------------------------|------------------|------------------|%n"
+ "| | | | At end point | 1 | 20 | 3 | 4 | 5 | 6 | true | false | true | 7 | 8 | 9 | 10 | 11 | 12 | 13.13 | 14.14 | 15.15 | 16.16 | 17.17 | 18.18 | 19.19 | 20.2 | 21.21 | 09:01:00.000000000 | 2007-12-23 | 2007-12-23T09:01:00.000000000 | 2007-12-23T09:01:00.000000000 | 2007-12-23T09:01:00.000000000 | ... | ... | ... | ... | ... | fr | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | ... | ... | ... | ... | ... | ... | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 30b443ae-c0c9-4790-9bec-ce1380808435 | null | null |%n"
+ "|----------|-------|---------|----------------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|--------------------|------------|-------------------------------|-------------------------------|-------------------------------|------------|------------|------------|------------|------------|-------------------------------------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|--------------------------------------|------------------|------------------|%n"));
- Assertions.assertThat(byteArrayOutputStream7.toString()).as("display8").isEqualTo(String.format("[Row at end point of Change at index 0 of Changes on test table of a data source]%n"
+ Assertions.assertThat(byteArrayOutputStream7.toString()).as("display8").isEqualTo(String.format("[Row at end point of Change at index 0 of Changes on test table of 'data source']%n"
+ "|---------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|--------------------|------------|-------------------------------|-------------------------------|-------------------------------|------------|------------|------------|------------|------------|-------------------------------------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|--------------------------------------|------------------|------------------|%n"
+ "| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |%n"
+ "| PRIMARY | VAR1 | VAR2 | VAR3 | VAR4 | VAR5 | VAR6 | VAR7 | VAR8 | VAR9 | VAR10 | VAR11 | VAR12 | VAR13 | VAR14 | VAR15 | VAR16 | VAR17 | VAR18 | VAR19 | VAR20 | VAR21 | VAR22 | VAR23 | VAR24 | VAR25 | VAR26 | VAR27 | VAR28 | VAR29 | VAR30 | VAR31 | VAR32 | VAR33 | VAR34 | VAR35 | VAR36 | VAR37 | VAR38 | VAR39 | VAR40 | VAR41 | VAR42 | VAR43 | VAR44 | VAR45 | VAR46 | VAR47 | VAR48 | VAR49 | VAR50 | VAR51 | VAR52 | VAR53 | VAR54 | VAR55 | VAR56 | VAR57 | VAR58 | VAR59 | VAR60 | VAR61 |%n"
@@ -177,14 +177,14 @@ public void test_Outputs_output() {
+ "|---------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|--------------------|------------|-------------------------------|-------------------------------|-------------------------------|------------|------------|------------|------------|------------|-------------------------------------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|--------------------------------------|------------------|------------------|%n"
+ "| | 1 | 20 | 3 | 4 | 5 | 6 | true | false | true | 7 | 8 | 9 | 10 | 11 | 12 | 13.13 | 14.14 | 15.15 | 16.16 | 17.17 | 18.18 | 19.19 | 20.2 | 21.21 | 09:01:00.000000000 | 2007-12-23 | 2007-12-23T09:01:00.000000000 | 2007-12-23T09:01:00.000000000 | 2007-12-23T09:01:00.000000000 | ... | ... | ... | ... | ... | fr | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | ... | ... | ... | ... | ... | ... | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 30b443ae-c0c9-4790-9bec-ce1380808435 | null | null |%n"
+ "|---------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|--------------------|------------|-------------------------------|-------------------------------|-------------------------------|------------|------------|------------|------------|------------|-------------------------------------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|--------------------------------------|------------------|------------------|%n"));
- Assertions.assertThat(byteArrayOutputStream8.toString()).as("display9").isEqualTo(String.format("[Value at index 0 (column name : VAR1) of Row at end point of Change at index 0 of Changes on test table of a data source]%n"
+ Assertions.assertThat(byteArrayOutputStream8.toString()).as("display9").isEqualTo(String.format("[Value at index 0 (column name : VAR1) of Row at end point of Change at index 0 of Changes on test table of 'data source']%n"
+ "|----------|%n"
+ "| VAR1 |%n"
+ "| (NUMBER) |%n"
+ "|----------|%n"
+ "| 1 |%n"
+ "|----------|%n"));
- Assertions.assertThat(byteArrayOutputStream9.toString()).as("display10").isEqualTo(String.format("[Column at index 0 (column name : VAR1) of Change at index 0 of Changes on test table of a data source]%n"
+ Assertions.assertThat(byteArrayOutputStream9.toString()).as("display10").isEqualTo(String.format("[Column at index 0 (column name : VAR1) of Change at index 0 of Changes on test table of 'data source']%n"
+ "|----------------|----------|%n"
+ "| | VAR1 |%n"
+ "| | (NUMBER) |%n"
@@ -193,14 +193,14 @@ public void test_Outputs_output() {
+ "|----------------|----------|%n"
+ "| At end point | 1 |%n"
+ "|----------------|----------|%n"));
- Assertions.assertThat(byteArrayOutputStream10.toString()).as("display11").isEqualTo(String.format("[Value at end point of Column at index 0 (column name : VAR1) of Change at index 0 of Changes on test table of a data source]%n"
+ Assertions.assertThat(byteArrayOutputStream10.toString()).as("display11").isEqualTo(String.format("[Value at end point of Column at index 0 (column name : VAR1) of Change at index 0 of Changes on test table of 'data source']%n"
+ "|----------|%n"
+ "| VAR1 |%n"
+ "| (NUMBER) |%n"
+ "|----------|%n"
+ "| 1 |%n"
+ "|----------|%n"));
- Assertions.assertThat(byteArrayOutputStream11.toString()).as("display12").isEqualTo(String.format("[Changes on TEST table of a data source]%n"
+ Assertions.assertThat(byteArrayOutputStream11.toString()).as("display12").isEqualTo(String.format("[Changes on TEST table of 'data source']%n"
+ "|-----------|--------------|-------|---------|----------------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|--------------------|------------|-------------------------------|-------------------------------|-------------------------------|------------|------------|------------|------------|------------|-------------------------------------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|--------------------------------------|------------------|------------------|%n"
+ "| | | | | | * | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |%n"
+ "| | TYPE | TABLE | PRIMARY | | VAR1 | VAR2 | VAR3 | VAR4 | VAR5 | VAR6 | VAR7 | VAR8 | VAR9 | VAR10 | VAR11 | VAR12 | VAR13 | VAR14 | VAR15 | VAR16 | VAR17 | VAR18 | VAR19 | VAR20 | VAR21 | VAR22 | VAR23 | VAR24 | VAR25 | VAR26 | VAR27 | VAR28 | VAR29 | VAR30 | VAR31 | VAR32 | VAR33 | VAR34 | VAR35 | VAR36 | VAR37 | VAR38 | VAR39 | VAR40 | VAR41 | VAR42 | VAR43 | VAR44 | VAR45 | VAR46 | VAR47 | VAR48 | VAR49 | VAR50 | VAR51 | VAR52 | VAR53 | VAR54 | VAR55 | VAR56 | VAR57 | VAR58 | VAR59 | VAR60 | VAR61 |%n"
@@ -211,7 +211,7 @@ public void test_Outputs_output() {
+ "| Index : 0 | MODIFICATION | TEST | 1 |----------------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|--------------------|------------|-------------------------------|-------------------------------|-------------------------------|------------|------------|------------|------------|------------|-------------------------------------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|--------------------------------------|------------------|------------------|%n"
+ "| | | | | At end point | 1 | 20 | 3 | 4 | 5 | 6 | true | false | true | 7 | 8 | 9 | 10 | 11 | 12 | 13.13 | 14.14 | 15.15 | 16.16 | 17.17 | 18.18 | 19.19 | 20.2 | 21.21 | 09:01:00.000000000 | 2007-12-23 | 2007-12-23T09:01:00.000000000 | 2007-12-23T09:01:00.000000000 | 2007-12-23T09:01:00.000000000 | ... | ... | ... | ... | ... | fr | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | ... | ... | ... | ... | ... | ... | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 30b443ae-c0c9-4790-9bec-ce1380808435 | null | null |%n"
+ "|-----------|--------------|-------|---------|----------------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|--------------------|------------|-------------------------------|-------------------------------|-------------------------------|------------|------------|------------|------------|------------|-------------------------------------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|--------------------------------------|------------------|------------------|%n"));
- Assertions.assertThat(byteArrayOutputStream12.toString()).as("display13").isEqualTo(String.format("[Change at index 0 (with primary key : [1]) of Changes on TEST table of a data source]%n"
+ Assertions.assertThat(byteArrayOutputStream12.toString()).as("display13").isEqualTo(String.format("[Change at index 0 (with primary key : [1]) of Changes on TEST table of 'data source']%n"
+ "|--------------|-------|---------|----------------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|--------------------|------------|-------------------------------|-------------------------------|-------------------------------|------------|------------|------------|------------|------------|-------------------------------------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|--------------------------------------|------------------|------------------|%n"
+ "| | | | | * | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |%n"
+ "| TYPE | TABLE | PRIMARY | | VAR1 | VAR2 | VAR3 | VAR4 | VAR5 | VAR6 | VAR7 | VAR8 | VAR9 | VAR10 | VAR11 | VAR12 | VAR13 | VAR14 | VAR15 | VAR16 | VAR17 | VAR18 | VAR19 | VAR20 | VAR21 | VAR22 | VAR23 | VAR24 | VAR25 | VAR26 | VAR27 | VAR28 | VAR29 | VAR30 | VAR31 | VAR32 | VAR33 | VAR34 | VAR35 | VAR36 | VAR37 | VAR38 | VAR39 | VAR40 | VAR41 | VAR42 | VAR43 | VAR44 | VAR45 | VAR46 | VAR47 | VAR48 | VAR49 | VAR50 | VAR51 | VAR52 | VAR53 | VAR54 | VAR55 | VAR56 | VAR57 | VAR58 | VAR59 | VAR60 | VAR61 |%n"
@@ -222,7 +222,7 @@ public void test_Outputs_output() {
+ "| MODIFICATION | TEST | 1 |----------------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|--------------------|------------|-------------------------------|-------------------------------|-------------------------------|------------|------------|------------|------------|------------|-------------------------------------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|--------------------------------------|------------------|------------------|%n"
+ "| | | | At end point | 1 | 20 | 3 | 4 | 5 | 6 | true | false | true | 7 | 8 | 9 | 10 | 11 | 12 | 13.13 | 14.14 | 15.15 | 16.16 | 17.17 | 18.18 | 19.19 | 20.2 | 21.21 | 09:01:00.000000000 | 2007-12-23 | 2007-12-23T09:01:00.000000000 | 2007-12-23T09:01:00.000000000 | 2007-12-23T09:01:00.000000000 | ... | ... | ... | ... | ... | fr | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | ... | ... | ... | ... | ... | ... | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 30b443ae-c0c9-4790-9bec-ce1380808435 | null | null |%n"
+ "|--------------|-------|---------|----------------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|--------------------|------------|-------------------------------|-------------------------------|-------------------------------|------------|------------|------------|------------|------------|-------------------------------------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|--------------------------------------|------------------|------------------|%n"));
- Assertions.assertThat(byteArrayOutputStream13.toString()).as("display14").isEqualTo(String.format("[Row at end point of Change at index 0 (with primary key : [1]) of Changes on TEST table of a data source]%n"
+ Assertions.assertThat(byteArrayOutputStream13.toString()).as("display14").isEqualTo(String.format("[Row at end point of Change at index 0 (with primary key : [1]) of Changes on TEST table of 'data source']%n"
+ "|---------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|--------------------|------------|-------------------------------|-------------------------------|-------------------------------|------------|------------|------------|------------|------------|-------------------------------------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|--------------------------------------|------------------|------------------|%n"
+ "| | * | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |%n"
+ "| PRIMARY | VAR1 | VAR2 | VAR3 | VAR4 | VAR5 | VAR6 | VAR7 | VAR8 | VAR9 | VAR10 | VAR11 | VAR12 | VAR13 | VAR14 | VAR15 | VAR16 | VAR17 | VAR18 | VAR19 | VAR20 | VAR21 | VAR22 | VAR23 | VAR24 | VAR25 | VAR26 | VAR27 | VAR28 | VAR29 | VAR30 | VAR31 | VAR32 | VAR33 | VAR34 | VAR35 | VAR36 | VAR37 | VAR38 | VAR39 | VAR40 | VAR41 | VAR42 | VAR43 | VAR44 | VAR45 | VAR46 | VAR47 | VAR48 | VAR49 | VAR50 | VAR51 | VAR52 | VAR53 | VAR54 | VAR55 | VAR56 | VAR57 | VAR58 | VAR59 | VAR60 | VAR61 |%n"
@@ -231,14 +231,14 @@ public void test_Outputs_output() {
+ "|---------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|--------------------|------------|-------------------------------|-------------------------------|-------------------------------|------------|------------|------------|------------|------------|-------------------------------------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|--------------------------------------|------------------|------------------|%n"
+ "| 1 | 1 | 20 | 3 | 4 | 5 | 6 | true | false | true | 7 | 8 | 9 | 10 | 11 | 12 | 13.13 | 14.14 | 15.15 | 16.16 | 17.17 | 18.18 | 19.19 | 20.2 | 21.21 | 09:01:00.000000000 | 2007-12-23 | 2007-12-23T09:01:00.000000000 | 2007-12-23T09:01:00.000000000 | 2007-12-23T09:01:00.000000000 | ... | ... | ... | ... | ... | fr | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | ... | ... | ... | ... | ... | ... | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 30b443ae-c0c9-4790-9bec-ce1380808435 | null | null |%n"
+ "|---------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|--------------------|------------|-------------------------------|-------------------------------|-------------------------------|------------|------------|------------|------------|------------|-------------------------------------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|--------------------------------------|------------------|------------------|%n"));
- Assertions.assertThat(byteArrayOutputStream14.toString()).as("display15").isEqualTo(String.format("[Value at index 0 (column name : VAR1) of Row at end point of Change at index 0 (with primary key : [1]) of Changes on TEST table of a data source]%n"
+ Assertions.assertThat(byteArrayOutputStream14.toString()).as("display15").isEqualTo(String.format("[Value at index 0 (column name : VAR1) of Row at end point of Change at index 0 (with primary key : [1]) of Changes on TEST table of 'data source']%n"
+ "|----------|%n"
+ "| VAR1 |%n"
+ "| (NUMBER) |%n"
+ "|----------|%n"
+ "| 1 |%n"
+ "|----------|%n"));
- Assertions.assertThat(byteArrayOutputStream15.toString()).as("display16").isEqualTo(String.format("[Column at index 0 (column name : VAR1) of Change at index 0 (with primary key : [1]) of Changes on TEST table of a data source]%n"
+ Assertions.assertThat(byteArrayOutputStream15.toString()).as("display16").isEqualTo(String.format("[Column at index 0 (column name : VAR1) of Change at index 0 (with primary key : [1]) of Changes on TEST table of 'data source']%n"
+ "|----------------|----------|%n"
+ "| | VAR1 |%n"
+ "| | (NUMBER) |%n"
@@ -247,7 +247,7 @@ public void test_Outputs_output() {
+ "|----------------|----------|%n"
+ "| At end point | 1 |%n"
+ "|----------------|----------|%n"));
- Assertions.assertThat(byteArrayOutputStream16.toString()).as("display17").isEqualTo(String.format("[Value at end point of Column at index 0 (column name : VAR1) of Change at index 0 (with primary key : [1]) of Changes on TEST table of a data source]%n"
+ Assertions.assertThat(byteArrayOutputStream16.toString()).as("display17").isEqualTo(String.format("[Value at end point of Column at index 0 (column name : VAR1) of Change at index 0 (with primary key : [1]) of Changes on TEST table of 'data source']%n"
+ "|----------|%n"
+ "| VAR1 |%n"
+ "| (NUMBER) |%n"
@@ -259,9 +259,9 @@ public void test_Outputs_output() {
@Test
@NeedReload
public void should_fail_because_primary_key_is_different() {
- Table table = new Table(dataSource, "test");
+ Table table = new Table(connectionProvider, "test");
Changes changes = new Changes(table).setStartPointNow();
- Changes changes2 = new Changes(dataSource).setStartPointNow();
+ Changes changes2 = new Changes(connectionProvider).setStartPointNow();
update();
changes.setEndPointNow();
changes2.setEndPointNow();
@@ -270,7 +270,7 @@ public void should_fail_because_primary_key_is_different() {
assertThat(changes).change().hasPksNames("var1");
fail("An exception must be raised");
} catch (AssertionError e) {
- Assertions.assertThat(e.getMessage()).as("message1").isEqualTo(String.format("[Change at index 0 of Changes on test table of a data source] %n"
+ Assertions.assertThat(e.getMessage()).as("message1").isEqualTo(String.format("[Change at index 0 of Changes on test table of 'data source'] %n"
+ "Expecting :%n"
+ " [\"var1\"]%n"
+ "to be the name of the columns of the primary keys but was:%n"
@@ -281,7 +281,7 @@ public void should_fail_because_primary_key_is_different() {
assertThat(changes2).change().hasPksNames("var1");
fail("An exception must be raised");
} catch (AssertionError e) {
- Assertions.assertThat(e.getMessage()).as("message2").isEqualTo(String.format("[Change at index 0 (with primary key : [1]) of Changes on TEST table of a data source] %n"
+ Assertions.assertThat(e.getMessage()).as("message2").isEqualTo(String.format("[Change at index 0 (with primary key : [1]) of Changes on TEST table of 'data source'] %n"
+ "Expecting :%n"
+ " [\"var1\"]%n"
+ "to be the name of the columns of the primary keys but was:%n"
@@ -292,9 +292,9 @@ public void should_fail_because_primary_key_is_different() {
@Test
@NeedReload
public void should_fail_because_column_name_is_different() {
- Table table = new Table(dataSource, "test");
+ Table table = new Table(connectionProvider, "test");
Changes changes = new Changes(table).setStartPointNow();
- Changes changes2 = new Changes(dataSource).setStartPointNow();
+ Changes changes2 = new Changes(connectionProvider).setStartPointNow();
update();
changes.setEndPointNow();
changes2.setEndPointNow();
@@ -324,7 +324,7 @@ public void should_fail_because_column_name_is_different() {
assertThat(changes).change().column().hasColumnName("Var1");
fail("An exception must be raised");
} catch (AssertionError e) {
- Assertions.assertThat(e.getMessage()).as("message3").isEqualTo(String.format("[Column at index 0 (column name : VAR1) of Change at index 0 of Changes on test table of a data source] %n"
+ Assertions.assertThat(e.getMessage()).as("message3").isEqualTo(String.format("[Column at index 0 (column name : VAR1) of Change at index 0 of Changes on test table of 'data source'] %n"
+ "Expecting :%n"
+ " \"Var1\"%n"
+ "to be the name of the column but was:%n"
@@ -334,7 +334,7 @@ public void should_fail_because_column_name_is_different() {
assertThat(changes).change().rowAtEndPoint().value().hasColumnName("Var1");
fail("An exception must be raised");
} catch (AssertionError e) {
- Assertions.assertThat(e.getMessage()).as("message4").isEqualTo(String.format("[Value at index 0 (column name : VAR1) of Row at end point of Change at index 0 of Changes on test table of a data source] %n"
+ Assertions.assertThat(e.getMessage()).as("message4").isEqualTo(String.format("[Value at index 0 (column name : VAR1) of Row at end point of Change at index 0 of Changes on test table of 'data source'] %n"
+ "Expecting :%n"
+ " \"Var1\"%n"
+ "to be the name of the column but was:%n"
@@ -345,7 +345,7 @@ public void should_fail_because_column_name_is_different() {
assertThat(changes2).change().column().hasColumnName("Var1");
fail("An exception must be raised");
} catch (AssertionError e) {
- Assertions.assertThat(e.getMessage()).as("message5").isEqualTo(String.format("[Column at index 0 (column name : VAR1) of Change at index 0 (with primary key : [1]) of Changes on TEST table of a data source] %n"
+ Assertions.assertThat(e.getMessage()).as("message5").isEqualTo(String.format("[Column at index 0 (column name : VAR1) of Change at index 0 (with primary key : [1]) of Changes on TEST table of 'data source'] %n"
+ "Expecting :%n"
+ " \"Var1\"%n"
+ "to be the name of the column but was:%n"
@@ -355,7 +355,7 @@ public void should_fail_because_column_name_is_different() {
assertThat(changes2).change().rowAtEndPoint().value().hasColumnName("Var1");
fail("An exception must be raised");
} catch (AssertionError e) {
- Assertions.assertThat(e.getMessage()).as("message6").isEqualTo(String.format("[Value at index 0 (column name : VAR1) of Row at end point of Change at index 0 (with primary key : [1]) of Changes on TEST table of a data source] %n"
+ Assertions.assertThat(e.getMessage()).as("message6").isEqualTo(String.format("[Value at index 0 (column name : VAR1) of Row at end point of Change at index 0 (with primary key : [1]) of Changes on TEST table of 'data source'] %n"
+ "Expecting :%n"
+ " \"Var1\"%n"
+ "to be the name of the column but was:%n"
@@ -366,9 +366,9 @@ public void should_fail_because_column_name_is_different() {
@Test
@NeedReload
public void should_fail_because_column_name_is_wrong_to_navigate() {
- Table table = new Table(dataSource, "test");
+ Table table = new Table(connectionProvider, "test");
Changes changes = new Changes(table).setStartPointNow();
- Changes changes2 = new Changes(dataSource).setStartPointNow();
+ Changes changes2 = new Changes(connectionProvider).setStartPointNow();
update();
changes.setEndPointNow();
changes2.setEndPointNow();
@@ -428,9 +428,9 @@ public void should_fail_because_column_name_is_wrong_to_navigate() {
@Test
@NeedReload
public void should_fail_because_table_name_is_different() {
- Table table = new Table(dataSource, "test");
+ Table table = new Table(connectionProvider, "test");
Changes changes = new Changes(table).setStartPointNow();
- Changes changes2 = new Changes(dataSource).setStartPointNow();
+ Changes changes2 = new Changes(connectionProvider).setStartPointNow();
update();
changes.setEndPointNow();
changes2.setEndPointNow();
@@ -439,7 +439,7 @@ public void should_fail_because_table_name_is_different() {
assertThat(changes).change().isOnTable("teSt");
fail("An exception must be raised");
} catch (AssertionError e) {
- Assertions.assertThat(e.getMessage()).as("message1").isEqualTo(String.format("[Change at index 0 of Changes on test table of a data source] %n"
+ Assertions.assertThat(e.getMessage()).as("message1").isEqualTo(String.format("[Change at index 0 of Changes on test table of 'data source'] %n"
+ "Expecting to be on the table:%n"
+ " <\"teSt\">%n"
+ "but was on the table:%n"
@@ -449,7 +449,7 @@ public void should_fail_because_table_name_is_different() {
assertThat(changes2).change().isOnTable("teSt");
fail("An exception must be raised");
} catch (AssertionError e) {
- Assertions.assertThat(e.getMessage()).as("message2").isEqualTo(String.format("[Change at index 0 (with primary key : [1]) of Changes on TEST table of a data source] %n"
+ Assertions.assertThat(e.getMessage()).as("message2").isEqualTo(String.format("[Change at index 0 (with primary key : [1]) of Changes on TEST table of 'data source'] %n"
+ "Expecting to be on the table:%n"
+ " <\"teSt\">%n"
+ "but was on the table:%n"
@@ -460,9 +460,9 @@ public void should_fail_because_table_name_is_different() {
@Test
@NeedReload
public void should_fail_because_table_name_is_wrong_to_navigate() {
- Table table = new Table(dataSource, "test");
+ Table table = new Table(connectionProvider, "test");
Changes changes = new Changes(table).setStartPointNow();
- Changes changes2 = new Changes(dataSource).setStartPointNow();
+ Changes changes2 = new Changes(connectionProvider).setStartPointNow();
update();
changes.setEndPointNow();
changes2.setEndPointNow();
@@ -509,9 +509,9 @@ public void should_fail_because_table_name_is_wrong_to_navigate() {
@Test
@NeedReload
public void test_ColumnName_hasColumnName() {
- Table table = new Table(dataSource, "test");
+ Table table = new Table(connectionProvider, "test");
Changes changes = new Changes(table).setStartPointNow();
- Changes changes2 = new Changes(dataSource).setStartPointNow();
+ Changes changes2 = new Changes(connectionProvider).setStartPointNow();
update();
changes.setEndPointNow();
changes2.setEndPointNow();
@@ -525,9 +525,9 @@ public void test_ColumnName_hasColumnName() {
@Test
@NeedReload
public void test_ColumnClass_isOfClass() {
- Table table = new Table(dataSource, "test");
+ Table table = new Table(connectionProvider, "test");
Changes changes = new Changes(table).setStartPointNow();
- Changes changes2 = new Changes(dataSource).setStartPointNow();
+ Changes changes2 = new Changes(connectionProvider).setStartPointNow();
update();
changes.setEndPointNow();
changes2.setEndPointNow();
@@ -541,11 +541,9 @@ public void test_ColumnClass_isOfClass() {
@Test
@NeedReload
public void test_getTableLetterCase() {
- DataSourceWithLetterCase datasourceWithLetterCase = (DataSourceWithLetterCase) dataSource;
+ Table table = new Table(connectionProvider, "test");
- Table table = new Table(dataSource, "test");
-
- Request request = new Request(dataSource, "select * from test");
+ Request request = new Request(connectionProvider, "select * from test");
Changes changes = new Changes(table).setStartPointNow();
update();
@@ -553,7 +551,7 @@ public void test_getTableLetterCase() {
Change change = changes.getChangesList().get(0);
- Assertions.assertThat(datasourceWithLetterCase.getTableLetterCase().getConversionName()).isSameAs(CaseConversions.NO.getConversionName());
+ Assertions.assertThat(connectionProvider.getTableLetterCase().getConversionName()).isSameAs(CaseConversions.NO.getConversionName());
Assertions.assertThat(table.getTableLetterCase().getConversionName()).isSameAs(CaseConversions.NO.getConversionName());
@@ -563,7 +561,7 @@ public void test_getTableLetterCase() {
Assertions.assertThat(change.getTableLetterCase().getConversionName()).isSameAs(CaseConversions.NO.getConversionName());
- Assertions.assertThat(datasourceWithLetterCase.getTableLetterCase().getComparisonName()).isSameAs(CaseComparisons.STRICT.getComparisonName());
+ Assertions.assertThat(connectionProvider.getTableLetterCase().getComparisonName()).isSameAs(CaseComparisons.STRICT.getComparisonName());
Assertions.assertThat(table.getTableLetterCase().getComparisonName()).isSameAs(CaseComparisons.STRICT.getComparisonName());
@@ -576,15 +574,13 @@ public void test_getTableLetterCase() {
@Test
@NeedReload
public void test_getColumnLetterCase() {
- DataSourceWithLetterCase datasourceWithLetterCase = (DataSourceWithLetterCase) dataSource;
-
- Table table = new Table(dataSource, "test");
+ Table table = new Table(connectionProvider, "test");
Row tableRow = table.getRow(0);
Column tableColumn = table.getColumn(0);
Value tableRowValue = tableRow.getColumnValue(0);
Value tableColumnValue = tableColumn.getRowValue(0);
- Request request = new Request(dataSource, "select * from test");
+ Request request = new Request(connectionProvider, "select * from test");
Row requestRow = request.getRow(0);
Column requestColumn = request.getColumn(0);
Value requestRowValue = requestRow.getColumnValue(0);
@@ -600,7 +596,7 @@ public void test_getColumnLetterCase() {
Value valueAtEndPoint = rowAtEndPoint.getColumnValue(0);
- Assertions.assertThat(datasourceWithLetterCase.getColumnLetterCase().getConversionName()).isSameAs(CaseConversions.NO.getConversionName());
+ Assertions.assertThat(connectionProvider.getColumnLetterCase().getConversionName()).isSameAs(CaseConversions.NO.getConversionName());
Assertions.assertThat(table.getColumnLetterCase().getConversionName()).isSameAs(CaseConversions.NO.getConversionName());
Assertions.assertThat(tableRow.getColumnLetterCase().getConversionName()).isSameAs(CaseConversions.NO.getConversionName());
@@ -622,7 +618,7 @@ public void test_getColumnLetterCase() {
Assertions.assertThat(valueAtEndPoint.getColumnLetterCase().getConversionName()).isSameAs(CaseConversions.NO.getConversionName());
- Assertions.assertThat(datasourceWithLetterCase.getColumnLetterCase().getComparisonName()).isSameAs(CaseComparisons.STRICT.getComparisonName());
+ Assertions.assertThat(connectionProvider.getColumnLetterCase().getComparisonName()).isSameAs(CaseComparisons.STRICT.getComparisonName());
Assertions.assertThat(table.getColumnLetterCase().getComparisonName()).isSameAs(CaseComparisons.STRICT.getComparisonName());
Assertions.assertThat(tableRow.getColumnLetterCase().getComparisonName()).isSameAs(CaseComparisons.STRICT.getComparisonName());
@@ -647,12 +643,10 @@ public void test_getColumnLetterCase() {
@Test
@NeedReload
public void test_getPrimaryKeyLetterCase() {
- DataSourceWithLetterCase datasourceWithLetterCase = (DataSourceWithLetterCase) dataSource;
-
- Table table = new Table(dataSource, "test");
+ Table table = new Table(connectionProvider, "test");
Row tableRow = table.getRow(0);
- Request request = new Request(dataSource, "select * from test");
+ Request request = new Request(connectionProvider, "select * from test");
Row requestRow = request.getRow(0);
Changes changes = new Changes(table).setStartPointNow();
@@ -663,7 +657,7 @@ public void test_getPrimaryKeyLetterCase() {
Row rowAtEndPoint = change.getRowAtEndPoint();
- Assertions.assertThat(datasourceWithLetterCase.getPrimaryKeyLetterCase().getConversionName()).isSameAs(CaseConversions.NO.getConversionName());
+ Assertions.assertThat(connectionProvider.getPrimaryKeyLetterCase().getConversionName()).isSameAs(CaseConversions.NO.getConversionName());
Assertions.assertThat(table.getPrimaryKeyLetterCase().getConversionName()).isSameAs(CaseConversions.NO.getConversionName());
Assertions.assertThat(tableRow.getPrimaryKeyLetterCase().getConversionName()).isSameAs(CaseConversions.NO.getConversionName());
@@ -677,7 +671,7 @@ public void test_getPrimaryKeyLetterCase() {
Assertions.assertThat(rowAtEndPoint.getPrimaryKeyLetterCase().getConversionName()).isSameAs(CaseConversions.NO.getConversionName());
- Assertions.assertThat(datasourceWithLetterCase.getPrimaryKeyLetterCase().getComparisonName()).isSameAs(CaseComparisons.STRICT.getComparisonName());
+ Assertions.assertThat(connectionProvider.getPrimaryKeyLetterCase().getComparisonName()).isSameAs(CaseComparisons.STRICT.getComparisonName());
Assertions.assertThat(table.getPrimaryKeyLetterCase().getComparisonName()).isSameAs(CaseComparisons.STRICT.getComparisonName());
Assertions.assertThat(tableRow.getPrimaryKeyLetterCase().getComparisonName()).isSameAs(CaseComparisons.STRICT.getComparisonName());
diff --git a/src/test/java/org/assertj/db/database/h2/H2Database_DataSource_UIUIUI_Test.java b/src/test/java/org/assertj/db/database/h2/H2Database_DataSource_UIUIUI_Test.java
index cbfb1c6d..a8e06c17 100644
--- a/src/test/java/org/assertj/db/database/h2/H2Database_DataSource_UIUIUI_Test.java
+++ b/src/test/java/org/assertj/db/database/h2/H2Database_DataSource_UIUIUI_Test.java
@@ -21,14 +21,13 @@
import java.sql.Timestamp;
import java.util.Locale;
import java.util.UUID;
-import javax.sql.DataSource;
import org.assertj.core.api.Assertions;
import org.assertj.db.common.NeedReload;
import org.assertj.db.type.Change;
import org.assertj.db.type.Changes;
import org.assertj.db.type.Column;
-import org.assertj.db.type.DataSourceWithLetterCase;
+import org.assertj.db.type.ConnectionProvider;
import org.assertj.db.type.DateTimeValue;
import org.assertj.db.type.DateValue;
import org.assertj.db.type.Request;
@@ -46,20 +45,21 @@
* Test on the H2 database.
*
* @author Régis Pouiller
+ * @author Julien Roy
*/
public class H2Database_DataSource_UIUIUI_Test extends AbstractH2Test {
- private DataSource dataSource;
+ private ConnectionProvider connectionProvider;
@Before
public void init() {
- dataSource = dataSourceUIUIUI;
+ connectionProvider = dsConnectionUIUIUI;
}
@Test
@NeedReload
public void test_PrimaryKey_hasPksNames() {
- Table table = new Table(dataSource, "test");
+ Table table = new Table(connectionProvider, "test");
Changes changes = new Changes(table).setStartPointNow();
update();
changes.setEndPointNow();
@@ -71,7 +71,7 @@ public void test_PrimaryKey_hasPksNames() {
@Test
@NeedReload
public void test_ColumnName_hasColumnName() {
- Table table = new Table(dataSource, "test");
+ Table table = new Table(connectionProvider, "test");
Changes changes = new Changes(table).setStartPointNow();
update();
changes.setEndPointNow();
@@ -208,7 +208,7 @@ public void test_ColumnName_hasColumnName() {
@Test
@NeedReload
public void test_ColumnClass_isOfClass() {
- Table table = new Table(dataSource, "test");
+ Table table = new Table(connectionProvider, "test");
Changes changes = new Changes(table).setStartPointNow();
update();
changes.setEndPointNow();
@@ -345,7 +345,7 @@ public void test_ColumnClass_isOfClass() {
@Test
@NeedReload
public void test_ColumnEquality_hasValues() {
- Table table = new Table(dataSource, "test");
+ Table table = new Table(connectionProvider, "test");
Changes changes = new Changes(table).setStartPointNow();
update();
changes.setEndPointNow();
@@ -481,7 +481,7 @@ public void test_ColumnEquality_hasValues() {
@Test
@NeedReload
public void test_ColumnEquality_containsValues() {
- Table table = new Table(dataSource, "test");
+ Table table = new Table(connectionProvider, "test");
Changes changes = new Changes(table).setStartPointNow();
update();
changes.setEndPointNow();
@@ -553,7 +553,7 @@ public void test_ColumnEquality_containsValues() {
@Test
@NeedReload
public void test_ColumnType_isOfType() {
- Table table = new Table(dataSource, "test");
+ Table table = new Table(connectionProvider, "test");
Changes changes = new Changes(table).setStartPointNow();
update();
changes.setEndPointNow();
@@ -689,7 +689,7 @@ public void test_ColumnType_isOfType() {
@Test
@NeedReload
public void test_ColumnOfChangeEquality_hasValues() {
- Table table = new Table(dataSource, "test");
+ Table table = new Table(connectionProvider, "test");
Changes changes = new Changes(table).setStartPointNow();
update();
changes.setEndPointNow();
@@ -841,7 +841,7 @@ public void test_ColumnOfChangeEquality_hasValues() {
@Test
@NeedReload
public void test_RowEquality_hasValues() {
- Table table = new Table(dataSource, "test");
+ Table table = new Table(connectionProvider, "test");
Changes changes = new Changes(table).setStartPointNow();
update();
changes.setEndPointNow();
@@ -978,7 +978,7 @@ public void test_RowEquality_hasValues() {
@Test
@NeedReload
public void test_ValueClass_isOfClass() {
- Table table = new Table(dataSource, "test");
+ Table table = new Table(connectionProvider, "test");
Changes changes = new Changes(table).setStartPointNow();
update();
changes.setEndPointNow();
@@ -1115,7 +1115,7 @@ public void test_ValueClass_isOfClass() {
@Test
@NeedReload
public void test_ValueEquality_isEqualTo() {
- Table table = new Table(dataSource, "test");
+ Table table = new Table(connectionProvider, "test");
Changes changes = new Changes(table).setStartPointNow();
update();
changes.setEndPointNow();
@@ -1252,7 +1252,7 @@ public void test_ValueEquality_isEqualTo() {
@Test
@NeedReload
public void test_ValueNonEquality_isNotEqualTo() {
- Table table = new Table(dataSource, "test");
+ Table table = new Table(connectionProvider, "test");
Changes changes = new Changes(table).setStartPointNow();
update();
changes.setEndPointNow();
@@ -1389,7 +1389,7 @@ public void test_ValueNonEquality_isNotEqualTo() {
@Test
@NeedReload
public void test_ValueType_isOfType() {
- Table table = new Table(dataSource, "test");
+ Table table = new Table(connectionProvider, "test");
Changes changes = new Changes(table).setStartPointNow();
update();
changes.setEndPointNow();
@@ -1526,11 +1526,9 @@ public void test_ValueType_isOfType() {
@Test
@NeedReload
public void test_getTableLetterCase() {
- DataSourceWithLetterCase datasourceWithLetterCase = (DataSourceWithLetterCase) dataSource;
+ Table table = new Table(connectionProvider, "test");
- Table table = new Table(dataSource, "test");
-
- Request request = new Request(dataSource, "select * from test");
+ Request request = new Request(connectionProvider, "select * from test");
Changes changes = new Changes(table).setStartPointNow();
update();
@@ -1538,7 +1536,7 @@ public void test_getTableLetterCase() {
Change change = changes.getChangesList().get(0);
- Assertions.assertThat(datasourceWithLetterCase.getTableLetterCase().getConversionName()).isSameAs(CaseConversions.UPPER.getConversionName());
+ Assertions.assertThat(connectionProvider.getTableLetterCase().getConversionName()).isSameAs(CaseConversions.UPPER.getConversionName());
Assertions.assertThat(table.getTableLetterCase().getConversionName()).isSameAs(CaseConversions.UPPER.getConversionName());
@@ -1548,7 +1546,7 @@ public void test_getTableLetterCase() {
Assertions.assertThat(change.getTableLetterCase().getConversionName()).isSameAs(CaseConversions.UPPER.getConversionName());
- Assertions.assertThat(datasourceWithLetterCase.getTableLetterCase().getComparisonName()).isSameAs(CaseComparisons.IGNORE.getComparisonName());
+ Assertions.assertThat(connectionProvider.getTableLetterCase().getComparisonName()).isSameAs(CaseComparisons.IGNORE.getComparisonName());
Assertions.assertThat(table.getTableLetterCase().getComparisonName()).isSameAs(CaseComparisons.IGNORE.getComparisonName());
@@ -1561,15 +1559,13 @@ public void test_getTableLetterCase() {
@Test
@NeedReload
public void test_getColumnLetterCase() {
- DataSourceWithLetterCase datasourceWithLetterCase = (DataSourceWithLetterCase) dataSource;
-
- Table table = new Table(dataSource, "test");
+ Table table = new Table(connectionProvider, "test");
Row tableRow = table.getRow(0);
Column tableColumn = table.getColumn(0);
Value tableRowValue = tableRow.getColumnValue(0);
Value tableColumnValue = tableColumn.getRowValue(0);
- Request request = new Request(dataSource, "select * from test");
+ Request request = new Request(connectionProvider, "select * from test");
Row requestRow = request.getRow(0);
Column requestColumn = request.getColumn(0);
Value requestRowValue = requestRow.getColumnValue(0);
@@ -1585,7 +1581,7 @@ public void test_getColumnLetterCase() {
Value valueAtEndPoint = rowAtEndPoint.getColumnValue(0);
- Assertions.assertThat(datasourceWithLetterCase.getColumnLetterCase().getConversionName()).isSameAs(CaseConversions.UPPER.getConversionName());
+ Assertions.assertThat(connectionProvider.getColumnLetterCase().getConversionName()).isSameAs(CaseConversions.UPPER.getConversionName());
Assertions.assertThat(table.getColumnLetterCase().getConversionName()).isSameAs(CaseConversions.UPPER.getConversionName());
Assertions.assertThat(tableRow.getColumnLetterCase().getConversionName()).isSameAs(CaseConversions.UPPER.getConversionName());
@@ -1607,7 +1603,7 @@ public void test_getColumnLetterCase() {
Assertions.assertThat(valueAtEndPoint.getColumnLetterCase().getConversionName()).isSameAs(CaseConversions.UPPER.getConversionName());
- Assertions.assertThat(datasourceWithLetterCase.getColumnLetterCase().getComparisonName()).isSameAs(CaseComparisons.IGNORE.getComparisonName());
+ Assertions.assertThat(connectionProvider.getColumnLetterCase().getComparisonName()).isSameAs(CaseComparisons.IGNORE.getComparisonName());
Assertions.assertThat(table.getColumnLetterCase().getComparisonName()).isSameAs(CaseComparisons.IGNORE.getComparisonName());
Assertions.assertThat(tableRow.getColumnLetterCase().getComparisonName()).isSameAs(CaseComparisons.IGNORE.getComparisonName());
@@ -1632,12 +1628,10 @@ public void test_getColumnLetterCase() {
@Test
@NeedReload
public void test_getPrimaryKeyLetterCase() {
- DataSourceWithLetterCase datasourceWithLetterCase = (DataSourceWithLetterCase) dataSource;
-
- Table table = new Table(dataSource, "test");
+ Table table = new Table(connectionProvider, "test");
Row tableRow = table.getRow(0);
- Request request = new Request(dataSource, "select * from test");
+ Request request = new Request(connectionProvider, "select * from test");
Row requestRow = request.getRow(0);
Changes changes = new Changes(table).setStartPointNow();
@@ -1648,7 +1642,7 @@ public void test_getPrimaryKeyLetterCase() {
Row rowAtEndPoint = change.getRowAtEndPoint();
- Assertions.assertThat(datasourceWithLetterCase.getPrimaryKeyLetterCase().getConversionName()).isSameAs(CaseConversions.UPPER.getConversionName());
+ Assertions.assertThat(connectionProvider.getPrimaryKeyLetterCase().getConversionName()).isSameAs(CaseConversions.UPPER.getConversionName());
Assertions.assertThat(table.getPrimaryKeyLetterCase().getConversionName()).isSameAs(CaseConversions.UPPER.getConversionName());
Assertions.assertThat(tableRow.getPrimaryKeyLetterCase().getConversionName()).isSameAs(CaseConversions.UPPER.getConversionName());
@@ -1662,7 +1656,7 @@ public void test_getPrimaryKeyLetterCase() {
Assertions.assertThat(rowAtEndPoint.getPrimaryKeyLetterCase().getConversionName()).isSameAs(CaseConversions.UPPER.getConversionName());
- Assertions.assertThat(datasourceWithLetterCase.getPrimaryKeyLetterCase().getComparisonName()).isSameAs(CaseComparisons.IGNORE.getComparisonName());
+ Assertions.assertThat(connectionProvider.getPrimaryKeyLetterCase().getComparisonName()).isSameAs(CaseComparisons.IGNORE.getComparisonName());
Assertions.assertThat(table.getPrimaryKeyLetterCase().getComparisonName()).isSameAs(CaseComparisons.IGNORE.getComparisonName());
Assertions.assertThat(tableRow.getPrimaryKeyLetterCase().getComparisonName()).isSameAs(CaseComparisons.IGNORE.getComparisonName());
diff --git a/src/test/java/org/assertj/db/database/h2/H2Database_Source_NSNSNS_Test.java b/src/test/java/org/assertj/db/database/h2/H2Database_JdbcUrl_NSNSNS_Test.java
similarity index 97%
rename from src/test/java/org/assertj/db/database/h2/H2Database_Source_NSNSNS_Test.java
rename to src/test/java/org/assertj/db/database/h2/H2Database_JdbcUrl_NSNSNS_Test.java
index ade7a6d8..6e32fe7c 100644
--- a/src/test/java/org/assertj/db/database/h2/H2Database_Source_NSNSNS_Test.java
+++ b/src/test/java/org/assertj/db/database/h2/H2Database_JdbcUrl_NSNSNS_Test.java
@@ -26,10 +26,9 @@
import org.assertj.db.type.ChangeType;
import org.assertj.db.type.Changes;
import org.assertj.db.type.Column;
+import org.assertj.db.type.ConnectionProvider;
import org.assertj.db.type.Request;
import org.assertj.db.type.Row;
-import org.assertj.db.type.Source;
-import org.assertj.db.type.SourceWithLetterCase;
import org.assertj.db.type.Table;
import org.assertj.db.type.Value;
import org.assertj.db.type.lettercase.CaseComparisons;
@@ -41,21 +40,22 @@
* Test on the H2 database.
*
* @author Régis Pouiller
+ * @author Julien Roy
*/
-public class H2Database_Source_NSNSNS_Test extends AbstractH2Test {
+public class H2Database_JdbcUrl_NSNSNS_Test extends AbstractH2Test {
- private Source source;
+ private ConnectionProvider connectionProvider;
@Before
public void init() {
- source = sourceNSNSNS;
+ connectionProvider = jdbcConnectionNSNSNS;
}
@NeedReload
public void test_Outputs_output() {
- Table table = new Table(source, "test");
+ Table table = new Table(connectionProvider, "test");
Changes changes = new Changes(table).setStartPointNow();
- Changes changes2 = new Changes(source).setStartPointNow();
+ Changes changes2 = new Changes(connectionProvider).setStartPointNow();
update();
changes.setEndPointNow();
changes2.setEndPointNow();
@@ -134,7 +134,7 @@ public void test_Outputs_output() {
+ "|----------|%n"
+ "| 1 |%n"
+ "|----------|%n"));
- Assertions.assertThat(byteArrayOutputStream5.toString()).isEqualTo(String.format("[Changes on TEST table of a data source]%n"
+ Assertions.assertThat(byteArrayOutputStream5.toString()).isEqualTo(String.format("[Changes on TEST table of 'data source']%n"
+ "|-----------|----------|-------|---------|----------------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|--------------------|------------|-------------------------------|-------------------------------|-------------------------------|------------|------------|------------|------------|------------|-------------------------------------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|--------------------------------------|------------------|------------------|%n"
+ "| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |%n"
+ "| | TYPE | TABLE | PRIMARY | | VAR1 | VAR2 | VAR3 | VAR4 | VAR5 | VAR6 | VAR7 | VAR8 | VAR9 | VAR10 | VAR11 | VAR12 | VAR13 | VAR14 | VAR15 | VAR16 | VAR17 | VAR18 | VAR19 | VAR20 | VAR21 | VAR22 | VAR23 | VAR24 | VAR25 | VAR26 | VAR27 | VAR28 | VAR29 | VAR30 | VAR31 | VAR32 | VAR33 | VAR34 | VAR35 | VAR36 | VAR37 | VAR38 | VAR39 | VAR40 | VAR41 | VAR42 | VAR43 | VAR44 | VAR45 | VAR46 | VAR47 | VAR48 | VAR49 | VAR50 | VAR51 | VAR52 | VAR53 | VAR54 | VAR55 | VAR56 | VAR57 | VAR58 | VAR59 | VAR60 | VAR61 |%n"
@@ -155,7 +155,7 @@ public void test_Outputs_output() {
+ "| Index : 1 | DELETION | test | |----------------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|--------------------|------------|-------------------------------|-------------------------------|-------------------------------|------------|------------|------------|------------|------------|-------------------------------------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|--------------------------------------|------------------|------------------|%n"
+ "| | | | | At end point | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |%n"
+ "|-----------|----------|-------|---------|----------------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|--------------------|------------|-------------------------------|-------------------------------|-------------------------------|------------|------------|------------|------------|------------|-------------------------------------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|--------------------------------------|------------------|------------------|%n"));
- Assertions.assertThat(byteArrayOutputStream6.toString()).isEqualTo(String.format("[Change at index 0 of Changes on TEST table of a data source]%n"
+ Assertions.assertThat(byteArrayOutputStream6.toString()).isEqualTo(String.format("[Change at index 0 of Changes on TEST table of 'data source']%n"
+ "|----------|-------|---------|----------------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|--------------------|------------|-------------------------------|-------------------------------|-------------------------------|------------|------------|------------|------------|------------|-------------------------------------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|--------------------------------------|------------------|------------------|%n"
+ "| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |%n"
+ "| TYPE | TABLE | PRIMARY | | VAR1 | VAR2 | VAR3 | VAR4 | VAR5 | VAR6 | VAR7 | VAR8 | VAR9 | VAR10 | VAR11 | VAR12 | VAR13 | VAR14 | VAR15 | VAR16 | VAR17 | VAR18 | VAR19 | VAR20 | VAR21 | VAR22 | VAR23 | VAR24 | VAR25 | VAR26 | VAR27 | VAR28 | VAR29 | VAR30 | VAR31 | VAR32 | VAR33 | VAR34 | VAR35 | VAR36 | VAR37 | VAR38 | VAR39 | VAR40 | VAR41 | VAR42 | VAR43 | VAR44 | VAR45 | VAR46 | VAR47 | VAR48 | VAR49 | VAR50 | VAR51 | VAR52 | VAR53 | VAR54 | VAR55 | VAR56 | VAR57 | VAR58 | VAR59 | VAR60 | VAR61 |%n"
@@ -166,7 +166,7 @@ public void test_Outputs_output() {
+ "| CREATION | test | |----------------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|--------------------|------------|-------------------------------|-------------------------------|-------------------------------|------------|------------|------------|------------|------------|-------------------------------------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|--------------------------------------|------------------|------------------|%n"
+ "| | | | At end point | 1 | 20 | 3 | 4 | 5 | 6 | true | false | true | 7 | 8 | 9 | 10 | 11 | 12 | 13.13 | 14.14 | 15.15 | 16.16 | 17.17 | 18.18 | 19.19 | 20.2 | 21.21 | 09:01:00.000000000 | 2007-12-23 | 2007-12-23T09:01:00.000000000 | 2007-12-23T09:01:00.000000000 | 2007-12-23T09:01:00.000000000 | ... | ... | ... | ... | ... | fr | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | ... | ... | ... | ... | ... | ... | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 30b443ae-c0c9-4790-9bec-ce1380808435 | null | null |%n"
+ "|----------|-------|---------|----------------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|--------------------|------------|-------------------------------|-------------------------------|-------------------------------|------------|------------|------------|------------|------------|-------------------------------------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|--------------------------------------|------------------|------------------|%n"));
- Assertions.assertThat(byteArrayOutputStream7.toString()).isEqualTo(String.format("[Row at end point of Change at index 0 of Changes on TEST table of a data source]%n"
+ Assertions.assertThat(byteArrayOutputStream7.toString()).isEqualTo(String.format("[Row at end point of Change at index 0 of Changes on TEST table of 'data source']%n"
+ "|---------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|--------------------|------------|-------------------------------|-------------------------------|-------------------------------|------------|------------|------------|------------|------------|-------------------------------------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|--------------------------------------|------------------|------------------|%n"
+ "| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |%n"
+ "| PRIMARY | VAR1 | VAR2 | VAR3 | VAR4 | VAR5 | VAR6 | VAR7 | VAR8 | VAR9 | VAR10 | VAR11 | VAR12 | VAR13 | VAR14 | VAR15 | VAR16 | VAR17 | VAR18 | VAR19 | VAR20 | VAR21 | VAR22 | VAR23 | VAR24 | VAR25 | VAR26 | VAR27 | VAR28 | VAR29 | VAR30 | VAR31 | VAR32 | VAR33 | VAR34 | VAR35 | VAR36 | VAR37 | VAR38 | VAR39 | VAR40 | VAR41 | VAR42 | VAR43 | VAR44 | VAR45 | VAR46 | VAR47 | VAR48 | VAR49 | VAR50 | VAR51 | VAR52 | VAR53 | VAR54 | VAR55 | VAR56 | VAR57 | VAR58 | VAR59 | VAR60 | VAR61 |%n"
@@ -175,14 +175,14 @@ public void test_Outputs_output() {
+ "|---------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|--------------------|------------|-------------------------------|-------------------------------|-------------------------------|------------|------------|------------|------------|------------|-------------------------------------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|--------------------------------------|------------------|------------------|%n"
+ "| | 1 | 20 | 3 | 4 | 5 | 6 | true | false | true | 7 | 8 | 9 | 10 | 11 | 12 | 13.13 | 14.14 | 15.15 | 16.16 | 17.17 | 18.18 | 19.19 | 20.2 | 21.21 | 09:01:00.000000000 | 2007-12-23 | 2007-12-23T09:01:00.000000000 | 2007-12-23T09:01:00.000000000 | 2007-12-23T09:01:00.000000000 | ... | ... | ... | ... | ... | fr | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | ... | ... | ... | ... | ... | ... | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 30b443ae-c0c9-4790-9bec-ce1380808435 | null | null |%n"
+ "|---------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|--------------------|------------|-------------------------------|-------------------------------|-------------------------------|------------|------------|------------|------------|------------|-------------------------------------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|--------------------------------------|------------------|------------------|%n"));
- Assertions.assertThat(byteArrayOutputStream8.toString()).isEqualTo(String.format("[Value at index 0 (column name : VAR1) of Row at end point of Change at index 0 of Changes on TEST table of a data source]%n"
+ Assertions.assertThat(byteArrayOutputStream8.toString()).isEqualTo(String.format("[Value at index 0 (column name : VAR1) of Row at end point of Change at index 0 of Changes on TEST table of 'data source']%n"
+ "|----------|%n"
+ "| VAR1 |%n"
+ "| (NUMBER) |%n"
+ "|----------|%n"
+ "| 1 |%n"
+ "|----------|%n"));
- Assertions.assertThat(byteArrayOutputStream9.toString()).isEqualTo(String.format("[Column at index 0 (column name : VAR1) of Change at index 0 of Changes on TEST table of a data source]%n"
+ Assertions.assertThat(byteArrayOutputStream9.toString()).isEqualTo(String.format("[Column at index 0 (column name : VAR1) of Change at index 0 of Changes on TEST table of 'data source']%n"
+ "|----------------|----------|%n"
+ "| | VAR1 |%n"
+ "| | (NUMBER) |%n"
@@ -191,14 +191,14 @@ public void test_Outputs_output() {
+ "|----------------|----------|%n"
+ "| At end point | 1 |%n"
+ "|----------------|----------|%n"));
- Assertions.assertThat(byteArrayOutputStream10.toString()).isEqualTo(String.format("[Value at end point of Column at index 0 (column name : VAR1) of Change at index 0 of Changes on TEST table of a data source]%n"
+ Assertions.assertThat(byteArrayOutputStream10.toString()).isEqualTo(String.format("[Value at end point of Column at index 0 (column name : VAR1) of Change at index 0 of Changes on TEST table of 'data source']%n"
+ "|----------|%n"
+ "| VAR1 |%n"
+ "| (NUMBER) |%n"
+ "|----------|%n"
+ "| 1 |%n"
+ "|----------|%n"));
- Assertions.assertThat(byteArrayOutputStream11.toString()).isEqualTo(String.format("[Changes on TEST table of a data source]%n"
+ Assertions.assertThat(byteArrayOutputStream11.toString()).isEqualTo(String.format("[Changes on TEST table of 'data source']%n"
+ "|-----------|----------|-------|---------|----------------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|--------------------|------------|-------------------------------|-------------------------------|-------------------------------|------------|------------|------------|------------|------------|-------------------------------------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|--------------------------------------|------------------|------------------|%n"
+ "| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |%n"
+ "| | TYPE | TABLE | PRIMARY | | VAR1 | VAR2 | VAR3 | VAR4 | VAR5 | VAR6 | VAR7 | VAR8 | VAR9 | VAR10 | VAR11 | VAR12 | VAR13 | VAR14 | VAR15 | VAR16 | VAR17 | VAR18 | VAR19 | VAR20 | VAR21 | VAR22 | VAR23 | VAR24 | VAR25 | VAR26 | VAR27 | VAR28 | VAR29 | VAR30 | VAR31 | VAR32 | VAR33 | VAR34 | VAR35 | VAR36 | VAR37 | VAR38 | VAR39 | VAR40 | VAR41 | VAR42 | VAR43 | VAR44 | VAR45 | VAR46 | VAR47 | VAR48 | VAR49 | VAR50 | VAR51 | VAR52 | VAR53 | VAR54 | VAR55 | VAR56 | VAR57 | VAR58 | VAR59 | VAR60 | VAR61 |%n"
@@ -219,7 +219,7 @@ public void test_Outputs_output() {
+ "| Index : 1 | DELETION | test | |----------------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|--------------------|------------|-------------------------------|-------------------------------|-------------------------------|------------|------------|------------|------------|------------|-------------------------------------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|--------------------------------------|------------------|------------------|%n"
+ "| | | | | At end point | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |%n"
+ "|-----------|----------|-------|---------|----------------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|--------------------|------------|-------------------------------|-------------------------------|-------------------------------|------------|------------|------------|------------|------------|-------------------------------------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|--------------------------------------|------------------|------------------|%n"));
- Assertions.assertThat(byteArrayOutputStream12.toString()).isEqualTo(String.format("[Change at index 0 of Changes on TEST table of a data source]%n"
+ Assertions.assertThat(byteArrayOutputStream12.toString()).isEqualTo(String.format("[Change at index 0 of Changes on TEST table of 'data source']%n"
+ "|----------|-------|---------|----------------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|--------------------|------------|-------------------------------|-------------------------------|-------------------------------|------------|------------|------------|------------|------------|-------------------------------------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|--------------------------------------|------------------|------------------|%n"
+ "| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |%n"
+ "| TYPE | TABLE | PRIMARY | | VAR1 | VAR2 | VAR3 | VAR4 | VAR5 | VAR6 | VAR7 | VAR8 | VAR9 | VAR10 | VAR11 | VAR12 | VAR13 | VAR14 | VAR15 | VAR16 | VAR17 | VAR18 | VAR19 | VAR20 | VAR21 | VAR22 | VAR23 | VAR24 | VAR25 | VAR26 | VAR27 | VAR28 | VAR29 | VAR30 | VAR31 | VAR32 | VAR33 | VAR34 | VAR35 | VAR36 | VAR37 | VAR38 | VAR39 | VAR40 | VAR41 | VAR42 | VAR43 | VAR44 | VAR45 | VAR46 | VAR47 | VAR48 | VAR49 | VAR50 | VAR51 | VAR52 | VAR53 | VAR54 | VAR55 | VAR56 | VAR57 | VAR58 | VAR59 | VAR60 | VAR61 |%n"
@@ -230,7 +230,7 @@ public void test_Outputs_output() {
+ "| CREATION | test | |----------------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|--------------------|------------|-------------------------------|-------------------------------|-------------------------------|------------|------------|------------|------------|------------|-------------------------------------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|--------------------------------------|------------------|------------------|%n"
+ "| | | | At end point | 1 | 20 | 3 | 4 | 5 | 6 | true | false | true | 7 | 8 | 9 | 10 | 11 | 12 | 13.13 | 14.14 | 15.15 | 16.16 | 17.17 | 18.18 | 19.19 | 20.2 | 21.21 | 09:01:00.000000000 | 2007-12-23 | 2007-12-23T09:01:00.000000000 | 2007-12-23T09:01:00.000000000 | 2007-12-23T09:01:00.000000000 | ... | ... | ... | ... | ... | fr | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | ... | ... | ... | ... | ... | ... | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 30b443ae-c0c9-4790-9bec-ce1380808435 | null | null |%n"
+ "|----------|-------|---------|----------------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|--------------------|------------|-------------------------------|-------------------------------|-------------------------------|------------|------------|------------|------------|------------|-------------------------------------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|--------------------------------------|------------------|------------------|%n"));
- Assertions.assertThat(byteArrayOutputStream13.toString()).isEqualTo(String.format("[Row at end point of Change at index 0 of Changes on TEST table of a data source]%n"
+ Assertions.assertThat(byteArrayOutputStream13.toString()).isEqualTo(String.format("[Row at end point of Change at index 0 of Changes on TEST table of 'data source']%n"
+ "|---------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|--------------------|------------|-------------------------------|-------------------------------|-------------------------------|------------|------------|------------|------------|------------|-------------------------------------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|--------------------------------------|------------------|------------------|%n"
+ "| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |%n"
+ "| PRIMARY | VAR1 | VAR2 | VAR3 | VAR4 | VAR5 | VAR6 | VAR7 | VAR8 | VAR9 | VAR10 | VAR11 | VAR12 | VAR13 | VAR14 | VAR15 | VAR16 | VAR17 | VAR18 | VAR19 | VAR20 | VAR21 | VAR22 | VAR23 | VAR24 | VAR25 | VAR26 | VAR27 | VAR28 | VAR29 | VAR30 | VAR31 | VAR32 | VAR33 | VAR34 | VAR35 | VAR36 | VAR37 | VAR38 | VAR39 | VAR40 | VAR41 | VAR42 | VAR43 | VAR44 | VAR45 | VAR46 | VAR47 | VAR48 | VAR49 | VAR50 | VAR51 | VAR52 | VAR53 | VAR54 | VAR55 | VAR56 | VAR57 | VAR58 | VAR59 | VAR60 | VAR61 |%n"
@@ -239,14 +239,14 @@ public void test_Outputs_output() {
+ "|---------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|--------------------|------------|-------------------------------|-------------------------------|-------------------------------|------------|------------|------------|------------|------------|-------------------------------------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|--------------------------------------|------------------|------------------|%n"
+ "| | 1 | 20 | 3 | 4 | 5 | 6 | true | false | true | 7 | 8 | 9 | 10 | 11 | 12 | 13.13 | 14.14 | 15.15 | 16.16 | 17.17 | 18.18 | 19.19 | 20.2 | 21.21 | 09:01:00.000000000 | 2007-12-23 | 2007-12-23T09:01:00.000000000 | 2007-12-23T09:01:00.000000000 | 2007-12-23T09:01:00.000000000 | ... | ... | ... | ... | ... | fr | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | ... | ... | ... | ... | ... | ... | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 30b443ae-c0c9-4790-9bec-ce1380808435 | null | null |%n"
+ "|---------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|--------------------|------------|-------------------------------|-------------------------------|-------------------------------|------------|------------|------------|------------|------------|-------------------------------------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|--------------------------------------|------------------|------------------|%n"));
- Assertions.assertThat(byteArrayOutputStream14.toString()).isEqualTo(String.format("[Value at index 0 (column name : VAR1) of Row at end point of Change at index 0 of Changes on TEST table of a data source]%n"
+ Assertions.assertThat(byteArrayOutputStream14.toString()).isEqualTo(String.format("[Value at index 0 (column name : VAR1) of Row at end point of Change at index 0 of Changes on TEST table of 'data source']%n"
+ "|----------|%n"
+ "| VAR1 |%n"
+ "| (NUMBER) |%n"
+ "|----------|%n"
+ "| 1 |%n"
+ "|----------|%n"));
- Assertions.assertThat(byteArrayOutputStream15.toString()).isEqualTo(String.format("[Column at index 0 (column name : VAR1) of Change at index 0 of Changes on TEST table of a data source]%n"
+ Assertions.assertThat(byteArrayOutputStream15.toString()).isEqualTo(String.format("[Column at index 0 (column name : VAR1) of Change at index 0 of Changes on TEST table of 'data source']%n"
+ "|----------------|----------|%n"
+ "| | VAR1 |%n"
+ "| | (NUMBER) |%n"
@@ -255,7 +255,7 @@ public void test_Outputs_output() {
+ "|----------------|----------|%n"
+ "| At end point | 1 |%n"
+ "|----------------|----------|%n"));
- Assertions.assertThat(byteArrayOutputStream16.toString()).isEqualTo(String.format("[Value at end point of Column at index 0 (column name : VAR1) of Change at index 0 of Changes on TEST table of a data source]%n"
+ Assertions.assertThat(byteArrayOutputStream16.toString()).isEqualTo(String.format("[Value at end point of Column at index 0 (column name : VAR1) of Change at index 0 of Changes on TEST table of 'data source']%n"
+ "|----------|%n"
+ "| VAR1 |%n"
+ "| (NUMBER) |%n"
@@ -267,9 +267,9 @@ public void test_Outputs_output() {
@Test
@NeedReload
public void should_fail_because_primary_key_is_different() {
- Table table = new Table(source, "test");
+ Table table = new Table(connectionProvider, "test");
Changes changes = new Changes(table).setStartPointNow();
- Changes changes2 = new Changes(source).setStartPointNow();
+ Changes changes2 = new Changes(connectionProvider).setStartPointNow();
update();
changes.setEndPointNow();
changes2.setEndPointNow();
@@ -278,7 +278,7 @@ public void should_fail_because_primary_key_is_different() {
assertThat(changes).change().hasPksNames("var1");
fail("An exception must be raised");
} catch (AssertionError e) {
- Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Change at index 0 of Changes on test table of 'sa/jdbc:h2:mem:testH2' source] %n"
+ Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Change at index 0 of Changes on test table of 'sa/jdbc:h2:mem:testH2'] %n"
+ "Expecting :%n"
+ " [\"var1\"]%n"
+ "to be the name of the columns of the primary keys but was:%n"
@@ -289,7 +289,7 @@ public void should_fail_because_primary_key_is_different() {
assertThat(changes2).change().hasPksNames("var1");
fail("An exception must be raised");
} catch (AssertionError e) {
- Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Change at index 0 (with primary key : [1]) of Changes on TEST table of 'sa/jdbc:h2:mem:testH2' source] %n"
+ Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Change at index 0 (with primary key : [1]) of Changes on TEST table of 'sa/jdbc:h2:mem:testH2'] %n"
+ "Expecting :%n"
+ " [\"var1\"]%n"
+ "to be the name of the columns of the primary keys but was:%n"
@@ -300,9 +300,9 @@ public void should_fail_because_primary_key_is_different() {
@Test
@NeedReload
public void should_fail_because_column_name_is_different() {
- Table table = new Table(source, "test");
+ Table table = new Table(connectionProvider, "test");
Changes changes = new Changes(table).setStartPointNow();
- Changes changes2 = new Changes(source).setStartPointNow();
+ Changes changes2 = new Changes(connectionProvider).setStartPointNow();
update();
changes.setEndPointNow();
changes2.setEndPointNow();
@@ -333,7 +333,7 @@ public void should_fail_because_column_name_is_different() {
assertThat(changes).change().column().hasColumnName("Var1");
fail("An exception must be raised");
} catch (AssertionError e) {
- Assertions.assertThat(e.getMessage()).as("message3").isEqualTo(String.format("[Column at index 0 (column name : VAR1) of Change at index 0 of Changes on test table of 'sa/jdbc:h2:mem:testH2' source] %n"
+ Assertions.assertThat(e.getMessage()).as("message3").isEqualTo(String.format("[Column at index 0 (column name : VAR1) of Change at index 0 of Changes on test table of 'sa/jdbc:h2:mem:testH2'] %n"
+ "Expecting :%n"
+ " \"Var1\"%n"
+ "to be the name of the column but was:%n"
@@ -343,7 +343,7 @@ public void should_fail_because_column_name_is_different() {
assertThat(changes).change().rowAtEndPoint().value().hasColumnName("Var1");
fail("An exception must be raised");
} catch (AssertionError e) {
- Assertions.assertThat(e.getMessage()).as("message4").isEqualTo(String.format("[Value at index 0 (column name : VAR1) of Row at end point of Change at index 0 of Changes on test table of 'sa/jdbc:h2:mem:testH2' source] %n"
+ Assertions.assertThat(e.getMessage()).as("message4").isEqualTo(String.format("[Value at index 0 (column name : VAR1) of Row at end point of Change at index 0 of Changes on test table of 'sa/jdbc:h2:mem:testH2'] %n"
+ "Expecting :%n"
+ " \"Var1\"%n"
+ "to be the name of the column but was:%n"
@@ -354,7 +354,7 @@ public void should_fail_because_column_name_is_different() {
assertThat(changes2).change().column().hasColumnName("Var1");
fail("An exception must be raised");
} catch (AssertionError e) {
- Assertions.assertThat(e.getMessage()).as("message5").isEqualTo(String.format("[Column at index 0 (column name : VAR1) of Change at index 0 (with primary key : [1]) of Changes on TEST table of 'sa/jdbc:h2:mem:testH2' source] %n"
+ Assertions.assertThat(e.getMessage()).as("message5").isEqualTo(String.format("[Column at index 0 (column name : VAR1) of Change at index 0 (with primary key : [1]) of Changes on TEST table of 'sa/jdbc:h2:mem:testH2'] %n"
+ "Expecting :%n"
+ " \"Var1\"%n"
+ "to be the name of the column but was:%n"
@@ -364,7 +364,7 @@ public void should_fail_because_column_name_is_different() {
assertThat(changes2).change().rowAtEndPoint().value().hasColumnName("Var1");
fail("An exception must be raised");
} catch (AssertionError e) {
- Assertions.assertThat(e.getMessage()).as("message6").isEqualTo(String.format("[Value at index 0 (column name : VAR1) of Row at end point of Change at index 0 (with primary key : [1]) of Changes on TEST table of 'sa/jdbc:h2:mem:testH2' source] %n"
+ Assertions.assertThat(e.getMessage()).as("message6").isEqualTo(String.format("[Value at index 0 (column name : VAR1) of Row at end point of Change at index 0 (with primary key : [1]) of Changes on TEST table of 'sa/jdbc:h2:mem:testH2'] %n"
+ "Expecting :%n"
+ " \"Var1\"%n"
+ "to be the name of the column but was:%n"
@@ -375,9 +375,9 @@ public void should_fail_because_column_name_is_different() {
@Test
@NeedReload
public void should_fail_because_column_name_is_wrong_to_navigate() {
- Table table = new Table(source, "test");
+ Table table = new Table(connectionProvider, "test");
Changes changes = new Changes(table).setStartPointNow();
- Changes changes2 = new Changes(source).setStartPointNow();
+ Changes changes2 = new Changes(connectionProvider).setStartPointNow();
update();
changes.setEndPointNow();
changes2.setEndPointNow();
@@ -437,9 +437,9 @@ public void should_fail_because_column_name_is_wrong_to_navigate() {
@Test
@NeedReload
public void should_fail_because_table_name_is_different() {
- Table table = new Table(source, "test");
+ Table table = new Table(connectionProvider, "test");
Changes changes = new Changes(table).setStartPointNow();
- Changes changes2 = new Changes(source).setStartPointNow();
+ Changes changes2 = new Changes(connectionProvider).setStartPointNow();
update();
changes.setEndPointNow();
changes2.setEndPointNow();
@@ -448,7 +448,7 @@ public void should_fail_because_table_name_is_different() {
assertThat(changes).change().isOnTable("teSt");
fail("An exception must be raised");
} catch (AssertionError e) {
- Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Change at index 0 of Changes on test table of 'sa/jdbc:h2:mem:testH2' source] %n"
+ Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Change at index 0 of Changes on test table of 'sa/jdbc:h2:mem:testH2'] %n"
+ "Expecting to be on the table:%n"
+ " <\"teSt\">%n"
+ "but was on the table:%n"
@@ -458,7 +458,7 @@ public void should_fail_because_table_name_is_different() {
assertThat(changes2).change().isOnTable("teSt");
fail("An exception must be raised");
} catch (AssertionError e) {
- Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Change at index 0 (with primary key : [1]) of Changes on TEST table of 'sa/jdbc:h2:mem:testH2' source] %n"
+ Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Change at index 0 (with primary key : [1]) of Changes on TEST table of 'sa/jdbc:h2:mem:testH2'] %n"
+ "Expecting to be on the table:%n"
+ " <\"teSt\">%n"
+ "but was on the table:%n"
@@ -469,9 +469,9 @@ public void should_fail_because_table_name_is_different() {
@Test
@NeedReload
public void should_fail_because_table_name_is_wrong_to_navigate() {
- Table table = new Table(source, "test");
+ Table table = new Table(connectionProvider, "test");
Changes changes = new Changes(table).setStartPointNow();
- Changes changes2 = new Changes(source).setStartPointNow();
+ Changes changes2 = new Changes(connectionProvider).setStartPointNow();
update();
changes.setEndPointNow();
changes2.setEndPointNow();
@@ -518,9 +518,9 @@ public void should_fail_because_table_name_is_wrong_to_navigate() {
@Test
@NeedReload
public void test_ColumnName_hasColumnName() {
- Table table = new Table(source, "test");
+ Table table = new Table(connectionProvider, "test");
Changes changes = new Changes(table).setStartPointNow();
- Changes changes2 = new Changes(source).setStartPointNow();
+ Changes changes2 = new Changes(connectionProvider).setStartPointNow();
update();
changes.setEndPointNow();
changes2.setEndPointNow();
@@ -534,9 +534,9 @@ public void test_ColumnName_hasColumnName() {
@Test
@NeedReload
public void test_ColumnClass_isOfClass() {
- Table table = new Table(source, "test");
+ Table table = new Table(connectionProvider, "test");
Changes changes = new Changes(table).setStartPointNow();
- Changes changes2 = new Changes(source).setStartPointNow();
+ Changes changes2 = new Changes(connectionProvider).setStartPointNow();
update();
changes.setEndPointNow();
changes2.setEndPointNow();
@@ -550,11 +550,9 @@ public void test_ColumnClass_isOfClass() {
@Test
@NeedReload
public void test_getTableLetterCase() {
- SourceWithLetterCase sourceWithLetterCase = (SourceWithLetterCase) source;
+ Table table = new Table(connectionProvider, "test");
- Table table = new Table(source, "test");
-
- Request request = new Request(source, "select * from test");
+ Request request = new Request(connectionProvider, "select * from test");
Changes changes = new Changes(table).setStartPointNow();
update();
@@ -562,7 +560,7 @@ public void test_getTableLetterCase() {
Change change = changes.getChangesList().get(0);
- Assertions.assertThat(sourceWithLetterCase.getTableLetterCase().getConversionName()).isSameAs(CaseConversions.NO.getConversionName());
+ Assertions.assertThat(connectionProvider.getTableLetterCase().getConversionName()).isSameAs(CaseConversions.NO.getConversionName());
Assertions.assertThat(table.getTableLetterCase().getConversionName()).isSameAs(CaseConversions.NO.getConversionName());
@@ -572,7 +570,7 @@ public void test_getTableLetterCase() {
Assertions.assertThat(change.getTableLetterCase().getConversionName()).isSameAs(CaseConversions.NO.getConversionName());
- Assertions.assertThat(sourceWithLetterCase.getTableLetterCase().getComparisonName()).isSameAs(CaseComparisons.STRICT.getComparisonName());
+ Assertions.assertThat(connectionProvider.getTableLetterCase().getComparisonName()).isSameAs(CaseComparisons.STRICT.getComparisonName());
Assertions.assertThat(table.getTableLetterCase().getComparisonName()).isSameAs(CaseComparisons.STRICT.getComparisonName());
@@ -585,15 +583,13 @@ public void test_getTableLetterCase() {
@Test
@NeedReload
public void test_getColumnLetterCase() {
- SourceWithLetterCase sourceWithLetterCase = (SourceWithLetterCase) source;
-
- Table table = new Table(source, "test");
+ Table table = new Table(connectionProvider, "test");
Row tableRow = table.getRow(0);
Column tableColumn = table.getColumn(0);
Value tableRowValue = tableRow.getColumnValue(0);
Value tableColumnValue = tableColumn.getRowValue(0);
- Request request = new Request(source, "select * from test");
+ Request request = new Request(connectionProvider, "select * from test");
Row requestRow = request.getRow(0);
Column requestColumn = request.getColumn(0);
Value requestRowValue = requestRow.getColumnValue(0);
@@ -609,7 +605,7 @@ public void test_getColumnLetterCase() {
Value valueAtEndPoint = rowAtEndPoint.getColumnValue(0);
- Assertions.assertThat(sourceWithLetterCase.getColumnLetterCase().getConversionName()).isSameAs(CaseConversions.NO.getConversionName());
+ Assertions.assertThat(connectionProvider.getColumnLetterCase().getConversionName()).isSameAs(CaseConversions.NO.getConversionName());
Assertions.assertThat(table.getColumnLetterCase().getConversionName()).isSameAs(CaseConversions.NO.getConversionName());
Assertions.assertThat(tableRow.getColumnLetterCase().getConversionName()).isSameAs(CaseConversions.NO.getConversionName());
@@ -631,7 +627,7 @@ public void test_getColumnLetterCase() {
Assertions.assertThat(valueAtEndPoint.getColumnLetterCase().getConversionName()).isSameAs(CaseConversions.NO.getConversionName());
- Assertions.assertThat(sourceWithLetterCase.getColumnLetterCase().getComparisonName()).isSameAs(CaseComparisons.STRICT.getComparisonName());
+ Assertions.assertThat(connectionProvider.getColumnLetterCase().getComparisonName()).isSameAs(CaseComparisons.STRICT.getComparisonName());
Assertions.assertThat(table.getColumnLetterCase().getComparisonName()).isSameAs(CaseComparisons.STRICT.getComparisonName());
Assertions.assertThat(tableRow.getColumnLetterCase().getComparisonName()).isSameAs(CaseComparisons.STRICT.getComparisonName());
@@ -656,12 +652,10 @@ public void test_getColumnLetterCase() {
@Test
@NeedReload
public void test_getPrimaryKeyLetterCase() {
- SourceWithLetterCase sourceWithLetterCase = (SourceWithLetterCase) source;
-
- Table table = new Table(source, "test");
+ Table table = new Table(connectionProvider, "test");
Row tableRow = table.getRow(0);
- Request request = new Request(source, "select * from test");
+ Request request = new Request(connectionProvider, "select * from test");
Row requestRow = request.getRow(0);
Changes changes = new Changes(table).setStartPointNow();
@@ -672,7 +666,7 @@ public void test_getPrimaryKeyLetterCase() {
Row rowAtEndPoint = change.getRowAtEndPoint();
- Assertions.assertThat(sourceWithLetterCase.getPrimaryKeyLetterCase().getConversionName()).isSameAs(CaseConversions.NO.getConversionName());
+ Assertions.assertThat(connectionProvider.getPrimaryKeyLetterCase().getConversionName()).isSameAs(CaseConversions.NO.getConversionName());
Assertions.assertThat(table.getPrimaryKeyLetterCase().getConversionName()).isSameAs(CaseConversions.NO.getConversionName());
Assertions.assertThat(tableRow.getPrimaryKeyLetterCase().getConversionName()).isSameAs(CaseConversions.NO.getConversionName());
@@ -686,7 +680,7 @@ public void test_getPrimaryKeyLetterCase() {
Assertions.assertThat(rowAtEndPoint.getPrimaryKeyLetterCase().getConversionName()).isSameAs(CaseConversions.NO.getConversionName());
- Assertions.assertThat(sourceWithLetterCase.getPrimaryKeyLetterCase().getComparisonName()).isSameAs(CaseComparisons.STRICT.getComparisonName());
+ Assertions.assertThat(connectionProvider.getPrimaryKeyLetterCase().getComparisonName()).isSameAs(CaseComparisons.STRICT.getComparisonName());
Assertions.assertThat(table.getPrimaryKeyLetterCase().getComparisonName()).isSameAs(CaseComparisons.STRICT.getComparisonName());
Assertions.assertThat(tableRow.getPrimaryKeyLetterCase().getComparisonName()).isSameAs(CaseComparisons.STRICT.getComparisonName());
diff --git a/src/test/java/org/assertj/db/database/h2/H2Database_Source_UIUIUI_Test.java b/src/test/java/org/assertj/db/database/h2/H2Database_JdbcUrl_UIUIUI_Test.java
similarity index 97%
rename from src/test/java/org/assertj/db/database/h2/H2Database_Source_UIUIUI_Test.java
rename to src/test/java/org/assertj/db/database/h2/H2Database_JdbcUrl_UIUIUI_Test.java
index 3efd9fb5..48f7fc5f 100644
--- a/src/test/java/org/assertj/db/database/h2/H2Database_Source_UIUIUI_Test.java
+++ b/src/test/java/org/assertj/db/database/h2/H2Database_JdbcUrl_UIUIUI_Test.java
@@ -27,12 +27,11 @@
import org.assertj.db.type.Change;
import org.assertj.db.type.Changes;
import org.assertj.db.type.Column;
+import org.assertj.db.type.ConnectionProvider;
import org.assertj.db.type.DateTimeValue;
import org.assertj.db.type.DateValue;
import org.assertj.db.type.Request;
import org.assertj.db.type.Row;
-import org.assertj.db.type.Source;
-import org.assertj.db.type.SourceWithLetterCase;
import org.assertj.db.type.Table;
import org.assertj.db.type.TimeValue;
import org.assertj.db.type.Value;
@@ -46,20 +45,21 @@
* Test on the H2 database.
*
* @author Régis Pouiller
+ * @author Julien Roy
*/
-public class H2Database_Source_UIUIUI_Test extends AbstractH2Test {
+public class H2Database_JdbcUrl_UIUIUI_Test extends AbstractH2Test {
- private Source source;
+ private ConnectionProvider connectionProvider;
@Before
public void init() {
- source = sourceUIUIUI;
+ connectionProvider = jdbcConnectionUIUIUI;
}
@Test
@NeedReload
public void test_PrimaryKey_hasPksNames() {
- Table table = new Table(source, "test");
+ Table table = new Table(connectionProvider, "test");
Changes changes = new Changes(table).setStartPointNow();
update();
changes.setEndPointNow();
@@ -71,7 +71,7 @@ public void test_PrimaryKey_hasPksNames() {
@Test
@NeedReload
public void test_ColumnName_hasColumnName() {
- Table table = new Table(source, "test");
+ Table table = new Table(connectionProvider, "test");
Changes changes = new Changes(table).setStartPointNow();
update();
changes.setEndPointNow();
@@ -208,7 +208,7 @@ public void test_ColumnName_hasColumnName() {
@Test
@NeedReload
public void test_ColumnClass_isOfClass() {
- Table table = new Table(source, "test");
+ Table table = new Table(connectionProvider, "test");
Changes changes = new Changes(table).setStartPointNow();
update();
changes.setEndPointNow();
@@ -345,7 +345,7 @@ public void test_ColumnClass_isOfClass() {
@Test
@NeedReload
public void test_ColumnEquality_hasValues() {
- Table table = new Table(source, "test");
+ Table table = new Table(connectionProvider, "test");
Changes changes = new Changes(table).setStartPointNow();
update();
changes.setEndPointNow();
@@ -481,7 +481,7 @@ public void test_ColumnEquality_hasValues() {
@Test
@NeedReload
public void test_ColumnEquality_containsValues() {
- Table table = new Table(source, "test");
+ Table table = new Table(connectionProvider, "test");
Changes changes = new Changes(table).setStartPointNow();
update();
changes.setEndPointNow();
@@ -553,7 +553,7 @@ public void test_ColumnEquality_containsValues() {
@Test
@NeedReload
public void test_ColumnType_isOfType() {
- Table table = new Table(source, "test");
+ Table table = new Table(connectionProvider, "test");
Changes changes = new Changes(table).setStartPointNow();
update();
changes.setEndPointNow();
@@ -689,7 +689,7 @@ public void test_ColumnType_isOfType() {
@Test
@NeedReload
public void test_ColumnOfChangeEquality_hasValues() {
- Table table = new Table(source, "test");
+ Table table = new Table(connectionProvider, "test");
Changes changes = new Changes(table).setStartPointNow();
update();
changes.setEndPointNow();
@@ -841,7 +841,7 @@ public void test_ColumnOfChangeEquality_hasValues() {
@Test
@NeedReload
public void test_RowEquality_hasValues() {
- Table table = new Table(source, "test");
+ Table table = new Table(connectionProvider, "test");
Changes changes = new Changes(table).setStartPointNow();
update();
changes.setEndPointNow();
@@ -978,7 +978,7 @@ public void test_RowEquality_hasValues() {
@Test
@NeedReload
public void test_ValueClass_isOfClass() {
- Table table = new Table(source, "test");
+ Table table = new Table(connectionProvider, "test");
Changes changes = new Changes(table).setStartPointNow();
update();
changes.setEndPointNow();
@@ -1115,7 +1115,7 @@ public void test_ValueClass_isOfClass() {
@Test
@NeedReload
public void test_ValueEquality_isEqualTo() {
- Table table = new Table(source, "test");
+ Table table = new Table(connectionProvider, "test");
Changes changes = new Changes(table).setStartPointNow();
update();
changes.setEndPointNow();
@@ -1252,7 +1252,7 @@ public void test_ValueEquality_isEqualTo() {
@Test
@NeedReload
public void test_ValueNonEquality_isNotEqualTo() {
- Table table = new Table(source, "test");
+ Table table = new Table(connectionProvider, "test");
Changes changes = new Changes(table).setStartPointNow();
update();
changes.setEndPointNow();
@@ -1389,7 +1389,7 @@ public void test_ValueNonEquality_isNotEqualTo() {
@Test
@NeedReload
public void test_ValueType_isOfType() {
- Table table = new Table(source, "test");
+ Table table = new Table(connectionProvider, "test");
Changes changes = new Changes(table).setStartPointNow();
update();
changes.setEndPointNow();
@@ -1526,11 +1526,9 @@ public void test_ValueType_isOfType() {
@Test
@NeedReload
public void test_getTableLetterCase() {
- SourceWithLetterCase sourceWithLetterCase = (SourceWithLetterCase) source;
+ Table table = new Table(connectionProvider, "test");
- Table table = new Table(source, "test");
-
- Request request = new Request(source, "select * from test");
+ Request request = new Request(connectionProvider, "select * from test");
Changes changes = new Changes(table).setStartPointNow();
update();
@@ -1538,7 +1536,7 @@ public void test_getTableLetterCase() {
Change change = changes.getChangesList().get(0);
- Assertions.assertThat(sourceWithLetterCase.getTableLetterCase().getConversionName()).isSameAs(CaseConversions.UPPER.getConversionName());
+ Assertions.assertThat(connectionProvider.getTableLetterCase().getConversionName()).isSameAs(CaseConversions.UPPER.getConversionName());
Assertions.assertThat(table.getTableLetterCase().getConversionName()).isSameAs(CaseConversions.UPPER.getConversionName());
@@ -1548,7 +1546,7 @@ public void test_getTableLetterCase() {
Assertions.assertThat(change.getTableLetterCase().getConversionName()).isSameAs(CaseConversions.UPPER.getConversionName());
- Assertions.assertThat(sourceWithLetterCase.getTableLetterCase().getComparisonName()).isSameAs(CaseComparisons.IGNORE.getComparisonName());
+ Assertions.assertThat(connectionProvider.getTableLetterCase().getComparisonName()).isSameAs(CaseComparisons.IGNORE.getComparisonName());
Assertions.assertThat(table.getTableLetterCase().getComparisonName()).isSameAs(CaseComparisons.IGNORE.getComparisonName());
@@ -1561,15 +1559,13 @@ public void test_getTableLetterCase() {
@Test
@NeedReload
public void test_getColumnLetterCase() {
- SourceWithLetterCase sourceWithLetterCase = (SourceWithLetterCase) source;
-
- Table table = new Table(source, "test");
+ Table table = new Table(connectionProvider, "test");
Row tableRow = table.getRow(0);
Column tableColumn = table.getColumn(0);
Value tableRowValue = tableRow.getColumnValue(0);
Value tableColumnValue = tableColumn.getRowValue(0);
- Request request = new Request(source, "select * from test");
+ Request request = new Request(connectionProvider, "select * from test");
Row requestRow = request.getRow(0);
Column requestColumn = request.getColumn(0);
Value requestRowValue = requestRow.getColumnValue(0);
@@ -1585,7 +1581,7 @@ public void test_getColumnLetterCase() {
Value valueAtEndPoint = rowAtEndPoint.getColumnValue(0);
- Assertions.assertThat(sourceWithLetterCase.getColumnLetterCase().getConversionName()).isSameAs(CaseConversions.UPPER.getConversionName());
+ Assertions.assertThat(connectionProvider.getColumnLetterCase().getConversionName()).isSameAs(CaseConversions.UPPER.getConversionName());
Assertions.assertThat(table.getColumnLetterCase().getConversionName()).isSameAs(CaseConversions.UPPER.getConversionName());
Assertions.assertThat(tableRow.getColumnLetterCase().getConversionName()).isSameAs(CaseConversions.UPPER.getConversionName());
@@ -1607,7 +1603,7 @@ public void test_getColumnLetterCase() {
Assertions.assertThat(valueAtEndPoint.getColumnLetterCase().getConversionName()).isSameAs(CaseConversions.UPPER.getConversionName());
- Assertions.assertThat(sourceWithLetterCase.getColumnLetterCase().getComparisonName()).isSameAs(CaseComparisons.IGNORE.getComparisonName());
+ Assertions.assertThat(connectionProvider.getColumnLetterCase().getComparisonName()).isSameAs(CaseComparisons.IGNORE.getComparisonName());
Assertions.assertThat(table.getColumnLetterCase().getComparisonName()).isSameAs(CaseComparisons.IGNORE.getComparisonName());
Assertions.assertThat(tableRow.getColumnLetterCase().getComparisonName()).isSameAs(CaseComparisons.IGNORE.getComparisonName());
@@ -1632,12 +1628,10 @@ public void test_getColumnLetterCase() {
@Test
@NeedReload
public void test_getPrimaryKeyLetterCase() {
- SourceWithLetterCase sourceWithLetterCase = (SourceWithLetterCase) source;
-
- Table table = new Table(source, "test");
+ Table table = new Table(connectionProvider, "test");
Row tableRow = table.getRow(0);
- Request request = new Request(source, "select * from test");
+ Request request = new Request(connectionProvider, "select * from test");
Row requestRow = request.getRow(0);
Changes changes = new Changes(table).setStartPointNow();
@@ -1648,7 +1642,7 @@ public void test_getPrimaryKeyLetterCase() {
Row rowAtEndPoint = change.getRowAtEndPoint();
- Assertions.assertThat(sourceWithLetterCase.getPrimaryKeyLetterCase().getConversionName()).isSameAs(CaseConversions.UPPER.getConversionName());
+ Assertions.assertThat(connectionProvider.getPrimaryKeyLetterCase().getConversionName()).isSameAs(CaseConversions.UPPER.getConversionName());
Assertions.assertThat(table.getPrimaryKeyLetterCase().getConversionName()).isSameAs(CaseConversions.UPPER.getConversionName());
Assertions.assertThat(tableRow.getPrimaryKeyLetterCase().getConversionName()).isSameAs(CaseConversions.UPPER.getConversionName());
@@ -1662,7 +1656,7 @@ public void test_getPrimaryKeyLetterCase() {
Assertions.assertThat(rowAtEndPoint.getPrimaryKeyLetterCase().getConversionName()).isSameAs(CaseConversions.UPPER.getConversionName());
- Assertions.assertThat(sourceWithLetterCase.getPrimaryKeyLetterCase().getComparisonName()).isSameAs(CaseComparisons.IGNORE.getComparisonName());
+ Assertions.assertThat(connectionProvider.getPrimaryKeyLetterCase().getComparisonName()).isSameAs(CaseComparisons.IGNORE.getComparisonName());
Assertions.assertThat(table.getPrimaryKeyLetterCase().getComparisonName()).isSameAs(CaseComparisons.IGNORE.getComparisonName());
Assertions.assertThat(tableRow.getPrimaryKeyLetterCase().getComparisonName()).isSameAs(CaseComparisons.IGNORE.getComparisonName());
diff --git a/src/test/java/org/assertj/db/database/h2/ReservedH2DataBase_Test.java b/src/test/java/org/assertj/db/database/h2/ReservedH2DataBase_Test.java
index 4006dbec..d35c3c23 100644
--- a/src/test/java/org/assertj/db/database/h2/ReservedH2DataBase_Test.java
+++ b/src/test/java/org/assertj/db/database/h2/ReservedH2DataBase_Test.java
@@ -44,7 +44,7 @@ public void test_catalog_for_data_source() throws SQLException {
}
@Test
- public void test_catalog_for_source() throws SQLException {
+ public void test_catalogfor_jdbc_connection() throws SQLException {
try (Connection connection = DriverManager.getConnection(URL, USER, PASSWORD)) {
String catalog = connection.getCatalog();
assertThat(catalog).isEqualTo("TESTRESERVEDH2");
@@ -60,7 +60,7 @@ public void test_schema_for_data_source() throws SQLException {
}
@Test
- public void test_schema_for_source() throws SQLException {
+ public void test_schemafor_jdbc_connection() throws SQLException {
try (Connection connection = DriverManager.getConnection(URL, USER, PASSWORD)) {
String schema = connection.getSchema();
assertThat(schema).isEqualTo("PUBLIC");
@@ -81,7 +81,7 @@ public void test_tables_for_data_source() throws SQLException {
}
@Test
- public void test_tables_for_source() throws SQLException {
+ public void test_tablesfor_jdbc_connection() throws SQLException {
try (Connection connection = DriverManager.getConnection(URL, USER, PASSWORD)) {
DatabaseMetaData databaseMetaData = connection.getMetaData();
ResultSet resultSet = databaseMetaData.getTables("TESTRESERVEDH2", null, null, new String[]{"TABLE"});
@@ -117,7 +117,7 @@ public void test_table_primary_keys_for_data_source() throws SQLException {
}
@Test
- public void test_table_primary_keys_for_source() throws SQLException {
+ public void test_table_primary_keysfor_jdbc_connection() throws SQLException {
try (Connection connection = DriverManager.getConnection(URL, USER, PASSWORD)) {
DatabaseMetaData databaseMetaData = connection.getMetaData();
{
@@ -177,7 +177,7 @@ public void test_table_columns_for_data_source() throws SQLException {
}
@Test
- public void test_table_columns_for_source() throws SQLException {
+ public void test_table_columnsfor_jdbc_connection() throws SQLException {
try (Connection connection = DriverManager.getConnection(URL, USER, PASSWORD)) {
DatabaseMetaData databaseMetaData = connection.getMetaData();
{
@@ -239,7 +239,7 @@ public void test_request_columns_for_data_source() throws SQLException {
}
@Test
- public void test_request_columns_for_source() throws SQLException {
+ public void test_request_columnsfor_jdbc_connection() throws SQLException {
try (Connection connection = DriverManager.getConnection(URL, USER, PASSWORD)) {
try (Statement statement = connection.createStatement()) {
try (ResultSet resultSet1 = statement.executeQuery("select * from `group`")) {
diff --git a/src/test/java/org/assertj/db/database/h2/ReservedH2Database_DataSource_DDD_Test.java b/src/test/java/org/assertj/db/database/h2/ReservedH2Database_DataSource_DDD_Test.java
index 16f93ae6..bc49ab63 100644
--- a/src/test/java/org/assertj/db/database/h2/ReservedH2Database_DataSource_DDD_Test.java
+++ b/src/test/java/org/assertj/db/database/h2/ReservedH2Database_DataSource_DDD_Test.java
@@ -14,10 +14,9 @@
import static org.assertj.db.api.Assertions.assertThat;
-import javax.sql.DataSource;
-
import org.assertj.db.common.NeedReload;
import org.assertj.db.type.Changes;
+import org.assertj.db.type.ConnectionProvider;
import org.assertj.db.type.Table;
import org.assertj.db.type.Table.Order;
import org.junit.Before;
@@ -27,21 +26,22 @@
* Test on the H2 database with reserved names in SQL structure.
*
* @author Régis Pouiller
+ * @author Julien Roy
*/
public class ReservedH2Database_DataSource_DDD_Test extends AbstractReservedH2Test {
- private DataSource dataSource;
+ private ConnectionProvider connectionProvider;
@Before
public void init() {
- dataSource = dataSourceDDD;
+ connectionProvider = dsConnectionDDD;
}
@Test
@NeedReload
public void test_PrimaryKey_hasPksNames() {
- Table table1 = new Table(dataSource, "group", '`', '`');
- Table table2 = new Table(dataSource, "two words", '`', '`');
+ Table table1 = new Table(connectionProvider, "group", '`', '`');
+ Table table2 = new Table(connectionProvider, "two words", '`', '`');
Changes changes1 = new Changes(table1).setStartPointNow();
Changes changes2 = new Changes(table2).setStartPointNow();
update();
@@ -58,8 +58,8 @@ public void test_PrimaryKey_hasPksNames() {
@Test
@NeedReload
public void test_ColumnName_hasColumnName() {
- Table table1 = new Table(dataSource, "group", '`', '`');
- Table table2 = new Table(dataSource, "two words", '`', '`');
+ Table table1 = new Table(connectionProvider, "group", '`', '`');
+ Table table2 = new Table(connectionProvider, "two words", '`', '`');
Changes changes1 = new Changes(table1).setStartPointNow();
Changes changes2 = new Changes(table2).setStartPointNow();
update();
@@ -100,11 +100,11 @@ public void test_ColumnName_hasColumnName() {
@Test
@NeedReload
public void test_ColumnName_hasColumnName_with_columns_to_check() {
- Table table1 = new Table(dataSource, "group", '`', '`')
+ Table table1 = new Table(connectionProvider, "group", '`', '`')
.setColumnsToCheck(new String[]{
"read", "by", "select", "from"
});
- Table table2 = new Table(dataSource, "two words", '`', '`')
+ Table table2 = new Table(connectionProvider, "two words", '`', '`')
.setColumnsToCheck(new String[]{
"primary key", "column name", "test%test"
});
@@ -144,11 +144,11 @@ public void test_ColumnName_hasColumnName_with_columns_to_check() {
@Test
@NeedReload
public void test_ColumnName_hasColumnName_with_columns_to_exclude() {
- Table table1 = new Table(dataSource, "group", '`', '`')
+ Table table1 = new Table(connectionProvider, "group", '`', '`')
.setColumnsToExclude(new String[]{
"read", "by", "from"
});
- Table table2 = new Table(dataSource, "two words", '`', '`')
+ Table table2 = new Table(connectionProvider, "two words", '`', '`')
.setColumnsToExclude(new String[]{
"column name"
});
@@ -184,11 +184,11 @@ public void test_ColumnName_hasColumnName_with_columns_to_exclude() {
@Test
@NeedReload
public void test_ColumnName_hasColumnName_with_order() {
- Table table1 = new Table(dataSource, "group", '`', '`')
+ Table table1 = new Table(connectionProvider, "group", '`', '`')
.setColumnsToOrder(new Order[]{
Order.asc("where")
});
- Table table2 = new Table(dataSource, "two words", '`', '`')
+ Table table2 = new Table(connectionProvider, "two words", '`', '`')
.setColumnsToOrder(new Order[]{
Order.asc("primary key")
});
diff --git a/src/test/java/org/assertj/db/database/h2/ReservedH2Database_DataSource_NSNSNS_Test.java b/src/test/java/org/assertj/db/database/h2/ReservedH2Database_DataSource_NSNSNS_Test.java
index 3723d07d..e062982a 100644
--- a/src/test/java/org/assertj/db/database/h2/ReservedH2Database_DataSource_NSNSNS_Test.java
+++ b/src/test/java/org/assertj/db/database/h2/ReservedH2Database_DataSource_NSNSNS_Test.java
@@ -14,10 +14,9 @@
import static org.assertj.db.api.Assertions.assertThat;
-import javax.sql.DataSource;
-
import org.assertj.db.common.NeedReload;
import org.assertj.db.type.Changes;
+import org.assertj.db.type.ConnectionProvider;
import org.assertj.db.type.Table;
import org.assertj.db.type.Table.Order;
import org.junit.Before;
@@ -27,21 +26,22 @@
* Test on the H2 database with reserved names in SQL structure.
*
* @author Régis Pouiller
+ * @author Julien Roy
*/
public class ReservedH2Database_DataSource_NSNSNS_Test extends AbstractReservedH2Test {
- private DataSource dataSource;
+ private ConnectionProvider connectionProvider;
@Before
public void init() {
- dataSource = dataSourceNSNSNS;
+ connectionProvider = dsConnectionNSNSNS;
}
@Test
@NeedReload
public void test_PrimaryKey_hasPksNames() {
- Table table1 = new Table(dataSource, "GROUP", '`', '`');
- Table table2 = new Table(dataSource, "TWO WORDS", '`', '`');
+ Table table1 = new Table(connectionProvider, "GROUP", '`', '`');
+ Table table2 = new Table(connectionProvider, "TWO WORDS", '`', '`');
Changes changes1 = new Changes(table1).setStartPointNow();
Changes changes2 = new Changes(table2).setStartPointNow();
update();
@@ -57,8 +57,8 @@ public void test_PrimaryKey_hasPksNames() {
@Test
@NeedReload
public void test_ColumnName_hasColumnName() {
- Table table1 = new Table(dataSource, "GROUP", '`', '`');
- Table table2 = new Table(dataSource, "TWO WORDS", '`', '`');
+ Table table1 = new Table(connectionProvider, "GROUP", '`', '`');
+ Table table2 = new Table(connectionProvider, "TWO WORDS", '`', '`');
Changes changes1 = new Changes(table1).setStartPointNow();
Changes changes2 = new Changes(table2).setStartPointNow();
update();
@@ -99,11 +99,11 @@ public void test_ColumnName_hasColumnName() {
@Test
@NeedReload
public void test_ColumnName_hasColumnName_with_columns_to_check() {
- Table table1 = new Table(dataSource, "GROUP", '`', '`')
+ Table table1 = new Table(connectionProvider, "GROUP", '`', '`')
.setColumnsToCheck(new String[]{
"READ", "BY", "SELECT", "FROM"
});
- Table table2 = new Table(dataSource, "TWO WORDS", '`', '`')
+ Table table2 = new Table(connectionProvider, "TWO WORDS", '`', '`')
.setColumnsToCheck(new String[]{
"PRIMARY KEY", "COLUMN NAME", "TEST%TEST"
});
@@ -143,11 +143,11 @@ public void test_ColumnName_hasColumnName_with_columns_to_check() {
@Test
@NeedReload
public void test_ColumnName_hasColumnName_with_columns_to_exclude() {
- Table table1 = new Table(dataSource, "GROUP", '`', '`')
+ Table table1 = new Table(connectionProvider, "GROUP", '`', '`')
.setColumnsToExclude(new String[]{
"READ", "BY", "FROM"
});
- Table table2 = new Table(dataSource, "TWO WORDS", '`', '`')
+ Table table2 = new Table(connectionProvider, "TWO WORDS", '`', '`')
.setColumnsToExclude(new String[]{
"COLUMN NAME"
});
@@ -183,11 +183,11 @@ public void test_ColumnName_hasColumnName_with_columns_to_exclude() {
@Test
@NeedReload
public void test_ColumnName_hasColumnName_with_order() {
- Table table1 = new Table(dataSource, "GROUP", '`', '`')
+ Table table1 = new Table(connectionProvider, "GROUP", '`', '`')
.setColumnsToOrder(new Order[]{
Order.asc("WHERE")
});
- Table table2 = new Table(dataSource, "TWO WORDS", '`', '`')
+ Table table2 = new Table(connectionProvider, "TWO WORDS", '`', '`')
.setColumnsToOrder(new Order[]{
Order.asc("PRIMARY KEY")
});
diff --git a/src/test/java/org/assertj/db/database/h2/ReservedH2Database_DataSource_UIUIUI_Test.java b/src/test/java/org/assertj/db/database/h2/ReservedH2Database_DataSource_UIUIUI_Test.java
index 84395bdb..befbc0ea 100644
--- a/src/test/java/org/assertj/db/database/h2/ReservedH2Database_DataSource_UIUIUI_Test.java
+++ b/src/test/java/org/assertj/db/database/h2/ReservedH2Database_DataSource_UIUIUI_Test.java
@@ -14,10 +14,9 @@
import static org.assertj.db.api.Assertions.assertThat;
-import javax.sql.DataSource;
-
import org.assertj.db.common.NeedReload;
import org.assertj.db.type.Changes;
+import org.assertj.db.type.ConnectionProvider;
import org.assertj.db.type.Table;
import org.assertj.db.type.Table.Order;
import org.junit.Before;
@@ -27,21 +26,22 @@
* Test on the H2 database with reserved names in SQL structure.
*
* @author Régis Pouiller
+ * @author Julien Roy
*/
public class ReservedH2Database_DataSource_UIUIUI_Test extends AbstractReservedH2Test {
- private DataSource dataSource;
+ private ConnectionProvider connectionProvider;
@Before
public void init() {
- dataSource = dataSourceUIUIUI;
+ connectionProvider = dsConnectionUIUIUI;
}
@Test
@NeedReload
public void test_PrimaryKey_hasPksNames() {
- Table table1 = new Table(dataSource, "group", '`', '`');
- Table table2 = new Table(dataSource, "two words", '`', '`');
+ Table table1 = new Table(connectionProvider, "group", '`', '`');
+ Table table2 = new Table(connectionProvider, "two words", '`', '`');
Changes changes1 = new Changes(table1).setStartPointNow();
Changes changes2 = new Changes(table2).setStartPointNow();
update();
@@ -58,8 +58,8 @@ public void test_PrimaryKey_hasPksNames() {
@Test
@NeedReload
public void test_ColumnName_hasColumnName() {
- Table table1 = new Table(dataSource, "group", '`', '`');
- Table table2 = new Table(dataSource, "two words", '`', '`');
+ Table table1 = new Table(connectionProvider, "group", '`', '`');
+ Table table2 = new Table(connectionProvider, "two words", '`', '`');
Changes changes1 = new Changes(table1).setStartPointNow();
Changes changes2 = new Changes(table2).setStartPointNow();
update();
@@ -100,11 +100,11 @@ public void test_ColumnName_hasColumnName() {
@Test
@NeedReload
public void test_ColumnName_hasColumnName_with_columns_to_check() {
- Table table1 = new Table(dataSource, "group", '`', '`')
+ Table table1 = new Table(connectionProvider, "group", '`', '`')
.setColumnsToCheck(new String[]{
"read", "by", "select", "from"
});
- Table table2 = new Table(dataSource, "two words", '`', '`')
+ Table table2 = new Table(connectionProvider, "two words", '`', '`')
.setColumnsToCheck(new String[]{
"primary key", "column name", "test%test"
});
@@ -144,11 +144,11 @@ public void test_ColumnName_hasColumnName_with_columns_to_check() {
@Test
@NeedReload
public void test_ColumnName_hasColumnName_with_columns_to_exclude() {
- Table table1 = new Table(dataSource, "group", '`', '`')
+ Table table1 = new Table(connectionProvider, "group", '`', '`')
.setColumnsToExclude(new String[]{
"read", "by", "from"
});
- Table table2 = new Table(dataSource, "two words", '`', '`')
+ Table table2 = new Table(connectionProvider, "two words", '`', '`')
.setColumnsToExclude(new String[]{
"column name"
});
@@ -184,11 +184,11 @@ public void test_ColumnName_hasColumnName_with_columns_to_exclude() {
@Test
@NeedReload
public void test_ColumnName_hasColumnName_with_order() {
- Table table1 = new Table(dataSource, "group", '`', '`')
+ Table table1 = new Table(connectionProvider, "group", '`', '`')
.setColumnsToOrder(new Order[]{
Order.asc("where")
});
- Table table2 = new Table(dataSource, "two words", '`', '`')
+ Table table2 = new Table(connectionProvider, "two words", '`', '`')
.setColumnsToOrder(new Order[]{
Order.asc("primary key")
});
diff --git a/src/test/java/org/assertj/db/database/h2/ReservedH2Database_Source_DDD_Test.java b/src/test/java/org/assertj/db/database/h2/ReservedH2Database_JdbcUrl_DDD_Test.java
similarity index 86%
rename from src/test/java/org/assertj/db/database/h2/ReservedH2Database_Source_DDD_Test.java
rename to src/test/java/org/assertj/db/database/h2/ReservedH2Database_JdbcUrl_DDD_Test.java
index 5b1088dd..0d668687 100644
--- a/src/test/java/org/assertj/db/database/h2/ReservedH2Database_Source_DDD_Test.java
+++ b/src/test/java/org/assertj/db/database/h2/ReservedH2Database_JdbcUrl_DDD_Test.java
@@ -16,7 +16,7 @@
import org.assertj.db.common.NeedReload;
import org.assertj.db.type.Changes;
-import org.assertj.db.type.Source;
+import org.assertj.db.type.ConnectionProvider;
import org.assertj.db.type.Table;
import org.assertj.db.type.Table.Order;
import org.junit.Before;
@@ -26,21 +26,22 @@
* Test on the H2 database with reserved names in SQL structure.
*
* @author Régis Pouiller
+ * @author Julien Roy
*/
-public class ReservedH2Database_Source_DDD_Test extends AbstractReservedH2Test {
+public class ReservedH2Database_JdbcUrl_DDD_Test extends AbstractReservedH2Test {
- private Source source;
+ private ConnectionProvider connectionProvider;
@Before
public void init() {
- source = sourceDDD;
+ connectionProvider = jdbcConnectionDDD;
}
@Test
@NeedReload
public void test_PrimaryKey_hasPksNames() {
- Table table1 = new Table(source, "group", '`', '`');
- Table table2 = new Table(source, "two words", '`', '`');
+ Table table1 = new Table(connectionProvider, "group", '`', '`');
+ Table table2 = new Table(connectionProvider, "two words", '`', '`');
Changes changes1 = new Changes(table1).setStartPointNow();
Changes changes2 = new Changes(table2).setStartPointNow();
update();
@@ -56,8 +57,8 @@ public void test_PrimaryKey_hasPksNames() {
@Test
@NeedReload
public void test_ColumnName_hasColumnName() {
- Table table1 = new Table(source, "group", '`', '`');
- Table table2 = new Table(source, "two words", '`', '`');
+ Table table1 = new Table(connectionProvider, "group", '`', '`');
+ Table table2 = new Table(connectionProvider, "two words", '`', '`');
Changes changes1 = new Changes(table1).setStartPointNow();
Changes changes2 = new Changes(table2).setStartPointNow();
update();
@@ -98,11 +99,11 @@ public void test_ColumnName_hasColumnName() {
@Test
@NeedReload
public void test_ColumnName_hasColumnName_with_columns_to_check() {
- Table table1 = new Table(source, "group", '`', '`')
+ Table table1 = new Table(connectionProvider, "group", '`', '`')
.setColumnsToCheck(new String[]{
"read", "by", "select", "from"
});
- Table table2 = new Table(source, "two words", '`', '`')
+ Table table2 = new Table(connectionProvider, "two words", '`', '`')
.setColumnsToCheck(new String[]{
"primary key", "column name", "test%test"
});
@@ -142,11 +143,11 @@ public void test_ColumnName_hasColumnName_with_columns_to_check() {
@Test
@NeedReload
public void test_ColumnName_hasColumnName_with_columns_to_exclude() {
- Table table1 = new Table(source, "group", '`', '`')
+ Table table1 = new Table(connectionProvider, "group", '`', '`')
.setColumnsToExclude(new String[]{
"read", "by", "from"
});
- Table table2 = new Table(source, "two words", '`', '`')
+ Table table2 = new Table(connectionProvider, "two words", '`', '`')
.setColumnsToExclude(new String[]{
"column name"
});
@@ -182,11 +183,11 @@ public void test_ColumnName_hasColumnName_with_columns_to_exclude() {
@Test
@NeedReload
public void test_ColumnName_hasColumnName_with_order() {
- Table table1 = new Table(source, "group", '`', '`')
+ Table table1 = new Table(connectionProvider, "group", '`', '`')
.setColumnsToOrder(new Order[]{
Order.asc("where")
});
- Table table2 = new Table(source, "two words", '`', '`')
+ Table table2 = new Table(connectionProvider, "two words", '`', '`')
.setColumnsToOrder(new Order[]{
Order.asc("primary key")
});
diff --git a/src/test/java/org/assertj/db/database/h2/ReservedH2Database_Source_NSNSNS_Test.java b/src/test/java/org/assertj/db/database/h2/ReservedH2Database_JdbcUrl_NSNSNS_Test.java
similarity index 86%
rename from src/test/java/org/assertj/db/database/h2/ReservedH2Database_Source_NSNSNS_Test.java
rename to src/test/java/org/assertj/db/database/h2/ReservedH2Database_JdbcUrl_NSNSNS_Test.java
index 1a204299..05d3ddac 100644
--- a/src/test/java/org/assertj/db/database/h2/ReservedH2Database_Source_NSNSNS_Test.java
+++ b/src/test/java/org/assertj/db/database/h2/ReservedH2Database_JdbcUrl_NSNSNS_Test.java
@@ -16,7 +16,7 @@
import org.assertj.db.common.NeedReload;
import org.assertj.db.type.Changes;
-import org.assertj.db.type.Source;
+import org.assertj.db.type.ConnectionProvider;
import org.assertj.db.type.Table;
import org.assertj.db.type.Table.Order;
import org.junit.Before;
@@ -26,21 +26,22 @@
* Test on the H2 database with reserved names in SQL structure.
*
* @author Régis Pouiller
+ * @author Julien Roy
*/
-public class ReservedH2Database_Source_NSNSNS_Test extends AbstractReservedH2Test {
+public class ReservedH2Database_JdbcUrl_NSNSNS_Test extends AbstractReservedH2Test {
- private Source source;
+ private ConnectionProvider connectionProvider;
@Before
public void init() {
- source = sourceNSNSNS;
+ connectionProvider = jdbcConnectionNSNSNS;
}
@Test
@NeedReload
public void test_PrimaryKey_hasPksNames() {
- Table table1 = new Table(source, "GROUP", '`', '`');
- Table table2 = new Table(source, "TWO WORDS", '`', '`');
+ Table table1 = new Table(connectionProvider, "GROUP", '`', '`');
+ Table table2 = new Table(connectionProvider, "TWO WORDS", '`', '`');
Changes changes1 = new Changes(table1).setStartPointNow();
Changes changes2 = new Changes(table2).setStartPointNow();
update();
@@ -56,8 +57,8 @@ public void test_PrimaryKey_hasPksNames() {
@Test
@NeedReload
public void test_ColumnName_hasColumnName() {
- Table table1 = new Table(source, "GROUP", '`', '`');
- Table table2 = new Table(source, "TWO WORDS", '`', '`');
+ Table table1 = new Table(connectionProvider, "GROUP", '`', '`');
+ Table table2 = new Table(connectionProvider, "TWO WORDS", '`', '`');
Changes changes1 = new Changes(table1).setStartPointNow();
Changes changes2 = new Changes(table2).setStartPointNow();
update();
@@ -98,11 +99,11 @@ public void test_ColumnName_hasColumnName() {
@Test
@NeedReload
public void test_ColumnName_hasColumnName_with_columns_to_check() {
- Table table1 = new Table(source, "GROUP", '`', '`')
+ Table table1 = new Table(connectionProvider, "GROUP", '`', '`')
.setColumnsToCheck(new String[]{
"READ", "BY", "SELECT", "FROM"
});
- Table table2 = new Table(source, "TWO WORDS", '`', '`')
+ Table table2 = new Table(connectionProvider, "TWO WORDS", '`', '`')
.setColumnsToCheck(new String[]{
"PRIMARY KEY", "COLUMN NAME", "TEST%TEST"
});
@@ -142,11 +143,11 @@ public void test_ColumnName_hasColumnName_with_columns_to_check() {
@Test
@NeedReload
public void test_ColumnName_hasColumnName_with_columns_to_exclude() {
- Table table1 = new Table(source, "GROUP", '`', '`')
+ Table table1 = new Table(connectionProvider, "GROUP", '`', '`')
.setColumnsToExclude(new String[]{
"READ", "BY", "FROM"
});
- Table table2 = new Table(source, "TWO WORDS", '`', '`')
+ Table table2 = new Table(connectionProvider, "TWO WORDS", '`', '`')
.setColumnsToExclude(new String[]{
"COLUMN NAME"
});
@@ -182,11 +183,11 @@ public void test_ColumnName_hasColumnName_with_columns_to_exclude() {
@Test
@NeedReload
public void test_ColumnName_hasColumnName_with_order() {
- Table table1 = new Table(source, "GROUP", '`', '`')
+ Table table1 = new Table(connectionProvider, "GROUP", '`', '`')
.setColumnsToOrder(new Order[]{
Order.asc("WHERE")
});
- Table table2 = new Table(source, "TWO WORDS", '`', '`')
+ Table table2 = new Table(connectionProvider, "TWO WORDS", '`', '`')
.setColumnsToOrder(new Order[]{
Order.asc("PRIMARY KEY")
});
diff --git a/src/test/java/org/assertj/db/database/h2/ReservedH2Database_Source_UIUIUI_Test.java b/src/test/java/org/assertj/db/database/h2/ReservedH2Database_JdbcUrl_UIUIUI_Test.java
similarity index 86%
rename from src/test/java/org/assertj/db/database/h2/ReservedH2Database_Source_UIUIUI_Test.java
rename to src/test/java/org/assertj/db/database/h2/ReservedH2Database_JdbcUrl_UIUIUI_Test.java
index fae85ba9..cbec650a 100644
--- a/src/test/java/org/assertj/db/database/h2/ReservedH2Database_Source_UIUIUI_Test.java
+++ b/src/test/java/org/assertj/db/database/h2/ReservedH2Database_JdbcUrl_UIUIUI_Test.java
@@ -16,7 +16,7 @@
import org.assertj.db.common.NeedReload;
import org.assertj.db.type.Changes;
-import org.assertj.db.type.Source;
+import org.assertj.db.type.ConnectionProvider;
import org.assertj.db.type.Table;
import org.assertj.db.type.Table.Order;
import org.junit.Before;
@@ -26,21 +26,22 @@
* Test on the H2 database with reserved names in SQL structure.
*
* @author Régis Pouiller
+ * @author Julien Roy
*/
-public class ReservedH2Database_Source_UIUIUI_Test extends AbstractReservedH2Test {
+public class ReservedH2Database_JdbcUrl_UIUIUI_Test extends AbstractReservedH2Test {
- private Source source;
+ private ConnectionProvider connectionProvider;
@Before
public void init() {
- source = sourceUIUIUI;
+ connectionProvider = jdbcConnectionUIUIUI;
}
@Test
@NeedReload
public void test_PrimaryKey_hasPksNames() {
- Table table1 = new Table(source, "group", '`', '`');
- Table table2 = new Table(source, "two words", '`', '`');
+ Table table1 = new Table(connectionProvider, "group", '`', '`');
+ Table table2 = new Table(connectionProvider, "two words", '`', '`');
Changes changes1 = new Changes(table1).setStartPointNow();
Changes changes2 = new Changes(table2).setStartPointNow();
update();
@@ -57,8 +58,8 @@ public void test_PrimaryKey_hasPksNames() {
@Test
@NeedReload
public void test_ColumnName_hasColumnName() {
- Table table1 = new Table(source, "group", '`', '`');
- Table table2 = new Table(source, "two words", '`', '`');
+ Table table1 = new Table(connectionProvider, "group", '`', '`');
+ Table table2 = new Table(connectionProvider, "two words", '`', '`');
Changes changes1 = new Changes(table1).setStartPointNow();
Changes changes2 = new Changes(table2).setStartPointNow();
update();
@@ -99,11 +100,11 @@ public void test_ColumnName_hasColumnName() {
@Test
@NeedReload
public void test_ColumnName_hasColumnName_with_columns_to_check() {
- Table table1 = new Table(source, "group", '`', '`')
+ Table table1 = new Table(connectionProvider, "group", '`', '`')
.setColumnsToCheck(new String[]{
"read", "by", "select", "from"
});
- Table table2 = new Table(source, "two words", '`', '`')
+ Table table2 = new Table(connectionProvider, "two words", '`', '`')
.setColumnsToCheck(new String[]{
"primary key", "column name", "test%test"
});
@@ -143,11 +144,11 @@ public void test_ColumnName_hasColumnName_with_columns_to_check() {
@Test
@NeedReload
public void test_ColumnName_hasColumnName_with_columns_to_exclude() {
- Table table1 = new Table(source, "group", '`', '`')
+ Table table1 = new Table(connectionProvider, "group", '`', '`')
.setColumnsToExclude(new String[]{
"read", "by", "from"
});
- Table table2 = new Table(source, "two words", '`', '`')
+ Table table2 = new Table(connectionProvider, "two words", '`', '`')
.setColumnsToExclude(new String[]{
"column name"
});
@@ -183,11 +184,11 @@ public void test_ColumnName_hasColumnName_with_columns_to_exclude() {
@Test
@NeedReload
public void test_ColumnName_hasColumnName_with_order() {
- Table table1 = new Table(source, "group", '`', '`')
+ Table table1 = new Table(connectionProvider, "group", '`', '`')
.setColumnsToOrder(new Order[]{
Order.asc("where")
});
- Table table2 = new Table(source, "two words", '`', '`')
+ Table table2 = new Table(connectionProvider, "two words", '`', '`')
.setColumnsToOrder(new Order[]{
Order.asc("primary key")
});
diff --git a/src/test/java/org/assertj/db/database/hsqldb/AbstractHsqldbTest.java b/src/test/java/org/assertj/db/database/hsqldb/AbstractHsqldbTest.java
index 6d5594e5..1af758f1 100644
--- a/src/test/java/org/assertj/db/database/hsqldb/AbstractHsqldbTest.java
+++ b/src/test/java/org/assertj/db/database/hsqldb/AbstractHsqldbTest.java
@@ -26,8 +26,8 @@
import javax.sql.DataSource;
import org.assertj.db.database.AbstractDatabaseTest;
-import org.assertj.db.type.DataSourceWithLetterCase;
-import org.assertj.db.type.SourceWithLetterCase;
+import org.assertj.db.type.ConnectionProvider;
+import org.assertj.db.type.ConnectionProviderFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.context.ContextConfiguration;
@@ -40,6 +40,7 @@
* Parent for all the tests which are specific for HSQLDB database.
*
* @author Régis Pouiller
+ * @author Julien Roy
*/
@ContextConfiguration(classes = {HsqldbConfiguration.class})
public abstract class AbstractHsqldbTest extends AbstractDatabaseTest {
@@ -77,12 +78,12 @@ public abstract class AbstractHsqldbTest extends AbstractDatabaseTest {
private static final DbSetup DB_SETUP = new DbSetup(new DriverManagerDestination("jdbc:hsqldb:mem:testHsqldb", "SA", ""),
OPERATIONS);
- protected final SourceWithLetterCase sourceUIUIUI = new SourceWithLetterCase("jdbc:hsqldb:mem:testHsqldb", "SA", "",
+ protected final ConnectionProvider jdbcConnectionUIUIUI = ConnectionProviderFactory.of("jdbc:hsqldb:mem:testHsqldb", "SA", "").letterCase(
letterCaseUI,
letterCaseUI,
- letterCaseUI);
- protected DataSourceWithLetterCase dataSourceUIUIUI;
- protected DataSourceWithLetterCase dataSourceNSNSNS;
+ letterCaseUI).create();
+ protected ConnectionProvider dsConnectionUIUIUI;
+ protected ConnectionProvider dsConnectionNSNSNS;
protected DbSetup getDbSetup() {
return DB_SETUP;
@@ -94,8 +95,8 @@ protected DbSetupTracker getDbSetupTracker() {
@Autowired
protected void setDataSource(DataSource dataSource) {
- this.dataSourceUIUIUI = new DataSourceWithLetterCase(dataSource, letterCaseUI, letterCaseUI, letterCaseUI);
- this.dataSourceNSNSNS = new DataSourceWithLetterCase(dataSource, letterCaseNS, letterCaseNS, letterCaseNS);
+ this.dsConnectionUIUIUI = ConnectionProviderFactory.of(dataSource).letterCase(letterCaseUI, letterCaseUI, letterCaseUI).create();
+ this.dsConnectionNSNSNS = ConnectionProviderFactory.of(dataSource).letterCase(letterCaseNS, letterCaseNS, letterCaseNS).create();
}
protected void update() {
diff --git a/src/test/java/org/assertj/db/database/hsqldb/HsqldbDataBase_Test.java b/src/test/java/org/assertj/db/database/hsqldb/HsqldbDataBase_Test.java
index 62bb0e02..8eb7bb83 100644
--- a/src/test/java/org/assertj/db/database/hsqldb/HsqldbDataBase_Test.java
+++ b/src/test/java/org/assertj/db/database/hsqldb/HsqldbDataBase_Test.java
@@ -44,7 +44,7 @@ public void test_catalog_for_data_source() throws SQLException {
}
@Test
- public void test_catalog_for_source() throws SQLException {
+ public void test_catalogfor_jdbc_connection() throws SQLException {
try (Connection connection = DriverManager.getConnection(URL, USER, PASSWORD)) {
String catalog = connection.getCatalog();
assertThat(catalog).isEqualTo("PUBLIC");
@@ -60,7 +60,7 @@ public void test_schema_for_data_source() throws SQLException {
}
@Test
- public void test_schema_for_source() throws SQLException {
+ public void test_schemafor_jdbc_connection() throws SQLException {
try (Connection connection = DriverManager.getConnection(URL, USER, PASSWORD)) {
String schema = connection.getSchema();
assertThat(schema).isEqualTo("PUBLIC");
@@ -79,7 +79,7 @@ public void test_tables_for_data_source() throws SQLException {
}
@Test
- public void test_tables_for_source() throws SQLException {
+ public void test_tablesfor_jdbc_connection() throws SQLException {
try (Connection connection = DriverManager.getConnection(URL, USER, PASSWORD)) {
DatabaseMetaData databaseMetaData = connection.getMetaData();
ResultSet resultSet = databaseMetaData.getTables("PUBLIC", "PUBLIC", null, new String[]{"TABLE"});
@@ -107,7 +107,7 @@ public void test_table_primary_keys_for_data_source() throws SQLException {
}
@Test
- public void test_table_primary_keys_for_source() throws SQLException {
+ public void test_table_primary_keysfor_jdbc_connection() throws SQLException {
try (Connection connection = DriverManager.getConnection(URL, USER, PASSWORD)) {
DatabaseMetaData databaseMetaData = connection.getMetaData();
{
@@ -191,7 +191,7 @@ public void test_table_columns_for_data_source() throws SQLException {
}
@Test
- public void test_table_columns_for_source() throws SQLException {
+ public void test_table_columnsfor_jdbc_connection() throws SQLException {
try (Connection connection = DriverManager.getConnection(URL, USER, PASSWORD)) {
DatabaseMetaData databaseMetaData = connection.getMetaData();
{
@@ -296,7 +296,7 @@ public void test_request_columns_for_data_source() throws SQLException {
}
@Test
- public void test_request_columns_for_source() throws SQLException {
+ public void test_request_columnsfor_jdbc_connection() throws SQLException {
try (Connection connection = DriverManager.getConnection(URL, USER, PASSWORD)) {
try (Statement statement = connection.createStatement()) {
try (ResultSet resultSet1 = statement.executeQuery("select * from test")) {
diff --git a/src/test/java/org/assertj/db/database/hsqldb/HsqldbDatabase_Source_UIUIUI_Test.java b/src/test/java/org/assertj/db/database/hsqldb/HsqldbDatabase_JdbcUrl_UIUIUI_Test.java
similarity index 97%
rename from src/test/java/org/assertj/db/database/hsqldb/HsqldbDatabase_Source_UIUIUI_Test.java
rename to src/test/java/org/assertj/db/database/hsqldb/HsqldbDatabase_JdbcUrl_UIUIUI_Test.java
index d41772f1..d889a8f6 100644
--- a/src/test/java/org/assertj/db/database/hsqldb/HsqldbDatabase_Source_UIUIUI_Test.java
+++ b/src/test/java/org/assertj/db/database/hsqldb/HsqldbDatabase_JdbcUrl_UIUIUI_Test.java
@@ -23,9 +23,9 @@
import org.assertj.db.common.NeedReload;
import org.assertj.db.type.Changes;
+import org.assertj.db.type.ConnectionProvider;
import org.assertj.db.type.DateTimeValue;
import org.assertj.db.type.DateValue;
-import org.assertj.db.type.Source;
import org.assertj.db.type.Table;
import org.assertj.db.type.TimeValue;
import org.assertj.db.type.ValueType;
@@ -36,20 +36,21 @@
* Test on the HSQLDB database.
*
* @author Régis Pouiller
+ * @author Julien Roy
*/
-public class HsqldbDatabase_Source_UIUIUI_Test extends AbstractHsqldbTest {
+public class HsqldbDatabase_JdbcUrl_UIUIUI_Test extends AbstractHsqldbTest {
- private Source source = sourceUIUIUI;
+ private ConnectionProvider connectionProvider = jdbcConnectionUIUIUI;
@Before
public void init() {
- source = sourceUIUIUI;
+ connectionProvider = jdbcConnectionUIUIUI;
}
@Test
@NeedReload
public void test_PrimaryKey_hasPksNames() {
- Table table = new Table(source, "test");
+ Table table = new Table(connectionProvider, "test");
Changes changes = new Changes(table).setStartPointNow();
update();
changes.setEndPointNow();
@@ -61,7 +62,7 @@ public void test_PrimaryKey_hasPksNames() {
@Test
@NeedReload
public void test_ColumnName_hasColumnName() {
- Table table = new Table(source, "test");
+ Table table = new Table(connectionProvider, "test");
Changes changes = new Changes(table).setStartPointNow();
update();
changes.setEndPointNow();
@@ -128,7 +129,7 @@ public void test_ColumnName_hasColumnName() {
@Test
@NeedReload
public void test_ColumnClass_isOfClass() {
- Table table = new Table(source, "test");
+ Table table = new Table(connectionProvider, "test");
Changes changes = new Changes(table).setStartPointNow();
update();
changes.setEndPointNow();
@@ -195,7 +196,7 @@ public void test_ColumnClass_isOfClass() {
@Test
@NeedReload
public void test_ColumnEquality_hasValues() {
- Table table = new Table(source, "test");
+ Table table = new Table(connectionProvider, "test");
Changes changes = new Changes(table).setStartPointNow();
update();
changes.setEndPointNow();
@@ -262,7 +263,7 @@ public void test_ColumnEquality_hasValues() {
@Test
@NeedReload
public void test_ColumnEquality_containsValues() {
- Table table = new Table(source, "test");
+ Table table = new Table(connectionProvider, "test");
Changes changes = new Changes(table).setStartPointNow();
update();
changes.setEndPointNow();
@@ -300,7 +301,7 @@ public void test_ColumnEquality_containsValues() {
@Test
@NeedReload
public void test_ColumnType_isOfType() {
- Table table = new Table(source, "test");
+ Table table = new Table(connectionProvider, "test");
Changes changes = new Changes(table).setStartPointNow();
update();
changes.setEndPointNow();
@@ -367,7 +368,7 @@ public void test_ColumnType_isOfType() {
@Test
@NeedReload
public void test_ColumnOfChangeEquality_hasValues() {
- Table table = new Table(source, "test");
+ Table table = new Table(connectionProvider, "test");
Changes changes = new Changes(table).setStartPointNow();
update();
changes.setEndPointNow();
@@ -441,7 +442,7 @@ public void test_ColumnOfChangeEquality_hasValues() {
@Test
@NeedReload
public void test_RowEquality_hasValues() {
- Table table = new Table(source, "test");
+ Table table = new Table(connectionProvider, "test");
Changes changes = new Changes(table).setStartPointNow();
update();
changes.setEndPointNow();
@@ -508,7 +509,7 @@ public void test_RowEquality_hasValues() {
@Test
@NeedReload
public void test_ValueClass_isOfClass() {
- Table table = new Table(source, "test");
+ Table table = new Table(connectionProvider, "test");
Changes changes = new Changes(table).setStartPointNow();
update();
changes.setEndPointNow();
@@ -575,7 +576,7 @@ public void test_ValueClass_isOfClass() {
@Test
@NeedReload
public void test_ValueEquality_isEqualTo() {
- Table table = new Table(source, "test");
+ Table table = new Table(connectionProvider, "test");
Changes changes = new Changes(table).setStartPointNow();
update();
changes.setEndPointNow();
@@ -642,7 +643,7 @@ public void test_ValueEquality_isEqualTo() {
@Test
@NeedReload
public void test_ValueNonEquality_isNotEqualTo() {
- Table table = new Table(source, "test");
+ Table table = new Table(connectionProvider, "test");
Changes changes = new Changes(table).setStartPointNow();
update();
changes.setEndPointNow();
@@ -709,7 +710,7 @@ public void test_ValueNonEquality_isNotEqualTo() {
@Test
@NeedReload
public void test_ValueType_isOfType() {
- Table table = new Table(source, "test");
+ Table table = new Table(connectionProvider, "test");
Changes changes = new Changes(table).setStartPointNow();
update();
changes.setEndPointNow();
diff --git a/src/test/java/org/assertj/db/database/sqlite/AbstractSqliteTest.java b/src/test/java/org/assertj/db/database/sqlite/AbstractSqliteTest.java
index d46c3484..e8d9573f 100644
--- a/src/test/java/org/assertj/db/database/sqlite/AbstractSqliteTest.java
+++ b/src/test/java/org/assertj/db/database/sqlite/AbstractSqliteTest.java
@@ -24,8 +24,8 @@
import javax.sql.DataSource;
import org.assertj.db.database.AbstractDatabaseTest;
-import org.assertj.db.type.DataSourceWithLetterCase;
-import org.assertj.db.type.SourceWithLetterCase;
+import org.assertj.db.type.ConnectionProvider;
+import org.assertj.db.type.ConnectionProviderFactory;
import org.assertj.db.type.lettercase.LetterCase;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.context.ContextConfiguration;
@@ -39,6 +39,7 @@
* Parent for all the tests which are specific for Derby database.
*
* @author Régis Pouiller
+ * @author Julien Roy
*/
@ContextConfiguration(classes = {SqliteConfiguration.class})
public abstract class AbstractSqliteTest extends AbstractDatabaseTest {
@@ -75,22 +76,22 @@ public abstract class AbstractSqliteTest extends AbstractDatabaseTest {
private static final DbSetup DB_SETUP = new DbSetup(new DriverManagerDestination("jdbc:sqlite:target/testDerby.db", "", ""),
OPERATIONS);
- protected final SourceWithLetterCase sourceDDD = new SourceWithLetterCase("jdbc:sqlite:target/testDerby.db", "", "",
+ protected final ConnectionProvider jdbcConnectionDDD = ConnectionProviderFactory.of("jdbc:sqlite:target/testDerby.db", "", "").letterCase(
LetterCase.TABLE_DEFAULT,
LetterCase.COLUMN_DEFAULT,
- LetterCase.PRIMARY_KEY_DEFAULT);
- protected final SourceWithLetterCase sourceUIUIUI = new SourceWithLetterCase("jdbc:sqlite:target/testDerby.db", "", "",
+ LetterCase.PRIMARY_KEY_DEFAULT).create();
+ protected final ConnectionProvider jdbcConnectionUIUIUI = ConnectionProviderFactory.of("jdbc:sqlite:target/testDerby.db", "", "").letterCase(
letterCaseUI,
letterCaseUI,
- letterCaseUI);
- protected final SourceWithLetterCase sourceNSNSNS = new SourceWithLetterCase("jdbc:sqlite:target/testDerby.db", "", "",
+ letterCaseUI).create();
+ protected final ConnectionProvider jdbcConnectionNSNSNS = ConnectionProviderFactory.of("jdbc:sqlite:target/testDerby.db", "", "").letterCase(
letterCaseNS,
letterCaseNS,
- letterCaseNS);
+ letterCaseNS).create();
protected DataSource dataSource;
- protected DataSourceWithLetterCase dataSourceDDD;
- protected DataSourceWithLetterCase dataSourceUIUIUI;
- protected DataSourceWithLetterCase dataSourceNSNSNS;
+ protected ConnectionProvider dsConnectionDDD;
+ protected ConnectionProvider dsConnectionUIUIUI;
+ protected ConnectionProvider dsConnectionNSNSNS;
protected DbSetup getDbSetup() {
return DB_SETUP;
@@ -103,11 +104,9 @@ protected DbSetupTracker getDbSetupTracker() {
@Autowired
protected void setDataSource(DataSource dataSource) {
this.dataSource = dataSource;
- this.dataSourceDDD = new DataSourceWithLetterCase(dataSource, LetterCase.TABLE_DEFAULT,
- LetterCase.COLUMN_DEFAULT,
- LetterCase.PRIMARY_KEY_DEFAULT);
- this.dataSourceUIUIUI = new DataSourceWithLetterCase(dataSource, letterCaseUI, letterCaseUI, letterCaseUI);
- this.dataSourceNSNSNS = new DataSourceWithLetterCase(dataSource, letterCaseNS, letterCaseNS, letterCaseNS);
+ this.dsConnectionDDD = ConnectionProviderFactory.of(dataSource).letterCase(LetterCase.TABLE_DEFAULT, LetterCase.COLUMN_DEFAULT, LetterCase.PRIMARY_KEY_DEFAULT).create();
+ this.dsConnectionUIUIUI = ConnectionProviderFactory.of(dataSource).letterCase(letterCaseUI, letterCaseUI, letterCaseUI).create();
+ this.dsConnectionNSNSNS = ConnectionProviderFactory.of(dataSource).letterCase(letterCaseNS, letterCaseNS, letterCaseNS).create();
}
protected void update() {
diff --git a/src/test/java/org/assertj/db/database/sqlite/SqliteDataBase_Test.java b/src/test/java/org/assertj/db/database/sqlite/SqliteDataBase_Test.java
index 2d568606..a89ef462 100644
--- a/src/test/java/org/assertj/db/database/sqlite/SqliteDataBase_Test.java
+++ b/src/test/java/org/assertj/db/database/sqlite/SqliteDataBase_Test.java
@@ -44,7 +44,7 @@ public void test_catalog_for_data_source() throws SQLException {
}
@Test
- public void test_catalog_for_source() throws SQLException {
+ public void test_catalog_for_jdbc_connection() throws SQLException {
try (Connection connection = DriverManager.getConnection(URL, USER, PASSWORD)) {
String catalog = connection.getCatalog();
assertThat(catalog).isNull();
@@ -60,7 +60,7 @@ public void test_schema_for_data_source() throws SQLException {
}
@Test
- public void test_schema_for_source() throws SQLException {
+ public void test_schema_for_jdbc_connection() throws SQLException {
try (Connection connection = DriverManager.getConnection(URL, USER, PASSWORD)) {
String schema = connection.getSchema();
assertThat(schema).isNull();
@@ -79,7 +79,7 @@ public void test_tables_for_data_source() throws SQLException {
}
@Test
- public void test_tables_for_source() throws SQLException {
+ public void test_tables_for_jdbc_connection() throws SQLException {
try (Connection connection = DriverManager.getConnection(URL, USER, PASSWORD)) {
DatabaseMetaData databaseMetaData = connection.getMetaData();
ResultSet resultSet = databaseMetaData.getTables(null, null, null, new String[]{"TABLE"});
@@ -109,7 +109,7 @@ public void test_table_primary_keys_for_data_source() throws SQLException {
}
@Test
- public void test_table_primary_keys_for_source() throws SQLException {
+ public void test_table_primary_keys_for_jdbc_connection() throws SQLException {
try (Connection connection = DriverManager.getConnection(URL, USER, PASSWORD)) {
DatabaseMetaData databaseMetaData = connection.getMetaData();
{
@@ -223,7 +223,7 @@ public void test_table_columns_for_data_source() throws SQLException {
}
@Test
- public void test_table_columns_for_source() throws SQLException {
+ public void test_table_columnsfor_jdbc_connection() throws SQLException {
try (Connection connection = DriverManager.getConnection(URL, USER, PASSWORD)) {
DatabaseMetaData databaseMetaData = connection.getMetaData();
{
@@ -350,7 +350,7 @@ public void test_request_columns_for_data_source() throws SQLException {
}
@Test
- public void test_request_columns_for_source() throws SQLException {
+ public void test_request_columnsfor_jdbc_connection() throws SQLException {
try (Connection connection = DriverManager.getConnection(URL, USER, PASSWORD)) {
try (Statement statement = connection.createStatement()) {
try (ResultSet resultSet1 = statement.executeQuery("select * from test")) {
diff --git a/src/test/java/org/assertj/db/database/sqlite/SqliteDatabase_DataSource_DDD_Test.java b/src/test/java/org/assertj/db/database/sqlite/SqliteDatabase_DataSource_DDD_Test.java
index fdca12f4..be3b89d1 100644
--- a/src/test/java/org/assertj/db/database/sqlite/SqliteDatabase_DataSource_DDD_Test.java
+++ b/src/test/java/org/assertj/db/database/sqlite/SqliteDatabase_DataSource_DDD_Test.java
@@ -17,12 +17,12 @@
import java.io.ByteArrayOutputStream;
import java.sql.Date;
-import javax.sql.DataSource;
import org.assertj.core.api.Assertions;
import org.assertj.db.common.NeedReload;
import org.assertj.db.output.Outputs;
import org.assertj.db.type.Changes;
+import org.assertj.db.type.ConnectionProvider;
import org.assertj.db.type.DateValue;
import org.assertj.db.type.Table;
import org.assertj.db.type.ValueType;
@@ -33,20 +33,21 @@
* Test on the Sqlite database.
*
* @author Régis Pouiller
+ * @author Julien Roy
*/
public class SqliteDatabase_DataSource_DDD_Test extends AbstractSqliteTest {
- private DataSource dataSource;
+ private ConnectionProvider connectionProvider;
@Before
public void init() {
- dataSource = dataSourceDDD;
+ connectionProvider = dsConnectionDDD;
}
@Test
@NeedReload
public void test_Outputs_output() {
- Table table = new Table(dataSource, "test", null, new String[]{"var20"});
+ Table table = new Table(connectionProvider, "test", null, new String[]{"var20"});
Changes changes = new Changes(table).setStartPointNow();
update();
changes.setEndPointNow();
@@ -114,7 +115,7 @@ public void test_Outputs_output() {
+ "|----------|%n"
+ "| 1 |%n"
+ "|----------|%n"));
- Assertions.assertThat(byteArrayOutputStream5.toString()).isEqualTo(String.format("[Changes on teSt table of a data source]%n"
+ Assertions.assertThat(byteArrayOutputStream5.toString()).isEqualTo(String.format("[Changes on teSt table of 'data source']%n"
+ "|-----------|--------------|-------|---------|----------------|-----------|-----------|-----------|-----------|-----------|------------|-----------|-----------|-----------|-----------|------------|------------|------------|------------|------------|------------|------------|-----------------------|------------|%n"
+ "| | | | | | * | | | | | | | | | | | | | | | | | | |%n"
+ "| | TYPE | TABLE | PRIMARY | | VAR1 | VAR2 | VAR3 | VAR4 | VAR5 | VAR6 | VAR7 | VAR8 | VAR9 | VAR10 | VAR11 | VAR12 | VAR13 | VAR14 | VAR15 | VAR16 | VAR17 | VAR18 | VAR19 |%n"
@@ -125,7 +126,7 @@ public void test_Outputs_output() {
+ "| Index : 0 | MODIFICATION | teSt | 1 |----------------|-----------|-----------|-----------|-----------|-----------|------------|-----------|-----------|-----------|-----------|------------|------------|------------|------------|------------|------------|------------|-----------------------|------------|%n"
+ "| | | | | At end point | 1 | 13 | 2 | 14 | 15 | 2007-12-23 | 3.3 | 4.4 | 5.5 | 6.6 | 20 | 8 | 16 | 9 | 10.1 | 11 | 09:01:00 | 2007-12-23 09:01:00.0 | 12 |%n"
+ "|-----------|--------------|-------|---------|----------------|-----------|-----------|-----------|-----------|-----------|------------|-----------|-----------|-----------|-----------|------------|------------|------------|------------|------------|------------|------------|-----------------------|------------|%n"));
- Assertions.assertThat(byteArrayOutputStream6.toString()).isEqualTo(String.format("[Change at index 0 (with primary key : [1]) of Changes on teSt table of a data source]%n"
+ Assertions.assertThat(byteArrayOutputStream6.toString()).isEqualTo(String.format("[Change at index 0 (with primary key : [1]) of Changes on teSt table of 'data source']%n"
+ "|--------------|-------|---------|----------------|-----------|-----------|-----------|-----------|-----------|------------|-----------|-----------|-----------|-----------|------------|------------|------------|------------|------------|------------|------------|-----------------------|------------|%n"
+ "| | | | | * | | | | | | | | | | | | | | | | | | |%n"
+ "| TYPE | TABLE | PRIMARY | | VAR1 | VAR2 | VAR3 | VAR4 | VAR5 | VAR6 | VAR7 | VAR8 | VAR9 | VAR10 | VAR11 | VAR12 | VAR13 | VAR14 | VAR15 | VAR16 | VAR17 | VAR18 | VAR19 |%n"
@@ -136,7 +137,7 @@ public void test_Outputs_output() {
+ "| MODIFICATION | teSt | 1 |----------------|-----------|-----------|-----------|-----------|-----------|------------|-----------|-----------|-----------|-----------|------------|------------|------------|------------|------------|------------|------------|-----------------------|------------|%n"
+ "| | | | At end point | 1 | 13 | 2 | 14 | 15 | 2007-12-23 | 3.3 | 4.4 | 5.5 | 6.6 | 20 | 8 | 16 | 9 | 10.1 | 11 | 09:01:00 | 2007-12-23 09:01:00.0 | 12 |%n"
+ "|--------------|-------|---------|----------------|-----------|-----------|-----------|-----------|-----------|------------|-----------|-----------|-----------|-----------|------------|------------|------------|------------|------------|------------|------------|-----------------------|------------|%n"));
- Assertions.assertThat(byteArrayOutputStream7.toString()).isEqualTo(String.format("[Row at end point of Change at index 0 (with primary key : [1]) of Changes on teSt table of a data source]%n"
+ Assertions.assertThat(byteArrayOutputStream7.toString()).isEqualTo(String.format("[Row at end point of Change at index 0 (with primary key : [1]) of Changes on teSt table of 'data source']%n"
+ "|---------|-----------|-----------|-----------|-----------|-----------|------------|-----------|-----------|-----------|-----------|------------|------------|------------|------------|------------|------------|------------|-----------------------|------------|%n"
+ "| | * | | | | | | | | | | | | | | | | | | |%n"
+ "| PRIMARY | VAR1 | VAR2 | VAR3 | VAR4 | VAR5 | VAR6 | VAR7 | VAR8 | VAR9 | VAR10 | VAR11 | VAR12 | VAR13 | VAR14 | VAR15 | VAR16 | VAR17 | VAR18 | VAR19 |%n"
@@ -145,14 +146,14 @@ public void test_Outputs_output() {
+ "|---------|-----------|-----------|-----------|-----------|-----------|------------|-----------|-----------|-----------|-----------|------------|------------|------------|------------|------------|------------|------------|-----------------------|------------|%n"
+ "| 1 | 1 | 13 | 2 | 14 | 15 | 2007-12-23 | 3.3 | 4.4 | 5.5 | 6.6 | 20 | 8 | 16 | 9 | 10.1 | 11 | 09:01:00 | 2007-12-23 09:01:00.0 | 12 |%n"
+ "|---------|-----------|-----------|-----------|-----------|-----------|------------|-----------|-----------|-----------|-----------|------------|------------|------------|------------|------------|------------|------------|-----------------------|------------|%n"));
- Assertions.assertThat(byteArrayOutputStream8.toString()).isEqualTo(String.format("[Value at index 0 (column name : VAR1) of Row at end point of Change at index 0 (with primary key : [1]) of Changes on teSt table of a data source]%n"
+ Assertions.assertThat(byteArrayOutputStream8.toString()).isEqualTo(String.format("[Value at index 0 (column name : VAR1) of Row at end point of Change at index 0 (with primary key : [1]) of Changes on teSt table of 'data source']%n"
+ "|----------|%n"
+ "| VAR1 |%n"
+ "| (NUMBER) |%n"
+ "|----------|%n"
+ "| 1 |%n"
+ "|----------|%n"));
- Assertions.assertThat(byteArrayOutputStream9.toString()).isEqualTo(String.format("[Column at index 0 (column name : VAR1) of Change at index 0 (with primary key : [1]) of Changes on teSt table of a data source]%n"
+ Assertions.assertThat(byteArrayOutputStream9.toString()).isEqualTo(String.format("[Column at index 0 (column name : VAR1) of Change at index 0 (with primary key : [1]) of Changes on teSt table of 'data source']%n"
+ "|----------------|----------|%n"
+ "| | VAR1 |%n"
+ "| | (NUMBER) |%n"
@@ -161,7 +162,7 @@ public void test_Outputs_output() {
+ "|----------------|----------|%n"
+ "| At end point | 1 |%n"
+ "|----------------|----------|%n"));
- Assertions.assertThat(byteArrayOutputStream10.toString()).isEqualTo(String.format("[Value at end point of Column at index 0 (column name : VAR1) of Change at index 0 (with primary key : [1]) of Changes on teSt table of a data source]%n"
+ Assertions.assertThat(byteArrayOutputStream10.toString()).isEqualTo(String.format("[Value at end point of Column at index 0 (column name : VAR1) of Change at index 0 (with primary key : [1]) of Changes on teSt table of 'data source']%n"
+ "|----------|%n"
+ "| VAR1 |%n"
+ "| (NUMBER) |%n"
@@ -173,7 +174,7 @@ public void test_Outputs_output() {
@Test
@NeedReload
public void test_PrimaryKey_hasPksNames() {
- Table table = new Table(dataSource, "test");
+ Table table = new Table(connectionProvider, "test");
Changes changes = new Changes(table).setStartPointNow();
update();
changes.setEndPointNow();
@@ -185,7 +186,7 @@ public void test_PrimaryKey_hasPksNames() {
@Test
@NeedReload
public void test_ColumnName_hasColumnName() {
- Table table = new Table(dataSource, "test");
+ Table table = new Table(connectionProvider, "test");
Changes changes = new Changes(table).setStartPointNow();
update();
changes.setEndPointNow();
@@ -240,7 +241,7 @@ public void test_ColumnName_hasColumnName() {
@Test
@NeedReload
public void test_ColumnClass_isOfClass() {
- Table table = new Table(dataSource, "test");
+ Table table = new Table(connectionProvider, "test");
Changes changes = new Changes(table).setStartPointNow();
update();
changes.setEndPointNow();
@@ -295,7 +296,7 @@ public void test_ColumnClass_isOfClass() {
@Test
@NeedReload
public void test_ColumnEquality_hasValues() {
- Table table = new Table(dataSource, "test", null, new String[]{"var20"});
+ Table table = new Table(connectionProvider, "test", null, new String[]{"var20"});
Changes changes = new Changes(table).setStartPointNow();
update();
changes.setEndPointNow();
@@ -347,7 +348,7 @@ public void test_ColumnEquality_hasValues() {
@Test
@NeedReload
public void test_ColumnEquality_containsValues() {
- Table table = new Table(dataSource, "test", null, new String[]{"var20"});
+ Table table = new Table(connectionProvider, "test", null, new String[]{"var20"});
Changes changes = new Changes(table).setStartPointNow();
update();
changes.setEndPointNow();
@@ -377,7 +378,7 @@ public void test_ColumnEquality_containsValues() {
@Test
@NeedReload
public void test_ColumnType_isOfType() {
- Table table = new Table(dataSource, "test");
+ Table table = new Table(connectionProvider, "test");
Changes changes = new Changes(table).setStartPointNow();
update();
changes.setEndPointNow();
@@ -431,7 +432,7 @@ public void test_ColumnType_isOfType() {
@Test
@NeedReload
public void test_ColumnOfChangeEquality_hasValues() {
- Table table = new Table(dataSource, "test", null, new String[]{"var20"});
+ Table table = new Table(connectionProvider, "test", null, new String[]{"var20"});
Changes changes = new Changes(table).setStartPointNow();
update();
changes.setEndPointNow();
@@ -484,7 +485,7 @@ public void test_ColumnOfChangeEquality_hasValues() {
@Test
@NeedReload
public void test_RowEquality_hasValues() {
- Table table = new Table(dataSource, "test", null, new String[]{"var20"});
+ Table table = new Table(connectionProvider, "test", null, new String[]{"var20"});
Changes changes = new Changes(table).setStartPointNow();
update();
changes.setEndPointNow();
@@ -507,7 +508,7 @@ public void test_RowEquality_hasValues() {
@Test
@NeedReload
public void test_ValueClass_isOfClass() {
- Table table = new Table(dataSource, "test");
+ Table table = new Table(connectionProvider, "test");
Changes changes = new Changes(table).setStartPointNow();
update();
changes.setEndPointNow();
@@ -562,7 +563,7 @@ public void test_ValueClass_isOfClass() {
@Test
@NeedReload
public void test_ValueEquality_isEqualTo() {
- Table table = new Table(dataSource, "test");
+ Table table = new Table(connectionProvider, "test");
Changes changes = new Changes(table).setStartPointNow();
update();
changes.setEndPointNow();
@@ -615,7 +616,7 @@ public void test_ValueEquality_isEqualTo() {
@Test
@NeedReload
public void test_ValueNonEquality_isNotEqualTo() {
- Table table = new Table(dataSource, "test");
+ Table table = new Table(connectionProvider, "test");
Changes changes = new Changes(table).setStartPointNow();
update();
changes.setEndPointNow();
@@ -668,7 +669,7 @@ public void test_ValueNonEquality_isNotEqualTo() {
@Test
@NeedReload
public void test_ValueType_isOfType() {
- Table table = new Table(dataSource, "test");
+ Table table = new Table(connectionProvider, "test");
Changes changes = new Changes(table).setStartPointNow();
update();
changes.setEndPointNow();
diff --git a/src/test/java/org/assertj/db/database/sqlite/SqliteDatabase_DataSource_NSNSNS_Test.java b/src/test/java/org/assertj/db/database/sqlite/SqliteDatabase_DataSource_NSNSNS_Test.java
index 94c606dd..4b6a1560 100644
--- a/src/test/java/org/assertj/db/database/sqlite/SqliteDatabase_DataSource_NSNSNS_Test.java
+++ b/src/test/java/org/assertj/db/database/sqlite/SqliteDatabase_DataSource_NSNSNS_Test.java
@@ -17,13 +17,13 @@
import static org.junit.Assert.fail;
import java.io.ByteArrayOutputStream;
-import javax.sql.DataSource;
import org.assertj.core.api.Assertions;
import org.assertj.db.common.NeedReload;
import org.assertj.db.exception.AssertJDBException;
import org.assertj.db.output.Outputs;
import org.assertj.db.type.Changes;
+import org.assertj.db.type.ConnectionProvider;
import org.assertj.db.type.Table;
import org.junit.Before;
import org.junit.Test;
@@ -32,20 +32,21 @@
* Test on the Sqlite database.
*
* @author Régis Pouiller
+ * @author Julien Roy
*/
public class SqliteDatabase_DataSource_NSNSNS_Test extends AbstractSqliteTest {
- private DataSource dataSource;
+ private ConnectionProvider connectionProvider;
@Before
public void init() {
- dataSource = dataSourceNSNSNS;
+ connectionProvider = dsConnectionNSNSNS;
}
@Test
@NeedReload
public void test_Outputs_output() {
- Table table = new Table(dataSource, "test", null, new String[]{"var20"});
+ Table table = new Table(connectionProvider, "test", null, new String[]{"var20"});
Changes changes = new Changes(table).setStartPointNow();
update();
changes.setEndPointNow();
@@ -112,7 +113,7 @@ public void test_Outputs_output() {
+ "|----------|%n"
+ "| 1 |%n"
+ "|----------|%n"));
- Assertions.assertThat(byteArrayOutputStream5.toString()).isEqualTo(String.format("[Changes on test table of a data source]%n"
+ Assertions.assertThat(byteArrayOutputStream5.toString()).isEqualTo(String.format("[Changes on test table of 'data source']%n"
+ "|-----------|--------------|-------|---------|----------------|-----------|-----------|-----------|-----------|-----------|------------|-----------|-----------|-----------|-----------|------------|------------|------------|------------|------------|------------|------------|-----------------------|------------|%n"
+ "| | | | | | * | | | | | | | | | | | | | | | | | | |%n"
+ "| | TYPE | TABLE | PRIMARY | | Var1 | vAr2 | vaR3 | var4 | var5 | var6 | var7 | var8 | var9 | var10 | var11 | var12 | var13 | var14 | var15 | var16 | var17 | var18 | var19 |%n"
@@ -123,7 +124,7 @@ public void test_Outputs_output() {
+ "| Index : 0 | MODIFICATION | test | 1 |----------------|-----------|-----------|-----------|-----------|-----------|------------|-----------|-----------|-----------|-----------|------------|------------|------------|------------|------------|------------|------------|-----------------------|------------|%n"
+ "| | | | | At end point | 1 | 13 | 2 | 14 | 15 | 2007-12-23 | 3.3 | 4.4 | 5.5 | 6.6 | 20 | 8 | 16 | 9 | 10.1 | 11 | 09:01:00 | 2007-12-23 09:01:00.0 | 12 |%n"
+ "|-----------|--------------|-------|---------|----------------|-----------|-----------|-----------|-----------|-----------|------------|-----------|-----------|-----------|-----------|------------|------------|------------|------------|------------|------------|------------|-----------------------|------------|%n"));
- Assertions.assertThat(byteArrayOutputStream6.toString()).isEqualTo(String.format("[Change at index 0 (with primary key : [1]) of Changes on test table of a data source]%n"
+ Assertions.assertThat(byteArrayOutputStream6.toString()).isEqualTo(String.format("[Change at index 0 (with primary key : [1]) of Changes on test table of 'data source']%n"
+ "|--------------|-------|---------|----------------|-----------|-----------|-----------|-----------|-----------|------------|-----------|-----------|-----------|-----------|------------|------------|------------|------------|------------|------------|------------|-----------------------|------------|%n"
+ "| | | | | * | | | | | | | | | | | | | | | | | | |%n"
+ "| TYPE | TABLE | PRIMARY | | Var1 | vAr2 | vaR3 | var4 | var5 | var6 | var7 | var8 | var9 | var10 | var11 | var12 | var13 | var14 | var15 | var16 | var17 | var18 | var19 |%n"
@@ -134,7 +135,7 @@ public void test_Outputs_output() {
+ "| MODIFICATION | test | 1 |----------------|-----------|-----------|-----------|-----------|-----------|------------|-----------|-----------|-----------|-----------|------------|------------|------------|------------|------------|------------|------------|-----------------------|------------|%n"
+ "| | | | At end point | 1 | 13 | 2 | 14 | 15 | 2007-12-23 | 3.3 | 4.4 | 5.5 | 6.6 | 20 | 8 | 16 | 9 | 10.1 | 11 | 09:01:00 | 2007-12-23 09:01:00.0 | 12 |%n"
+ "|--------------|-------|---------|----------------|-----------|-----------|-----------|-----------|-----------|------------|-----------|-----------|-----------|-----------|------------|------------|------------|------------|------------|------------|------------|-----------------------|------------|%n"));
- Assertions.assertThat(byteArrayOutputStream7.toString()).isEqualTo(String.format("[Row at end point of Change at index 0 (with primary key : [1]) of Changes on test table of a data source]%n"
+ Assertions.assertThat(byteArrayOutputStream7.toString()).isEqualTo(String.format("[Row at end point of Change at index 0 (with primary key : [1]) of Changes on test table of 'data source']%n"
+ "|---------|-----------|-----------|-----------|-----------|-----------|------------|-----------|-----------|-----------|-----------|------------|------------|------------|------------|------------|------------|------------|-----------------------|------------|%n"
+ "| | * | | | | | | | | | | | | | | | | | | |%n"
+ "| PRIMARY | Var1 | vAr2 | vaR3 | var4 | var5 | var6 | var7 | var8 | var9 | var10 | var11 | var12 | var13 | var14 | var15 | var16 | var17 | var18 | var19 |%n"
@@ -143,14 +144,14 @@ public void test_Outputs_output() {
+ "|---------|-----------|-----------|-----------|-----------|-----------|------------|-----------|-----------|-----------|-----------|------------|------------|------------|------------|------------|------------|------------|-----------------------|------------|%n"
+ "| 1 | 1 | 13 | 2 | 14 | 15 | 2007-12-23 | 3.3 | 4.4 | 5.5 | 6.6 | 20 | 8 | 16 | 9 | 10.1 | 11 | 09:01:00 | 2007-12-23 09:01:00.0 | 12 |%n"
+ "|---------|-----------|-----------|-----------|-----------|-----------|------------|-----------|-----------|-----------|-----------|------------|------------|------------|------------|------------|------------|------------|-----------------------|------------|%n"));
- Assertions.assertThat(byteArrayOutputStream8.toString()).isEqualTo(String.format("[Value at index 0 (column name : Var1) of Row at end point of Change at index 0 (with primary key : [1]) of Changes on test table of a data source]%n"
+ Assertions.assertThat(byteArrayOutputStream8.toString()).isEqualTo(String.format("[Value at index 0 (column name : Var1) of Row at end point of Change at index 0 (with primary key : [1]) of Changes on test table of 'data source']%n"
+ "|----------|%n"
+ "| Var1 |%n"
+ "| (NUMBER) |%n"
+ "|----------|%n"
+ "| 1 |%n"
+ "|----------|%n"));
- Assertions.assertThat(byteArrayOutputStream9.toString()).isEqualTo(String.format("[Column at index 0 (column name : Var1) of Change at index 0 (with primary key : [1]) of Changes on test table of a data source]%n"
+ Assertions.assertThat(byteArrayOutputStream9.toString()).isEqualTo(String.format("[Column at index 0 (column name : Var1) of Change at index 0 (with primary key : [1]) of Changes on test table of 'data source']%n"
+ "|----------------|----------|%n"
+ "| | Var1 |%n"
+ "| | (NUMBER) |%n"
@@ -159,7 +160,7 @@ public void test_Outputs_output() {
+ "|----------------|----------|%n"
+ "| At end point | 1 |%n"
+ "|----------------|----------|%n"));
- Assertions.assertThat(byteArrayOutputStream10.toString()).isEqualTo(String.format("[Value at end point of Column at index 0 (column name : Var1) of Change at index 0 (with primary key : [1]) of Changes on test table of a data source]%n"
+ Assertions.assertThat(byteArrayOutputStream10.toString()).isEqualTo(String.format("[Value at end point of Column at index 0 (column name : Var1) of Change at index 0 (with primary key : [1]) of Changes on test table of 'data source']%n"
+ "|----------|%n"
+ "| Var1 |%n"
+ "| (NUMBER) |%n"
@@ -171,9 +172,9 @@ public void test_Outputs_output() {
@Test
@NeedReload
public void should_fail_because_primary_key_is_different() {
- Table table = new Table(dataSource, "test");
+ Table table = new Table(connectionProvider, "test");
Changes changes = new Changes(table).setStartPointNow();
- Changes changes2 = new Changes(dataSource).setStartPointNow();
+ Changes changes2 = new Changes(connectionProvider).setStartPointNow();
update();
changes.setEndPointNow();
changes2.setEndPointNow();
@@ -182,7 +183,7 @@ public void should_fail_because_primary_key_is_different() {
assertThat(changes).change().hasPksNames("var1");
fail("An exception must be raised");
} catch (AssertionError e) {
- Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Change at index 0 (with primary key : [1]) of Changes on test table of a data source] %n"
+ Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Change at index 0 (with primary key : [1]) of Changes on test table of 'data source'] %n"
+ "Expecting :%n"
+ " [\"var1\"]%n"
+ "to be the name of the columns of the primary keys but was:%n"
@@ -193,7 +194,7 @@ public void should_fail_because_primary_key_is_different() {
assertThat(changes2).change().hasPksNames("var1");
fail("An exception must be raised");
} catch (AssertionError e) {
- Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Change at index 0 (with primary key : [1]) of Changes on teSt table of a data source] %n"
+ Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Change at index 0 (with primary key : [1]) of Changes on teSt table of 'data source'] %n"
+ "Expecting :%n"
+ " [\"var1\"]%n"
+ "to be the name of the columns of the primary keys but was:%n"
@@ -204,9 +205,9 @@ public void should_fail_because_primary_key_is_different() {
@Test
@NeedReload
public void should_fail_because_column_name_is_different() {
- Table table = new Table(dataSource, "test");
+ Table table = new Table(connectionProvider, "test");
Changes changes = new Changes(table).setStartPointNow();
- Changes changes2 = new Changes(dataSource).setStartPointNow();
+ Changes changes2 = new Changes(connectionProvider).setStartPointNow();
update();
changes.setEndPointNow();
changes2.setEndPointNow();
@@ -236,7 +237,7 @@ public void should_fail_because_column_name_is_different() {
assertThat(changes).change().column().hasColumnName("var1");
fail("An exception must be raised");
} catch (AssertionError e) {
- Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Column at index 0 (column name : Var1) of Change at index 0 (with primary key : [1]) of Changes on test table of a data source] %n"
+ Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Column at index 0 (column name : Var1) of Change at index 0 (with primary key : [1]) of Changes on test table of 'data source'] %n"
+ "Expecting :%n"
+ " \"var1\"%n"
+ "to be the name of the column but was:%n"
@@ -246,7 +247,7 @@ public void should_fail_because_column_name_is_different() {
assertThat(changes).change().rowAtEndPoint().value().hasColumnName("var1");
fail("An exception must be raised");
} catch (AssertionError e) {
- Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Value at index 0 (column name : Var1) of Row at end point of Change at index 0 (with primary key : [1]) of Changes on test table of a data source] %n"
+ Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Value at index 0 (column name : Var1) of Row at end point of Change at index 0 (with primary key : [1]) of Changes on test table of 'data source'] %n"
+ "Expecting :%n"
+ " \"var1\"%n"
+ "to be the name of the column but was:%n"
@@ -257,7 +258,7 @@ public void should_fail_because_column_name_is_different() {
assertThat(changes2).change().column().hasColumnName("var1");
fail("An exception must be raised");
} catch (AssertionError e) {
- Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Column at index 0 (column name : Var1) of Change at index 0 (with primary key : [1]) of Changes on teSt table of a data source] %n"
+ Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Column at index 0 (column name : Var1) of Change at index 0 (with primary key : [1]) of Changes on teSt table of 'data source'] %n"
+ "Expecting :%n"
+ " \"var1\"%n"
+ "to be the name of the column but was:%n"
@@ -267,7 +268,7 @@ public void should_fail_because_column_name_is_different() {
assertThat(changes2).change().rowAtEndPoint().value().hasColumnName("var1");
fail("An exception must be raised");
} catch (AssertionError e) {
- Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Value at index 0 (column name : Var1) of Row at end point of Change at index 0 (with primary key : [1]) of Changes on teSt table of a data source] %n"
+ Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Value at index 0 (column name : Var1) of Row at end point of Change at index 0 (with primary key : [1]) of Changes on teSt table of 'data source'] %n"
+ "Expecting :%n"
+ " \"var1\"%n"
+ "to be the name of the column but was:%n"
@@ -278,9 +279,9 @@ public void should_fail_because_column_name_is_different() {
@Test
@NeedReload
public void should_fail_because_column_name_is_wrong_to_navigate() {
- Table table = new Table(dataSource, "test");
+ Table table = new Table(connectionProvider, "test");
Changes changes = new Changes(table).setStartPointNow();
- Changes changes2 = new Changes(dataSource).setStartPointNow();
+ Changes changes2 = new Changes(connectionProvider).setStartPointNow();
update();
changes.setEndPointNow();
changes2.setEndPointNow();
@@ -340,9 +341,9 @@ public void should_fail_because_column_name_is_wrong_to_navigate() {
@Test
@NeedReload
public void should_fail_because_table_name_is_different() {
- Table table = new Table(dataSource, "test");
+ Table table = new Table(connectionProvider, "test");
Changes changes = new Changes(table).setStartPointNow();
- Changes changes2 = new Changes(dataSource).setStartPointNow();
+ Changes changes2 = new Changes(connectionProvider).setStartPointNow();
update();
changes.setEndPointNow();
changes2.setEndPointNow();
@@ -351,7 +352,7 @@ public void should_fail_because_table_name_is_different() {
assertThat(changes).change().isOnTable("teSt");
fail("An exception must be raised");
} catch (AssertionError e) {
- Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Change at index 0 (with primary key : [1]) of Changes on test table of a data source] %n"
+ Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Change at index 0 (with primary key : [1]) of Changes on test table of 'data source'] %n"
+ "Expecting to be on the table:%n"
+ " <\"teSt\">%n"
+ "but was on the table:%n"
@@ -361,7 +362,7 @@ public void should_fail_because_table_name_is_different() {
assertThat(changes2).change().isOnTable("test");
fail("An exception must be raised");
} catch (AssertionError e) {
- Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Change at index 0 (with primary key : [1]) of Changes on teSt table of a data source] %n"
+ Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Change at index 0 (with primary key : [1]) of Changes on teSt table of 'data source'] %n"
+ "Expecting to be on the table:%n"
+ " <\"test\">%n"
+ "but was on the table:%n"
@@ -372,9 +373,9 @@ public void should_fail_because_table_name_is_different() {
@Test
@NeedReload
public void should_fail_because_table_name_is_wrong_to_navigate() {
- Table table = new Table(dataSource, "test");
+ Table table = new Table(connectionProvider, "test");
Changes changes = new Changes(table).setStartPointNow();
- Changes changes2 = new Changes(dataSource).setStartPointNow();
+ Changes changes2 = new Changes(connectionProvider).setStartPointNow();
update();
changes.setEndPointNow();
changes2.setEndPointNow();
@@ -421,9 +422,9 @@ public void should_fail_because_table_name_is_wrong_to_navigate() {
@Test
@NeedReload
public void test_ColumnName_hasColumnName() {
- Table table = new Table(dataSource, "test");
+ Table table = new Table(connectionProvider, "test");
Changes changes = new Changes(table).setStartPointNow();
- Changes changes2 = new Changes(dataSource).setStartPointNow();
+ Changes changes2 = new Changes(connectionProvider).setStartPointNow();
update();
changes.setEndPointNow();
changes2.setEndPointNow();
@@ -437,9 +438,9 @@ public void test_ColumnName_hasColumnName() {
@Test
@NeedReload
public void test_ColumnClass_isOfClass() {
- Table table = new Table(dataSource, "test");
+ Table table = new Table(connectionProvider, "test");
Changes changes = new Changes(table).setStartPointNow();
- Changes changes2 = new Changes(dataSource).setStartPointNow();
+ Changes changes2 = new Changes(connectionProvider).setStartPointNow();
update();
changes.setEndPointNow();
changes2.setEndPointNow();
diff --git a/src/test/java/org/assertj/db/database/sqlite/SqliteDatabase_DataSource_UIUIUI_Test.java b/src/test/java/org/assertj/db/database/sqlite/SqliteDatabase_DataSource_UIUIUI_Test.java
index 19c58d63..9101ad0e 100644
--- a/src/test/java/org/assertj/db/database/sqlite/SqliteDatabase_DataSource_UIUIUI_Test.java
+++ b/src/test/java/org/assertj/db/database/sqlite/SqliteDatabase_DataSource_UIUIUI_Test.java
@@ -17,12 +17,12 @@
import java.io.ByteArrayOutputStream;
import java.sql.Date;
-import javax.sql.DataSource;
import org.assertj.core.api.Assertions;
import org.assertj.db.common.NeedReload;
import org.assertj.db.output.Outputs;
import org.assertj.db.type.Changes;
+import org.assertj.db.type.ConnectionProvider;
import org.assertj.db.type.DateValue;
import org.assertj.db.type.Table;
import org.assertj.db.type.ValueType;
@@ -33,20 +33,21 @@
* Test on the Sqlite database.
*
* @author Régis Pouiller
+ * @author Julien Roy
*/
public class SqliteDatabase_DataSource_UIUIUI_Test extends AbstractSqliteTest {
- private DataSource dataSource;
+ private ConnectionProvider connectionProvider;
@Before
public void init() {
- dataSource = dataSourceUIUIUI;
+ connectionProvider = dsConnectionUIUIUI;
}
@Test
@NeedReload
public void test_Outputs_output() {
- Table table = new Table(dataSource, "test", null, new String[]{"var20"});
+ Table table = new Table(connectionProvider, "test", null, new String[]{"var20"});
Changes changes = new Changes(table).setStartPointNow();
update();
changes.setEndPointNow();
@@ -114,7 +115,7 @@ public void test_Outputs_output() {
+ "|----------|%n"
+ "| 1 |%n"
+ "|----------|%n"));
- Assertions.assertThat(byteArrayOutputStream5.toString()).isEqualTo(String.format("[Changes on TEST table of a data source]%n"
+ Assertions.assertThat(byteArrayOutputStream5.toString()).isEqualTo(String.format("[Changes on TEST table of 'data source']%n"
+ "|-----------|--------------|-------|---------|----------------|-----------|-----------|-----------|-----------|-----------|------------|-----------|-----------|-----------|-----------|------------|------------|------------|------------|------------|------------|------------|-----------------------|------------|%n"
+ "| | | | | | * | | | | | | | | | | | | | | | | | | |%n"
+ "| | TYPE | TABLE | PRIMARY | | VAR1 | VAR2 | VAR3 | VAR4 | VAR5 | VAR6 | VAR7 | VAR8 | VAR9 | VAR10 | VAR11 | VAR12 | VAR13 | VAR14 | VAR15 | VAR16 | VAR17 | VAR18 | VAR19 |%n"
@@ -125,7 +126,7 @@ public void test_Outputs_output() {
+ "| Index : 0 | MODIFICATION | TEST | 1 |----------------|-----------|-----------|-----------|-----------|-----------|------------|-----------|-----------|-----------|-----------|------------|------------|------------|------------|------------|------------|------------|-----------------------|------------|%n"
+ "| | | | | At end point | 1 | 13 | 2 | 14 | 15 | 2007-12-23 | 3.3 | 4.4 | 5.5 | 6.6 | 20 | 8 | 16 | 9 | 10.1 | 11 | 09:01:00 | 2007-12-23 09:01:00.0 | 12 |%n"
+ "|-----------|--------------|-------|---------|----------------|-----------|-----------|-----------|-----------|-----------|------------|-----------|-----------|-----------|-----------|------------|------------|------------|------------|------------|------------|------------|-----------------------|------------|%n"));
- Assertions.assertThat(byteArrayOutputStream6.toString()).isEqualTo(String.format("[Change at index 0 (with primary key : [1]) of Changes on TEST table of a data source]%n"
+ Assertions.assertThat(byteArrayOutputStream6.toString()).isEqualTo(String.format("[Change at index 0 (with primary key : [1]) of Changes on TEST table of 'data source']%n"
+ "|--------------|-------|---------|----------------|-----------|-----------|-----------|-----------|-----------|------------|-----------|-----------|-----------|-----------|------------|------------|------------|------------|------------|------------|------------|-----------------------|------------|%n"
+ "| | | | | * | | | | | | | | | | | | | | | | | | |%n"
+ "| TYPE | TABLE | PRIMARY | | VAR1 | VAR2 | VAR3 | VAR4 | VAR5 | VAR6 | VAR7 | VAR8 | VAR9 | VAR10 | VAR11 | VAR12 | VAR13 | VAR14 | VAR15 | VAR16 | VAR17 | VAR18 | VAR19 |%n"
@@ -136,7 +137,7 @@ public void test_Outputs_output() {
+ "| MODIFICATION | TEST | 1 |----------------|-----------|-----------|-----------|-----------|-----------|------------|-----------|-----------|-----------|-----------|------------|------------|------------|------------|------------|------------|------------|-----------------------|------------|%n"
+ "| | | | At end point | 1 | 13 | 2 | 14 | 15 | 2007-12-23 | 3.3 | 4.4 | 5.5 | 6.6 | 20 | 8 | 16 | 9 | 10.1 | 11 | 09:01:00 | 2007-12-23 09:01:00.0 | 12 |%n"
+ "|--------------|-------|---------|----------------|-----------|-----------|-----------|-----------|-----------|------------|-----------|-----------|-----------|-----------|------------|------------|------------|------------|------------|------------|------------|-----------------------|------------|%n"));
- Assertions.assertThat(byteArrayOutputStream7.toString()).isEqualTo(String.format("[Row at end point of Change at index 0 (with primary key : [1]) of Changes on TEST table of a data source]%n"
+ Assertions.assertThat(byteArrayOutputStream7.toString()).isEqualTo(String.format("[Row at end point of Change at index 0 (with primary key : [1]) of Changes on TEST table of 'data source']%n"
+ "|---------|-----------|-----------|-----------|-----------|-----------|------------|-----------|-----------|-----------|-----------|------------|------------|------------|------------|------------|------------|------------|-----------------------|------------|%n"
+ "| | * | | | | | | | | | | | | | | | | | | |%n"
+ "| PRIMARY | VAR1 | VAR2 | VAR3 | VAR4 | VAR5 | VAR6 | VAR7 | VAR8 | VAR9 | VAR10 | VAR11 | VAR12 | VAR13 | VAR14 | VAR15 | VAR16 | VAR17 | VAR18 | VAR19 |%n"
@@ -145,14 +146,14 @@ public void test_Outputs_output() {
+ "|---------|-----------|-----------|-----------|-----------|-----------|------------|-----------|-----------|-----------|-----------|------------|------------|------------|------------|------------|------------|------------|-----------------------|------------|%n"
+ "| 1 | 1 | 13 | 2 | 14 | 15 | 2007-12-23 | 3.3 | 4.4 | 5.5 | 6.6 | 20 | 8 | 16 | 9 | 10.1 | 11 | 09:01:00 | 2007-12-23 09:01:00.0 | 12 |%n"
+ "|---------|-----------|-----------|-----------|-----------|-----------|------------|-----------|-----------|-----------|-----------|------------|------------|------------|------------|------------|------------|------------|-----------------------|------------|%n"));
- Assertions.assertThat(byteArrayOutputStream8.toString()).isEqualTo(String.format("[Value at index 0 (column name : VAR1) of Row at end point of Change at index 0 (with primary key : [1]) of Changes on TEST table of a data source]%n"
+ Assertions.assertThat(byteArrayOutputStream8.toString()).isEqualTo(String.format("[Value at index 0 (column name : VAR1) of Row at end point of Change at index 0 (with primary key : [1]) of Changes on TEST table of 'data source']%n"
+ "|----------|%n"
+ "| VAR1 |%n"
+ "| (NUMBER) |%n"
+ "|----------|%n"
+ "| 1 |%n"
+ "|----------|%n"));
- Assertions.assertThat(byteArrayOutputStream9.toString()).isEqualTo(String.format("[Column at index 0 (column name : VAR1) of Change at index 0 (with primary key : [1]) of Changes on TEST table of a data source]%n"
+ Assertions.assertThat(byteArrayOutputStream9.toString()).isEqualTo(String.format("[Column at index 0 (column name : VAR1) of Change at index 0 (with primary key : [1]) of Changes on TEST table of 'data source']%n"
+ "|----------------|----------|%n"
+ "| | VAR1 |%n"
+ "| | (NUMBER) |%n"
@@ -161,7 +162,7 @@ public void test_Outputs_output() {
+ "|----------------|----------|%n"
+ "| At end point | 1 |%n"
+ "|----------------|----------|%n"));
- Assertions.assertThat(byteArrayOutputStream10.toString()).isEqualTo(String.format("[Value at end point of Column at index 0 (column name : VAR1) of Change at index 0 (with primary key : [1]) of Changes on TEST table of a data source]%n"
+ Assertions.assertThat(byteArrayOutputStream10.toString()).isEqualTo(String.format("[Value at end point of Column at index 0 (column name : VAR1) of Change at index 0 (with primary key : [1]) of Changes on TEST table of 'data source']%n"
+ "|----------|%n"
+ "| VAR1 |%n"
+ "| (NUMBER) |%n"
@@ -173,7 +174,7 @@ public void test_Outputs_output() {
@Test
@NeedReload
public void test_PrimaryKey_hasPksNames() {
- Table table = new Table(dataSource, "test");
+ Table table = new Table(connectionProvider, "test");
Changes changes = new Changes(table).setStartPointNow();
update();
changes.setEndPointNow();
@@ -185,7 +186,7 @@ public void test_PrimaryKey_hasPksNames() {
@Test
@NeedReload
public void test_ColumnName_hasColumnName() {
- Table table = new Table(dataSource, "test");
+ Table table = new Table(connectionProvider, "test");
Changes changes = new Changes(table).setStartPointNow();
update();
changes.setEndPointNow();
@@ -240,7 +241,7 @@ public void test_ColumnName_hasColumnName() {
@Test
@NeedReload
public void test_ColumnClass_isOfClass() {
- Table table = new Table(dataSource, "test");
+ Table table = new Table(connectionProvider, "test");
Changes changes = new Changes(table).setStartPointNow();
update();
changes.setEndPointNow();
@@ -295,7 +296,7 @@ public void test_ColumnClass_isOfClass() {
@Test
@NeedReload
public void test_ColumnEquality_hasValues() {
- Table table = new Table(dataSource, "test", null, new String[]{"var20"});
+ Table table = new Table(connectionProvider, "test", null, new String[]{"var20"});
Changes changes = new Changes(table).setStartPointNow();
update();
changes.setEndPointNow();
@@ -347,7 +348,7 @@ public void test_ColumnEquality_hasValues() {
@Test
@NeedReload
public void test_ColumnEquality_containsValues() {
- Table table = new Table(dataSource, "test", null, new String[]{"var20"});
+ Table table = new Table(connectionProvider, "test", null, new String[]{"var20"});
Changes changes = new Changes(table).setStartPointNow();
update();
changes.setEndPointNow();
@@ -377,7 +378,7 @@ public void test_ColumnEquality_containsValues() {
@Test
@NeedReload
public void test_ColumnType_isOfType() {
- Table table = new Table(dataSource, "test");
+ Table table = new Table(connectionProvider, "test");
Changes changes = new Changes(table).setStartPointNow();
update();
changes.setEndPointNow();
@@ -431,7 +432,7 @@ public void test_ColumnType_isOfType() {
@Test
@NeedReload
public void test_ColumnOfChangeEquality_hasValues() {
- Table table = new Table(dataSource, "test", null, new String[]{"var20"});
+ Table table = new Table(connectionProvider, "test", null, new String[]{"var20"});
Changes changes = new Changes(table).setStartPointNow();
update();
changes.setEndPointNow();
@@ -484,7 +485,7 @@ public void test_ColumnOfChangeEquality_hasValues() {
@Test
@NeedReload
public void test_RowEquality_hasValues() {
- Table table = new Table(dataSource, "test", null, new String[]{"var20"});
+ Table table = new Table(connectionProvider, "test", null, new String[]{"var20"});
Changes changes = new Changes(table).setStartPointNow();
update();
changes.setEndPointNow();
@@ -507,7 +508,7 @@ public void test_RowEquality_hasValues() {
@Test
@NeedReload
public void test_ValueClass_isOfClass() {
- Table table = new Table(dataSource, "test");
+ Table table = new Table(connectionProvider, "test");
Changes changes = new Changes(table).setStartPointNow();
update();
changes.setEndPointNow();
@@ -562,7 +563,7 @@ public void test_ValueClass_isOfClass() {
@Test
@NeedReload
public void test_ValueEquality_isEqualTo() {
- Table table = new Table(dataSource, "test");
+ Table table = new Table(connectionProvider, "test");
Changes changes = new Changes(table).setStartPointNow();
update();
changes.setEndPointNow();
@@ -615,7 +616,7 @@ public void test_ValueEquality_isEqualTo() {
@Test
@NeedReload
public void test_ValueNonEquality_isNotEqualTo() {
- Table table = new Table(dataSource, "test");
+ Table table = new Table(connectionProvider, "test");
Changes changes = new Changes(table).setStartPointNow();
update();
changes.setEndPointNow();
@@ -668,7 +669,7 @@ public void test_ValueNonEquality_isNotEqualTo() {
@Test
@NeedReload
public void test_ValueType_isOfType() {
- Table table = new Table(dataSource, "test");
+ Table table = new Table(connectionProvider, "test");
Changes changes = new Changes(table).setStartPointNow();
update();
changes.setEndPointNow();
diff --git a/src/test/java/org/assertj/db/database/sqlite/SqliteDatabase_Source_DDD_Test.java b/src/test/java/org/assertj/db/database/sqlite/SqliteDatabase_JdbcUrl_DDD_Test.java
similarity index 96%
rename from src/test/java/org/assertj/db/database/sqlite/SqliteDatabase_Source_DDD_Test.java
rename to src/test/java/org/assertj/db/database/sqlite/SqliteDatabase_JdbcUrl_DDD_Test.java
index 4b4c21fd..f4cb7761 100644
--- a/src/test/java/org/assertj/db/database/sqlite/SqliteDatabase_Source_DDD_Test.java
+++ b/src/test/java/org/assertj/db/database/sqlite/SqliteDatabase_JdbcUrl_DDD_Test.java
@@ -22,8 +22,8 @@
import org.assertj.db.common.NeedReload;
import org.assertj.db.output.Outputs;
import org.assertj.db.type.Changes;
+import org.assertj.db.type.ConnectionProvider;
import org.assertj.db.type.DateValue;
-import org.assertj.db.type.Source;
import org.assertj.db.type.Table;
import org.assertj.db.type.ValueType;
import org.junit.Before;
@@ -33,20 +33,21 @@
* Test on the Sqlite database.
*
* @author Régis Pouiller
+ * @author Julien Roy
*/
-public class SqliteDatabase_Source_DDD_Test extends AbstractSqliteTest {
+public class SqliteDatabase_JdbcUrl_DDD_Test extends AbstractSqliteTest {
- private Source source;
+ private ConnectionProvider connectionProvider;
@Before
public void init() {
- source = sourceDDD;
+ connectionProvider = jdbcConnectionDDD;
}
@Test
@NeedReload
public void test_Outputs_output() {
- Table table = new Table(source, "test", null, new String[]{"var20"});
+ Table table = new Table(connectionProvider, "test", null, new String[]{"var20"});
Changes changes = new Changes(table).setStartPointNow();
update();
changes.setEndPointNow();
@@ -114,7 +115,7 @@ public void test_Outputs_output() {
+ "|----------|%n"
+ "| 1 |%n"
+ "|----------|%n"));
- Assertions.assertThat(byteArrayOutputStream5.toString()).isEqualTo(String.format("[Changes on teSt table of '/jdbc:sqlite:target/testDerby.db' source]%n"
+ Assertions.assertThat(byteArrayOutputStream5.toString()).isEqualTo(String.format("[Changes on teSt table of '/jdbc:sqlite:target/testDerby.db']%n"
+ "|-----------|--------------|-------|---------|----------------|-----------|-----------|-----------|-----------|-----------|------------|-----------|-----------|-----------|-----------|------------|------------|------------|------------|------------|------------|------------|-----------------------|------------|%n"
+ "| | | | | | * | | | | | | | | | | | | | | | | | | |%n"
+ "| | TYPE | TABLE | PRIMARY | | VAR1 | VAR2 | VAR3 | VAR4 | VAR5 | VAR6 | VAR7 | VAR8 | VAR9 | VAR10 | VAR11 | VAR12 | VAR13 | VAR14 | VAR15 | VAR16 | VAR17 | VAR18 | VAR19 |%n"
@@ -125,7 +126,7 @@ public void test_Outputs_output() {
+ "| Index : 0 | MODIFICATION | teSt | 1 |----------------|-----------|-----------|-----------|-----------|-----------|------------|-----------|-----------|-----------|-----------|------------|------------|------------|------------|------------|------------|------------|-----------------------|------------|%n"
+ "| | | | | At end point | 1 | 13 | 2 | 14 | 15 | 2007-12-23 | 3.3 | 4.4 | 5.5 | 6.6 | 20 | 8 | 16 | 9 | 10.1 | 11 | 09:01:00 | 2007-12-23 09:01:00.0 | 12 |%n"
+ "|-----------|--------------|-------|---------|----------------|-----------|-----------|-----------|-----------|-----------|------------|-----------|-----------|-----------|-----------|------------|------------|------------|------------|------------|------------|------------|-----------------------|------------|%n"));
- Assertions.assertThat(byteArrayOutputStream6.toString()).isEqualTo(String.format("[Change at index 0 (with primary key : [1]) of Changes on teSt table of '/jdbc:sqlite:target/testDerby.db' source]%n"
+ Assertions.assertThat(byteArrayOutputStream6.toString()).isEqualTo(String.format("[Change at index 0 (with primary key : [1]) of Changes on teSt table of '/jdbc:sqlite:target/testDerby.db']%n"
+ "|--------------|-------|---------|----------------|-----------|-----------|-----------|-----------|-----------|------------|-----------|-----------|-----------|-----------|------------|------------|------------|------------|------------|------------|------------|-----------------------|------------|%n"
+ "| | | | | * | | | | | | | | | | | | | | | | | | |%n"
+ "| TYPE | TABLE | PRIMARY | | VAR1 | VAR2 | VAR3 | VAR4 | VAR5 | VAR6 | VAR7 | VAR8 | VAR9 | VAR10 | VAR11 | VAR12 | VAR13 | VAR14 | VAR15 | VAR16 | VAR17 | VAR18 | VAR19 |%n"
@@ -136,7 +137,7 @@ public void test_Outputs_output() {
+ "| MODIFICATION | teSt | 1 |----------------|-----------|-----------|-----------|-----------|-----------|------------|-----------|-----------|-----------|-----------|------------|------------|------------|------------|------------|------------|------------|-----------------------|------------|%n"
+ "| | | | At end point | 1 | 13 | 2 | 14 | 15 | 2007-12-23 | 3.3 | 4.4 | 5.5 | 6.6 | 20 | 8 | 16 | 9 | 10.1 | 11 | 09:01:00 | 2007-12-23 09:01:00.0 | 12 |%n"
+ "|--------------|-------|---------|----------------|-----------|-----------|-----------|-----------|-----------|------------|-----------|-----------|-----------|-----------|------------|------------|------------|------------|------------|------------|------------|-----------------------|------------|%n"));
- Assertions.assertThat(byteArrayOutputStream7.toString()).isEqualTo(String.format("[Row at end point of Change at index 0 (with primary key : [1]) of Changes on teSt table of '/jdbc:sqlite:target/testDerby.db' source]%n"
+ Assertions.assertThat(byteArrayOutputStream7.toString()).isEqualTo(String.format("[Row at end point of Change at index 0 (with primary key : [1]) of Changes on teSt table of '/jdbc:sqlite:target/testDerby.db']%n"
+ "|---------|-----------|-----------|-----------|-----------|-----------|------------|-----------|-----------|-----------|-----------|------------|------------|------------|------------|------------|------------|------------|-----------------------|------------|%n"
+ "| | * | | | | | | | | | | | | | | | | | | |%n"
+ "| PRIMARY | VAR1 | VAR2 | VAR3 | VAR4 | VAR5 | VAR6 | VAR7 | VAR8 | VAR9 | VAR10 | VAR11 | VAR12 | VAR13 | VAR14 | VAR15 | VAR16 | VAR17 | VAR18 | VAR19 |%n"
@@ -145,14 +146,14 @@ public void test_Outputs_output() {
+ "|---------|-----------|-----------|-----------|-----------|-----------|------------|-----------|-----------|-----------|-----------|------------|------------|------------|------------|------------|------------|------------|-----------------------|------------|%n"
+ "| 1 | 1 | 13 | 2 | 14 | 15 | 2007-12-23 | 3.3 | 4.4 | 5.5 | 6.6 | 20 | 8 | 16 | 9 | 10.1 | 11 | 09:01:00 | 2007-12-23 09:01:00.0 | 12 |%n"
+ "|---------|-----------|-----------|-----------|-----------|-----------|------------|-----------|-----------|-----------|-----------|------------|------------|------------|------------|------------|------------|------------|-----------------------|------------|%n"));
- Assertions.assertThat(byteArrayOutputStream8.toString()).isEqualTo(String.format("[Value at index 0 (column name : VAR1) of Row at end point of Change at index 0 (with primary key : [1]) of Changes on teSt table of '/jdbc:sqlite:target/testDerby.db' source]%n"
+ Assertions.assertThat(byteArrayOutputStream8.toString()).isEqualTo(String.format("[Value at index 0 (column name : VAR1) of Row at end point of Change at index 0 (with primary key : [1]) of Changes on teSt table of '/jdbc:sqlite:target/testDerby.db']%n"
+ "|----------|%n"
+ "| VAR1 |%n"
+ "| (NUMBER) |%n"
+ "|----------|%n"
+ "| 1 |%n"
+ "|----------|%n"));
- Assertions.assertThat(byteArrayOutputStream9.toString()).isEqualTo(String.format("[Column at index 0 (column name : VAR1) of Change at index 0 (with primary key : [1]) of Changes on teSt table of '/jdbc:sqlite:target/testDerby.db' source]%n"
+ Assertions.assertThat(byteArrayOutputStream9.toString()).isEqualTo(String.format("[Column at index 0 (column name : VAR1) of Change at index 0 (with primary key : [1]) of Changes on teSt table of '/jdbc:sqlite:target/testDerby.db']%n"
+ "|----------------|----------|%n"
+ "| | VAR1 |%n"
+ "| | (NUMBER) |%n"
@@ -161,7 +162,7 @@ public void test_Outputs_output() {
+ "|----------------|----------|%n"
+ "| At end point | 1 |%n"
+ "|----------------|----------|%n"));
- Assertions.assertThat(byteArrayOutputStream10.toString()).isEqualTo(String.format("[Value at end point of Column at index 0 (column name : VAR1) of Change at index 0 (with primary key : [1]) of Changes on teSt table of '/jdbc:sqlite:target/testDerby.db' source]%n"
+ Assertions.assertThat(byteArrayOutputStream10.toString()).isEqualTo(String.format("[Value at end point of Column at index 0 (column name : VAR1) of Change at index 0 (with primary key : [1]) of Changes on teSt table of '/jdbc:sqlite:target/testDerby.db']%n"
+ "|----------|%n"
+ "| VAR1 |%n"
+ "| (NUMBER) |%n"
@@ -173,7 +174,7 @@ public void test_Outputs_output() {
@Test
@NeedReload
public void test_PrimaryKey_hasPksNames() {
- Table table = new Table(source, "test");
+ Table table = new Table(connectionProvider, "test");
Changes changes = new Changes(table).setStartPointNow();
update();
changes.setEndPointNow();
@@ -185,7 +186,7 @@ public void test_PrimaryKey_hasPksNames() {
@Test
@NeedReload
public void test_ColumnName_hasColumnName() {
- Table table = new Table(source, "test");
+ Table table = new Table(connectionProvider, "test");
Changes changes = new Changes(table).setStartPointNow();
update();
changes.setEndPointNow();
@@ -240,7 +241,7 @@ public void test_ColumnName_hasColumnName() {
@Test
@NeedReload
public void test_ColumnClass_isOfClass() {
- Table table = new Table(source, "test");
+ Table table = new Table(connectionProvider, "test");
Changes changes = new Changes(table).setStartPointNow();
update();
changes.setEndPointNow();
@@ -295,7 +296,7 @@ public void test_ColumnClass_isOfClass() {
@Test
@NeedReload
public void test_ColumnEquality_hasValues() {
- Table table = new Table(source, "test", null, new String[]{"var20"});
+ Table table = new Table(connectionProvider, "test", null, new String[]{"var20"});
Changes changes = new Changes(table).setStartPointNow();
update();
changes.setEndPointNow();
@@ -347,7 +348,7 @@ public void test_ColumnEquality_hasValues() {
@Test
@NeedReload
public void test_ColumnEquality_containsValues() {
- Table table = new Table(source, "test", null, new String[]{"var20"});
+ Table table = new Table(connectionProvider, "test", null, new String[]{"var20"});
Changes changes = new Changes(table).setStartPointNow();
update();
changes.setEndPointNow();
@@ -377,7 +378,7 @@ public void test_ColumnEquality_containsValues() {
@Test
@NeedReload
public void test_ColumnType_isOfType() {
- Table table = new Table(source, "test");
+ Table table = new Table(connectionProvider, "test");
Changes changes = new Changes(table).setStartPointNow();
update();
changes.setEndPointNow();
@@ -431,7 +432,7 @@ public void test_ColumnType_isOfType() {
@Test
@NeedReload
public void test_ColumnOfChangeEquality_hasValues() {
- Table table = new Table(source, "test", null, new String[]{"var20"});
+ Table table = new Table(connectionProvider, "test", null, new String[]{"var20"});
Changes changes = new Changes(table).setStartPointNow();
update();
changes.setEndPointNow();
@@ -484,7 +485,7 @@ public void test_ColumnOfChangeEquality_hasValues() {
@Test
@NeedReload
public void test_RowEquality_hasValues() {
- Table table = new Table(source, "test", null, new String[]{"var20"});
+ Table table = new Table(connectionProvider, "test", null, new String[]{"var20"});
Changes changes = new Changes(table).setStartPointNow();
update();
changes.setEndPointNow();
@@ -507,7 +508,7 @@ public void test_RowEquality_hasValues() {
@Test
@NeedReload
public void test_ValueClass_isOfClass() {
- Table table = new Table(source, "test");
+ Table table = new Table(connectionProvider, "test");
Changes changes = new Changes(table).setStartPointNow();
update();
changes.setEndPointNow();
@@ -562,7 +563,7 @@ public void test_ValueClass_isOfClass() {
@Test
@NeedReload
public void test_ValueEquality_isEqualTo() {
- Table table = new Table(source, "test");
+ Table table = new Table(connectionProvider, "test");
Changes changes = new Changes(table).setStartPointNow();
update();
changes.setEndPointNow();
@@ -615,7 +616,7 @@ public void test_ValueEquality_isEqualTo() {
@Test
@NeedReload
public void test_ValueNonEquality_isNotEqualTo() {
- Table table = new Table(source, "test");
+ Table table = new Table(connectionProvider, "test");
Changes changes = new Changes(table).setStartPointNow();
update();
changes.setEndPointNow();
@@ -668,7 +669,7 @@ public void test_ValueNonEquality_isNotEqualTo() {
@Test
@NeedReload
public void test_ValueType_isOfType() {
- Table table = new Table(source, "test");
+ Table table = new Table(connectionProvider, "test");
Changes changes = new Changes(table).setStartPointNow();
update();
changes.setEndPointNow();
diff --git a/src/test/java/org/assertj/db/database/sqlite/SqliteDatabase_Source_NSNSNS_Test.java b/src/test/java/org/assertj/db/database/sqlite/SqliteDatabase_JdbcUrl_NSNSNS_Test.java
similarity index 94%
rename from src/test/java/org/assertj/db/database/sqlite/SqliteDatabase_Source_NSNSNS_Test.java
rename to src/test/java/org/assertj/db/database/sqlite/SqliteDatabase_JdbcUrl_NSNSNS_Test.java
index 23f21978..750f86ce 100644
--- a/src/test/java/org/assertj/db/database/sqlite/SqliteDatabase_Source_NSNSNS_Test.java
+++ b/src/test/java/org/assertj/db/database/sqlite/SqliteDatabase_JdbcUrl_NSNSNS_Test.java
@@ -23,7 +23,7 @@
import org.assertj.db.exception.AssertJDBException;
import org.assertj.db.output.Outputs;
import org.assertj.db.type.Changes;
-import org.assertj.db.type.Source;
+import org.assertj.db.type.ConnectionProvider;
import org.assertj.db.type.Table;
import org.junit.Before;
import org.junit.Test;
@@ -32,20 +32,21 @@
* Test on the Sqlite database.
*
* @author Régis Pouiller
+ * @author Julien Roy
*/
-public class SqliteDatabase_Source_NSNSNS_Test extends AbstractSqliteTest {
+public class SqliteDatabase_JdbcUrl_NSNSNS_Test extends AbstractSqliteTest {
- private Source source;
+ private ConnectionProvider connectionProvider;
@Before
public void init() {
- source = sourceNSNSNS;
+ connectionProvider = jdbcConnectionNSNSNS;
}
@Test
@NeedReload
public void test_Outputs_output() {
- Table table = new Table(source, "test", null, new String[]{"var20"});
+ Table table = new Table(connectionProvider, "test", null, new String[]{"var20"});
Changes changes = new Changes(table).setStartPointNow();
update();
changes.setEndPointNow();
@@ -112,7 +113,7 @@ public void test_Outputs_output() {
+ "|----------|%n"
+ "| 1 |%n"
+ "|----------|%n"));
- Assertions.assertThat(byteArrayOutputStream5.toString()).isEqualTo(String.format("[Changes on test table of '/jdbc:sqlite:target/testDerby.db' source]%n"
+ Assertions.assertThat(byteArrayOutputStream5.toString()).isEqualTo(String.format("[Changes on test table of '/jdbc:sqlite:target/testDerby.db']%n"
+ "|-----------|--------------|-------|---------|----------------|-----------|-----------|-----------|-----------|-----------|------------|-----------|-----------|-----------|-----------|------------|------------|------------|------------|------------|------------|------------|-----------------------|------------|%n"
+ "| | | | | | * | | | | | | | | | | | | | | | | | | |%n"
+ "| | TYPE | TABLE | PRIMARY | | Var1 | vAr2 | vaR3 | var4 | var5 | var6 | var7 | var8 | var9 | var10 | var11 | var12 | var13 | var14 | var15 | var16 | var17 | var18 | var19 |%n"
@@ -123,7 +124,7 @@ public void test_Outputs_output() {
+ "| Index : 0 | MODIFICATION | test | 1 |----------------|-----------|-----------|-----------|-----------|-----------|------------|-----------|-----------|-----------|-----------|------------|------------|------------|------------|------------|------------|------------|-----------------------|------------|%n"
+ "| | | | | At end point | 1 | 13 | 2 | 14 | 15 | 2007-12-23 | 3.3 | 4.4 | 5.5 | 6.6 | 20 | 8 | 16 | 9 | 10.1 | 11 | 09:01:00 | 2007-12-23 09:01:00.0 | 12 |%n"
+ "|-----------|--------------|-------|---------|----------------|-----------|-----------|-----------|-----------|-----------|------------|-----------|-----------|-----------|-----------|------------|------------|------------|------------|------------|------------|------------|-----------------------|------------|%n"));
- Assertions.assertThat(byteArrayOutputStream6.toString()).isEqualTo(String.format("[Change at index 0 (with primary key : [1]) of Changes on test table of '/jdbc:sqlite:target/testDerby.db' source]%n"
+ Assertions.assertThat(byteArrayOutputStream6.toString()).isEqualTo(String.format("[Change at index 0 (with primary key : [1]) of Changes on test table of '/jdbc:sqlite:target/testDerby.db']%n"
+ "|--------------|-------|---------|----------------|-----------|-----------|-----------|-----------|-----------|------------|-----------|-----------|-----------|-----------|------------|------------|------------|------------|------------|------------|------------|-----------------------|------------|%n"
+ "| | | | | * | | | | | | | | | | | | | | | | | | |%n"
+ "| TYPE | TABLE | PRIMARY | | Var1 | vAr2 | vaR3 | var4 | var5 | var6 | var7 | var8 | var9 | var10 | var11 | var12 | var13 | var14 | var15 | var16 | var17 | var18 | var19 |%n"
@@ -134,7 +135,7 @@ public void test_Outputs_output() {
+ "| MODIFICATION | test | 1 |----------------|-----------|-----------|-----------|-----------|-----------|------------|-----------|-----------|-----------|-----------|------------|------------|------------|------------|------------|------------|------------|-----------------------|------------|%n"
+ "| | | | At end point | 1 | 13 | 2 | 14 | 15 | 2007-12-23 | 3.3 | 4.4 | 5.5 | 6.6 | 20 | 8 | 16 | 9 | 10.1 | 11 | 09:01:00 | 2007-12-23 09:01:00.0 | 12 |%n"
+ "|--------------|-------|---------|----------------|-----------|-----------|-----------|-----------|-----------|------------|-----------|-----------|-----------|-----------|------------|------------|------------|------------|------------|------------|------------|-----------------------|------------|%n"));
- Assertions.assertThat(byteArrayOutputStream7.toString()).isEqualTo(String.format("[Row at end point of Change at index 0 (with primary key : [1]) of Changes on test table of '/jdbc:sqlite:target/testDerby.db' source]%n"
+ Assertions.assertThat(byteArrayOutputStream7.toString()).isEqualTo(String.format("[Row at end point of Change at index 0 (with primary key : [1]) of Changes on test table of '/jdbc:sqlite:target/testDerby.db']%n"
+ "|---------|-----------|-----------|-----------|-----------|-----------|------------|-----------|-----------|-----------|-----------|------------|------------|------------|------------|------------|------------|------------|-----------------------|------------|%n"
+ "| | * | | | | | | | | | | | | | | | | | | |%n"
+ "| PRIMARY | Var1 | vAr2 | vaR3 | var4 | var5 | var6 | var7 | var8 | var9 | var10 | var11 | var12 | var13 | var14 | var15 | var16 | var17 | var18 | var19 |%n"
@@ -143,14 +144,14 @@ public void test_Outputs_output() {
+ "|---------|-----------|-----------|-----------|-----------|-----------|------------|-----------|-----------|-----------|-----------|------------|------------|------------|------------|------------|------------|------------|-----------------------|------------|%n"
+ "| 1 | 1 | 13 | 2 | 14 | 15 | 2007-12-23 | 3.3 | 4.4 | 5.5 | 6.6 | 20 | 8 | 16 | 9 | 10.1 | 11 | 09:01:00 | 2007-12-23 09:01:00.0 | 12 |%n"
+ "|---------|-----------|-----------|-----------|-----------|-----------|------------|-----------|-----------|-----------|-----------|------------|------------|------------|------------|------------|------------|------------|-----------------------|------------|%n"));
- Assertions.assertThat(byteArrayOutputStream8.toString()).isEqualTo(String.format("[Value at index 0 (column name : Var1) of Row at end point of Change at index 0 (with primary key : [1]) of Changes on test table of '/jdbc:sqlite:target/testDerby.db' source]%n"
+ Assertions.assertThat(byteArrayOutputStream8.toString()).isEqualTo(String.format("[Value at index 0 (column name : Var1) of Row at end point of Change at index 0 (with primary key : [1]) of Changes on test table of '/jdbc:sqlite:target/testDerby.db']%n"
+ "|----------|%n"
+ "| Var1 |%n"
+ "| (NUMBER) |%n"
+ "|----------|%n"
+ "| 1 |%n"
+ "|----------|%n"));
- Assertions.assertThat(byteArrayOutputStream9.toString()).isEqualTo(String.format("[Column at index 0 (column name : Var1) of Change at index 0 (with primary key : [1]) of Changes on test table of '/jdbc:sqlite:target/testDerby.db' source]%n"
+ Assertions.assertThat(byteArrayOutputStream9.toString()).isEqualTo(String.format("[Column at index 0 (column name : Var1) of Change at index 0 (with primary key : [1]) of Changes on test table of '/jdbc:sqlite:target/testDerby.db']%n"
+ "|----------------|----------|%n"
+ "| | Var1 |%n"
+ "| | (NUMBER) |%n"
@@ -159,7 +160,7 @@ public void test_Outputs_output() {
+ "|----------------|----------|%n"
+ "| At end point | 1 |%n"
+ "|----------------|----------|%n"));
- Assertions.assertThat(byteArrayOutputStream10.toString()).isEqualTo(String.format("[Value at end point of Column at index 0 (column name : Var1) of Change at index 0 (with primary key : [1]) of Changes on test table of '/jdbc:sqlite:target/testDerby.db' source]%n"
+ Assertions.assertThat(byteArrayOutputStream10.toString()).isEqualTo(String.format("[Value at end point of Column at index 0 (column name : Var1) of Change at index 0 (with primary key : [1]) of Changes on test table of '/jdbc:sqlite:target/testDerby.db']%n"
+ "|----------|%n"
+ "| Var1 |%n"
+ "| (NUMBER) |%n"
@@ -171,9 +172,9 @@ public void test_Outputs_output() {
@Test
@NeedReload
public void should_fail_because_primary_key_is_different() {
- Table table = new Table(source, "test");
+ Table table = new Table(connectionProvider, "test");
Changes changes = new Changes(table).setStartPointNow();
- Changes changes2 = new Changes(source).setStartPointNow();
+ Changes changes2 = new Changes(connectionProvider).setStartPointNow();
update();
changes.setEndPointNow();
changes2.setEndPointNow();
@@ -182,7 +183,7 @@ public void should_fail_because_primary_key_is_different() {
assertThat(changes).change().hasPksNames("var1");
fail("An exception must be raised");
} catch (AssertionError e) {
- Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Change at index 0 (with primary key : [1]) of Changes on test table of '/jdbc:sqlite:target/testDerby.db' source] %n"
+ Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Change at index 0 (with primary key : [1]) of Changes on test table of '/jdbc:sqlite:target/testDerby.db'] %n"
+ "Expecting :%n"
+ " [\"var1\"]%n"
+ "to be the name of the columns of the primary keys but was:%n"
@@ -193,7 +194,7 @@ public void should_fail_because_primary_key_is_different() {
assertThat(changes2).change().hasPksNames("var1");
fail("An exception must be raised");
} catch (AssertionError e) {
- Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Change at index 0 (with primary key : [1]) of Changes on teSt table of '/jdbc:sqlite:target/testDerby.db' source] %n"
+ Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Change at index 0 (with primary key : [1]) of Changes on teSt table of '/jdbc:sqlite:target/testDerby.db'] %n"
+ "Expecting :%n"
+ " [\"var1\"]%n"
+ "to be the name of the columns of the primary keys but was:%n"
@@ -204,9 +205,9 @@ public void should_fail_because_primary_key_is_different() {
@Test
@NeedReload
public void should_fail_because_column_name_is_different() {
- Table table = new Table(source, "test");
+ Table table = new Table(connectionProvider, "test");
Changes changes = new Changes(table).setStartPointNow();
- Changes changes2 = new Changes(source).setStartPointNow();
+ Changes changes2 = new Changes(connectionProvider).setStartPointNow();
update();
changes.setEndPointNow();
changes2.setEndPointNow();
@@ -236,7 +237,7 @@ public void should_fail_because_column_name_is_different() {
assertThat(changes).change().column().hasColumnName("var1");
fail("An exception must be raised");
} catch (AssertionError e) {
- Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Column at index 0 (column name : Var1) of Change at index 0 (with primary key : [1]) of Changes on test table of '/jdbc:sqlite:target/testDerby.db' source] %n"
+ Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Column at index 0 (column name : Var1) of Change at index 0 (with primary key : [1]) of Changes on test table of '/jdbc:sqlite:target/testDerby.db'] %n"
+ "Expecting :%n"
+ " \"var1\"%n"
+ "to be the name of the column but was:%n"
@@ -246,7 +247,7 @@ public void should_fail_because_column_name_is_different() {
assertThat(changes).change().rowAtEndPoint().value().hasColumnName("var1");
fail("An exception must be raised");
} catch (AssertionError e) {
- Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Value at index 0 (column name : Var1) of Row at end point of Change at index 0 (with primary key : [1]) of Changes on test table of '/jdbc:sqlite:target/testDerby.db' source] %n"
+ Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Value at index 0 (column name : Var1) of Row at end point of Change at index 0 (with primary key : [1]) of Changes on test table of '/jdbc:sqlite:target/testDerby.db'] %n"
+ "Expecting :%n"
+ " \"var1\"%n"
+ "to be the name of the column but was:%n"
@@ -257,7 +258,7 @@ public void should_fail_because_column_name_is_different() {
assertThat(changes2).change().column().hasColumnName("var1");
fail("An exception must be raised");
} catch (AssertionError e) {
- Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Column at index 0 (column name : Var1) of Change at index 0 (with primary key : [1]) of Changes on teSt table of '/jdbc:sqlite:target/testDerby.db' source] %n"
+ Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Column at index 0 (column name : Var1) of Change at index 0 (with primary key : [1]) of Changes on teSt table of '/jdbc:sqlite:target/testDerby.db'] %n"
+ "Expecting :%n"
+ " \"var1\"%n"
+ "to be the name of the column but was:%n"
@@ -267,7 +268,7 @@ public void should_fail_because_column_name_is_different() {
assertThat(changes2).change().rowAtEndPoint().value().hasColumnName("var1");
fail("An exception must be raised");
} catch (AssertionError e) {
- Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Value at index 0 (column name : Var1) of Row at end point of Change at index 0 (with primary key : [1]) of Changes on teSt table of '/jdbc:sqlite:target/testDerby.db' source] %n"
+ Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Value at index 0 (column name : Var1) of Row at end point of Change at index 0 (with primary key : [1]) of Changes on teSt table of '/jdbc:sqlite:target/testDerby.db'] %n"
+ "Expecting :%n"
+ " \"var1\"%n"
+ "to be the name of the column but was:%n"
@@ -278,9 +279,9 @@ public void should_fail_because_column_name_is_different() {
@Test
@NeedReload
public void should_fail_because_column_name_is_wrong_to_navigate() {
- Table table = new Table(source, "test");
+ Table table = new Table(connectionProvider, "test");
Changes changes = new Changes(table).setStartPointNow();
- Changes changes2 = new Changes(source).setStartPointNow();
+ Changes changes2 = new Changes(connectionProvider).setStartPointNow();
update();
changes.setEndPointNow();
changes2.setEndPointNow();
@@ -340,9 +341,9 @@ public void should_fail_because_column_name_is_wrong_to_navigate() {
@Test
@NeedReload
public void should_fail_because_table_name_is_different() {
- Table table = new Table(source, "test");
+ Table table = new Table(connectionProvider, "test");
Changes changes = new Changes(table).setStartPointNow();
- Changes changes2 = new Changes(source).setStartPointNow();
+ Changes changes2 = new Changes(connectionProvider).setStartPointNow();
update();
changes.setEndPointNow();
changes2.setEndPointNow();
@@ -351,7 +352,7 @@ public void should_fail_because_table_name_is_different() {
assertThat(changes).change().isOnTable("teSt");
fail("An exception must be raised");
} catch (AssertionError e) {
- Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Change at index 0 (with primary key : [1]) of Changes on test table of '/jdbc:sqlite:target/testDerby.db' source] %n"
+ Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Change at index 0 (with primary key : [1]) of Changes on test table of '/jdbc:sqlite:target/testDerby.db'] %n"
+ "Expecting to be on the table:%n"
+ " <\"teSt\">%n"
+ "but was on the table:%n"
@@ -361,7 +362,7 @@ public void should_fail_because_table_name_is_different() {
assertThat(changes2).change().isOnTable("test");
fail("An exception must be raised");
} catch (AssertionError e) {
- Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Change at index 0 (with primary key : [1]) of Changes on teSt table of '/jdbc:sqlite:target/testDerby.db' source] %n"
+ Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Change at index 0 (with primary key : [1]) of Changes on teSt table of '/jdbc:sqlite:target/testDerby.db'] %n"
+ "Expecting to be on the table:%n"
+ " <\"test\">%n"
+ "but was on the table:%n"
@@ -372,9 +373,9 @@ public void should_fail_because_table_name_is_different() {
@Test
@NeedReload
public void should_fail_because_table_name_is_wrong_to_navigate() {
- Table table = new Table(source, "test");
+ Table table = new Table(connectionProvider, "test");
Changes changes = new Changes(table).setStartPointNow();
- Changes changes2 = new Changes(source).setStartPointNow();
+ Changes changes2 = new Changes(connectionProvider).setStartPointNow();
update();
changes.setEndPointNow();
changes2.setEndPointNow();
@@ -421,9 +422,9 @@ public void should_fail_because_table_name_is_wrong_to_navigate() {
@Test
@NeedReload
public void test_ColumnName_hasColumnName() {
- Table table = new Table(source, "test");
+ Table table = new Table(connectionProvider, "test");
Changes changes = new Changes(table).setStartPointNow();
- Changes changes2 = new Changes(source).setStartPointNow();
+ Changes changes2 = new Changes(connectionProvider).setStartPointNow();
update();
changes.setEndPointNow();
changes2.setEndPointNow();
@@ -437,9 +438,9 @@ public void test_ColumnName_hasColumnName() {
@Test
@NeedReload
public void test_ColumnClass_isOfClass() {
- Table table = new Table(source, "test");
+ Table table = new Table(connectionProvider, "test");
Changes changes = new Changes(table).setStartPointNow();
- Changes changes2 = new Changes(source).setStartPointNow();
+ Changes changes2 = new Changes(connectionProvider).setStartPointNow();
update();
changes.setEndPointNow();
changes2.setEndPointNow();
diff --git a/src/test/java/org/assertj/db/database/sqlite/SqliteDatabase_Source_UIUIUI_Test.java b/src/test/java/org/assertj/db/database/sqlite/SqliteDatabase_JdbcUrl_UIUIUI_Test.java
similarity index 96%
rename from src/test/java/org/assertj/db/database/sqlite/SqliteDatabase_Source_UIUIUI_Test.java
rename to src/test/java/org/assertj/db/database/sqlite/SqliteDatabase_JdbcUrl_UIUIUI_Test.java
index a39fc0f7..65c59752 100644
--- a/src/test/java/org/assertj/db/database/sqlite/SqliteDatabase_Source_UIUIUI_Test.java
+++ b/src/test/java/org/assertj/db/database/sqlite/SqliteDatabase_JdbcUrl_UIUIUI_Test.java
@@ -22,8 +22,8 @@
import org.assertj.db.common.NeedReload;
import org.assertj.db.output.Outputs;
import org.assertj.db.type.Changes;
+import org.assertj.db.type.ConnectionProvider;
import org.assertj.db.type.DateValue;
-import org.assertj.db.type.Source;
import org.assertj.db.type.Table;
import org.assertj.db.type.ValueType;
import org.junit.Before;
@@ -33,20 +33,21 @@
* Test on the Sqlite database.
*
* @author Régis Pouiller
+ * @author Julien Roy
*/
-public class SqliteDatabase_Source_UIUIUI_Test extends AbstractSqliteTest {
+public class SqliteDatabase_JdbcUrl_UIUIUI_Test extends AbstractSqliteTest {
- private Source source;
+ private ConnectionProvider connectionProvider;
@Before
public void init() {
- source = sourceUIUIUI;
+ connectionProvider = jdbcConnectionUIUIUI;
}
@Test
@NeedReload
public void test_Outputs_output() {
- Table table = new Table(source, "test", null, new String[]{"var20"});
+ Table table = new Table(connectionProvider, "test", null, new String[]{"var20"});
Changes changes = new Changes(table).setStartPointNow();
update();
changes.setEndPointNow();
@@ -114,7 +115,7 @@ public void test_Outputs_output() {
+ "|----------|%n"
+ "| 1 |%n"
+ "|----------|%n"));
- Assertions.assertThat(byteArrayOutputStream5.toString()).isEqualTo(String.format("[Changes on TEST table of '/jdbc:sqlite:target/testDerby.db' source]%n"
+ Assertions.assertThat(byteArrayOutputStream5.toString()).isEqualTo(String.format("[Changes on TEST table of '/jdbc:sqlite:target/testDerby.db']%n"
+ "|-----------|--------------|-------|---------|----------------|-----------|-----------|-----------|-----------|-----------|------------|-----------|-----------|-----------|-----------|------------|------------|------------|------------|------------|------------|------------|-----------------------|------------|%n"
+ "| | | | | | * | | | | | | | | | | | | | | | | | | |%n"
+ "| | TYPE | TABLE | PRIMARY | | VAR1 | VAR2 | VAR3 | VAR4 | VAR5 | VAR6 | VAR7 | VAR8 | VAR9 | VAR10 | VAR11 | VAR12 | VAR13 | VAR14 | VAR15 | VAR16 | VAR17 | VAR18 | VAR19 |%n"
@@ -125,7 +126,7 @@ public void test_Outputs_output() {
+ "| Index : 0 | MODIFICATION | TEST | 1 |----------------|-----------|-----------|-----------|-----------|-----------|------------|-----------|-----------|-----------|-----------|------------|------------|------------|------------|------------|------------|------------|-----------------------|------------|%n"
+ "| | | | | At end point | 1 | 13 | 2 | 14 | 15 | 2007-12-23 | 3.3 | 4.4 | 5.5 | 6.6 | 20 | 8 | 16 | 9 | 10.1 | 11 | 09:01:00 | 2007-12-23 09:01:00.0 | 12 |%n"
+ "|-----------|--------------|-------|---------|----------------|-----------|-----------|-----------|-----------|-----------|------------|-----------|-----------|-----------|-----------|------------|------------|------------|------------|------------|------------|------------|-----------------------|------------|%n"));
- Assertions.assertThat(byteArrayOutputStream6.toString()).isEqualTo(String.format("[Change at index 0 (with primary key : [1]) of Changes on TEST table of '/jdbc:sqlite:target/testDerby.db' source]%n"
+ Assertions.assertThat(byteArrayOutputStream6.toString()).isEqualTo(String.format("[Change at index 0 (with primary key : [1]) of Changes on TEST table of '/jdbc:sqlite:target/testDerby.db']%n"
+ "|--------------|-------|---------|----------------|-----------|-----------|-----------|-----------|-----------|------------|-----------|-----------|-----------|-----------|------------|------------|------------|------------|------------|------------|------------|-----------------------|------------|%n"
+ "| | | | | * | | | | | | | | | | | | | | | | | | |%n"
+ "| TYPE | TABLE | PRIMARY | | VAR1 | VAR2 | VAR3 | VAR4 | VAR5 | VAR6 | VAR7 | VAR8 | VAR9 | VAR10 | VAR11 | VAR12 | VAR13 | VAR14 | VAR15 | VAR16 | VAR17 | VAR18 | VAR19 |%n"
@@ -136,7 +137,7 @@ public void test_Outputs_output() {
+ "| MODIFICATION | TEST | 1 |----------------|-----------|-----------|-----------|-----------|-----------|------------|-----------|-----------|-----------|-----------|------------|------------|------------|------------|------------|------------|------------|-----------------------|------------|%n"
+ "| | | | At end point | 1 | 13 | 2 | 14 | 15 | 2007-12-23 | 3.3 | 4.4 | 5.5 | 6.6 | 20 | 8 | 16 | 9 | 10.1 | 11 | 09:01:00 | 2007-12-23 09:01:00.0 | 12 |%n"
+ "|--------------|-------|---------|----------------|-----------|-----------|-----------|-----------|-----------|------------|-----------|-----------|-----------|-----------|------------|------------|------------|------------|------------|------------|------------|-----------------------|------------|%n"));
- Assertions.assertThat(byteArrayOutputStream7.toString()).isEqualTo(String.format("[Row at end point of Change at index 0 (with primary key : [1]) of Changes on TEST table of '/jdbc:sqlite:target/testDerby.db' source]%n"
+ Assertions.assertThat(byteArrayOutputStream7.toString()).isEqualTo(String.format("[Row at end point of Change at index 0 (with primary key : [1]) of Changes on TEST table of '/jdbc:sqlite:target/testDerby.db']%n"
+ "|---------|-----------|-----------|-----------|-----------|-----------|------------|-----------|-----------|-----------|-----------|------------|------------|------------|------------|------------|------------|------------|-----------------------|------------|%n"
+ "| | * | | | | | | | | | | | | | | | | | | |%n"
+ "| PRIMARY | VAR1 | VAR2 | VAR3 | VAR4 | VAR5 | VAR6 | VAR7 | VAR8 | VAR9 | VAR10 | VAR11 | VAR12 | VAR13 | VAR14 | VAR15 | VAR16 | VAR17 | VAR18 | VAR19 |%n"
@@ -145,14 +146,14 @@ public void test_Outputs_output() {
+ "|---------|-----------|-----------|-----------|-----------|-----------|------------|-----------|-----------|-----------|-----------|------------|------------|------------|------------|------------|------------|------------|-----------------------|------------|%n"
+ "| 1 | 1 | 13 | 2 | 14 | 15 | 2007-12-23 | 3.3 | 4.4 | 5.5 | 6.6 | 20 | 8 | 16 | 9 | 10.1 | 11 | 09:01:00 | 2007-12-23 09:01:00.0 | 12 |%n"
+ "|---------|-----------|-----------|-----------|-----------|-----------|------------|-----------|-----------|-----------|-----------|------------|------------|------------|------------|------------|------------|------------|-----------------------|------------|%n"));
- Assertions.assertThat(byteArrayOutputStream8.toString()).isEqualTo(String.format("[Value at index 0 (column name : VAR1) of Row at end point of Change at index 0 (with primary key : [1]) of Changes on TEST table of '/jdbc:sqlite:target/testDerby.db' source]%n"
+ Assertions.assertThat(byteArrayOutputStream8.toString()).isEqualTo(String.format("[Value at index 0 (column name : VAR1) of Row at end point of Change at index 0 (with primary key : [1]) of Changes on TEST table of '/jdbc:sqlite:target/testDerby.db']%n"
+ "|----------|%n"
+ "| VAR1 |%n"
+ "| (NUMBER) |%n"
+ "|----------|%n"
+ "| 1 |%n"
+ "|----------|%n"));
- Assertions.assertThat(byteArrayOutputStream9.toString()).isEqualTo(String.format("[Column at index 0 (column name : VAR1) of Change at index 0 (with primary key : [1]) of Changes on TEST table of '/jdbc:sqlite:target/testDerby.db' source]%n"
+ Assertions.assertThat(byteArrayOutputStream9.toString()).isEqualTo(String.format("[Column at index 0 (column name : VAR1) of Change at index 0 (with primary key : [1]) of Changes on TEST table of '/jdbc:sqlite:target/testDerby.db']%n"
+ "|----------------|----------|%n"
+ "| | VAR1 |%n"
+ "| | (NUMBER) |%n"
@@ -161,7 +162,7 @@ public void test_Outputs_output() {
+ "|----------------|----------|%n"
+ "| At end point | 1 |%n"
+ "|----------------|----------|%n"));
- Assertions.assertThat(byteArrayOutputStream10.toString()).isEqualTo(String.format("[Value at end point of Column at index 0 (column name : VAR1) of Change at index 0 (with primary key : [1]) of Changes on TEST table of '/jdbc:sqlite:target/testDerby.db' source]%n"
+ Assertions.assertThat(byteArrayOutputStream10.toString()).isEqualTo(String.format("[Value at end point of Column at index 0 (column name : VAR1) of Change at index 0 (with primary key : [1]) of Changes on TEST table of '/jdbc:sqlite:target/testDerby.db']%n"
+ "|----------|%n"
+ "| VAR1 |%n"
+ "| (NUMBER) |%n"
@@ -173,7 +174,7 @@ public void test_Outputs_output() {
@Test
@NeedReload
public void test_PrimaryKey_hasPksNames() {
- Table table = new Table(source, "test");
+ Table table = new Table(connectionProvider, "test");
Changes changes = new Changes(table).setStartPointNow();
update();
changes.setEndPointNow();
@@ -185,7 +186,7 @@ public void test_PrimaryKey_hasPksNames() {
@Test
@NeedReload
public void test_ColumnName_hasColumnName() {
- Table table = new Table(source, "test");
+ Table table = new Table(connectionProvider, "test");
Changes changes = new Changes(table).setStartPointNow();
update();
changes.setEndPointNow();
@@ -240,7 +241,7 @@ public void test_ColumnName_hasColumnName() {
@Test
@NeedReload
public void test_ColumnClass_isOfClass() {
- Table table = new Table(source, "test");
+ Table table = new Table(connectionProvider, "test");
Changes changes = new Changes(table).setStartPointNow();
update();
changes.setEndPointNow();
@@ -295,7 +296,7 @@ public void test_ColumnClass_isOfClass() {
@Test
@NeedReload
public void test_ColumnEquality_hasValues() {
- Table table = new Table(source, "test", null, new String[]{"var20"});
+ Table table = new Table(connectionProvider, "test", null, new String[]{"var20"});
Changes changes = new Changes(table).setStartPointNow();
update();
changes.setEndPointNow();
@@ -347,7 +348,7 @@ public void test_ColumnEquality_hasValues() {
@Test
@NeedReload
public void test_ColumnEquality_containsValues() {
- Table table = new Table(source, "test", null, new String[]{"var20"});
+ Table table = new Table(connectionProvider, "test", null, new String[]{"var20"});
Changes changes = new Changes(table).setStartPointNow();
update();
changes.setEndPointNow();
@@ -377,7 +378,7 @@ public void test_ColumnEquality_containsValues() {
@Test
@NeedReload
public void test_ColumnType_isOfType() {
- Table table = new Table(source, "test");
+ Table table = new Table(connectionProvider, "test");
Changes changes = new Changes(table).setStartPointNow();
update();
changes.setEndPointNow();
@@ -431,7 +432,7 @@ public void test_ColumnType_isOfType() {
@Test
@NeedReload
public void test_ColumnOfChangeEquality_hasValues() {
- Table table = new Table(source, "test", null, new String[]{"var20"});
+ Table table = new Table(connectionProvider, "test", null, new String[]{"var20"});
Changes changes = new Changes(table).setStartPointNow();
update();
changes.setEndPointNow();
@@ -484,7 +485,7 @@ public void test_ColumnOfChangeEquality_hasValues() {
@Test
@NeedReload
public void test_RowEquality_hasValues() {
- Table table = new Table(source, "test", null, new String[]{"var20"});
+ Table table = new Table(connectionProvider, "test", null, new String[]{"var20"});
Changes changes = new Changes(table).setStartPointNow();
update();
changes.setEndPointNow();
@@ -507,7 +508,7 @@ public void test_RowEquality_hasValues() {
@Test
@NeedReload
public void test_ValueClass_isOfClass() {
- Table table = new Table(source, "test");
+ Table table = new Table(connectionProvider, "test");
Changes changes = new Changes(table).setStartPointNow();
update();
changes.setEndPointNow();
@@ -562,7 +563,7 @@ public void test_ValueClass_isOfClass() {
@Test
@NeedReload
public void test_ValueEquality_isEqualTo() {
- Table table = new Table(source, "test");
+ Table table = new Table(connectionProvider, "test");
Changes changes = new Changes(table).setStartPointNow();
update();
changes.setEndPointNow();
@@ -615,7 +616,7 @@ public void test_ValueEquality_isEqualTo() {
@Test
@NeedReload
public void test_ValueNonEquality_isNotEqualTo() {
- Table table = new Table(source, "test");
+ Table table = new Table(connectionProvider, "test");
Changes changes = new Changes(table).setStartPointNow();
update();
changes.setEndPointNow();
@@ -668,7 +669,7 @@ public void test_ValueNonEquality_isNotEqualTo() {
@Test
@NeedReload
public void test_ValueType_isOfType() {
- Table table = new Table(source, "test");
+ Table table = new Table(connectionProvider, "test");
Changes changes = new Changes(table).setStartPointNow();
update();
changes.setEndPointNow();
diff --git a/src/test/java/org/assertj/db/navigation/InstantiationError_Test.java b/src/test/java/org/assertj/db/navigation/InstantiationError_Test.java
index 1f8549c4..877adb79 100644
--- a/src/test/java/org/assertj/db/navigation/InstantiationError_Test.java
+++ b/src/test/java/org/assertj/db/navigation/InstantiationError_Test.java
@@ -35,6 +35,7 @@
* Tests on instantiation errors.
*
* @author Régis Pouiller
+ * @author Julien Roy
*/
public class InstantiationError_Test extends AbstractTest {
@@ -43,7 +44,7 @@ public class InstantiationError_Test extends AbstractTest {
*/
@Test
public void should_fail_because_mistake_in_instantiation_of_column() throws Exception {
- Table table = new Table(source, "actor");
+ Table table = new Table(jdbcConnectionProvider, "actor");
TableAssert tableAssert = assertThat(table);
Field field = AbstractDbAssert.class.getDeclaredField("columnPosition");
@@ -70,7 +71,7 @@ public void should_fail_because_mistake_in_instantiation_of_column() throws Exce
*/
@Test
public void should_fail_because_mistake_in_instantiation_of_row() throws Exception {
- Table table = new Table(source, "actor");
+ Table table = new Table(jdbcConnectionProvider, "actor");
TableAssert tableAssert = assertThat(table);
Field field = AbstractDbAssert.class.getDeclaredField("rowPosition");
@@ -97,7 +98,7 @@ public void should_fail_because_mistake_in_instantiation_of_row() throws Excepti
*/
@Test
public void should_fail_because_mistake_in_instantiation_of_value() throws Exception {
- Table table = new Table(source, "actor");
+ Table table = new Table(jdbcConnectionProvider, "actor");
TableColumnAssert tableColumnAssert = assertThat(table).column();
Field field = AbstractColumnAssert.class.getDeclaredField("valuePosition");
@@ -125,7 +126,7 @@ public void should_fail_because_mistake_in_instantiation_of_value() throws Excep
@Test
@NeedReload
public void should_fail_because_mistake_in_instantiation_of_changes() throws Exception {
- Changes changes = new Changes(source).setStartPointNow();
+ Changes changes = new Changes(jdbcConnectionProvider).setStartPointNow();
updateChangesForTests();
changes.setEndPointNow();
ChangesAssert changesAssert = assertThat(changes);
@@ -155,7 +156,7 @@ public void should_fail_because_mistake_in_instantiation_of_changes() throws Exc
@Test
@NeedReload
public void should_fail_because_mistake_in_instantiation_of_change() throws Exception {
- Changes changes = new Changes(source).setStartPointNow();
+ Changes changes = new Changes(jdbcConnectionProvider).setStartPointNow();
updateChangesForTests();
changes.setEndPointNow();
ChangesAssert changesAssert = assertThat(changes);
@@ -185,7 +186,7 @@ public void should_fail_because_mistake_in_instantiation_of_change() throws Exce
@Test
@NeedReload
public void should_fail_because_mistake_in_instantiation_of_columnchange() throws Exception {
- Changes changes = new Changes(source).setStartPointNow();
+ Changes changes = new Changes(jdbcConnectionProvider).setStartPointNow();
updateChangesForTests();
changes.setEndPointNow();
ChangeAssert changeAssert = assertThat(changes).change();
@@ -215,7 +216,7 @@ public void should_fail_because_mistake_in_instantiation_of_columnchange() throw
@Test
@NeedReload
public void should_fail_because_mistake_in_instantiation_of_rowAtStartPoint() throws Exception {
- Changes changes = new Changes(source).setStartPointNow();
+ Changes changes = new Changes(jdbcConnectionProvider).setStartPointNow();
updateChangesForTests();
changes.setEndPointNow();
ChangeAssert changeAssert = assertThat(changes).change();
diff --git a/src/test/java/org/assertj/db/navigation/ReturnToOrigin_Test.java b/src/test/java/org/assertj/db/navigation/ReturnToOrigin_Test.java
index 863d1bb6..78baaf11 100644
--- a/src/test/java/org/assertj/db/navigation/ReturnToOrigin_Test.java
+++ b/src/test/java/org/assertj/db/navigation/ReturnToOrigin_Test.java
@@ -60,6 +60,7 @@
* Tests on the different methods linked on the {@code returnToOrigin()} method.
*
* @author Régis Pouiller
+ * @author Julien Roy
*/
public class ReturnToOrigin_Test extends AbstractTest {
@@ -68,7 +69,7 @@ public class ReturnToOrigin_Test extends AbstractTest {
*/
@Test
public void test_return_to_table_from_column_with_assertions() throws Exception {
- Table table = new Table(source, "actor");
+ Table table = new Table(jdbcConnectionProvider, "actor");
TableAssert tableAssert = assertThat(table);
TableColumnAssert tableColumnAssert = tableAssert.column();
TableAssert tableAssertBis = tableColumnAssert.returnToTable();
@@ -81,7 +82,7 @@ public void test_return_to_table_from_column_with_assertions() throws Exception
*/
@Test
public void test_return_to_table_from_row_with_assertions() throws Exception {
- Table table = new Table(source, "actor");
+ Table table = new Table(jdbcConnectionProvider, "actor");
TableAssert tableAssert = assertThat(table);
TableRowAssert tableRowAssert = tableAssert.row();
TableAssert tableAssertBis = tableRowAssert.returnToTable();
@@ -94,7 +95,7 @@ public void test_return_to_table_from_row_with_assertions() throws Exception {
*/
@Test
public void test_return_to_request_from_column_with_assertions() throws Exception {
- Request request = new Request(source, "select * from actor");
+ Request request = new Request(jdbcConnectionProvider, "select * from actor");
RequestAssert requestAssert = assertThat(request);
RequestColumnAssert requestColumnAssert = requestAssert.column();
RequestAssert requestAssertBis = requestColumnAssert.returnToRequest();
@@ -107,7 +108,7 @@ public void test_return_to_request_from_column_with_assertions() throws Exceptio
*/
@Test
public void test_return_to_request_from_row_with_assertions() throws Exception {
- Request request = new Request(source, "select * from actor");
+ Request request = new Request(jdbcConnectionProvider, "select * from actor");
RequestAssert requestAssert = assertThat(request);
RequestRowAssert requestRowAssert = requestAssert.row();
RequestAssert requestAssertBis = requestRowAssert.returnToRequest();
@@ -120,7 +121,7 @@ public void test_return_to_request_from_row_with_assertions() throws Exception {
*/
@Test
public void test_return_to_column_from_value_for_table_with_assertions() throws Exception {
- Table table = new Table(source, "actor");
+ Table table = new Table(jdbcConnectionProvider, "actor");
TableAssert tableAssert = assertThat(table);
TableColumnAssert tableColumnAssert = tableAssert.column();
TableColumnValueAssert tableColumnValueAssert = tableColumnAssert.value();
@@ -134,7 +135,7 @@ public void test_return_to_column_from_value_for_table_with_assertions() throws
*/
@Test
public void test_return_to_row_from_value_for_table_with_assertions() throws Exception {
- Table table = new Table(source, "actor");
+ Table table = new Table(jdbcConnectionProvider, "actor");
TableAssert tableAssert = assertThat(table);
TableRowAssert tableRowAssert = tableAssert.row();
TableRowValueAssert tableRowValueAssert = tableRowAssert.value();
@@ -148,7 +149,7 @@ public void test_return_to_row_from_value_for_table_with_assertions() throws Exc
*/
@Test
public void test_return_to_column_from_value_for_request_with_assertions() throws Exception {
- Request request = new Request(source, "select * from actor");
+ Request request = new Request(jdbcConnectionProvider, "select * from actor");
RequestAssert requestAssert = assertThat(request);
RequestColumnAssert requestColumnAssert = requestAssert.column();
RequestColumnValueAssert requestColumnValueAssert = requestColumnAssert.value();
@@ -162,7 +163,7 @@ public void test_return_to_column_from_value_for_request_with_assertions() throw
*/
@Test
public void test_return_to_row_from_value_for_request_with_assertions() throws Exception {
- Request request = new Request(source, "select * from actor");
+ Request request = new Request(jdbcConnectionProvider, "select * from actor");
RequestAssert requestAssert = assertThat(request);
RequestRowAssert requestRowAssert = requestAssert.row();
RequestRowValueAssert requestRowValueAssert = requestRowAssert.value();
@@ -177,7 +178,7 @@ public void test_return_to_row_from_value_for_request_with_assertions() throws E
@Test
@NeedReload
public void test_return_to_changes_from_change_with_assertions() throws Exception {
- Changes changes = new Changes(source).setStartPointNow();
+ Changes changes = new Changes(jdbcConnectionProvider).setStartPointNow();
updateChangesForTests();
changes.setEndPointNow();
@@ -194,7 +195,7 @@ public void test_return_to_changes_from_change_with_assertions() throws Exceptio
@Test
@NeedReload
public void test_return_to_change_from_column_with_assertions() throws Exception {
- Changes changes = new Changes(source).setStartPointNow();
+ Changes changes = new Changes(jdbcConnectionProvider).setStartPointNow();
updateChangesForTests();
changes.setEndPointNow();
@@ -211,7 +212,7 @@ public void test_return_to_change_from_column_with_assertions() throws Exception
@Test
@NeedReload
public void test_return_to_change_from_row_with_assertions() throws Exception {
- Changes changes = new Changes(source).setStartPointNow();
+ Changes changes = new Changes(jdbcConnectionProvider).setStartPointNow();
updateChangesForTests();
changes.setEndPointNow();
@@ -228,7 +229,7 @@ public void test_return_to_change_from_row_with_assertions() throws Exception {
@Test
@NeedReload
public void test_return_to_column_from_value_with_assertions() throws Exception {
- Changes changes = new Changes(source).setStartPointNow();
+ Changes changes = new Changes(jdbcConnectionProvider).setStartPointNow();
updateChangesForTests();
changes.setEndPointNow();
@@ -245,7 +246,7 @@ public void test_return_to_column_from_value_with_assertions() throws Exception
@Test
@NeedReload
public void test_return_to_row_from_value_with_assertions() throws Exception {
- Changes changes = new Changes(source).setStartPointNow();
+ Changes changes = new Changes(jdbcConnectionProvider).setStartPointNow();
updateChangesForTests();
changes.setEndPointNow();
@@ -261,7 +262,7 @@ public void test_return_to_row_from_value_with_assertions() throws Exception {
*/
@Test
public void test_return_to_table_from_column_with_displays() throws Exception {
- Table table = new Table(source, "actor");
+ Table table = new Table(jdbcConnectionProvider, "actor");
TableOutputter tableOutputter = Outputs.output(table);
TableColumnOutputter tableColumnOutputter = tableOutputter.column();
TableOutputter tableOutputterBis = tableColumnOutputter.returnToTable();
@@ -274,7 +275,7 @@ public void test_return_to_table_from_column_with_displays() throws Exception {
*/
@Test
public void test_return_to_table_from_row_with_displays() throws Exception {
- Table table = new Table(source, "actor");
+ Table table = new Table(jdbcConnectionProvider, "actor");
TableOutputter tableOutputter = Outputs.output(table);
TableRowOutputter tableRowOutputter = tableOutputter.row();
TableOutputter tableOutputterBis = tableRowOutputter.returnToTable();
@@ -287,7 +288,7 @@ public void test_return_to_table_from_row_with_displays() throws Exception {
*/
@Test
public void test_return_to_request_from_column_with_displays() throws Exception {
- Request request = new Request(source, "select * from actor");
+ Request request = new Request(jdbcConnectionProvider, "select * from actor");
RequestOutputter requestOutputter = Outputs.output(request);
RequestColumnOutputter requestColumnOutputter = requestOutputter.column();
RequestOutputter requestOutputterBis = requestColumnOutputter.returnToRequest();
@@ -300,7 +301,7 @@ public void test_return_to_request_from_column_with_displays() throws Exception
*/
@Test
public void test_return_to_request_from_row_with_displays() throws Exception {
- Request request = new Request(source, "select * from actor");
+ Request request = new Request(jdbcConnectionProvider, "select * from actor");
RequestOutputter requestOutputter = Outputs.output(request);
RequestRowOutputter requestRowOutputter = requestOutputter.row();
RequestOutputter requestOutputterBis = requestRowOutputter.returnToRequest();
@@ -313,7 +314,7 @@ public void test_return_to_request_from_row_with_displays() throws Exception {
*/
@Test
public void test_return_to_column_from_value_for_table_with_displays() throws Exception {
- Table table = new Table(source, "actor");
+ Table table = new Table(jdbcConnectionProvider, "actor");
TableOutputter tableOutputter = Outputs.output(table);
TableColumnOutputter tableColumnOutputter = tableOutputter.column();
TableColumnValueOutputter tableColumnValueOutputter = tableColumnOutputter.value();
@@ -327,7 +328,7 @@ public void test_return_to_column_from_value_for_table_with_displays() throws Ex
*/
@Test
public void test_return_to_row_from_value_for_table_with_displays() throws Exception {
- Table table = new Table(source, "actor");
+ Table table = new Table(jdbcConnectionProvider, "actor");
TableOutputter tableOutputter = Outputs.output(table);
TableRowOutputter tableRowOutputter = tableOutputter.row();
TableRowValueOutputter tableRowValueOutputter = tableRowOutputter.value();
@@ -341,7 +342,7 @@ public void test_return_to_row_from_value_for_table_with_displays() throws Excep
*/
@Test
public void test_return_to_column_from_value_for_request_with_displays() throws Exception {
- Request request = new Request(source, "select * from actor");
+ Request request = new Request(jdbcConnectionProvider, "select * from actor");
RequestOutputter requestOutputter = Outputs.output(request);
RequestColumnOutputter requestColumnOutputter = requestOutputter.column();
RequestColumnValueOutputter requestColumnValueOutputter = requestColumnOutputter.value();
@@ -355,7 +356,7 @@ public void test_return_to_column_from_value_for_request_with_displays() throws
*/
@Test
public void test_return_to_row_from_value_for_request_with_displays() throws Exception {
- Request request = new Request(source, "select * from actor");
+ Request request = new Request(jdbcConnectionProvider, "select * from actor");
RequestOutputter requestOutputter = Outputs.output(request);
RequestRowOutputter requestRowOutputter = requestOutputter.row();
RequestRowValueOutputter requestRowValueOutputter = requestRowOutputter.value();
@@ -370,7 +371,7 @@ public void test_return_to_row_from_value_for_request_with_displays() throws Exc
@Test
@NeedReload
public void test_return_to_changes_from_change_with_displays() throws Exception {
- Changes changes = new Changes(source).setStartPointNow();
+ Changes changes = new Changes(jdbcConnectionProvider).setStartPointNow();
updateChangesForTests();
changes.setEndPointNow();
@@ -387,7 +388,7 @@ public void test_return_to_changes_from_change_with_displays() throws Exception
@Test
@NeedReload
public void test_return_to_change_from_column_with_displays() throws Exception {
- Changes changes = new Changes(source).setStartPointNow();
+ Changes changes = new Changes(jdbcConnectionProvider).setStartPointNow();
updateChangesForTests();
changes.setEndPointNow();
@@ -404,7 +405,7 @@ public void test_return_to_change_from_column_with_displays() throws Exception {
@Test
@NeedReload
public void test_return_to_change_from_row_with_displays() throws Exception {
- Changes changes = new Changes(source).setStartPointNow();
+ Changes changes = new Changes(jdbcConnectionProvider).setStartPointNow();
updateChangesForTests();
changes.setEndPointNow();
@@ -421,7 +422,7 @@ public void test_return_to_change_from_row_with_displays() throws Exception {
@Test
@NeedReload
public void test_return_to_column_from_value_with_displays() throws Exception {
- Changes changes = new Changes(source).setStartPointNow();
+ Changes changes = new Changes(jdbcConnectionProvider).setStartPointNow();
updateChangesForTests();
changes.setEndPointNow();
@@ -438,7 +439,7 @@ public void test_return_to_column_from_value_with_displays() throws Exception {
@Test
@NeedReload
public void test_return_to_row_from_value_with_displays() throws Exception {
- Changes changes = new Changes(source).setStartPointNow();
+ Changes changes = new Changes(jdbcConnectionProvider).setStartPointNow();
updateChangesForTests();
changes.setEndPointNow();
diff --git a/src/test/java/org/assertj/db/navigation/ToChange_ChangeOfCreationOnTable_Integer_Test.java b/src/test/java/org/assertj/db/navigation/ToChange_ChangeOfCreationOnTable_Integer_Test.java
index ed389516..f65b98e4 100644
--- a/src/test/java/org/assertj/db/navigation/ToChange_ChangeOfCreationOnTable_Integer_Test.java
+++ b/src/test/java/org/assertj/db/navigation/ToChange_ChangeOfCreationOnTable_Integer_Test.java
@@ -38,6 +38,7 @@
* {@link org.assertj.db.navigation.ToChange#changeOfCreationOnTable(String, int)} method.
*
* @author Régis Pouiller
+ * @author Julien Roy
*/
public class ToChange_ChangeOfCreationOnTable_Integer_Test extends AbstractTest {
@@ -47,7 +48,7 @@ public class ToChange_ChangeOfCreationOnTable_Integer_Test extends AbstractTest
@Test
@NeedReload
public void test_change_of_creation_on_table_with_index_with_assertions() throws Exception {
- Changes changes = new Changes(source).setStartPointNow();
+ Changes changes = new Changes(jdbcConnectionProvider).setStartPointNow();
updateChangesForTests();
changes.setEndPointNow();
@@ -144,7 +145,7 @@ public void test_change_of_creation_on_table_with_index_with_assertions() throws
@Test
@NeedReload
public void test_change_of_creation_on_table_with_index_with_displays() throws Exception {
- Changes changes = new Changes(source).setStartPointNow();
+ Changes changes = new Changes(jdbcConnectionProvider).setStartPointNow();
updateChangesForTests();
changes.setEndPointNow();
diff --git a/src/test/java/org/assertj/db/navigation/ToChange_ChangeOfCreationOnTable_Test.java b/src/test/java/org/assertj/db/navigation/ToChange_ChangeOfCreationOnTable_Test.java
index 16fbe055..39d4aeea 100644
--- a/src/test/java/org/assertj/db/navigation/ToChange_ChangeOfCreationOnTable_Test.java
+++ b/src/test/java/org/assertj/db/navigation/ToChange_ChangeOfCreationOnTable_Test.java
@@ -38,6 +38,7 @@
* {@link ToChange#changeOfCreationOnTable(String)} method.
*
* @author Régis Pouiller
+ * @author Julien Roy
*/
public class ToChange_ChangeOfCreationOnTable_Test extends AbstractTest {
@@ -47,7 +48,7 @@ public class ToChange_ChangeOfCreationOnTable_Test extends AbstractTest {
@Test
@NeedReload
public void test_change_of_creation_on_table_with_assertions() throws Exception {
- Changes changes = new Changes(source).setStartPointNow();
+ Changes changes = new Changes(jdbcConnectionProvider).setStartPointNow();
updateChangesForTests();
changes.setEndPointNow();
@@ -128,7 +129,7 @@ public void test_change_of_creation_on_table_with_assertions() throws Exception
@Test
@NeedReload
public void test_change_of_creation_on_table_with_displays() throws Exception {
- Changes changes = new Changes(source).setStartPointNow();
+ Changes changes = new Changes(jdbcConnectionProvider).setStartPointNow();
updateChangesForTests();
changes.setEndPointNow();
diff --git a/src/test/java/org/assertj/db/navigation/ToChange_ChangeOfCreation_Integer_Test.java b/src/test/java/org/assertj/db/navigation/ToChange_ChangeOfCreation_Integer_Test.java
index b0bf5fd0..016695ec 100644
--- a/src/test/java/org/assertj/db/navigation/ToChange_ChangeOfCreation_Integer_Test.java
+++ b/src/test/java/org/assertj/db/navigation/ToChange_ChangeOfCreation_Integer_Test.java
@@ -38,6 +38,7 @@
* {@link ToChange#changeOfCreation(int)} method.
*
* @author Régis Pouiller
+ * @author Julien Roy
*/
public class ToChange_ChangeOfCreation_Integer_Test extends AbstractTest {
@@ -47,7 +48,7 @@ public class ToChange_ChangeOfCreation_Integer_Test extends AbstractTest {
@Test
@NeedReload
public void test_change_of_creation_with_index_with_assertions() throws Exception {
- Changes changes = new Changes(source).setStartPointNow();
+ Changes changes = new Changes(jdbcConnectionProvider).setStartPointNow();
updateChangesForTests();
changes.setEndPointNow();
@@ -144,7 +145,7 @@ public void test_change_of_creation_with_index_with_assertions() throws Exceptio
@Test
@NeedReload
public void test_change_of_creation_with_index_with_displays() throws Exception {
- Changes changes = new Changes(source).setStartPointNow();
+ Changes changes = new Changes(jdbcConnectionProvider).setStartPointNow();
updateChangesForTests();
changes.setEndPointNow();
diff --git a/src/test/java/org/assertj/db/navigation/ToChange_ChangeOfCreation_Test.java b/src/test/java/org/assertj/db/navigation/ToChange_ChangeOfCreation_Test.java
index 536ecbe5..aac997ec 100644
--- a/src/test/java/org/assertj/db/navigation/ToChange_ChangeOfCreation_Test.java
+++ b/src/test/java/org/assertj/db/navigation/ToChange_ChangeOfCreation_Test.java
@@ -38,6 +38,7 @@
* {@link org.assertj.db.navigation.ToChange#changeOfCreation()} method.
*
* @author Régis Pouiller
+ * @author Julien Roy
*/
public class ToChange_ChangeOfCreation_Test extends AbstractTest {
@@ -47,7 +48,7 @@ public class ToChange_ChangeOfCreation_Test extends AbstractTest {
@Test
@NeedReload
public void test_change_of_creation_with_assertions() throws Exception {
- Changes changes = new Changes(source).setStartPointNow();
+ Changes changes = new Changes(jdbcConnectionProvider).setStartPointNow();
updateChangesForTests();
changes.setEndPointNow();
@@ -128,7 +129,7 @@ public void test_change_of_creation_with_assertions() throws Exception {
@Test
@NeedReload
public void test_change_of_creation_with_displays() throws Exception {
- Changes changes = new Changes(source).setStartPointNow();
+ Changes changes = new Changes(jdbcConnectionProvider).setStartPointNow();
updateChangesForTests();
changes.setEndPointNow();
diff --git a/src/test/java/org/assertj/db/navigation/ToChange_ChangeOfDeletionOnTable_Integer_Test.java b/src/test/java/org/assertj/db/navigation/ToChange_ChangeOfDeletionOnTable_Integer_Test.java
index ba86c2ec..a0348194 100644
--- a/src/test/java/org/assertj/db/navigation/ToChange_ChangeOfDeletionOnTable_Integer_Test.java
+++ b/src/test/java/org/assertj/db/navigation/ToChange_ChangeOfDeletionOnTable_Integer_Test.java
@@ -38,6 +38,7 @@
* {@link ToChange#changeOfDeletionOnTable(String, int)} method.
*
* @author Régis Pouiller
+ * @author Julien Roy
*/
public class ToChange_ChangeOfDeletionOnTable_Integer_Test extends AbstractTest {
@@ -47,7 +48,7 @@ public class ToChange_ChangeOfDeletionOnTable_Integer_Test extends AbstractTest
@Test
@NeedReload
public void test_change_of_deletion_on_table_with_index_with_assertions() throws Exception {
- Changes changes = new Changes(source).setStartPointNow();
+ Changes changes = new Changes(jdbcConnectionProvider).setStartPointNow();
updateChangesForTests();
changes.setEndPointNow();
@@ -133,7 +134,7 @@ public void test_change_of_deletion_on_table_with_index_with_assertions() throws
@Test
@NeedReload
public void test_change_of_deletion_on_table_with_index_with_displays() throws Exception {
- Changes changes = new Changes(source).setStartPointNow();
+ Changes changes = new Changes(jdbcConnectionProvider).setStartPointNow();
updateChangesForTests();
changes.setEndPointNow();
diff --git a/src/test/java/org/assertj/db/navigation/ToChange_ChangeOfDeletionOnTable_Test.java b/src/test/java/org/assertj/db/navigation/ToChange_ChangeOfDeletionOnTable_Test.java
index ef8f07d2..edd2f57d 100644
--- a/src/test/java/org/assertj/db/navigation/ToChange_ChangeOfDeletionOnTable_Test.java
+++ b/src/test/java/org/assertj/db/navigation/ToChange_ChangeOfDeletionOnTable_Test.java
@@ -38,6 +38,7 @@
* {@link org.assertj.db.navigation.ToChange#changeOfDeletionOnTable(String)} method.
*
* @author Régis Pouiller
+ * @author Julien Roy
*/
public class ToChange_ChangeOfDeletionOnTable_Test extends AbstractTest {
@@ -47,7 +48,7 @@ public class ToChange_ChangeOfDeletionOnTable_Test extends AbstractTest {
@Test
@NeedReload
public void test_change_of_deletion_on_table_with_assertions() throws Exception {
- Changes changes = new Changes(source).setStartPointNow();
+ Changes changes = new Changes(jdbcConnectionProvider).setStartPointNow();
updateChangesForTests();
changes.setEndPointNow();
@@ -117,7 +118,7 @@ public void test_change_of_deletion_on_table_with_assertions() throws Exception
@Test
@NeedReload
public void test_change_of_deletion_on_table_with_displays() throws Exception {
- Changes changes = new Changes(source).setStartPointNow();
+ Changes changes = new Changes(jdbcConnectionProvider).setStartPointNow();
updateChangesForTests();
changes.setEndPointNow();
diff --git a/src/test/java/org/assertj/db/navigation/ToChange_ChangeOfDeletion_Integer_Test.java b/src/test/java/org/assertj/db/navigation/ToChange_ChangeOfDeletion_Integer_Test.java
index 4472e644..8aaed8ab 100644
--- a/src/test/java/org/assertj/db/navigation/ToChange_ChangeOfDeletion_Integer_Test.java
+++ b/src/test/java/org/assertj/db/navigation/ToChange_ChangeOfDeletion_Integer_Test.java
@@ -38,6 +38,7 @@
* {@link org.assertj.db.navigation.ToChange#changeOfDeletion(int)} method.
*
* @author Régis Pouiller
+ * @author Julien Roy
*/
public class ToChange_ChangeOfDeletion_Integer_Test extends AbstractTest {
@@ -47,7 +48,7 @@ public class ToChange_ChangeOfDeletion_Integer_Test extends AbstractTest {
@Test
@NeedReload
public void test_change_of_deletion_with_index_with_assertions() throws Exception {
- Changes changes = new Changes(source).setStartPointNow();
+ Changes changes = new Changes(jdbcConnectionProvider).setStartPointNow();
updateChangesForTests();
changes.setEndPointNow();
@@ -133,7 +134,7 @@ public void test_change_of_deletion_with_index_with_assertions() throws Exceptio
@Test
@NeedReload
public void test_change_of_deletion_with_index_with_displays() throws Exception {
- Changes changes = new Changes(source).setStartPointNow();
+ Changes changes = new Changes(jdbcConnectionProvider).setStartPointNow();
updateChangesForTests();
changes.setEndPointNow();
diff --git a/src/test/java/org/assertj/db/navigation/ToChange_ChangeOfDeletion_Test.java b/src/test/java/org/assertj/db/navigation/ToChange_ChangeOfDeletion_Test.java
index 24e785a1..8b6bb2b8 100644
--- a/src/test/java/org/assertj/db/navigation/ToChange_ChangeOfDeletion_Test.java
+++ b/src/test/java/org/assertj/db/navigation/ToChange_ChangeOfDeletion_Test.java
@@ -38,6 +38,7 @@
* {@link ToChange#changeOfDeletion()} method.
*
* @author Régis Pouiller
+ * @author Julien Roy
*/
public class ToChange_ChangeOfDeletion_Test extends AbstractTest {
@@ -47,7 +48,7 @@ public class ToChange_ChangeOfDeletion_Test extends AbstractTest {
@Test
@NeedReload
public void test_change_of_deletion_with_assertions() throws Exception {
- Changes changes = new Changes(source).setStartPointNow();
+ Changes changes = new Changes(jdbcConnectionProvider).setStartPointNow();
updateChangesForTests();
changes.setEndPointNow();
@@ -117,7 +118,7 @@ public void test_change_of_deletion_with_assertions() throws Exception {
@Test
@NeedReload
public void test_change_of_deletion_with_displays() throws Exception {
- Changes changes = new Changes(source).setStartPointNow();
+ Changes changes = new Changes(jdbcConnectionProvider).setStartPointNow();
updateChangesForTests();
changes.setEndPointNow();
diff --git a/src/test/java/org/assertj/db/navigation/ToChange_ChangeOfModificationOnTable_Integer_Test.java b/src/test/java/org/assertj/db/navigation/ToChange_ChangeOfModificationOnTable_Integer_Test.java
index 528721c7..b7fa860a 100644
--- a/src/test/java/org/assertj/db/navigation/ToChange_ChangeOfModificationOnTable_Integer_Test.java
+++ b/src/test/java/org/assertj/db/navigation/ToChange_ChangeOfModificationOnTable_Integer_Test.java
@@ -38,6 +38,7 @@
* {@link org.assertj.db.navigation.ToChange#changeOfModificationOnTable(String, int)} method.
*
* @author Régis Pouiller
+ * @author Julien Roy
*/
public class ToChange_ChangeOfModificationOnTable_Integer_Test extends AbstractTest {
@@ -47,7 +48,7 @@ public class ToChange_ChangeOfModificationOnTable_Integer_Test extends AbstractT
@Test
@NeedReload
public void test_change_of_modification_on_table_with_index_with_assertions() throws Exception {
- Changes changes = new Changes(source).setStartPointNow();
+ Changes changes = new Changes(jdbcConnectionProvider).setStartPointNow();
updateChangesForTests();
changes.setEndPointNow();
@@ -144,7 +145,7 @@ public void test_change_of_modification_on_table_with_index_with_assertions() th
@Test
@NeedReload
public void test_change_of_modification_on_table_with_index_with_displays() throws Exception {
- Changes changes = new Changes(source).setStartPointNow();
+ Changes changes = new Changes(jdbcConnectionProvider).setStartPointNow();
updateChangesForTests();
changes.setEndPointNow();
diff --git a/src/test/java/org/assertj/db/navigation/ToChange_ChangeOfModificationOnTable_Test.java b/src/test/java/org/assertj/db/navigation/ToChange_ChangeOfModificationOnTable_Test.java
index df93151a..f10bad25 100644
--- a/src/test/java/org/assertj/db/navigation/ToChange_ChangeOfModificationOnTable_Test.java
+++ b/src/test/java/org/assertj/db/navigation/ToChange_ChangeOfModificationOnTable_Test.java
@@ -38,6 +38,7 @@
* {@link ToChange#changeOfModificationOnTable(String)} method.
*
* @author Régis Pouiller
+ * @author Julien Roy
*/
public class ToChange_ChangeOfModificationOnTable_Test extends AbstractTest {
@@ -47,7 +48,7 @@ public class ToChange_ChangeOfModificationOnTable_Test extends AbstractTest {
@Test
@NeedReload
public void test_change_of_modification_on_table_with_assertions() throws Exception {
- Changes changes = new Changes(source).setStartPointNow();
+ Changes changes = new Changes(jdbcConnectionProvider).setStartPointNow();
updateChangesForTests();
changes.setEndPointNow();
@@ -128,7 +129,7 @@ public void test_change_of_modification_on_table_with_assertions() throws Except
@Test
@NeedReload
public void test_change_of_modification_on_table_with_displays() throws Exception {
- Changes changes = new Changes(source).setStartPointNow();
+ Changes changes = new Changes(jdbcConnectionProvider).setStartPointNow();
updateChangesForTests();
changes.setEndPointNow();
diff --git a/src/test/java/org/assertj/db/navigation/ToChange_ChangeOfModification_Integer_Test.java b/src/test/java/org/assertj/db/navigation/ToChange_ChangeOfModification_Integer_Test.java
index 0b0e8dcf..ad90c950 100644
--- a/src/test/java/org/assertj/db/navigation/ToChange_ChangeOfModification_Integer_Test.java
+++ b/src/test/java/org/assertj/db/navigation/ToChange_ChangeOfModification_Integer_Test.java
@@ -38,6 +38,7 @@
* {@link ToChange#changeOfModification(int)} method.
*
* @author Régis Pouiller
+ * @author Julien Roy
*/
public class ToChange_ChangeOfModification_Integer_Test extends AbstractTest {
@@ -47,7 +48,7 @@ public class ToChange_ChangeOfModification_Integer_Test extends AbstractTest {
@Test
@NeedReload
public void test_change_of_modification_with_index_with_assertions() throws Exception {
- Changes changes = new Changes(source).setStartPointNow();
+ Changes changes = new Changes(jdbcConnectionProvider).setStartPointNow();
updateChangesForTests();
changes.setEndPointNow();
@@ -144,7 +145,7 @@ public void test_change_of_modification_with_index_with_assertions() throws Exce
@Test
@NeedReload
public void test_change_of_modification_with_index_with_displays() throws Exception {
- Changes changes = new Changes(source).setStartPointNow();
+ Changes changes = new Changes(jdbcConnectionProvider).setStartPointNow();
updateChangesForTests();
changes.setEndPointNow();
diff --git a/src/test/java/org/assertj/db/navigation/ToChange_ChangeOfModification_Test.java b/src/test/java/org/assertj/db/navigation/ToChange_ChangeOfModification_Test.java
index a82b1dd7..aea6dc90 100644
--- a/src/test/java/org/assertj/db/navigation/ToChange_ChangeOfModification_Test.java
+++ b/src/test/java/org/assertj/db/navigation/ToChange_ChangeOfModification_Test.java
@@ -12,15 +12,6 @@
*/
package org.assertj.db.navigation;
-import static org.assertj.core.api.Assertions.assertThat;
-import static org.assertj.db.api.Assertions.assertThat;
-import static org.assertj.db.output.Outputs.output;
-import static org.junit.Assert.fail;
-
-import java.lang.reflect.Field;
-import java.util.List;
-import java.util.Map;
-
import org.assertj.core.api.Assertions;
import org.assertj.db.api.ChangeAssert;
import org.assertj.db.api.ChangesAssert;
@@ -33,11 +24,21 @@
import org.assertj.db.type.Changes;
import org.junit.Test;
+import java.lang.reflect.Field;
+import java.util.List;
+import java.util.Map;
+
+import static org.assertj.core.api.Assertions.assertThat;
+import static org.assertj.db.api.Assertions.assertThat;
+import static org.assertj.db.output.Outputs.output;
+import static org.junit.Assert.fail;
+
/**
* Tests on {@link org.assertj.db.navigation.ToChange} class :
* {@link org.assertj.db.navigation.ToChange#changeOfModification()} method.
*
* @author Régis Pouiller
+ * @author Julien Roy
*/
public class ToChange_ChangeOfModification_Test extends AbstractTest {
@@ -47,7 +48,7 @@ public class ToChange_ChangeOfModification_Test extends AbstractTest {
@Test
@NeedReload
public void test_change_of_modification_with_assertions() throws Exception {
- Changes changes = new Changes(source).setStartPointNow();
+ Changes changes = new Changes(jdbcConnectionProvider).setStartPointNow();
updateChangesForTests();
changes.setEndPointNow();
@@ -128,7 +129,7 @@ public void test_change_of_modification_with_assertions() throws Exception {
@Test
@NeedReload
public void test_change_of_modification_with_displays() throws Exception {
- Changes changes = new Changes(source).setStartPointNow();
+ Changes changes = new Changes(jdbcConnectionProvider).setStartPointNow();
updateChangesForTests();
changes.setEndPointNow();
diff --git a/src/test/java/org/assertj/db/navigation/ToChange_ChangeOnTableWithPks_Test.java b/src/test/java/org/assertj/db/navigation/ToChange_ChangeOnTableWithPks_Test.java
index 5e10fe96..7ae09b50 100644
--- a/src/test/java/org/assertj/db/navigation/ToChange_ChangeOnTableWithPks_Test.java
+++ b/src/test/java/org/assertj/db/navigation/ToChange_ChangeOnTableWithPks_Test.java
@@ -12,14 +12,6 @@
*/
package org.assertj.db.navigation;
-import static org.assertj.db.api.Assertions.assertThat;
-import static org.assertj.db.output.Outputs.output;
-import static org.junit.Assert.fail;
-
-import java.lang.reflect.Field;
-import java.util.List;
-import java.util.Map;
-
import org.assertj.core.api.Assertions;
import org.assertj.db.api.ChangeAssert;
import org.assertj.db.api.ChangesAssert;
@@ -32,11 +24,20 @@
import org.assertj.db.type.Changes;
import org.junit.Test;
+import java.lang.reflect.Field;
+import java.util.List;
+import java.util.Map;
+
+import static org.assertj.db.api.Assertions.assertThat;
+import static org.assertj.db.output.Outputs.output;
+import static org.junit.Assert.fail;
+
/**
* Tests on {@link ToChange} class :
* {@link ToChange#changeOnTableWithPks(String, Object...)} method.
*
* @author Régis Pouiller
+ * @author Julien Roy
*/
public class ToChange_ChangeOnTableWithPks_Test extends AbstractTest {
@@ -46,7 +47,7 @@ public class ToChange_ChangeOnTableWithPks_Test extends AbstractTest {
@Test
@NeedReload
public void test_change_on_table_with_pks_with_assertions() throws Exception {
- Changes changes = new Changes(source).setStartPointNow();
+ Changes changes = new Changes(jdbcConnectionProvider).setStartPointNow();
updateChangesForTests();
changes.setEndPointNow();
@@ -127,7 +128,7 @@ public void test_change_on_table_with_pks_with_assertions() throws Exception {
@Test
@NeedReload
public void test_change_on_table_with_pks_with_displays() throws Exception {
- Changes changes = new Changes(source).setStartPointNow();
+ Changes changes = new Changes(jdbcConnectionProvider).setStartPointNow();
updateChangesForTests();
changes.setEndPointNow();
diff --git a/src/test/java/org/assertj/db/navigation/ToChange_ChangeOnTable_Integer_Test.java b/src/test/java/org/assertj/db/navigation/ToChange_ChangeOnTable_Integer_Test.java
index 054f6594..3b61d506 100644
--- a/src/test/java/org/assertj/db/navigation/ToChange_ChangeOnTable_Integer_Test.java
+++ b/src/test/java/org/assertj/db/navigation/ToChange_ChangeOnTable_Integer_Test.java
@@ -38,6 +38,7 @@
* {@link ToChange#changeOnTable(String, int)} method.
*
* @author Régis Pouiller
+ * @author Julien Roy
*/
public class ToChange_ChangeOnTable_Integer_Test extends AbstractTest {
@@ -47,7 +48,7 @@ public class ToChange_ChangeOnTable_Integer_Test extends AbstractTest {
@Test
@NeedReload
public void test_change_on_table_with_index_with_assertions() throws Exception {
- Changes changes = new Changes(source).setStartPointNow();
+ Changes changes = new Changes(jdbcConnectionProvider).setStartPointNow();
updateChangesForTests();
changes.setEndPointNow();
@@ -138,7 +139,7 @@ public void test_change_on_table_with_index_with_assertions() throws Exception {
@Test
@NeedReload
public void test_change_on_table_with_index_with_displays() throws Exception {
- Changes changes = new Changes(source).setStartPointNow();
+ Changes changes = new Changes(jdbcConnectionProvider).setStartPointNow();
updateChangesForTests();
changes.setEndPointNow();
diff --git a/src/test/java/org/assertj/db/navigation/ToChange_ChangeOnTable_Test.java b/src/test/java/org/assertj/db/navigation/ToChange_ChangeOnTable_Test.java
index 7b1a4a04..aba577a3 100644
--- a/src/test/java/org/assertj/db/navigation/ToChange_ChangeOnTable_Test.java
+++ b/src/test/java/org/assertj/db/navigation/ToChange_ChangeOnTable_Test.java
@@ -38,6 +38,7 @@
* {@link org.assertj.db.navigation.ToChange#changeOnTable(String)} method.
*
* @author Régis Pouiller
+ * @author Julien Roy
*/
public class ToChange_ChangeOnTable_Test extends AbstractTest {
@@ -47,7 +48,7 @@ public class ToChange_ChangeOnTable_Test extends AbstractTest {
@Test
@NeedReload
public void test_change_on_table_with_assertions() throws Exception {
- Changes changes = new Changes(source).setStartPointNow();
+ Changes changes = new Changes(jdbcConnectionProvider).setStartPointNow();
updateChangesForTests();
changes.setEndPointNow();
@@ -122,7 +123,7 @@ public void test_change_on_table_with_assertions() throws Exception {
@Test
@NeedReload
public void test_change_on_table_with_displays() throws Exception {
- Changes changes = new Changes(source).setStartPointNow();
+ Changes changes = new Changes(jdbcConnectionProvider).setStartPointNow();
updateChangesForTests();
changes.setEndPointNow();
diff --git a/src/test/java/org/assertj/db/navigation/ToChange_Change_Integer_Test.java b/src/test/java/org/assertj/db/navigation/ToChange_Change_Integer_Test.java
index 0a303075..1a79396c 100644
--- a/src/test/java/org/assertj/db/navigation/ToChange_Change_Integer_Test.java
+++ b/src/test/java/org/assertj/db/navigation/ToChange_Change_Integer_Test.java
@@ -38,6 +38,7 @@
* {@link org.assertj.db.navigation.ToChange#change(int)} method.
*
* @author Régis Pouiller
+ * @author Julien Roy
*/
public class ToChange_Change_Integer_Test extends AbstractTest {
@@ -48,7 +49,7 @@ public class ToChange_Change_Integer_Test extends AbstractTest {
@Test
@NeedReload
public void test_change_with_index_with_assertions() throws Exception {
- Changes changes = new Changes(source).setStartPointNow();
+ Changes changes = new Changes(jdbcConnectionProvider).setStartPointNow();
updateChangesForTests();
changes.setEndPointNow();
@@ -185,7 +186,7 @@ public void test_change_with_index_with_assertions() throws Exception {
@Test
@NeedReload
public void test_change_with_index_with_displays() throws Exception {
- Changes changes = new Changes(source).setStartPointNow();
+ Changes changes = new Changes(jdbcConnectionProvider).setStartPointNow();
updateChangesForTests();
changes.setEndPointNow();
diff --git a/src/test/java/org/assertj/db/navigation/ToChange_Change_Test.java b/src/test/java/org/assertj/db/navigation/ToChange_Change_Test.java
index 825a7b2c..12dc0e87 100644
--- a/src/test/java/org/assertj/db/navigation/ToChange_Change_Test.java
+++ b/src/test/java/org/assertj/db/navigation/ToChange_Change_Test.java
@@ -38,6 +38,7 @@
* {@link ToChange#change()} method.
*
* @author Régis Pouiller
+ * @author Julien Roy
*/
public class ToChange_Change_Test extends AbstractTest {
@@ -47,7 +48,7 @@ public class ToChange_Change_Test extends AbstractTest {
@Test
@NeedReload
public void test_change_with_assertions() throws Exception {
- Changes changes = new Changes(source).setStartPointNow();
+ Changes changes = new Changes(jdbcConnectionProvider).setStartPointNow();
updateChangesForTests();
changes.setEndPointNow();
@@ -167,7 +168,7 @@ public void test_change_with_assertions() throws Exception {
@Test
@NeedReload
public void test_change_with_displays() throws Exception {
- Changes changes = new Changes(source).setStartPointNow();
+ Changes changes = new Changes(jdbcConnectionProvider).setStartPointNow();
updateChangesForTests();
changes.setEndPointNow();
diff --git a/src/test/java/org/assertj/db/navigation/ToChange_Test.java b/src/test/java/org/assertj/db/navigation/ToChange_Test.java
index a2e79c6d..b8bbca41 100644
--- a/src/test/java/org/assertj/db/navigation/ToChange_Test.java
+++ b/src/test/java/org/assertj/db/navigation/ToChange_Test.java
@@ -31,6 +31,7 @@
* Tests on {@link ToChange} interface.
*
* @author Régis Pouiller
+ * @author Julien Roy
*/
public class ToChange_Test extends AbstractTest {
@@ -40,7 +41,7 @@ public class ToChange_Test extends AbstractTest {
@Test
@NeedReload
public void test_to_change_navigation_with_assertions() throws Exception {
- Changes changes = new Changes(source).setStartPointNow();
+ Changes changes = new Changes(jdbcConnectionProvider).setStartPointNow();
updateChangesForTests();
changes.setEndPointNow();
@@ -124,7 +125,7 @@ public void test_to_change_navigation_with_assertions() throws Exception {
@Test
@NeedReload
public void test_to_change_navigation_with_displays() throws Exception {
- Changes changes = new Changes(source).setStartPointNow();
+ Changes changes = new Changes(jdbcConnectionProvider).setStartPointNow();
updateChangesForTests();
changes.setEndPointNow();
diff --git a/src/test/java/org/assertj/db/navigation/ToChanges_Test.java b/src/test/java/org/assertj/db/navigation/ToChanges_Test.java
index 83e37055..39902e21 100644
--- a/src/test/java/org/assertj/db/navigation/ToChanges_Test.java
+++ b/src/test/java/org/assertj/db/navigation/ToChanges_Test.java
@@ -33,6 +33,7 @@
* Tests on {@link org.assertj.db.navigation.ToChanges} interface.
*
* @author Régis Pouiller
+ * @author Julien Roy
*/
public class ToChanges_Test extends AbstractTest {
@@ -42,7 +43,7 @@ public class ToChanges_Test extends AbstractTest {
@Test
@NeedReload
public void test_to_changes_navigation_with_assertions() throws Exception {
- Changes changes = new Changes(source).setStartPointNow();
+ Changes changes = new Changes(jdbcConnectionProvider).setStartPointNow();
updateChangesForTests();
changes.setEndPointNow();
@@ -121,7 +122,7 @@ public void test_to_changes_navigation_with_assertions() throws Exception {
@Test
@NeedReload
public void test_to_changes_navigation_with_displays() throws Exception {
- Changes changes = new Changes(source).setStartPointNow();
+ Changes changes = new Changes(jdbcConnectionProvider).setStartPointNow();
updateChangesForTests();
changes.setEndPointNow();
diff --git a/src/test/java/org/assertj/db/navigation/ToColumnFromChange_ColumnAmongTheModifiedOnes_Integer_Test.java b/src/test/java/org/assertj/db/navigation/ToColumnFromChange_ColumnAmongTheModifiedOnes_Integer_Test.java
index 7ec87724..b5ad33ce 100644
--- a/src/test/java/org/assertj/db/navigation/ToColumnFromChange_ColumnAmongTheModifiedOnes_Integer_Test.java
+++ b/src/test/java/org/assertj/db/navigation/ToColumnFromChange_ColumnAmongTheModifiedOnes_Integer_Test.java
@@ -40,6 +40,7 @@
* {@link org.assertj.db.navigation.ToColumnFromChange#columnAmongTheModifiedOnes()} method.
*
* @author Régis Pouiller
+ * @author Julien Roy
*/
public class ToColumnFromChange_ColumnAmongTheModifiedOnes_Integer_Test extends AbstractTest {
@@ -49,7 +50,7 @@ public class ToColumnFromChange_ColumnAmongTheModifiedOnes_Integer_Test extends
@Test
@NeedReload
public void test_column_among_the_modified_ones_with_index_with_assertions() throws Exception {
- Changes changes = new Changes(source).setStartPointNow();
+ Changes changes = new Changes(jdbcConnectionProvider).setStartPointNow();
updateChangesForTests();
changes.setEndPointNow();
@@ -185,7 +186,7 @@ public void test_column_among_the_modified_ones_with_index_with_assertions() thr
@Test
@NeedReload
public void test_column_among_the_modified_ones_with_index_with_displays() throws Exception {
- Changes changes = new Changes(source).setStartPointNow();
+ Changes changes = new Changes(jdbcConnectionProvider).setStartPointNow();
updateChangesForTests();
changes.setEndPointNow();
diff --git a/src/test/java/org/assertj/db/navigation/ToColumnFromChange_ColumnAmongTheModifiedOnes_String_Test.java b/src/test/java/org/assertj/db/navigation/ToColumnFromChange_ColumnAmongTheModifiedOnes_String_Test.java
index 5e49c2c2..edddb128 100644
--- a/src/test/java/org/assertj/db/navigation/ToColumnFromChange_ColumnAmongTheModifiedOnes_String_Test.java
+++ b/src/test/java/org/assertj/db/navigation/ToColumnFromChange_ColumnAmongTheModifiedOnes_String_Test.java
@@ -39,6 +39,7 @@
* {@link org.assertj.db.navigation.ToColumnFromChange#columnAmongTheModifiedOnes()} method.
*
* @author Régis Pouiller
+ * @author Julien Roy
*/
public class ToColumnFromChange_ColumnAmongTheModifiedOnes_String_Test extends AbstractTest {
@@ -48,7 +49,7 @@ public class ToColumnFromChange_ColumnAmongTheModifiedOnes_String_Test extends A
@Test
@NeedReload
public void test_column_among_the_modified_ones_with_column_name_with_assertions() throws Exception {
- Changes changes = new Changes(source).setStartPointNow();
+ Changes changes = new Changes(jdbcConnectionProvider).setStartPointNow();
updateChangesForTests();
changes.setEndPointNow();
@@ -171,7 +172,7 @@ public void test_column_among_the_modified_ones_with_column_name_with_assertions
@Test
@NeedReload
public void test_column_among_the_modified_ones_with_column_name_with_displays() throws Exception {
- Changes changes = new Changes(source).setStartPointNow();
+ Changes changes = new Changes(jdbcConnectionProvider).setStartPointNow();
updateChangesForTests();
changes.setEndPointNow();
diff --git a/src/test/java/org/assertj/db/navigation/ToColumnFromChange_ColumnAmongTheModifiedOnes_Test.java b/src/test/java/org/assertj/db/navigation/ToColumnFromChange_ColumnAmongTheModifiedOnes_Test.java
index dbeda675..dfe13def 100644
--- a/src/test/java/org/assertj/db/navigation/ToColumnFromChange_ColumnAmongTheModifiedOnes_Test.java
+++ b/src/test/java/org/assertj/db/navigation/ToColumnFromChange_ColumnAmongTheModifiedOnes_Test.java
@@ -40,6 +40,7 @@
* {@link org.assertj.db.navigation.ToColumnFromChange#columnAmongTheModifiedOnes()} method.
*
* @author Régis Pouiller
+ * @author Julien Roy
*/
public class ToColumnFromChange_ColumnAmongTheModifiedOnes_Test extends AbstractTest {
@@ -49,7 +50,7 @@ public class ToColumnFromChange_ColumnAmongTheModifiedOnes_Test extends Abstract
@Test
@NeedReload
public void test_column_among_the_modified_ones_with_assertions() throws Exception {
- Changes changes = new Changes(source).setStartPointNow();
+ Changes changes = new Changes(jdbcConnectionProvider).setStartPointNow();
updateChangesForTests();
changes.setEndPointNow();
@@ -165,7 +166,7 @@ public void test_column_among_the_modified_ones_with_assertions() throws Excepti
@Test
@NeedReload
public void test_column_among_the_modified_ones_with_displays() throws Exception {
- Changes changes = new Changes(source).setStartPointNow();
+ Changes changes = new Changes(jdbcConnectionProvider).setStartPointNow();
updateChangesForTests();
changes.setEndPointNow();
diff --git a/src/test/java/org/assertj/db/navigation/ToColumn_Column_Integer_Test.java b/src/test/java/org/assertj/db/navigation/ToColumn_Column_Integer_Test.java
index 4f1d4150..e0abf69c 100644
--- a/src/test/java/org/assertj/db/navigation/ToColumn_Column_Integer_Test.java
+++ b/src/test/java/org/assertj/db/navigation/ToColumn_Column_Integer_Test.java
@@ -56,6 +56,7 @@
* {@link org.assertj.db.navigation.ToColumn#column(int)} method.
*
* @author Régis Pouiller
+ * @author Julien Roy
*/
public class ToColumn_Column_Integer_Test extends AbstractTest {
@@ -65,7 +66,7 @@ public class ToColumn_Column_Integer_Test extends AbstractTest {
@Test
@NeedReload
public void test_column_with_index_from_change_with_assertions() throws Exception {
- Changes changes = new Changes(source).setStartPointNow();
+ Changes changes = new Changes(jdbcConnectionProvider).setStartPointNow();
updateChangesForTests();
changes.setEndPointNow();
@@ -193,7 +194,7 @@ public void test_column_with_index_from_table_with_assertions() throws Exception
Field fieldIndex = Position.class.getDeclaredField("nextIndex");
fieldIndex.setAccessible(true);
- Table table = new Table(source, "actor");
+ Table table = new Table(jdbcConnectionProvider, "actor");
TableAssert tableAssert = assertThat(table);
Position position =
(Position) fieldPosition.get(tableAssert);
@@ -297,7 +298,7 @@ public void test_column_with_index_from_request_with_assertions() throws Excepti
Field fieldIndex = Position.class.getDeclaredField("nextIndex");
fieldIndex.setAccessible(true);
- Request request = new Request(source, "select * from actor");
+ Request request = new Request(jdbcConnectionProvider, "select * from actor");
RequestAssert requestAssert = assertThat(request);
Position position = (Position) fieldPosition.get(requestAssert);
Assertions.assertThat(fieldIndex.get(position)).isEqualTo(0);
@@ -400,7 +401,7 @@ public void test_column_with_index_from_request_with_assertions() throws Excepti
@Test
@NeedReload
public void test_column_with_index_from_change_with_displays() throws Exception {
- Changes changes = new Changes(source).setStartPointNow();
+ Changes changes = new Changes(jdbcConnectionProvider).setStartPointNow();
updateChangesForTests();
changes.setEndPointNow();
@@ -528,7 +529,7 @@ public void test_column_with_index_from_table_with_displays() throws Exception {
Field fieldIndex = Position.class.getDeclaredField("nextIndex");
fieldIndex.setAccessible(true);
- Table table = new Table(source, "actor");
+ Table table = new Table(jdbcConnectionProvider, "actor");
TableOutputter tableOutputter = Outputs.output(table);
Position position = (Position) fieldPosition.get(tableOutputter);
Assertions.assertThat(fieldIndex.get(position)).isEqualTo(0);
@@ -631,7 +632,7 @@ public void test_column_with_index_from_request_with_displays() throws Exception
Field fieldIndex = Position.class.getDeclaredField("nextIndex");
fieldIndex.setAccessible(true);
- Request request = new Request(source, "select * from actor");
+ Request request = new Request(jdbcConnectionProvider, "select * from actor");
RequestOutputter requestOutputter = Outputs.output(request);
Position position = (Position) fieldPosition.get(requestOutputter);
Assertions.assertThat(fieldIndex.get(position)).isEqualTo(0);
diff --git a/src/test/java/org/assertj/db/navigation/ToColumn_Column_String_Test.java b/src/test/java/org/assertj/db/navigation/ToColumn_Column_String_Test.java
index c5e85acb..197eff18 100644
--- a/src/test/java/org/assertj/db/navigation/ToColumn_Column_String_Test.java
+++ b/src/test/java/org/assertj/db/navigation/ToColumn_Column_String_Test.java
@@ -55,6 +55,7 @@
* {@link org.assertj.db.navigation.ToColumn#column(String)} method.
*
* @author Régis Pouiller
+ * @author Julien Roy
*/
public class ToColumn_Column_String_Test extends AbstractTest {
@@ -64,7 +65,7 @@ public class ToColumn_Column_String_Test extends AbstractTest {
@Test
@NeedReload
public void test_column_with_column_name_from_change_with_assertions() throws Exception {
- Changes changes = new Changes(source).setStartPointNow();
+ Changes changes = new Changes(jdbcConnectionProvider).setStartPointNow();
updateChangesForTests();
changes.setEndPointNow();
@@ -179,7 +180,7 @@ public void test_column_with_column_name_from_table_with_assertions() throws Exc
Field fieldIndex = Position.class.getDeclaredField("nextIndex");
fieldIndex.setAccessible(true);
- Table table = new Table(source, "actor");
+ Table table = new Table(jdbcConnectionProvider, "actor");
TableAssert tableAssert = assertThat(table);
Position position = (Position) fieldPosition.get(tableAssert);
Assertions.assertThat(fieldIndex.get(position)).isEqualTo(0);
@@ -275,7 +276,7 @@ public void test_column_with_column_name_from_request_with_assertions() throws E
Field fieldIndex = Position.class.getDeclaredField("nextIndex");
fieldIndex.setAccessible(true);
- Request request = new Request(source, "select * from actor");
+ Request request = new Request(jdbcConnectionProvider, "select * from actor");
RequestAssert requestAssert = assertThat(request);
Position position = (Position) fieldPosition.get(requestAssert);
Assertions.assertThat(fieldIndex.get(position)).isEqualTo(0);
@@ -365,7 +366,7 @@ public void test_column_with_column_name_from_request_with_assertions() throws E
@Test
@NeedReload
public void test_column_with_column_name_from_change_with_displays() throws Exception {
- Changes changes = new Changes(source).setStartPointNow();
+ Changes changes = new Changes(jdbcConnectionProvider).setStartPointNow();
updateChangesForTests();
changes.setEndPointNow();
@@ -480,7 +481,7 @@ public void test_column_with_column_name_from_table_with_displays() throws Excep
Field fieldIndex = Position.class.getDeclaredField("nextIndex");
fieldIndex.setAccessible(true);
- Table table = new Table(source, "actor");
+ Table table = new Table(jdbcConnectionProvider, "actor");
TableOutputter tableOutputter = Outputs.output(table);
Position position =
(Position) fieldPosition.get(tableOutputter);
@@ -578,7 +579,7 @@ public void test_column_with_column_name_from_request_with_displays() throws Exc
Field fieldIndex = Position.class.getDeclaredField("nextIndex");
fieldIndex.setAccessible(true);
- Request request = new Request(source, "select * from actor");
+ Request request = new Request(jdbcConnectionProvider, "select * from actor");
RequestOutputter requestOutputter = Outputs.output(request);
Position position =
(Position) fieldPosition.get(requestOutputter);
diff --git a/src/test/java/org/assertj/db/navigation/ToColumn_Column_Test.java b/src/test/java/org/assertj/db/navigation/ToColumn_Column_Test.java
index c949f594..ec493958 100644
--- a/src/test/java/org/assertj/db/navigation/ToColumn_Column_Test.java
+++ b/src/test/java/org/assertj/db/navigation/ToColumn_Column_Test.java
@@ -56,6 +56,7 @@
* {@link org.assertj.db.navigation.ToColumn#column()} method.
*
* @author Régis Pouiller
+ * @author Julien Roy
*/
public class ToColumn_Column_Test extends AbstractTest {
@@ -65,7 +66,7 @@ public class ToColumn_Column_Test extends AbstractTest {
@Test
@NeedReload
public void test_column_from_change_with_assertions() throws Exception {
- Changes changes = new Changes(source).setStartPointNow();
+ Changes changes = new Changes(jdbcConnectionProvider).setStartPointNow();
updateChangesForTests();
changes.setEndPointNow();
@@ -172,7 +173,7 @@ public void test_column_from_table_with_assertions() throws Exception {
Field fieldIndex = Position.class.getDeclaredField("nextIndex");
fieldIndex.setAccessible(true);
- Table table = new Table(source, "actor");
+ Table table = new Table(jdbcConnectionProvider, "actor");
TableAssert tableAssert = assertThat(table);
Position position = (Position) fieldPosition.get(tableAssert);
assertThat(fieldIndex.get(position)).isEqualTo(0);
@@ -259,7 +260,7 @@ public void test_column_from_request_with_assertions() throws Exception {
Field fieldIndex = Position.class.getDeclaredField("nextIndex");
fieldIndex.setAccessible(true);
- Request request = new Request(source, "select * from actor");
+ Request request = new Request(jdbcConnectionProvider, "select * from actor");
RequestAssert requestAssert = assertThat(request);
Position position = (Position) fieldPosition.get(requestAssert);
assertThat(fieldIndex.get(position)).isEqualTo(0);
@@ -342,7 +343,7 @@ public void test_column_from_request_with_assertions() throws Exception {
@Test
@NeedReload
public void test_column_from_change_with_displays() throws Exception {
- Changes changes = new Changes(source).setStartPointNow();
+ Changes changes = new Changes(jdbcConnectionProvider).setStartPointNow();
updateChangesForTests();
changes.setEndPointNow();
@@ -449,7 +450,7 @@ public void test_column_from_table_with_displays() throws Exception {
Field fieldIndex = Position.class.getDeclaredField("nextIndex");
fieldIndex.setAccessible(true);
- Table table = new Table(source, "actor");
+ Table table = new Table(jdbcConnectionProvider, "actor");
TableOutputter tableOutputter = Outputs.output(table);
Position position =
(Position) fieldPosition.get(tableOutputter);
@@ -538,7 +539,7 @@ public void test_column_from_request_with_displays() throws Exception {
Field fieldIndex = Position.class.getDeclaredField("nextIndex");
fieldIndex.setAccessible(true);
- Request request = new Request(source, "select * from actor");
+ Request request = new Request(jdbcConnectionProvider, "select * from actor");
RequestOutputter requestOutputter = Outputs.output(request);
Position position = (Position) fieldPosition.get(requestOutputter);
assertThat(fieldIndex.get(position)).isEqualTo(0);
diff --git a/src/test/java/org/assertj/db/navigation/ToRowFromChange_RowAtEndPoint_Test.java b/src/test/java/org/assertj/db/navigation/ToRowFromChange_RowAtEndPoint_Test.java
index c939f3c7..6f1d65a4 100644
--- a/src/test/java/org/assertj/db/navigation/ToRowFromChange_RowAtEndPoint_Test.java
+++ b/src/test/java/org/assertj/db/navigation/ToRowFromChange_RowAtEndPoint_Test.java
@@ -36,6 +36,7 @@
* {@link org.assertj.db.navigation.ToRowFromChange#rowAtEndPoint()} method.
*
* @author Régis Pouiller
+ * @author Julien Roy
*/
public class ToRowFromChange_RowAtEndPoint_Test extends AbstractTest {
@@ -45,7 +46,7 @@ public class ToRowFromChange_RowAtEndPoint_Test extends AbstractTest {
@Test
@NeedReload
public void test_row_at_end_point_with_assertions() throws Exception {
- Changes changes = new Changes(source).setStartPointNow();
+ Changes changes = new Changes(jdbcConnectionProvider).setStartPointNow();
updateChangesForTests();
changes.setEndPointNow();
@@ -99,7 +100,7 @@ public void test_row_at_end_point_with_assertions() throws Exception {
@Test
@NeedReload
public void test_row_at_end_point_with_displays() throws Exception {
- Changes changes = new Changes(source).setStartPointNow();
+ Changes changes = new Changes(jdbcConnectionProvider).setStartPointNow();
updateChangesForTests();
changes.setEndPointNow();
diff --git a/src/test/java/org/assertj/db/navigation/ToRowFromChange_RowAtStartPoint_Test.java b/src/test/java/org/assertj/db/navigation/ToRowFromChange_RowAtStartPoint_Test.java
index 20495cad..32b9891f 100644
--- a/src/test/java/org/assertj/db/navigation/ToRowFromChange_RowAtStartPoint_Test.java
+++ b/src/test/java/org/assertj/db/navigation/ToRowFromChange_RowAtStartPoint_Test.java
@@ -36,6 +36,7 @@
* {@link org.assertj.db.navigation.ToRowFromChange#rowAtStartPoint()} method.
*
* @author Régis Pouiller
+ * @author Julien Roy
*/
public class ToRowFromChange_RowAtStartPoint_Test extends AbstractTest {
@@ -45,7 +46,7 @@ public class ToRowFromChange_RowAtStartPoint_Test extends AbstractTest {
@Test
@NeedReload
public void test_row_at_start_point_with_assertions() throws Exception {
- Changes changes = new Changes(source).setStartPointNow();
+ Changes changes = new Changes(jdbcConnectionProvider).setStartPointNow();
updateChangesForTests();
changes.setEndPointNow();
@@ -99,7 +100,7 @@ public void test_row_at_start_point_with_assertions() throws Exception {
@Test
@NeedReload
public void test_row_at_start_point_with_displays() throws Exception {
- Changes changes = new Changes(source).setStartPointNow();
+ Changes changes = new Changes(jdbcConnectionProvider).setStartPointNow();
updateChangesForTests();
changes.setEndPointNow();
diff --git a/src/test/java/org/assertj/db/navigation/ToRow_Row_Integer_Test.java b/src/test/java/org/assertj/db/navigation/ToRow_Row_Integer_Test.java
index 97466aa5..8e5fa1ac 100644
--- a/src/test/java/org/assertj/db/navigation/ToRow_Row_Integer_Test.java
+++ b/src/test/java/org/assertj/db/navigation/ToRow_Row_Integer_Test.java
@@ -46,6 +46,7 @@
* {@link org.assertj.db.navigation.ToRow#row(int)} method.
*
* @author Régis Pouiller
+ * @author Julien Roy
*/
public class ToRow_Row_Integer_Test extends AbstractTest {
@@ -61,7 +62,7 @@ public void test_column_from_table_with_assertions() throws Exception {
Field fieldIndex = Position.class.getDeclaredField("nextIndex");
fieldIndex.setAccessible(true);
- Table table = new Table(source, "actor");
+ Table table = new Table(jdbcConnectionProvider, "actor");
TableAssert tableAssert = assertThat(table);
Position position =
(Position) fieldPosition.get(tableAssert);
@@ -157,7 +158,7 @@ public void test_column_from_request_with_assertions() throws Exception {
Field fieldIndex = Position.class.getDeclaredField("nextIndex");
fieldIndex.setAccessible(true);
- Request request = new Request(source, "select * from actor");
+ Request request = new Request(jdbcConnectionProvider, "select * from actor");
RequestAssert requestAssert = assertThat(request);
Position position =
(Position) fieldPosition.get(requestAssert);
@@ -259,7 +260,7 @@ public void test_column_from_table_with_displays() throws Exception {
Field fieldIndex = Position.class.getDeclaredField("nextIndex");
fieldIndex.setAccessible(true);
- Table table = new Table(source, "actor");
+ Table table = new Table(jdbcConnectionProvider, "actor");
TableOutputter tableOutputter = Outputs.output(table);
Position position =
(Position) fieldPosition.get(tableOutputter);
@@ -355,7 +356,7 @@ public void test_column_from_request_with_displays() throws Exception {
Field fieldIndex = Position.class.getDeclaredField("nextIndex");
fieldIndex.setAccessible(true);
- Request request = new Request(source, "select * from actor");
+ Request request = new Request(jdbcConnectionProvider, "select * from actor");
RequestOutputter requestOutputter = Outputs.output(request);
Position position =
(Position) fieldPosition.get(requestOutputter);
diff --git a/src/test/java/org/assertj/db/navigation/ToRow_Row_Test.java b/src/test/java/org/assertj/db/navigation/ToRow_Row_Test.java
index 63798128..57cf622b 100644
--- a/src/test/java/org/assertj/db/navigation/ToRow_Row_Test.java
+++ b/src/test/java/org/assertj/db/navigation/ToRow_Row_Test.java
@@ -46,6 +46,7 @@
* {@link org.assertj.db.navigation.ToRow#row()} method.
*
* @author Régis Pouiller
+ * @author Julien Roy
*/
public class ToRow_Row_Test extends AbstractTest {
@@ -61,7 +62,7 @@ public void test_row_from_table_with_assertions() throws Exception {
Field fieldIndex = Position.class.getDeclaredField("nextIndex");
fieldIndex.setAccessible(true);
- Table table = new Table(source, "actor");
+ Table table = new Table(jdbcConnectionProvider, "actor");
TableAssert tableAssert = assertThat(table);
Position position =
(Position) fieldPosition.get(tableAssert);
@@ -147,7 +148,7 @@ public void test_row_from_request_with_assertions() throws Exception {
Field fieldIndex = Position.class.getDeclaredField("nextIndex");
fieldIndex.setAccessible(true);
- Request request = new Request(source, "select * from actor");
+ Request request = new Request(jdbcConnectionProvider, "select * from actor");
RequestAssert requestAssert = assertThat(request);
Position position =
(Position) fieldPosition.get(requestAssert);
@@ -233,7 +234,7 @@ public void test_row_from_table_with_displays() throws Exception {
Field fieldIndex = Position.class.getDeclaredField("nextIndex");
fieldIndex.setAccessible(true);
- Table table = new Table(source, "actor");
+ Table table = new Table(jdbcConnectionProvider, "actor");
TableOutputter tableOutputter = Outputs.output(table);
Position position =
(Position) fieldPosition.get(tableOutputter);
@@ -319,7 +320,7 @@ public void test_row_from_request_with_displays() throws Exception {
Field fieldIndex = Position.class.getDeclaredField("nextIndex");
fieldIndex.setAccessible(true);
- Request request = new Request(source, "select * from actor");
+ Request request = new Request(jdbcConnectionProvider, "select * from actor");
RequestOutputter requestOutputter = Outputs.output(request);
Position position =
(Position) fieldPosition.get(requestOutputter);
diff --git a/src/test/java/org/assertj/db/navigation/ToValueFromColumn_ValueAtEndPoint_Test.java b/src/test/java/org/assertj/db/navigation/ToValueFromColumn_ValueAtEndPoint_Test.java
index 732ed634..52fb061e 100644
--- a/src/test/java/org/assertj/db/navigation/ToValueFromColumn_ValueAtEndPoint_Test.java
+++ b/src/test/java/org/assertj/db/navigation/ToValueFromColumn_ValueAtEndPoint_Test.java
@@ -40,6 +40,7 @@
* {@link org.assertj.db.navigation.ToValueFromColumn#valueAtEndPoint()} method.
*
* @author Régis Pouiller
+ * @author Julien Roy
*/
public class ToValueFromColumn_ValueAtEndPoint_Test extends AbstractTest {
@@ -49,7 +50,7 @@ public class ToValueFromColumn_ValueAtEndPoint_Test extends AbstractTest {
@Test
@NeedReload
public void test_value_at_end_point_with_assertions() throws Exception {
- Changes changes = new Changes(source).setStartPointNow();
+ Changes changes = new Changes(jdbcConnectionProvider).setStartPointNow();
updateChangesForTests();
changes.setEndPointNow();
@@ -106,7 +107,7 @@ public void test_value_at_end_point_with_assertions() throws Exception {
@Test
@NeedReload
public void test_value_at_end_point_with_displays() throws Exception {
- Changes changes = new Changes(source).setStartPointNow();
+ Changes changes = new Changes(jdbcConnectionProvider).setStartPointNow();
updateChangesForTests();
changes.setEndPointNow();
diff --git a/src/test/java/org/assertj/db/navigation/ToValueFromColumn_ValueAtStartPoint_Test.java b/src/test/java/org/assertj/db/navigation/ToValueFromColumn_ValueAtStartPoint_Test.java
index 86881417..66676720 100644
--- a/src/test/java/org/assertj/db/navigation/ToValueFromColumn_ValueAtStartPoint_Test.java
+++ b/src/test/java/org/assertj/db/navigation/ToValueFromColumn_ValueAtStartPoint_Test.java
@@ -40,6 +40,7 @@
* {@link org.assertj.db.navigation.ToValueFromColumn#valueAtStartPoint()} method.
*
* @author Régis Pouiller
+ * @author Julien Roy
*/
public class ToValueFromColumn_ValueAtStartPoint_Test extends AbstractTest {
@@ -49,7 +50,7 @@ public class ToValueFromColumn_ValueAtStartPoint_Test extends AbstractTest {
@Test
@NeedReload
public void test_value_at_start_point_with_assertions() throws Exception {
- Changes changes = new Changes(source).setStartPointNow();
+ Changes changes = new Changes(jdbcConnectionProvider).setStartPointNow();
updateChangesForTests();
changes.setEndPointNow();
@@ -107,7 +108,7 @@ public void test_value_at_start_point_with_assertions() throws Exception {
@Test
@NeedReload
public void test_value_at_start_point_with_displays() throws Exception {
- Changes changes = new Changes(source).setStartPointNow();
+ Changes changes = new Changes(jdbcConnectionProvider).setStartPointNow();
updateChangesForTests();
changes.setEndPointNow();
diff --git a/src/test/java/org/assertj/db/navigation/ToValueFromRow_Value_String_Test.java b/src/test/java/org/assertj/db/navigation/ToValueFromRow_Value_String_Test.java
index 0804f38e..4df22db4 100644
--- a/src/test/java/org/assertj/db/navigation/ToValueFromRow_Value_String_Test.java
+++ b/src/test/java/org/assertj/db/navigation/ToValueFromRow_Value_String_Test.java
@@ -47,6 +47,7 @@
* {@link org.assertj.db.navigation.ToValueFromRow#value(String)} method.
*
* @author Régis Pouiller
+ * @author Julien Roy
*/
public class ToValueFromRow_Value_String_Test extends AbstractTest {
@@ -57,7 +58,7 @@ public class ToValueFromRow_Value_String_Test extends AbstractTest {
@Test
@NeedReload
public void should_fail_because_row_does_not_exist() {
- Changes changes = new Changes(source).setStartPointNow();
+ Changes changes = new Changes(jdbcConnectionProvider).setStartPointNow();
updateChangesForTests();
changes.setEndPointNow();
@@ -75,7 +76,7 @@ public void should_fail_because_row_does_not_exist() {
@Test
@NeedReload
public void test_value_from_row_of_change_with_column_name() throws Exception {
- Changes changes = new Changes(source).setStartPointNow();
+ Changes changes = new Changes(jdbcConnectionProvider).setStartPointNow();
updateChangesForTests();
changes.setEndPointNow();
@@ -165,7 +166,7 @@ public void test_value_from_row_of_table() throws Exception {
Field fieldIndex = Position.class.getDeclaredField("nextIndex");
fieldIndex.setAccessible(true);
- Table table = new Table(source, "actor");
+ Table table = new Table(jdbcConnectionProvider, "actor");
TableAssert tableAssert = assertThat(table);
TableRowAssert tableRowAssert = tableAssert.row();
Position position = (Position) fieldPosition.get(tableRowAssert);
@@ -246,7 +247,7 @@ public void test_value_from_row_of_request() throws Exception {
Field fieldIndex = Position.class.getDeclaredField("nextIndex");
fieldIndex.setAccessible(true);
- Request request = new Request(source, "select * from actor");
+ Request request = new Request(jdbcConnectionProvider, "select * from actor");
RequestAssert requestAssert = assertThat(request);
RequestRowAssert requestRowAssert = requestAssert.row();
Position position = (Position) fieldPosition.get(requestRowAssert);
diff --git a/src/test/java/org/assertj/db/navigation/ToValue_Value_Integer_Test.java b/src/test/java/org/assertj/db/navigation/ToValue_Value_Integer_Test.java
index e8a5eec4..75b72817 100644
--- a/src/test/java/org/assertj/db/navigation/ToValue_Value_Integer_Test.java
+++ b/src/test/java/org/assertj/db/navigation/ToValue_Value_Integer_Test.java
@@ -73,6 +73,7 @@
* {@link org.assertj.db.navigation.ToValue#value(int)} method.
*
* @author Régis Pouiller
+ * @author Julien Roy
*/
public class ToValue_Value_Integer_Test extends AbstractTest {
@@ -82,7 +83,7 @@ public class ToValue_Value_Integer_Test extends AbstractTest {
@Test
@NeedReload
public void test_value_from_row_of_change_with_index_with_assertions() throws Exception {
- Changes changes = new Changes(source).setStartPointNow();
+ Changes changes = new Changes(jdbcConnectionProvider).setStartPointNow();
updateChangesForTests();
changes.setEndPointNow();
@@ -194,7 +195,7 @@ public void test_value_from_column_of_table_with_index_with_assertions() throws
Field fieldIndex = Position.class.getDeclaredField("nextIndex");
fieldIndex.setAccessible(true);
- Table table = new Table(source, "actor");
+ Table table = new Table(jdbcConnectionProvider, "actor");
TableAssert tableAssert = assertThat(table);
TableColumnAssert tableColumnAssert = tableAssert.column();
Position position =
@@ -270,7 +271,7 @@ public void test_value_from_row_of_table_with_index_with_assertions() throws Exc
Field fieldIndex = Position.class.getDeclaredField("nextIndex");
fieldIndex.setAccessible(true);
- Table table = new Table(source, "actor");
+ Table table = new Table(jdbcConnectionProvider, "actor");
TableAssert tableAssert = assertThat(table);
TableRowAssert tableRowAssert = tableAssert.row();
Position position =
@@ -360,7 +361,7 @@ public void test_value_from_column_of_request_with_index_with_assertions() throw
Field fieldIndex = Position.class.getDeclaredField("nextIndex");
fieldIndex.setAccessible(true);
- Request request = new Request(source, "select * from actor");
+ Request request = new Request(jdbcConnectionProvider, "select * from actor");
RequestAssert requestAssert = assertThat(request);
RequestColumnAssert requestColumnAssert = requestAssert.column();
Position position = (Position) fieldPosition.get(requestColumnAssert);
@@ -434,7 +435,7 @@ public void test_value_from_row_of_request_with_index_with_assertions() throws E
Field fieldIndex = Position.class.getDeclaredField("nextIndex");
fieldIndex.setAccessible(true);
- Request request = new Request(source, "select * from actor");
+ Request request = new Request(jdbcConnectionProvider, "select * from actor");
RequestAssert requestAssert = assertThat(request);
RequestRowAssert requestRowAssert = requestAssert.row();
Position position = (Position) fieldPosition.get(requestRowAssert);
@@ -516,7 +517,7 @@ public void test_value_from_row_of_request_with_index_with_assertions() throws E
@Test
@NeedReload
public void test_value_from_row_of_change_with_index_with_displays() throws Exception {
- Changes changes = new Changes(source).setStartPointNow();
+ Changes changes = new Changes(jdbcConnectionProvider).setStartPointNow();
updateChangesForTests();
changes.setEndPointNow();
@@ -626,7 +627,7 @@ public void test_value_from_column_of_table_with_index_with_displays() throws Ex
Field fieldIndex = Position.class.getDeclaredField("nextIndex");
fieldIndex.setAccessible(true);
- Table table = new Table(source, "actor");
+ Table table = new Table(jdbcConnectionProvider, "actor");
TableOutputter tableOutputter = Outputs.output(table);
TableColumnOutputter tableColumnOutputter = tableOutputter.column();
Position position = (Position) fieldPosition.get(tableColumnOutputter);
@@ -700,7 +701,7 @@ public void test_value_from_row_of_table_with_index_with_displays() throws Excep
Field fieldIndex = Position.class.getDeclaredField("nextIndex");
fieldIndex.setAccessible(true);
- Table table = new Table(source, "actor");
+ Table table = new Table(jdbcConnectionProvider, "actor");
TableOutputter tableOutputter = Outputs.output(table);
TableRowOutputter tableRowOutputter = tableOutputter.row();
Position position = (Position) fieldPosition.get(tableRowOutputter);
@@ -788,7 +789,7 @@ public void test_value_from_column_of_request_with_index_with_displays() throws
Field fieldIndex = Position.class.getDeclaredField("nextIndex");
fieldIndex.setAccessible(true);
- Request request = new Request(source, "select * from actor");
+ Request request = new Request(jdbcConnectionProvider, "select * from actor");
RequestOutputter requestOutputter = Outputs.output(request);
RequestColumnOutputter requestColumnOutputter = requestOutputter.column();
Position position = (Position) fieldPosition.get(requestColumnOutputter);
@@ -862,7 +863,7 @@ public void test_value_from_row_of_request_with_index_with_displays() throws Exc
Field fieldIndex = Position.class.getDeclaredField("nextIndex");
fieldIndex.setAccessible(true);
- Request request = new Request(source, "select * from actor");
+ Request request = new Request(jdbcConnectionProvider, "select * from actor");
RequestOutputter requestOutputter = Outputs.output(request);
RequestRowOutputter requestRowOutputter = requestOutputter.row();
Position position = (Position) fieldPosition.get(requestRowOutputter);
diff --git a/src/test/java/org/assertj/db/navigation/ToValue_Value_Test.java b/src/test/java/org/assertj/db/navigation/ToValue_Value_Test.java
index f5477e97..6e10200d 100644
--- a/src/test/java/org/assertj/db/navigation/ToValue_Value_Test.java
+++ b/src/test/java/org/assertj/db/navigation/ToValue_Value_Test.java
@@ -73,6 +73,7 @@
* {@link org.assertj.db.navigation.ToValue#value()} method.
*
* @author Régis Pouiller
+ * @author Julien Roy
*/
public class ToValue_Value_Test extends AbstractTest {
@@ -82,7 +83,7 @@ public class ToValue_Value_Test extends AbstractTest {
@Test
@NeedReload
public void test_value_from_row_of_change_with_assertions() throws Exception {
- Changes changes = new Changes(source).setStartPointNow();
+ Changes changes = new Changes(jdbcConnectionProvider).setStartPointNow();
updateChangesForTests();
changes.setEndPointNow();
@@ -176,7 +177,7 @@ public void test_value_from_column_of_table_with_assertions() throws Exception {
Field fieldIndex = Position.class.getDeclaredField("nextIndex");
fieldIndex.setAccessible(true);
- Table table = new Table(source, "actor");
+ Table table = new Table(jdbcConnectionProvider, "actor");
TableAssert tableAssert = assertThat(table);
TableColumnAssert tableColumnAssert = tableAssert.column();
Position position = (Position) fieldPosition.get(tableColumnAssert);
@@ -234,7 +235,7 @@ public void test_value_from_row_of_table_with_assertions() throws Exception {
Field fieldIndex = Position.class.getDeclaredField("nextIndex");
fieldIndex.setAccessible(true);
- Table table = new Table(source, "actor");
+ Table table = new Table(jdbcConnectionProvider, "actor");
TableAssert tableAssert = assertThat(table);
TableRowAssert tableRowAssert = tableAssert.row();
Position position = (Position) fieldPosition.get(tableRowAssert);
@@ -306,7 +307,7 @@ public void test_value_from_column_of_request_with_assertions() throws Exception
Field fieldIndex = Position.class.getDeclaredField("nextIndex");
fieldIndex.setAccessible(true);
- Request request = new Request(source, "select * from actor");
+ Request request = new Request(jdbcConnectionProvider, "select * from actor");
RequestAssert requestAssert = assertThat(request);
RequestColumnAssert requestColumnAssert = requestAssert.column();
Position position = (Position) fieldPosition.get(requestColumnAssert);
@@ -364,7 +365,7 @@ public void test_value_from_row_of_request_with_assertions() throws Exception {
Field fieldIndex = Position.class.getDeclaredField("nextIndex");
fieldIndex.setAccessible(true);
- Request request = new Request(source, "select * from actor");
+ Request request = new Request(jdbcConnectionProvider, "select * from actor");
RequestAssert requestAssert = assertThat(request);
RequestRowAssert requestRowAssert = requestAssert.row();
Position position = (Position) fieldPosition.get(requestRowAssert);
@@ -430,7 +431,7 @@ public void test_value_from_row_of_request_with_assertions() throws Exception {
@Test
@NeedReload
public void test_value_from_row_of_change_with_displays() throws Exception {
- Changes changes = new Changes(source).setStartPointNow();
+ Changes changes = new Changes(jdbcConnectionProvider).setStartPointNow();
updateChangesForTests();
changes.setEndPointNow();
@@ -524,7 +525,7 @@ public void test_value_from_column_of_table_with_displays() throws Exception {
Field fieldIndex = Position.class.getDeclaredField("nextIndex");
fieldIndex.setAccessible(true);
- Table table = new Table(source, "actor");
+ Table table = new Table(jdbcConnectionProvider, "actor");
TableOutputter tableOutputter = Outputs.output(table);
TableColumnOutputter tableColumnOutputter = tableOutputter.column();
Position position = (Position) fieldPosition.get(tableColumnOutputter);
@@ -582,7 +583,7 @@ public void test_value_from_row_of_table_with_displays() throws Exception {
Field fieldIndex = Position.class.getDeclaredField("nextIndex");
fieldIndex.setAccessible(true);
- Table table = new Table(source, "actor");
+ Table table = new Table(jdbcConnectionProvider, "actor");
TableOutputter tableOutputter = Outputs.output(table);
TableRowOutputter tableRowOutputter = tableOutputter.row();
Position position = (Position) fieldPosition.get(tableRowOutputter);
@@ -654,7 +655,7 @@ public void test_value_from_column_of_request_with_displays() throws Exception {
Field fieldIndex = Position.class.getDeclaredField("nextIndex");
fieldIndex.setAccessible(true);
- Request request = new Request(source, "select * from actor");
+ Request request = new Request(jdbcConnectionProvider, "select * from actor");
RequestOutputter requestOutputter = Outputs.output(request);
RequestColumnOutputter requestColumnOutputter = requestOutputter.column();
Position position = (Position) fieldPosition.get(requestColumnOutputter);
@@ -712,7 +713,7 @@ public void test_value_from_row_of_request_with_displays() throws Exception {
Field fieldIndex = Position.class.getDeclaredField("nextIndex");
fieldIndex.setAccessible(true);
- Request request = new Request(source, "select * from actor");
+ Request request = new Request(jdbcConnectionProvider, "select * from actor");
RequestOutputter requestOutputter = Outputs.output(request);
RequestRowOutputter requestRowOutputter = requestOutputter.row();
Position position = (Position) fieldPosition.get(requestRowOutputter);
diff --git a/src/test/java/org/assertj/db/output/OutputterChange_Test.java b/src/test/java/org/assertj/db/output/OutputterChange_Test.java
index f1b248c2..d60f63e8 100644
--- a/src/test/java/org/assertj/db/output/OutputterChange_Test.java
+++ b/src/test/java/org/assertj/db/output/OutputterChange_Test.java
@@ -26,6 +26,7 @@
* Test the output of changes.
*
* @author Régis Pouiller
+ * @author Julien Roy
*/
public class OutputterChange_Test extends AbstractTest {
@@ -35,7 +36,7 @@ public class OutputterChange_Test extends AbstractTest {
@Test
@NeedReload
public void test_output() throws Exception {
- Changes changes = new Changes(source).setStartPointNow();
+ Changes changes = new Changes(jdbcConnectionProvider).setStartPointNow();
updateChangesForTests();
changes.setEndPointNow();
@@ -55,7 +56,7 @@ public void test_output() throws Exception {
.change().toStream(byteArrayOutputStream5)
.change().toStream(byteArrayOutputStream6)
.change().toStream(byteArrayOutputStream7);
- Assertions.assertThat(byteArrayOutputStream0.toString()).isEqualTo(String.format("[Change at index 0 (on table : ACTOR and with primary key : [4]) of Changes on tables of 'sa/jdbc:h2:mem:test' source]%n"
+ Assertions.assertThat(byteArrayOutputStream0.toString()).isEqualTo(String.format("[Change at index 0 (on table : ACTOR and with primary key : [4]) of Changes on tables of 'sa/jdbc:h2:mem:test']%n"
+ "|----------|-------|---------|----------------|-----------|-----------|-----------|------------|--------------------------------------|%n"
+ "| | | | | * | | | | |%n"
+ "| TYPE | TABLE | PRIMARY | | ID | NAME | FIRSTNAME | BIRTH | ACTOR_IMDB |%n"
@@ -66,7 +67,7 @@ public void test_output() throws Exception {
+ "| CREATION | ACTOR | 4 |----------------|-----------|-----------|-----------|------------|--------------------------------------|%n"
+ "| | | | At end point | 4 | Murray | Bill | 1950-09-21 | 30b443ae-c0c9-4790-9bec-ce1380808435 |%n"
+ "|----------|-------|---------|----------------|-----------|-----------|-----------|------------|--------------------------------------|%n"));
- Assertions.assertThat(byteArrayOutputStream1.toString()).isEqualTo(String.format("[Change at index 1 (on table : INTERPRETATION and with primary key : [6]) of Changes on tables of 'sa/jdbc:h2:mem:test' source]%n"
+ Assertions.assertThat(byteArrayOutputStream1.toString()).isEqualTo(String.format("[Change at index 1 (on table : INTERPRETATION and with primary key : [6]) of Changes on tables of 'sa/jdbc:h2:mem:test']%n"
+ "|----------|----------------|---------|----------------|-----------|-----------|-----------|------------------|%n"
+ "| | | | | * | | | |%n"
+ "| TYPE | TABLE | PRIMARY | | ID | ID_MOVIE | ID_ACTOR | CHARACTER |%n"
@@ -77,7 +78,7 @@ public void test_output() throws Exception {
+ "| CREATION | INTERPRETATION | 6 |----------------|-----------|-----------|-----------|------------------|%n"
+ "| | | | At end point | 6 | 4 | 4 | Dr Peter Venkman |%n"
+ "|----------|----------------|---------|----------------|-----------|-----------|-----------|------------------|%n"));
- Assertions.assertThat(byteArrayOutputStream2.toString()).isEqualTo(String.format("[Change at index 2 (on table : MOVIE and with primary key : [4]) of Changes on tables of 'sa/jdbc:h2:mem:test' source]%n"
+ Assertions.assertThat(byteArrayOutputStream2.toString()).isEqualTo(String.format("[Change at index 2 (on table : MOVIE and with primary key : [4]) of Changes on tables of 'sa/jdbc:h2:mem:test']%n"
+ "|----------|-------|---------|----------------|-----------|--------------|-----------|--------------------------------------|%n"
+ "| | | | | * | | | |%n"
+ "| TYPE | TABLE | PRIMARY | | ID | TITLE | YEAR | MOVIE_IMDB |%n"
@@ -88,7 +89,7 @@ public void test_output() throws Exception {
+ "| CREATION | MOVIE | 4 |----------------|-----------|--------------|-----------|--------------------------------------|%n"
+ "| | | | At end point | 4 | Ghostbusters | 1984 | 30b443ae-c0c9-4790-9bec-ce1380808435 |%n"
+ "|----------|-------|---------|----------------|-----------|--------------|-----------|--------------------------------------|%n"));
- Assertions.assertThat(byteArrayOutputStream3.toString()).isEqualTo(String.format("[Change at index 3 (on table : ACTOR and with primary key : [1]) of Changes on tables of 'sa/jdbc:h2:mem:test' source]%n"
+ Assertions.assertThat(byteArrayOutputStream3.toString()).isEqualTo(String.format("[Change at index 3 (on table : ACTOR and with primary key : [1]) of Changes on tables of 'sa/jdbc:h2:mem:test']%n"
+ "|--------------|-------|---------|----------------|-----------|-----------|-----------------|------------|--------------------------------------|%n"
+ "| | | | | * | | | | |%n"
+ "| TYPE | TABLE | PRIMARY | | ID | NAME | FIRSTNAME | BIRTH | ACTOR_IMDB |%n"
@@ -99,7 +100,7 @@ public void test_output() throws Exception {
+ "| MODIFICATION | ACTOR | 1 |----------------|-----------|-----------|-----------------|------------|--------------------------------------|%n"
+ "| | | | At end point | 1 | Weaver | Susan Alexandra | 1949-10-08 | 30b443ae-c0c9-4790-9bec-ce1380808435 |%n"
+ "|--------------|-------|---------|----------------|-----------|-----------|-----------------|------------|--------------------------------------|%n"));
- Assertions.assertThat(byteArrayOutputStream4.toString()).isEqualTo(String.format("[Change at index 4 (on table : INTERPRETATION and with primary key : [3]) of Changes on tables of 'sa/jdbc:h2:mem:test' source]%n"
+ Assertions.assertThat(byteArrayOutputStream4.toString()).isEqualTo(String.format("[Change at index 4 (on table : INTERPRETATION and with primary key : [3]) of Changes on tables of 'sa/jdbc:h2:mem:test']%n"
+ "|--------------|----------------|---------|----------------|-----------|-----------|-----------|------------------------|%n"
+ "| | | | | * | | | |%n"
+ "| TYPE | TABLE | PRIMARY | | ID | ID_MOVIE | ID_ACTOR | CHARACTER |%n"
@@ -110,7 +111,7 @@ public void test_output() throws Exception {
+ "| MODIFICATION | INTERPRETATION | 3 |----------------|-----------|-----------|-----------|------------------------|%n"
+ "| | | | At end point | 3 | 3 | 1 | Doctor Grace Augustine |%n"
+ "|--------------|----------------|---------|----------------|-----------|-----------|-----------|------------------------|%n"));
- Assertions.assertThat(byteArrayOutputStream5.toString()).isEqualTo(String.format("[Change at index 5 (on table : MOVIE and with primary key : [3]) of Changes on tables of 'sa/jdbc:h2:mem:test' source]%n"
+ Assertions.assertThat(byteArrayOutputStream5.toString()).isEqualTo(String.format("[Change at index 5 (on table : MOVIE and with primary key : [3]) of Changes on tables of 'sa/jdbc:h2:mem:test']%n"
+ "|--------------|-------|---------|----------------|-----------|------------|-----------|--------------------------------------|%n"
+ "| | | | | * | | | |%n"
+ "| TYPE | TABLE | PRIMARY | | ID | TITLE | YEAR | MOVIE_IMDB |%n"
@@ -121,7 +122,7 @@ public void test_output() throws Exception {
+ "| MODIFICATION | MOVIE | 3 |----------------|-----------|------------|-----------|--------------------------------------|%n"
+ "| | | | At end point | 3 | The Avatar | 2009 | d735221b-5de5-4112-aa1e-49090cb75ada |%n"
+ "|--------------|-------|---------|----------------|-----------|------------|-----------|--------------------------------------|%n"));
- Assertions.assertThat(byteArrayOutputStream6.toString()).isEqualTo(String.format("[Change at index 6 (on table : ACTOR and with primary key : [3]) of Changes on tables of 'sa/jdbc:h2:mem:test' source]%n"
+ Assertions.assertThat(byteArrayOutputStream6.toString()).isEqualTo(String.format("[Change at index 6 (on table : ACTOR and with primary key : [3]) of Changes on tables of 'sa/jdbc:h2:mem:test']%n"
+ "|----------|-------|---------|----------------|-----------|-------------|-----------|------------|--------------------------------------|%n"
+ "| | | | | * | | | | |%n"
+ "| TYPE | TABLE | PRIMARY | | ID | NAME | FIRSTNAME | BIRTH | ACTOR_IMDB |%n"
@@ -132,7 +133,7 @@ public void test_output() throws Exception {
+ "| DELETION | ACTOR | 3 |----------------|-----------|-------------|-----------|------------|--------------------------------------|%n"
+ "| | | | At end point | | | | | |%n"
+ "|----------|-------|---------|----------------|-----------|-------------|-----------|------------|--------------------------------------|%n"));
- Assertions.assertThat(byteArrayOutputStream7.toString()).isEqualTo(String.format("[Change at index 7 (on table : INTERPRETATION and with primary key : [5]) of Changes on tables of 'sa/jdbc:h2:mem:test' source]%n"
+ Assertions.assertThat(byteArrayOutputStream7.toString()).isEqualTo(String.format("[Change at index 7 (on table : INTERPRETATION and with primary key : [5]) of Changes on tables of 'sa/jdbc:h2:mem:test']%n"
+ "|----------|----------------|---------|----------------|-----------|-----------|-----------|------------|%n"
+ "| | | | | * | | | |%n"
+ "| TYPE | TABLE | PRIMARY | | ID | ID_MOVIE | ID_ACTOR | CHARACTER |%n"
diff --git a/src/test/java/org/assertj/db/output/OutputterChanges_Test.java b/src/test/java/org/assertj/db/output/OutputterChanges_Test.java
index 10138a02..cea4f6c1 100644
--- a/src/test/java/org/assertj/db/output/OutputterChanges_Test.java
+++ b/src/test/java/org/assertj/db/output/OutputterChanges_Test.java
@@ -26,6 +26,7 @@
* Test the output of changes.
*
* @author Régis Pouiller
+ * @author Julien Roy
*/
public class OutputterChanges_Test extends AbstractTest {
@@ -35,13 +36,13 @@ public class OutputterChanges_Test extends AbstractTest {
@Test
@NeedReload
public void test_output() throws Exception {
- Changes changes = new Changes(source).setStartPointNow();
+ Changes changes = new Changes(jdbcConnectionProvider).setStartPointNow();
updateChangesForTests();
changes.setEndPointNow();
ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
output(changes).toStream(byteArrayOutputStream);
- Assertions.assertThat(byteArrayOutputStream.toString()).isEqualTo(String.format("[Changes on tables of 'sa/jdbc:h2:mem:test' source]%n"
+ Assertions.assertThat(byteArrayOutputStream.toString()).isEqualTo(String.format("[Changes on tables of 'sa/jdbc:h2:mem:test']%n"
+ "|-----------|--------------|----------------|---------|----------------|-----------|-----------|-----------|------------|--------------------------------------|%n"
+ "| | | | | | * | | | | |%n"
+ "| | TYPE | TABLE | PRIMARY | | ID | NAME | FIRSTNAME | BIRTH | ACTOR_IMDB |%n"
diff --git a/src/test/java/org/assertj/db/output/OutputterColumn_Test.java b/src/test/java/org/assertj/db/output/OutputterColumn_Test.java
index 4091979c..4959e768 100644
--- a/src/test/java/org/assertj/db/output/OutputterColumn_Test.java
+++ b/src/test/java/org/assertj/db/output/OutputterColumn_Test.java
@@ -28,6 +28,7 @@
* Test the output of columns.
*
* @author Régis Pouiller
+ * @author Julien Roy
*/
public class OutputterColumn_Test extends AbstractTest {
@@ -36,7 +37,7 @@ public class OutputterColumn_Test extends AbstractTest {
*/
@Test
public void test_output_for_table() throws Exception {
- Table table = new Table(source, "actor");
+ Table table = new Table(jdbcConnectionProvider, "actor");
ByteArrayOutputStream byteArrayOutputStream0 = new ByteArrayOutputStream();
ByteArrayOutputStream byteArrayOutputStream1 = new ByteArrayOutputStream();
@@ -78,7 +79,7 @@ public void test_output_for_table() throws Exception {
*/
@Test
public void test_output_for_request() throws Exception {
- Request request = new Request(source, "select * from actor");
+ Request request = new Request(jdbcConnectionProvider, "select * from actor");
ByteArrayOutputStream byteArrayOutputStream0 = new ByteArrayOutputStream();
ByteArrayOutputStream byteArrayOutputStream1 = new ByteArrayOutputStream();
@@ -121,7 +122,7 @@ public void test_output_for_request() throws Exception {
@Test
@NeedReload
public void test_output_for_change() throws Exception {
- Changes changes = new Changes(source).setStartPointNow();
+ Changes changes = new Changes(jdbcConnectionProvider).setStartPointNow();
updateChangesForTests();
changes.setEndPointNow();
@@ -131,7 +132,7 @@ public void test_output_for_change() throws Exception {
output(changes).change().column().toStream(byteArrayOutputStream0)
.column().toStream(byteArrayOutputStream1)
.column().toStream(byteArrayOutputStream2);
- Assertions.assertThat(byteArrayOutputStream0.toString()).isEqualTo(String.format("[Column at index 0 (column name : ID) of Change at index 0 (on table : ACTOR and with primary key : [4]) of Changes on tables of 'sa/jdbc:h2:mem:test' source]%n"
+ Assertions.assertThat(byteArrayOutputStream0.toString()).isEqualTo(String.format("[Column at index 0 (column name : ID) of Change at index 0 (on table : ACTOR and with primary key : [4]) of Changes on tables of 'sa/jdbc:h2:mem:test']%n"
+ "|----------------|----------|%n"
+ "| | ID |%n"
+ "| | (NUMBER) |%n"
@@ -140,7 +141,7 @@ public void test_output_for_change() throws Exception {
+ "|----------------|----------|%n"
+ "| At end point | 4 |%n"
+ "|----------------|----------|%n"));
- Assertions.assertThat(byteArrayOutputStream1.toString()).isEqualTo(String.format("[Column at index 1 (column name : NAME) of Change at index 0 (on table : ACTOR and with primary key : [4]) of Changes on tables of 'sa/jdbc:h2:mem:test' source]%n"
+ Assertions.assertThat(byteArrayOutputStream1.toString()).isEqualTo(String.format("[Column at index 1 (column name : NAME) of Change at index 0 (on table : ACTOR and with primary key : [4]) of Changes on tables of 'sa/jdbc:h2:mem:test']%n"
+ "|----------------|--------|%n"
+ "| | NAME |%n"
+ "| | (TEXT) |%n"
@@ -149,7 +150,7 @@ public void test_output_for_change() throws Exception {
+ "|----------------|--------|%n"
+ "| At end point | Murray |%n"
+ "|----------------|--------|%n"));
- Assertions.assertThat(byteArrayOutputStream2.toString()).isEqualTo(String.format("[Column at index 2 (column name : FIRSTNAME) of Change at index 0 (on table : ACTOR and with primary key : [4]) of Changes on tables of 'sa/jdbc:h2:mem:test' source]%n"
+ Assertions.assertThat(byteArrayOutputStream2.toString()).isEqualTo(String.format("[Column at index 2 (column name : FIRSTNAME) of Change at index 0 (on table : ACTOR and with primary key : [4]) of Changes on tables of 'sa/jdbc:h2:mem:test']%n"
+ "|----------------|-----------|%n"
+ "| | FIRSTNAME |%n"
+ "| | (TEXT) |%n"
diff --git a/src/test/java/org/assertj/db/output/OutputterException_Test.java b/src/test/java/org/assertj/db/output/OutputterException_Test.java
index 5b375dd7..638ca9cc 100644
--- a/src/test/java/org/assertj/db/output/OutputterException_Test.java
+++ b/src/test/java/org/assertj/db/output/OutputterException_Test.java
@@ -29,6 +29,7 @@
* Test the exception of output.
*
* @author Régis Pouiller
+ * @author Julien Roy
* @author Pascal Schumacher
*/
public class OutputterException_Test extends AbstractTest {
@@ -38,7 +39,7 @@ public class OutputterException_Test extends AbstractTest {
*/
@Test
public void test_display_from_column_for_table() throws Exception {
- Table table = new Table(source, "actor");
+ Table table = new Table(jdbcConnectionProvider, "actor");
try {
Outputs.output(table).column(null);
@@ -62,7 +63,7 @@ public void test_display_from_column_for_table() throws Exception {
*/
@Test
public void test_display_from_column_for_request() throws Exception {
- Request request = new Request(source, "select * from actor");
+ Request request = new Request(jdbcConnectionProvider, "select * from actor");
try {
Outputs.output(request).column(null);
@@ -87,7 +88,7 @@ public void test_display_from_column_for_request() throws Exception {
@Test
@NeedReload
public void test_output_for_row_from_change() throws Exception {
- Changes changes = new Changes(source).setStartPointNow();
+ Changes changes = new Changes(jdbcConnectionProvider).setStartPointNow();
updateChangesForTests();
changes.setEndPointNow();
@@ -118,7 +119,7 @@ public void test_output_for_row_from_change() throws Exception {
*/
@Test
public void test_display_from_value_from_row_for_table() throws Exception {
- Table table = new Table(source, "actor");
+ Table table = new Table(jdbcConnectionProvider, "actor");
try {
Outputs.output(table).row().value(null);
@@ -142,7 +143,7 @@ public void test_display_from_value_from_row_for_table() throws Exception {
*/
@Test
public void test_display_from_value_from_row_for_request() throws Exception {
- Request request = new Request(source, "select * from actor");
+ Request request = new Request(jdbcConnectionProvider, "select * from actor");
try {
Outputs.output(request).row().value(null);
@@ -163,7 +164,7 @@ public void test_display_from_value_from_row_for_request() throws Exception {
@Test
public void test_display_to_file() {
- Request request = new Request(source, "select * from actor");
+ Request request = new Request(jdbcConnectionProvider, "select * from actor");
try {
Outputs.output(request).toFile("test" + File.separator + "test.txt");
diff --git a/src/test/java/org/assertj/db/output/OutputterRequest_Test.java b/src/test/java/org/assertj/db/output/OutputterRequest_Test.java
index 35fddfdd..ed25f40b 100644
--- a/src/test/java/org/assertj/db/output/OutputterRequest_Test.java
+++ b/src/test/java/org/assertj/db/output/OutputterRequest_Test.java
@@ -25,6 +25,7 @@
* Test the output of requests.
*
* @author Régis Pouiller
+ * @author Julien Roy
*/
public class OutputterRequest_Test extends AbstractTest {
@@ -33,7 +34,7 @@ public class OutputterRequest_Test extends AbstractTest {
*/
@Test
public void test_output() throws Exception {
- Request request = new Request(source, "select * from actor");
+ Request request = new Request(jdbcConnectionProvider, "select * from actor");
ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
output(request).toStream(byteArrayOutputStream);
@@ -55,7 +56,7 @@ public void test_output() throws Exception {
*/
@Test
public void test_navigation() throws Exception {
- Request request = new Request(source, "select * from actor");
+ Request request = new Request(jdbcConnectionProvider, "select * from actor");
RequestOutputter requestOutputter = output(request);
diff --git a/src/test/java/org/assertj/db/output/OutputterRow_Test.java b/src/test/java/org/assertj/db/output/OutputterRow_Test.java
index a6bc2001..10e35b61 100644
--- a/src/test/java/org/assertj/db/output/OutputterRow_Test.java
+++ b/src/test/java/org/assertj/db/output/OutputterRow_Test.java
@@ -28,6 +28,7 @@
* Test the output of rows.
*
* @author Régis Pouiller
+ * @author Julien Roy
*/
public class OutputterRow_Test extends AbstractTest {
@@ -36,7 +37,7 @@ public class OutputterRow_Test extends AbstractTest {
*/
@Test
public void test_output_for_table() throws Exception {
- Table table = new Table(source, "actor");
+ Table table = new Table(jdbcConnectionProvider, "actor");
ByteArrayOutputStream byteArrayOutputStream0 = new ByteArrayOutputStream();
ByteArrayOutputStream byteArrayOutputStream1 = new ByteArrayOutputStream();
@@ -78,7 +79,7 @@ public void test_output_for_table() throws Exception {
*/
@Test
public void test_output_for_request() throws Exception {
- Request request = new Request(source, "select * from actor");
+ Request request = new Request(jdbcConnectionProvider, "select * from actor");
ByteArrayOutputStream byteArrayOutputStream0 = new ByteArrayOutputStream();
ByteArrayOutputStream byteArrayOutputStream1 = new ByteArrayOutputStream();
@@ -121,7 +122,7 @@ public void test_output_for_request() throws Exception {
@Test
@NeedReload
public void test_output_for_change() throws Exception {
- Changes changes = new Changes(source).setStartPointNow();
+ Changes changes = new Changes(jdbcConnectionProvider).setStartPointNow();
updateChangesForTests();
changes.setEndPointNow();
@@ -131,9 +132,9 @@ public void test_output_for_change() throws Exception {
output(changes).change().rowAtStartPoint().toStream(byteArrayOutputStream0)
.rowAtEndPoint().toStream(byteArrayOutputStream1)
.changeOfModification().rowAtStartPoint().toStream(byteArrayOutputStream2);
- Assertions.assertThat(byteArrayOutputStream0.toString()).isEqualTo(String.format("[Row at start point of Change at index 0 (on table : ACTOR and with primary key : [4]) of Changes on tables of 'sa/jdbc:h2:mem:test' source]%n"
+ Assertions.assertThat(byteArrayOutputStream0.toString()).isEqualTo(String.format("[Row at start point of Change at index 0 (on table : ACTOR and with primary key : [4]) of Changes on tables of 'sa/jdbc:h2:mem:test']%n"
+ "Row does not exist%n"));
- Assertions.assertThat(byteArrayOutputStream1.toString()).isEqualTo(String.format("[Row at end point of Change at index 0 (on table : ACTOR and with primary key : [4]) of Changes on tables of 'sa/jdbc:h2:mem:test' source]%n"
+ Assertions.assertThat(byteArrayOutputStream1.toString()).isEqualTo(String.format("[Row at end point of Change at index 0 (on table : ACTOR and with primary key : [4]) of Changes on tables of 'sa/jdbc:h2:mem:test']%n"
+ "|---------|-----------|-----------|-----------|------------|--------------------------------------|%n"
+ "| | * | | | | |%n"
+ "| PRIMARY | ID | NAME | FIRSTNAME | BIRTH | ACTOR_IMDB |%n"
@@ -142,7 +143,7 @@ public void test_output_for_change() throws Exception {
+ "|---------|-----------|-----------|-----------|------------|--------------------------------------|%n"
+ "| 4 | 4 | Murray | Bill | 1950-09-21 | 30b443ae-c0c9-4790-9bec-ce1380808435 |%n"
+ "|---------|-----------|-----------|-----------|------------|--------------------------------------|%n"));
- Assertions.assertThat(byteArrayOutputStream2.toString()).isEqualTo(String.format("[Row at start point of Change at index 0 (on table : ACTOR and with primary key : [1]) of Changes on tables of 'sa/jdbc:h2:mem:test' source (only modification changes)]%n"
+ Assertions.assertThat(byteArrayOutputStream2.toString()).isEqualTo(String.format("[Row at start point of Change at index 0 (on table : ACTOR and with primary key : [1]) of Changes on tables of 'sa/jdbc:h2:mem:test' (only modification changes)]%n"
+ "|---------|-----------|-----------|-----------|------------|--------------------------------------|%n"
+ "| | * | | | | |%n"
+ "| PRIMARY | ID | NAME | FIRSTNAME | BIRTH | ACTOR_IMDB |%n"
diff --git a/src/test/java/org/assertj/db/output/OutputterTable_Test.java b/src/test/java/org/assertj/db/output/OutputterTable_Test.java
index f0d19022..8fa8d8c4 100644
--- a/src/test/java/org/assertj/db/output/OutputterTable_Test.java
+++ b/src/test/java/org/assertj/db/output/OutputterTable_Test.java
@@ -25,6 +25,7 @@
* Test the output of tables.
*
* @author Régis Pouiller
+ * @author Julien Roy
*/
public class OutputterTable_Test extends AbstractTest {
@@ -33,7 +34,7 @@ public class OutputterTable_Test extends AbstractTest {
*/
@Test
public void test_output() throws Exception {
- Table table = new Table(source, "actor");
+ Table table = new Table(jdbcConnectionProvider, "actor");
ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
output(table).toStream(byteArrayOutputStream);
@@ -55,7 +56,7 @@ public void test_output() throws Exception {
*/
@Test
public void test_navigation() throws Exception {
- Table table = new Table(source, "actor");
+ Table table = new Table(jdbcConnectionProvider, "actor");
TableOutputter tableOutputter = output(table);
diff --git a/src/test/java/org/assertj/db/output/OutputterToConsole_Test.java b/src/test/java/org/assertj/db/output/OutputterToConsole_Test.java
index bc24c259..defa44ca 100644
--- a/src/test/java/org/assertj/db/output/OutputterToConsole_Test.java
+++ b/src/test/java/org/assertj/db/output/OutputterToConsole_Test.java
@@ -24,6 +24,7 @@
* Test the output to console.
*
* @author Régis Pouiller
+ * @author Julien Roy
*/
public class OutputterToConsole_Test extends AbstractTest {
@@ -32,7 +33,7 @@ public class OutputterToConsole_Test extends AbstractTest {
*/
@Test
public void test_output_to_console() throws Exception {
- Table table = new Table(source, "actor");
+ Table table = new Table(jdbcConnectionProvider, "actor");
ByteArrayOutputStream byteArrayOutputStream0 = new ByteArrayOutputStream();
System.setOut(new PrintStream(byteArrayOutputStream0));
diff --git a/src/test/java/org/assertj/db/output/OutputterToFile_Test.java b/src/test/java/org/assertj/db/output/OutputterToFile_Test.java
index 0e654a53..fe4e2d68 100644
--- a/src/test/java/org/assertj/db/output/OutputterToFile_Test.java
+++ b/src/test/java/org/assertj/db/output/OutputterToFile_Test.java
@@ -25,6 +25,7 @@
* Test the output to File.
*
* @author Régis Pouiller
+ * @author Julien Roy
*/
public class OutputterToFile_Test extends AbstractTest {
@@ -33,7 +34,7 @@ public class OutputterToFile_Test extends AbstractTest {
*/
@Test
public void test_output_to_file() throws Exception {
- Table table = new Table(source, "actor");
+ Table table = new Table(jdbcConnectionProvider, "actor");
Outputs.output(table).row().value().toFile("target" + File.separator + "test.txt");
try (InputStream inputStream = new FileInputStream(new File("target" + File.separator + "test.txt"))) {
diff --git a/src/test/java/org/assertj/db/output/OutputterToStream_Test.java b/src/test/java/org/assertj/db/output/OutputterToStream_Test.java
index 705a1dc9..55d7e2b0 100644
--- a/src/test/java/org/assertj/db/output/OutputterToStream_Test.java
+++ b/src/test/java/org/assertj/db/output/OutputterToStream_Test.java
@@ -23,6 +23,7 @@
* Test the output to Stream.
*
* @author Régis Pouiller
+ * @author Julien Roy
*/
public class OutputterToStream_Test extends AbstractTest {
@@ -31,7 +32,7 @@ public class OutputterToStream_Test extends AbstractTest {
*/
@Test
public void test_output_to_stream() throws Exception {
- Table table = new Table(source, "actor");
+ Table table = new Table(jdbcConnectionProvider, "actor");
ByteArrayOutputStream byteArrayOutputStream0 = new ByteArrayOutputStream();
Outputs.output(table).row().value().toStream(byteArrayOutputStream0);
diff --git a/src/test/java/org/assertj/db/output/OutputterValue_Test.java b/src/test/java/org/assertj/db/output/OutputterValue_Test.java
index 35e0f7be..635cd8bf 100644
--- a/src/test/java/org/assertj/db/output/OutputterValue_Test.java
+++ b/src/test/java/org/assertj/db/output/OutputterValue_Test.java
@@ -28,6 +28,7 @@
* Test the output of values.
*
* @author Régis Pouiller
+ * @author Julien Roy
*/
public class OutputterValue_Test extends AbstractTest {
@@ -36,7 +37,7 @@ public class OutputterValue_Test extends AbstractTest {
*/
@Test
public void test_output_for_row_from_table() throws Exception {
- Table table = new Table(source, "actor");
+ Table table = new Table(jdbcConnectionProvider, "actor");
ByteArrayOutputStream byteArrayOutputStream0 = new ByteArrayOutputStream();
ByteArrayOutputStream byteArrayOutputStream1 = new ByteArrayOutputStream();
@@ -81,7 +82,7 @@ public void test_output_for_row_from_table() throws Exception {
*/
@Test
public void test_output_for_row_from_request() throws Exception {
- Request request = new Request(source, "select * from actor");
+ Request request = new Request(jdbcConnectionProvider, "select * from actor");
ByteArrayOutputStream byteArrayOutputStream0 = new ByteArrayOutputStream();
ByteArrayOutputStream byteArrayOutputStream1 = new ByteArrayOutputStream();
@@ -127,7 +128,7 @@ public void test_output_for_row_from_request() throws Exception {
@Test
@NeedReload
public void test_output_for_row_from_change() throws Exception {
- Changes changes = new Changes(source).setStartPointNow();
+ Changes changes = new Changes(jdbcConnectionProvider).setStartPointNow();
updateChangesForTests();
changes.setEndPointNow();
@@ -139,28 +140,28 @@ public void test_output_for_row_from_change() throws Exception {
.changeOfModification().rowAtStartPoint().value().toStream(byteArrayOutputStream1)
.rowAtEndPoint().value().toStream(byteArrayOutputStream2)
.value("firstname").toStream(byteArrayOutputStream3);
- Assertions.assertThat(byteArrayOutputStream0.toString()).isEqualTo(String.format("[Value at index 0 (column name : ID) of Row at end point of Change at index 0 (on table : ACTOR and with primary key : [4]) of Changes on tables of 'sa/jdbc:h2:mem:test' source]%n"
+ Assertions.assertThat(byteArrayOutputStream0.toString()).isEqualTo(String.format("[Value at index 0 (column name : ID) of Row at end point of Change at index 0 (on table : ACTOR and with primary key : [4]) of Changes on tables of 'sa/jdbc:h2:mem:test']%n"
+ "|----------|%n"
+ "| ID |%n"
+ "| (NUMBER) |%n"
+ "|----------|%n"
+ "| 4 |%n"
+ "|----------|%n"));
- Assertions.assertThat(byteArrayOutputStream1.toString()).isEqualTo(String.format("[Value at index 0 (column name : ID) of Row at start point of Change at index 0 (on table : ACTOR and with primary key : [1]) of Changes on tables of 'sa/jdbc:h2:mem:test' source (only modification changes)]%n"
+ Assertions.assertThat(byteArrayOutputStream1.toString()).isEqualTo(String.format("[Value at index 0 (column name : ID) of Row at start point of Change at index 0 (on table : ACTOR and with primary key : [1]) of Changes on tables of 'sa/jdbc:h2:mem:test' (only modification changes)]%n"
+ "|----------|%n"
+ "| ID |%n"
+ "| (NUMBER) |%n"
+ "|----------|%n"
+ "| 1 |%n"
+ "|----------|%n"));
- Assertions.assertThat(byteArrayOutputStream2.toString()).isEqualTo(String.format("[Value at index 0 (column name : ID) of Row at end point of Change at index 0 (on table : ACTOR and with primary key : [1]) of Changes on tables of 'sa/jdbc:h2:mem:test' source (only modification changes)]%n"
+ Assertions.assertThat(byteArrayOutputStream2.toString()).isEqualTo(String.format("[Value at index 0 (column name : ID) of Row at end point of Change at index 0 (on table : ACTOR and with primary key : [1]) of Changes on tables of 'sa/jdbc:h2:mem:test' (only modification changes)]%n"
+ "|----------|%n"
+ "| ID |%n"
+ "| (NUMBER) |%n"
+ "|----------|%n"
+ "| 1 |%n"
+ "|----------|%n"));
- Assertions.assertThat(byteArrayOutputStream3.toString()).isEqualTo(String.format("[Value at index 2 (column name : FIRSTNAME) of Row at end point of Change at index 0 (on table : ACTOR and with primary key : [1]) of Changes on tables of 'sa/jdbc:h2:mem:test' source (only modification changes)]%n"
+ Assertions.assertThat(byteArrayOutputStream3.toString()).isEqualTo(String.format("[Value at index 2 (column name : FIRSTNAME) of Row at end point of Change at index 0 (on table : ACTOR and with primary key : [1]) of Changes on tables of 'sa/jdbc:h2:mem:test' (only modification changes)]%n"
+ "|-----------------|%n"
+ "| FIRSTNAME |%n"
+ "| (TEXT) |%n"
@@ -174,7 +175,7 @@ public void test_output_for_row_from_change() throws Exception {
*/
@Test
public void test_output_for_column_from_table() throws Exception {
- Table table = new Table(source, "actor");
+ Table table = new Table(jdbcConnectionProvider, "actor");
ByteArrayOutputStream byteArrayOutputStream0 = new ByteArrayOutputStream();
ByteArrayOutputStream byteArrayOutputStream1 = new ByteArrayOutputStream();
@@ -219,7 +220,7 @@ public void test_output_for_column_from_table() throws Exception {
*/
@Test
public void test_output_for_column_from_request() throws Exception {
- Request request = new Request(source, "select * from actor");
+ Request request = new Request(jdbcConnectionProvider, "select * from actor");
ByteArrayOutputStream byteArrayOutputStream0 = new ByteArrayOutputStream();
ByteArrayOutputStream byteArrayOutputStream1 = new ByteArrayOutputStream();
@@ -266,7 +267,7 @@ public void test_output_for_column_from_request() throws Exception {
@Test
@NeedReload
public void test_output_for_column_from_change() throws Exception {
- Changes changes = new Changes(source).setStartPointNow();
+ Changes changes = new Changes(jdbcConnectionProvider).setStartPointNow();
updateChangesForTests();
changes.setEndPointNow();
@@ -276,21 +277,21 @@ public void test_output_for_column_from_change() throws Exception {
output(changes).change().column().valueAtStartPoint().toStream(byteArrayOutputStream0)
.valueAtEndPoint().toStream(byteArrayOutputStream1)
.column().valueAtEndPoint().toStream(byteArrayOutputStream2);
- Assertions.assertThat(byteArrayOutputStream0.toString()).isEqualTo(String.format("[Value at start point of Column at index 0 (column name : ID) of Change at index 0 (on table : ACTOR and with primary key : [4]) of Changes on tables of 'sa/jdbc:h2:mem:test' source]%n"
+ Assertions.assertThat(byteArrayOutputStream0.toString()).isEqualTo(String.format("[Value at start point of Column at index 0 (column name : ID) of Change at index 0 (on table : ACTOR and with primary key : [4]) of Changes on tables of 'sa/jdbc:h2:mem:test']%n"
+ "|------------------|%n"
+ "| ID |%n"
+ "| (NOT_IDENTIFIED) |%n"
+ "|------------------|%n"
+ "| null |%n"
+ "|------------------|%n"));
- Assertions.assertThat(byteArrayOutputStream1.toString()).isEqualTo(String.format("[Value at end point of Column at index 0 (column name : ID) of Change at index 0 (on table : ACTOR and with primary key : [4]) of Changes on tables of 'sa/jdbc:h2:mem:test' source]%n"
+ Assertions.assertThat(byteArrayOutputStream1.toString()).isEqualTo(String.format("[Value at end point of Column at index 0 (column name : ID) of Change at index 0 (on table : ACTOR and with primary key : [4]) of Changes on tables of 'sa/jdbc:h2:mem:test']%n"
+ "|----------|%n"
+ "| ID |%n"
+ "| (NUMBER) |%n"
+ "|----------|%n"
+ "| 4 |%n"
+ "|----------|%n"));
- Assertions.assertThat(byteArrayOutputStream2.toString()).isEqualTo(String.format("[Value at end point of Column at index 1 (column name : NAME) of Change at index 0 (on table : ACTOR and with primary key : [4]) of Changes on tables of 'sa/jdbc:h2:mem:test' source]%n"
+ Assertions.assertThat(byteArrayOutputStream2.toString()).isEqualTo(String.format("[Value at end point of Column at index 1 (column name : NAME) of Change at index 0 (on table : ACTOR and with primary key : [4]) of Changes on tables of 'sa/jdbc:h2:mem:test']%n"
+ "|--------|%n"
+ "| NAME |%n"
+ "| (TEXT) |%n"
diff --git a/src/test/java/org/assertj/db/output/impl/OutputType_ValueOf_Test.java b/src/test/java/org/assertj/db/output/impl/OutputType_ValueOf_Test.java
index 37476d35..ae41c089 100644
--- a/src/test/java/org/assertj/db/output/impl/OutputType_ValueOf_Test.java
+++ b/src/test/java/org/assertj/db/output/impl/OutputType_ValueOf_Test.java
@@ -12,10 +12,10 @@
*/
package org.assertj.db.output.impl;
-import org.junit.Test;
-
import static org.assertj.core.api.Assertions.assertThat;
+import org.junit.Test;
+
/**
* Test on the type got from {@code valueOf} method from {@code RepresentationType} enum.
*
diff --git a/src/test/java/org/assertj/db/output/impl/PlainOutput_Test.java b/src/test/java/org/assertj/db/output/impl/PlainOutput_Test.java
index c66aecbe..326b5063 100644
--- a/src/test/java/org/assertj/db/output/impl/PlainOutput_Test.java
+++ b/src/test/java/org/assertj/db/output/impl/PlainOutput_Test.java
@@ -12,14 +12,7 @@
*/
package org.assertj.db.output.impl;
-import org.assertj.core.api.WritableAssertionInfo;
-import org.assertj.db.common.AbstractTest;
-import org.assertj.db.type.Change;
-import org.assertj.db.type.ChangeType;
-import org.assertj.db.type.DataType;
-import org.assertj.db.type.Row;
-import org.assertj.db.type.Value;
-import org.junit.Test;
+import static org.assertj.core.api.Assertions.assertThat;
import java.sql.Date;
import java.sql.Time;
@@ -29,7 +22,14 @@
import java.util.Locale;
import java.util.UUID;
-import static org.assertj.core.api.Assertions.assertThat;
+import org.assertj.core.api.WritableAssertionInfo;
+import org.assertj.db.common.AbstractTest;
+import org.assertj.db.type.Change;
+import org.assertj.db.type.ChangeType;
+import org.assertj.db.type.DataType;
+import org.assertj.db.type.Row;
+import org.assertj.db.type.Value;
+import org.junit.Test;
/**
* Test on the utility class {@code PlainRepresentation}.
diff --git a/src/test/java/org/assertj/db/type/AbstractDbElement_Exception_Test.java b/src/test/java/org/assertj/db/type/AbstractDbElement_Exception_Test.java
deleted file mode 100644
index 8e47f1b9..00000000
--- a/src/test/java/org/assertj/db/type/AbstractDbElement_Exception_Test.java
+++ /dev/null
@@ -1,102 +0,0 @@
-/*
- * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
- * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations under the License.
- *
- * Copyright 2015-2024 the original author or authors.
- */
-package org.assertj.db.type;
-
-import static org.assertj.core.api.Assertions.assertThat;
-import static org.junit.Assert.fail;
-
-import java.sql.SQLException;
-
-import org.assertj.db.common.AbstractTest;
-import org.assertj.db.common.DefaultConnection;
-import org.junit.Test;
-
-/**
- * Tests on the exceptions of {@code AbstractDbElement}
- *
- * @author Régis Pouiller
- */
-public class AbstractDbElement_Exception_Test extends AbstractTest {
-
- /**
- * This method should fail because {@code getCatalog} throws an SQL Exception.
- */
- @Test
- public void should_fail_because_getCatalog_throws_an_SQLException() {
- try {
- AbstractDbElement.getCatalog(new DefaultConnection(null) {
-
- @Override
- public String getCatalog() throws SQLException {
- throw new SQLException("test");
- }
- });
- fail("An exception must be raised");
- } catch (SQLException exception) {
- assertThat(exception.getMessage()).isEqualTo("test");
- }
- }
-
- /**
- * Tests if returns {@code null} because {@code getCatalog} throws an Exception.
- *
- * @throws SQLException
- */
- @Test
- public void test_if_returns_null_because_getCatalog_throws_an_Exception() throws SQLException {
- String catalog = AbstractDbElement.getCatalog(new DefaultConnection(null) {
-
- @Override
- public String getCatalog() throws SQLException {
- throw new RuntimeException("test");
- }
- });
- assertThat(catalog).isNull();
- }
-
- /**
- * This method should fail because {@code getSchema} throws an SQL Exception.
- */
- @Test
- public void should_fail_because_getSchema_throws_an_SQLException() {
- try {
- AbstractDbElement.getSchema(new DefaultConnection(null) {
-
- @Override
- public String getSchema() throws SQLException {
- throw new SQLException("test");
- }
- });
- fail("An exception must be raised");
- } catch (SQLException exception) {
- assertThat(exception.getMessage()).isEqualTo("test");
- }
- }
-
- /**
- * Tests if returns {@code null} because {@code getSchema} throws an Exception.
- *
- * @throws SQLException
- */
- @Test
- public void test_if_returns_null_because_getSchema_throws_an_Exception() throws SQLException {
- String schema = AbstractDbElement.getSchema(new DefaultConnection(null) {
-
- @Override
- public String getCatalog() throws SQLException {
- throw new RuntimeException("test");
- }
- });
- assertThat(schema).isNull();
- }
-}
diff --git a/src/test/java/org/assertj/db/type/CachedSchemaMetaData_Test.java b/src/test/java/org/assertj/db/type/CachedSchemaMetaData_Test.java
new file mode 100644
index 00000000..f1d5d61d
--- /dev/null
+++ b/src/test/java/org/assertj/db/type/CachedSchemaMetaData_Test.java
@@ -0,0 +1,50 @@
+/*
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
+ * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations under the License.
+ *
+ * Copyright 2015-2024 the original author or authors.
+ */
+package org.assertj.db.type;
+
+import org.assertj.db.common.AbstractTest;
+import org.junit.Test;
+
+import javax.xml.validation.Schema;
+import java.sql.Time;
+import java.text.ParseException;
+import java.time.LocalTime;
+import java.util.Calendar;
+
+import static org.assertj.core.api.Assertions.assertThat;
+
+/**
+ * Tests on the cached schema metadata.
+ *
+ * @author Julien Roy
+ */
+public class CachedSchemaMetaData_Test extends AbstractTest {
+
+ @Test
+ public void test_get_tables() {
+ CachedSchemaMetaData metaData = new CachedSchemaMetaData(jdbcConnectionProvider);
+ assertThat(metaData.getTablesName()).containsExactly("ACTOR", "INTERPRETATION", "MOVIE", "TEST", "TEST2");
+ }
+
+ @Test
+ public void test_get_columns() {
+ CachedSchemaMetaData metaData = new CachedSchemaMetaData(jdbcConnectionProvider);
+ assertThat(metaData.getColumnsName("ACTOR")).containsExactly("ID", "NAME", "FIRSTNAME", "BIRTH", "ACTOR_IMDB");
+ }
+
+ @Test
+ public void test_get_primary_keys() {
+ CachedSchemaMetaData metaData = new CachedSchemaMetaData(jdbcConnectionProvider);
+ assertThat(metaData.getPrimaryKeys("ACTOR")).containsExactly("ID");
+ }
+}
diff --git a/src/test/java/org/assertj/db/type/Change_GetDataType_Test.java b/src/test/java/org/assertj/db/type/Change_GetDataType_Test.java
index f15a8855..28ab6c3c 100644
--- a/src/test/java/org/assertj/db/type/Change_GetDataType_Test.java
+++ b/src/test/java/org/assertj/db/type/Change_GetDataType_Test.java
@@ -21,7 +21,8 @@
/**
* Tests on the {@code getDataType} method.
*
- * @author Régis Pouiller.
+ * @author Régis Pouiller
+ * @author Julien Roy.
*/
public class Change_GetDataType_Test extends AbstractTest {
@@ -31,7 +32,7 @@ public class Change_GetDataType_Test extends AbstractTest {
@Test
@NeedReload
public void test_getDataTypeOfTable() {
- Changes changes = new Changes(source).setStartPointNow();
+ Changes changes = new Changes(jdbcConnectionProvider).setStartPointNow();
updateChangesForTests();
changes.setEndPointNow();
@@ -44,7 +45,7 @@ public void test_getDataTypeOfTable() {
@Test
@NeedReload
public void test_getDataTypeOfRequest() {
- Changes changes = new Changes(new Request(source, "select * from movie")).setStartPointNow();
+ Changes changes = new Changes(new Request(jdbcConnectionProvider, "select * from movie")).setStartPointNow();
updateChangesForTests();
changes.setEndPointNow();
diff --git a/src/test/java/org/assertj/db/type/Changes_Constructor_Test.java b/src/test/java/org/assertj/db/type/Changes_Constructor_Test.java
index 9790b047..97ac7e0d 100644
--- a/src/test/java/org/assertj/db/type/Changes_Constructor_Test.java
+++ b/src/test/java/org/assertj/db/type/Changes_Constructor_Test.java
@@ -21,15 +21,16 @@
* Tests on the constructors of Changes
*
* @author Régis Pouiller
+ * @author Julien Roy
*/
public class Changes_Constructor_Test extends AbstractTest {
/**
- * This method test the constructor with source.
+ * This method test the constructor with jdbc connection provider.
*/
@Test
- public void test_constructor_source() {
- Changes changes = new Changes(source);
+ public void test_constructor_jdbc() {
+ Changes changes = new Changes(jdbcConnectionProvider);
assertThat(changes.getRequestAtStartPoint()).isNull();
assertThat(changes.getRequestAtEndPoint()).isNull();
@@ -41,25 +42,20 @@ public void test_constructor_source() {
assertThat(changes.getRequestAtStartPoint()).isNull();
assertThat(changes.getRequestAtEndPoint()).isNull();
assertThat(changes.getTablesAtStartPointList()).isNotNull();
- assertThat(changes.getTablesAtStartPointList().size()).isEqualTo(5);
- assertThat(changes.getTablesAtStartPointList().get(0).getSource()).isSameAs(source);
- assertThat(changes.getTablesAtStartPointList().get(0).getDataSource()).isNull();
+ assertThat(changes.getTablesAtStartPointList()).hasSize(5);
+ assertThat(changes.getTablesAtStartPointList().get(0).getConnectionProvider()).isSameAs(jdbcConnectionProvider);
assertThat(changes.getTablesAtStartPointList().get(0).getName()).isEqualTo("ACTOR");
assertThat(changes.getTablesAtStartPointList().get(0).getRequest()).isEqualTo("SELECT * FROM ACTOR");
- assertThat(changes.getTablesAtStartPointList().get(1).getSource()).isSameAs(source);
- assertThat(changes.getTablesAtStartPointList().get(1).getDataSource()).isNull();
+ assertThat(changes.getTablesAtStartPointList().get(1).getConnectionProvider()).isSameAs(jdbcConnectionProvider);
assertThat(changes.getTablesAtStartPointList().get(1).getName()).isEqualTo("INTERPRETATION");
assertThat(changes.getTablesAtStartPointList().get(1).getRequest()).isEqualTo("SELECT * FROM INTERPRETATION");
- assertThat(changes.getTablesAtStartPointList().get(2).getSource()).isSameAs(source);
- assertThat(changes.getTablesAtStartPointList().get(2).getDataSource()).isNull();
+ assertThat(changes.getTablesAtStartPointList().get(2).getConnectionProvider()).isSameAs(jdbcConnectionProvider);
assertThat(changes.getTablesAtStartPointList().get(2).getName()).isEqualTo("MOVIE");
assertThat(changes.getTablesAtStartPointList().get(2).getRequest()).isEqualTo("SELECT * FROM MOVIE");
- assertThat(changes.getTablesAtStartPointList().get(3).getSource()).isSameAs(source);
- assertThat(changes.getTablesAtStartPointList().get(3).getDataSource()).isNull();
+ assertThat(changes.getTablesAtStartPointList().get(3).getConnectionProvider()).isSameAs(jdbcConnectionProvider);
assertThat(changes.getTablesAtStartPointList().get(3).getName()).isEqualTo("TEST");
assertThat(changes.getTablesAtStartPointList().get(3).getRequest()).isEqualTo("SELECT * FROM TEST");
- assertThat(changes.getTablesAtStartPointList().get(4).getSource()).isSameAs(source);
- assertThat(changes.getTablesAtStartPointList().get(4).getDataSource()).isNull();
+ assertThat(changes.getTablesAtStartPointList().get(4).getConnectionProvider()).isSameAs(jdbcConnectionProvider);
assertThat(changes.getTablesAtStartPointList().get(4).getName()).isEqualTo("TEST2");
assertThat(changes.getTablesAtStartPointList().get(4).getRequest()).isEqualTo("SELECT * FROM TEST2");
assertThat(changes.getTablesAtEndPointList()).isNull();
@@ -69,47 +65,37 @@ public void test_constructor_source() {
assertThat(changes.getRequestAtStartPoint()).isNull();
assertThat(changes.getRequestAtEndPoint()).isNull();
assertThat(changes.getTablesAtStartPointList()).isNotNull();
- assertThat(changes.getTablesAtStartPointList().size()).isEqualTo(5);
- assertThat(changes.getTablesAtStartPointList().get(0).getSource()).isSameAs(source);
- assertThat(changes.getTablesAtStartPointList().get(0).getDataSource()).isNull();
+ assertThat(changes.getTablesAtStartPointList()).hasSize(5);
+ assertThat(changes.getTablesAtStartPointList().get(0).getConnectionProvider()).isSameAs(jdbcConnectionProvider);
assertThat(changes.getTablesAtStartPointList().get(0).getName()).isEqualTo("ACTOR");
assertThat(changes.getTablesAtStartPointList().get(0).getRequest()).isEqualTo("SELECT * FROM ACTOR");
- assertThat(changes.getTablesAtStartPointList().get(1).getSource()).isSameAs(source);
- assertThat(changes.getTablesAtStartPointList().get(1).getDataSource()).isNull();
+ assertThat(changes.getTablesAtStartPointList().get(1).getConnectionProvider()).isSameAs(jdbcConnectionProvider);
assertThat(changes.getTablesAtStartPointList().get(1).getName()).isEqualTo("INTERPRETATION");
assertThat(changes.getTablesAtStartPointList().get(1).getRequest()).isEqualTo("SELECT * FROM INTERPRETATION");
- assertThat(changes.getTablesAtStartPointList().get(2).getSource()).isSameAs(source);
- assertThat(changes.getTablesAtStartPointList().get(2).getDataSource()).isNull();
+ assertThat(changes.getTablesAtStartPointList().get(2).getConnectionProvider()).isSameAs(jdbcConnectionProvider);
assertThat(changes.getTablesAtStartPointList().get(2).getName()).isEqualTo("MOVIE");
assertThat(changes.getTablesAtStartPointList().get(2).getRequest()).isEqualTo("SELECT * FROM MOVIE");
- assertThat(changes.getTablesAtStartPointList().get(3).getSource()).isSameAs(source);
- assertThat(changes.getTablesAtStartPointList().get(3).getDataSource()).isNull();
+ assertThat(changes.getTablesAtStartPointList().get(3).getConnectionProvider()).isSameAs(jdbcConnectionProvider);
assertThat(changes.getTablesAtStartPointList().get(3).getName()).isEqualTo("TEST");
assertThat(changes.getTablesAtStartPointList().get(3).getRequest()).isEqualTo("SELECT * FROM TEST");
- assertThat(changes.getTablesAtStartPointList().get(4).getSource()).isSameAs(source);
- assertThat(changes.getTablesAtStartPointList().get(4).getDataSource()).isNull();
+ assertThat(changes.getTablesAtStartPointList().get(4).getConnectionProvider()).isSameAs(jdbcConnectionProvider);
assertThat(changes.getTablesAtStartPointList().get(4).getName()).isEqualTo("TEST2");
assertThat(changes.getTablesAtStartPointList().get(4).getRequest()).isEqualTo("SELECT * FROM TEST2");
assertThat(changes.getTablesAtEndPointList()).isNotNull();
- assertThat(changes.getTablesAtEndPointList().size()).isEqualTo(5);
- assertThat(changes.getTablesAtEndPointList().get(0).getSource()).isSameAs(source);
- assertThat(changes.getTablesAtEndPointList().get(0).getDataSource()).isNull();
+ assertThat(changes.getTablesAtEndPointList()).hasSize(5);
+ assertThat(changes.getTablesAtEndPointList().get(0).getConnectionProvider()).isSameAs(jdbcConnectionProvider);
assertThat(changes.getTablesAtEndPointList().get(0).getName()).isEqualTo("ACTOR");
assertThat(changes.getTablesAtEndPointList().get(0).getRequest()).isEqualTo("SELECT * FROM ACTOR");
- assertThat(changes.getTablesAtEndPointList().get(1).getSource()).isSameAs(source);
- assertThat(changes.getTablesAtEndPointList().get(1).getDataSource()).isNull();
+ assertThat(changes.getTablesAtEndPointList().get(1).getConnectionProvider()).isSameAs(jdbcConnectionProvider);
assertThat(changes.getTablesAtEndPointList().get(1).getName()).isEqualTo("INTERPRETATION");
assertThat(changes.getTablesAtEndPointList().get(1).getRequest()).isEqualTo("SELECT * FROM INTERPRETATION");
- assertThat(changes.getTablesAtEndPointList().get(2).getSource()).isSameAs(source);
- assertThat(changes.getTablesAtEndPointList().get(2).getDataSource()).isNull();
+ assertThat(changes.getTablesAtEndPointList().get(2).getConnectionProvider()).isSameAs(jdbcConnectionProvider);
assertThat(changes.getTablesAtEndPointList().get(2).getName()).isEqualTo("MOVIE");
assertThat(changes.getTablesAtEndPointList().get(2).getRequest()).isEqualTo("SELECT * FROM MOVIE");
- assertThat(changes.getTablesAtEndPointList().get(3).getSource()).isSameAs(source);
- assertThat(changes.getTablesAtEndPointList().get(3).getDataSource()).isNull();
+ assertThat(changes.getTablesAtEndPointList().get(3).getConnectionProvider()).isSameAs(jdbcConnectionProvider);
assertThat(changes.getTablesAtEndPointList().get(3).getName()).isEqualTo("TEST");
assertThat(changes.getTablesAtEndPointList().get(3).getRequest()).isEqualTo("SELECT * FROM TEST");
- assertThat(changes.getTablesAtEndPointList().get(4).getSource()).isSameAs(source);
- assertThat(changes.getTablesAtEndPointList().get(4).getDataSource()).isNull();
+ assertThat(changes.getTablesAtEndPointList().get(4).getConnectionProvider()).isSameAs(jdbcConnectionProvider);
assertThat(changes.getTablesAtEndPointList().get(4).getName()).isEqualTo("TEST2");
assertThat(changes.getTablesAtEndPointList().get(4).getRequest()).isEqualTo("SELECT * FROM TEST2");
}
@@ -119,7 +105,7 @@ public void test_constructor_source() {
*/
@Test
public void test_constructor_datasource() {
- Changes changes = new Changes(dataSource);
+ Changes changes = new Changes(dsConnectionProvider);
assertThat(changes.getRequestAtStartPoint()).isNull();
assertThat(changes.getRequestAtEndPoint()).isNull();
@@ -131,25 +117,20 @@ public void test_constructor_datasource() {
assertThat(changes.getRequestAtStartPoint()).isNull();
assertThat(changes.getRequestAtEndPoint()).isNull();
assertThat(changes.getTablesAtStartPointList()).isNotNull();
- assertThat(changes.getTablesAtStartPointList().size()).isEqualTo(5);
- assertThat(changes.getTablesAtStartPointList().get(0).getSource()).isNull();
- assertThat(changes.getTablesAtStartPointList().get(0).getDataSource()).isSameAs(dataSource);
+ assertThat(changes.getTablesAtStartPointList()).hasSize(5);
+ assertThat(changes.getTablesAtStartPointList().get(0).getConnectionProvider()).isSameAs(dsConnectionProvider);
assertThat(changes.getTablesAtStartPointList().get(0).getName()).isEqualTo("ACTOR");
assertThat(changes.getTablesAtStartPointList().get(0).getRequest()).isEqualTo("SELECT * FROM ACTOR");
- assertThat(changes.getTablesAtStartPointList().get(1).getSource()).isNull();
- assertThat(changes.getTablesAtStartPointList().get(1).getDataSource()).isSameAs(dataSource);
+ assertThat(changes.getTablesAtStartPointList().get(1).getConnectionProvider()).isSameAs(dsConnectionProvider);
assertThat(changes.getTablesAtStartPointList().get(1).getName()).isEqualTo("INTERPRETATION");
assertThat(changes.getTablesAtStartPointList().get(1).getRequest()).isEqualTo("SELECT * FROM INTERPRETATION");
- assertThat(changes.getTablesAtStartPointList().get(2).getSource()).isNull();
- assertThat(changes.getTablesAtStartPointList().get(2).getDataSource()).isSameAs(dataSource);
+ assertThat(changes.getTablesAtStartPointList().get(2).getConnectionProvider()).isSameAs(dsConnectionProvider);
assertThat(changes.getTablesAtStartPointList().get(2).getName()).isEqualTo("MOVIE");
assertThat(changes.getTablesAtStartPointList().get(2).getRequest()).isEqualTo("SELECT * FROM MOVIE");
- assertThat(changes.getTablesAtStartPointList().get(3).getSource()).isNull();
- assertThat(changes.getTablesAtStartPointList().get(3).getDataSource()).isSameAs(dataSource);
+ assertThat(changes.getTablesAtStartPointList().get(3).getConnectionProvider()).isSameAs(dsConnectionProvider);
assertThat(changes.getTablesAtStartPointList().get(3).getName()).isEqualTo("TEST");
assertThat(changes.getTablesAtStartPointList().get(3).getRequest()).isEqualTo("SELECT * FROM TEST");
- assertThat(changes.getTablesAtStartPointList().get(4).getSource()).isNull();
- assertThat(changes.getTablesAtStartPointList().get(4).getDataSource()).isSameAs(dataSource);
+ assertThat(changes.getTablesAtStartPointList().get(4).getConnectionProvider()).isSameAs(dsConnectionProvider);
assertThat(changes.getTablesAtStartPointList().get(4).getName()).isEqualTo("TEST2");
assertThat(changes.getTablesAtStartPointList().get(4).getRequest()).isEqualTo("SELECT * FROM TEST2");
assertThat(changes.getTablesAtEndPointList()).isNull();
@@ -159,47 +140,37 @@ public void test_constructor_datasource() {
assertThat(changes.getRequestAtStartPoint()).isNull();
assertThat(changes.getRequestAtEndPoint()).isNull();
assertThat(changes.getTablesAtStartPointList()).isNotNull();
- assertThat(changes.getTablesAtStartPointList().size()).isEqualTo(5);
- assertThat(changes.getTablesAtStartPointList().get(0).getSource()).isNull();
- assertThat(changes.getTablesAtStartPointList().get(0).getDataSource()).isSameAs(dataSource);
+ assertThat(changes.getTablesAtStartPointList()).hasSize(5);
+ assertThat(changes.getTablesAtStartPointList().get(0).getConnectionProvider()).isSameAs(dsConnectionProvider);
assertThat(changes.getTablesAtStartPointList().get(0).getName()).isEqualTo("ACTOR");
assertThat(changes.getTablesAtStartPointList().get(0).getRequest()).isEqualTo("SELECT * FROM ACTOR");
- assertThat(changes.getTablesAtStartPointList().get(1).getSource()).isNull();
- assertThat(changes.getTablesAtStartPointList().get(1).getDataSource()).isSameAs(dataSource);
+ assertThat(changes.getTablesAtStartPointList().get(1).getConnectionProvider()).isSameAs(dsConnectionProvider);
assertThat(changes.getTablesAtStartPointList().get(1).getName()).isEqualTo("INTERPRETATION");
assertThat(changes.getTablesAtStartPointList().get(1).getRequest()).isEqualTo("SELECT * FROM INTERPRETATION");
- assertThat(changes.getTablesAtStartPointList().get(2).getSource()).isNull();
- assertThat(changes.getTablesAtStartPointList().get(2).getDataSource()).isSameAs(dataSource);
+ assertThat(changes.getTablesAtStartPointList().get(2).getConnectionProvider()).isSameAs(dsConnectionProvider);
assertThat(changes.getTablesAtStartPointList().get(2).getName()).isEqualTo("MOVIE");
assertThat(changes.getTablesAtStartPointList().get(2).getRequest()).isEqualTo("SELECT * FROM MOVIE");
- assertThat(changes.getTablesAtStartPointList().get(3).getSource()).isNull();
- assertThat(changes.getTablesAtStartPointList().get(3).getDataSource()).isSameAs(dataSource);
+ assertThat(changes.getTablesAtStartPointList().get(3).getConnectionProvider()).isSameAs(dsConnectionProvider);
assertThat(changes.getTablesAtStartPointList().get(3).getName()).isEqualTo("TEST");
assertThat(changes.getTablesAtStartPointList().get(3).getRequest()).isEqualTo("SELECT * FROM TEST");
- assertThat(changes.getTablesAtStartPointList().get(4).getSource()).isNull();
- assertThat(changes.getTablesAtStartPointList().get(4).getDataSource()).isSameAs(dataSource);
+ assertThat(changes.getTablesAtStartPointList().get(4).getConnectionProvider()).isSameAs(dsConnectionProvider);
assertThat(changes.getTablesAtStartPointList().get(4).getName()).isEqualTo("TEST2");
assertThat(changes.getTablesAtStartPointList().get(4).getRequest()).isEqualTo("SELECT * FROM TEST2");
assertThat(changes.getTablesAtEndPointList()).isNotNull();
- assertThat(changes.getTablesAtEndPointList().size()).isEqualTo(5);
- assertThat(changes.getTablesAtEndPointList().get(0).getSource()).isNull();
- assertThat(changes.getTablesAtEndPointList().get(0).getDataSource()).isSameAs(dataSource);
+ assertThat(changes.getTablesAtEndPointList()).hasSize(5);
+ assertThat(changes.getTablesAtEndPointList().get(0).getConnectionProvider()).isSameAs(dsConnectionProvider);
assertThat(changes.getTablesAtEndPointList().get(0).getName()).isEqualTo("ACTOR");
assertThat(changes.getTablesAtEndPointList().get(0).getRequest()).isEqualTo("SELECT * FROM ACTOR");
- assertThat(changes.getTablesAtEndPointList().get(1).getSource()).isNull();
- assertThat(changes.getTablesAtEndPointList().get(1).getDataSource()).isSameAs(dataSource);
+ assertThat(changes.getTablesAtEndPointList().get(1).getConnectionProvider()).isSameAs(dsConnectionProvider);
assertThat(changes.getTablesAtEndPointList().get(1).getName()).isEqualTo("INTERPRETATION");
assertThat(changes.getTablesAtEndPointList().get(1).getRequest()).isEqualTo("SELECT * FROM INTERPRETATION");
- assertThat(changes.getTablesAtEndPointList().get(2).getSource()).isNull();
- assertThat(changes.getTablesAtEndPointList().get(2).getDataSource()).isSameAs(dataSource);
+ assertThat(changes.getTablesAtEndPointList().get(2).getConnectionProvider()).isSameAs(dsConnectionProvider);
assertThat(changes.getTablesAtEndPointList().get(2).getName()).isEqualTo("MOVIE");
assertThat(changes.getTablesAtEndPointList().get(2).getRequest()).isEqualTo("SELECT * FROM MOVIE");
- assertThat(changes.getTablesAtEndPointList().get(3).getSource()).isNull();
- assertThat(changes.getTablesAtEndPointList().get(3).getDataSource()).isSameAs(dataSource);
+ assertThat(changes.getTablesAtEndPointList().get(3).getConnectionProvider()).isSameAs(dsConnectionProvider);
assertThat(changes.getTablesAtEndPointList().get(3).getName()).isEqualTo("TEST");
assertThat(changes.getTablesAtEndPointList().get(3).getRequest()).isEqualTo("SELECT * FROM TEST");
- assertThat(changes.getTablesAtEndPointList().get(4).getSource()).isNull();
- assertThat(changes.getTablesAtEndPointList().get(4).getDataSource()).isSameAs(dataSource);
+ assertThat(changes.getTablesAtEndPointList().get(4).getConnectionProvider()).isSameAs(dsConnectionProvider);
assertThat(changes.getTablesAtEndPointList().get(4).getName()).isEqualTo("TEST2");
assertThat(changes.getTablesAtEndPointList().get(4).getRequest()).isEqualTo("SELECT * FROM TEST2");
}
@@ -209,7 +180,7 @@ public void test_constructor_datasource() {
*/
@Test
public void test_constructor_one_table() {
- Changes changes = new Changes(new Table(source, "test"));
+ Changes changes = new Changes(new Table(jdbcConnectionProvider, "test"));
assertThat(changes.getRequestAtStartPoint()).isNull();
assertThat(changes.getRequestAtEndPoint()).isNull();
@@ -217,18 +188,16 @@ public void test_constructor_one_table() {
assertThat(changes.getTablesAtStartPointList()).isNull();
changes.setStartPointNow();
assertThat(changes.getTablesAtStartPointList()).isNotNull();
- assertThat(changes.getTablesAtStartPointList().size()).isEqualTo(1);
- assertThat(changes.getTablesAtStartPointList().get(0).getSource()).isSameAs(source);
- assertThat(changes.getTablesAtStartPointList().get(0).getDataSource()).isNull();
+ assertThat(changes.getTablesAtStartPointList()).hasSize(1);
+ assertThat(changes.getTablesAtStartPointList().get(0).getConnectionProvider()).isSameAs(jdbcConnectionProvider);
assertThat(changes.getTablesAtStartPointList().get(0).getName()).isEqualTo("TEST");
assertThat(changes.getTablesAtStartPointList().get(0).getRequest()).isEqualTo("SELECT * FROM TEST");
assertThat(changes.getTablesAtEndPointList()).isNull();
changes.setEndPointNow();
assertThat(changes.getTablesAtEndPointList()).isNotNull();
- assertThat(changes.getTablesAtEndPointList().size()).isEqualTo(1);
- assertThat(changes.getTablesAtEndPointList().get(0).getSource()).isSameAs(source);
- assertThat(changes.getTablesAtEndPointList().get(0).getDataSource()).isNull();
+ assertThat(changes.getTablesAtEndPointList()).hasSize(1);
+ assertThat(changes.getTablesAtEndPointList().get(0).getConnectionProvider()).isSameAs(jdbcConnectionProvider);
assertThat(changes.getTablesAtEndPointList().get(0).getName()).isEqualTo("TEST");
assertThat(changes.getTablesAtEndPointList().get(0).getRequest()).isEqualTo("SELECT * FROM TEST");
}
@@ -238,7 +207,7 @@ public void test_constructor_one_table() {
*/
@Test
public void test_constructor_two_tables() {
- Changes changes = new Changes(new Table(source, "test"), new Table(dataSource, "test2"));
+ Changes changes = new Changes(new Table(jdbcConnectionProvider, "test"), new Table(dsConnectionProvider, "test2"));
assertThat(changes.getRequestAtStartPoint()).isNull();
assertThat(changes.getRequestAtEndPoint()).isNull();
@@ -246,26 +215,22 @@ public void test_constructor_two_tables() {
assertThat(changes.getTablesAtStartPointList()).isNull();
changes.setStartPointNow();
assertThat(changes.getTablesAtStartPointList()).isNotNull();
- assertThat(changes.getTablesAtStartPointList().size()).isEqualTo(2);
- assertThat(changes.getTablesAtStartPointList().get(0).getSource()).isSameAs(source);
- assertThat(changes.getTablesAtStartPointList().get(0).getDataSource()).isNull();
+ assertThat(changes.getTablesAtStartPointList()).hasSize(2);
+ assertThat(changes.getTablesAtStartPointList().get(0).getConnectionProvider()).isSameAs(jdbcConnectionProvider);
assertThat(changes.getTablesAtStartPointList().get(0).getName()).isEqualTo("TEST");
assertThat(changes.getTablesAtStartPointList().get(0).getRequest()).isEqualTo("SELECT * FROM TEST");
- assertThat(changes.getTablesAtStartPointList().get(1).getSource()).isNull();
- assertThat(changes.getTablesAtStartPointList().get(1).getDataSource()).isSameAs(dataSource);
+ assertThat(changes.getTablesAtStartPointList().get(1).getConnectionProvider()).isSameAs(dsConnectionProvider);
assertThat(changes.getTablesAtStartPointList().get(1).getName()).isEqualTo("TEST2");
assertThat(changes.getTablesAtStartPointList().get(1).getRequest()).isEqualTo("SELECT * FROM TEST2");
assertThat(changes.getTablesAtEndPointList()).isNull();
changes.setEndPointNow();
assertThat(changes.getTablesAtEndPointList()).isNotNull();
- assertThat(changes.getTablesAtEndPointList().size()).isEqualTo(2);
- assertThat(changes.getTablesAtEndPointList().get(0).getSource()).isSameAs(source);
- assertThat(changes.getTablesAtEndPointList().get(0).getDataSource()).isNull();
+ assertThat(changes.getTablesAtEndPointList()).hasSize(2);
+ assertThat(changes.getTablesAtEndPointList().get(0).getConnectionProvider()).isSameAs(jdbcConnectionProvider);
assertThat(changes.getTablesAtEndPointList().get(0).getName()).isEqualTo("TEST");
assertThat(changes.getTablesAtEndPointList().get(0).getRequest()).isEqualTo("SELECT * FROM TEST");
- assertThat(changes.getTablesAtEndPointList().get(1).getSource()).isNull();
- assertThat(changes.getTablesAtEndPointList().get(1).getDataSource()).isSameAs(dataSource);
+ assertThat(changes.getTablesAtEndPointList().get(1).getConnectionProvider()).isSameAs(dsConnectionProvider);
assertThat(changes.getTablesAtEndPointList().get(1).getName()).isEqualTo("TEST2");
assertThat(changes.getTablesAtEndPointList().get(1).getRequest()).isEqualTo("SELECT * FROM TEST2");
}
@@ -275,7 +240,7 @@ public void test_constructor_two_tables() {
*/
@Test
public void test_constructor_request() {
- Changes changes = new Changes(new Request(source, "select * from test"));
+ Changes changes = new Changes(new Request(jdbcConnectionProvider, "select * from test"));
assertThat(changes.getRequestAtStartPoint()).isNull();
assertThat(changes.getRequestAtEndPoint()).isNull();
@@ -285,7 +250,7 @@ public void test_constructor_request() {
changes.setStartPointNow();
assertThat(changes.getRequestAtStartPoint()).isNotNull();
- assertThat(changes.getRequestAtStartPoint().getSource()).isSameAs(source);
+ assertThat(changes.getRequestAtStartPoint().getConnectionProvider()).isSameAs(jdbcConnectionProvider);
assertThat(changes.getRequestAtStartPoint().getRequest()).isEqualTo("select * from test");
assertThat(changes.getRequestAtEndPoint()).isNull();
assertThat(changes.getTablesAtStartPointList()).isNull();
@@ -295,7 +260,7 @@ public void test_constructor_request() {
assertThat(changes.getRequestAtStartPoint()).isNotNull();
assertThat(changes.getRequestAtEndPoint()).isNotNull();
- assertThat(changes.getRequestAtEndPoint().getSource()).isSameAs(source);
+ assertThat(changes.getRequestAtEndPoint().getConnectionProvider()).isSameAs(jdbcConnectionProvider);
assertThat(changes.getRequestAtEndPoint().getRequest()).isEqualTo("select * from test");
assertThat(changes.getTablesAtStartPointList()).isNull();
assertThat(changes.getTablesAtEndPointList()).isNull();
diff --git a/src/test/java/org/assertj/db/type/Changes_Exception_Test.java b/src/test/java/org/assertj/db/type/Changes_Exception_Test.java
index d3976a17..adfe4d7d 100644
--- a/src/test/java/org/assertj/db/type/Changes_Exception_Test.java
+++ b/src/test/java/org/assertj/db/type/Changes_Exception_Test.java
@@ -27,9 +27,10 @@
import org.junit.Test;
/**
- * Tests on the exceptions of Changes
+ * Tests on the exceptions to the Changes
*
* @author Régis Pouiller
+ * @author Julien Roy
*/
public class Changes_Exception_Test extends AbstractTest {
@@ -38,8 +39,8 @@ public class Changes_Exception_Test extends AbstractTest {
*/
@Test(expected = AssertJDBException.class)
public void should_fail_because_connection_throws_exception_when_getting_an_object() {
- DataSource ds = new DefaultDataSource(dataSource);
- Table table = new Table(ds, "movi");
+ ConnectionProvider connectionProvider = ConnectionProviderFactory.of(new DefaultDataSource(dataSource)).create();
+ Table table = new Table(connectionProvider, "movi");
Changes changes = new Changes().setTables(table);
changes.setStartPointNow();
}
@@ -62,7 +63,8 @@ public DatabaseMetaData getMetaData() throws SQLException {
};
}
};
- Table table = new Table(ds, "movi");
+ ConnectionProvider connectionProvider = ConnectionProviderFactory.of(ds).create();
+ Table table = new Table(connectionProvider, "movi");
Changes changes = new Changes().setTables(table);
changes.setStartPointNow();
}
@@ -91,7 +93,8 @@ public ResultSet executeQuery(String sql) throws SQLException {
};
}
};
- Table table = new Table(ds, "movi");
+ ConnectionProvider connectionProvider = ConnectionProviderFactory.of(ds).create();
+ Table table = new Table(connectionProvider, "movi");
Changes changes = new Changes().setTables(table);
changes.setStartPointNow();
}
@@ -113,7 +116,8 @@ public DatabaseMetaData getMetaData() throws SQLException {
};
}
};
- Table table = new Table(ds, "movi");
+ ConnectionProvider connectionProvider = ConnectionProviderFactory.of(ds).create();
+ Table table = new Table(connectionProvider, "movi");
Changes changes = new Changes().setTables(table);
changes.setStartPointNow();
}
@@ -135,7 +139,8 @@ public Statement createStatement() throws SQLException {
};
}
};
- Table table = new Table(ds, "movi");
+ ConnectionProvider connectionProvider = ConnectionProviderFactory.of(ds).create();
+ Table table = new Table(connectionProvider, "movi");
Changes changes = new Changes().setTables(table);
changes.setStartPointNow();
}
@@ -151,7 +156,8 @@ public Connection getConnection() throws SQLException {
throw new SQLException();
}
};
- Table table = new Table(ds, "movi");
+ ConnectionProvider connectionProvider = ConnectionProviderFactory.of(ds).create();
+ Table table = new Table(connectionProvider, "movi");
Changes changes = new Changes().setTables(table);
changes.setStartPointNow();
}
@@ -177,7 +183,7 @@ public void should_fail_because_request_is_null() {
*/
@Test(expected = AssertJDBException.class)
public void should_fail_because_end_before_start() {
- Table table = new Table(dataSource, "test");
+ Table table = new Table(dsConnectionProvider, "test");
Changes changes = new Changes().setTables(table);
changes.setEndPointNow();
}
@@ -187,7 +193,7 @@ public void should_fail_because_end_before_start() {
*/
@Test(expected = AssertJDBException.class)
public void should_fail_because_getting_list_of_changes_before_end() {
- Table table = new Table(dataSource, "test");
+ Table table = new Table(dsConnectionProvider, "test");
Changes changes = new Changes().setTables(table);
changes.setStartPointNow();
changes.getChangesList();
@@ -198,7 +204,7 @@ public void should_fail_because_getting_list_of_changes_before_end() {
*/
@Test(expected = NullPointerException.class)
public void should_fail_because_tablename_is_null() {
- new Changes(source).getChangesOfTable(null);
+ new Changes(jdbcConnectionProvider).getChangesOfTable(null);
}
/**
@@ -206,6 +212,6 @@ public void should_fail_because_tablename_is_null() {
*/
@Test(expected = NullPointerException.class)
public void should_fail_because_type_is_null() {
- new Changes(source).getChangesOfType(null);
+ new Changes(jdbcConnectionProvider).getChangesOfType(null);
}
}
diff --git a/src/test/java/org/assertj/db/type/Changes_GetChangesOfTable_Test.java b/src/test/java/org/assertj/db/type/Changes_GetChangesOfTable_Test.java
index 2f15ca14..916fbfca 100644
--- a/src/test/java/org/assertj/db/type/Changes_GetChangesOfTable_Test.java
+++ b/src/test/java/org/assertj/db/type/Changes_GetChangesOfTable_Test.java
@@ -25,7 +25,8 @@
/**
* Tests on the {@code getChangesOfTable} method.
*
- * @author Régis Pouiller.
+ * @author Régis Pouiller
+ * @author Julien Roy.
*/
public class Changes_GetChangesOfTable_Test extends AbstractTest {
@@ -35,8 +36,8 @@ public class Changes_GetChangesOfTable_Test extends AbstractTest {
@Test
@NeedReload
public void test_getChangesOfTable() {
- Changes changesSource = new Changes(source);
- Changes changesRequest = new Changes(new Request(source,
+ Changes changesSource = new Changes(jdbcConnectionProvider);
+ Changes changesRequest = new Changes(new Request(jdbcConnectionProvider,
"select interpretation.id, character, movie.title, actor.name "
+ " from interpretation, movie, actor " + " where interpretation.id_movie = movie.id "
+ " and interpretation.id_actor = actor.id ").setPksName("id"));
diff --git a/src/test/java/org/assertj/db/type/Changes_GetChangesOfType_Test.java b/src/test/java/org/assertj/db/type/Changes_GetChangesOfType_Test.java
index d95f5d4d..2d8cc2c3 100644
--- a/src/test/java/org/assertj/db/type/Changes_GetChangesOfType_Test.java
+++ b/src/test/java/org/assertj/db/type/Changes_GetChangesOfType_Test.java
@@ -25,7 +25,8 @@
/**
* Tests on the {@code getChangesOfType} method.
*
- * @author Régis Pouiller.
+ * @author Régis Pouiller
+ * @author Julien Roy.
*/
public class Changes_GetChangesOfType_Test extends AbstractTest {
@@ -35,8 +36,8 @@ public class Changes_GetChangesOfType_Test extends AbstractTest {
@Test
@NeedReload
public void test_getChangesOfTable() {
- Changes changesSource = new Changes(source);
- Changes changesRequest = new Changes(new Request(source,
+ Changes changesSource = new Changes(jdbcConnectionProvider);
+ Changes changesRequest = new Changes(new Request(jdbcConnectionProvider,
"select interpretation.id, character, movie.title, actor.name "
+ " from interpretation, movie, actor " + " where interpretation.id_movie = movie.id "
+ " and interpretation.id_actor = actor.id ").setPksName("id"));
diff --git a/src/test/java/org/assertj/db/type/Changes_GetChanges_Test.java b/src/test/java/org/assertj/db/type/Changes_GetChanges_Test.java
index fd3aab9e..3e038cfc 100644
--- a/src/test/java/org/assertj/db/type/Changes_GetChanges_Test.java
+++ b/src/test/java/org/assertj/db/type/Changes_GetChanges_Test.java
@@ -24,7 +24,8 @@
/**
* Tests on the {@code getChangesOfTable} and {@code getChangesOfType} methods together.
*
- * @author Régis Pouiller.
+ * @author Régis Pouiller
+ * @author Julien Roy.
*/
public class Changes_GetChanges_Test extends AbstractTest {
@@ -34,7 +35,7 @@ public class Changes_GetChanges_Test extends AbstractTest {
@Test
@NeedReload
public void test_getChangesOfTableAndType() {
- Changes changesSource = new Changes(source);
+ Changes changesSource = new Changes(jdbcConnectionProvider);
changesSource.setStartPointNow();
updateChangesForTests();
@@ -65,7 +66,7 @@ public void test_getChangesOfTableAndType() {
@Test
@NeedReload
public void test_getChangesOfTypeAndTable() {
- Changes changesSource = new Changes(source);
+ Changes changesSource = new Changes(jdbcConnectionProvider);
changesSource.setStartPointNow();
updateChangesForTests();
diff --git a/src/test/java/org/assertj/db/type/Changes_Request_GetChangesList_Test.java b/src/test/java/org/assertj/db/type/Changes_Request_GetChangesList_Test.java
index b7a158f2..77fb41f5 100644
--- a/src/test/java/org/assertj/db/type/Changes_Request_GetChangesList_Test.java
+++ b/src/test/java/org/assertj/db/type/Changes_Request_GetChangesList_Test.java
@@ -38,7 +38,7 @@ public class Changes_Request_GetChangesList_Test extends AbstractTest {
*/
@Test
public void test_when_there_is_no_change() {
- Changes changes = new Changes(new Request(dataSource, "select * from test"));
+ Changes changes = new Changes(new Request(dsConnectionProvider, "select * from test"));
changes.setStartPointNow();
changes.setEndPointNow();
assertThat(changes.getChangesList()).hasSize(0);
@@ -52,7 +52,7 @@ public void test_when_there_is_no_change() {
@Test
@NeedReload
public void test_when_there_is_no_change_found() throws SQLException {
- Changes changes = new Changes(new Request(dataSource, "select * from test"));
+ Changes changes = new Changes(new Request(dsConnectionProvider, "select * from test"));
changes.setStartPointNow();
update("delete from test2 where VAR1 is null");
changes.setEndPointNow();
@@ -67,7 +67,7 @@ public void test_when_there_is_no_change_found() throws SQLException {
@Test
@NeedReload
public void test_when_there_is_deletion_change() throws SQLException {
- Changes changes = new Changes(new Request(dataSource, "select * from test2"));
+ Changes changes = new Changes(new Request(dsConnectionProvider, "select * from test2"));
changes.setStartPointNow();
update("delete from test2 where VAR1 is null");
changes.setEndPointNow();
@@ -106,7 +106,7 @@ public void test_when_there_is_deletion_change() throws SQLException {
@Test
@NeedReload
public void test_when_there_is_creation_change() throws SQLException {
- Changes changes = new Changes(new Request(dataSource, "select * from test2"));
+ Changes changes = new Changes(new Request(dsConnectionProvider, "select * from test2"));
changes.setStartPointNow();
update("insert into test2(VAR1) values(200)");
changes.setEndPointNow();
@@ -145,7 +145,7 @@ public void test_when_there_is_creation_change() throws SQLException {
@Test
@NeedReload
public void test_when_there_is_modification_change_without_primary_key() throws SQLException {
- Changes changes = new Changes(new Request(dataSource, "select * from test2"));
+ Changes changes = new Changes(new Request(dsConnectionProvider, "select * from test2"));
changes.setStartPointNow();
update("update test2 set VAR12 = 'modification' where VAR1 = 1");
changes.setEndPointNow();
@@ -212,7 +212,7 @@ public void test_when_there_is_modification_change_without_primary_key() throws
@Test
@NeedReload
public void test_when_there_is_modification_change_with_primary_key() throws SQLException {
- Changes changes = new Changes(new Request(dataSource, "select * from interpretation").setPksName("id"));
+ Changes changes = new Changes(new Request(dsConnectionProvider, "select * from interpretation").setPksName("id"));
changes.setStartPointNow();
update("update interpretation set character = 'Doctor Grace Augustine' where id = 3");
changes.setEndPointNow();
@@ -240,7 +240,7 @@ public void test_when_there_is_modification_change_with_primary_key() throws SQL
@Test
@NeedReload
public void test_when_there_is_creation_change_with_primary_key() throws SQLException {
- Changes changes = new Changes(new Request(dataSource, "select * from movie").setPksName("id"));
+ Changes changes = new Changes(new Request(dsConnectionProvider, "select * from movie").setPksName("id"));
changes.setStartPointNow();
update("insert into movie values(4, 'Ghostbusters', 1984, '16319617-AE95-4087-9264-D3D21BF611B6')");
changes.setEndPointNow();
@@ -267,7 +267,7 @@ public void test_when_there_is_creation_change_with_primary_key() throws SQLExce
@Test
@NeedReload
public void test_when_there_is_deletion_change_with_primary_key() throws SQLException {
- Changes changes = new Changes(new Request(dataSource, "select * from interpretation").setPksName("id"));
+ Changes changes = new Changes(new Request(dsConnectionProvider, "select * from interpretation").setPksName("id"));
changes.setStartPointNow();
update("delete interpretation where id = 3");
changes.setEndPointNow();
diff --git a/src/test/java/org/assertj/db/type/Changes_SetTables_Test.java b/src/test/java/org/assertj/db/type/Changes_SetTables_Test.java
index b1f7e3bf..561fca75 100644
--- a/src/test/java/org/assertj/db/type/Changes_SetTables_Test.java
+++ b/src/test/java/org/assertj/db/type/Changes_SetTables_Test.java
@@ -19,6 +19,7 @@
* Tests on the setTables method.
*
* @author Régis Pouiller
+ * @author Julien Roy
*/
public class Changes_SetTables_Test extends AbstractTest {
@@ -27,7 +28,7 @@ public class Changes_SetTables_Test extends AbstractTest {
*/
@Test
public void test_when_setting_tables_with_empty_parameters() {
- Changes changes = new Changes(source);
+ Changes changes = new Changes(jdbcConnectionProvider);
changes.setTables();
}
}
diff --git a/src/test/java/org/assertj/db/type/Changes_Table_GetChangesList_Test.java b/src/test/java/org/assertj/db/type/Changes_Table_GetChangesList_Test.java
index b0cff50f..c2bf257d 100644
--- a/src/test/java/org/assertj/db/type/Changes_Table_GetChangesList_Test.java
+++ b/src/test/java/org/assertj/db/type/Changes_Table_GetChangesList_Test.java
@@ -29,7 +29,8 @@
/**
* Tests on the list of changes on tables.
*
- * @author Régis Pouiller.
+ * @author Régis Pouiller
+ * @author Julien Roy.
*/
public class Changes_Table_GetChangesList_Test extends AbstractTest {
@@ -38,7 +39,7 @@ public class Changes_Table_GetChangesList_Test extends AbstractTest {
*/
@Test
public void test_when_there_is_no_change() {
- Changes changes = new Changes(source);
+ Changes changes = new Changes(jdbcConnectionProvider);
changes.setStartPointNow();
changes.setEndPointNow();
assertThat(changes.getChangesList()).hasSize(0);
@@ -52,7 +53,7 @@ public void test_when_there_is_no_change() {
@Test
@NeedReload
public void test_when_there_is_no_change_found() throws SQLException {
- Changes changes = new Changes(new Table(source, "test"));
+ Changes changes = new Changes(new Table(jdbcConnectionProvider, "test"));
changes.setStartPointNow();
update("delete from test2 where VAR1 is null");
changes.setEndPointNow();
@@ -67,7 +68,7 @@ public void test_when_there_is_no_change_found() throws SQLException {
@Test
@NeedReload
public void test_when_there_is_deletion_change() throws SQLException {
- Changes changes = new Changes(source);
+ Changes changes = new Changes(jdbcConnectionProvider);
changes.setStartPointNow();
update("delete from test2 where VAR1 is null");
changes.setEndPointNow();
@@ -106,7 +107,7 @@ public void test_when_there_is_deletion_change() throws SQLException {
@Test
@NeedReload
public void test_when_there_is_creation_change() throws SQLException {
- Changes changes = new Changes(source);
+ Changes changes = new Changes(jdbcConnectionProvider);
changes.setStartPointNow();
update("insert into test2(VAR1) values(200)");
changes.setEndPointNow();
@@ -146,7 +147,7 @@ public void test_when_there_is_creation_change() throws SQLException {
@Test
@NeedReload
public void test_when_there_is_modification_change_without_primary_key() throws SQLException {
- Changes changes = new Changes(source);
+ Changes changes = new Changes(jdbcConnectionProvider);
changes.setStartPointNow();
update("update test2 set VAR12 = 'modification' where VAR1 = 1");
changes.setEndPointNow();
@@ -218,7 +219,7 @@ public void test_when_there_is_modification_change_without_primary_key() throws
@Test
@NeedReload
public void test_when_there_is_modification_change_with_primary_key() throws SQLException {
- Changes changes = new Changes(source);
+ Changes changes = new Changes(jdbcConnectionProvider);
changes.setStartPointNow();
update("update interpretation set character = 'Doctor Grace Augustine' where id = 3");
changes.setEndPointNow();
@@ -246,7 +247,7 @@ public void test_when_there_is_modification_change_with_primary_key() throws SQL
@Test
@NeedReload
public void test_when_there_is_creation_change_with_primary_key() throws SQLException {
- Changes changes = new Changes(new Table(source, "movie"));
+ Changes changes = new Changes(new Table(jdbcConnectionProvider, "movie"));
changes.setStartPointNow();
update("insert into movie values(4, 'Ghostbusters', 1984, '16319617-AE95-4087-9264-D3D21BF611B6')");
changes.setEndPointNow();
@@ -273,7 +274,7 @@ public void test_when_there_is_creation_change_with_primary_key() throws SQLExce
@Test
@NeedReload
public void test_when_there_is_deletion_change_with_primary_key() throws SQLException {
- Changes changes = new Changes(new Table(source, "interpretation"));
+ Changes changes = new Changes(new Table(jdbcConnectionProvider, "interpretation"));
changes.setStartPointNow();
update("delete interpretation where id = 3");
changes.setEndPointNow();
diff --git a/src/test/java/org/assertj/db/type/DataSourceWithLetterCase_Test.java b/src/test/java/org/assertj/db/type/DataSourceWithLetterCase_Test.java
deleted file mode 100644
index 4727575d..00000000
--- a/src/test/java/org/assertj/db/type/DataSourceWithLetterCase_Test.java
+++ /dev/null
@@ -1,186 +0,0 @@
-/*
- * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
- * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations under the License.
- *
- * Copyright 2015-2024 the original author or authors.
- */
-package org.assertj.db.type;
-
-import static org.assertj.core.api.Assertions.assertThat;
-
-import java.io.PrintWriter;
-import java.sql.Connection;
-import java.sql.SQLException;
-import java.sql.SQLFeatureNotSupportedException;
-import java.util.logging.Logger;
-import javax.sql.DataSource;
-
-import org.assertj.db.common.AbstractTest;
-import org.assertj.db.common.DefaultConnection;
-import org.assertj.db.type.lettercase.LetterCase;
-import org.junit.Before;
-import org.junit.Test;
-
-/**
- * Tests on the {@code DataSourceWithLetterCase_Test}.
- *
- * @author Régis Pouiller
- */
-public class DataSourceWithLetterCase_Test extends AbstractTest {
-
- private DataSource delegate;
-
- ;
- private DataSourceWithLetterCase dataSourceWithLetterCase;
-
- @Before
- public void init() throws SQLException {
- delegate = new MyDataSource(dataSource);
- dataSourceWithLetterCase = new DataSourceWithLetterCase(delegate, LetterCase.TABLE_DEFAULT, LetterCase.COLUMN_DEFAULT, LetterCase.PRIMARY_KEY_DEFAULT);
- }
-
- /**
- * This method test the {@code getConnection} method.
- *
- * @throws SQLException
- */
- @Test
- public void test_getConnection() throws SQLException {
- assertThat(dataSourceWithLetterCase.getConnection()).isSameAs(delegate.getConnection());
- assertThat(dataSourceWithLetterCase.getConnection("SA", "")).isSameAs(delegate.getConnection("SA", ""));
- }
-
- /**
- * This method test the {@code getLogWriter} and {@code setLogWriter} method.
- *
- * @throws SQLException
- */
- @Test
- public void test_LogWriter() throws SQLException {
- assertThat(dataSourceWithLetterCase.getLogWriter()).isSameAs(delegate.getLogWriter());
- PrintWriter printWriter = new PrintWriter(System.out);
- dataSourceWithLetterCase.setLogWriter(printWriter);
- assertThat(dataSourceWithLetterCase.getLogWriter()).isSameAs(delegate.getLogWriter()).isSameAs(printWriter);
- }
-
- /**
- * This method test the {@code getLoginTimeout} and {@code setLoginTimeout} method.
- *
- * @throws SQLException
- */
- @Test
- public void test_LoginTimeout() throws SQLException {
- assertThat(dataSourceWithLetterCase.getLoginTimeout()).isEqualTo(delegate.getLoginTimeout()).isEqualTo(0);
- dataSourceWithLetterCase.setLoginTimeout(10);
- assertThat(dataSourceWithLetterCase.getLoginTimeout()).isEqualTo(delegate.getLoginTimeout()).isEqualTo(10);
- }
-
- /**
- * This method test the {@code getParentLogger} method.
- *
- * @throws SQLException
- */
- @Test
- public void test_getParentLogger() throws SQLException {
- assertThat(dataSourceWithLetterCase.getParentLogger()).isSameAs(delegate.getParentLogger());
- }
-
- /**
- * This method test the {@code isWrapperFor} method.
- *
- * @throws SQLException
- */
- @Test
- public void test_isWrapperFor() throws SQLException {
- assertThat(dataSourceWithLetterCase.isWrapperFor(Boolean.class)).isEqualTo(delegate.isWrapperFor(Boolean.class)).isTrue();
- assertThat(dataSourceWithLetterCase.isWrapperFor(Integer.class)).isEqualTo(delegate.isWrapperFor(Integer.class)).isFalse();
- }
-
- /**
- * This method test the {@code unwrap} method.
- *
- * @throws SQLException
- */
- @Test
- public void test_unwrap() throws SQLException {
- assertThat(dataSourceWithLetterCase.unwrap(Boolean.class)).isEqualTo(delegate.unwrap(Boolean.class)).isTrue();
- assertThat(dataSourceWithLetterCase.unwrap(String.class)).isEqualTo(delegate.unwrap(String.class)).isEqualTo("test");
- assertThat(dataSourceWithLetterCase.unwrap(Integer.class)).isEqualTo(delegate.unwrap(Integer.class)).isNull();
- }
-
- private static class MyDataSource implements DataSource {
-
- private Connection connection;
- private int loginTimeout;
- private PrintWriter printWriter;
- private Logger logger;
-
- private MyDataSource(DataSource dataSource) throws SQLException {
- connection = new DefaultConnection(dataSource.getConnection());
- loginTimeout = 0;
- printWriter = new PrintWriter(System.out);
- logger = Logger.getGlobal();
- }
-
- @Override
- public PrintWriter getLogWriter() throws SQLException {
- return printWriter;
- }
-
- @Override
- public void setLogWriter(PrintWriter arg0) throws SQLException {
- printWriter = arg0;
- }
-
- @Override
- public int getLoginTimeout() throws SQLException {
- return loginTimeout;
- }
-
- @Override
- public void setLoginTimeout(int arg0) throws SQLException {
- loginTimeout = arg0;
- }
-
- @Override
- public Logger getParentLogger() throws SQLFeatureNotSupportedException {
- return logger;
- }
-
- @Override
- public boolean isWrapperFor(Class> arg0) throws SQLException {
- if (Boolean.class.equals(arg0)) {
- return true;
- }
- return false;
- }
-
- @SuppressWarnings("unchecked")
- @Override
- public T unwrap(Class iface) throws SQLException {
- if (Boolean.class.equals(iface)) {
- return (T) Boolean.TRUE;
- } else if (String.class.equals(iface)) {
- return (T) "test";
- }
- return null;
- }
-
- @Override
- public Connection getConnection() throws SQLException {
- return connection;
- }
-
- @Override
- public Connection getConnection(String arg0, String arg1) throws SQLException {
- return connection;
- }
-
- }
-}
diff --git a/src/test/java/org/assertj/db/type/Request_Columns_Name_Test.java b/src/test/java/org/assertj/db/type/Request_Columns_Name_Test.java
index e028986e..e1723aed 100644
--- a/src/test/java/org/assertj/db/type/Request_Columns_Name_Test.java
+++ b/src/test/java/org/assertj/db/type/Request_Columns_Name_Test.java
@@ -25,15 +25,16 @@
*
*
* @author Régis Pouiller
+ * @author Julien Roy
*/
public class Request_Columns_Name_Test extends AbstractTest {
/**
- * This method test the columns name got from a {@code Source}.
+ * This method test the columns name got from a {@code ConnectionProvider}.
*/
@Test
- public void test_columns_name_with_source_set() {
- Request request = new Request(source,
+ public void test_columns_name_with_jdbc_set() {
+ Request request = new Request(jdbcConnectionProvider,
"SELECT actor.name, actor.firstname, movie.year, interpretation.character "
+ " FROM movie, actor, interpretation"
+ " WHERE movie.id = interpretation.id_movie"
@@ -50,7 +51,7 @@ public void test_columns_name_with_source_set() {
*/
@Test
public void test_columns_name_with_datasource_set() {
- Request request = new Request(dataSource,
+ Request request = new Request(dsConnectionProvider,
"SELECT actor.name, actor.firstname, movie.year, interpretation.character "
+ " FROM movie, actor, interpretation"
+ " WHERE movie.id = interpretation.id_movie"
@@ -63,11 +64,11 @@ public void test_columns_name_with_datasource_set() {
}
/**
- * This method test the columns name got from a {@code Source}.
+ * This method test the columns name got from a {@code ConnectionProvider}.
*/
@Test
- public void test_columns_name_with_source_and_parameters_set() {
- Request request = new Request(source,
+ public void test_columns_name_with_jdbc_and_parameters_set() {
+ Request request = new Request(jdbcConnectionProvider,
"SELECT actor.name, actor.firstname, movie.year, interpretation.character "
+ " FROM movie, actor, interpretation"
+ " WHERE movie.id = interpretation.id_movie"
@@ -85,7 +86,7 @@ public void test_columns_name_with_source_and_parameters_set() {
*/
@Test
public void test_columns_name_with_datasource_and_parameters_set() {
- Request request = new Request(dataSource,
+ Request request = new Request(dsConnectionProvider,
"SELECT actor.name, actor.firstname, movie.year, interpretation.character "
+ " FROM movie, actor, interpretation"
+ " WHERE movie.id = interpretation.id_movie"
@@ -105,7 +106,7 @@ public void test_columns_name_with_datasource_and_parameters_set() {
*/
@Test(expected = AssertJDBException.class)
public void should_throw_AssertJDBException_because_SQLException_caused_by_table_not_found() {
- Table table = new Table(dataSource, "select * from interpret");
+ Table table = new Table(dsConnectionProvider, "select * from interpret");
table.getColumnsNameList();
}
diff --git a/src/test/java/org/assertj/db/type/Request_Columns_Test.java b/src/test/java/org/assertj/db/type/Request_Columns_Test.java
index eccb77c9..31873329 100644
--- a/src/test/java/org/assertj/db/type/Request_Columns_Test.java
+++ b/src/test/java/org/assertj/db/type/Request_Columns_Test.java
@@ -24,15 +24,16 @@
*
*
* @author Régis Pouiller
+ * @author Julien Roy
*/
public class Request_Columns_Test extends AbstractTest {
/**
- * This method test the columns got from a {@code Source}.
+ * This method test the columns got from a {@code ConnectionProvider}.
*/
@Test
- public void test_columns_with_source_set() {
- Request request = new Request(source, "SELECT actor.name, actor.firstname, movie.year, interpretation.character "
+ public void test_columns_with_jdbc_set() {
+ Request request = new Request(jdbcConnectionProvider, "SELECT actor.name, actor.firstname, movie.year, interpretation.character "
+ " FROM movie, actor, interpretation"
+ " WHERE movie.id = interpretation.id_movie"
+ " AND interpretation.id_actor = actor.id"
@@ -54,7 +55,7 @@ public void test_columns_with_source_set() {
*/
@Test
public void test_columns_with_datasource_set() {
- Request request = new Request(dataSource, "SELECT actor.name, actor.firstname, movie.year, interpretation.character "
+ Request request = new Request(dsConnectionProvider, "SELECT actor.name, actor.firstname, movie.year, interpretation.character "
+ " FROM movie, actor, interpretation"
+ " WHERE movie.id = interpretation.id_movie"
+ " AND interpretation.id_actor = actor.id"
diff --git a/src/test/java/org/assertj/db/type/Request_Exception_Test.java b/src/test/java/org/assertj/db/type/Request_Exception_Test.java
index 1d84eba3..0c5cf56a 100644
--- a/src/test/java/org/assertj/db/type/Request_Exception_Test.java
+++ b/src/test/java/org/assertj/db/type/Request_Exception_Test.java
@@ -38,23 +38,15 @@ public class Request_Exception_Test extends AbstractTest {
*/
@Test(expected = AssertJDBException.class)
public void should_fail_because_setting_primarykey_which_donot_exist() {
- new Request(dataSource, "select var1 from test").setPksName("var2").getRowsList();
+ new Request(dsConnectionProvider, "select var1 from test").setPksName("var2").getRowsList();
}
/**
- * This method should fail because setting the datasource to null.
+ * This method should fail because setting the connection provider to null.
*/
@Test(expected = NullPointerException.class)
- public void should_fail_because_setting_datasource_to_null() {
- new Request().setDataSource(null);
- }
-
- /**
- * This method should fail because setting the source to null.
- */
- @Test(expected = NullPointerException.class)
- public void should_fail_because_setting_source_to_null() {
- new Request().setSource(null);
+ public void should_fail_because_setting_connection_provider_to_null() {
+ new Request().setConnectionProvider(null);
}
/**
@@ -63,7 +55,8 @@ public void should_fail_because_setting_source_to_null() {
@Test(expected = AssertJDBException.class)
public void should_fail_because_connection_throws_exception_when_getting_an_object() {
DataSource ds = new DefaultDataSource(dataSource);
- Request request = new Request(ds, "select * from movi where id = ?", 1);
+ ConnectionProvider connectionProvider = ConnectionProviderFactory.of(ds).create();
+ Request request = new Request(connectionProvider, "select * from movi where id = ?", 1);
request.getColumnsNameList();
}
@@ -90,7 +83,8 @@ public ResultSet executeQuery() throws SQLException {
};
}
};
- Request request = new Request(ds, "select * from movi where id = ?", 1);
+ ConnectionProvider connectionProvider = ConnectionProviderFactory.of(ds).create();
+ Request request = new Request(connectionProvider, "select * from movi where id = ?", 1);
request.getColumnsNameList();
}
@@ -111,7 +105,8 @@ public DatabaseMetaData getMetaData() throws SQLException {
};
}
};
- Request request = new Request(ds, "select * from movi where id = ?", 1);
+ ConnectionProvider connectionProvider = ConnectionProviderFactory.of(ds).create();
+ Request request = new Request(connectionProvider, "select * from movi where id = ?", 1);
request.getColumnsNameList();
}
@@ -132,7 +127,8 @@ public PreparedStatement prepareStatement(String sql) throws SQLException {
};
}
};
- Request request = new Request(ds, "select * from movi where id = ?", 1);
+ ConnectionProvider connectionProvider = ConnectionProviderFactory.of(ds).create();
+ Request request = new Request(connectionProvider, "select * from movi where id = ?", 1);
request.getColumnsNameList();
}
@@ -147,7 +143,8 @@ public Connection getConnection() throws SQLException {
throw new SQLException();
}
};
- Request request = new Request(ds, "select * from movi where id = ?", 1);
+ ConnectionProvider connectionProvider = ConnectionProviderFactory.of(ds).create();
+ Request request = new Request(connectionProvider, "select * from movi where id = ?", 1);
request.getColumnsNameList();
}
}
diff --git a/src/test/java/org/assertj/db/type/Request_GetRowFromPksValues_Test.java b/src/test/java/org/assertj/db/type/Request_GetRowFromPksValues_Test.java
index de1f9f22..beece44f 100644
--- a/src/test/java/org/assertj/db/type/Request_GetRowFromPksValues_Test.java
+++ b/src/test/java/org/assertj/db/type/Request_GetRowFromPksValues_Test.java
@@ -23,6 +23,7 @@
* Tests on getting a {@code Row} in a {@code Request} from primary keys values.
*
* @author Régis Pouiller
+ * @author Julien Roy
*/
public class Request_GetRowFromPksValues_Test extends AbstractTest {
@@ -31,7 +32,7 @@ public class Request_GetRowFromPksValues_Test extends AbstractTest {
*/
@Test
public void test_getting_row_from_primary_keys_values_without_finding() throws Exception {
- Request request = new Request(source,
+ Request request = new Request(jdbcConnectionProvider,
"SELECT actor.name, actor.firstname, movie.year, interpretation.id, interpretation.character "
+ " FROM movie, actor, interpretation WHERE movie.id = interpretation.id_movie"
+ " AND interpretation.id_actor = actor.id ORDER BY actor.name, movie.year");
@@ -50,7 +51,7 @@ public void test_getting_row_from_primary_keys_values_without_finding() throws E
*/
@Test
public void test_getting_row_from_primary_keys_values_with_finding() throws Exception {
- Request request = new Request(source,
+ Request request = new Request(jdbcConnectionProvider,
"SELECT actor.name, actor.firstname, movie.year, interpretation.id, interpretation.character "
+ " FROM movie, actor, interpretation WHERE movie.id = interpretation.id_movie"
+ " AND interpretation.id_actor = actor.id ORDER BY actor.name, movie.year").setPksName("id");
diff --git a/src/test/java/org/assertj/db/type/Request_Getters_Test.java b/src/test/java/org/assertj/db/type/Request_Getters_Test.java
index 2ea0da6f..240a06c0 100644
--- a/src/test/java/org/assertj/db/type/Request_Getters_Test.java
+++ b/src/test/java/org/assertj/db/type/Request_Getters_Test.java
@@ -24,49 +24,35 @@
*
*
* @author Régis Pouiller
+ * @author Julien Roy
*/
public class Request_Getters_Test extends AbstractTest {
/**
- * This method test the getters of a {@code Table} when only the source is set.
+ * This method test the getters of a {@code Table} when only the jdbc connection is set.
*/
@Test
- public void test_getters_with_only_source_set() {
- Request request = new Request().setSource(source);
+ public void test_getters_with_only_jdbc_connection_set() {
+ Request request = new Request().setConnectionProvider(jdbcConnectionProvider);
- assertThat(request.getSource()).isSameAs(source);
- assertThat(request.getDataSource()).isNull();
+ assertThat(request.getConnectionProvider()).isSameAs(jdbcConnectionProvider);
assertThat(request.getRequest()).isNull();
assertThat(request.getParameters()).isNull();
}
/**
- * This method test the getters of a {@code Table} when only the datasource is set.
+ * This method test the getters of a {@code Table} when the jdbc connection and the name are set.
*/
@Test
- public void test_getters_with_only_datasource_set() {
- Request request = new Request().setDataSource(dataSource);
-
- assertThat(request.getSource()).isNull();
- assertThat(request.getDataSource()).isSameAs(dataSource);
- assertThat(request.getRequest()).isNull();
- assertThat(request.getParameters()).isNull();
- }
-
- /**
- * This method test the getters of a {@code Table} when the source and the name are set.
- */
- @Test
- public void test_getters_with_source_and_name_set() {
- Request request = new Request(source,
+ public void test_getters_with_jdbc_and_name_set() {
+ Request request = new Request(jdbcConnectionProvider,
"SELECT actor.name, actor.firstname, movie.year, interpretation.character "
+ " FROM movie, actor, interpretation"
+ " WHERE movie.id = interpretation.id_movie"
+ " AND interpretation.id_actor = actor.id"
+ " ORDER BY actor.name, movie.year");
- assertThat(request.getSource()).as("Source of MOVIE table").isSameAs(source);
- assertThat(request.getDataSource()).isNull();
+ assertThat(request.getConnectionProvider()).as("Source of MOVIE table").isSameAs(jdbcConnectionProvider);
assertThat(request.getRequest()).isEqualTo("SELECT actor.name, actor.firstname, movie.year, interpretation.character "
+ " FROM movie, actor, interpretation"
+ " WHERE movie.id = interpretation.id_movie"
@@ -76,12 +62,12 @@ public void test_getters_with_source_and_name_set() {
}
/**
- * This method test the getters of a {@code Table} when the source, the name and the information about the columns
+ * This method test the getters of a {@code Table} when the jdbc connection, the name and the information about the columns
* are set.
*/
@Test
- public void test_getters_with_source_name_and_columns_set() {
- Request request = new Request(source,
+ public void test_getters_with_jdbc_name_and_columns_set() {
+ Request request = new Request(jdbcConnectionProvider,
"SELECT actor.name, actor.firstname, movie.year, interpretation.character "
+ " FROM movie, actor, interpretation"
+ " WHERE movie.id = interpretation.id_movie"
@@ -89,8 +75,7 @@ public void test_getters_with_source_name_and_columns_set() {
+ " AND movie.year > ?"
+ " ORDER BY actor.name, movie.year", 2000);
- assertThat(request.getSource()).as("Source of MOVIE table").isSameAs(source);
- assertThat(request.getDataSource()).isNull();
+ assertThat(request.getConnectionProvider()).as("Source of MOVIE table").isSameAs(jdbcConnectionProvider);
assertThat(request.getRequest()).isEqualTo("SELECT actor.name, actor.firstname, movie.year, interpretation.character "
+ " FROM movie, actor, interpretation"
+ " WHERE movie.id = interpretation.id_movie"
diff --git a/src/test/java/org/assertj/db/type/Request_Instantiation_Test.java b/src/test/java/org/assertj/db/type/Request_Instantiation_Test.java
index 7c6d2341..f8128810 100644
--- a/src/test/java/org/assertj/db/type/Request_Instantiation_Test.java
+++ b/src/test/java/org/assertj/db/type/Request_Instantiation_Test.java
@@ -12,8 +12,6 @@
*/
package org.assertj.db.type;
-import javax.sql.DataSource;
-
import org.assertj.db.common.AbstractTest;
import org.assertj.db.exception.AssertJDBException;
import org.junit.Test;
@@ -25,77 +23,61 @@
*
*
* @author Régis Pouiller
+ * @author Julien Roy
*/
public class Request_Instantiation_Test extends AbstractTest {
/**
- * This method should throw a {@code NullPointerException}, because the {@code Source} parameter is {@code null}.
- */
- @Test(expected = NullPointerException.class)
- public void should_throw_NullPointerException_if_instantiate_with_Source_null() {
- new Request((Source) null, null);
- }
-
- /**
- * This method should throw a {@code NullPointerException}, because the {@code DataSource} parameter is {@code null}.
+ * This method should throw a {@code NullPointerException}, because the {@code ConnectionProvider} parameter is {@code null}.
*/
@Test(expected = NullPointerException.class)
- public void should_throw_NullPointerException_if_instantiate_with_DataSource_null() {
- new Request((DataSource) null, null);
+ public void should_throw_NullPointerException_if_instantiate_with_connection_provider_null() {
+ new Request(null, null);
}
/**
- * This method should throw a {@code NullPointerException}, because the {@code Source} parameter is not {@code null}
+ * This method should throw a {@code NullPointerException}, because the {@code ConnectionProvider} parameter is not {@code null}
* and request is {@code null}.
*/
@Test(expected = NullPointerException.class)
- public void should_throw_NullPointerException_if_instantiate_with_Source_not_null_and_table_name_null() {
- new Request(source, null);
+ public void should_throw_NullPointerException_if_instantiate_with_jdbc_not_null_and_table_name_null() {
+ new Request(jdbcConnectionProvider, null);
}
/**
- * This method should throw a {@code NullPointerException}, because the {@code DataSource} parameter is {@code null}
+ * This method should throw a {@code NullPointerException}, because the {@code ConnectionProvider} parameter is {@code null}
* and request is {@code null}.
*/
@Test(expected = NullPointerException.class)
- public void should_throw_NullPointerException_if_instantiate_with_DataSource_not_null_and_table_name_null() {
- new Request(dataSource, null);
+ public void should_throw_NullPointerException_if_instantiate_with_data_source_not_null_and_table_name_null() {
+ new Request(dsConnectionProvider, null);
}
/**
- * This method should throw a {@code NullPointerException}, because the {@code DataSource} and the {@code Source}
+ * This method should throw a {@code NullPointerException}, because the {@code DataSource} and the {@code ConnectionProvider}
* fields are not set when call {@code getColumnsNameList()}.
*/
@Test(expected = NullPointerException.class)
- public void should_throw_NullPointerException_if_get_list_of_columns_name_without_setting_source_or_datasource() {
+ public void should_throw_NullPointerException_if_get_list_of_columns_name_without_setting_connection_provider_or_datasource() {
new Request().getColumnsNameList();
}
/**
- * This method should throw a {@code NullPointerException}, because the {@code Source} field is set but not the table
+ * This method should throw a {@code NullPointerException}, because the {@code ConnectionProvider} field is set but not the table
* name when call {@code getColumnsNameList()}.
*/
@Test(expected = NullPointerException.class)
- public void should_throw_NullPointerException_if_get_list_of_columns_name_with_setting_source_and_without_setting_table_name() {
- new Request().setSource(source).getColumnsNameList();
- }
-
- /**
- * This method should throw a {@code NullPointerException}, because the {@code DataSource} field is set but not the
- * table name when call {@code getColumnsNameList()}.
- */
- @Test(expected = NullPointerException.class)
- public void should_throw_NullPointerException_if_get_list_of_columns_name_with_setting_datasource_and_without_setting_table_name() {
- new Request().setDataSource(dataSource).getColumnsNameList();
+ public void should_throw_NullPointerException_if_get_list_of_columns_name_with_setting_connection_provider_and_without_setting_table_name() {
+ new Request().setConnectionProvider(jdbcConnectionProvider).getColumnsNameList();
}
/**
- * This method should throw a {@code AssertJDBException}, because the {@code Source} field is set but not
- * all the information of the {@code Source}.
+ * This method should throw a {@code AssertJDBException}, because the {@code ConnectionProvider} field is set but not
+ * all the information of the {@code ConnectionProvider}.
*/
@Test(expected = AssertJDBException.class)
- public void should_throw_AssertJDBException_if_get_list_of_rows_with_setting_source_having_bad_user() {
- Request request = new Request(new Source(source.getUrl(), "", ""), "");
+ public void should_throw_AssertJDBException_if_get_list_of_rows_with_setting_connection_provider_having_bad_user() {
+ Request request = new Request(ConnectionProviderFactory.of("jdbc:h2:mem:test", "", "").create(), "");
request.getRowsList();
}
}
diff --git a/src/test/java/org/assertj/db/type/Request_PrimaryKeys_Name_Test.java b/src/test/java/org/assertj/db/type/Request_PrimaryKeys_Name_Test.java
index dbd70b90..5ec0dcc4 100644
--- a/src/test/java/org/assertj/db/type/Request_PrimaryKeys_Name_Test.java
+++ b/src/test/java/org/assertj/db/type/Request_PrimaryKeys_Name_Test.java
@@ -25,15 +25,16 @@
*
*
* @author Régis Pouiller
+ * @author Julien Roy
*/
public class Request_PrimaryKeys_Name_Test extends AbstractTest {
/**
- * This method test the primary keys name got from a {@code Source}.
+ * This method test the primary keys name got from a {@code JdbcUrlConnectionProvider}.
*/
@Test
- public void test_pks_name_with_source_set_but_not_primary_keys() {
- Request request = new Request(source,
+ public void test_pks_name_with_jdbc_set_but_not_primary_keys() {
+ Request request = new Request(jdbcConnectionProvider,
"SELECT actor.name, actor.firstname, movie.year, interpretation.character "
+ " FROM movie, actor, interpretation"
+ " WHERE movie.id = interpretation.id_movie"
@@ -45,11 +46,11 @@ public void test_pks_name_with_source_set_but_not_primary_keys() {
}
/**
- * This method test the primary keys name got from a {@code Source}.
+ * This method test the primary keys name got from a {@code JdbcUrlConnectionProvider}.
*/
@Test
- public void test_pks_name_with_source_set() {
- Request request = new Request(source,
+ public void test_pks_name_with_jdbc_set() {
+ Request request = new Request(jdbcConnectionProvider,
"SELECT actor.name, actor.firstname, movie.year, interpretation.character "
+ " FROM movie, actor, interpretation"
+ " WHERE movie.id = interpretation.id_movie"
@@ -62,11 +63,11 @@ public void test_pks_name_with_source_set() {
}
/**
- * This method test the primary keys name got from a {@code DataSource}.
+ * This method test the primary keys name got from a {@code DataSourceConnectionProvider}.
*/
@Test
public void test_pks_name_with_datasource_set() {
- Request request = new Request(dataSource,
+ Request request = new Request(dsConnectionProvider,
"SELECT actor.name, actor.firstname, movie.year, interpretation.character "
+ " FROM movie, actor, interpretation"
+ " WHERE movie.id = interpretation.id_movie"
@@ -79,11 +80,11 @@ public void test_pks_name_with_datasource_set() {
}
/**
- * This method test the primary keys name got from a {@code Source}.
+ * This method test the primary keys name got from a {@code DataSourceConnectionProvider}.
*/
@Test
- public void test_pks_name_with_source_and_parameters_set() {
- Request request = new Request(source,
+ public void test_pks_name_with_jdbc_and_parameters_set() {
+ Request request = new Request(dsConnectionProvider,
"SELECT actor.name, actor.firstname, movie.year, interpretation.character "
+ " FROM movie, actor, interpretation"
+ " WHERE movie.id = interpretation.id_movie"
@@ -97,11 +98,11 @@ public void test_pks_name_with_source_and_parameters_set() {
}
/**
- * This method test the primary keys name got from a {@code DataSource}.
+ * This method test the primary keys name got from a {@code DataSourceConnectionProvider}.
*/
@Test
public void test_pks_name_with_datasource_and_parameters_set() {
- Request request = new Request(dataSource,
+ Request request = new Request(dsConnectionProvider,
"SELECT actor.name, actor.firstname, movie.year, interpretation.character "
+ " FROM movie, actor, interpretation"
+ " WHERE movie.id = interpretation.id_movie"
@@ -121,7 +122,7 @@ public void test_pks_name_with_datasource_and_parameters_set() {
*/
@Test(expected = AssertJDBException.class)
public void should_throw_AssertJDBException_because_SQLException_caused_by_table_not_found() {
- Table table = new Table(dataSource, "select * from interpret");
+ Table table = new Table(dsConnectionProvider, "select * from interpret");
table.getPksNameList();
}
diff --git a/src/test/java/org/assertj/db/type/Request_Rows_Test.java b/src/test/java/org/assertj/db/type/Request_Rows_Test.java
index 2e6c5e5c..1769dc53 100644
--- a/src/test/java/org/assertj/db/type/Request_Rows_Test.java
+++ b/src/test/java/org/assertj/db/type/Request_Rows_Test.java
@@ -26,15 +26,16 @@
*
*
* @author Régis Pouiller
+ * @author Julien Roy
*/
public class Request_Rows_Test extends AbstractTest {
/**
- * This method test the rows got from a {@code Source}.
+ * This method test the rows got from a {@code ConnectionProvider}.
*/
@Test
- public void test_rows_with_source_set() {
- Request request = new Request(source, "SELECT actor.name, actor.firstname, movie.year, interpretation.character "
+ public void test_rows_with_jdbc_set() {
+ Request request = new Request(jdbcConnectionProvider, "SELECT actor.name, actor.firstname, movie.year, interpretation.character "
+ " FROM movie, actor, interpretation"
+ " WHERE movie.id = interpretation.id_movie"
+ " AND interpretation.id_actor = actor.id"
@@ -74,7 +75,7 @@ public void test_rows_with_source_set() {
*/
@Test
public void test_rows_with_datasource_set() {
- Request request = new Request(dataSource, "SELECT actor.name, actor.firstname, movie.year, interpretation.character "
+ Request request = new Request(dsConnectionProvider, "SELECT actor.name, actor.firstname, movie.year, interpretation.character "
+ " FROM movie, actor, interpretation"
+ " WHERE movie.id = interpretation.id_movie"
+ " AND interpretation.id_actor = actor.id"
@@ -109,7 +110,7 @@ public void test_rows_with_datasource_set() {
*/
@Test(expected = NullPointerException.class)
public void should_throw_NullPointerException_because_column_name_parameter_is_null_when_calling_getColumnValue() {
- Request request = new Request(dataSource, "SELECT actor.name, actor.firstname, movie.year, interpretation.character "
+ Request request = new Request(dsConnectionProvider, "SELECT actor.name, actor.firstname, movie.year, interpretation.character "
+ " FROM movie, actor, interpretation"
+ " WHERE movie.id = interpretation.id_movie"
+ " AND interpretation.id_actor = actor.id"
@@ -122,7 +123,7 @@ public void should_throw_NullPointerException_because_column_name_parameter_is_n
*/
@Test
public void test_that_we_get_null_when_calling_getColumnValue_and_the_column_name_dont_exist() {
- Request request = new Request(dataSource, "SELECT actor.name, actor.firstname, movie.year, interpretation.character "
+ Request request = new Request(dsConnectionProvider, "SELECT actor.name, actor.firstname, movie.year, interpretation.character "
+ " FROM movie, actor, interpretation"
+ " WHERE movie.id = interpretation.id_movie"
+ " AND interpretation.id_actor = actor.id"
diff --git a/src/test/java/org/assertj/db/type/Table_Columns_Name_Test.java b/src/test/java/org/assertj/db/type/Table_Columns_Name_Test.java
index 8a0fa849..be6cb9aa 100644
--- a/src/test/java/org/assertj/db/type/Table_Columns_Name_Test.java
+++ b/src/test/java/org/assertj/db/type/Table_Columns_Name_Test.java
@@ -25,15 +25,16 @@
*
*
* @author Régis Pouiller
+ * @author Julien Roy
*/
public class Table_Columns_Name_Test extends AbstractTest {
/**
- * This method test the columns got from a {@code Source}.
+ * This method test the columns got from a {@code ConnectionProvider}.
*/
@Test
- public void test_columns_name_with_source_set() {
- Table table = new Table(source, "movie");
+ public void test_columns_name_with_jdbc_set() {
+ Table table = new Table(jdbcConnectionProvider, "movie");
assertThat(table.getColumnsNameList()).as("Columns of MOVIE table").hasSize(4)
.containsExactly("ID", "TITLE", "YEAR", "MOVIE_IMDB");
@@ -44,18 +45,18 @@ public void test_columns_name_with_source_set() {
*/
@Test
public void test_columns_name_with_datasource_set() {
- Table table = new Table(dataSource, "movie");
+ Table table = new Table(dsConnectionProvider, "movie");
assertThat(table.getColumnsNameList()).as("Columns of MOVIE table").hasSize(4)
.containsExactly("ID", "TITLE", "YEAR", "MOVIE_IMDB");
}
/**
- * This method test the columns got from a {@code Source} when the columns to check are set.
+ * This method test the columns got from a {@code ConnectionProvider} when the columns to check are set.
*/
@Test
- public void test_columns_name_to_check_with_source_set() {
- Table table = new Table(source, "actor", new String[]{"id", "name", "birth"}, null);
+ public void test_columns_name_to_check_with_jdbc_set() {
+ Table table = new Table(jdbcConnectionProvider, "actor", new String[]{"id", "name", "birth"}, null);
assertThat(table.getColumnsNameList()).as("Columns of ACTOR table").hasSize(3)
.containsExactly("ID", "NAME", "BIRTH");
@@ -66,18 +67,18 @@ public void test_columns_name_to_check_with_source_set() {
*/
@Test
public void test_columns_name_to_check_with_datasource_set() {
- Table table = new Table(dataSource, "actor", new String[]{"id", "name", "birth"}, null);
+ Table table = new Table(dsConnectionProvider, "actor", new String[]{"id", "name", "birth"}, null);
assertThat(table.getColumnsNameList()).as("Columns of ACTOR table").hasSize(3)
.containsExactly("ID", "NAME", "BIRTH");
}
/**
- * This method test the columns got from a {@code Source} when the columns to exclude are set.
+ * This method test the columns got from a {@code ConnectionProvider} when the columns to exclude are set.
*/
@Test
- public void test_columns_name_to_exclude_with_source_set() {
- Table table = new Table(source, "interpretation", null, new String[]{"id"});
+ public void test_columns_name_to_exclude_with_jdbc_set() {
+ Table table = new Table(jdbcConnectionProvider, "interpretation", null, new String[]{"id"});
assertThat(table.getColumnsNameList()).as("Columns of INTERPRETATION table").hasSize(3)
.containsExactly("ID_MOVIE", "ID_ACTOR", "CHARACTER");
@@ -88,7 +89,7 @@ public void test_columns_name_to_exclude_with_source_set() {
*/
@Test
public void test_columns_name_to_exclude_with_datasource_set() {
- Table table = new Table(dataSource, "interpretation", null, new String[]{"id"});
+ Table table = new Table(dsConnectionProvider, "interpretation", null, new String[]{"id"});
assertThat(table.getColumnsNameList()).as("Columns of INTERPRETATION table").hasSize(3)
.containsExactly("ID_MOVIE", "ID_ACTOR", "CHARACTER");
@@ -100,7 +101,7 @@ public void test_columns_name_to_exclude_with_datasource_set() {
*/
@Test(expected = AssertJDBException.class)
public void should_throw_AssertJDBException_because_SQLException_caused_by_table_not_found() {
- Table table = new Table(dataSource, "interpret");
+ Table table = new Table(dsConnectionProvider, "interpret");
table.getColumnsNameList();
}
}
diff --git a/src/test/java/org/assertj/db/type/Table_Columns_Test.java b/src/test/java/org/assertj/db/type/Table_Columns_Test.java
index bf2aea18..95e71389 100644
--- a/src/test/java/org/assertj/db/type/Table_Columns_Test.java
+++ b/src/test/java/org/assertj/db/type/Table_Columns_Test.java
@@ -25,15 +25,16 @@
*
*
* @author Régis Pouiller
+ * @author Julien Roy
*/
public class Table_Columns_Test extends AbstractTest {
/**
- * This method test the columns got from a {@code Source}.
+ * This method test the columns got from a {@code ConnectionProvider}.
*/
@Test
- public void test_columns_with_source_set() {
- Table table = new Table(source, "movie");
+ public void test_columns_with_jdbc_set() {
+ Table table = new Table(jdbcConnectionProvider, "movie");
Column columnFromIndex = table.getColumn(1);
@@ -49,7 +50,7 @@ public void test_columns_with_source_set() {
*/
@Test
public void test_columns_with_datasource_set() {
- Table table = new Table(dataSource, "movie");
+ Table table = new Table(dsConnectionProvider, "movie");
Column columnFromIndex = table.getColumn(1);
@@ -65,7 +66,7 @@ public void test_columns_with_datasource_set() {
*/
@Test
public void test_columns_to_check() {
- Table table = new Table(source, "movie");
+ Table table = new Table(jdbcConnectionProvider, "movie");
assertThat(table.getColumnsToCheck()).isNull();
@@ -80,7 +81,7 @@ public void test_columns_to_check() {
*/
@Test
public void test_columns_to_exclude() {
- Table table = new Table(source, "movie");
+ Table table = new Table(jdbcConnectionProvider, "movie");
assertThat(table.getColumnsToExclude()).isNull();
@@ -95,7 +96,7 @@ public void test_columns_to_exclude() {
*/
@Test
public void test_columns_to_order() {
- Table table = new Table(source, "movie");
+ Table table = new Table(jdbcConnectionProvider, "movie");
assertThat(table.getColumnsToOrder()).isNull();
diff --git a/src/test/java/org/assertj/db/type/Table_Exception_Test.java b/src/test/java/org/assertj/db/type/Table_Exception_Test.java
index 1aa2364b..31f8fb15 100644
--- a/src/test/java/org/assertj/db/type/Table_Exception_Test.java
+++ b/src/test/java/org/assertj/db/type/Table_Exception_Test.java
@@ -34,23 +34,16 @@
* Test on loading of the data for a table and exception during the different steps.
*
* @author Régis Pouiller
+ * @author Julien Roy
*/
public class Table_Exception_Test extends AbstractTest {
/**
- * This method should fail because setting the datasource to null.
+ * This method should fail because setting the connection provider to null.
*/
@Test(expected = NullPointerException.class)
- public void should_fail_because_setting_datasource_to_null() {
- new Table().setDataSource(null);
- }
-
- /**
- * This method should fail because setting the source to null.
- */
- @Test(expected = NullPointerException.class)
- public void should_fail_because_setting_source_to_null() {
- new Table().setSource(null);
+ public void should_fail_because_setting_connection_provider_to_null() {
+ new Table().setConnectionProvider(null);
}
/**
@@ -59,7 +52,8 @@ public void should_fail_because_setting_source_to_null() {
@Test(expected = AssertJDBException.class)
public void should_fail_because_connection_throws_exception_when_getting_an_object() {
DataSource ds = new DefaultDataSource(dataSource);
- Table table = new Table(ds, "movi");
+ ConnectionProvider connectionProvider = ConnectionProviderFactory.of(ds).create();
+ Table table = new Table(connectionProvider, "movi");
table.getColumnsNameList();
}
@@ -72,7 +66,7 @@ public void should_fail_because_trying_to_set_columns_to_check_first() {
new Table().setColumnsToCheck(new String[]{"test"});
fail("An exception must be raised");
} catch (AssertJDBException e) {
- Assertions.assertThat(e.getMessage()).isEqualTo(String.format("The table name and the source or datasource must be set first"));
+ Assertions.assertThat(e.getMessage()).isEqualTo("The table name and the connectionProvider must be set first");
}
}
@@ -85,7 +79,7 @@ public void should_fail_because_trying_to_set_columns_to_exclude_first() {
new Table().setColumnsToExclude(new String[]{"test"});
fail("An exception must be raised");
} catch (AssertJDBException e) {
- Assertions.assertThat(e.getMessage()).isEqualTo(String.format("The table name and the source or datasource must be set first"));
+ Assertions.assertThat(e.getMessage()).isEqualTo("The table name and the connectionProvider must be set first");
}
}
@@ -98,7 +92,7 @@ public void should_fail_because_trying_to_set_columns_order_first() {
new Table().setColumnsToOrder(new Order[]{Order.asc("test")});
fail("An exception must be raised");
} catch (AssertJDBException e) {
- Assertions.assertThat(e.getMessage()).isEqualTo(String.format("The table name and the source or datasource must be set first"));
+ Assertions.assertThat(e.getMessage()).isEqualTo("The table name and the connectionProvider must be set first");
}
}
@@ -108,10 +102,10 @@ public void should_fail_because_trying_to_set_columns_order_first() {
@Test
public void should_fail_because_trying_to_set_columns_order_with_order_null() {
try {
- new Table(source, "test").setColumnsToOrder(new Order[]{null});
+ new Table(jdbcConnectionProvider, "test").setColumnsToOrder(new Order[]{null});
fail("An exception must be raised");
} catch (NullPointerException e) {
- Assertions.assertThat(e.getMessage()).isEqualTo(String.format("The order can not be null"));
+ Assertions.assertThat(e.getMessage()).isEqualTo("The order can not be null");
}
}
@@ -121,10 +115,10 @@ public void should_fail_because_trying_to_set_columns_order_with_order_null() {
@Test
public void should_fail_because_trying_to_set_columns_order_with_column_null() {
try {
- new Table(source, "test").setColumnsToOrder(new Order[]{Order.asc(null)});
+ new Table(jdbcConnectionProvider, "test").setColumnsToOrder(new Order[]{Order.asc(null)});
fail("An exception must be raised");
} catch (NullPointerException e) {
- Assertions.assertThat(e.getMessage()).isEqualTo(String.format("The name of the column for order can not be null"));
+ Assertions.assertThat(e.getMessage()).isEqualTo("The name of the column for order can not be null");
}
}
@@ -151,7 +145,8 @@ public ResultSet executeQuery(String sql) throws SQLException {
};
}
};
- Table table = new Table(ds, "movi");
+ ConnectionProvider connectionProvider = ConnectionProviderFactory.of(ds).create();
+ Table table = new Table(connectionProvider, "movi");
table.getColumnsNameList();
}
@@ -172,7 +167,8 @@ public DatabaseMetaData getMetaData() throws SQLException {
};
}
};
- Table table = new Table(ds, "movi");
+ ConnectionProvider connectionProvider = ConnectionProviderFactory.of(ds).create();
+ Table table = new Table(connectionProvider, "movi");
table.getColumnsNameList();
}
@@ -193,7 +189,8 @@ public Statement createStatement() throws SQLException {
};
}
};
- Table table = new Table(ds, "movi");
+ ConnectionProvider connectionProvider = ConnectionProviderFactory.of(ds).create();
+ Table table = new Table(connectionProvider, "movi");
table.getColumnsNameList();
}
@@ -208,7 +205,8 @@ public Connection getConnection() throws SQLException {
throw new SQLException();
}
};
- Table table = new Table(ds, "movi");
+ ConnectionProvider connectionProvider = ConnectionProviderFactory.of(ds).create();
+ Table table = new Table(connectionProvider, "movi");
table.getColumnsNameList();
}
}
diff --git a/src/test/java/org/assertj/db/type/Table_GetRowFromPksValues_Test.java b/src/test/java/org/assertj/db/type/Table_GetRowFromPksValues_Test.java
index 07c2ca09..891b862c 100644
--- a/src/test/java/org/assertj/db/type/Table_GetRowFromPksValues_Test.java
+++ b/src/test/java/org/assertj/db/type/Table_GetRowFromPksValues_Test.java
@@ -24,6 +24,7 @@
* Tests on getting a {@code Row} in a {@code Table} from primary keys values.
*
* @author Régis Pouiller
+ * @author Julien Roy
*/
public class Table_GetRowFromPksValues_Test extends AbstractTest {
@@ -32,7 +33,7 @@ public class Table_GetRowFromPksValues_Test extends AbstractTest {
*/
@Test
public void test_getting_row_from_primary_keys_values_without_finding() throws Exception {
- Table table = new Table(source, "movie");
+ Table table = new Table(jdbcConnectionProvider, "movie");
assertThat(table.getRowFromPksValues()).isNull();
assertThat(table.getRowFromPksValues(getValue(null, 1L), getValue(null, 3))).isNull();
@@ -43,7 +44,7 @@ public void test_getting_row_from_primary_keys_values_without_finding() throws E
*/
@Test
public void test_getting_row_from_primary_keys_values_with_finding() throws Exception {
- Table table = new Table(source, "movie");
+ Table table = new Table(jdbcConnectionProvider, "movie");
assertThat(table.getRowFromPksValues(getValue(null, 3)).getValuesList().get(0).getValue()).isEqualTo(new BigDecimal(3));
assertThat(table.getRowFromPksValues(getValue(null, 3)).getValuesList().get(1).getValue()).isEqualTo("Avatar");
diff --git a/src/test/java/org/assertj/db/type/Table_Getters_Test.java b/src/test/java/org/assertj/db/type/Table_Getters_Test.java
index 770b6c76..575b6ab6 100644
--- a/src/test/java/org/assertj/db/type/Table_Getters_Test.java
+++ b/src/test/java/org/assertj/db/type/Table_Getters_Test.java
@@ -26,18 +26,18 @@
*
*
* @author Régis Pouiller
+ * @author Julien Roy
*/
public class Table_Getters_Test extends AbstractTest {
/**
- * This method test the getters of a {@code Table} when only the source is set.
+ * This method test the getters of a {@code Table} when only the connection provider is set.
*/
@Test
- public void test_getters_with_only_source_set() {
- Table table = new Table().setSource(source);
+ public void test_getters_with_only_connection_provider_set() {
+ Table table = new Table().setConnectionProvider(jdbcConnectionProvider);
- assertThat(table.getSource()).as("Source of MOVIE table").isSameAs(source);
- assertThat(table.getDataSource()).isNull();
+ assertThat(table.getConnectionProvider()).as("Source of MOVIE table").isSameAs(jdbcConnectionProvider);
assertThat(table.getName()).isNull();
assertThat(table.getColumnsToCheck()).isNull();
assertThat(table.getColumnsToExclude()).isNull();
@@ -46,62 +46,13 @@ public void test_getters_with_only_source_set() {
}
/**
- * This method test the getters of a {@code Table} when only the datasource is set.
+ * This method test the getters of a {@code Table} when the connection provider and the name are set.
*/
@Test
- public void test_getters_with_only_datasource_set() {
- Table table = new Table().setDataSource(dataSource);
+ public void test_getters_with_connection_provider_and_name_set() {
+ Table table = new Table(jdbcConnectionProvider, "movie");
- assertThat(table.getSource()).isNull();
- assertThat(table.getDataSource()).as("DataSource of MOVIE table").isSameAs(dataSource);
- assertThat(table.getName()).isNull();
- assertThat(table.getColumnsToCheck()).isNull();
- assertThat(table.getColumnsToExclude()).isNull();
- assertThat(table.getStartDelimiter()).isNull();
- assertThat(table.getEndDelimiter()).isNull();
- }
-
- /**
- * This method test the getters of a {@code Table} when only the source is set after the datasource was set.
- */
- @Test
- public void test_getters_with_only_datasource_set_and_after_only_source_set() {
- Table table = new Table().setDataSource(dataSource).setSource(source);
-
- assertThat(table.getSource()).as("Source of MOVIE table").isSameAs(source);
- assertThat(table.getDataSource()).isNull();
- assertThat(table.getName()).isNull();
- assertThat(table.getColumnsToCheck()).isNull();
- assertThat(table.getColumnsToExclude()).isNull();
- assertThat(table.getStartDelimiter()).isNull();
- assertThat(table.getEndDelimiter()).isNull();
- }
-
- /**
- * This method test the getters of a {@code Table} when only the datasource is set after the source was set.
- */
- @Test
- public void test_getters_with_only_source_set_and_after_only_datasource_set() {
- Table table = new Table().setSource(source).setDataSource(dataSource);
-
- assertThat(table.getSource()).isNull();
- assertThat(table.getDataSource()).as("DataSource of MOVIE table").isSameAs(dataSource);
- assertThat(table.getName()).isNull();
- assertThat(table.getColumnsToCheck()).isNull();
- assertThat(table.getColumnsToExclude()).isNull();
- assertThat(table.getStartDelimiter()).isNull();
- assertThat(table.getEndDelimiter()).isNull();
- }
-
- /**
- * This method test the getters of a {@code Table} when the source and the name are set.
- */
- @Test
- public void test_getters_with_source_and_name_set() {
- Table table = new Table(source, "movie");
-
- assertThat(table.getSource()).as("Source of MOVIE table").isSameAs(source);
- assertThat(table.getDataSource()).isNull();
+ assertThat(table.getConnectionProvider()).as("Source of MOVIE table").isSameAs(jdbcConnectionProvider);
assertThat(table.getName()).isEqualTo("MOVIE");
assertThat(table.getColumnsToCheck()).isNull();
assertThat(table.getColumnsToExclude()).isNull();
@@ -111,15 +62,14 @@ public void test_getters_with_source_and_name_set() {
}
/**
- * This method test the getters of a {@code Table} when the source, the name and the information about the columns
+ * This method test the getters of a {@code Table} when the connection provider, the name and the information about the columns
* are set.
*/
@Test
- public void test_getters_with_source_name_and_columns_set() {
- Table table = new Table(source, "movie", new String[]{"title", "year"}, new String[]{"id"});
+ public void test_getters_with_connection_provider_name_and_columns_set() {
+ Table table = new Table(jdbcConnectionProvider, "movie", new String[]{"title", "year"}, new String[]{"id"});
- assertThat(table.getSource()).as("Source of MOVIE table").isSameAs(source);
- assertThat(table.getDataSource()).isNull();
+ assertThat(table.getConnectionProvider()).as("Source of MOVIE table").isSameAs(jdbcConnectionProvider);
assertThat(table.getName()).isEqualTo("MOVIE");
assertThat(table.getColumnsToCheck()).containsExactly("TITLE", "YEAR");
assertThat(table.getColumnsToExclude()).containsExactly("ID");
@@ -129,17 +79,16 @@ public void test_getters_with_source_name_and_columns_set() {
}
/**
- * This method test the getters of a {@code Table} when the source, the name and the information about the columns
+ * This method test the getters of a {@code Table} when the connection provider, the name and the information about the columns
* and the orders are set.
*/
@Test
- public void test_getters_with_source_name_columns_and_order_set() {
- Table table = new Table(source, "movie",
+ public void test_getters_with_connection_provider_name_columns_and_order_set() {
+ Table table = new Table(jdbcConnectionProvider, "movie",
new Table.Order[]{asc("title"), desc("year")},
new String[]{"title", "year"}, new String[]{"id"});
- assertThat(table.getSource()).as("Source of MOVIE table").isSameAs(source);
- assertThat(table.getDataSource()).isNull();
+ assertThat(table.getConnectionProvider()).as("Source of MOVIE table").isSameAs(jdbcConnectionProvider);
assertThat(table.getName()).isEqualTo("MOVIE");
assertThat(table.getColumnsToCheck()).containsExactly("TITLE", "YEAR");
assertThat(table.getColumnsToExclude()).containsExactly("ID");
@@ -150,16 +99,15 @@ public void test_getters_with_source_name_columns_and_order_set() {
}
/**
- * This method test the getters of a {@code Table} when the source, the name and the information about the orders
+ * This method test the getters of a {@code Table} when the connection provider, the name and the information about the orders
* are set.
*/
@Test
- public void test_getters_with_source_name_and_order_set() {
- Table table = new Table(source, "movie",
+ public void test_getters_with_connection_provider_name_and_order_set() {
+ Table table = new Table(jdbcConnectionProvider, "movie",
new Table.Order[]{asc("title"), desc("year")});
- assertThat(table.getSource()).as("Source of MOVIE table").isSameAs(source);
- assertThat(table.getDataSource()).isNull();
+ assertThat(table.getConnectionProvider()).as("Source of MOVIE table").isSameAs(jdbcConnectionProvider);
assertThat(table.getName()).isEqualTo("MOVIE");
assertThat(table.getColumnsToCheck()).isNull();
assertThat(table.getColumnsToExclude()).isNull();
@@ -170,14 +118,13 @@ public void test_getters_with_source_name_and_order_set() {
}
/**
- * This method test the getters of a {@code Table} when the source, delimiteres and the name are set.
+ * This method test the getters of a {@code Table} when the connection provider, delimiters and the name are set.
*/
@Test
- public void test_getters_with_source_delimiters_and_name_set() {
- Table table = new Table(source, "movie", '1', '2');
+ public void test_getters_with_connection_provider_delimiters_and_name_set() {
+ Table table = new Table(jdbcConnectionProvider, "movie", '1', '2');
- assertThat(table.getSource()).as("Source of MOVIE table").isSameAs(source);
- assertThat(table.getDataSource()).isNull();
+ assertThat(table.getConnectionProvider()).as("Source of MOVIE table").isSameAs(jdbcConnectionProvider);
assertThat(table.getName()).isEqualTo("MOVIE");
assertThat(table.getColumnsToCheck()).isNull();
assertThat(table.getColumnsToExclude()).isNull();
@@ -187,16 +134,15 @@ public void test_getters_with_source_delimiters_and_name_set() {
}
/**
- * This method test the getters of a {@code Table} when the source, the name, the delimiters
+ * This method test the getters of a {@code Table} when the connection provider, the name, the delimiters
* and the information about the columns are set.
*/
@Test
- public void test_getters_with_source_name_delimiters_and_columns_set() {
- Table table = new Table(source, "movie", '1', '2',
+ public void test_getters_with_connection_provider_name_delimiters_and_columns_set() {
+ Table table = new Table(jdbcConnectionProvider, "movie", '1', '2',
new String[]{"title", "year"}, new String[]{"id"});
- assertThat(table.getSource()).as("Source of MOVIE table").isSameAs(source);
- assertThat(table.getDataSource()).isNull();
+ assertThat(table.getConnectionProvider()).as("Source of MOVIE table").isSameAs(jdbcConnectionProvider);
assertThat(table.getName()).isEqualTo("MOVIE");
assertThat(table.getColumnsToCheck()).containsExactly("TITLE", "YEAR");
assertThat(table.getColumnsToExclude()).containsExactly("ID");
@@ -206,17 +152,16 @@ public void test_getters_with_source_name_delimiters_and_columns_set() {
}
/**
- * This method test the getters of a {@code Table} when the source, the name, the delimiters
+ * This method test the getters of a {@code Table} when the connection provider, the name, the delimiters
* and the information about the columns and the orders are set.
*/
@Test
- public void test_getters_with_source_name_columns_delimiters_and_order_set() {
- Table table = new Table(source, "movie", '1', '2',
+ public void test_getters_with_connection_provider_name_columns_delimiters_and_order_set() {
+ Table table = new Table(jdbcConnectionProvider, "movie", '1', '2',
new Table.Order[]{asc("title"), desc("year")},
new String[]{"title", "year"}, new String[]{"id"});
- assertThat(table.getSource()).as("Source of MOVIE table").isSameAs(source);
- assertThat(table.getDataSource()).isNull();
+ assertThat(table.getConnectionProvider()).as("Source of MOVIE table").isSameAs(jdbcConnectionProvider);
assertThat(table.getName()).isEqualTo("MOVIE");
assertThat(table.getColumnsToCheck()).containsExactly("TITLE", "YEAR");
assertThat(table.getColumnsToExclude()).containsExactly("ID");
@@ -227,16 +172,15 @@ public void test_getters_with_source_name_columns_delimiters_and_order_set() {
}
/**
- * This method test the getters of a {@code Table} when the source, the name, the delimiters
+ * This method test the getters of a {@code Table} when the connection provider, the name, the delimiters
* and the information about the orders are set.
*/
@Test
- public void test_getters_with_source_name_delimiters_and_order_set() {
- Table table = new Table(source, "movie", '1', '2',
+ public void test_getters_with_connection_provider_name_delimiters_and_order_set() {
+ Table table = new Table(jdbcConnectionProvider, "movie", '1', '2',
new Table.Order[]{asc("title"), desc("year")});
- assertThat(table.getSource()).as("Source of MOVIE table").isSameAs(source);
- assertThat(table.getDataSource()).isNull();
+ assertThat(table.getConnectionProvider()).as("Source of MOVIE table").isSameAs(jdbcConnectionProvider);
assertThat(table.getName()).isEqualTo("MOVIE");
assertThat(table.getColumnsToCheck()).isNull();
assertThat(table.getColumnsToExclude()).isNull();
diff --git a/src/test/java/org/assertj/db/type/Table_Instantiation_Test.java b/src/test/java/org/assertj/db/type/Table_Instantiation_Test.java
index eb61d305..b356b3d8 100644
--- a/src/test/java/org/assertj/db/type/Table_Instantiation_Test.java
+++ b/src/test/java/org/assertj/db/type/Table_Instantiation_Test.java
@@ -12,8 +12,6 @@
*/
package org.assertj.db.type;
-import javax.sql.DataSource;
-
import org.assertj.db.common.AbstractTest;
import org.assertj.db.exception.AssertJDBException;
import org.junit.Test;
@@ -25,34 +23,26 @@
*
*
* @author Régis Pouiller
+ * @author Julien Roy
*/
public class Table_Instantiation_Test extends AbstractTest {
/**
- * This method should throw a {@code NullPointerException}, because the {@code Source} parameter is
- * {@code null}.
- */
- @Test(expected = NullPointerException.class)
- public void should_throw_NullPointerException_if_instantiate_with_Source_null() {
- new Table((Source) null, null);
- }
-
- /**
- * This method should throw a {@code NullPointerException}, because the {@code DataSource} parameter is
+ * This method should throw a {@code NullPointerException}, because the {@code ConnectionProvider} parameter is
* {@code null}.
*/
@Test(expected = NullPointerException.class)
- public void should_throw_NullPointerException_if_instantiate_with_DataSource_null() {
- new Table((DataSource) null, null);
+ public void should_throw_NullPointerException_if_instantiate_with_connection_provider_null() {
+ new Table(null, null);
}
/**
- * This method should throw a {@code NullPointerException}, because the {@code Source} parameter is not
+ * This method should throw a {@code NullPointerException}, because the {@code ConnectionProvider} parameter is not
* {@code null} and table name is {@code null}.
*/
@Test(expected = NullPointerException.class)
- public void should_throw_NullPointerException_if_instantiate_with_Source_not_null_and_table_name_null() {
- new Table(source, null);
+ public void should_throw_NullPointerException_if_instantiate_with_jdbc_connection_provider_not_null_and_table_name_null() {
+ new Table(jdbcConnectionProvider, null);
}
/**
@@ -60,26 +50,26 @@ public void should_throw_NullPointerException_if_instantiate_with_Source_not_nul
* {@code null} and table name is {@code null}.
*/
@Test(expected = NullPointerException.class)
- public void should_throw_NullPointerException_if_instantiate_with_DataSource_not_null_and_table_name_null() {
- new Table(dataSource, null);
+ public void should_throw_NullPointerException_if_instantiate_with_ds_connection_provider_not_null_and_table_name_null() {
+ new Table(dsConnectionProvider, null);
}
/**
* This method should throw a {@code NullPointerException}, because the {@code DataSource} and the
- * {@code Source} fields are not set when call {@code getColumnsNameList()}.
+ * {@code ConnectionProvider} fields are not set when call {@code getColumnsNameList()}.
*/
@Test(expected = NullPointerException.class)
- public void should_throw_NullPointerException_if_get_list_of_columns_name_without_setting_source_or_datasource() {
+ public void should_throw_NullPointerException_if_get_list_of_columns_name_without_setting_connection_provider_or_datasource() {
new Table().getColumnsNameList();
}
/**
- * This method should throw a {@code NullPointerException}, because the {@code Source} field is set but not
+ * This method should throw a {@code NullPointerException}, because the {@code ConnectionProvider} field is set but not
* the table name when call {@code getColumnsNameList()}.
*/
@Test(expected = NullPointerException.class)
- public void should_throw_NullPointerException_if_get_list_of_columns_name_with_setting_source_and_without_setting_table_name() {
- new Table().setSource(source).getColumnsNameList();
+ public void should_throw_NullPointerException_if_get_list_of_columns_name_with_setting_connection_provider_and_without_setting_table_name() {
+ new Table().setConnectionProvider(jdbcConnectionProvider).getColumnsNameList();
}
/**
@@ -88,16 +78,16 @@ public void should_throw_NullPointerException_if_get_list_of_columns_name_with_s
*/
@Test(expected = NullPointerException.class)
public void should_throw_NullPointerException_if_get_list_of_columns_name_with_setting_datasource_and_without_setting_table_name() {
- new Table().setDataSource(dataSource).getColumnsNameList();
+ new Table().setConnectionProvider(dsConnectionProvider).getColumnsNameList();
}
/**
- * This method should throw a {@code NullPointerException}, because the {@code Source} field is set but not
+ * This method should throw a {@code NullPointerException}, because the {@code ConnectionProvider} field is set but not
* the table name when call {@code getRequest()}.
*/
@Test(expected = NullPointerException.class)
- public void should_throw_NullPointerException_if_get_request_with_setting_source_and_without_setting_table_name() {
- new Table().setSource(source).getRequest();
+ public void should_throw_NullPointerException_if_get_request_with_setting_jdbc_connection_and_without_setting_table_name() {
+ new Table().setConnectionProvider(jdbcConnectionProvider).getRequest();
}
/**
@@ -106,16 +96,16 @@ public void should_throw_NullPointerException_if_get_request_with_setting_source
*/
@Test(expected = NullPointerException.class)
public void should_throw_NullPointerException_if_get_request_with_setting_datasource_and_without_setting_table_name() {
- new Table().setDataSource(dataSource).getRequest();
+ new Table().setConnectionProvider(dsConnectionProvider).getRequest();
}
/**
- * This method should throw a {@code AssertJDBException}, because the {@code Source} field is set but not
- * all the information of the {@code Source}.
+ * This method should throw a {@code AssertJDBException}, because the {@code ConnectionProvider} field is set but not
+ * all the information of the {@code ConnectionProvider}.
*/
@Test(expected = AssertJDBException.class)
- public void should_throw_AssertJDBException_if_get_list_of_rows_with_setting_source_having_bad_user() {
- Table table = new Table(new Source(source.getUrl(), "", ""), "");
+ public void should_throw_AssertJDBException_if_get_list_of_rows_with_setting_connection_provider_having_bad_user() {
+ Table table = new Table(ConnectionProviderFactory.of("jdbc:h2:mem:test", "", "").create(), "");
table.getRowsList();
}
@@ -124,7 +114,7 @@ public void should_throw_AssertJDBException_if_get_list_of_rows_with_setting_sou
*/
@Test(expected = NullPointerException.class)
public void should_throw_NullPointerException_if_one_of_the_columns_to_check_is_null() {
- new Table(source, "movie", new String[]{"id", null, "birth"}, null);
+ new Table(jdbcConnectionProvider, "movie", new String[]{"id", null, "birth"}, null);
}
/**
@@ -132,6 +122,6 @@ public void should_throw_NullPointerException_if_one_of_the_columns_to_check_is_
*/
@Test(expected = NullPointerException.class)
public void should_throw_NullPointerException_if_one_of_the_columns_to_exclude_is_null() {
- new Table(source, "movie", new String[]{"id", "name", "birth"}, new String[]{null});
+ new Table(jdbcConnectionProvider, "movie", new String[]{"id", "name", "birth"}, new String[]{null});
}
}
diff --git a/src/test/java/org/assertj/db/type/Table_PrimaryKeys_Name_Test.java b/src/test/java/org/assertj/db/type/Table_PrimaryKeys_Name_Test.java
index 548cf787..d093d9d9 100644
--- a/src/test/java/org/assertj/db/type/Table_PrimaryKeys_Name_Test.java
+++ b/src/test/java/org/assertj/db/type/Table_PrimaryKeys_Name_Test.java
@@ -25,15 +25,16 @@
*
*
* @author Régis Pouiller
+ * @author Julien Roy
*/
public class Table_PrimaryKeys_Name_Test extends AbstractTest {
/**
- * This method test the primary keys got from a {@code Source}.
+ * This method test the primary keys got from a {@code ConnectionProvider}.
*/
@Test
- public void test_pks_name_with_source_set() {
- Table table = new Table(source, "movie");
+ public void test_pks_name_with_jdbc_set() {
+ Table table = new Table(jdbcConnectionProvider, "movie");
assertThat(table.getPksNameList()).as("Primary Keys of MOVIE table").hasSize(1)
.containsExactly("ID");
@@ -44,18 +45,18 @@ public void test_pks_name_with_source_set() {
*/
@Test
public void test_pks_name_with_datasource_set() {
- Table table = new Table(dataSource, "movie");
+ Table table = new Table(dsConnectionProvider, "movie");
assertThat(table.getPksNameList()).as("Primary Keys of MOVIE table").hasSize(1)
.containsExactly("ID");
}
/**
- * This method test the primary keys got from a {@code Source} when the columns to check are set.
+ * This method test the primary keys got from a {@code ConnectionProvider} when the columns to check are set.
*/
@Test
- public void test_pks_name_to_check_with_source_set() {
- Table table = new Table(source, "actor", new String[]{"id", "name", "birth"}, null);
+ public void test_pks_name_to_check_with_jdbc_set() {
+ Table table = new Table(jdbcConnectionProvider, "actor", new String[]{"id", "name", "birth"}, null);
assertThat(table.getPksNameList()).as("Primary Keys of ACTOR table").hasSize(1)
.containsExactly("ID");
@@ -66,18 +67,18 @@ public void test_pks_name_to_check_with_source_set() {
*/
@Test
public void test_pks_name_to_check_with_datasource_set() {
- Table table = new Table(dataSource, "actor", new String[]{"id", "name", "birth"}, null);
+ Table table = new Table(dsConnectionProvider, "actor", new String[]{"id", "name", "birth"}, null);
assertThat(table.getPksNameList()).as("Primary Keys of ACTOR table").hasSize(1)
.containsExactly("ID");
}
/**
- * This method test the primary keys got from a {@code Source} when the columns to exclude are set.
+ * This method test the primary keys got from a {@code ConnectionProvider} when the columns to exclude are set.
*/
@Test
- public void test_pks_name_to_exclude_with_source_set() {
- Table table = new Table(source, "interpretation", null, new String[]{"ID"});
+ public void test_pks_name_to_exclude_with_jdbc_set() {
+ Table table = new Table(jdbcConnectionProvider, "interpretation", null, new String[]{"ID"});
assertThat(table.getPksNameList()).as("Primary Keys of INTERPRETATION table").hasSize(0);
}
@@ -87,7 +88,7 @@ public void test_pks_name_to_exclude_with_source_set() {
*/
@Test
public void test_pks_name_to_exclude_with_datasource_set() {
- Table table = new Table(dataSource, "interpretation", null, new String[]{"id"});
+ Table table = new Table(dsConnectionProvider, "interpretation", null, new String[]{"id"});
assertThat(table.getPksNameList()).as("Primary Keys of INTERPRETATION table").hasSize(0);
}
@@ -98,7 +99,7 @@ public void test_pks_name_to_exclude_with_datasource_set() {
*/
@Test(expected = AssertJDBException.class)
public void should_throw_AssertJDBException_because_SQLException_caused_by_table_not_found() {
- Table table = new Table(dataSource, "interpret");
+ Table table = new Table(dsConnectionProvider, "interpret");
table.getPksNameList();
}
diff --git a/src/test/java/org/assertj/db/type/Table_Rows_Test.java b/src/test/java/org/assertj/db/type/Table_Rows_Test.java
index b38f2193..1b8f8f0a 100644
--- a/src/test/java/org/assertj/db/type/Table_Rows_Test.java
+++ b/src/test/java/org/assertj/db/type/Table_Rows_Test.java
@@ -28,15 +28,16 @@
*
*
* @author Régis Pouiller
+ * @author Julien Roy
*/
public class Table_Rows_Test extends AbstractTest {
/**
- * This method test the rows got from a {@code Source}.
+ * This method test the rows got from a {@code ConnectionProvider}.
*/
@Test
- public void test_rows_with_source_set() {
- Table table = new Table(source, "movie");
+ public void test_rows_with_jdbc_set() {
+ Table table = new Table(jdbcConnectionProvider, "movie");
assertThat(table.getRowsList()).as("Values of MOVIE table").hasSize(3);
@@ -73,7 +74,7 @@ public void test_rows_with_source_set() {
*/
@Test
public void test_rows_with_datasource_set() {
- Table table = new Table(dataSource, "movie");
+ Table table = new Table(dsConnectionProvider, "movie");
assertThat(table.getRowsList()).as("Values of MOVIE table").hasSize(3);
@@ -107,7 +108,7 @@ public void test_rows_with_datasource_set() {
*/
@Test
public void test_rows_with_datasource_and_order_set() {
- Table table = new Table(dataSource, "movie", new Table.Order[]{asc("title")});
+ Table table = new Table(dsConnectionProvider, "movie", new Table.Order[]{asc("title")});
assertThat(table.getRowsList()).as("Values of MOVIE table").hasSize(3);
@@ -141,7 +142,7 @@ public void test_rows_with_datasource_and_order_set() {
*/
@Test(expected = NullPointerException.class)
public void should_throw_NullPointerException_because_column_name_parameter_is_null_when_calling_getColumnValue() {
- Table table = new Table(source, "movie");
+ Table table = new Table(jdbcConnectionProvider, "movie");
table.getRow(0).getColumnValue(null);
}
@@ -150,7 +151,7 @@ public void should_throw_NullPointerException_because_column_name_parameter_is_n
*/
@Test
public void test_that_we_get_null_when_calling_getColumnValue_and_the_column_name_dont_exist() {
- Table table = new Table(source, "movie");
+ Table table = new Table(jdbcConnectionProvider, "movie");
assertThat(table.getRow(0).getColumnValue("not_exist")).isNull();
}
diff --git a/src/test/java/org/assertj/db/util/Descriptions_GetDescription_Test.java b/src/test/java/org/assertj/db/util/Descriptions_GetDescription_Test.java
index 33afcb1a..3663334a 100644
--- a/src/test/java/org/assertj/db/util/Descriptions_GetDescription_Test.java
+++ b/src/test/java/org/assertj/db/util/Descriptions_GetDescription_Test.java
@@ -26,6 +26,7 @@
* Tests on {@code getDescription} method from utility class {@code Descriptions}.
*
* @author Régis Pouiller
+ * @author Julien Roy
*/
public class Descriptions_GetDescription_Test extends AbstractTest {
@@ -34,8 +35,8 @@ public class Descriptions_GetDescription_Test extends AbstractTest {
*/
@Test
public void test_get_description_for_table() {
- Table fromSource = new Table(source, "actor");
- Table fromDataSource = new Table(dataSource, "actor");
+ Table fromSource = new Table(jdbcConnectionProvider, "actor");
+ Table fromDataSource = new Table(dsConnectionProvider, "actor");
String descriptionFromSource = Descriptions.getDescription(fromSource);
String descriptionFromDataSource = Descriptions.getDescription(fromDataSource);
@@ -49,10 +50,10 @@ public void test_get_description_for_table() {
*/
@Test
public void test_get_description_for_request() {
- Request fromSource = new Request(source, "select * from actor");
- Request fromDataSource = new Request(dataSource, "select * from actor");
- Request fromSourceLong = new Request(source, "select id, name, firstname, birth, actor_imdb from actor");
- Request fromDataSourceLong = new Request(dataSource, "select id, name, firstname, birth, actor_imdb from actor");
+ Request fromSource = new Request(jdbcConnectionProvider, "select * from actor");
+ Request fromDataSource = new Request(dsConnectionProvider, "select * from actor");
+ Request fromSourceLong = new Request(jdbcConnectionProvider, "select id, name, firstname, birth, actor_imdb from actor");
+ Request fromDataSourceLong = new Request(dsConnectionProvider, "select id, name, firstname, birth, actor_imdb from actor");
String descriptionFromSource = Descriptions.getDescription(fromSource);
String descriptionFromDataSource = Descriptions.getDescription(fromDataSource);
@@ -71,8 +72,8 @@ public void test_get_description_for_request() {
@Test
@NeedReload
public void test_get_description_for_changes() {
- org.assertj.db.type.Changes fromSource = new org.assertj.db.type.Changes(source).setStartPointNow();
- org.assertj.db.type.Changes fromDataSource = new org.assertj.db.type.Changes(dataSource).setStartPointNow();
+ org.assertj.db.type.Changes fromSource = new org.assertj.db.type.Changes(jdbcConnectionProvider).setStartPointNow();
+ org.assertj.db.type.Changes fromDataSource = new org.assertj.db.type.Changes(dsConnectionProvider).setStartPointNow();
updateChangesForTests();
fromSource.setEndPointNow();
fromDataSource.setEndPointNow();
@@ -80,8 +81,8 @@ public void test_get_description_for_changes() {
String descriptionFromSource = Descriptions.getDescription(fromSource);
String descriptionFromDataSource = Descriptions.getDescription(fromDataSource);
- assertThat(descriptionFromSource).isEqualTo("Changes on tables of 'sa/jdbc:h2:mem:test' source");
- assertThat(descriptionFromDataSource).isEqualTo("Changes on tables of a data source");
+ assertThat(descriptionFromSource).isEqualTo("Changes on tables of 'sa/jdbc:h2:mem:test'");
+ assertThat(descriptionFromDataSource).isEqualTo("Changes on tables of 'data source'");
}
/**
@@ -90,9 +91,9 @@ public void test_get_description_for_changes() {
@Test
@NeedReload
public void test_get_description_for_changes_from_table() {
- org.assertj.db.type.Changes fromSource = new org.assertj.db.type.Changes(new Table(source, "actor"))
+ org.assertj.db.type.Changes fromSource = new org.assertj.db.type.Changes(new Table(jdbcConnectionProvider, "actor"))
.setStartPointNow();
- org.assertj.db.type.Changes fromDataSource = new org.assertj.db.type.Changes(new Table(dataSource, "actor"))
+ org.assertj.db.type.Changes fromDataSource = new org.assertj.db.type.Changes(new Table(dsConnectionProvider, "actor"))
.setStartPointNow();
updateChangesForTests();
fromSource.setEndPointNow();
@@ -101,8 +102,8 @@ public void test_get_description_for_changes_from_table() {
String descriptionFromSource = Descriptions.getDescription(fromSource);
String descriptionFromDataSource = Descriptions.getDescription(fromDataSource);
- assertThat(descriptionFromSource).isEqualTo("Changes on ACTOR table of 'sa/jdbc:h2:mem:test' source");
- assertThat(descriptionFromDataSource).isEqualTo("Changes on ACTOR table of a data source");
+ assertThat(descriptionFromSource).isEqualTo("Changes on ACTOR table of 'sa/jdbc:h2:mem:test'");
+ assertThat(descriptionFromDataSource).isEqualTo("Changes on ACTOR table of 'data source'");
}
/**
@@ -111,14 +112,14 @@ public void test_get_description_for_changes_from_table() {
@Test
@NeedReload
public void test_get_description_for_changes_from_request() {
- org.assertj.db.type.Changes fromSource = new org.assertj.db.type.Changes(new Request(source, "select * from actor"))
+ org.assertj.db.type.Changes fromSource = new org.assertj.db.type.Changes(new Request(jdbcConnectionProvider, "select * from actor"))
.setStartPointNow();
org.assertj.db.type.Changes fromDataSource = new org.assertj.db.type.Changes(
- new Request(dataSource, "select * from actor")).setStartPointNow();
+ new Request(dsConnectionProvider, "select * from actor")).setStartPointNow();
org.assertj.db.type.Changes fromSourceLong = new org.assertj.db.type.Changes(
- new Request(source, "select id, name, firstname, birth, actor_imdb from actor")).setStartPointNow();
+ new Request(jdbcConnectionProvider, "select id, name, firstname, birth, actor_imdb from actor")).setStartPointNow();
org.assertj.db.type.Changes fromDataSourceLong = new org.assertj.db.type.Changes(
- new Request(dataSource, "select id, name, firstname, birth, actor_imdb from actor")).setStartPointNow();
+ new Request(dsConnectionProvider, "select id, name, firstname, birth, actor_imdb from actor")).setStartPointNow();
updateChangesForTests();
fromSource.setEndPointNow();
fromDataSource.setEndPointNow();
@@ -130,10 +131,10 @@ public void test_get_description_for_changes_from_request() {
String descriptionFromSourceLong = Descriptions.getDescription(fromSourceLong);
String descriptionFromDataSourceLong = Descriptions.getDescription(fromDataSourceLong);
- assertThat(descriptionFromSource).isEqualTo("Changes on 'select * from actor' request of 'sa/jdbc:h2:mem:test' source");
- assertThat(descriptionFromDataSource).isEqualTo("Changes on 'select * from actor' request of a data source");
- assertThat(descriptionFromSourceLong).isEqualTo("Changes on 'select id, name, firstname, bi...' request of 'sa/jdbc:h2:mem:test' source");
- assertThat(descriptionFromDataSourceLong).isEqualTo("Changes on 'select id, name, firstname, bi...' request of a data source");
+ assertThat(descriptionFromSource).isEqualTo("Changes on 'select * from actor' request of 'sa/jdbc:h2:mem:test'");
+ assertThat(descriptionFromDataSource).isEqualTo("Changes on 'select * from actor' request of 'data source'");
+ assertThat(descriptionFromSourceLong).isEqualTo("Changes on 'select id, name, firstname, bi...' request of 'sa/jdbc:h2:mem:test'");
+ assertThat(descriptionFromDataSourceLong).isEqualTo("Changes on 'select id, name, firstname, bi...' request of 'data source'");
}
/**
@@ -260,9 +261,9 @@ public void test_get_description_for_changes_from_changes() {
@Test
@NeedReload
public void test_get_description_for_change_from_changes_from_table() {
- org.assertj.db.type.Changes fromSource = new org.assertj.db.type.Changes(new Table(source, "actor"))
+ org.assertj.db.type.Changes fromSource = new org.assertj.db.type.Changes(new Table(jdbcConnectionProvider, "actor"))
.setStartPointNow();
- org.assertj.db.type.Changes fromDataSource = new org.assertj.db.type.Changes(new Table(dataSource, "actor"))
+ org.assertj.db.type.Changes fromDataSource = new org.assertj.db.type.Changes(new Table(dsConnectionProvider, "actor"))
.setStartPointNow();
updateChangesForTests();
fromSource.setEndPointNow();
@@ -296,14 +297,14 @@ public void test_get_description_for_change_from_changes_from_table() {
@Test
@NeedReload
public void test_get_description_for_change_from_changes_from_request() {
- org.assertj.db.type.Changes fromSource = new org.assertj.db.type.Changes(new Request(source, "select * from actor"))
+ org.assertj.db.type.Changes fromSource = new org.assertj.db.type.Changes(new Request(jdbcConnectionProvider, "select * from actor"))
.setStartPointNow();
org.assertj.db.type.Changes fromDataSource = new org.assertj.db.type.Changes(
- new Request(dataSource, "select * from actor")).setStartPointNow();
+ new Request(dsConnectionProvider, "select * from actor")).setStartPointNow();
org.assertj.db.type.Changes fromSourceLong = new org.assertj.db.type.Changes(
- new Request(source, "select id, name, firstname, birth, actor_imdb from actor")).setStartPointNow();
+ new Request(jdbcConnectionProvider, "select id, name, firstname, birth, actor_imdb from actor")).setStartPointNow();
org.assertj.db.type.Changes fromDataSourceLong = new org.assertj.db.type.Changes(
- new Request(dataSource, "select id, name, firstname, birth, actor_imdb from actor")).setStartPointNow();
+ new Request(dsConnectionProvider, "select id, name, firstname, birth, actor_imdb from actor")).setStartPointNow();
updateChangesForTests();
fromSource.setEndPointNow();
fromDataSource.setEndPointNow();
From 6d29d46b698abe464fa7155c990d350763b646bd Mon Sep 17 00:00:00 2001
From: Julien Roy
Date: Wed, 13 Nov 2024 10:19:16 +0100
Subject: [PATCH 2/2] Provide fluent API to build DbElement
---
pom.xml | 9 -
.../org/assertj/db/api/ErrorCollector.java | 10 +-
.../org/assertj/db/type/AbstractDbData.java | 24 +-
.../assertj/db/type/AbstractDbElement.java | 88 +----
.../assertj/db/type/AssertDbConnection.java | 81 ++++
...ry.java => AssertDbConnectionFactory.java} | 31 +-
.../java/org/assertj/db/type/Changes.java | 255 ++++++++++---
.../db/type/DataSourceConnectionProvider.java | 2 +-
.../db/type/JdbcUrlConnectionProvider.java | 2 +-
.../java/org/assertj/db/type/Request.java | 143 ++++---
.../org/assertj/db/type/SchemaMetadata.java | 25 +-
src/main/java/org/assertj/db/type/Table.java | 352 +++++++++---------
src/main/javadoc/hljs-theme.css | 4 +-
...Equality_HasValues_One_Character_Test.java | 6 +-
.../db/api/DefaultDescription_Test.java | 283 +++++++-------
.../org/assertj/db/api/Descriptable_Test.java | 2 +-
.../assertj/db/api/SoftAssertions_Test.java | 6 +-
.../AssertOnChangeType_IsCreation_Test.java | 8 +-
.../AssertOnChangeType_IsDeletion_Test.java | 8 +-
...ssertOnChangeType_IsModification_Test.java | 72 ++--
.../AssertOnChangeType_IsOfType_Test.java | 8 +-
.../AssertOnColumnClass_IsOfClass_Test.java | 12 +-
...mnContent_ContainsValues_Boolean_Test.java | 12 +-
...lumnContent_ContainsValues_Bytes_Test.java | 12 +-
...Content_ContainsValues_Character_Test.java | 12 +-
...ent_ContainsValues_DateTimeValue_Test.java | 12 +-
...Content_ContainsValues_DateValue_Test.java | 12 +-
...umnContent_ContainsValues_Number_Test.java | 12 +-
...umnContent_ContainsValues_String_Test.java | 14 +-
...olumnContent_HasValues_TimeValue_Test.java | 12 +-
...rtOnColumnContent_HasValues_UUID_Test.java | 12 +-
...ColumnEquality_HasValues_Boolean_Test.java | 12 +-
...OnColumnEquality_HasValues_Bytes_Test.java | 12 +-
...lumnEquality_HasValues_Character_Test.java | 12 +-
...Equality_HasValues_DateTimeValue_Test.java | 12 +-
...lumnEquality_HasValues_DateValue_Test.java | 12 +-
...nColumnEquality_HasValues_Number_Test.java | 12 +-
...nColumnEquality_HasValues_String_Test.java | 14 +-
...lumnEquality_HasValues_TimeValue_Test.java | 12 +-
...tOnColumnEquality_HasValues_UUID_Test.java | 12 +-
...AssertOnColumnName_HasColumnName_Test.java | 12 +-
...lumnNullity_HasOnlyNotNullValues_Test.java | 6 +-
...nColumnNullity_HasOnlyNullValues_Test.java | 6 +-
...geEquality_HasValues_One_Boolean_Test.java | 6 +-
...angeEquality_HasValues_One_Bytes_Test.java | 6 +-
...lity_HasValues_One_DateTimeValue_Test.java | 6 +-
...Equality_HasValues_One_DateValue_Test.java | 6 +-
...ngeEquality_HasValues_One_Number_Test.java | 6 +-
...ngeEquality_HasValues_One_String_Test.java | 6 +-
...Equality_HasValues_One_TimeValue_Test.java | 6 +-
...hangeEquality_HasValues_One_UUID_Test.java | 6 +-
...geEquality_HasValues_Two_Boolean_Test.java | 12 +-
...angeEquality_HasValues_Two_Bytes_Test.java | 6 +-
...Equality_HasValues_Two_Character_Test.java | 6 +-
...lity_HasValues_Two_DateTimeValue_Test.java | 6 +-
...Equality_HasValues_Two_DateValue_Test.java | 6 +-
...ngeEquality_HasValues_Two_Number_Test.java | 6 +-
...ngeEquality_HasValues_Two_String_Test.java | 6 +-
...Equality_HasValues_Two_TimeValue_Test.java | 6 +-
...hangeEquality_HasValues_Two_UUID_Test.java | 6 +-
.../AssertOnColumnType_IsBoolean_Test.java | 12 +-
.../AssertOnColumnType_IsBytes_Test.java | 12 +-
.../AssertOnColumnType_IsDateTime_Test.java | 12 +-
.../AssertOnColumnType_IsDate_Test.java | 12 +-
.../AssertOnColumnType_IsNumber_Test.java | 12 +-
...AssertOnColumnType_IsOfAnyTypeIn_Test.java | 12 +-
.../AssertOnColumnType_IsOfType_Test.java | 12 +-
.../AssertOnColumnType_IsText_Test.java | 12 +-
.../AssertOnColumnType_IsTime_Test.java | 12 +-
.../AssertOnColumnType_IsUUID_Test.java | 12 +-
.../AssertOnDataType_IsOnDataType_Test.java | 12 +-
.../AssertOnDataType_IsOnRequest_Test.java | 12 +-
.../AssertOnDataType_IsOnTable_Name_Test.java | 24 +-
.../AssertOnDataType_IsOnTable_Test.java | 12 +-
.../AssertOnExistence_DoesNotExist_Test.java | 4 +-
.../AssertOnExistence_Exists_Test.java | 4 +-
...ssertOnModifiedColumn_IsModified_Test.java | 4 +-
...rtOnModifiedColumn_IsNotModified_Test.java | 4 +-
...lumns_HasModifiedColumns_Integer_Test.java | 8 +-
...olumns_HasModifiedColumns_String_Test.java | 8 +-
...ifiedColumnsGreaterThanOrEqualTo_Test.java | 8 +-
...mberOfModifiedColumnsGreaterThan_Test.java | 8 +-
...ModifiedColumnsLessThanOrEqualTo_Test.java | 8 +-
...sNumberOfModifiedColumnsLessThan_Test.java | 8 +-
...lumns_HasNumberOfModifiedColumns_Test.java | 8 +-
...berOfChangesGreaterThanOrEqualTo_Test.java | 12 +-
...es_HasNumberOfChangesGreaterThan_Test.java | 12 +-
...NumberOfChangesLessThanOrEqualTo_Test.java | 12 +-
...anges_HasNumberOfChangesLessThan_Test.java | 12 +-
...mberOfChanges_HasNumberOfChanges_Test.java | 14 +-
...berOfColumnsGreaterThanOrEqualTo_Test.java | 8 +-
...ns_HasNumberOfColumnsGreaterThan_Test.java | 8 +-
...NumberOfColumnsLessThanOrEqualTo_Test.java | 8 +-
...lumns_HasNumberOfColumnsLessThan_Test.java | 8 +-
...mberOfColumns_HasNumberOfColumns_Test.java | 8 +-
...NumberOfRowsGreaterThanOrEqualTo_Test.java | 4 +-
...fRows_HasNumberOfRowsGreaterThan_Test.java | 4 +-
...HasNumberOfRowsLessThanOrEqualTo_Test.java | 4 +-
...erOfRows_HasNumberOfRowsLessThan_Test.java | 4 +-
...rtOnNumberOfRows_HasNumberOfRows_Test.java | 4 +-
.../AssertOnNumberOfRows_IsEmpty_Test.java | 4 +-
.../AssertOnPrimaryKey_HasPksNames_Test.java | 12 +-
.../AssertOnPrimaryKey_HasPksValues_Test.java | 18 +-
...RowCondition_HasValuesSatisfying_Test.java | 8 +-
.../AssertOnRowEquality_HasValues_Test.java | 8 +-
...nRowNullity_HasOnlyNotNullValues_Test.java | 6 +-
...owOfChangeExistence_DoesNotExist_Test.java | 8 +-
...ertOnRowOfChangeExistence_Exists_Test.java | 8 +-
...y_IsAfterOrEqualTo_DateTimeValue_Test.java | 8 +-
...ology_IsAfterOrEqualTo_DateValue_Test.java | 8 +-
...y_IsAfterOrEqualTo_LocalDateTime_Test.java | 8 +-
...ology_IsAfterOrEqualTo_LocalDate_Test.java | 8 +-
...ology_IsAfterOrEqualTo_LocalTime_Test.java | 8 +-
...ronology_IsAfterOrEqualTo_String_Test.java | 8 +-
...ology_IsAfterOrEqualTo_TimeValue_Test.java | 8 +-
...Chronology_IsAfter_DateTimeValue_Test.java | 8 +-
...alueChronology_IsAfter_DateValue_Test.java | 8 +-
...Chronology_IsAfter_LocalDateTime_Test.java | 8 +-
...alueChronology_IsAfter_LocalDate_Test.java | 8 +-
...alueChronology_IsAfter_LocalTime_Test.java | 8 +-
...OnValueChronology_IsAfter_String_Test.java | 8 +-
...alueChronology_IsAfter_TimeValue_Test.java | 8 +-
..._IsBeforeOrEqualTo_DateTimeValue_Test.java | 8 +-
...logy_IsBeforeOrEqualTo_DateValue_Test.java | 8 +-
..._IsBeforeOrEqualTo_LocalDateTime_Test.java | 8 +-
...logy_IsBeforeOrEqualTo_LocalDate_Test.java | 8 +-
...logy_IsBeforeOrEqualTo_LocalTime_Test.java | 8 +-
...onology_IsBeforeOrEqualTo_String_Test.java | 8 +-
...logy_IsBeforeOrEqualTo_TimeValue_Test.java | 8 +-
...hronology_IsBefore_DateTimeValue_Test.java | 8 +-
...lueChronology_IsBefore_DateValue_Test.java | 8 +-
...hronology_IsBefore_LocalDateTime_Test.java | 8 +-
...lueChronology_IsBefore_LocalDate_Test.java | 8 +-
...lueChronology_IsBefore_LocalTime_Test.java | 8 +-
...nValueChronology_IsBefore_String_Test.java | 8 +-
...lueChronology_IsBefore_TimeValue_Test.java | 8 +-
.../AssertOnValueClass_IsOfClass_Test.java | 8 +-
...seTo_DateTimeValue_DateTimeValue_Test.java | 8 +-
...sCloseTo_DateTimeValue_DateValue_Test.java | 8 +-
...sCloseTo_DateTimeValue_TimeValue_Test.java | 8 +-
...sCloseTo_DateValue_DateTimeValue_Test.java | 8 +-
...ss_IsCloseTo_DateValue_DateValue_Test.java | 8 +-
...ss_IsCloseTo_DateValue_TimeValue_Test.java | 8 +-
...nValueCloseness_IsCloseTo_Number_Test.java | 8 +-
...ss_IsCloseTo_TimeValue_TimeValue_Test.java | 8 +-
...omparison_IsGreaterThanOrEqualTo_Test.java | 8 +-
...tOnValueComparison_IsGreaterThan_Test.java | 8 +-
...ueComparison_IsLessThanOrEqualTo_Test.java | 8 +-
...sertOnValueComparison_IsLessThan_Test.java | 8 +-
...sertOnValueCondition_DoesNotHave_Test.java | 8 +-
.../AssertOnValueCondition_Has_Test.java | 8 +-
.../AssertOnValueCondition_IsNot_Test.java | 8 +-
.../AssertOnValueCondition_Is_Test.java | 8 +-
...AssertOnValueCondition_Satisfies_Test.java | 8 +-
...nValueEquality_IsEqualTo_Boolean_Test.java | 8 +-
...tOnValueEquality_IsEqualTo_Bytes_Test.java | 8 +-
...alueEquality_IsEqualTo_Character_Test.java | 8 +-
...Equality_IsEqualTo_DateTimeValue_Test.java | 8 +-
...alueEquality_IsEqualTo_DateValue_Test.java | 8 +-
...Equality_IsEqualTo_LocalDateTime_Test.java | 8 +-
...alueEquality_IsEqualTo_LocalDate_Test.java | 8 +-
...alueEquality_IsEqualTo_LocalTime_Test.java | 8 +-
...OnValueEquality_IsEqualTo_Number_Test.java | 8 +-
...OnValueEquality_IsEqualTo_Object_Test.java | 8 +-
...OnValueEquality_IsEqualTo_String_Test.java | 8 +-
...alueEquality_IsEqualTo_TimeValue_Test.java | 8 +-
...rtOnValueEquality_IsEqualTo_UUID_Test.java | 8 +-
.../AssertOnValueEquality_IsFalse_Test.java | 8 +-
.../AssertOnValueEquality_IsTrue_Test.java | 8 +-
.../AssertOnValueEquality_IsZero_Test.java | 8 +-
...eInequality_IsNotEqualTo_Boolean_Test.java | 8 +-
...lueInequality_IsNotEqualTo_Bytes_Test.java | 8 +-
...nequality_IsNotEqualTo_Character_Test.java | 8 +-
...ality_IsNotEqualTo_DateTimeValue_Test.java | 8 +-
...nequality_IsNotEqualTo_DateValue_Test.java | 8 +-
...ality_IsNotEqualTo_LocalDateTime_Test.java | 8 +-
...nequality_IsNotEqualTo_LocalDate_Test.java | 8 +-
...nequality_IsNotEqualTo_LocalTime_Test.java | 8 +-
...ueInequality_IsNotEqualTo_Number_Test.java | 8 +-
...ueInequality_IsNotEqualTo_Object_Test.java | 8 +-
...ueInequality_IsNotEqualTo_String_Test.java | 8 +-
...nequality_IsNotEqualTo_TimeValue_Test.java | 8 +-
...alueInequality_IsNotEqualTo_UUID_Test.java | 8 +-
...ssertOnValueInequality_IsNotZero_Test.java | 8 +-
.../AssertOnValueNullity_IsNotNull_Test.java | 14 +-
.../AssertOnValueNullity_IsNull_Test.java | 12 +-
.../AssertOnValueType_IsBoolean_Test.java | 8 +-
.../AssertOnValueType_IsBytes_Test.java | 8 +-
.../AssertOnValueType_IsDateTime_Test.java | 8 +-
.../AssertOnValueType_IsDate_Test.java | 8 +-
.../AssertOnValueType_IsNumber_Test.java | 8 +-
.../AssertOnValueType_IsOfAnyTypeIn_Test.java | 14 +-
.../AssertOnValueType_IsOfType_Test.java | 8 +-
.../AssertOnValueType_IsText_Test.java | 8 +-
.../AssertOnValueType_IsTime_Test.java | 8 +-
.../AssertOnValueType_IsUUID_Test.java | 8 +-
.../db/api/assertions/BDDAssertions_Test.java | 12 +-
...ssertionsOnChangeType_IsCreation_Test.java | 8 +-
...ssertionsOnChangeType_IsDeletion_Test.java | 8 +-
...tionsOnChangeType_IsModification_Test.java | 8 +-
.../AssertionsOnChangeType_IsOfType_Test.java | 8 +-
...ssertionsOnColumnClass_IsOfClass_Test.java | 17 +-
...mnContent_ContainsValues_Boolean_Test.java | 14 +-
...lumnContent_ContainsValues_Bytes_Test.java | 14 +-
...Content_ContainsValues_Character_Test.java | 14 +-
...ent_ContainsValues_DateTimeValue_Test.java | 14 +-
...Content_ContainsValues_DateValue_Test.java | 14 +-
...umnContent_ContainsValues_Number_Test.java | 14 +-
...umnContent_ContainsValues_Object_Test.java | 14 +-
...umnContent_ContainsValues_String_Test.java | 14 +-
...Content_ContainsValues_TimeValue_Test.java | 14 +-
...olumnContent_ContainsValues_UUID_Test.java | 14 +-
...ColumnEquality_HasValues_Boolean_Test.java | 14 +-
...OnColumnEquality_HasValues_Bytes_Test.java | 14 +-
...lumnEquality_HasValues_Character_Test.java | 14 +-
...Equality_HasValues_DateTimeValue_Test.java | 14 +-
...lumnEquality_HasValues_DateValue_Test.java | 14 +-
...nColumnEquality_HasValues_Number_Test.java | 14 +-
...nColumnEquality_HasValues_Object_Test.java | 14 +-
...nColumnEquality_HasValues_String_Test.java | 14 +-
...lumnEquality_HasValues_TimeValue_Test.java | 14 +-
...sOnColumnEquality_HasValues_UUID_Test.java | 14 +-
...rtionsOnColumnName_HasColumnName_Test.java | 11 +-
...sOnColumnOfChangeClass_IsOfClass_Test.java | 20 +-
...geEquality_HasValues_One_Boolean_Test.java | 14 +-
...angeEquality_HasValues_One_Bytes_Test.java | 14 +-
...Equality_HasValues_One_Character_Test.java | 14 +-
...lity_HasValues_One_DateTimeValue_Test.java | 14 +-
...Equality_HasValues_One_DateValue_Test.java | 14 +-
...ngeEquality_HasValues_One_Number_Test.java | 14 +-
...ngeEquality_HasValues_One_Object_Test.java | 14 +-
...ngeEquality_HasValues_One_String_Test.java | 14 +-
...Equality_HasValues_One_TimeValue_Test.java | 14 +-
...hangeEquality_HasValues_One_UUID_Test.java | 14 +-
...geEquality_HasValues_Two_Boolean_Test.java | 14 +-
...angeEquality_HasValues_Two_Bytes_Test.java | 14 +-
...Equality_HasValues_Two_Character_Test.java | 14 +-
...lity_HasValues_Two_DateTimeValue_Test.java | 14 +-
...Equality_HasValues_Two_DateValue_Test.java | 14 +-
...ngeEquality_HasValues_Two_Number_Test.java | 14 +-
...geEquality_HasValues_Two_Objects_Test.java | 14 +-
...ngeEquality_HasValues_Two_String_Test.java | 14 +-
...Equality_HasValues_Two_TimeValue_Test.java | 14 +-
...hangeEquality_HasValues_Two_UUID_Test.java | 14 +-
...nsOnColumnOfChangeType_IsBoolean_Test.java | 17 +-
...ionsOnColumnOfChangeType_IsBytes_Test.java | 17 +-
...sOnColumnOfChangeType_IsDateTime_Test.java | 17 +-
...tionsOnColumnOfChangeType_IsDate_Test.java | 17 +-
...onsOnColumnOfChangeType_IsNumber_Test.java | 17 +-
...olumnOfChangeType_IsOfAnyOfTypes_Test.java | 17 +-
...onsOnColumnOfChangeType_IsOfType_Test.java | 17 +-
...tionsOnColumnOfChangeType_IsText_Test.java | 17 +-
...tionsOnColumnOfChangeType_IsTime_Test.java | 17 +-
...AssertionsOnColumnType_IsBoolean_Test.java | 14 +-
.../AssertionsOnColumnType_IsBytes_Test.java | 14 +-
...ssertionsOnColumnType_IsDateTime_Test.java | 14 +-
.../AssertionsOnColumnType_IsDate_Test.java | 14 +-
.../AssertionsOnColumnType_IsNumber_Test.java | 14 +-
...rtionsOnColumnType_IsOfAnyTypeIn_Test.java | 14 +-
.../AssertionsOnColumnType_IsOfType_Test.java | 14 +-
.../AssertionsOnColumnType_IsText_Test.java | 14 +-
.../AssertionsOnColumnType_IsTime_Test.java | 14 +-
.../AssertionsOnColumnType_IsUUID_Test.java | 14 +-
...ssertionsOnDataType_IsOnDataType_Test.java | 8 +-
...AssertionsOnDataType_IsOnRequest_Test.java | 8 +-
...ertionsOnDataType_IsOnTable_Name_Test.java | 14 +-
.../AssertionsOnDataType_IsOnTable_Test.java | 8 +-
...tionsOnModifiedColumn_IsModified_Test.java | 8 +-
...nsOnModifiedColumn_IsNotModified_Test.java | 8 +-
...lumns_HasModifiedColumns_Integer_Test.java | 14 +-
...olumns_HasModifiedColumns_String_Test.java | 17 +-
...ifiedColumnsGreaterThanOrEqualTo_Test.java | 8 +-
...mberOfModifiedColumnsGreaterThan_Test.java | 8 +-
...ModifiedColumnsLessThanOrEqualTo_Test.java | 8 +-
...sNumberOfModifiedColumnsLessThan_Test.java | 8 +-
...lumns_HasNumberOfModifiedColumns_Test.java | 8 +-
...berOfChangesGreaterThanOrEqualTo_Test.java | 8 +-
...es_HasNumberOfChangesGreaterThan_Test.java | 8 +-
...NumberOfChangesLessThanOrEqualTo_Test.java | 8 +-
...anges_HasNumberOfChangesLessThan_Test.java | 8 +-
...mberOfChanges_HasNumberOfChanges_Test.java | 8 +-
...berOfColumnsGreaterThanOrEqualTo_Test.java | 8 +-
...ns_HasNumberOfColumnsGreaterThan_Test.java | 8 +-
...NumberOfColumnsLessThanOrEqualTo_Test.java | 8 +-
...lumns_HasNumberOfColumnsLessThan_Test.java | 8 +-
...mberOfColumns_HasNumberOfColumns_Test.java | 8 +-
...NumberOfRowsGreaterThanOrEqualTo_Test.java | 8 +-
...fRows_HasNumberOfRowsGreaterThan_Test.java | 8 +-
...HasNumberOfRowsLessThanOrEqualTo_Test.java | 8 +-
...erOfRows_HasNumberOfRowsLessThan_Test.java | 8 +-
...nsOnNumberOfRows_HasNumberOfRows_Test.java | 8 +-
...sertionsOnPrimaryKey_HasPksNames_Test.java | 17 +-
...ertionsOnPrimaryKey_HasPksValues_Test.java | 11 +-
...owCondition_HasValues_Satisfying_Test.java | 17 +-
...ssertionsOnRowEquality_HasValues_Test.java | 14 +-
...owOfChangeExistence_DoesNotExist_Test.java | 8 +-
...onsOnRowOfChangeExistence_Exists_Test.java | 8 +-
...onsOnTableExistence_DoesNotExist_Test.java | 30 +-
...ssertionsOnTableExistence_Exists_Test.java | 34 +-
...y_IsAfterOrEqualTo_DateTimeValue_Test.java | 11 +-
...ology_IsAfterOrEqualTo_DateValue_Test.java | 11 +-
...ronology_IsAfterOrEqualTo_String_Test.java | 17 +-
...ology_IsAfterOrEqualTo_TimeValue_Test.java | 11 +-
...Chronology_IsAfter_DateTimeValue_Test.java | 11 +-
...alueChronology_IsAfter_DateValue_Test.java | 11 +-
...OnValueChronology_IsAfter_String_Test.java | 17 +-
...alueChronology_IsAfter_TimeValue_Test.java | 11 +-
..._IsBeforeOrEqualTo_DateTimeValue_Test.java | 11 +-
...logy_IsBeforeOrEqualTo_DateValue_Test.java | 11 +-
...onology_IsBeforeOrEqualTo_String_Test.java | 17 +-
...logy_IsBeforeOrEqualTo_TimeValue_Test.java | 11 +-
...hronology_IsBefore_DateTimeValue_Test.java | 11 +-
...lueChronology_IsBefore_DateValue_Test.java | 11 +-
...nValueChronology_IsBefore_String_Test.java | 17 +-
...lueChronology_IsBefore_TimeValue_Test.java | 11 +-
...AssertionsOnValueClass_IsOfClass_Test.java | 11 +-
...seTo_DateTimeValue_DateTimeValue_Test.java | 11 +-
...sCloseTo_DateTimeValue_DateValue_Test.java | 11 +-
...sCloseTo_DateTimeValue_TimeValue_Test.java | 11 +-
...sCloseTo_DateValue_DateTimeValue_Test.java | 11 +-
...ss_IsCloseTo_DateValue_DateValue_Test.java | 11 +-
...ss_IsCloseTo_DateValue_TimeValue_Test.java | 11 +-
...nValueCloseness_IsCloseTo_Number_Test.java | 11 +-
...ss_IsCloseTo_TimeValue_TimeValue_Test.java | 11 +-
...omparison_IsGreaterThanOrEqualTo_Test.java | 11 +-
...sOnValueComparison_IsGreaterThan_Test.java | 11 +-
...ueComparison_IsLessThanOrEqualTo_Test.java | 11 +-
...ionsOnValueComparison_IsLessThan_Test.java | 11 +-
...AssertionsOnValueCondition_IsNot_Test.java | 8 +-
.../AssertionsOnValueCondition_Is_Test.java | 8 +-
...nValueEquality_IsEqualTo_Boolean_Test.java | 11 +-
...sOnValueEquality_IsEqualTo_Bytes_Test.java | 11 +-
...alueEquality_IsEqualTo_Character_Test.java | 11 +-
...Equality_IsEqualTo_DateTimeValue_Test.java | 11 +-
...alueEquality_IsEqualTo_DateValue_Test.java | 11 +-
...OnValueEquality_IsEqualTo_Number_Test.java | 11 +-
...OnValueEquality_IsEqualTo_Object_Test.java | 11 +-
...OnValueEquality_IsEqualTo_String_Test.java | 11 +-
...alueEquality_IsEqualTo_TimeValue_Test.java | 11 +-
...nsOnValueEquality_IsEqualTo_UUID_Test.java | 11 +-
...ssertionsOnValueEquality_IsFalse_Test.java | 11 +-
...AssertionsOnValueEquality_IsTrue_Test.java | 11 +-
...AssertionsOnValueEquality_IsZero_Test.java | 11 +-
...eInequality_IsNotEqualTo_Boolean_Test.java | 11 +-
...lueInequality_IsNotEqualTo_Bytes_Test.java | 11 +-
...nequality_IsNotEqualTo_Character_Test.java | 11 +-
...ality_IsNotEqualTo_DateTimeValue_Test.java | 11 +-
...nequality_IsNotEqualTo_DateValue_Test.java | 11 +-
...ueInequality_IsNotEqualTo_Number_Test.java | 11 +-
...ueInequality_IsNotEqualTo_Object_Test.java | 11 +-
...ueInequality_IsNotEqualTo_String_Test.java | 11 +-
...nequality_IsNotEqualTo_TimeValue_Test.java | 11 +-
...alueInequality_IsNotEqualTo_UUID_Test.java | 11 +-
...tionsOnValueInequality_IsNotZero_Test.java | 11 +-
...sertionsOnValueNullity_IsNotNull_Test.java | 8 +-
.../AssertionsOnValueNullity_IsNull_Test.java | 8 +-
.../AssertionsOnValueType_IsBoolean_Test.java | 11 +-
.../AssertionsOnValueType_IsBytes_Test.java | 11 +-
...AssertionsOnValueType_IsDateTime_Test.java | 11 +-
.../AssertionsOnValueType_IsDate_Test.java | 11 +-
.../AssertionsOnValueType_IsNumber_Test.java | 11 +-
...ertionsOnValueType_IsOfAnyTypeIn_Test.java | 11 +-
.../AssertionsOnValueType_IsOfType_Test.java | 11 +-
.../AssertionsOnValueType_IsText_Test.java | 11 +-
.../AssertionsOnValueType_IsTime_Test.java | 11 +-
.../AssertionsOnValueType_IsUUID_Test.java | 11 +-
...luesNullity_HasOnlyNotNullValues_Test.java | 8 +-
...nValuesNullity_HasOnlyNullValues_Test.java | 8 +-
.../org/assertj/db/common/AbstractTest.java | 18 +-
.../db/common/DefaultConnectionProvider.java | 54 +++
.../db/database/h2/AbstractH2Test.java | 22 +-
.../database/h2/AbstractReservedH2Test.java | 22 +-
.../h2/H2DataBase_JdbcUrl_DDD_Test.java | 113 +++---
.../h2/H2Database_DataSource_DDD_Test.java | 115 +++---
.../h2/H2Database_DataSource_NSNSNS_Test.java | 88 ++---
.../h2/H2Database_DataSource_UIUIUI_Test.java | 86 ++---
.../h2/H2Database_JdbcUrl_NSNSNS_Test.java | 136 +++----
.../h2/H2Database_JdbcUrl_UIUIUI_Test.java | 90 ++---
...eservedH2Database_DataSource_DDD_Test.java | 74 ++--
...rvedH2Database_DataSource_NSNSNS_Test.java | 76 ++--
...rvedH2Database_DataSource_UIUIUI_Test.java | 77 ++--
.../ReservedH2Database_JdbcUrl_DDD_Test.java | 77 ++--
...eservedH2Database_JdbcUrl_NSNSNS_Test.java | 76 ++--
...eservedH2Database_JdbcUrl_UIUIUI_Test.java | 76 ++--
.../database/hsqldb/AbstractHsqldbTest.java | 14 +-
.../HsqldbDatabase_JdbcUrl_UIUIUI_Test.java | 54 +--
.../database/sqlite/AbstractSqliteTest.java | 22 +-
.../SqliteDatabase_DataSource_DDD_Test.java | 80 ++--
...SqliteDatabase_DataSource_NSNSNS_Test.java | 74 ++--
...SqliteDatabase_DataSource_UIUIUI_Test.java | 80 ++--
.../SqliteDatabase_JdbcUrl_DDD_Test.java | 80 ++--
.../SqliteDatabase_JdbcUrl_NSNSNS_Test.java | 86 ++---
.../SqliteDatabase_JdbcUrl_UIUIUI_Test.java | 80 ++--
.../navigation/InstantiationError_Test.java | 14 +-
.../db/navigation/ReturnToOrigin_Test.java | 52 +--
..._ChangeOfCreationOnTable_Integer_Test.java | 4 +-
...ToChange_ChangeOfCreationOnTable_Test.java | 4 +-
...oChange_ChangeOfCreation_Integer_Test.java | 4 +-
.../ToChange_ChangeOfCreation_Test.java | 4 +-
..._ChangeOfDeletionOnTable_Integer_Test.java | 4 +-
...ToChange_ChangeOfDeletionOnTable_Test.java | 4 +-
...oChange_ChangeOfDeletion_Integer_Test.java | 4 +-
.../ToChange_ChangeOfDeletion_Test.java | 4 +-
...ngeOfModificationOnTable_Integer_Test.java | 4 +-
...ange_ChangeOfModificationOnTable_Test.java | 4 +-
...nge_ChangeOfModification_Integer_Test.java | 4 +-
.../ToChange_ChangeOfModification_Test.java | 22 +-
.../ToChange_ChangeOnTableWithPks_Test.java | 20 +-
.../ToChange_ChangeOnTable_Integer_Test.java | 4 +-
.../ToChange_ChangeOnTable_Test.java | 4 +-
.../ToChange_Change_Integer_Test.java | 4 +-
.../db/navigation/ToChange_Change_Test.java | 4 +-
.../assertj/db/navigation/ToChange_Test.java | 4 +-
.../assertj/db/navigation/ToChanges_Test.java | 4 +-
...lumnAmongTheModifiedOnes_Integer_Test.java | 4 +-
...olumnAmongTheModifiedOnes_String_Test.java | 4 +-
...hange_ColumnAmongTheModifiedOnes_Test.java | 4 +-
.../ToColumn_Column_Integer_Test.java | 12 +-
.../ToColumn_Column_String_Test.java | 12 +-
.../db/navigation/ToColumn_Column_Test.java | 12 +-
.../ToRowFromChange_RowAtEndPoint_Test.java | 4 +-
.../ToRowFromChange_RowAtStartPoint_Test.java | 4 +-
.../db/navigation/ToRow_Row_Integer_Test.java | 8 +-
.../assertj/db/navigation/ToRow_Row_Test.java | 8 +-
...oValueFromColumn_ValueAtEndPoint_Test.java | 4 +-
...alueFromColumn_ValueAtStartPoint_Test.java | 4 +-
.../ToValueFromRow_Value_String_Test.java | 8 +-
.../ToValue_Value_Integer_Test.java | 20 +-
.../db/navigation/ToValue_Value_Test.java | 20 +-
.../db/output/OutputterChange_Test.java | 18 +-
.../db/output/OutputterChanges_Test.java | 4 +-
.../db/output/OutputterColumn_Test.java | 24 +-
.../db/output/OutputterException_Test.java | 12 +-
.../db/output/OutputterRequest_Test.java | 6 +-
.../assertj/db/output/OutputterRow_Test.java | 24 +-
.../db/output/OutputterTable_Test.java | 6 +-
.../db/output/OutputterToConsole_Test.java | 4 +-
.../db/output/OutputterToFile_Test.java | 2 +-
.../db/output/OutputterToStream_Test.java | 4 +-
.../db/output/OutputterValue_Test.java | 58 +--
.../db/type/CachedSchemaMetaData_Test.java | 26 +-
.../db/type/Change_Exception_Test.java | 2 +-
.../db/type/Change_GetDataType_Test.java | 4 +-
.../db/type/Changes_Constructor_Test.java | 132 ++-----
.../db/type/Changes_Exception_Test.java | 64 ++--
.../type/Changes_GetChangesOfTable_Test.java | 9 +-
.../type/Changes_GetChangesOfType_Test.java | 9 +-
.../db/type/Changes_GetChanges_Test.java | 4 +-
.../Changes_Request_GetChangesList_Test.java | 45 +--
.../db/type/Changes_SetTables_Test.java | 34 --
.../Changes_Table_GetChangesList_Test.java | 30 +-
.../assertj/db/type/DateTimeValue_Test.java | 4 +-
.../org/assertj/db/type/DateValue_Test.java | 4 +-
.../db/type/Request_Columns_Name_Test.java | 69 +---
.../assertj/db/type/Request_Columns_Test.java | 14 +-
.../db/type/Request_Exception_Test.java | 30 +-
.../Request_GetRowFromPksValues_Test.java | 22 +-
.../assertj/db/type/Request_Getters_Test.java | 47 +--
.../db/type/Request_Instantiation_Test.java | 46 +--
.../type/Request_PrimaryKeys_Name_Test.java | 71 ++--
.../assertj/db/type/Request_Rows_Test.java | 49 +--
.../db/type/Table_Columns_Name_Test.java | 52 +--
.../assertj/db/type/Table_Columns_Test.java | 51 ++-
.../assertj/db/type/Table_Exception_Test.java | 105 +-----
.../type/Table_GetRowFromPksValues_Test.java | 4 +-
.../assertj/db/type/Table_Getters_Test.java | 72 ++--
.../db/type/Table_Instantiation_Test.java | 75 +---
.../db/type/Table_PrimaryKeys_Name_Test.java | 46 +--
.../org/assertj/db/type/Table_Rows_Test.java | 46 +--
.../org/assertj/db/type/TimeValue_Test.java | 2 +-
.../db/util/Changes_Constructor_Test.java | 4 +-
...nges_GetIndexesOfModifiedColumns_Test.java | 4 +-
.../Descriptions_GetDescription_Test.java | 80 ++--
473 files changed, 3659 insertions(+), 4876 deletions(-)
create mode 100644 src/main/java/org/assertj/db/type/AssertDbConnection.java
rename src/main/java/org/assertj/db/type/{ConnectionProviderFactory.java => AssertDbConnectionFactory.java} (82%)
create mode 100644 src/test/java/org/assertj/db/common/DefaultConnectionProvider.java
delete mode 100644 src/test/java/org/assertj/db/type/Changes_SetTables_Test.java
diff --git a/pom.xml b/pom.xml
index 1f2e907e..c71bbce9 100644
--- a/pom.xml
+++ b/pom.xml
@@ -206,14 +206,5 @@
-
-
-
- org.sonarsource.scanner.maven
- sonar-maven-plugin
- 4.0.0.4121
-
-
-
diff --git a/src/main/java/org/assertj/db/api/ErrorCollector.java b/src/main/java/org/assertj/db/api/ErrorCollector.java
index 7bc4f7f4..449c91fc 100644
--- a/src/main/java/org/assertj/db/api/ErrorCollector.java
+++ b/src/main/java/org/assertj/db/api/ErrorCollector.java
@@ -34,18 +34,16 @@ public class ErrorCollector {
private static final String INTERCEPT_METHOD_NAME = "intercept";
private static final String CLASS_NAME = ErrorCollector.class.getName();
-
+ // scope : the current soft-assertion object
+ private final List errors = new ArrayList<>();
+ // scope : the last assertion call (might be nested)
+ private final LastResult lastResult = new LastResult();
/**
* Construct empty error collector.
*/
public ErrorCollector() {
}
- // scope : the current soft-assertion object
- private final List errors = new ArrayList<>();
- // scope : the last assertion call (might be nested)
- private final LastResult lastResult = new LastResult();
-
private static int countErrorCollectorProxyCalls() {
int nbCalls = 0;
for (StackTraceElement stackTraceElement : Thread.currentThread().getStackTrace()) {
diff --git a/src/main/java/org/assertj/db/type/AbstractDbData.java b/src/main/java/org/assertj/db/type/AbstractDbData.java
index c31c1691..27240ffb 100644
--- a/src/main/java/org/assertj/db/type/AbstractDbData.java
+++ b/src/main/java/org/assertj/db/type/AbstractDbData.java
@@ -63,17 +63,6 @@ public abstract class AbstractDbData> extends Abstra
*/
private List columnsList;
- /**
- * Default constructor.
- *
- * @param dataType The type of the data on which is the change.
- * @param selfType Class of this element : a subclass of {@code AbstractDbData}.
- */
- AbstractDbData(Class selfType, DataType dataType) {
- super(selfType);
- this.dataType = dataType;
- }
-
/**
* Constructor with a {@link JdbcUrlConnectionProvider}.
*
@@ -82,11 +71,22 @@ public abstract class AbstractDbData> extends Abstra
* @param connectionProvider The {@link JdbcUrlConnectionProvider} to connect to the database (must be not {@code null}).
* @throws NullPointerException If {@code connectionProvider} is {@code null}.
*/
- AbstractDbData(Class selfType, DataType dataType, ConnectionProvider connectionProvider) {
+ protected AbstractDbData(Class selfType, DataType dataType, ConnectionProvider connectionProvider) {
super(selfType, connectionProvider);
this.dataType = dataType;
}
+ /**
+ * Only used for tests.
+ *
+ * @param selfType Class of DbElement.
+ * @param dataType Type of DbData.
+ */
+ protected AbstractDbData(Class selfType, DataType dataType) {
+ super(selfType);
+ this.dataType = dataType;
+ }
+
/**
* Returns the type of the data on which is the change.
*
diff --git a/src/main/java/org/assertj/db/type/AbstractDbElement.java b/src/main/java/org/assertj/db/type/AbstractDbElement.java
index d66d0c95..c1b498d1 100644
--- a/src/main/java/org/assertj/db/type/AbstractDbElement.java
+++ b/src/main/java/org/assertj/db/type/AbstractDbElement.java
@@ -36,35 +36,7 @@ public abstract class AbstractDbElement> implemen
/**
* Database connection provider.
*/
- private ConnectionProvider connectionProvider;
- /**
- * Letter case of the tables.
- *
- * @since 1.1.0
- */
- private LetterCase tableLetterCase = LetterCase.TABLE_DEFAULT;
- /**
- * Letter case of the columns.
- *
- * @since 1.1.0
- */
- private LetterCase columnLetterCase = LetterCase.COLUMN_DEFAULT;
- /**
- * Letter case of the primary keys.
- *
- * @since 1.1.0
- */
- private LetterCase primaryKeyLetterCase = LetterCase.PRIMARY_KEY_DEFAULT;
-
- /**
- * Default constructor.
- *
- * @param selfType Class of this element : a sub-class of {@code AbstractDbElement}.
- */
- AbstractDbElement(Class selfType) {
- myself = selfType.cast(this);
- setLetterCases();
- }
+ private final ConnectionProvider connectionProvider;
/**
* Constructor.
@@ -73,37 +45,22 @@ public abstract class AbstractDbElement> implemen
* @param connectionProvider The {@link ConnectionProvider} to connect to the database (must be not {@code null}).
* @throws NullPointerException If {@code connectionProvider} is {@code null}.
*/
- AbstractDbElement(Class selfType, ConnectionProvider connectionProvider) {
- this(selfType);
+ protected AbstractDbElement(Class selfType, ConnectionProvider connectionProvider) {
+ this.myself = selfType.cast(this);
+ if (connectionProvider == null) {
+ throw new IllegalArgumentException("connectionProvider can not be null");
+ }
this.connectionProvider = connectionProvider;
- setLetterCases();
}
/**
- * Sets the letter cases from information in parameters.
+ * Only used for tests.
*
- * @param tableLetterCase Letter case of the tables.
- * @param columnLetterCase Letter case of the columns.
- * @param primaryKeyLetterCase Letter case of the primary keys.
- * @return The actual instance.
+ * @param selfType Class of DbElement.
*/
- D setLetterCases(LetterCase tableLetterCase, LetterCase columnLetterCase, LetterCase primaryKeyLetterCase) {
- this.tableLetterCase = tableLetterCase;
- this.columnLetterCase = columnLetterCase;
- this.primaryKeyLetterCase = primaryKeyLetterCase;
- return myself;
- }
-
- /**
- * Sets the letter cases from information in {@code connectionProvider}.
- */
- private void setLetterCases() {
- if (connectionProvider == null) {
- return;
- }
- tableLetterCase = connectionProvider.getTableLetterCase();
- columnLetterCase = connectionProvider.getColumnLetterCase();
- primaryKeyLetterCase = connectionProvider.getPrimaryKeyLetterCase();
+ protected AbstractDbElement(Class selfType) {
+ this.myself = selfType.cast(this);
+ this.connectionProvider = null;
}
/**
@@ -111,7 +68,7 @@ private void setLetterCases() {
*/
@Override
public LetterCase getColumnLetterCase() {
- return columnLetterCase;
+ return this.connectionProvider.getColumnLetterCase();
}
/**
@@ -119,7 +76,7 @@ public LetterCase getColumnLetterCase() {
*/
@Override
public LetterCase getPrimaryKeyLetterCase() {
- return primaryKeyLetterCase;
+ return this.connectionProvider.getPrimaryKeyLetterCase();
}
/**
@@ -127,35 +84,18 @@ public LetterCase getPrimaryKeyLetterCase() {
*/
@Override
public LetterCase getTableLetterCase() {
- return tableLetterCase;
+ return this.connectionProvider.getTableLetterCase();
}
/**
* Return the connectionProvider.
*
* @return The {@link ConnectionProvider} to connect.
- * @see #setConnectionProvider(ConnectionProvider)
*/
public ConnectionProvider getConnectionProvider() {
return connectionProvider;
}
- /**
- * Sets the connectionProvider.
- *
- * @param connectionProvider {@link ConnectionProvider} to connect to the database (must be not {@code null}).
- * @return The actual instance.
- * @throws NullPointerException If {@code connectionProvider} is {@code null}.
- */
- public D setConnectionProvider(ConnectionProvider connectionProvider) {
- if (connectionProvider == null) {
- throw new NullPointerException("connectionProvider must be not null");
- }
- this.connectionProvider = connectionProvider;
- setLetterCases();
- return myself;
- }
-
/**
* Returns a {@link Connection} from the {@link ConnectionProvider}
*
diff --git a/src/main/java/org/assertj/db/type/AssertDbConnection.java b/src/main/java/org/assertj/db/type/AssertDbConnection.java
new file mode 100644
index 00000000..9eba7349
--- /dev/null
+++ b/src/main/java/org/assertj/db/type/AssertDbConnection.java
@@ -0,0 +1,81 @@
+/*
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
+ * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations under the License.
+ *
+ * Copyright 2015-2024 the original author or authors.
+ */
+package org.assertj.db.type;
+
+/**
+ * Entry point for creating database element ( Table, Request, Changes ) required to build assertion.
+ * Use {@link AssertDbConnectionFactory} to construct new instance of this builder.
+ *
+ * Provider fluent builder for create Table, Request and Changes :
+ *
+ *
+ * AssertDbConnection connection = ....;
+ * Table table = connection.table("movie").build();
+ * Request request = connection.request("select * from actor;").build();
+ * Changes changes = connection.changes().build();
+ *
+ *
+ *
+ * Some more advanced examples :
+ *
+ *
+ * AssertDbConnection connection = ....;
+ * Table table = connection.table("movie").columnToCheck(new String[] { "number", "title" }).build();
+ * Request request = connection.request("select * from actor where id = ?;").parameters(1).build();
+ * Changes changes = connection.changes().table("movie", t -> t.columnToCheck(new String[] { "number", "title" })).build();
+ *
+ *
+ *
+ * @author Julien Roy
+ * @since 3.0.0
+ */
+public class AssertDbConnection {
+
+ private final ConnectionProvider connectionProvider;
+
+ AssertDbConnection(ConnectionProvider connectionProvider) {
+ if (connectionProvider == null) {
+ throw new IllegalArgumentException("connectionProvider can not be null");
+ }
+ this.connectionProvider = connectionProvider;
+ }
+
+ /**
+ * Start building Table element.
+ *
+ * @param name Name of the table
+ * @return Table builder
+ */
+ public Table.Builder table(String name) {
+ return new Table.Builder(this.connectionProvider, name);
+ }
+
+ /**
+ * Start building Request element.
+ *
+ * @param request SQL request
+ * @return Request builder
+ */
+ public Request.Builder request(String request) {
+ return new Request.Builder(this.connectionProvider, request);
+ }
+
+ /**
+ * Start building Changes element.
+ *
+ * @return Changes builder
+ */
+ public Changes.Builder changes() {
+ return new Changes.Builder(this.connectionProvider);
+ }
+}
diff --git a/src/main/java/org/assertj/db/type/ConnectionProviderFactory.java b/src/main/java/org/assertj/db/type/AssertDbConnectionFactory.java
similarity index 82%
rename from src/main/java/org/assertj/db/type/ConnectionProviderFactory.java
rename to src/main/java/org/assertj/db/type/AssertDbConnectionFactory.java
index 81abd7fa..3aa65b51 100644
--- a/src/main/java/org/assertj/db/type/ConnectionProviderFactory.java
+++ b/src/main/java/org/assertj/db/type/AssertDbConnectionFactory.java
@@ -17,32 +17,32 @@
import org.assertj.db.type.lettercase.LetterCase;
/**
- * Fluent factory to create a connectionProvider from different input ( Jdbc URL or DataSource ).
+ * Factory to create a {@link AssertDbConnection} from different database connection input ( Jdbc URL or DataSource ).
* Allow to configure behavior of connection provider like letter case or schema metadata retrieval mode.
*
* For create with JDBC URL :
+ *
*
*
- * ConnectionProvider connectionProvider = ConnectionProviderFactory.of("jdbc:h2:mem:test", "sa", "").create();
- * Table table = new Table(connectionProvider, "movie");
+ * AssertDbConnection connection = AssertDbConnectionFactory.of("jdbc:h2:mem:test", "sa", "").create();
+ * Table table = connection.table("movie").build();
*
*
- *
* For create with JDBC URL :
*
*
* DataSource dataSource = ...;
- * ConnectionProvider connectionProvider = ConnectionProviderFactory.of(dataSource).create();
- * Table table = new Table(connectionProvider, "song", new String[] { "number", "title" }, null);
+ * AssertDbConnection connection = AssertDbConnectionFactory.of(dataSource).create();
+ * Table table = connection.table("song").columnToCheck(new String[] { "number", "title" }).build();
*
*
*
* @author Julien Roy
* @since 3.0.0
*/
-public abstract class ConnectionProviderFactory {
+public abstract class AssertDbConnectionFactory {
- private ConnectionProviderFactory() {
+ private AssertDbConnectionFactory() {
throw new UnsupportedOperationException();
}
@@ -83,7 +83,7 @@ private DataSourceConnectionProviderFactory(DataSource dataSource) {
* {@inheritDoc}
*/
@Override
- public ConnectionProvider create() {
+ public ConnectionProvider createConnectionProvider() {
return new DataSourceConnectionProvider(dataSource, this.schemaMetaDataMode.getType(), this.tableLetterCase, this.columnLetterCase, this.primaryKeyLetterCase);
}
}
@@ -108,7 +108,7 @@ private JdbcUrlConnectionProviderFactory(String url, String user, String passwor
* {@inheritDoc}
*/
@Override
- public ConnectionProvider create() {
+ public ConnectionProvider createConnectionProvider() {
return new JdbcUrlConnectionProvider(url, user, password, this.schemaMetaDataMode.getType(), this.tableLetterCase, this.columnLetterCase, this.primaryKeyLetterCase);
}
}
@@ -170,6 +170,15 @@ public T schemaMetaDataMode(SchemaMetaDataMode mode) {
*
* @return Connection provider to use for Table, Request or Changes
*/
- public abstract ConnectionProvider create();
+ protected abstract ConnectionProvider createConnectionProvider();
+
+ /**
+ * Build the Connection Provider
+ *
+ * @return Connection provider to use for Table, Request or Changes
+ */
+ public AssertDbConnection create() {
+ return new AssertDbConnection(createConnectionProvider());
+ }
}
}
diff --git a/src/main/java/org/assertj/db/type/Changes.java b/src/main/java/org/assertj/db/type/Changes.java
index 3eec5960..acd07ee9 100644
--- a/src/main/java/org/assertj/db/type/Changes.java
+++ b/src/main/java/org/assertj/db/type/Changes.java
@@ -17,16 +17,71 @@
import static org.assertj.db.type.Change.createModificationChange;
import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collection;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;
+import java.util.function.Consumer;
import org.assertj.db.exception.AssertJDBException;
import org.assertj.db.util.ChangeComparator;
/**
* Changes in the database.
+ *
+ * A Changes should be constructed by the fluent builder {@link Changes.Builder} from a AssertDbConnection instance.
+ *
+ *
+ * Examples of instantiation :
+ *
+ *
+ * -
+ *
+ * This {@link Changes} detect all changes in database.
+ *
*
+ *
+ *
+ * AssertDbConnection connection = AssertDbConnectionFactory.of(dataSource).create();
+ * Changes changes = connection.changes().build();
+ * changes.setStartPointNow();
+ * ....
+ * do some DB updates
+ * ....
+ * changes.setEndPointNow();
+ * assertThat(changes).....
+ *
+ *
+ *
+ *
+ * -
+ *
+ * This {@link Changes} detect changes for only two table.
+ *
+ *
+ *
+ *
+ * AssertDbConnection connection = AssertDbConnectionFactory.of(dataSource).create();
+ * Changes changes = connection.changes().table("movie").table("song").build();
+ *
+ *
+ *
+ *
+ * -
+ *
+ * This {@link Changes} detect changes for row returned by a SQL query.
+ *
+ *
+ *
+ *
+ * AssertDbConnection connection = AssertDbConnectionFactory.of(dataSource).create();
+ * Changes changes = connection.changes().request("select * from movie;").build();
+ *
+ *
+ *
+ *
+ *
* @author Régis Pouiller
* @author Julien Roy
*/
@@ -68,7 +123,7 @@ public class Changes extends AbstractDbElement {
* @throws NullPointerException If {@code connectionProvider} is {@code null}.
* @since 3.0.0
*/
- public Changes(ConnectionProvider connectionProvider) {
+ private Changes(ConnectionProvider connectionProvider) {
super(Changes.class, connectionProvider);
}
@@ -77,8 +132,8 @@ public Changes(ConnectionProvider connectionProvider) {
*
* @param tables Table on which are the comparison.
*/
- public Changes(Table... tables) {
- super(Changes.class);
+ private Changes(ConnectionProvider connectionProvider, Collection tables) {
+ super(Changes.class, connectionProvider);
setTables(tables);
}
@@ -87,21 +142,16 @@ public Changes(Table... tables) {
*
* @param request Request on which are the comparison.
*/
- public Changes(Request request) {
- super(Changes.class);
+ private Changes(ConnectionProvider connectionProvider, Request request) {
+ super(Changes.class, connectionProvider);
setRequest(request);
}
/**
- * Copy a {@link AbstractDbElement} in parameter on another.
- *
- * @param elementToCopy The {@link AbstractDbElement} to copy
- * @param element The {@link AbstractDbElement} on which is the copy
+ * Only used for tests.
*/
- private static void copyElement(AbstractDbElement> elementToCopy, AbstractDbElement> element) {
- if (elementToCopy.getConnectionProvider() != null) {
- element.setConnectionProvider(elementToCopy.getConnectionProvider());
- }
+ private Changes() {
+ super(Changes.class);
}
/**
@@ -110,15 +160,11 @@ private static void copyElement(AbstractDbElement> elementToCopy, AbstractDbEl
* @param request The {@link Request} to duplicate
* @return The Duplication
*/
- private static Request getDuplicatedRequest(Request request) {
- Request r = new Request();
- copyElement(request, r);
- return r.setLetterCases(request.getTableLetterCase(),
- request.getColumnLetterCase(),
- request.getPrimaryKeyLetterCase())
- .setRequest(request.getRequest())
- .setParameters(request.getParameters())
- .setPksName(request.getPksNameList().toArray(new String[0]));
+ private Request getDuplicatedRequest(Request request) {
+ return new Request.Builder(this.getConnectionProvider(), request.getRequest())
+ .parameters(request.getParameters())
+ .pksName(request.getPksNameList().toArray(new String[0]))
+ .build();
}
/**
@@ -127,27 +173,21 @@ private static Request getDuplicatedRequest(Request request) {
* @param table The {@link Table} to duplicate
* @return The Duplication
*/
- private static Table getDuplicatedTable(Table table) {
- Table t = new Table();
- copyElement(table, t);
- return t.setLetterCases(table.getTableLetterCase(),
- table.getColumnLetterCase(),
- table.getPrimaryKeyLetterCase())
- .setName(table.getName())
- .setStartDelimiter(table.getStartDelimiter())
- .setEndDelimiter(table.getEndDelimiter())
- .setColumnsToCheck(table.getColumnsToCheck())
- .setColumnsToExclude(table.getColumnsToExclude())
- .setColumnsToOrder(table.getColumnsToOrder());
+ private Table getDuplicatedTable(Table table) {
+ return new Table.Builder(this.getConnectionProvider(), table.getName())
+ .delimiters(table.getStartDelimiter(), table.getEndDelimiter())
+ .columnsToCheck(table.getColumnsToCheck())
+ .columnsToExclude(table.getColumnsToExclude())
+ .columnsToOrder(table.getColumnsToOrder())
+ .build();
}
/**
* Sets the table on which are the comparison.
*
* @param tables Table on which are the comparison.
- * @return {@code this} actual instance.
*/
- public Changes setTables(Table... tables) {
+ private void setTables(Collection tables) {
request = null;
requestAtStartPoint = null;
requestAtEndPoint = null;
@@ -162,10 +202,6 @@ public Changes setTables(Table... tables) {
Table t = getDuplicatedTable(table);
tablesList.add(t);
}
- if (tables.length > 0) {
- copyElement(tables[0], this);
- }
- return myself;
}
/**
@@ -190,9 +226,8 @@ public Request getRequest() {
* Sets the {@link Request}.
*
* @param request The {@link Request}.
- * @return {@code this} actual instance.
*/
- public Changes setRequest(Request request) {
+ private void setRequest(Request request) {
if (request == null) {
throw new NullPointerException("The request must be not null");
}
@@ -200,11 +235,9 @@ public Changes setRequest(Request request) {
tablesAtStartPointList = null;
tablesAtEndPointList = null;
this.request = getDuplicatedRequest(request);
- copyElement(request, this);
requestAtStartPoint = null;
requestAtEndPoint = null;
changesList = null;
- return myself;
}
/**
@@ -256,10 +289,7 @@ public Changes setStartPointNow() {
if (request == null && tablesList == null) {
tablesList = new LinkedList<>();
for (String tableName : getMetaData().getTablesName()) {
- Table t = new Table().setLetterCases(getTableLetterCase(), getColumnLetterCase(), getPrimaryKeyLetterCase())
- .setName(getTableLetterCase().convert(tableName));
- copyElement(this, t);
- tablesList.add(t);
+ tablesList.add(new Table.Builder(this.getConnectionProvider(), getTableLetterCase().convert(tableName)).build());
}
}
@@ -520,4 +550,133 @@ private Changes createChangesFromThis() {
changes.changesList = new ArrayList<>();
return changes;
}
+
+ /**
+ * Fluent {@link Changes} builder.
+ * Use {@link AssertDbConnection} to construct new instance of this builder.
+ *
+ *
+ * AssertDbConnection connection = ....;
+ * Changes changes = connection.changes().build();
+ * Changes changes = connection.changes().table("movie", t -> t.columnToCheck(new String[] { "number", "title" })).build();
+ *
+ *
+ *
+ * @author Julien Roy
+ * @since 3.0.0
+ */
+ public static class Builder {
+ private final ConnectionProvider connectionProvider;
+ private Request request;
+ private List tables = new ArrayList<>();
+
+ Builder(ConnectionProvider connectionProvider) {
+ this.connectionProvider = connectionProvider;
+ }
+
+ /**
+ * Force usage of {@link Request} for this {@link Changes} instead load all database objects.
+ *
+ * @param request Request to use to retrieve changes from DB.
+ * @return Current builder instance.
+ */
+ public Changes.Builder request(Request request) {
+ this.request = request;
+ return this;
+ }
+
+ /**
+ * Force usage of SQL request for this {@link Changes} instead load all database objects.
+ *
+ * @param request SQL Request to use to retrieve changes from DB.
+ * @return Current builder instance.
+ */
+ public Changes.Builder request(String request) {
+ this.request = new Request.Builder(this.connectionProvider, request).build();
+ return this;
+ }
+
+ /**
+ * Force usage of SQL request for this {@link Changes} instead load all database objects.
+ *
+ *
+ * AssertDbConnection connection = ....;
+ * Changes changes = connection.changes()
+ * .request("select * from actor where id = ?", r -> r.parameters(1))
+ * .build();
+ *
+ *
+ *
+ * @param request SQL Request to use to retrieve changes from DB.
+ * @param customizer Method that allow to customize the {@link Request} instance created.
+ * @return Current builder instance.
+ */
+ public Changes.Builder request(String request, Consumer customizer) {
+ Request.Builder builder = new Request.Builder(this.connectionProvider, request);
+ customizer.accept(builder);
+ this.request = builder.build();
+ return this;
+ }
+
+ /**
+ * Add new table to table list to use for this {@link Changes} instead load all database objects.
+ * Each call to this method add new table to list.
+ *
+ * @param name Table name to use to retrieve changes from DB.
+ * @return Current builder instance.
+ */
+ public Changes.Builder table(String name) {
+ this.tables.add(new Table.Builder(this.connectionProvider, name).build());
+ return this;
+ }
+
+ /**
+ * Add new table to table list to use for this {@link Changes} instead load all database objects.
+ * Each call to this method add new table to list.
+ *
+ *
+ * AssertDbConnection connection = ....;
+ * Changes changes = connection.changes()
+ * .table("actor", t -> t.setColumnsToOrder(new Order[]{Order.asc("where")})
+ * .build();
+ *
+ *
+ *
+ * @param name Table name to use to retrieve changes from DB.
+ * @param customizer Method that allow to customize the {@link Table} instance created.
+ * @return Current builder instance.
+ */
+ public Changes.Builder table(String name, Consumer customizer) {
+ Table.Builder builder = new Table.Builder(this.connectionProvider, name);
+ customizer.accept(builder);
+ this.tables.add(builder.build());
+ return this;
+ }
+
+ /**
+ * Force usage of {@link Table} list for this {@link Changes} instead load all database objects.
+ *
+ * @param tables Tables to use to retrieve changes from DB.
+ * @return Current builder instance.
+ */
+ public Changes.Builder tables(Table... tables) {
+ this.tables = Arrays.asList(tables);
+ return this;
+ }
+
+ /**
+ * Build the Changes instance.
+ *
+ * @return Changes instance to use in assertThat.
+ */
+ public Changes build() {
+ if (this.tables != null && !tables.isEmpty()) {
+ return new Changes(this.connectionProvider, tables);
+ }
+ if (this.request != null) {
+ return new Changes(this.connectionProvider, request);
+ }
+ return new Changes(this.connectionProvider);
+ }
+ }
}
diff --git a/src/main/java/org/assertj/db/type/DataSourceConnectionProvider.java b/src/main/java/org/assertj/db/type/DataSourceConnectionProvider.java
index 4f59e125..c254848b 100644
--- a/src/main/java/org/assertj/db/type/DataSourceConnectionProvider.java
+++ b/src/main/java/org/assertj/db/type/DataSourceConnectionProvider.java
@@ -20,7 +20,7 @@
/**
* The implementation of {@link ConnectionProvider} based on java.sql.DataSource.
- * Use {@link ConnectionProviderFactory} for instantiate.
+ * Use {@link AssertDbConnectionFactory} for instantiate.
*
* @author Julien Roy
* @since 3.0.0
diff --git a/src/main/java/org/assertj/db/type/JdbcUrlConnectionProvider.java b/src/main/java/org/assertj/db/type/JdbcUrlConnectionProvider.java
index a7795006..a757e9f9 100644
--- a/src/main/java/org/assertj/db/type/JdbcUrlConnectionProvider.java
+++ b/src/main/java/org/assertj/db/type/JdbcUrlConnectionProvider.java
@@ -20,7 +20,7 @@
/**
* The implementation of {@link ConnectionProvider} from JDBC url connection info.
- * Use {@link ConnectionProviderFactory} for instantiate.
+ * Use {@link AssertDbConnectionFactory} for instantiate.
*
* @author Julien Roy
* @since 3.0.0
diff --git a/src/main/java/org/assertj/db/type/Request.java b/src/main/java/org/assertj/db/type/Request.java
index 41b4cd34..90cd5e02 100644
--- a/src/main/java/org/assertj/db/type/Request.java
+++ b/src/main/java/org/assertj/db/type/Request.java
@@ -26,8 +26,8 @@
/**
* A request in the database to get values.
*
- * The different information of the request are connectionProvider, the SQL request and optionally the parameters
- * of the SQL request.
+ * The different information of the request are the SQL request and optionally the parameters of the SQL request.
+ * A Request should be constructed by the fluent builder {@link Request.Builder} from a AssertDbConnection instance.
*
*
* Examples of instantiation :
@@ -35,26 +35,25 @@
*
* -
*
- * This {@link Request} point to a request without parameter in a H2 database in memory like indicated in the
- * {@link ConnectionProvider}.
+ * This {@link Request} point to a request without parameter in a H2 database in memory.
*
*
*
- * ConnectionProvider connectionProvider = ConnectionProviderFactory.of("jdbc:h2:mem:test", "sa", "").create();
- * Request request = new Request(connectionProvider, "select title from movie;");
+ * AssertDbConnection connection = AssertDbConnectionFactory.of("jdbc:h2:mem:test", "sa", "").create();
+ * Request request = connection.request("select title from movie;").build();
*
*
*
* -
*
* Below the {@link Request} point to a request with {@code 2000} in parameter.
- * The {@link Request} use a {@code DataSource} in the factory of {@link ConnectionProvider} like above.
+ * The {@link AssertDbConnection} use a {@code DataSource} instead of a JDBC url like above.
*
*
*
* DataSource dataSource = ...;
- * ConnectionProvider connectionProvider = ConnectionProviderFactory.of(dataSource).create();
- * Request request = new Request(connectionProvider, "select title from movie where year > ?;", 2000);
+ * AssertDbConnection connection = AssertDbConnectionFactory.of(dataSource).create();
+ * Request request = connection.request("select title from movie where year > ?;").parameters(2000).build();
*
*
*
@@ -68,18 +67,11 @@ public class Request extends AbstractDbData {
/**
* SQL request to get the values.
*/
- private String request;
+ private final String request;
/**
* Parameters of the SQL request.
*/
- private Object[] parameters;
-
- /**
- * Default constructor.
- */
- public Request() {
- super(Request.class, DataType.REQUEST);
- }
+ private final Object[] parameters;
/**
* Constructor with a connection.
@@ -89,35 +81,34 @@ public Request() {
* @param parameters Parameters of the SQL request.
* @since 3.0.0
*/
- public Request(ConnectionProvider connectionProvider, String request, Object... parameters) {
+ private Request(ConnectionProvider connectionProvider, String request, Object[] parameters, String[] pksName) {
super(Request.class, DataType.REQUEST, connectionProvider);
- setRequest(request);
+ if (request == null) {
+ throw new IllegalArgumentException("request can not be null");
+ }
+ if (pksName != null) {
+ super.setPksNameList(new ArrayList<>(Arrays.asList(pksName)));
+ }
+ this.request = request;
this.parameters = parameters;
}
/**
- * Returns the SQL request.
- *
- * @return The SQL request.
+ * Only used for tests.
*/
- public String getRequest() {
- return request;
+ private Request() {
+ super(Request.class, DataType.REQUEST);
+ this.request = null;
+ this.parameters = null;
}
/**
- * Sets the SQL request.
+ * Returns the SQL request.
*
- * @param request The SQL request.
* @return The SQL request.
- * @throws NullPointerException If the {@link #request} field is {@code null}.
*/
- public Request setRequest(String request) {
- if (request == null) {
- throw new NullPointerException("request can not be null");
- }
-
- this.request = request;
- return this;
+ public String getRequest() {
+ return request;
}
/**
@@ -127,34 +118,11 @@ public Request setRequest(String request) {
*/
public Object[] getParameters() {
if (parameters == null) {
- return null;
+ return new Object[0];
}
return parameters.clone();
}
- /**
- * Sets the parameters of the SQL request.
- *
- * @param parameters The parameters of the SQL request.
- * @return The parameters of the SQL request.
- */
- public Request setParameters(Object... parameters) {
- this.parameters = parameters;
- return this;
- }
-
- /**
- * Sets the primary keys name.
- *
- * @param pksName The primary keys name.
- * @return {@code this} instance.
- */
- public Request setPksName(String... pksName) {
- List pksNameList = new ArrayList<>(Arrays.asList(pksName));
- super.setPksNameList(pksNameList);
- return this;
- }
-
/**
* Collects the columns name from the {@code ResultSet} from the SQL request.
*
@@ -201,4 +169,61 @@ protected void loadImpl(Connection connection) throws SQLException {
}
}
}
+
+ /**
+ * Fluent {@link Request} builder.
+ * Use {@link AssertDbConnection} to construct new instance of this builder.
+ *
+ *
+ * AssertDbConnection connection = ....;
+ * Request request = connection.request("select * from actor;").build();
+ * Request request = connection.request("select * from actor where id = ?;").parameters(1).build();
+ *
+ *
+ *
+ * @author Julien Roy
+ * @since 3.0.0
+ */
+ public static class Builder {
+ private final ConnectionProvider connectionProvider;
+ private final String request;
+ private Object[] parameters = new Object[0];
+ private String[] pksName = null;
+
+ Builder(ConnectionProvider connectionProvider, String request) {
+ this.connectionProvider = connectionProvider;
+ this.request = request;
+ }
+
+ /**
+ * Specify parameters to use in SQL request.
+ *
+ * @param parameters List of SQL parameters.
+ * @return Current builder instance.
+ */
+ public Request.Builder parameters(Object... parameters) {
+ this.parameters = parameters;
+ return this;
+ }
+
+ /**
+ * Set the list of primary keys
+ *
+ * @param pksName List of column name to use as primary keys.
+ * @return Current builder instance.
+ */
+ public Request.Builder pksName(String... pksName) {
+ this.pksName = pksName;
+ return this;
+ }
+
+ /**
+ * Build the Request instance.
+ *
+ * @return Request instance to use in assertThat.
+ */
+ public Request build() {
+ return new Request(this.connectionProvider, this.request, this.parameters, this.pksName);
+ }
+ }
}
diff --git a/src/main/java/org/assertj/db/type/SchemaMetadata.java b/src/main/java/org/assertj/db/type/SchemaMetadata.java
index ee02e8c0..f3190327 100644
--- a/src/main/java/org/assertj/db/type/SchemaMetadata.java
+++ b/src/main/java/org/assertj/db/type/SchemaMetadata.java
@@ -14,12 +14,35 @@
import java.util.Collection;
-interface SchemaMetadata {
+/**
+ * Represent access to a database schema metadata.
+ *
+ * @author Julien Roy
+ * @since 3.0.0
+ */
+public interface SchemaMetadata {
+ /**
+ * Return list of name of tables discovered in database schema.
+ *
+ * @return List of table names
+ */
Collection getTablesName();
+ /**
+ * Return list of name of columns discovered in database schema.
+ *
+ * @param tableName Name of table to discover.
+ * @return List of table names
+ */
Collection getColumnsName(String tableName);
+ /**
+ * Return list of primary keys discovered in database schema.
+ *
+ * @param tableName Name of table to discover.
+ * @return List of primary keys
+ */
Collection getPrimaryKeys(String tableName);
}
diff --git a/src/main/java/org/assertj/db/type/Table.java b/src/main/java/org/assertj/db/type/Table.java
index a9186235..ffc35219 100644
--- a/src/main/java/org/assertj/db/type/Table.java
+++ b/src/main/java/org/assertj/db/type/Table.java
@@ -21,7 +21,6 @@
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
-import javax.sql.DataSource;
import org.assertj.db.exception.AssertJDBException;
import org.assertj.db.type.lettercase.LetterCase;
@@ -30,8 +29,8 @@
/**
* A table in the database to read to get the values.
*
- * The different information of the table are {@link ConnectionProvider} or {@link DataSource}, name of the table and optionally
- * the columns to check and to exclude.
+ * The different information of the table are name of the table and optionally the columns to check and to exclude.
+ * A table should be constructed by the fluent builder {@link Table.Builder} from a AssertDbConnection instance.
*
*
* Examples of instantiation :
@@ -39,14 +38,13 @@
*
* -
*
- * This {@link Table} point to a table called {@code movie} in a H2 database in memory like indicated in the
- * {@link ConnectionProvider}.
+ * This {@link Table} point to a table called {@code movie} in a H2 database in memory.
*
*
*
*
- * ConnectionProvider connectionProvider = ConnectionProviderFactory.of("jdbc:h2:mem:test", "sa", "").create();
- * Table table = new Table(connectionProvider, "movie");
+ * AssertDbConnection connection = AssertDbConnectionFactory.of("jdbc:h2:mem:test", "sa", "").create();
+ * Table table = connection.table("movie").build();
*
*
*
@@ -57,15 +55,15 @@
* {@code number} and {@code title}).
* And the {@link Table} {@code table2} point to a table called {@code musician} (but ignore on the column called
* {@code birthday}).
- * The {@link Table} use a {@code DataSource} instead of a {@link ConnectionProvider} like above.
+ * The {@link AssertDbConnection} use a {@code DataSource} instead of a JDBC url like above.
*
*
*
*
* DataSource dataSource = ...;
- * ConnectionProvider connectionProvider = ConnectionProviderFactory.of(dataSource).create();
- * Table table1 = new Table(connectionProvider, "song", new String[] { "number", "title" }, null);
- * Table table2 = new Table(connectionProvider, "musician", null, new String[] { "birthday" });
+ * AssertDbConnection connection = AssertDbConnectionFactory.of(dataSource).create();
+ * Table table1 = connection.table("song").columnsToCheck(new String[] { "number", "title" }).build();
+ * Table table2 = connection..table("musician").columnsToExclude(new String[] { "birthday" }).build();
*
*
*
@@ -112,111 +110,6 @@ public class Table extends AbstractDbData {
*/
private Character endDelimiter = null;
- /**
- * Default constructor.
- */
- public Table() {
- super(Table.class, DataType.TABLE);
- }
-
- /**
- * Constructor with a {@link ConnectionProvider} and the name of the table.
- *
- * @param connectionProvider {@link ConnectionProvider} to connect to the database.
- * @param name Name of the table.
- * @since 3.0.0
- */
- public Table(ConnectionProvider connectionProvider, String name) {
- this(connectionProvider, name, null, (String[]) null);
- }
-
- /**
- * Constructor with a {@link ConnectionProvider}, the name of the table and the columns to check and to exclude.
- *
- * @param connectionProvider {@link ConnectionProvider} to connect to the database.
- * @param name Name of the table.
- * @param columnsToCheck Array of the name of the columns to check. If {@code null} that means to check all the
- * columns.
- * @param columnsToExclude Array of the name of the columns to exclude. If {@code null} that means to exclude no
- * column.
- * @since 3.0.0
- */
- public Table(ConnectionProvider connectionProvider, String name, String[] columnsToCheck, String[] columnsToExclude) {
- this(connectionProvider, name, null, columnsToCheck, columnsToExclude);
- }
-
- /**
- * Constructor with a {@link ConnectionProvider} and the name of the table.
- *
- * @param connectionProvider {@link ConnectionProvider} to connect to the database.
- * @param name Name of the table.
- * @param columnsToOrder List of column to use as ORDER BY
- * @since 3.0.0
- */
- public Table(ConnectionProvider connectionProvider, String name, Order[] columnsToOrder) {
- this(connectionProvider, name, columnsToOrder, null, null);
- }
-
- /**
- * Constructor with a {@link ConnectionProvider}, the name of the table and the columns to check and to exclude.
- *
- * @param connectionProvider {@link ConnectionProvider} to connect to the database.
- * @param name Name of the table.
- * @param columnsToOrder List of column to use as ORDER BY
- * @param columnsToCheck Array of the name of the columns to check. If {@code null} that means to check all the
- * columns.
- * @param columnsToExclude Array of the name of the columns to exclude. If {@code null} that means to exclude no
- * column.
- * @since 3.0.0
- */
- public Table(ConnectionProvider connectionProvider, String name, Order[] columnsToOrder, String[] columnsToCheck, String[] columnsToExclude) {
- this(connectionProvider, name, null, null, columnsToOrder, columnsToCheck, columnsToExclude);
- }
-
- /**
- * Constructor with a {@link ConnectionProvider} and the name of the table.
- *
- * @param connectionProvider {@link ConnectionProvider} to connect to the database.
- * @param name Name of the table.
- * @param startDelimiter Start delimiter for column name and table name.
- * @param endDelimiter End delimiter for column name and table name.
- * @since 3.0.0
- */
- public Table(ConnectionProvider connectionProvider, String name, Character startDelimiter, Character endDelimiter) {
- this(connectionProvider, name, startDelimiter, endDelimiter, null, null, null);
- }
-
- /**
- * Constructor with a {@link ConnectionProvider}, the name of the table and the columns to check and to exclude.
- *
- * @param connectionProvider {@link ConnectionProvider} to connect to the database.
- * @param name Name of the table.
- * @param startDelimiter Start delimiter for column name and table name.
- * @param endDelimiter End delimiter for column name and table name.
- * @param columnsToCheck Array of the name of the columns to check. If {@code null} that means to check all the
- * columns.
- * @param columnsToExclude Array of the name of the columns to exclude. If {@code null} that means to exclude no
- * column.
- * @since 3.0.0
- */
- public Table(ConnectionProvider connectionProvider, String name, Character startDelimiter, Character endDelimiter, String[] columnsToCheck,
- String[] columnsToExclude) {
- this(connectionProvider, name, startDelimiter, endDelimiter, null, columnsToCheck, columnsToExclude);
- }
-
- /**
- * Constructor with a {@link ConnectionProvider} and the name of the table.
- *
- * @param connectionProvider {@link ConnectionProvider} to connect to the database.
- * @param name Name of the table.
- * @param startDelimiter Start delimiter for column name and table name.
- * @param endDelimiter End delimiter for column name and table name.
- * @param columnsToOrder List of column to use as ORDER BY
- * @since 3.0.0
- */
- public Table(ConnectionProvider connectionProvider, String name, Character startDelimiter, Character endDelimiter, Order[] columnsToOrder) {
- this(connectionProvider, name, startDelimiter, endDelimiter, columnsToOrder, null, null);
- }
/**
* Constructor with a {@link ConnectionProvider}, the name of the table and the columns to check and to exclude.
@@ -232,8 +125,8 @@ public Table(ConnectionProvider connectionProvider, String name, Character start
* column.
* @since 3.0.0
*/
- public Table(ConnectionProvider connectionProvider, String name, Character startDelimiter, Character endDelimiter, Order[] columnsToOrder,
- String[] columnsToCheck, String[] columnsToExclude) {
+ private Table(ConnectionProvider connectionProvider, String name, Character startDelimiter, Character endDelimiter, Order[] columnsToOrder,
+ String[] columnsToCheck, String[] columnsToExclude) {
super(Table.class, DataType.TABLE, connectionProvider);
setName(name);
setStartDelimiter(startDelimiter);
@@ -243,6 +136,13 @@ public Table(ConnectionProvider connectionProvider, String name, Character start
setColumnsToExclude(columnsToExclude);
}
+ /**
+ * Only used for tests.
+ */
+ private Table() {
+ super(Table.class, DataType.TABLE);
+ }
+
/**
* Return the name of the table.
*
@@ -260,25 +160,15 @@ public String getName() {
* @return The actual instance.
* @see #getName()
*/
- public Table setName(String name) {
+ private Table setName(String name) {
if (name == null) {
- throw new NullPointerException("name can not be null");
+ throw new IllegalArgumentException("name can not be null");
}
this.name = name;
setNameFromDb();
return this;
}
- /**
- * {@inheritDoc}
- */
- @Override
- public Table setConnectionProvider(ConnectionProvider connectionProvider) {
- Table table = super.setConnectionProvider(connectionProvider);
- setNameFromDb();
- return table;
- }
-
/**
* Set the name from the corresponding name in the database.
*/
@@ -324,28 +214,30 @@ public String[] getColumnsToCheck() {
* @throws NullPointerException If one of the name in {@code columnsToCheck} is {@code null}.
* @see #getColumnsToCheck()
*/
- public Table setColumnsToCheck(String[] columnsToCheck) {
+ private Table setColumnsToCheck(String[] columnsToCheck) {
+ if (columnsToCheck == null) {
+ this.columnsToCheck = null;
+ return this;
+ }
+
if (columnsList == null) {
throw new AssertJDBException("The table name and the connectionProvider must be set first");
}
- if (columnsToCheck != null) {
- LetterCase letterCase = getColumnLetterCase();
- // If the parameter is not null, all the names are convert
- // before setting the instance field
- List columnsToCheckList = new ArrayList<>();
- for (String column : columnsToCheck) {
- if (column == null) {
- throw new NullPointerException("The name of the column can not be null");
- }
- int indexOf = NameComparator.INSTANCE.indexOf(columnsList, column, letterCase);
- if (indexOf != -1) {
- columnsToCheckList.add(columnsList.get(indexOf));
- }
+
+ LetterCase letterCase = getColumnLetterCase();
+ // If the parameter is not null, all the names are convert
+ // before setting the instance field
+ List columnsToCheckList = new ArrayList<>();
+ for (String column : columnsToCheck) {
+ if (column == null) {
+ throw new NullPointerException("The name of the column can not be null");
+ }
+ int indexOf = NameComparator.INSTANCE.indexOf(columnsList, column, letterCase);
+ if (indexOf != -1) {
+ columnsToCheckList.add(columnsList.get(indexOf));
}
- this.columnsToCheck = columnsToCheckList.toArray(new String[0]);
- } else {
- this.columnsToCheck = null;
}
+ this.columnsToCheck = columnsToCheckList.toArray(new String[0]);
return this;
}
@@ -369,27 +261,29 @@ public String[] getColumnsToExclude() {
* @return The actual instance.
* @see #getColumnsToExclude()
*/
- public Table setColumnsToExclude(String[] columnsToExclude) {
+ private Table setColumnsToExclude(String[] columnsToExclude) {
+ if (columnsToExclude == null) {
+ this.columnsToExclude = null;
+ return this;
+ }
+
if (columnsList == null) {
throw new AssertJDBException("The table name and the connectionProvider must be set first");
}
- if (columnsToExclude != null) {
- LetterCase letterCase = getColumnLetterCase();
- this.columnsToExclude = new String[columnsToExclude.length];
- List columnsToExcludeList = new ArrayList<>();
- for (String column : columnsToExclude) {
- if (column == null) {
- throw new NullPointerException("The name of the column can not be null");
- }
- int indexOf = NameComparator.INSTANCE.indexOf(columnsList, column, letterCase);
- if (indexOf != -1) {
- columnsToExcludeList.add(columnsList.get(indexOf));
- }
+
+ LetterCase letterCase = getColumnLetterCase();
+ this.columnsToExclude = new String[columnsToExclude.length];
+ List columnsToExcludeList = new ArrayList<>();
+ for (String column : columnsToExclude) {
+ if (column == null) {
+ throw new NullPointerException("The name of the column can not be null");
+ }
+ int indexOf = NameComparator.INSTANCE.indexOf(columnsList, column, letterCase);
+ if (indexOf != -1) {
+ columnsToExcludeList.add(columnsList.get(indexOf));
}
- this.columnsToExclude = columnsToExcludeList.toArray(new String[0]);
- } else {
- this.columnsToExclude = null;
}
+ this.columnsToExclude = columnsToExcludeList.toArray(new String[0]);
return this;
}
@@ -413,32 +307,34 @@ public Order[] getColumnsToOrder() {
* @return The actual instance.
* @see #getColumnsToOrder()
*/
- public Table setColumnsToOrder(Order[] columnsToOrder) {
+ private Table setColumnsToOrder(Order[] columnsToOrder) {
+ if (columnsToOrder == null) {
+ this.columnsToOrder = null;
+ return this;
+ }
+
if (columnsList == null) {
throw new AssertJDBException("The table name and the connectionProvider must be set first");
}
- if (columnsToOrder != null) {
- LetterCase letterCase = getColumnLetterCase();
- this.columnsToOrder = new Order[columnsToOrder.length];
- List columnsToOrderList = new ArrayList<>();
- for (Order order : columnsToOrder) {
- if (order == null) {
- throw new NullPointerException("The order can not be null");
- }
- String column = order.getName();
- if (column == null) {
- throw new NullPointerException("The name of the column for order can not be null");
- }
- int indexOf = NameComparator.INSTANCE.indexOf(columnsList, column, letterCase);
- if (indexOf != -1) {
- String columnName = columnsList.get(indexOf);
- columnsToOrderList.add(Order.getOrder(columnName, order.getType()));
- }
+
+ LetterCase letterCase = getColumnLetterCase();
+ this.columnsToOrder = new Order[columnsToOrder.length];
+ List columnsToOrderList = new ArrayList<>();
+ for (Order order : columnsToOrder) {
+ if (order == null) {
+ throw new NullPointerException("The order can not be null");
+ }
+ String column = order.getName();
+ if (column == null) {
+ throw new NullPointerException("The name of the column for order can not be null");
+ }
+ int indexOf = NameComparator.INSTANCE.indexOf(columnsList, column, letterCase);
+ if (indexOf != -1) {
+ String columnName = columnsList.get(indexOf);
+ columnsToOrderList.add(Order.getOrder(columnName, order.getType()));
}
- this.columnsToOrder = columnsToOrderList.toArray(new Order[0]);
- } else {
- this.columnsToOrder = null;
}
+ this.columnsToOrder = columnsToOrderList.toArray(new Order[0]);
return this;
}
@@ -461,7 +357,7 @@ public Character getStartDelimiter() {
* @see #getStartDelimiter()
* @since 1.2.0
*/
- public Table setStartDelimiter(Character startDelimiter) {
+ private Table setStartDelimiter(Character startDelimiter) {
this.startDelimiter = startDelimiter;
return this;
}
@@ -485,7 +381,7 @@ public Character getEndDelimiter() {
* @see #getEndDelimiter()
* @since 1.2.0
*/
- public Table setEndDelimiter(Character endDelimiter) {
+ private Table setEndDelimiter(Character endDelimiter) {
this.endDelimiter = endDelimiter;
return this;
}
@@ -637,6 +533,90 @@ protected void loadImpl(Connection connection) throws SQLException {
}
}
+ /**
+ * Fluent {@link Table} builder.
+ * Use {@link AssertDbConnection} to construct new instance of this builder.
+ *
+ *
+ * AssertDbConnection connection = ....;
+ * Table table = connection.table("movie").build();
+ * Table table2 = connection.table("movie").columnToCheck(new String[] { "number", "title" }).build();
+ *
+ *
+ *
+ * @author Julien Roy
+ * @since 3.0.0
+ */
+ public static class Builder {
+ private final ConnectionProvider connectionProvider;
+ private final String name;
+ private Order[] columnsToOrder;
+ private Character startDelimiter;
+ private Character endDelimiter;
+ private String[] columnsToCheck;
+ private String[] columnsToExclude;
+
+ Builder(ConnectionProvider connectionProvider, String name) {
+ this.connectionProvider = connectionProvider;
+ this.name = name;
+ }
+
+ /**
+ * Set order to use in SQL queries.
+ *
+ * @param columnsToOrder List of column to use as ORDER BY.
+ * @return Current builder instance.
+ */
+ public Builder columnsToOrder(Order[] columnsToOrder) {
+ this.columnsToOrder = columnsToOrder;
+ return this;
+ }
+
+ /**
+ * Set delimiters to use in SQL queries.
+ *
+ * @param startDelimiter Start delimiter for column name and table name.
+ * @param endDelimiter End delimiter for column name and table name.
+ * @return Current builder instance
+ */
+ public Builder delimiters(Character startDelimiter, Character endDelimiter) {
+ this.startDelimiter = startDelimiter;
+ this.endDelimiter = endDelimiter;
+ return this;
+ }
+
+ /**
+ * Set the columns to check.
+ *
+ * @param columnsToCheck Array of the name of the columns to check. If {@code null} that means to check all the columns.
+ * @return Current builder instance.
+ */
+ public Builder columnsToCheck(String[] columnsToCheck) {
+ this.columnsToCheck = columnsToCheck;
+ return this;
+ }
+
+ /**
+ * Set the columns to exclude.
+ *
+ * @param columnsToExclude Array of the name of the columns to exclude. If {@code null} that means to exclude no column.
+ * @return Current builder instance.
+ */
+ public Builder columnsToExclude(String[] columnsToExclude) {
+ this.columnsToExclude = columnsToExclude;
+ return this;
+ }
+
+ /**
+ * Build the Table instance.
+ *
+ * @return Table instance to use in assertThat.
+ */
+ public Table build() {
+ return new Table(this.connectionProvider, this.name, this.startDelimiter, this.endDelimiter, this.columnsToOrder, this.columnsToCheck, this.columnsToExclude);
+ }
+ }
+
/**
* Indicates an order with the name on which is the order and the type.
*
diff --git a/src/main/javadoc/hljs-theme.css b/src/main/javadoc/hljs-theme.css
index 75a4d088..b241e860 100644
--- a/src/main/javadoc/hljs-theme.css
+++ b/src/main/javadoc/hljs-theme.css
@@ -11,7 +11,7 @@ Railscasts-like style (c) Visoft, Inc. (Damien White)
background: #232323;
color: #e6e1dc;
/* added by us */
- border-radius:8px;
+ border-radius: 8px;
}
.hljs-comment,
@@ -105,4 +105,4 @@ Railscasts-like style (c) Visoft, Inc. (Damien White)
.hljs-link {
text-decoration: underline;
-}
\ No newline at end of file
+}
diff --git a/src/test/java/org/assertj/db/api/AssertOnColumnOfChangeEquality_HasValues_One_Character_Test.java b/src/test/java/org/assertj/db/api/AssertOnColumnOfChangeEquality_HasValues_One_Character_Test.java
index e38f5048..e5ecce03 100644
--- a/src/test/java/org/assertj/db/api/AssertOnColumnOfChangeEquality_HasValues_One_Character_Test.java
+++ b/src/test/java/org/assertj/db/api/AssertOnColumnOfChangeEquality_HasValues_One_Character_Test.java
@@ -36,7 +36,7 @@ public class AssertOnColumnOfChangeEquality_HasValues_One_Character_Test extends
@Test
@NeedReload
public void test_have_values_equal_to() {
- Changes changes = new Changes(jdbcConnectionProvider).setStartPointNow();
+ Changes changes = assertDbConnection.changes().build().setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
changes.setEndPointNow();
@@ -52,7 +52,7 @@ public void test_have_values_equal_to() {
@Test
@NeedReload
public void should_fail_because_value_at_start_point_is_different() {
- Changes changes = new Changes(jdbcConnectionProvider).setStartPointNow();
+ Changes changes = assertDbConnection.changes().build().setStartPointNow();
update("insert into test(var1, var16) values(5, 'X')");
changes.setEndPointNow();
@@ -74,7 +74,7 @@ public void should_fail_because_value_at_start_point_is_different() {
@Test
@NeedReload
public void should_fail_because_value_at_end_point_is_different() {
- Changes changes = new Changes(jdbcConnectionProvider).setStartPointNow();
+ Changes changes = assertDbConnection.changes().build().setStartPointNow();
update("delete from test where var1 = 1");
changes.setEndPointNow();
diff --git a/src/test/java/org/assertj/db/api/DefaultDescription_Test.java b/src/test/java/org/assertj/db/api/DefaultDescription_Test.java
index d7ba0120..7e379320 100644
--- a/src/test/java/org/assertj/db/api/DefaultDescription_Test.java
+++ b/src/test/java/org/assertj/db/api/DefaultDescription_Test.java
@@ -21,9 +21,12 @@
import org.assertj.db.common.AbstractTest;
import org.assertj.db.common.NeedReload;
import org.assertj.db.global.AbstractElement;
+import org.assertj.db.type.AssertDbConnection;
+import org.assertj.db.type.AssertDbConnectionFactory;
import org.assertj.db.type.Changes;
import org.assertj.db.type.Request;
import org.assertj.db.type.Table;
+import org.junit.Before;
import org.junit.Test;
/**
@@ -34,6 +37,16 @@
*/
public class DefaultDescription_Test extends AbstractTest {
+ AssertDbConnection assertDbConnectionFromDs;
+
+ @Before
+ public void initAssertDbConnectionFromDs() {
+ if (assertDbConnectionFromDs != null) {
+ return;
+ }
+ assertDbConnectionFromDs = AssertDbConnectionFactory.of(this.dataSource).create();
+ }
+
/**
* This method tests the description of change with different information.
*/
@@ -44,11 +57,11 @@ public void test_default_description_for_change_with_different_information() thr
field.setAccessible(true);
- Table actorTable = new Table(dsConnectionProvider, "actor");
- Request request = new Request(dsConnectionProvider, "select * from actor");
- Changes changes = new Changes(dsConnectionProvider).setStartPointNow();
- Changes changesOnActorTable = new Changes(actorTable).setStartPointNow();
- Changes changesOnRequest = new Changes(request).setStartPointNow();
+ Table actorTable = assertDbConnectionFromDs.table("actor").build();
+ Request request = assertDbConnectionFromDs.request("select * from actor").build();
+ Changes changes = assertDbConnectionFromDs.changes().build().setStartPointNow();
+ Changes changesOnActorTable = assertDbConnectionFromDs.changes().tables(actorTable).build().setStartPointNow();
+ Changes changesOnRequest = assertDbConnectionFromDs.changes().request(request).build().setStartPointNow();
updateChangesForTests();
update("delete from test2 where var1 = 1");
changes.setEndPointNow();
@@ -76,8 +89,8 @@ public void test_default_description_of_changes() throws Exception {
field.setAccessible(true);
- Changes changesFromSource = new Changes(jdbcConnectionProvider).setStartPointNow();
- Changes changesFromDataSource = new Changes(dsConnectionProvider).setStartPointNow();
+ Changes changesFromSource = assertDbConnection.changes().build().setStartPointNow();
+ Changes changesFromDataSource = assertDbConnectionFromDs.changes().build().setStartPointNow();
updateChangesForTests();
changesFromSource.setEndPointNow();
changesFromDataSource.setEndPointNow();
@@ -104,8 +117,8 @@ public void test_default_description_of_all_changes() throws Exception {
field.setAccessible(true);
- Changes changesFromSource = new Changes(jdbcConnectionProvider).setStartPointNow();
- Changes changesFromDataSource = new Changes(dsConnectionProvider).setStartPointNow();
+ Changes changesFromSource = assertDbConnection.changes().build().setStartPointNow();
+ Changes changesFromDataSource = assertDbConnectionFromDs.changes().build().setStartPointNow();
updateChangesForTests();
changesFromSource.setEndPointNow();
changesFromDataSource.setEndPointNow();
@@ -132,8 +145,8 @@ public void test_default_description_of_creation_changes() throws Exception {
field.setAccessible(true);
- Changes changesFromSource = new Changes(jdbcConnectionProvider).setStartPointNow();
- Changes changesFromDataSource = new Changes(dsConnectionProvider).setStartPointNow();
+ Changes changesFromSource = assertDbConnection.changes().build().setStartPointNow();
+ Changes changesFromDataSource = assertDbConnectionFromDs.changes().build().setStartPointNow();
updateChangesForTests();
changesFromSource.setEndPointNow();
changesFromDataSource.setEndPointNow();
@@ -160,8 +173,8 @@ public void test_default_description_of_modification_changes() throws Exception
field.setAccessible(true);
- Changes changesFromSource = new Changes(jdbcConnectionProvider).setStartPointNow();
- Changes changesFromDataSource = new Changes(dsConnectionProvider).setStartPointNow();
+ Changes changesFromSource = assertDbConnection.changes().build().setStartPointNow();
+ Changes changesFromDataSource = assertDbConnectionFromDs.changes().build().setStartPointNow();
updateChangesForTests();
changesFromSource.setEndPointNow();
changesFromDataSource.setEndPointNow();
@@ -188,8 +201,8 @@ public void test_default_description_of_deletion_changes() throws Exception {
field.setAccessible(true);
- Changes changesFromSource = new Changes(jdbcConnectionProvider).setStartPointNow();
- Changes changesFromDataSource = new Changes(dsConnectionProvider).setStartPointNow();
+ Changes changesFromSource = assertDbConnection.changes().build().setStartPointNow();
+ Changes changesFromDataSource = assertDbConnectionFromDs.changes().build().setStartPointNow();
updateChangesForTests();
changesFromSource.setEndPointNow();
changesFromDataSource.setEndPointNow();
@@ -216,8 +229,8 @@ public void test_default_description_of_creation_on_table_changes() throws Excep
field.setAccessible(true);
- Changes changesFromSource = new Changes(jdbcConnectionProvider).setStartPointNow();
- Changes changesFromDataSource = new Changes(dsConnectionProvider).setStartPointNow();
+ Changes changesFromSource = assertDbConnection.changes().build().setStartPointNow();
+ Changes changesFromDataSource = assertDbConnectionFromDs.changes().build().setStartPointNow();
updateChangesForTests();
changesFromSource.setEndPointNow();
changesFromDataSource.setEndPointNow();
@@ -244,8 +257,8 @@ public void test_default_description_of_modification_on_table_changes() throws E
field.setAccessible(true);
- Changes changesFromSource = new Changes(jdbcConnectionProvider).setStartPointNow();
- Changes changesFromDataSource = new Changes(dsConnectionProvider).setStartPointNow();
+ Changes changesFromSource = assertDbConnection.changes().build().setStartPointNow();
+ Changes changesFromDataSource = assertDbConnectionFromDs.changes().build().setStartPointNow();
updateChangesForTests();
changesFromSource.setEndPointNow();
changesFromDataSource.setEndPointNow();
@@ -272,8 +285,8 @@ public void test_default_description_of_deletion_on_table_changes() throws Excep
field.setAccessible(true);
- Changes changesFromSource = new Changes(jdbcConnectionProvider).setStartPointNow();
- Changes changesFromDataSource = new Changes(dsConnectionProvider).setStartPointNow();
+ Changes changesFromSource = assertDbConnection.changes().build().setStartPointNow();
+ Changes changesFromDataSource = assertDbConnectionFromDs.changes().build().setStartPointNow();
updateChangesForTests();
changesFromSource.setEndPointNow();
changesFromDataSource.setEndPointNow();
@@ -300,8 +313,8 @@ public void test_default_description_on_table_changes() throws Exception {
field.setAccessible(true);
- Changes changesFromSource = new Changes(jdbcConnectionProvider).setStartPointNow();
- Changes changesFromDataSource = new Changes(dsConnectionProvider).setStartPointNow();
+ Changes changesFromSource = assertDbConnection.changes().build().setStartPointNow();
+ Changes changesFromDataSource = assertDbConnectionFromDs.changes().build().setStartPointNow();
updateChangesForTests();
changesFromSource.setEndPointNow();
changesFromDataSource.setEndPointNow();
@@ -328,10 +341,10 @@ public void test_default_description_of_changes_on_table() throws Exception {
field.setAccessible(true);
- Table tableFromSource = new Table(jdbcConnectionProvider, "actor");
- Table tableFromDataSource = new Table(dsConnectionProvider, "actor");
- Changes changesFromSource = new Changes(tableFromSource).setStartPointNow();
- Changes changesFromDataSource = new Changes(tableFromDataSource).setStartPointNow();
+ Table tableFromSource = assertDbConnection.table("actor").build();
+ Table tableFromDataSource = assertDbConnectionFromDs.table("actor").build();
+ Changes changesFromSource = assertDbConnection.changes().tables(tableFromSource).build().setStartPointNow();
+ Changes changesFromDataSource = assertDbConnectionFromDs.changes().tables(tableFromDataSource).build().setStartPointNow();
updateChangesForTests();
changesFromSource.setEndPointNow();
changesFromDataSource.setEndPointNow();
@@ -358,10 +371,10 @@ public void test_default_description_of_changes_on_request() throws Exception {
field.setAccessible(true);
- Request requestFromSource = new Request(jdbcConnectionProvider, "select * from actor").setPksName("ID");
- Request requestFromDataSource = new Request(dsConnectionProvider, "select * from actor").setPksName("ID");
- Changes changesFromSource = new Changes(requestFromSource).setStartPointNow();
- Changes changesFromDataSource = new Changes(requestFromDataSource).setStartPointNow();
+ Request requestFromSource = assertDbConnection.request("select * from actor").pksName("ID").build();
+ Request requestFromDataSource = assertDbConnectionFromDs.request("select * from actor").pksName("ID").build();
+ Changes changesFromSource = assertDbConnection.changes().request(requestFromSource).build().setStartPointNow();
+ Changes changesFromDataSource = assertDbConnectionFromDs.changes().request(requestFromDataSource).build().setStartPointNow();
updateChangesForTests();
changesFromSource.setEndPointNow();
changesFromDataSource.setEndPointNow();
@@ -388,8 +401,8 @@ public void test_default_description_of_change_of_changes() throws Exception {
field.setAccessible(true);
- Changes changesFromSource = new Changes(jdbcConnectionProvider).setStartPointNow();
- Changes changesFromDataSource = new Changes(dsConnectionProvider).setStartPointNow();
+ Changes changesFromSource = assertDbConnection.changes().build().setStartPointNow();
+ Changes changesFromDataSource = assertDbConnectionFromDs.changes().build().setStartPointNow();
updateChangesForTests();
changesFromSource.setEndPointNow();
changesFromDataSource.setEndPointNow();
@@ -416,10 +429,10 @@ public void test_default_description_of_change_of_changes_on_table() throws Exce
field.setAccessible(true);
- Table tableFromSource = new Table(jdbcConnectionProvider, "actor");
- Table tableFromDataSource = new Table(dsConnectionProvider, "actor");
- Changes changesFromSource = new Changes(tableFromSource).setStartPointNow();
- Changes changesFromDataSource = new Changes(tableFromDataSource).setStartPointNow();
+ Table tableFromSource = assertDbConnection.table("actor").build();
+ Table tableFromDataSource = assertDbConnectionFromDs.table("actor").build();
+ Changes changesFromSource = assertDbConnection.changes().tables(tableFromSource).build().setStartPointNow();
+ Changes changesFromDataSource = assertDbConnectionFromDs.changes().tables(tableFromDataSource).build().setStartPointNow();
updateChangesForTests();
changesFromSource.setEndPointNow();
changesFromDataSource.setEndPointNow();
@@ -445,10 +458,10 @@ public void test_default_description_of_change_of_changes_on_request() throws Ex
field.setAccessible(true);
- Request requestFromSource = new Request(jdbcConnectionProvider, "select id, name, firstname, birth from actor where id = 1").setPksName("ID");
- Request requestFromDataSource = new Request(dsConnectionProvider, "select * from actor").setPksName("ID");
- Changes changesFromSource = new Changes(requestFromSource).setStartPointNow();
- Changes changesFromDataSource = new Changes(requestFromDataSource).setStartPointNow();
+ Request requestFromSource = assertDbConnection.request("select id, name, firstname, birth from actor where id = 1").pksName("ID").build();
+ Request requestFromDataSource = assertDbConnectionFromDs.request("select * from actor").pksName("ID").build();
+ Changes changesFromSource = assertDbConnection.changes().request(requestFromSource).build().setStartPointNow();
+ Changes changesFromDataSource = assertDbConnectionFromDs.changes().request(requestFromDataSource).build().setStartPointNow();
updateChangesForTests();
changesFromSource.setEndPointNow();
changesFromDataSource.setEndPointNow();
@@ -475,8 +488,8 @@ public void test_default_description_of_creation_change_of_changes() throws Exce
field.setAccessible(true);
- Changes changesFromSource = new Changes(jdbcConnectionProvider).setStartPointNow();
- Changes changesFromDataSource = new Changes(dsConnectionProvider).setStartPointNow();
+ Changes changesFromSource = assertDbConnection.changes().build().setStartPointNow();
+ Changes changesFromDataSource = assertDbConnectionFromDs.changes().build().setStartPointNow();
updateChangesForTests();
changesFromSource.setEndPointNow();
changesFromDataSource.setEndPointNow();
@@ -503,10 +516,10 @@ public void test_default_description_of_creation_change_of_changes_on_table() th
field.setAccessible(true);
- Table tableFromSource = new Table(jdbcConnectionProvider, "actor");
- Table tableFromDataSource = new Table(dsConnectionProvider, "actor");
- Changes changesFromSource = new Changes(tableFromSource).setStartPointNow();
- Changes changesFromDataSource = new Changes(tableFromDataSource).setStartPointNow();
+ Table tableFromSource = assertDbConnection.table("actor").build();
+ Table tableFromDataSource = assertDbConnectionFromDs.table("actor").build();
+ Changes changesFromSource = assertDbConnection.changes().tables(tableFromSource).build().setStartPointNow();
+ Changes changesFromDataSource = assertDbConnectionFromDs.changes().tables(tableFromDataSource).build().setStartPointNow();
updateChangesForTests();
changesFromSource.setEndPointNow();
changesFromDataSource.setEndPointNow();
@@ -533,10 +546,10 @@ public void test_default_description_of_creation_change_of_changes_on_request()
field.setAccessible(true);
- Request requestFromSource = new Request(jdbcConnectionProvider, "select * from actor").setPksName("ID");
- Request requestFromDataSource = new Request(dsConnectionProvider, "select * from actor").setPksName("ID");
- Changes changesFromSource = new Changes(requestFromSource).setStartPointNow();
- Changes changesFromDataSource = new Changes(requestFromDataSource).setStartPointNow();
+ Request requestFromSource = assertDbConnection.request("select * from actor").pksName("ID").build();
+ Request requestFromDataSource = assertDbConnectionFromDs.request("select * from actor").pksName("ID").build();
+ Changes changesFromSource = assertDbConnection.changes().request(requestFromSource).build().setStartPointNow();
+ Changes changesFromDataSource = assertDbConnectionFromDs.changes().request(requestFromDataSource).build().setStartPointNow();
updateChangesForTests();
changesFromSource.setEndPointNow();
changesFromDataSource.setEndPointNow();
@@ -563,8 +576,8 @@ public void test_default_description_of_modification_change_of_changes() throws
field.setAccessible(true);
- Changes changesFromSource = new Changes(jdbcConnectionProvider).setStartPointNow();
- Changes changesFromDataSource = new Changes(dsConnectionProvider).setStartPointNow();
+ Changes changesFromSource = assertDbConnection.changes().build().setStartPointNow();
+ Changes changesFromDataSource = assertDbConnectionFromDs.changes().build().setStartPointNow();
updateChangesForTests();
changesFromSource.setEndPointNow();
changesFromDataSource.setEndPointNow();
@@ -591,10 +604,10 @@ public void test_default_description_of_modification_change_of_changes_on_table(
field.setAccessible(true);
- Table tableFromSource = new Table(jdbcConnectionProvider, "actor");
- Table tableFromDataSource = new Table(dsConnectionProvider, "actor");
- Changes changesFromSource = new Changes(tableFromSource).setStartPointNow();
- Changes changesFromDataSource = new Changes(tableFromDataSource).setStartPointNow();
+ Table tableFromSource = assertDbConnection.table("actor").build();
+ Table tableFromDataSource = assertDbConnectionFromDs.table("actor").build();
+ Changes changesFromSource = assertDbConnection.changes().tables(tableFromSource).build().setStartPointNow();
+ Changes changesFromDataSource = assertDbConnectionFromDs.changes().tables(tableFromDataSource).build().setStartPointNow();
updateChangesForTests();
changesFromSource.setEndPointNow();
changesFromDataSource.setEndPointNow();
@@ -621,10 +634,10 @@ public void test_default_description_of_modification_change_of_changes_on_reques
field.setAccessible(true);
- Request requestFromSource = new Request(jdbcConnectionProvider, "select * from actor").setPksName("ID");
- Request requestFromDataSource = new Request(dsConnectionProvider, "select * from actor").setPksName("ID");
- Changes changesFromSource = new Changes(requestFromSource).setStartPointNow();
- Changes changesFromDataSource = new Changes(requestFromDataSource).setStartPointNow();
+ Request requestFromSource = assertDbConnection.request("select * from actor").pksName("ID").build();
+ Request requestFromDataSource = assertDbConnectionFromDs.request("select * from actor").pksName("ID").build();
+ Changes changesFromSource = assertDbConnection.changes().request(requestFromSource).build().setStartPointNow();
+ Changes changesFromDataSource = assertDbConnectionFromDs.changes().request(requestFromDataSource).build().setStartPointNow();
updateChangesForTests();
changesFromSource.setEndPointNow();
changesFromDataSource.setEndPointNow();
@@ -650,8 +663,8 @@ public void test_default_description_of_deletion_change_of_changes() throws Exce
field.setAccessible(true);
- Changes changesFromSource = new Changes(jdbcConnectionProvider).setStartPointNow();
- Changes changesFromDataSource = new Changes(dsConnectionProvider).setStartPointNow();
+ Changes changesFromSource = assertDbConnection.changes().build().setStartPointNow();
+ Changes changesFromDataSource = assertDbConnectionFromDs.changes().build().setStartPointNow();
updateChangesForTests();
changesFromSource.setEndPointNow();
changesFromDataSource.setEndPointNow();
@@ -678,10 +691,10 @@ public void test_default_description_of_deletion_change_of_changes_on_table() th
field.setAccessible(true);
- Table tableFromSource = new Table(jdbcConnectionProvider, "actor");
- Table tableFromDataSource = new Table(dsConnectionProvider, "actor");
- Changes changesFromSource = new Changes(tableFromSource).setStartPointNow();
- Changes changesFromDataSource = new Changes(tableFromDataSource).setStartPointNow();
+ Table tableFromSource = assertDbConnection.table("actor").build();
+ Table tableFromDataSource = assertDbConnectionFromDs.table("actor").build();
+ Changes changesFromSource = assertDbConnection.changes().tables(tableFromSource).build().setStartPointNow();
+ Changes changesFromDataSource = assertDbConnectionFromDs.changes().tables(tableFromDataSource).build().setStartPointNow();
updateChangesForTests();
changesFromSource.setEndPointNow();
changesFromDataSource.setEndPointNow();
@@ -708,10 +721,10 @@ public void test_default_description_of_deletion_change_of_changes_on_request()
field.setAccessible(true);
- Request requestFromSource = new Request(jdbcConnectionProvider, "select * from actor").setPksName("ID");
- Request requestFromDataSource = new Request(dsConnectionProvider, "select * from actor").setPksName("ID");
- Changes changesFromSource = new Changes(requestFromSource).setStartPointNow();
- Changes changesFromDataSource = new Changes(requestFromDataSource).setStartPointNow();
+ Request requestFromSource = assertDbConnection.request("select * from actor").pksName("ID").build();
+ Request requestFromDataSource = assertDbConnectionFromDs.request("select * from actor").pksName("ID").build();
+ Changes changesFromSource = assertDbConnection.changes().request(requestFromSource).build().setStartPointNow();
+ Changes changesFromDataSource = assertDbConnectionFromDs.changes().request(requestFromDataSource).build().setStartPointNow();
updateChangesForTests();
changesFromSource.setEndPointNow();
changesFromDataSource.setEndPointNow();
@@ -738,8 +751,8 @@ public void test_default_description_of_creation_change_on_table_of_changes() th
field.setAccessible(true);
- Changes changesFromSource = new Changes(jdbcConnectionProvider).setStartPointNow();
- Changes changesFromDataSource = new Changes(dsConnectionProvider).setStartPointNow();
+ Changes changesFromSource = assertDbConnection.changes().build().setStartPointNow();
+ Changes changesFromDataSource = assertDbConnectionFromDs.changes().build().setStartPointNow();
updateChangesForTests();
changesFromSource.setEndPointNow();
changesFromDataSource.setEndPointNow();
@@ -766,10 +779,10 @@ public void test_default_description_of_creation_change_on_table_of_changes_on_t
field.setAccessible(true);
- Table tableFromSource = new Table(jdbcConnectionProvider, "actor");
- Table tableFromDataSource = new Table(dsConnectionProvider, "actor");
- Changes changesFromSource = new Changes(tableFromSource).setStartPointNow();
- Changes changesFromDataSource = new Changes(tableFromDataSource).setStartPointNow();
+ Table tableFromSource = assertDbConnection.table("actor").build();
+ Table tableFromDataSource = assertDbConnectionFromDs.table("actor").build();
+ Changes changesFromSource = assertDbConnection.changes().tables(tableFromSource).build().setStartPointNow();
+ Changes changesFromDataSource = assertDbConnectionFromDs.changes().tables(tableFromDataSource).build().setStartPointNow();
updateChangesForTests();
changesFromSource.setEndPointNow();
changesFromDataSource.setEndPointNow();
@@ -796,8 +809,8 @@ public void test_default_description_of_modification_change_on_table_of_changes(
field.setAccessible(true);
- Changes changesFromSource = new Changes(jdbcConnectionProvider).setStartPointNow();
- Changes changesFromDataSource = new Changes(dsConnectionProvider).setStartPointNow();
+ Changes changesFromSource = assertDbConnection.changes().build().setStartPointNow();
+ Changes changesFromDataSource = assertDbConnectionFromDs.changes().build().setStartPointNow();
updateChangesForTests();
changesFromSource.setEndPointNow();
changesFromDataSource.setEndPointNow();
@@ -824,10 +837,10 @@ public void test_default_description_of_modification_change_on_table_of_changes_
field.setAccessible(true);
- Table tableFromSource = new Table(jdbcConnectionProvider, "actor");
- Table tableFromDataSource = new Table(dsConnectionProvider, "actor");
- Changes changesFromSource = new Changes(tableFromSource).setStartPointNow();
- Changes changesFromDataSource = new Changes(tableFromDataSource).setStartPointNow();
+ Table tableFromSource = assertDbConnection.table("actor").build();
+ Table tableFromDataSource = assertDbConnectionFromDs.table("actor").build();
+ Changes changesFromSource = assertDbConnection.changes().tables(tableFromSource).build().setStartPointNow();
+ Changes changesFromDataSource = assertDbConnectionFromDs.changes().tables(tableFromDataSource).build().setStartPointNow();
updateChangesForTests();
changesFromSource.setEndPointNow();
changesFromDataSource.setEndPointNow();
@@ -854,8 +867,8 @@ public void test_default_description_of_deletion_change_on_table_of_changes() th
field.setAccessible(true);
- Changes changesFromSource = new Changes(jdbcConnectionProvider).setStartPointNow();
- Changes changesFromDataSource = new Changes(dsConnectionProvider).setStartPointNow();
+ Changes changesFromSource = assertDbConnection.changes().build().setStartPointNow();
+ Changes changesFromDataSource = assertDbConnectionFromDs.changes().build().setStartPointNow();
updateChangesForTests();
changesFromSource.setEndPointNow();
changesFromDataSource.setEndPointNow();
@@ -882,10 +895,10 @@ public void test_default_description_of_deletion_change_on_table_of_changes_on_t
field.setAccessible(true);
- Table tableFromSource = new Table(jdbcConnectionProvider, "actor");
- Table tableFromDataSource = new Table(dsConnectionProvider, "actor");
- Changes changesFromSource = new Changes(tableFromSource).setStartPointNow();
- Changes changesFromDataSource = new Changes(tableFromDataSource).setStartPointNow();
+ Table tableFromSource = assertDbConnection.table("actor").build();
+ Table tableFromDataSource = assertDbConnectionFromDs.table("actor").build();
+ Changes changesFromSource = assertDbConnection.changes().tables(tableFromSource).build().setStartPointNow();
+ Changes changesFromDataSource = assertDbConnectionFromDs.changes().tables(tableFromDataSource).build().setStartPointNow();
updateChangesForTests();
changesFromSource.setEndPointNow();
changesFromDataSource.setEndPointNow();
@@ -912,8 +925,8 @@ public void test_default_description_of_change_on_table_of_changes() throws Exce
field.setAccessible(true);
- Changes changesFromSource = new Changes(jdbcConnectionProvider).setStartPointNow();
- Changes changesFromDataSource = new Changes(dsConnectionProvider).setStartPointNow();
+ Changes changesFromSource = assertDbConnection.changes().build().setStartPointNow();
+ Changes changesFromDataSource = assertDbConnectionFromDs.changes().build().setStartPointNow();
updateChangesForTests();
changesFromSource.setEndPointNow();
changesFromDataSource.setEndPointNow();
@@ -939,10 +952,10 @@ public void test_default_description_of_change_on_table_of_changes_on_table() th
field.setAccessible(true);
- Table tableFromSource = new Table(jdbcConnectionProvider, "actor");
- Table tableFromDataSource = new Table(dsConnectionProvider, "actor");
- Changes changesFromSource = new Changes(tableFromSource).setStartPointNow();
- Changes changesFromDataSource = new Changes(tableFromDataSource).setStartPointNow();
+ Table tableFromSource = assertDbConnection.table("actor").build();
+ Table tableFromDataSource = assertDbConnectionFromDs.table("actor").build();
+ Changes changesFromSource = assertDbConnection.changes().tables(tableFromSource).build().setStartPointNow();
+ Changes changesFromDataSource = assertDbConnectionFromDs.changes().tables(tableFromDataSource).build().setStartPointNow();
updateChangesForTests();
changesFromSource.setEndPointNow();
changesFromDataSource.setEndPointNow();
@@ -969,8 +982,8 @@ public void test_default_description_of_change_on_table_with_pks_of_changes() th
field.setAccessible(true);
- Changes changesFromSource = new Changes(jdbcConnectionProvider).setStartPointNow();
- Changes changesFromDataSource = new Changes(dsConnectionProvider).setStartPointNow();
+ Changes changesFromSource = assertDbConnection.changes().build().setStartPointNow();
+ Changes changesFromDataSource = assertDbConnectionFromDs.changes().build().setStartPointNow();
updateChangesForTests();
changesFromSource.setEndPointNow();
changesFromDataSource.setEndPointNow();
@@ -997,10 +1010,10 @@ public void test_default_description_of_change_on_table_with_pks_of_changes_on_t
field.setAccessible(true);
- Table tableFromSource = new Table(jdbcConnectionProvider, "actor");
- Table tableFromDataSource = new Table(dsConnectionProvider, "actor");
- Changes changesFromSource = new Changes(tableFromSource).setStartPointNow();
- Changes changesFromDataSource = new Changes(tableFromDataSource).setStartPointNow();
+ Table tableFromSource = assertDbConnection.table("actor").build();
+ Table tableFromDataSource = assertDbConnectionFromDs.table("actor").build();
+ Changes changesFromSource = assertDbConnection.changes().tables(tableFromSource).build().setStartPointNow();
+ Changes changesFromDataSource = assertDbConnectionFromDs.changes().tables(tableFromDataSource).build().setStartPointNow();
updateChangesForTests();
changesFromSource.setEndPointNow();
changesFromDataSource.setEndPointNow();
@@ -1027,8 +1040,8 @@ public void test_default_description_column_of_change_of_changes() throws Except
field.setAccessible(true);
- Changes changesFromSource = new Changes(jdbcConnectionProvider).setStartPointNow();
- Changes changesFromDataSource = new Changes(dsConnectionProvider).setStartPointNow();
+ Changes changesFromSource = assertDbConnection.changes().build().setStartPointNow();
+ Changes changesFromDataSource = assertDbConnectionFromDs.changes().build().setStartPointNow();
updateChangesForTests();
changesFromSource.setEndPointNow();
changesFromDataSource.setEndPointNow();
@@ -1055,8 +1068,8 @@ public void test_default_description_row_at_start_point_of_change_of_changes() t
field.setAccessible(true);
- Changes changesFromSource = new Changes(jdbcConnectionProvider).setStartPointNow();
- Changes changesFromDataSource = new Changes(dsConnectionProvider).setStartPointNow();
+ Changes changesFromSource = assertDbConnection.changes().build().setStartPointNow();
+ Changes changesFromDataSource = assertDbConnectionFromDs.changes().build().setStartPointNow();
updateChangesForTests();
changesFromSource.setEndPointNow();
changesFromDataSource.setEndPointNow();
@@ -1083,8 +1096,8 @@ public void test_default_description_row_at_end_point_of_change_of_changes() thr
field.setAccessible(true);
- Changes changesFromSource = new Changes(jdbcConnectionProvider).setStartPointNow();
- Changes changesFromDataSource = new Changes(dsConnectionProvider).setStartPointNow();
+ Changes changesFromSource = assertDbConnection.changes().build().setStartPointNow();
+ Changes changesFromDataSource = assertDbConnectionFromDs.changes().build().setStartPointNow();
updateChangesForTests();
changesFromSource.setEndPointNow();
changesFromDataSource.setEndPointNow();
@@ -1111,8 +1124,8 @@ public void test_default_description_value_at_start_point_of_column_of_change_of
field.setAccessible(true);
- Changes changesFromSource = new Changes(jdbcConnectionProvider).setStartPointNow();
- Changes changesFromDataSource = new Changes(dsConnectionProvider).setStartPointNow();
+ Changes changesFromSource = assertDbConnection.changes().build().setStartPointNow();
+ Changes changesFromDataSource = assertDbConnectionFromDs.changes().build().setStartPointNow();
updateChangesForTests();
changesFromSource.setEndPointNow();
changesFromDataSource.setEndPointNow();
@@ -1140,8 +1153,8 @@ public void test_default_description_value_at_end_point_of_column_of_change_of_c
field.setAccessible(true);
- Changes changesFromSource = new Changes(jdbcConnectionProvider).setStartPointNow();
- Changes changesFromDataSource = new Changes(dsConnectionProvider).setStartPointNow();
+ Changes changesFromSource = assertDbConnection.changes().build().setStartPointNow();
+ Changes changesFromDataSource = assertDbConnectionFromDs.changes().build().setStartPointNow();
updateChangesForTests();
changesFromSource.setEndPointNow();
changesFromDataSource.setEndPointNow();
@@ -1169,8 +1182,8 @@ public void test_default_description_value_of_row_at_start_point_of_change_of_ch
field.setAccessible(true);
- Changes changesFromSource = new Changes(jdbcConnectionProvider).setStartPointNow();
- Changes changesFromDataSource = new Changes(dsConnectionProvider).setStartPointNow();
+ Changes changesFromSource = assertDbConnection.changes().build().setStartPointNow();
+ Changes changesFromDataSource = assertDbConnectionFromDs.changes().build().setStartPointNow();
updateChangesForTests();
changesFromSource.setEndPointNow();
changesFromDataSource.setEndPointNow();
@@ -1197,8 +1210,8 @@ public void test_default_description_value_of_row_at_end_point_of_change_of_chan
field.setAccessible(true);
- Changes changesFromSource = new Changes(jdbcConnectionProvider).setStartPointNow();
- Changes changesFromDataSource = new Changes(dsConnectionProvider).setStartPointNow();
+ Changes changesFromSource = assertDbConnection.changes().build().setStartPointNow();
+ Changes changesFromDataSource = assertDbConnectionFromDs.changes().build().setStartPointNow();
updateChangesForTests();
changesFromSource.setEndPointNow();
changesFromDataSource.setEndPointNow();
@@ -1224,8 +1237,8 @@ public void test_default_description_of_table() throws Exception {
field.setAccessible(true);
- Table tableFromSource = new Table(jdbcConnectionProvider, "actor");
- Table tableFromDataSource = new Table(dsConnectionProvider, "actor");
+ Table tableFromSource = assertDbConnection.table("actor").build();
+ Table tableFromDataSource = assertDbConnectionFromDs.table("actor").build();
TableAssert assertionFromSource = assertThat(tableFromSource);
@@ -1248,8 +1261,8 @@ public void test_default_description_of_request() throws Exception {
field.setAccessible(true);
- Request requestFromSource = new Request(jdbcConnectionProvider, "select id, name, firstname, birth from actor where id = 1").setPksName("ID");
- Request requestFromDataSource = new Request(dsConnectionProvider, "select * from actor").setPksName("ID");
+ Request requestFromSource = assertDbConnection.request("select id, name, firstname, birth from actor where id = 1").pksName("ID").build();
+ Request requestFromDataSource = assertDbConnectionFromDs.request("select * from actor").pksName("ID").build();
RequestAssert assertionFromSource = assertThat(requestFromSource);
@@ -1272,8 +1285,8 @@ public void test_default_description_of_column_of_table() throws Exception {
field.setAccessible(true);
- Table tableFromSource = new Table(jdbcConnectionProvider, "actor");
- Table tableFromDataSource = new Table(dsConnectionProvider, "actor");
+ Table tableFromSource = assertDbConnection.table("actor").build();
+ Table tableFromDataSource = assertDbConnectionFromDs.table("actor").build();
TableColumnAssert assertionFromSource = assertThat(tableFromSource).column();
@@ -1296,8 +1309,8 @@ public void test_default_description_of_row_of_table() throws Exception {
field.setAccessible(true);
- Table tableFromSource = new Table(jdbcConnectionProvider, "actor");
- Table tableFromDataSource = new Table(dsConnectionProvider, "actor");
+ Table tableFromSource = assertDbConnection.table("actor").build();
+ Table tableFromDataSource = assertDbConnectionFromDs.table("actor").build();
TableRowAssert assertionFromSource = assertThat(tableFromSource).row();
@@ -1320,8 +1333,8 @@ public void test_default_description_of_column_of_request() throws Exception {
field.setAccessible(true);
- Request requestFromSource = new Request(jdbcConnectionProvider, "select * from actor").setPksName("ID");
- Request requestFromDataSource = new Request(dsConnectionProvider, "select * from actor").setPksName("ID");
+ Request requestFromSource = assertDbConnection.request("select * from actor").pksName("ID").build();
+ Request requestFromDataSource = assertDbConnectionFromDs.request("select * from actor").pksName("ID").build();
RequestColumnAssert assertionFromSource = assertThat(requestFromSource).column();
@@ -1344,8 +1357,8 @@ public void test_default_description_of_row_of_request() throws Exception {
field.setAccessible(true);
- Request requestFromSource = new Request(jdbcConnectionProvider, "select * from actor").setPksName("ID");
- Request requestFromDataSource = new Request(dsConnectionProvider, "select * from actor").setPksName("ID");
+ Request requestFromSource = assertDbConnection.request("select * from actor").pksName("ID").build();
+ Request requestFromDataSource = assertDbConnectionFromDs.request("select * from actor").pksName("ID").build();
RequestRowAssert assertionFromSource = assertThat(requestFromSource).row();
@@ -1368,8 +1381,8 @@ public void test_default_description_of_value_of_column_of_table() throws Except
field.setAccessible(true);
- Table tableFromSource = new Table(jdbcConnectionProvider, "actor");
- Table tableFromDataSource = new Table(dsConnectionProvider, "actor");
+ Table tableFromSource = assertDbConnection.table("actor").build();
+ Table tableFromDataSource = assertDbConnectionFromDs.table("actor").build();
TableColumnValueAssert assertionFromSource = assertThat(tableFromSource).column().value();
@@ -1392,8 +1405,8 @@ public void test_default_description_of_value_of_row_of_table() throws Exception
field.setAccessible(true);
- Table tableFromSource = new Table(jdbcConnectionProvider, "actor");
- Table tableFromDataSource = new Table(dsConnectionProvider, "actor");
+ Table tableFromSource = assertDbConnection.table("actor").build();
+ Table tableFromDataSource = assertDbConnectionFromDs.table("actor").build();
TableRowValueAssert assertionFromSource = assertThat(tableFromSource).row().value();
@@ -1416,8 +1429,8 @@ public void test_default_description_of_value_of_column_of_request() throws Exce
field.setAccessible(true);
- Request requestFromSource = new Request(jdbcConnectionProvider, "select * from actor").setPksName("ID");
- Request requestFromDataSource = new Request(dsConnectionProvider, "select * from actor").setPksName("ID");
+ Request requestFromSource = assertDbConnection.request("select * from actor").pksName("ID").build();
+ Request requestFromDataSource = assertDbConnectionFromDs.request("select * from actor").pksName("ID").build();
RequestColumnValueAssert assertionFromSource = assertThat(requestFromSource).column().value();
@@ -1440,8 +1453,8 @@ public void test_default_description_of_value_of_row_of_request() throws Excepti
field.setAccessible(true);
- Request requestFromSource = new Request(jdbcConnectionProvider, "select * from actor").setPksName("ID");
- Request requestFromDataSource = new Request(dsConnectionProvider, "select * from actor").setPksName("ID");
+ Request requestFromSource = assertDbConnection.request("select * from actor").pksName("ID").build();
+ Request requestFromDataSource = assertDbConnectionFromDs.request("select * from actor").pksName("ID").build();
RequestRowValueAssert assertionFromSource = assertThat(requestFromSource).row().value();
diff --git a/src/test/java/org/assertj/db/api/Descriptable_Test.java b/src/test/java/org/assertj/db/api/Descriptable_Test.java
index 9cca5d4a..522fe6b0 100644
--- a/src/test/java/org/assertj/db/api/Descriptable_Test.java
+++ b/src/test/java/org/assertj/db/api/Descriptable_Test.java
@@ -40,7 +40,7 @@ public class Descriptable_Test extends AbstractTest {
public void test_as() throws Exception {
Field field = AbstractElement.class.getDeclaredField("info");
field.setAccessible(true);
- Table table = new Table(jdbcConnectionProvider, "actor");
+ Table table = assertDbConnection.table("actor").build();
TableRowAssert assertion = assertThat(table).row();
WritableAssertionInfo info1 = (WritableAssertionInfo) field.get(assertion);
diff --git a/src/test/java/org/assertj/db/api/SoftAssertions_Test.java b/src/test/java/org/assertj/db/api/SoftAssertions_Test.java
index 06707c51..499e4e49 100644
--- a/src/test/java/org/assertj/db/api/SoftAssertions_Test.java
+++ b/src/test/java/org/assertj/db/api/SoftAssertions_Test.java
@@ -37,7 +37,7 @@ public class SoftAssertions_Test extends AbstractTest {
@Test
@NeedReload
public void test_soft_assert_table() {
- Table table = new Table(jdbcConnectionProvider, "test");
+ Table table = assertDbConnection.table("test").build();
final SoftAssertions softly = new SoftAssertions();
softly.assertThat(table).as("Show be Zero").column("var1").value().isEqualTo(0);
softly.assertThat(table).column("var2").value().isFalse();
@@ -67,7 +67,7 @@ public void call() {
@Test
@NeedReload
public void test_soft_assert_request() {
- Request request = new Request(jdbcConnectionProvider, "select * from test");
+ Request request = assertDbConnection.request("select * from test").build();
final SoftAssertions softly = new SoftAssertions();
softly.assertThat(request).column("var1").value(0).isEqualTo(0);
softly.assertThat(request).column("var2").value(0).isFalse();
@@ -97,7 +97,7 @@ public void call() {
@Test
@NeedReload
public void test_soft_assert_changes() {
- Changes changes = new Changes(jdbcConnectionProvider);
+ Changes changes = assertDbConnection.changes().build();
changes.setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
changes.setEndPointNow();
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnChangeType_IsCreation_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnChangeType_IsCreation_Test.java
index fba5f299..21d19734 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnChangeType_IsCreation_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnChangeType_IsCreation_Test.java
@@ -36,8 +36,8 @@ public class AssertOnChangeType_IsCreation_Test extends AbstractTest {
*/
@Test
@NeedReload
- public void test_is_creation() throws Exception {
- Changes changes = new Changes(jdbcConnectionProvider).setStartPointNow();
+ public void test_is_creation() {
+ Changes changes = assertDbConnection.changes().build().setStartPointNow();
updateChangesForTests();
changes.setEndPointNow();
@@ -51,8 +51,8 @@ public void test_is_creation() throws Exception {
*/
@Test
@NeedReload
- public void should_fail_because_type_of_change_is_different() throws Exception {
- Changes changes = new Changes(jdbcConnectionProvider).setStartPointNow();
+ public void should_fail_because_type_of_change_is_different() {
+ Changes changes = assertDbConnection.changes().build().setStartPointNow();
updateChangesForTests();
changes.setEndPointNow();
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnChangeType_IsDeletion_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnChangeType_IsDeletion_Test.java
index ccbfa0cd..21228271 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnChangeType_IsDeletion_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnChangeType_IsDeletion_Test.java
@@ -36,8 +36,8 @@ public class AssertOnChangeType_IsDeletion_Test extends AbstractTest {
*/
@Test
@NeedReload
- public void test_is_deletion() throws Exception {
- Changes changes = new Changes(jdbcConnectionProvider).setStartPointNow();
+ public void test_is_deletion() {
+ Changes changes = assertDbConnection.changes().build().setStartPointNow();
updateChangesForTests();
changes.setEndPointNow();
@@ -51,8 +51,8 @@ public void test_is_deletion() throws Exception {
*/
@Test
@NeedReload
- public void should_fail_because_type_of_change_is_different() throws Exception {
- Changes changes = new Changes(jdbcConnectionProvider).setStartPointNow();
+ public void should_fail_because_type_of_change_is_different() {
+ Changes changes = assertDbConnection.changes().build().setStartPointNow();
updateChangesForTests();
changes.setEndPointNow();
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnChangeType_IsModification_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnChangeType_IsModification_Test.java
index 8192788d..f5265f14 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnChangeType_IsModification_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnChangeType_IsModification_Test.java
@@ -12,6 +12,9 @@
*/
package org.assertj.db.api.assertions;
+import static org.assertj.db.api.Assertions.assertThat;
+import static org.junit.Assert.fail;
+
import org.assertj.core.api.Assertions;
import org.assertj.db.api.ChangeAssert;
import org.assertj.db.common.AbstractTest;
@@ -19,9 +22,6 @@
import org.assertj.db.type.Changes;
import org.junit.Test;
-import static org.assertj.db.api.Assertions.assertThat;
-import static org.junit.Assert.fail;
-
/**
* Tests on {@link AssertOnChangeType} class :
* {@link AssertOnChangeType#isModification()}} method.
@@ -31,41 +31,41 @@
*/
public class AssertOnChangeType_IsModification_Test extends AbstractTest {
- /**
- * This method tests the {@code isModification} assertion method.
- */
- @Test
- @NeedReload
- public void test_is_modification() throws Exception {
- Changes changes = new Changes(jdbcConnectionProvider).setStartPointNow();
- updateChangesForTests();
- changes.setEndPointNow();
+ /**
+ * This method tests the {@code isModification} assertion method.
+ */
+ @Test
+ @NeedReload
+ public void test_is_modification() {
+ Changes changes = assertDbConnection.changes().build().setStartPointNow();
+ updateChangesForTests();
+ changes.setEndPointNow();
- ChangeAssert changeAssert = assertThat(changes).change(3);
- ChangeAssert changeAssert2 = changeAssert.isModification();
- Assertions.assertThat(changeAssert).isSameAs(changeAssert2);
- }
+ ChangeAssert changeAssert = assertThat(changes).change(3);
+ ChangeAssert changeAssert2 = changeAssert.isModification();
+ Assertions.assertThat(changeAssert).isSameAs(changeAssert2);
+ }
- /**
- * This method should fail because the type of change is different.
- */
- @Test
- @NeedReload
- public void should_fail_because_type_of_change_is_different() throws Exception {
- Changes changes = new Changes(jdbcConnectionProvider).setStartPointNow();
- updateChangesForTests();
- changes.setEndPointNow();
+ /**
+ * This method should fail because the type of change is different.
+ */
+ @Test
+ @NeedReload
+ public void should_fail_because_type_of_change_is_different() {
+ Changes changes = assertDbConnection.changes().build().setStartPointNow();
+ updateChangesForTests();
+ changes.setEndPointNow();
- try {
- assertThat(changes).change().isModification();
- fail("An exception must be raised");
- } catch (AssertionError e) {
- Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Change at index 0 (on table : ACTOR and with primary key : [4]) of Changes on tables of 'sa/jdbc:h2:mem:test'] %n"
- + "Expecting:%n"
- + "to be of type%n"
- + " %n"
- + "but was of type%n"
- + " "));
- }
+ try {
+ assertThat(changes).change().isModification();
+ fail("An exception must be raised");
+ } catch (AssertionError e) {
+ Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Change at index 0 (on table : ACTOR and with primary key : [4]) of Changes on tables of 'sa/jdbc:h2:mem:test'] %n"
+ + "Expecting:%n"
+ + "to be of type%n"
+ + " %n"
+ + "but was of type%n"
+ + " "));
}
+ }
}
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnChangeType_IsOfType_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnChangeType_IsOfType_Test.java
index 3d372386..f13f7638 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnChangeType_IsOfType_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnChangeType_IsOfType_Test.java
@@ -37,8 +37,8 @@ public class AssertOnChangeType_IsOfType_Test extends AbstractTest {
*/
@Test
@NeedReload
- public void test_is_of_type() throws Exception {
- Changes changes = new Changes(jdbcConnectionProvider).setStartPointNow();
+ public void test_is_of_type() {
+ Changes changes = assertDbConnection.changes().build().setStartPointNow();
updateChangesForTests();
changes.setEndPointNow();
@@ -52,8 +52,8 @@ public void test_is_of_type() throws Exception {
*/
@Test
@NeedReload
- public void should_fail_because_type_of_change_is_different() throws Exception {
- Changes changes = new Changes(jdbcConnectionProvider).setStartPointNow();
+ public void should_fail_because_type_of_change_is_different() {
+ Changes changes = assertDbConnection.changes().build().setStartPointNow();
updateChangesForTests();
changes.setEndPointNow();
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnColumnClass_IsOfClass_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnColumnClass_IsOfClass_Test.java
index 35abedfe..eda9b04a 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnColumnClass_IsOfClass_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnColumnClass_IsOfClass_Test.java
@@ -39,12 +39,12 @@ public class AssertOnColumnClass_IsOfClass_Test extends AbstractTest {
@Test
@NeedReload
public void test_is_of_type() {
- Changes changes = new Changes(jdbcConnectionProvider).setStartPointNow();
+ Changes changes = assertDbConnection.changes().build().setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
update("insert into test(var1, var2, var11, var10, var9, var3, var12, var8) values(5, true, FILE_READ('classpath:h2-logo-2.png'), '2014-05-24 09:46:30', '2014-05-24', 3, 'test', '09:46:30')");
changes.setEndPointNow();
- Table table = new Table(jdbcConnectionProvider, "test");
- Table table2 = new Table(jdbcConnectionProvider, "test2");
+ Table table = assertDbConnection.table("test").build();
+ Table table2 = assertDbConnection.table("test2").build();
ChangeColumnAssert changeColumnAssert1 = assertThat(changes).change().column("var2");
ChangeColumnAssert changeColumnAssertReturn1 = changeColumnAssert1.isOfClass(Boolean.class, true);
@@ -66,12 +66,12 @@ public void test_is_of_type() {
@Test
@NeedReload
public void should_fail_because_value_have_different_type() {
- Changes changes = new Changes(jdbcConnectionProvider).setStartPointNow();
+ Changes changes = assertDbConnection.changes().build().setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
update("insert into test(var1, var2, var11, var10, var9, var3, var12, var8) values(5, true, FILE_READ('classpath:h2-logo-2.png'), '2014-05-24 09:46:30', '2014-05-24', 3, 'test', '09:46:30')");
changes.setEndPointNow();
- Table table = new Table(jdbcConnectionProvider, "test");
- Table table2 = new Table(jdbcConnectionProvider, "test2");
+ Table table = assertDbConnection.table("test").build();
+ Table table2 = assertDbConnection.table("test2").build();
try {
assertThat(changes).change().column("var2").isOfClass(Boolean.class, false);
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnColumnContent_ContainsValues_Boolean_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnColumnContent_ContainsValues_Boolean_Test.java
index 947be5d0..c6e4c495 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnColumnContent_ContainsValues_Boolean_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnColumnContent_ContainsValues_Boolean_Test.java
@@ -34,13 +34,13 @@ public class AssertOnColumnContent_ContainsValues_Boolean_Test extends AbstractT
* This method tests the {@code containsValues} assertion method.
*/
@Test
- public void test_has_values() throws Exception {
- Table table = new Table(jdbcConnectionProvider, "test");
+ public void test_has_values() {
+ Table table = assertDbConnection.table("test").build();
TableColumnAssert tableColumnAssert = assertThat(table).column("var2");
TableColumnAssert tableColumnAssertReturn = tableColumnAssert.containsValues(true, false, false, false);
Assertions.assertThat(tableColumnAssert).isSameAs(tableColumnAssertReturn);
- Table table2 = new Table(jdbcConnectionProvider, "test2");
+ Table table2 = assertDbConnection.table("test2").build();
TableColumnAssert tableColumnAssert2 = assertThat(table2).column("var2");
TableColumnAssert tableColumnAssertReturn2 = tableColumnAssert2.containsValues(true, null);
Assertions.assertThat(tableColumnAssert2).isSameAs(tableColumnAssertReturn2);
@@ -50,8 +50,8 @@ public void test_has_values() throws Exception {
* This method should fail because the values are different.
*/
@Test
- public void should_fail_because_values_are_different() throws Exception {
- Table table = new Table(jdbcConnectionProvider, "test");
+ public void should_fail_because_values_are_different() {
+ Table table = assertDbConnection.table("test").build();
TableColumnAssert tableColumnAssert = assertThat(table).column("var2");
try {
tableColumnAssert.containsValues(true, false, true, false);
@@ -64,7 +64,7 @@ public void should_fail_because_values_are_different() throws Exception {
+ " <[true, false, true, false]>%n"
+ " (parameter at index 2 is not found)"));
}
- Table table2 = new Table(jdbcConnectionProvider, "test2");
+ Table table2 = assertDbConnection.table("test2").build();
TableColumnAssert tableColumnAssert2 = assertThat(table2).column("var2");
try {
tableColumnAssert2.containsValues(true, true);
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnColumnContent_ContainsValues_Bytes_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnColumnContent_ContainsValues_Bytes_Test.java
index 85f332cc..357f0030 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnColumnContent_ContainsValues_Bytes_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnColumnContent_ContainsValues_Bytes_Test.java
@@ -35,16 +35,16 @@ public class AssertOnColumnContent_ContainsValues_Bytes_Test extends AbstractTes
* This method tests the {@code containsValues} assertion method.
*/
@Test
- public void test_has_values() throws Exception {
+ public void test_has_values() {
byte[] bytesH2 = bytesContentFromClassPathOf("h2-logo-2.png");
byte[] bytesDev = bytesContentFromClassPathOf("logo-dev.jpg");
- Table table = new Table(jdbcConnectionProvider, "test");
+ Table table = assertDbConnection.table("test").build();
TableColumnAssert tableColumnAssert = assertThat(table).column("var11");
TableColumnAssert tableColumnAssertReturn = tableColumnAssert.containsValues(bytesH2, bytesDev, bytesDev, bytesDev);
Assertions.assertThat(tableColumnAssert).isSameAs(tableColumnAssertReturn);
- Table table2 = new Table(jdbcConnectionProvider, "test2");
+ Table table2 = assertDbConnection.table("test2").build();
TableColumnAssert tableColumnAssert2 = assertThat(table2).column("var11");
TableColumnAssert tableColumnAssertReturn2 = tableColumnAssert2.containsValues(bytesH2, null);
Assertions.assertThat(tableColumnAssert2).isSameAs(tableColumnAssertReturn2);
@@ -54,10 +54,10 @@ public void test_has_values() throws Exception {
* This method should fail because the values are different.
*/
@Test
- public void should_fail_because_values_are_different() throws Exception {
+ public void should_fail_because_values_are_different() {
byte[] bytesH2 = bytesContentFromClassPathOf("h2-logo-2.png");
- Table table = new Table(jdbcConnectionProvider, "test");
+ Table table = assertDbConnection.table("test").build();
TableColumnAssert tableColumnAssert = assertThat(table).column("var11");
try {
tableColumnAssert.containsValues(bytesH2, bytesH2, bytesH2, bytesH2);
@@ -68,7 +68,7 @@ public void should_fail_because_values_are_different() throws Exception {
+ " (parameter at index 1 is not found)"));
}
- Table table2 = new Table(jdbcConnectionProvider, "test2");
+ Table table2 = assertDbConnection.table("test2").build();
TableColumnAssert tableColumnAssert2 = assertThat(table2).column("var11");
try {
tableColumnAssert2.containsValues(bytesH2, bytesH2);
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnColumnContent_ContainsValues_Character_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnColumnContent_ContainsValues_Character_Test.java
index fd67e39c..6dae1114 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnColumnContent_ContainsValues_Character_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnColumnContent_ContainsValues_Character_Test.java
@@ -34,13 +34,13 @@ public class AssertOnColumnContent_ContainsValues_Character_Test extends Abstrac
* This method tests the {@code containsValues} assertion method.
*/
@Test
- public void test_has_values() throws Exception {
- Table table = new Table(jdbcConnectionProvider, "test");
+ public void test_has_values() {
+ Table table = assertDbConnection.table("test").build();
TableColumnAssert tableColumnAssert = assertThat(table).column("var16");
TableColumnAssert tableColumnAssertReturn = tableColumnAssert.containsValues('T', 'e', 's', 't');
Assertions.assertThat(tableColumnAssert).isSameAs(tableColumnAssertReturn);
- Table table2 = new Table(jdbcConnectionProvider, "test2");
+ Table table2 = assertDbConnection.table("test2").build();
TableColumnAssert tableColumnAssert2 = assertThat(table2).column("var17");
TableColumnAssert tableColumnAssertReturn2 = tableColumnAssert2.containsValues(null, 'T');
Assertions.assertThat(tableColumnAssert2).isSameAs(tableColumnAssertReturn2);
@@ -50,8 +50,8 @@ public void test_has_values() throws Exception {
* This method should fail because the values are different.
*/
@Test
- public void should_fail_because_values_are_different() throws Exception {
- Table table = new Table(jdbcConnectionProvider, "test");
+ public void should_fail_because_values_are_different() {
+ Table table = assertDbConnection.table("test").build();
TableColumnAssert tableColumnAssert = assertThat(table).column("var16");
try {
tableColumnAssert.containsValues('t', 'e', 's', 't');
@@ -64,7 +64,7 @@ public void should_fail_because_values_are_different() throws Exception {
+ " <['t', 'e', 's', 't']>%n"
+ " (parameter <'t'> at index 3 is not found)"));
}
- Table table2 = new Table(jdbcConnectionProvider, "test2");
+ Table table2 = assertDbConnection.table("test2").build();
TableColumnAssert tableColumnAssert2 = assertThat(table2).column("var17");
try {
tableColumnAssert2.containsValues('T', 'T');
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnColumnContent_ContainsValues_DateTimeValue_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnColumnContent_ContainsValues_DateTimeValue_Test.java
index 36167327..ae4c5e35 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnColumnContent_ContainsValues_DateTimeValue_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnColumnContent_ContainsValues_DateTimeValue_Test.java
@@ -37,8 +37,8 @@ public class AssertOnColumnContent_ContainsValues_DateTimeValue_Test extends Abs
* This method tests the {@code containsValues} assertion method.
*/
@Test
- public void test_has_values() throws Exception {
- Table table = new Table(jdbcConnectionProvider, "test");
+ public void test_has_values() {
+ Table table = assertDbConnection.table("test").build();
TableColumnAssert tableColumnAssert = assertThat(table).column("var10");
TableColumnAssert tableColumnAssertReturn = tableColumnAssert.containsValues(
DateTimeValue.of(DateValue.of(2014, 5, 24), TimeValue.of(9, 46, 30)),
@@ -47,7 +47,7 @@ public void test_has_values() throws Exception {
DateTimeValue.of(DateValue.of(2014, 5, 30)));
Assertions.assertThat(tableColumnAssert).isSameAs(tableColumnAssertReturn);
- Table table2 = new Table(jdbcConnectionProvider, "test2");
+ Table table2 = assertDbConnection.table("test2").build();
TableColumnAssert tableColumnAssert2 = assertThat(table2).column("var10");
TableColumnAssert tableColumnAssertReturn2 = tableColumnAssert2.containsValues(
DateTimeValue.of(DateValue.of(2014, 5, 24), TimeValue.of(9, 46, 30)),
@@ -73,8 +73,8 @@ public void test_has_values() throws Exception {
* This method should fail because the values are different.
*/
@Test
- public void should_fail_because_values_are_different() throws Exception {
- Table table = new Table(jdbcConnectionProvider, "test");
+ public void should_fail_because_values_are_different() {
+ Table table = assertDbConnection.table("test").build();
TableColumnAssert tableColumnAssert = assertThat(table).column("var10");
try {
tableColumnAssert.containsValues(DateTimeValue.of(DateValue.of(2014, 5, 24), TimeValue.of(9, 46, 30)),
@@ -96,7 +96,7 @@ public void should_fail_because_values_are_different() throws Exception {
+ " 2014-05-30T00:00:00.000000000]>%n"
+ " (parameter <2014-05-30T13:29:49.000000000> at index 1 is not found)"));
}
- Table table2 = new Table(jdbcConnectionProvider, "test2");
+ Table table2 = assertDbConnection.table("test2").build();
TableColumnAssert tableColumnAssert2 = assertThat(table2).column("var10");
try {
tableColumnAssert2.containsValues(DateTimeValue.of(DateValue.of(2014, 5, 24), TimeValue.of(9, 46, 30)),
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnColumnContent_ContainsValues_DateValue_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnColumnContent_ContainsValues_DateValue_Test.java
index 2987b77c..c2a0d2e5 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnColumnContent_ContainsValues_DateValue_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnColumnContent_ContainsValues_DateValue_Test.java
@@ -37,9 +37,9 @@ public class AssertOnColumnContent_ContainsValues_DateValue_Test extends Abstrac
*/
@Test
@NeedReload
- public void test_has_values() throws Exception {
+ public void test_has_values() {
update("update test2 set var10 = '2014-05-24' where var1 = 1");
- Table table = new Table(jdbcConnectionProvider, "test");
+ Table table = assertDbConnection.table("test").build();
TableColumnAssert tableColumnAssert = assertThat(table).column("var9");
TableColumnAssert tableColumnAssertReturn = tableColumnAssert.containsValues(
DateValue.of(2014, 5, 24),
@@ -48,7 +48,7 @@ public void test_has_values() throws Exception {
DateValue.of(2014, 5, 30));
Assertions.assertThat(tableColumnAssert).isSameAs(tableColumnAssertReturn);
- Table table2 = new Table(jdbcConnectionProvider, "test2");
+ Table table2 = assertDbConnection.table("test2").build();
TableColumnAssert tableColumnAssert2 = assertThat(table2).column("var9");
TableColumnAssert tableColumnAssertReturn2 = tableColumnAssert2.containsValues(DateValue.of(2014, 5, 24),
null);
@@ -63,8 +63,8 @@ public void test_has_values() throws Exception {
* This method should fail because the values are different.
*/
@Test
- public void should_fail_because_values_are_different() throws Exception {
- Table table = new Table(jdbcConnectionProvider, "test");
+ public void should_fail_because_values_are_different() {
+ Table table = assertDbConnection.table("test").build();
TableColumnAssert tableColumnAssert = assertThat(table).column("var9");
try {
tableColumnAssert.containsValues(DateValue.of(2014, 5, 24),
@@ -83,7 +83,7 @@ public void should_fail_because_values_are_different() throws Exception {
+ " <[2014-05-24, 2014-05-29, 2014-05-30, 2014-05-30]>%n"
+ " (parameter <2014-05-29> at index 1 is not found)"));
}
- Table table2 = new Table(jdbcConnectionProvider, "test2");
+ Table table2 = assertDbConnection.table("test2").build();
TableColumnAssert tableColumnAssert2 = assertThat(table2).column("var9");
try {
tableColumnAssert2.containsValues(DateValue.of(2014, 5, 24),
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnColumnContent_ContainsValues_Number_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnColumnContent_ContainsValues_Number_Test.java
index 6dc649a5..267e0c27 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnColumnContent_ContainsValues_Number_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnColumnContent_ContainsValues_Number_Test.java
@@ -34,13 +34,13 @@ public class AssertOnColumnContent_ContainsValues_Number_Test extends AbstractTe
* This method tests the {@code containsValues} assertion method.
*/
@Test
- public void test_has_values() throws Exception {
- Table table = new Table(jdbcConnectionProvider, "test");
+ public void test_has_values() {
+ Table table = assertDbConnection.table("test").build();
TableColumnAssert tableColumnAssert = assertThat(table).column("var3");
TableColumnAssert tableColumnAssertReturn = tableColumnAssert.containsValues(2, 20, 25, 0);
Assertions.assertThat(tableColumnAssert).isSameAs(tableColumnAssertReturn);
- Table table2 = new Table(jdbcConnectionProvider, "test2");
+ Table table2 = assertDbConnection.table("test2").build();
TableColumnAssert tableColumnAssert2 = assertThat(table2).column("var3");
TableColumnAssert tableColumnAssertReturn2 = tableColumnAssert2.containsValues(2, null);
Assertions.assertThat(tableColumnAssert2).isSameAs(tableColumnAssertReturn2);
@@ -98,8 +98,8 @@ public void test_has_values() throws Exception {
* This method should fail because the values are different.
*/
@Test
- public void should_fail_because_values_are_different() throws Exception {
- Table table = new Table(jdbcConnectionProvider, "test");
+ public void should_fail_because_values_are_different() {
+ Table table = assertDbConnection.table("test").build();
TableColumnAssert tableColumnAssert = assertThat(table).column("var3");
try {
tableColumnAssert.containsValues(2, 20, 35, 0);
@@ -112,7 +112,7 @@ public void should_fail_because_values_are_different() throws Exception {
+ " <[2, 20, 35, 0]>%n"
+ " (parameter <35> at index 2 is not found)"));
}
- Table table2 = new Table(jdbcConnectionProvider, "test2");
+ Table table2 = assertDbConnection.table("test2").build();
TableColumnAssert tableColumnAssert2 = assertThat(table2).column("var3");
try {
tableColumnAssert2.containsValues(2, 2);
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnColumnContent_ContainsValues_String_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnColumnContent_ContainsValues_String_Test.java
index d81c2e8e..63f94e17 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnColumnContent_ContainsValues_String_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnColumnContent_ContainsValues_String_Test.java
@@ -36,13 +36,13 @@ public class AssertOnColumnContent_ContainsValues_String_Test extends AbstractTe
*/
@Test
@NeedReload
- public void test_has_values() throws Exception {
- Table table = new Table(jdbcConnectionProvider, "test");
+ public void test_has_values() {
+ Table table = assertDbConnection.table("test").build();
TableColumnAssert tableColumnAssert = assertThat(table).column("var3");
TableColumnAssert tableColumnAssertReturn = tableColumnAssert.containsValues("2", "20", "25", "0");
Assertions.assertThat(tableColumnAssert).isSameAs(tableColumnAssertReturn);
- Table table2 = new Table(jdbcConnectionProvider, "test2");
+ Table table2 = assertDbConnection.table("test2").build();
TableColumnAssert tableColumnAssert2 = assertThat(table2).column("var3");
TableColumnAssert tableColumnAssertReturn2 = tableColumnAssert2.containsValues("2", null);
Assertions.assertThat(tableColumnAssert2).isSameAs(tableColumnAssertReturn2);
@@ -155,7 +155,7 @@ public void test_has_values() throws Exception {
Assertions.assertThat(tableColumnAssert18).isSameAs(tableColumnAssertReturn18);
update("update test2 set var10 = '2014-05-24' where var1 = 1");
- table2 = new Table(jdbcConnectionProvider, "test2");
+ table2 = assertDbConnection.table("test2").build();
TableColumnAssert tableColumnAssert19 = assertThat(table2).column("var10");
TableColumnAssert tableColumnAssertReturn19 = tableColumnAssert19.containsValues("2014-05-24",
null);
@@ -172,8 +172,8 @@ public void test_has_values() throws Exception {
* This method should fail because the values are different.
*/
@Test
- public void should_fail_because_values_are_different() throws Exception {
- Table table = new Table(jdbcConnectionProvider, "test");
+ public void should_fail_because_values_are_different() {
+ Table table = assertDbConnection.table("test").build();
TableColumnAssert tableColumnAssert = assertThat(table).column("var3");
try {
tableColumnAssert.containsValues("2", "20", "35", "0");
@@ -186,7 +186,7 @@ public void should_fail_because_values_are_different() throws Exception {
+ " <[\"2\", \"20\", \"35\", \"0\"]>%n"
+ " (parameter <\"35\"> at index 2 is not found)"));
}
- Table table2 = new Table(jdbcConnectionProvider, "test2");
+ Table table2 = assertDbConnection.table("test2").build();
TableColumnAssert tableColumnAssert2 = assertThat(table2).column("var3");
try {
tableColumnAssert2.containsValues("2", "2");
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnColumnContent_HasValues_TimeValue_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnColumnContent_HasValues_TimeValue_Test.java
index e2a07984..94570202 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnColumnContent_HasValues_TimeValue_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnColumnContent_HasValues_TimeValue_Test.java
@@ -35,8 +35,8 @@ public class AssertOnColumnContent_HasValues_TimeValue_Test extends AbstractTest
* This method tests the {@code containsValues} assertion method.
*/
@Test
- public void test_has_values() throws Exception {
- Table table = new Table(jdbcConnectionProvider, "test");
+ public void test_has_values() {
+ Table table = assertDbConnection.table("test").build();
TableColumnAssert tableColumnAssert = assertThat(table).column("var8");
TableColumnAssert tableColumnAssertReturn = tableColumnAssert.containsValues(TimeValue.of(9, 46, 30),
TimeValue.of(12, 29, 49),
@@ -44,7 +44,7 @@ public void test_has_values() throws Exception {
TimeValue.of(12, 29, 49));
Assertions.assertThat(tableColumnAssert).isSameAs(tableColumnAssertReturn);
- Table table2 = new Table(jdbcConnectionProvider, "test2");
+ Table table2 = assertDbConnection.table("test2").build();
TableColumnAssert tableColumnAssert2 = assertThat(table2).column("var8");
TableColumnAssert tableColumnAssertReturn2 = tableColumnAssert2.containsValues(TimeValue.of(9, 46, 30), null);
Assertions.assertThat(tableColumnAssert2).isSameAs(tableColumnAssertReturn2);
@@ -54,8 +54,8 @@ public void test_has_values() throws Exception {
* This method should fail because the values are different.
*/
@Test
- public void should_fail_because_values_are_different() throws Exception {
- Table table = new Table(jdbcConnectionProvider, "test");
+ public void should_fail_because_values_are_different() {
+ Table table = assertDbConnection.table("test").build();
TableColumnAssert tableColumnAssert = assertThat(table).column("var8");
try {
tableColumnAssert.containsValues(TimeValue.of(12, 29, 49),
@@ -77,7 +77,7 @@ public void should_fail_because_values_are_different() throws Exception {
+ "12:29:49.000000000]>%n"
+ " (parameter <12:29:49.000000000> at index 3 is not found)"));
}
- Table table2 = new Table(jdbcConnectionProvider, "test2");
+ Table table2 = assertDbConnection.table("test2").build();
TableColumnAssert tableColumnAssert2 = assertThat(table2).column("var8");
try {
tableColumnAssert2.containsValues(TimeValue.of(9, 46, 30),
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnColumnContent_HasValues_UUID_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnColumnContent_HasValues_UUID_Test.java
index 9deb4bec..d7f75fe2 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnColumnContent_HasValues_UUID_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnColumnContent_HasValues_UUID_Test.java
@@ -35,8 +35,8 @@ public class AssertOnColumnContent_HasValues_UUID_Test extends AbstractTest {
* This method tests the {@code containsValues} assertion method.
*/
@Test
- public void test_has_values() throws Exception {
- Table table = new Table(jdbcConnectionProvider, "test");
+ public void test_has_values() {
+ Table table = assertDbConnection.table("test").build();
TableColumnAssert tableColumnAssert = assertThat(table).column("var15");
TableColumnAssert tableColumnAssertReturn = tableColumnAssert.containsValues(
UUID.fromString("30B443AE-C0C9-4790-9BEC-CE1380808435"),
@@ -46,7 +46,7 @@ public void test_has_values() throws Exception {
);
Assertions.assertThat(tableColumnAssert).isSameAs(tableColumnAssertReturn);
- Table table2 = new Table(jdbcConnectionProvider, "test2");
+ Table table2 = assertDbConnection.table("test2").build();
TableColumnAssert tableColumnAssert2 = assertThat(table2).column("var16");
TableColumnAssert tableColumnAssertReturn2 = tableColumnAssert2
.containsValues(UUID.fromString("30B443AE-C0C9-4790-9BEC-CE1380808435"), null);
@@ -57,8 +57,8 @@ public void test_has_values() throws Exception {
* This method should fail because the values are different.
*/
@Test
- public void should_fail_because_values_are_different() throws Exception {
- Table table = new Table(jdbcConnectionProvider, "test");
+ public void should_fail_because_values_are_different() {
+ Table table = assertDbConnection.table("test").build();
TableColumnAssert tableColumnAssert = assertThat(table).column("var15");
try {
tableColumnAssert.containsValues(UUID.fromString("F96EC595-CE91-47CC-9152-CCC8AC48AAD6"),
@@ -81,7 +81,7 @@ public void should_fail_because_values_are_different() throws Exception {
+ " f96ec595-ce91-47cc-9152-ccc8ac48aad6]>%n"
+ " (parameter at index 0 is not found)"));
}
- Table table2 = new Table(jdbcConnectionProvider, "test2");
+ Table table2 = assertDbConnection.table("test2").build();
TableColumnAssert tableColumnAssert2 = assertThat(table2).column("var16");
try {
tableColumnAssert2.containsValues(UUID.fromString("30B443AE-C0C9-4790-9BEC-CE1380808435"),
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnColumnEquality_HasValues_Boolean_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnColumnEquality_HasValues_Boolean_Test.java
index 35ccfe9c..9320401c 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnColumnEquality_HasValues_Boolean_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnColumnEquality_HasValues_Boolean_Test.java
@@ -34,13 +34,13 @@ public class AssertOnColumnEquality_HasValues_Boolean_Test extends AbstractTest
* This method tests the {@code hasValues} assertion method.
*/
@Test
- public void test_has_values() throws Exception {
- Table table = new Table(jdbcConnectionProvider, "test");
+ public void test_has_values() {
+ Table table = assertDbConnection.table("test").build();
TableColumnAssert tableColumnAssert = assertThat(table).column("var2");
TableColumnAssert tableColumnAssertReturn = tableColumnAssert.hasValues(true, false, false, false);
Assertions.assertThat(tableColumnAssert).isSameAs(tableColumnAssertReturn);
- Table table2 = new Table(jdbcConnectionProvider, "test2");
+ Table table2 = assertDbConnection.table("test2").build();
TableColumnAssert tableColumnAssert2 = assertThat(table2).column("var2");
TableColumnAssert tableColumnAssertReturn2 = tableColumnAssert2.hasValues(true, null);
Assertions.assertThat(tableColumnAssert2).isSameAs(tableColumnAssertReturn2);
@@ -50,8 +50,8 @@ public void test_has_values() throws Exception {
* This method should fail because the values are different.
*/
@Test
- public void should_fail_because_values_are_different() throws Exception {
- Table table = new Table(jdbcConnectionProvider, "test");
+ public void should_fail_because_values_are_different() {
+ Table table = assertDbConnection.table("test").build();
TableColumnAssert tableColumnAssert = assertThat(table).column("var2");
try {
tableColumnAssert.hasValues(true, false, true, false);
@@ -63,7 +63,7 @@ public void should_fail_because_values_are_different() throws Exception {
+ "to be equal to: %n"
+ " "));
}
- Table table2 = new Table(jdbcConnectionProvider, "test2");
+ Table table2 = assertDbConnection.table("test2").build();
TableColumnAssert tableColumnAssert2 = assertThat(table2).column("var2");
try {
tableColumnAssert2.hasValues(true, true);
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnColumnEquality_HasValues_Bytes_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnColumnEquality_HasValues_Bytes_Test.java
index 22c901c4..56103f82 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnColumnEquality_HasValues_Bytes_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnColumnEquality_HasValues_Bytes_Test.java
@@ -35,16 +35,16 @@ public class AssertOnColumnEquality_HasValues_Bytes_Test extends AbstractTest {
* This method tests the {@code hasValues} assertion method.
*/
@Test
- public void test_has_values() throws Exception {
+ public void test_has_values() {
byte[] bytesH2 = bytesContentFromClassPathOf("h2-logo-2.png");
byte[] bytesDev = bytesContentFromClassPathOf("logo-dev.jpg");
- Table table = new Table(jdbcConnectionProvider, "test");
+ Table table = assertDbConnection.table("test").build();
TableColumnAssert tableColumnAssert = assertThat(table).column("var11");
TableColumnAssert tableColumnAssertReturn = tableColumnAssert.hasValues(bytesH2, bytesDev, bytesDev, bytesDev);
Assertions.assertThat(tableColumnAssert).isSameAs(tableColumnAssertReturn);
- Table table2 = new Table(jdbcConnectionProvider, "test2");
+ Table table2 = assertDbConnection.table("test2").build();
TableColumnAssert tableColumnAssert2 = assertThat(table2).column("var11");
TableColumnAssert tableColumnAssertReturn2 = tableColumnAssert2.hasValues(bytesH2, null);
Assertions.assertThat(tableColumnAssert2).isSameAs(tableColumnAssertReturn2);
@@ -54,10 +54,10 @@ public void test_has_values() throws Exception {
* This method should fail because the values are different.
*/
@Test
- public void should_fail_because_values_are_different() throws Exception {
+ public void should_fail_because_values_are_different() {
byte[] bytesH2 = bytesContentFromClassPathOf("h2-logo-2.png");
- Table table = new Table(jdbcConnectionProvider, "test");
+ Table table = assertDbConnection.table("test").build();
TableColumnAssert tableColumnAssert = assertThat(table).column("var11");
try {
tableColumnAssert.hasValues(bytesH2, bytesH2, bytesH2, bytesH2);
@@ -67,7 +67,7 @@ public void should_fail_because_values_are_different() throws Exception {
+ "Expecting that the value at index 1 to be equal to the expected value but was not equal"));
}
- Table table2 = new Table(jdbcConnectionProvider, "test2");
+ Table table2 = assertDbConnection.table("test2").build();
TableColumnAssert tableColumnAssert2 = assertThat(table2).column("var11");
try {
tableColumnAssert2.hasValues(bytesH2, bytesH2);
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnColumnEquality_HasValues_Character_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnColumnEquality_HasValues_Character_Test.java
index f14313e1..6b4cd512 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnColumnEquality_HasValues_Character_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnColumnEquality_HasValues_Character_Test.java
@@ -34,13 +34,13 @@ public class AssertOnColumnEquality_HasValues_Character_Test extends AbstractTes
* This method tests the {@code hasValues} assertion method.
*/
@Test
- public void test_has_values() throws Exception {
- Table table = new Table(jdbcConnectionProvider, "test");
+ public void test_has_values() {
+ Table table = assertDbConnection.table("test").build();
TableColumnAssert tableColumnAssert = assertThat(table).column("var16");
TableColumnAssert tableColumnAssertReturn = tableColumnAssert.hasValues('T', 'e', 's', 't');
Assertions.assertThat(tableColumnAssert).isSameAs(tableColumnAssertReturn);
- Table table2 = new Table(jdbcConnectionProvider, "test2");
+ Table table2 = assertDbConnection.table("test2").build();
TableColumnAssert tableColumnAssert2 = assertThat(table2).column("var17");
TableColumnAssert tableColumnAssertReturn2 = tableColumnAssert2.hasValues('T', null);
Assertions.assertThat(tableColumnAssert2).isSameAs(tableColumnAssertReturn2);
@@ -50,8 +50,8 @@ public void test_has_values() throws Exception {
* This method should fail because the values are different.
*/
@Test
- public void should_fail_because_values_are_different() throws Exception {
- Table table = new Table(jdbcConnectionProvider, "test");
+ public void should_fail_because_values_are_different() {
+ Table table = assertDbConnection.table("test").build();
TableColumnAssert tableColumnAssert = assertThat(table).column("var16");
try {
tableColumnAssert.hasValues('t', 'e', 's', 'T');
@@ -63,7 +63,7 @@ public void should_fail_because_values_are_different() throws Exception {
+ "to be equal to: %n"
+ " <'t'>"));
}
- Table table2 = new Table(jdbcConnectionProvider, "test2");
+ Table table2 = assertDbConnection.table("test2").build();
TableColumnAssert tableColumnAssert2 = assertThat(table2).column("var17");
try {
tableColumnAssert2.hasValues('T', 'T');
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnColumnEquality_HasValues_DateTimeValue_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnColumnEquality_HasValues_DateTimeValue_Test.java
index 08fcdcbe..c7ebe5fe 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnColumnEquality_HasValues_DateTimeValue_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnColumnEquality_HasValues_DateTimeValue_Test.java
@@ -37,8 +37,8 @@ public class AssertOnColumnEquality_HasValues_DateTimeValue_Test extends Abstrac
* This method tests the {@code hasValues} assertion method.
*/
@Test
- public void test_has_values() throws Exception {
- Table table = new Table(jdbcConnectionProvider, "test");
+ public void test_has_values() {
+ Table table = assertDbConnection.table("test").build();
TableColumnAssert tableColumnAssert = assertThat(table).column("var10");
TableColumnAssert tableColumnAssertReturn = tableColumnAssert.hasValues(
DateTimeValue.of(DateValue.of(2014, 5, 24), TimeValue.of(9, 46, 30)),
@@ -47,7 +47,7 @@ public void test_has_values() throws Exception {
DateTimeValue.of(DateValue.of(2014, 5, 30)));
Assertions.assertThat(tableColumnAssert).isSameAs(tableColumnAssertReturn);
- Table table2 = new Table(jdbcConnectionProvider, "test2");
+ Table table2 = assertDbConnection.table("test2").build();
TableColumnAssert tableColumnAssert2 = assertThat(table2).column("var10");
TableColumnAssert tableColumnAssertReturn2 = tableColumnAssert2.hasValues(
DateTimeValue.of(DateValue.of(2014, 5, 24), TimeValue.of(9, 46, 30)),
@@ -73,8 +73,8 @@ public void test_has_values() throws Exception {
* This method should fail because the values are different.
*/
@Test
- public void should_fail_because_values_are_different() throws Exception {
- Table table = new Table(jdbcConnectionProvider, "test");
+ public void should_fail_because_values_are_different() {
+ Table table = assertDbConnection.table("test").build();
TableColumnAssert tableColumnAssert = assertThat(table).column("var10");
try {
tableColumnAssert.hasValues(DateTimeValue.of(DateValue.of(2014, 5, 24), TimeValue.of(9, 46, 30)),
@@ -89,7 +89,7 @@ public void should_fail_because_values_are_different() throws Exception {
+ "to be equal to: %n"
+ " <2014-05-30T13:29:49.000000000>"));
}
- Table table2 = new Table(jdbcConnectionProvider, "test2");
+ Table table2 = assertDbConnection.table("test2").build();
TableColumnAssert tableColumnAssert2 = assertThat(table2).column("var10");
try {
tableColumnAssert2.hasValues(DateTimeValue.of(DateValue.of(2014, 5, 24), TimeValue.of(9, 46, 30)),
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnColumnEquality_HasValues_DateValue_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnColumnEquality_HasValues_DateValue_Test.java
index 08de07ff..f55774e4 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnColumnEquality_HasValues_DateValue_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnColumnEquality_HasValues_DateValue_Test.java
@@ -37,9 +37,9 @@ public class AssertOnColumnEquality_HasValues_DateValue_Test extends AbstractTes
*/
@Test
@NeedReload
- public void test_has_values() throws Exception {
+ public void test_has_values() {
update("update test2 set var10 = '2014-05-24' where var1 = 1");
- Table table = new Table(jdbcConnectionProvider, "test");
+ Table table = assertDbConnection.table("test").build();
TableColumnAssert tableColumnAssert = assertThat(table).column("var9");
TableColumnAssert tableColumnAssertReturn = tableColumnAssert.hasValues(
DateValue.of(2014, 5, 24),
@@ -48,7 +48,7 @@ public void test_has_values() throws Exception {
DateValue.of(2014, 5, 30));
Assertions.assertThat(tableColumnAssert).isSameAs(tableColumnAssertReturn);
- Table table2 = new Table(jdbcConnectionProvider, "test2");
+ Table table2 = assertDbConnection.table("test2").build();
TableColumnAssert tableColumnAssert2 = assertThat(table2).column("var9");
TableColumnAssert tableColumnAssertReturn2 = tableColumnAssert2.hasValues(DateValue.of(2014, 5, 24),
null);
@@ -63,8 +63,8 @@ public void test_has_values() throws Exception {
* This method should fail because the values are different.
*/
@Test
- public void should_fail_because_values_are_different() throws Exception {
- Table table = new Table(jdbcConnectionProvider, "test");
+ public void should_fail_because_values_are_different() {
+ Table table = assertDbConnection.table("test").build();
TableColumnAssert tableColumnAssert = assertThat(table).column("var9");
try {
tableColumnAssert.hasValues(DateValue.of(2014, 5, 24),
@@ -79,7 +79,7 @@ public void should_fail_because_values_are_different() throws Exception {
+ "to be equal to: %n"
+ " <2014-05-29>"));
}
- Table table2 = new Table(jdbcConnectionProvider, "test2");
+ Table table2 = assertDbConnection.table("test2").build();
TableColumnAssert tableColumnAssert2 = assertThat(table2).column("var9");
try {
tableColumnAssert2.hasValues(DateValue.of(2014, 5, 24),
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnColumnEquality_HasValues_Number_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnColumnEquality_HasValues_Number_Test.java
index 22ea82e0..b6679c80 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnColumnEquality_HasValues_Number_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnColumnEquality_HasValues_Number_Test.java
@@ -34,13 +34,13 @@ public class AssertOnColumnEquality_HasValues_Number_Test extends AbstractTest {
* This method tests the {@code hasValues} assertion method.
*/
@Test
- public void test_has_values() throws Exception {
- Table table = new Table(jdbcConnectionProvider, "test");
+ public void test_has_values() {
+ Table table = assertDbConnection.table("test").build();
TableColumnAssert tableColumnAssert = assertThat(table).column("var3");
TableColumnAssert tableColumnAssertReturn = tableColumnAssert.hasValues(2, 20, 25, 0);
Assertions.assertThat(tableColumnAssert).isSameAs(tableColumnAssertReturn);
- Table table2 = new Table(jdbcConnectionProvider, "test2");
+ Table table2 = assertDbConnection.table("test2").build();
TableColumnAssert tableColumnAssert2 = assertThat(table2).column("var3");
TableColumnAssert tableColumnAssertReturn2 = tableColumnAssert2.hasValues(2, null);
Assertions.assertThat(tableColumnAssert2).isSameAs(tableColumnAssertReturn2);
@@ -98,8 +98,8 @@ public void test_has_values() throws Exception {
* This method should fail because the values are different.
*/
@Test
- public void should_fail_because_values_are_different() throws Exception {
- Table table = new Table(jdbcConnectionProvider, "test");
+ public void should_fail_because_values_are_different() {
+ Table table = assertDbConnection.table("test").build();
TableColumnAssert tableColumnAssert = assertThat(table).column("var3");
try {
tableColumnAssert.hasValues(2, 20, 35, 0);
@@ -111,7 +111,7 @@ public void should_fail_because_values_are_different() throws Exception {
+ "to be equal to: %n"
+ " <35>"));
}
- Table table2 = new Table(jdbcConnectionProvider, "test2");
+ Table table2 = assertDbConnection.table("test2").build();
TableColumnAssert tableColumnAssert2 = assertThat(table2).column("var3");
try {
tableColumnAssert2.hasValues(2, 2);
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnColumnEquality_HasValues_String_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnColumnEquality_HasValues_String_Test.java
index 6a06df36..37936dd8 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnColumnEquality_HasValues_String_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnColumnEquality_HasValues_String_Test.java
@@ -36,13 +36,13 @@ public class AssertOnColumnEquality_HasValues_String_Test extends AbstractTest {
*/
@Test
@NeedReload
- public void test_has_values() throws Exception {
- Table table = new Table(jdbcConnectionProvider, "test");
+ public void test_has_values() {
+ Table table = assertDbConnection.table("test").build();
TableColumnAssert tableColumnAssert = assertThat(table).column("var3");
TableColumnAssert tableColumnAssertReturn = tableColumnAssert.hasValues("2", "20", "25", "0");
Assertions.assertThat(tableColumnAssert).isSameAs(tableColumnAssertReturn);
- Table table2 = new Table(jdbcConnectionProvider, "test2");
+ Table table2 = assertDbConnection.table("test2").build();
TableColumnAssert tableColumnAssert2 = assertThat(table2).column("var3");
TableColumnAssert tableColumnAssertReturn2 = tableColumnAssert2.hasValues("2", null);
Assertions.assertThat(tableColumnAssert2).isSameAs(tableColumnAssertReturn2);
@@ -155,7 +155,7 @@ public void test_has_values() throws Exception {
Assertions.assertThat(tableColumnAssert18).isSameAs(tableColumnAssertReturn18);
update("update test2 set var10 = '2014-05-24' where var1 = 1");
- table2 = new Table(jdbcConnectionProvider, "test2");
+ table2 = assertDbConnection.table("test2").build();
TableColumnAssert tableColumnAssert19 = assertThat(table2).column("var10");
TableColumnAssert tableColumnAssertReturn19 = tableColumnAssert19.hasValues("2014-05-24",
null);
@@ -171,8 +171,8 @@ public void test_has_values() throws Exception {
* This method should fail because the values are different.
*/
@Test
- public void should_fail_because_values_are_different() throws Exception {
- Table table = new Table(jdbcConnectionProvider, "test");
+ public void should_fail_because_values_are_different() {
+ Table table = assertDbConnection.table("test").build();
TableColumnAssert tableColumnAssert = assertThat(table).column("var3");
try {
tableColumnAssert.hasValues("2", "20", "35", "0");
@@ -184,7 +184,7 @@ public void should_fail_because_values_are_different() throws Exception {
+ "to be equal to: %n"
+ " <\"35\">"));
}
- Table table2 = new Table(jdbcConnectionProvider, "test2");
+ Table table2 = assertDbConnection.table("test2").build();
TableColumnAssert tableColumnAssert2 = assertThat(table2).column("var3");
try {
tableColumnAssert2.hasValues("2", "2");
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnColumnEquality_HasValues_TimeValue_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnColumnEquality_HasValues_TimeValue_Test.java
index df1b4b2e..7ba0be60 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnColumnEquality_HasValues_TimeValue_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnColumnEquality_HasValues_TimeValue_Test.java
@@ -35,8 +35,8 @@ public class AssertOnColumnEquality_HasValues_TimeValue_Test extends AbstractTes
* This method tests the {@code hasValues} assertion method.
*/
@Test
- public void test_has_values() throws Exception {
- Table table = new Table(jdbcConnectionProvider, "test");
+ public void test_has_values() {
+ Table table = assertDbConnection.table("test").build();
TableColumnAssert tableColumnAssert = assertThat(table).column("var8");
TableColumnAssert tableColumnAssertReturn = tableColumnAssert.hasValues(TimeValue.of(9, 46, 30),
TimeValue.of(12, 29, 49),
@@ -44,7 +44,7 @@ public void test_has_values() throws Exception {
TimeValue.of(12, 29, 49));
Assertions.assertThat(tableColumnAssert).isSameAs(tableColumnAssertReturn);
- Table table2 = new Table(jdbcConnectionProvider, "test2");
+ Table table2 = assertDbConnection.table("test2").build();
TableColumnAssert tableColumnAssert2 = assertThat(table2).column("var8");
TableColumnAssert tableColumnAssertReturn2 = tableColumnAssert2.hasValues(TimeValue.of(9, 46, 30), null);
Assertions.assertThat(tableColumnAssert2).isSameAs(tableColumnAssertReturn2);
@@ -54,8 +54,8 @@ public void test_has_values() throws Exception {
* This method should fail because the values are different.
*/
@Test
- public void should_fail_because_values_are_different() throws Exception {
- Table table = new Table(jdbcConnectionProvider, "test");
+ public void should_fail_because_values_are_different() {
+ Table table = assertDbConnection.table("test").build();
TableColumnAssert tableColumnAssert = assertThat(table).column("var8");
try {
tableColumnAssert.hasValues(TimeValue.of(12, 29, 49),
@@ -70,7 +70,7 @@ public void should_fail_because_values_are_different() throws Exception {
+ "to be equal to: %n"
+ " <12:29:49.000000000>"));
}
- Table table2 = new Table(jdbcConnectionProvider, "test2");
+ Table table2 = assertDbConnection.table("test2").build();
TableColumnAssert tableColumnAssert2 = assertThat(table2).column("var8");
try {
tableColumnAssert2.hasValues(TimeValue.of(9, 46, 30),
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnColumnEquality_HasValues_UUID_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnColumnEquality_HasValues_UUID_Test.java
index adfc7262..971d1e5c 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnColumnEquality_HasValues_UUID_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnColumnEquality_HasValues_UUID_Test.java
@@ -35,8 +35,8 @@ public class AssertOnColumnEquality_HasValues_UUID_Test extends AbstractTest {
* This method tests the {@code hasValues} assertion method.
*/
@Test
- public void test_has_values() throws Exception {
- Table table = new Table(jdbcConnectionProvider, "test");
+ public void test_has_values() {
+ Table table = assertDbConnection.table("test").build();
TableColumnAssert tableColumnAssert = assertThat(table).column("var15");
TableColumnAssert tableColumnAssertReturn = tableColumnAssert.hasValues(
UUID.fromString("30B443AE-C0C9-4790-9BEC-CE1380808435"),
@@ -46,7 +46,7 @@ public void test_has_values() throws Exception {
);
Assertions.assertThat(tableColumnAssert).isSameAs(tableColumnAssertReturn);
- Table table2 = new Table(jdbcConnectionProvider, "test2");
+ Table table2 = assertDbConnection.table("test2").build();
TableColumnAssert tableColumnAssert2 = assertThat(table2).column("var16");
TableColumnAssert tableColumnAssertReturn2 = tableColumnAssert2
.hasValues(UUID.fromString("30B443AE-C0C9-4790-9BEC-CE1380808435"), null);
@@ -57,8 +57,8 @@ public void test_has_values() throws Exception {
* This method should fail because the values are different.
*/
@Test
- public void should_fail_because_values_are_different() throws Exception {
- Table table = new Table(jdbcConnectionProvider, "test");
+ public void should_fail_because_values_are_different() {
+ Table table = assertDbConnection.table("test").build();
TableColumnAssert tableColumnAssert = assertThat(table).column("var15");
try {
tableColumnAssert.hasValues(UUID.fromString("F96EC595-CE91-47CC-9152-CCC8AC48AAD6"),
@@ -74,7 +74,7 @@ public void should_fail_because_values_are_different() throws Exception {
+ "to be equal to: %n"
+ " "));
}
- Table table2 = new Table(jdbcConnectionProvider, "test2");
+ Table table2 = assertDbConnection.table("test2").build();
TableColumnAssert tableColumnAssert2 = assertThat(table2).column("var16");
try {
tableColumnAssert2.hasValues(UUID.fromString("30B443AE-C0C9-4790-9BEC-CE1380808435"),
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnColumnName_HasColumnName_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnColumnName_HasColumnName_Test.java
index 7132241d..855c4b98 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnColumnName_HasColumnName_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnColumnName_HasColumnName_Test.java
@@ -42,8 +42,8 @@ public class AssertOnColumnName_HasColumnName_Test extends AbstractTest {
*/
@Test
@NeedReload
- public void test_has_column_name() throws Exception {
- Changes changes = new Changes(jdbcConnectionProvider).setStartPointNow();
+ public void test_has_column_name() {
+ Changes changes = assertDbConnection.changes().build().setStartPointNow();
updateChangesForTests();
changes.setEndPointNow();
@@ -55,7 +55,7 @@ public void test_has_column_name() throws Exception {
ChangeRowValueAssert changeRowValueAssert2 = changeRowValueAssert.hasColumnName("id");
Assertions.assertThat(changeRowValueAssert).isSameAs(changeRowValueAssert2);
- Table table = new Table(jdbcConnectionProvider, "actor");
+ Table table = assertDbConnection.table("actor").build();
TableAssert tableAssert = assertThat(table);
TableColumnAssert tableColumnAssert = tableAssert.column();
TableColumnAssert tableColumnAssert2 = tableColumnAssert.hasColumnName("id");
@@ -70,8 +70,8 @@ public void test_has_column_name() throws Exception {
*/
@Test
@NeedReload
- public void should_fail_because_column_name_is_different() throws Exception {
- Changes changes = new Changes(jdbcConnectionProvider).setStartPointNow();
+ public void should_fail_because_column_name_is_different() {
+ Changes changes = assertDbConnection.changes().build().setStartPointNow();
updateChangesForTests();
changes.setEndPointNow();
@@ -97,7 +97,7 @@ public void should_fail_because_column_name_is_different() throws Exception {
+ " \"ID\""));
}
- Table table = new Table(jdbcConnectionProvider, "actor");
+ Table table = assertDbConnection.table("actor").build();
TableAssert tableAssert = assertThat(table);
try {
tableAssert.column().hasColumnName("ID2");
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnColumnNullity_HasOnlyNotNullValues_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnColumnNullity_HasOnlyNotNullValues_Test.java
index 6ff53c24..1a8c11a0 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnColumnNullity_HasOnlyNotNullValues_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnColumnNullity_HasOnlyNotNullValues_Test.java
@@ -35,7 +35,7 @@ public class AssertOnColumnNullity_HasOnlyNotNullValues_Test extends AbstractTes
*/
@Test
public void test_has_only_not_null_values() {
- Table table = new Table(jdbcConnectionProvider, "test");
+ Table table = assertDbConnection.table("test").build();
TableColumnAssert tableColumnAssert = assertThat(table).column("var14");
TableColumnAssert tableColumnAssert2 = tableColumnAssert.hasOnlyNotNullValues();
Assertions.assertThat(tableColumnAssert).isSameAs(tableColumnAssert2);
@@ -45,8 +45,8 @@ public void test_has_only_not_null_values() {
* This method should fail because the column has a null value.
*/
@Test
- public void should_fail_because_column_has_null_value() throws Exception {
- Table table = new Table(jdbcConnectionProvider, "test2");
+ public void should_fail_because_column_has_null_value() {
+ Table table = assertDbConnection.table("test2").build();
TableColumnAssert tableColumnAssert = assertThat(table).column("var14");
try {
tableColumnAssert.hasOnlyNotNullValues();
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnColumnNullity_HasOnlyNullValues_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnColumnNullity_HasOnlyNullValues_Test.java
index c8a6d2cd..710b8709 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnColumnNullity_HasOnlyNullValues_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnColumnNullity_HasOnlyNullValues_Test.java
@@ -35,7 +35,7 @@ public class AssertOnColumnNullity_HasOnlyNullValues_Test extends AbstractTest {
*/
@Test
public void test_has_only_null_values() {
- Table table = new Table(jdbcConnectionProvider, "test2");
+ Table table = assertDbConnection.table("test2").build();
TableColumnAssert tableColumnAssert = assertThat(table).column("var15");
TableColumnAssert tableColumnAssert2 = tableColumnAssert.hasOnlyNullValues();
Assertions.assertThat(tableColumnAssert).isSameAs(tableColumnAssert2);
@@ -45,8 +45,8 @@ public void test_has_only_null_values() {
* This method should fail because the column has a not null value.
*/
@Test
- public void should_fail_because_column_has_not_null_value() throws Exception {
- Table table = new Table(jdbcConnectionProvider, "test2");
+ public void should_fail_because_column_has_not_null_value() {
+ Table table = assertDbConnection.table("test2").build();
TableColumnAssert tableColumnAssert = assertThat(table).column("var14");
try {
tableColumnAssert.hasOnlyNullValues();
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnColumnOfChangeEquality_HasValues_One_Boolean_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnColumnOfChangeEquality_HasValues_One_Boolean_Test.java
index 07b192f9..426ca34b 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnColumnOfChangeEquality_HasValues_One_Boolean_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnColumnOfChangeEquality_HasValues_One_Boolean_Test.java
@@ -38,7 +38,7 @@ public class AssertOnColumnOfChangeEquality_HasValues_One_Boolean_Test extends A
@Test
@NeedReload
public void test_have_values_equal_to() {
- Changes changes = new Changes(jdbcConnectionProvider).setStartPointNow();
+ Changes changes = assertDbConnection.changes().build().setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
changes.setEndPointNow();
@@ -54,7 +54,7 @@ public void test_have_values_equal_to() {
@Test
@NeedReload
public void should_fail_because_value_at_start_point_is_different() {
- Changes changes = new Changes(jdbcConnectionProvider).setStartPointNow();
+ Changes changes = assertDbConnection.changes().build().setStartPointNow();
update("insert into test(var1, var2) values(5, true)");
changes.setEndPointNow();
@@ -76,7 +76,7 @@ public void should_fail_because_value_at_start_point_is_different() {
@Test
@NeedReload
public void should_fail_because_value_at_end_point_is_different() {
- Changes changes = new Changes(jdbcConnectionProvider).setStartPointNow();
+ Changes changes = assertDbConnection.changes().build().setStartPointNow();
update("delete from test where var1 = 1");
changes.setEndPointNow();
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnColumnOfChangeEquality_HasValues_One_Bytes_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnColumnOfChangeEquality_HasValues_One_Bytes_Test.java
index 4a76ede4..6d5f83d4 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnColumnOfChangeEquality_HasValues_One_Bytes_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnColumnOfChangeEquality_HasValues_One_Bytes_Test.java
@@ -41,7 +41,7 @@ public class AssertOnColumnOfChangeEquality_HasValues_One_Bytes_Test extends Abs
public void test_have_values_equal_to() {
byte[] bytesH2 = bytesContentFromClassPathOf("h2-logo-2.png");
- Changes changes = new Changes(jdbcConnectionProvider).setStartPointNow();
+ Changes changes = assertDbConnection.changes().build().setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
changes.setEndPointNow();
@@ -59,7 +59,7 @@ public void test_have_values_equal_to() {
public void should_fail_because_value_at_start_point_is_different() {
byte[] bytesH2 = bytesContentFromClassPathOf("h2-logo-2.png");
- Changes changes = new Changes(jdbcConnectionProvider).setStartPointNow();
+ Changes changes = assertDbConnection.changes().build().setStartPointNow();
update("insert into test(var1, var11) values(5, FILE_READ('classpath:h2-logo-2.png'))");
changes.setEndPointNow();
@@ -80,7 +80,7 @@ public void should_fail_because_value_at_start_point_is_different() {
public void should_fail_because_value_at_end_point_is_different() {
byte[] bytesH2 = bytesContentFromClassPathOf("h2-logo-2.png");
- Changes changes = new Changes(jdbcConnectionProvider).setStartPointNow();
+ Changes changes = assertDbConnection.changes().build().setStartPointNow();
update("delete from test where var1 = 1");
changes.setEndPointNow();
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnColumnOfChangeEquality_HasValues_One_DateTimeValue_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnColumnOfChangeEquality_HasValues_One_DateTimeValue_Test.java
index 459de5c2..c50bcddd 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnColumnOfChangeEquality_HasValues_One_DateTimeValue_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnColumnOfChangeEquality_HasValues_One_DateTimeValue_Test.java
@@ -41,7 +41,7 @@ public class AssertOnColumnOfChangeEquality_HasValues_One_DateTimeValue_Test ext
@Test
@NeedReload
public void test_have_values_equal_to() {
- Changes changes = new Changes(jdbcConnectionProvider).setStartPointNow();
+ Changes changes = assertDbConnection.changes().build().setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
changes.setEndPointNow();
@@ -58,7 +58,7 @@ public void test_have_values_equal_to() {
@Test
@NeedReload
public void should_fail_because_value_at_start_point_is_different() {
- Changes changes = new Changes(jdbcConnectionProvider).setStartPointNow();
+ Changes changes = assertDbConnection.changes().build().setStartPointNow();
update("insert into test(var1, var10) values(5, '2014-05-24 09:46:30')");
changes.setEndPointNow();
@@ -81,7 +81,7 @@ public void should_fail_because_value_at_start_point_is_different() {
@Test
@NeedReload
public void should_fail_because_value_at_end_point_is_different() {
- Changes changes = new Changes(jdbcConnectionProvider).setStartPointNow();
+ Changes changes = assertDbConnection.changes().build().setStartPointNow();
update("delete from test where var1 = 1");
changes.setEndPointNow();
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnColumnOfChangeEquality_HasValues_One_DateValue_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnColumnOfChangeEquality_HasValues_One_DateValue_Test.java
index baac0c38..2eb881d1 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnColumnOfChangeEquality_HasValues_One_DateValue_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnColumnOfChangeEquality_HasValues_One_DateValue_Test.java
@@ -39,7 +39,7 @@ public class AssertOnColumnOfChangeEquality_HasValues_One_DateValue_Test extends
@Test
@NeedReload
public void test_have_values_equal_to() {
- Changes changes = new Changes(jdbcConnectionProvider).setStartPointNow();
+ Changes changes = assertDbConnection.changes().build().setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
changes.setEndPointNow();
@@ -55,7 +55,7 @@ public void test_have_values_equal_to() {
@Test
@NeedReload
public void should_fail_because_value_at_start_point_is_different() {
- Changes changes = new Changes(jdbcConnectionProvider).setStartPointNow();
+ Changes changes = assertDbConnection.changes().build().setStartPointNow();
update("insert into test(var1, var9) values(5, '2014-05-24')");
changes.setEndPointNow();
@@ -77,7 +77,7 @@ public void should_fail_because_value_at_start_point_is_different() {
@Test
@NeedReload
public void should_fail_because_value_at_end_point_is_different() {
- Changes changes = new Changes(jdbcConnectionProvider).setStartPointNow();
+ Changes changes = assertDbConnection.changes().build().setStartPointNow();
update("delete from test where var1 = 1");
changes.setEndPointNow();
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnColumnOfChangeEquality_HasValues_One_Number_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnColumnOfChangeEquality_HasValues_One_Number_Test.java
index de0ede87..cfeee156 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnColumnOfChangeEquality_HasValues_One_Number_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnColumnOfChangeEquality_HasValues_One_Number_Test.java
@@ -38,7 +38,7 @@ public class AssertOnColumnOfChangeEquality_HasValues_One_Number_Test extends Ab
@Test
@NeedReload
public void test_has_values() {
- Changes changes = new Changes(jdbcConnectionProvider).setStartPointNow();
+ Changes changes = assertDbConnection.changes().build().setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
changes.setEndPointNow();
@@ -54,7 +54,7 @@ public void test_has_values() {
@Test
@NeedReload
public void should_fail_because_value_at_start_point_is_different() {
- Changes changes = new Changes(jdbcConnectionProvider).setStartPointNow();
+ Changes changes = assertDbConnection.changes().build().setStartPointNow();
update("insert into test(var1, var3) values(5, 3)");
changes.setEndPointNow();
@@ -76,7 +76,7 @@ public void should_fail_because_value_at_start_point_is_different() {
@Test
@NeedReload
public void should_fail_because_value_at_end_point_is_different() {
- Changes changes = new Changes(jdbcConnectionProvider).setStartPointNow();
+ Changes changes = assertDbConnection.changes().build().setStartPointNow();
update("delete from test where var1 = 1");
changes.setEndPointNow();
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnColumnOfChangeEquality_HasValues_One_String_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnColumnOfChangeEquality_HasValues_One_String_Test.java
index 213c162b..9f129311 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnColumnOfChangeEquality_HasValues_One_String_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnColumnOfChangeEquality_HasValues_One_String_Test.java
@@ -38,7 +38,7 @@ public class AssertOnColumnOfChangeEquality_HasValues_One_String_Test extends Ab
@Test
@NeedReload
public void test_has_values() {
- Changes changes = new Changes(jdbcConnectionProvider).setStartPointNow();
+ Changes changes = assertDbConnection.changes().build().setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
changes.setEndPointNow();
@@ -57,7 +57,7 @@ public void test_has_values() {
@Test
@NeedReload
public void should_fail_because_value_at_start_point_is_different() {
- Changes changes = new Changes(jdbcConnectionProvider).setStartPointNow();
+ Changes changes = assertDbConnection.changes().build().setStartPointNow();
update("insert into test(var1, var12, var15) values(5, 'test', '88838129-291E-40A9-A94C-A15BE36CF7C3')");
changes.setEndPointNow();
@@ -89,7 +89,7 @@ public void should_fail_because_value_at_start_point_is_different() {
@Test
@NeedReload
public void should_fail_because_value_at_end_point_is_different() {
- Changes changes = new Changes(jdbcConnectionProvider).setStartPointNow();
+ Changes changes = assertDbConnection.changes().build().setStartPointNow();
update("delete from test where var1 = 1");
changes.setEndPointNow();
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnColumnOfChangeEquality_HasValues_One_TimeValue_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnColumnOfChangeEquality_HasValues_One_TimeValue_Test.java
index eec9e11c..893452e9 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnColumnOfChangeEquality_HasValues_One_TimeValue_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnColumnOfChangeEquality_HasValues_One_TimeValue_Test.java
@@ -39,7 +39,7 @@ public class AssertOnColumnOfChangeEquality_HasValues_One_TimeValue_Test extends
@Test
@NeedReload
public void test_has_values() {
- Changes changes = new Changes(jdbcConnectionProvider).setStartPointNow();
+ Changes changes = assertDbConnection.changes().build().setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
changes.setEndPointNow();
@@ -55,7 +55,7 @@ public void test_has_values() {
@Test
@NeedReload
public void should_fail_because_value_at_start_point_is_different() {
- Changes changes = new Changes(jdbcConnectionProvider).setStartPointNow();
+ Changes changes = assertDbConnection.changes().build().setStartPointNow();
update("insert into test(var1, var8) values(5, '09:46:30')");
changes.setEndPointNow();
@@ -77,7 +77,7 @@ public void should_fail_because_value_at_start_point_is_different() {
@Test
@NeedReload
public void should_fail_because_value_at_end_point_is_different() {
- Changes changes = new Changes(jdbcConnectionProvider).setStartPointNow();
+ Changes changes = assertDbConnection.changes().build().setStartPointNow();
update("delete from test where var1 = 1");
changes.setEndPointNow();
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnColumnOfChangeEquality_HasValues_One_UUID_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnColumnOfChangeEquality_HasValues_One_UUID_Test.java
index e06b9b27..ec3eac4b 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnColumnOfChangeEquality_HasValues_One_UUID_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnColumnOfChangeEquality_HasValues_One_UUID_Test.java
@@ -39,7 +39,7 @@ public class AssertOnColumnOfChangeEquality_HasValues_One_UUID_Test extends Abst
@Test
@NeedReload
public void test_have_values_equal_to() {
- Changes changes = new Changes(jdbcConnectionProvider).setStartPointNow();
+ Changes changes = assertDbConnection.changes().build().setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
changes.setEndPointNow();
@@ -56,7 +56,7 @@ public void test_have_values_equal_to() {
@Test
@NeedReload
public void should_fail_because_value_at_start_point_is_different() {
- Changes changes = new Changes(jdbcConnectionProvider).setStartPointNow();
+ Changes changes = assertDbConnection.changes().build().setStartPointNow();
update("insert into test(var1, var15) values(5, 'F96EC595-CE91-47CC-9152-CCC8AC48AAD6')");
changes.setEndPointNow();
@@ -79,7 +79,7 @@ public void should_fail_because_value_at_start_point_is_different() {
@Test
@NeedReload
public void should_fail_because_value_at_end_point_is_different() {
- Changes changes = new Changes(jdbcConnectionProvider).setStartPointNow();
+ Changes changes = assertDbConnection.changes().build().setStartPointNow();
update("delete from test where var1 = 1");
changes.setEndPointNow();
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnColumnOfChangeEquality_HasValues_Two_Boolean_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnColumnOfChangeEquality_HasValues_Two_Boolean_Test.java
index d1ddbf52..b9a16835 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnColumnOfChangeEquality_HasValues_Two_Boolean_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnColumnOfChangeEquality_HasValues_Two_Boolean_Test.java
@@ -12,6 +12,9 @@
*/
package org.assertj.db.api.assertions;
+import static org.assertj.db.api.Assertions.assertThat;
+import static org.junit.Assert.fail;
+
import org.assertj.core.api.Assertions;
import org.assertj.db.api.ChangeAssert;
import org.assertj.db.api.ChangeColumnAssert;
@@ -20,9 +23,6 @@
import org.assertj.db.type.Changes;
import org.junit.Test;
-import static org.assertj.db.api.Assertions.assertThat;
-import static org.junit.Assert.fail;
-
/**
* Tests on {@link org.assertj.db.api.assertions.AssertOnColumnOfChangeEquality} class :
* {@link org.assertj.db.api.assertions.AssertOnColumnOfChangeEquality#hasValues(Boolean, Boolean)} method.
@@ -38,7 +38,7 @@ public class AssertOnColumnOfChangeEquality_HasValues_Two_Boolean_Test extends A
@Test
@NeedReload
public void test_has_values() {
- Changes changes = new Changes(jdbcConnectionProvider).setStartPointNow();
+ Changes changes = assertDbConnection.changes().build().setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
changes.setEndPointNow();
@@ -54,7 +54,7 @@ public void test_has_values() {
@Test
@NeedReload
public void should_fail_because_value_at_start_point_is_different() {
- Changes changes = new Changes(jdbcConnectionProvider).setStartPointNow();
+ Changes changes = assertDbConnection.changes().build().setStartPointNow();
update("insert into test(var1, var2) values(5, true)");
changes.setEndPointNow();
@@ -76,7 +76,7 @@ public void should_fail_because_value_at_start_point_is_different() {
@Test
@NeedReload
public void should_fail_because_value_at_end_point_is_different() {
- Changes changes = new Changes(jdbcConnectionProvider).setStartPointNow();
+ Changes changes = assertDbConnection.changes().build().setStartPointNow();
update("delete from test where var1 = 1");
changes.setEndPointNow();
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnColumnOfChangeEquality_HasValues_Two_Bytes_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnColumnOfChangeEquality_HasValues_Two_Bytes_Test.java
index 642704d0..f4a6fefb 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnColumnOfChangeEquality_HasValues_Two_Bytes_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnColumnOfChangeEquality_HasValues_Two_Bytes_Test.java
@@ -41,7 +41,7 @@ public class AssertOnColumnOfChangeEquality_HasValues_Two_Bytes_Test extends Abs
public void test_has_values() {
byte[] bytesH2 = bytesContentFromClassPathOf("h2-logo-2.png");
- Changes changes = new Changes(jdbcConnectionProvider).setStartPointNow();
+ Changes changes = assertDbConnection.changes().build().setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
changes.setEndPointNow();
@@ -59,7 +59,7 @@ public void test_has_values() {
public void should_fail_because_value_at_start_point_is_different() {
byte[] bytesH2 = bytesContentFromClassPathOf("h2-logo-2.png");
- Changes changes = new Changes(jdbcConnectionProvider).setStartPointNow();
+ Changes changes = assertDbConnection.changes().build().setStartPointNow();
update("insert into test(var1, var11) values(5, FILE_READ('classpath:h2-logo-2.png'))");
changes.setEndPointNow();
@@ -80,7 +80,7 @@ public void should_fail_because_value_at_start_point_is_different() {
public void should_fail_because_value_at_end_point_is_different() {
byte[] bytesH2 = bytesContentFromClassPathOf("h2-logo-2.png");
- Changes changes = new Changes(jdbcConnectionProvider).setStartPointNow();
+ Changes changes = assertDbConnection.changes().build().setStartPointNow();
update("delete from test where var1 = 1");
changes.setEndPointNow();
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnColumnOfChangeEquality_HasValues_Two_Character_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnColumnOfChangeEquality_HasValues_Two_Character_Test.java
index 9a2b29e6..5d46d5e8 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnColumnOfChangeEquality_HasValues_Two_Character_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnColumnOfChangeEquality_HasValues_Two_Character_Test.java
@@ -38,7 +38,7 @@ public class AssertOnColumnOfChangeEquality_HasValues_Two_Character_Test extends
@Test
@NeedReload
public void test_has_values() {
- Changes changes = new Changes(jdbcConnectionProvider).setStartPointNow();
+ Changes changes = assertDbConnection.changes().build().setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
changes.setEndPointNow();
@@ -54,7 +54,7 @@ public void test_has_values() {
@Test
@NeedReload
public void should_fail_because_value_at_start_point_is_different() {
- Changes changes = new Changes(jdbcConnectionProvider).setStartPointNow();
+ Changes changes = assertDbConnection.changes().build().setStartPointNow();
update("insert into test(var1, var2) values(5, true)");
changes.setEndPointNow();
@@ -76,7 +76,7 @@ public void should_fail_because_value_at_start_point_is_different() {
@Test
@NeedReload
public void should_fail_because_value_at_end_point_is_different() {
- Changes changes = new Changes(jdbcConnectionProvider).setStartPointNow();
+ Changes changes = assertDbConnection.changes().build().setStartPointNow();
update("delete from test where var1 = 1");
changes.setEndPointNow();
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnColumnOfChangeEquality_HasValues_Two_DateTimeValue_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnColumnOfChangeEquality_HasValues_Two_DateTimeValue_Test.java
index 67f70f2c..7a6f0ae3 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnColumnOfChangeEquality_HasValues_Two_DateTimeValue_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnColumnOfChangeEquality_HasValues_Two_DateTimeValue_Test.java
@@ -41,7 +41,7 @@ public class AssertOnColumnOfChangeEquality_HasValues_Two_DateTimeValue_Test ext
@Test
@NeedReload
public void test_has_values() {
- Changes changes = new Changes(jdbcConnectionProvider).setStartPointNow();
+ Changes changes = assertDbConnection.changes().build().setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
changes.setEndPointNow();
@@ -59,7 +59,7 @@ public void test_has_values() {
@Test
@NeedReload
public void should_fail_because_value_at_start_point_is_different() {
- Changes changes = new Changes(jdbcConnectionProvider).setStartPointNow();
+ Changes changes = assertDbConnection.changes().build().setStartPointNow();
update("insert into test(var1, var10) values(5, '2014-05-24 09:46:30')");
changes.setEndPointNow();
@@ -83,7 +83,7 @@ public void should_fail_because_value_at_start_point_is_different() {
@Test
@NeedReload
public void should_fail_because_value_at_end_point_is_different() {
- Changes changes = new Changes(jdbcConnectionProvider).setStartPointNow();
+ Changes changes = assertDbConnection.changes().build().setStartPointNow();
update("delete from test where var1 = 1");
changes.setEndPointNow();
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnColumnOfChangeEquality_HasValues_Two_DateValue_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnColumnOfChangeEquality_HasValues_Two_DateValue_Test.java
index 097ccc59..d192c257 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnColumnOfChangeEquality_HasValues_Two_DateValue_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnColumnOfChangeEquality_HasValues_Two_DateValue_Test.java
@@ -39,7 +39,7 @@ public class AssertOnColumnOfChangeEquality_HasValues_Two_DateValue_Test extends
@Test
@NeedReload
public void test_has_values() {
- Changes changes = new Changes(jdbcConnectionProvider).setStartPointNow();
+ Changes changes = assertDbConnection.changes().build().setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
changes.setEndPointNow();
@@ -56,7 +56,7 @@ public void test_has_values() {
@Test
@NeedReload
public void should_fail_because_value_at_start_point_is_different() {
- Changes changes = new Changes(jdbcConnectionProvider).setStartPointNow();
+ Changes changes = assertDbConnection.changes().build().setStartPointNow();
update("insert into test(var1, var9) values(5, '2014-05-24')");
changes.setEndPointNow();
@@ -78,7 +78,7 @@ public void should_fail_because_value_at_start_point_is_different() {
@Test
@NeedReload
public void should_fail_because_value_at_end_point_is_different() {
- Changes changes = new Changes(jdbcConnectionProvider).setStartPointNow();
+ Changes changes = assertDbConnection.changes().build().setStartPointNow();
update("delete from test where var1 = 1");
changes.setEndPointNow();
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnColumnOfChangeEquality_HasValues_Two_Number_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnColumnOfChangeEquality_HasValues_Two_Number_Test.java
index 756b4a11..e8eb4fd8 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnColumnOfChangeEquality_HasValues_Two_Number_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnColumnOfChangeEquality_HasValues_Two_Number_Test.java
@@ -38,7 +38,7 @@ public class AssertOnColumnOfChangeEquality_HasValues_Two_Number_Test extends Ab
@Test
@NeedReload
public void test_has_values() {
- Changes changes = new Changes(jdbcConnectionProvider).setStartPointNow();
+ Changes changes = assertDbConnection.changes().build().setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
changes.setEndPointNow();
@@ -54,7 +54,7 @@ public void test_has_values() {
@Test
@NeedReload
public void should_fail_because_value_at_start_point_is_different() {
- Changes changes = new Changes(jdbcConnectionProvider).setStartPointNow();
+ Changes changes = assertDbConnection.changes().build().setStartPointNow();
update("insert into test(var1, var3) values(5, 3)");
changes.setEndPointNow();
@@ -76,7 +76,7 @@ public void should_fail_because_value_at_start_point_is_different() {
@Test
@NeedReload
public void should_fail_because_value_at_end_point_is_different() {
- Changes changes = new Changes(jdbcConnectionProvider).setStartPointNow();
+ Changes changes = assertDbConnection.changes().build().setStartPointNow();
update("delete from test where var1 = 1");
changes.setEndPointNow();
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnColumnOfChangeEquality_HasValues_Two_String_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnColumnOfChangeEquality_HasValues_Two_String_Test.java
index e0193752..23743b9f 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnColumnOfChangeEquality_HasValues_Two_String_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnColumnOfChangeEquality_HasValues_Two_String_Test.java
@@ -38,7 +38,7 @@ public class AssertOnColumnOfChangeEquality_HasValues_Two_String_Test extends Ab
@Test
@NeedReload
public void test_has_values() {
- Changes changes = new Changes(jdbcConnectionProvider).setStartPointNow();
+ Changes changes = assertDbConnection.changes().build().setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
changes.setEndPointNow();
@@ -57,7 +57,7 @@ public void test_has_values() {
@Test
@NeedReload
public void should_fail_because_value_at_start_point_is_different() {
- Changes changes = new Changes(jdbcConnectionProvider).setStartPointNow();
+ Changes changes = assertDbConnection.changes().build().setStartPointNow();
update("insert into test(var1, var12, var15) values(5, 'test', '88838129-291E-40A9-A94C-A15BE36CF7C3')");
changes.setEndPointNow();
@@ -89,7 +89,7 @@ public void should_fail_because_value_at_start_point_is_different() {
@Test
@NeedReload
public void should_fail_because_value_at_end_point_is_different() {
- Changes changes = new Changes(jdbcConnectionProvider).setStartPointNow();
+ Changes changes = assertDbConnection.changes().build().setStartPointNow();
update("delete from test where var1 = 1");
changes.setEndPointNow();
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnColumnOfChangeEquality_HasValues_Two_TimeValue_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnColumnOfChangeEquality_HasValues_Two_TimeValue_Test.java
index 6d07f3b5..e634ef23 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnColumnOfChangeEquality_HasValues_Two_TimeValue_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnColumnOfChangeEquality_HasValues_Two_TimeValue_Test.java
@@ -39,7 +39,7 @@ public class AssertOnColumnOfChangeEquality_HasValues_Two_TimeValue_Test extends
@Test
@NeedReload
public void test_has_values() {
- Changes changes = new Changes(jdbcConnectionProvider).setStartPointNow();
+ Changes changes = assertDbConnection.changes().build().setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
changes.setEndPointNow();
@@ -56,7 +56,7 @@ public void test_has_values() {
@Test
@NeedReload
public void should_fail_because_value_at_start_point_is_different() {
- Changes changes = new Changes(jdbcConnectionProvider).setStartPointNow();
+ Changes changes = assertDbConnection.changes().build().setStartPointNow();
update("insert into test(var1, var8) values(5, '09:46:30')");
changes.setEndPointNow();
@@ -78,7 +78,7 @@ public void should_fail_because_value_at_start_point_is_different() {
@Test
@NeedReload
public void should_fail_because_value_at_end_point_is_different() {
- Changes changes = new Changes(jdbcConnectionProvider).setStartPointNow();
+ Changes changes = assertDbConnection.changes().build().setStartPointNow();
update("delete from test where var1 = 1");
changes.setEndPointNow();
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnColumnOfChangeEquality_HasValues_Two_UUID_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnColumnOfChangeEquality_HasValues_Two_UUID_Test.java
index a8e4c693..b0856013 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnColumnOfChangeEquality_HasValues_Two_UUID_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnColumnOfChangeEquality_HasValues_Two_UUID_Test.java
@@ -39,7 +39,7 @@ public class AssertOnColumnOfChangeEquality_HasValues_Two_UUID_Test extends Abst
@Test
@NeedReload
public void test_has_values() {
- Changes changes = new Changes(jdbcConnectionProvider).setStartPointNow();
+ Changes changes = assertDbConnection.changes().build().setStartPointNow();
update("update test set var15 = '0E2A1269-EFF0-4233-B87B-B53E8B6F164D' where var1 = 1");
changes.setEndPointNow();
@@ -57,7 +57,7 @@ public void test_has_values() {
@Test
@NeedReload
public void should_fail_because_value_at_start_point_is_different() {
- Changes changes = new Changes(jdbcConnectionProvider).setStartPointNow();
+ Changes changes = assertDbConnection.changes().build().setStartPointNow();
update("insert into test(var1, var15) values(5, '0E2A1269-EFF0-4233-B87B-B53E8B6F164D')");
changes.setEndPointNow();
@@ -81,7 +81,7 @@ public void should_fail_because_value_at_start_point_is_different() {
@Test
@NeedReload
public void should_fail_because_value_at_end_point_is_different() {
- Changes changes = new Changes(jdbcConnectionProvider).setStartPointNow();
+ Changes changes = assertDbConnection.changes().build().setStartPointNow();
update("delete from test where var1 = 1");
changes.setEndPointNow();
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnColumnType_IsBoolean_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnColumnType_IsBoolean_Test.java
index faa1c5e0..8792ca07 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnColumnType_IsBoolean_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnColumnType_IsBoolean_Test.java
@@ -39,12 +39,12 @@ public class AssertOnColumnType_IsBoolean_Test extends AbstractTest {
@Test
@NeedReload
public void test_is_boolean() {
- Changes changes = new Changes(jdbcConnectionProvider).setStartPointNow();
+ Changes changes = assertDbConnection.changes().build().setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
update("insert into test(var1, var2, var11, var10, var9, var3, var12, var8) values(5, true, FILE_READ('classpath:h2-logo-2.png'), '2014-05-24 09:46:30', '2014-05-24', 3, 'test', '09:46:30')");
changes.setEndPointNow();
- Table table = new Table(jdbcConnectionProvider, "test");
- Table table2 = new Table(jdbcConnectionProvider, "test2");
+ Table table = assertDbConnection.table("test").build();
+ Table table2 = assertDbConnection.table("test2").build();
ChangeColumnAssert changeColumnAssert1 = assertThat(changes).change().column("var2");
ChangeColumnAssert changeColumnAssertReturn1 = changeColumnAssert1.isBoolean(true);
@@ -66,12 +66,12 @@ public void test_is_boolean() {
@Test
@NeedReload
public void should_fail_because_value_have_different_type() {
- Changes changes = new Changes(jdbcConnectionProvider).setStartPointNow();
+ Changes changes = assertDbConnection.changes().build().setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
update("insert into test(var1, var2, var11, var10, var9, var3, var12, var8) values(5, true, FILE_READ('classpath:h2-logo-2.png'), '2014-05-24 09:46:30', '2014-05-24', 3, 'test', '09:46:30')");
changes.setEndPointNow();
- Table table = new Table(jdbcConnectionProvider, "test");
- Table table2 = new Table(jdbcConnectionProvider, "test2");
+ Table table = assertDbConnection.table("test").build();
+ Table table2 = assertDbConnection.table("test2").build();
try {
assertThat(changes).change().column("var2").isBoolean(false);
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnColumnType_IsBytes_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnColumnType_IsBytes_Test.java
index 3bca0c4f..c5b92637 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnColumnType_IsBytes_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnColumnType_IsBytes_Test.java
@@ -39,12 +39,12 @@ public class AssertOnColumnType_IsBytes_Test extends AbstractTest {
@Test
@NeedReload
public void test_is_bytes() {
- Changes changes = new Changes(jdbcConnectionProvider).setStartPointNow();
+ Changes changes = assertDbConnection.changes().build().setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
update("insert into test(var1, var2, var11, var10, var9, var3, var12, var8) values(5, true, FILE_READ('classpath:h2-logo-2.png'), '2014-05-24 09:46:30', '2014-05-24', 3, 'test', '09:46:30')");
changes.setEndPointNow();
- Table table = new Table(jdbcConnectionProvider, "test");
- Table table2 = new Table(jdbcConnectionProvider, "test2");
+ Table table = assertDbConnection.table("test").build();
+ Table table2 = assertDbConnection.table("test2").build();
ChangeColumnAssert changeColumnAssert1 = assertThat(changes).change().column("var11");
ChangeColumnAssert changeColumnAssertReturn1 = changeColumnAssert1.isBytes(true);
@@ -66,12 +66,12 @@ public void test_is_bytes() {
@Test
@NeedReload
public void should_fail_because_value_have_different_type() {
- Changes changes = new Changes(jdbcConnectionProvider).setStartPointNow();
+ Changes changes = assertDbConnection.changes().build().setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
update("insert into test(var1, var2, var11, var10, var9, var3, var12, var8) values(5, true, FILE_READ('classpath:h2-logo-2.png'), '2014-05-24 09:46:30', '2014-05-24', 3, 'test', '09:46:30')");
changes.setEndPointNow();
- Table table = new Table(jdbcConnectionProvider, "test");
- Table table2 = new Table(jdbcConnectionProvider, "test2");
+ Table table = assertDbConnection.table("test").build();
+ Table table2 = assertDbConnection.table("test2").build();
try {
assertThat(changes).change().column("var11").isBytes(false);
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnColumnType_IsDateTime_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnColumnType_IsDateTime_Test.java
index 6f251b44..7ce2ce28 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnColumnType_IsDateTime_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnColumnType_IsDateTime_Test.java
@@ -39,12 +39,12 @@ public class AssertOnColumnType_IsDateTime_Test extends AbstractTest {
@Test
@NeedReload
public void test_is_date_time() {
- Changes changes = new Changes(jdbcConnectionProvider).setStartPointNow();
+ Changes changes = assertDbConnection.changes().build().setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
update("insert into test(var1, var2, var11, var10, var9, var3, var12, var8) values(5, true, FILE_READ('classpath:h2-logo-2.png'), '2014-05-24 09:46:30', '2014-05-24', 3, 'test', '09:46:30')");
changes.setEndPointNow();
- Table table = new Table(jdbcConnectionProvider, "test");
- Table table2 = new Table(jdbcConnectionProvider, "test2");
+ Table table = assertDbConnection.table("test").build();
+ Table table2 = assertDbConnection.table("test2").build();
ChangeColumnAssert changeColumnAssert1 = assertThat(changes).change().column("var10");
ChangeColumnAssert changeColumnAssertReturn1 = changeColumnAssert1.isDateTime(true);
@@ -66,12 +66,12 @@ public void test_is_date_time() {
@Test
@NeedReload
public void should_fail_because_value_have_different_type() {
- Changes changes = new Changes(jdbcConnectionProvider).setStartPointNow();
+ Changes changes = assertDbConnection.changes().build().setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
update("insert into test(var1, var2, var11, var10, var9, var3, var12, var8) values(5, true, FILE_READ('classpath:h2-logo-2.png'), '2014-05-24 09:46:30', '2014-05-24', 3, 'test', '09:46:30')");
changes.setEndPointNow();
- Table table = new Table(jdbcConnectionProvider, "test");
- Table table2 = new Table(jdbcConnectionProvider, "test2");
+ Table table = assertDbConnection.table("test").build();
+ Table table2 = assertDbConnection.table("test2").build();
try {
assertThat(changes).change().column("var10").isDateTime(false);
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnColumnType_IsDate_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnColumnType_IsDate_Test.java
index 9b50336e..a240b569 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnColumnType_IsDate_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnColumnType_IsDate_Test.java
@@ -39,12 +39,12 @@ public class AssertOnColumnType_IsDate_Test extends AbstractTest {
@Test
@NeedReload
public void test_is_date() {
- Changes changes = new Changes(jdbcConnectionProvider).setStartPointNow();
+ Changes changes = assertDbConnection.changes().build().setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
update("insert into test(var1, var2, var11, var10, var9, var3, var12, var8) values(5, true, FILE_READ('classpath:h2-logo-2.png'), '2014-05-24 09:46:30', '2014-05-24', 3, 'test', '09:46:30')");
changes.setEndPointNow();
- Table table = new Table(jdbcConnectionProvider, "test");
- Table table2 = new Table(jdbcConnectionProvider, "test2");
+ Table table = assertDbConnection.table("test").build();
+ Table table2 = assertDbConnection.table("test2").build();
ChangeColumnAssert changeColumnAssert1 = assertThat(changes).change().column("var9");
ChangeColumnAssert changeColumnAssertReturn1 = changeColumnAssert1.isDate(true);
@@ -66,12 +66,12 @@ public void test_is_date() {
@Test
@NeedReload
public void should_fail_because_value_have_different_type() {
- Changes changes = new Changes(jdbcConnectionProvider).setStartPointNow();
+ Changes changes = assertDbConnection.changes().build().setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
update("insert into test(var1, var2, var11, var10, var9, var3, var12, var8) values(5, true, FILE_READ('classpath:h2-logo-2.png'), '2014-05-24 09:46:30', '2014-05-24', 3, 'test', '09:46:30')");
changes.setEndPointNow();
- Table table = new Table(jdbcConnectionProvider, "test");
- Table table2 = new Table(jdbcConnectionProvider, "test2");
+ Table table = assertDbConnection.table("test").build();
+ Table table2 = assertDbConnection.table("test2").build();
try {
assertThat(changes).change().column("var9").isDate(false);
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnColumnType_IsNumber_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnColumnType_IsNumber_Test.java
index 570a5f8b..0b5af595 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnColumnType_IsNumber_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnColumnType_IsNumber_Test.java
@@ -39,12 +39,12 @@ public class AssertOnColumnType_IsNumber_Test extends AbstractTest {
@Test
@NeedReload
public void test_is_number() {
- Changes changes = new Changes(jdbcConnectionProvider).setStartPointNow();
+ Changes changes = assertDbConnection.changes().build().setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
update("insert into test(var1, var2, var11, var10, var9, var3, var12, var8) values(5, true, FILE_READ('classpath:h2-logo-2.png'), '2014-05-24 09:46:30', '2014-05-24', 3, 'test', '09:46:30')");
changes.setEndPointNow();
- Table table = new Table(jdbcConnectionProvider, "test");
- Table table2 = new Table(jdbcConnectionProvider, "test2");
+ Table table = assertDbConnection.table("test").build();
+ Table table2 = assertDbConnection.table("test2").build();
ChangeColumnAssert changeColumnAssert1 = assertThat(changes).change().column("var3");
ChangeColumnAssert changeColumnAssertReturn1 = changeColumnAssert1.isNumber(true);
@@ -66,12 +66,12 @@ public void test_is_number() {
@Test
@NeedReload
public void should_fail_because_value_have_different_type() {
- Changes changes = new Changes(jdbcConnectionProvider).setStartPointNow();
+ Changes changes = assertDbConnection.changes().build().setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
update("insert into test(var1, var2, var11, var10, var9, var3, var12, var8) values(5, true, FILE_READ('classpath:h2-logo-2.png'), '2014-05-24 09:46:30', '2014-05-24', 3, 'test', '09:46:30')");
changes.setEndPointNow();
- Table table = new Table(jdbcConnectionProvider, "test");
- Table table2 = new Table(jdbcConnectionProvider, "test2");
+ Table table = assertDbConnection.table("test").build();
+ Table table2 = assertDbConnection.table("test2").build();
try {
assertThat(changes).change().column("var3").isNumber(false);
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnColumnType_IsOfAnyTypeIn_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnColumnType_IsOfAnyTypeIn_Test.java
index de35075a..f023cebf 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnColumnType_IsOfAnyTypeIn_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnColumnType_IsOfAnyTypeIn_Test.java
@@ -40,12 +40,12 @@ public class AssertOnColumnType_IsOfAnyTypeIn_Test extends AbstractTest {
@Test
@NeedReload
public void test_is_of_any_of_types() {
- Changes changes = new Changes(jdbcConnectionProvider).setStartPointNow();
+ Changes changes = assertDbConnection.changes().build().setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
update("insert into test(var1, var2, var11, var10, var9, var3, var12, var8) values(5, true, FILE_READ('classpath:h2-logo-2.png'), '2014-05-24 09:46:30', '2014-05-24', 3, 'test', '09:46:30')");
changes.setEndPointNow();
- Table table = new Table(jdbcConnectionProvider, "test");
- Table table2 = new Table(jdbcConnectionProvider, "test2");
+ Table table = assertDbConnection.table("test").build();
+ Table table2 = assertDbConnection.table("test2").build();
ChangeColumnAssert changeColumnAssert1 = assertThat(changes).change().column("var2");
ChangeColumnAssert changeColumnAssertReturn1 = changeColumnAssert1.isOfAnyTypeIn(ValueType.BOOLEAN,
@@ -69,12 +69,12 @@ public void test_is_of_any_of_types() {
@Test
@NeedReload
public void should_fail_because_value_have_different_type() {
- Changes changes = new Changes(jdbcConnectionProvider).setStartPointNow();
+ Changes changes = assertDbConnection.changes().build().setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
update("insert into test(var1, var2, var11, var10, var9, var3, var12, var8) values(5, true, FILE_READ('classpath:h2-logo-2.png'), '2014-05-24 09:46:30', '2014-05-24', 3, 'test', '09:46:30')");
changes.setEndPointNow();
- Table table = new Table(jdbcConnectionProvider, "test");
- Table table2 = new Table(jdbcConnectionProvider, "test2");
+ Table table = assertDbConnection.table("test").build();
+ Table table2 = assertDbConnection.table("test2").build();
try {
assertThat(changes).change().column("var2").isOfAnyTypeIn(ValueType.BOOLEAN, ValueType.TEXT);
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnColumnType_IsOfType_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnColumnType_IsOfType_Test.java
index 50160006..e9b6dc73 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnColumnType_IsOfType_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnColumnType_IsOfType_Test.java
@@ -40,12 +40,12 @@ public class AssertOnColumnType_IsOfType_Test extends AbstractTest {
@Test
@NeedReload
public void test_is_of_type() {
- Changes changes = new Changes(jdbcConnectionProvider).setStartPointNow();
+ Changes changes = assertDbConnection.changes().build().setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
update("insert into test(var1, var2, var11, var10, var9, var3, var12, var8) values(5, true, FILE_READ('classpath:h2-logo-2.png'), '2014-05-24 09:46:30', '2014-05-24', 3, 'test', '09:46:30')");
changes.setEndPointNow();
- Table table = new Table(jdbcConnectionProvider, "test");
- Table table2 = new Table(jdbcConnectionProvider, "test2");
+ Table table = assertDbConnection.table("test").build();
+ Table table2 = assertDbConnection.table("test2").build();
ChangeColumnAssert changeColumnAssert1 = assertThat(changes).change().column("var2");
ChangeColumnAssert changeColumnAssertReturn1 = changeColumnAssert1.isOfType(ValueType.BOOLEAN, true);
@@ -67,12 +67,12 @@ public void test_is_of_type() {
@Test
@NeedReload
public void should_fail_because_value_have_different_type() {
- Changes changes = new Changes(jdbcConnectionProvider).setStartPointNow();
+ Changes changes = assertDbConnection.changes().build().setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
update("insert into test(var1, var2, var11, var10, var9, var3, var12, var8) values(5, true, FILE_READ('classpath:h2-logo-2.png'), '2014-05-24 09:46:30', '2014-05-24', 3, 'test', '09:46:30')");
changes.setEndPointNow();
- Table table = new Table(jdbcConnectionProvider, "test");
- Table table2 = new Table(jdbcConnectionProvider, "test2");
+ Table table = assertDbConnection.table("test").build();
+ Table table2 = assertDbConnection.table("test2").build();
try {
assertThat(changes).change().column("var2").isOfType(ValueType.BOOLEAN, false);
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnColumnType_IsText_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnColumnType_IsText_Test.java
index ddc1a9f5..819fdb48 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnColumnType_IsText_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnColumnType_IsText_Test.java
@@ -39,12 +39,12 @@ public class AssertOnColumnType_IsText_Test extends AbstractTest {
@Test
@NeedReload
public void test_is_text() {
- Changes changes = new Changes(jdbcConnectionProvider).setStartPointNow();
+ Changes changes = assertDbConnection.changes().build().setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
update("insert into test(var1, var2, var11, var10, var9, var3, var12, var8) values(5, true, FILE_READ('classpath:h2-logo-2.png'), '2014-05-24 09:46:30', '2014-05-24', 3, 'test', '09:46:30')");
changes.setEndPointNow();
- Table table = new Table(jdbcConnectionProvider, "test");
- Table table2 = new Table(jdbcConnectionProvider, "test2");
+ Table table = assertDbConnection.table("test").build();
+ Table table2 = assertDbConnection.table("test2").build();
ChangeColumnAssert changeColumnAssert1 = assertThat(changes).change().column("var12");
ChangeColumnAssert changeColumnAssertReturn1 = changeColumnAssert1.isText(true);
@@ -66,12 +66,12 @@ public void test_is_text() {
@Test
@NeedReload
public void should_fail_because_value_have_different_type() {
- Changes changes = new Changes(jdbcConnectionProvider).setStartPointNow();
+ Changes changes = assertDbConnection.changes().build().setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
update("insert into test(var1, var2, var11, var10, var9, var3, var12, var8) values(5, true, FILE_READ('classpath:h2-logo-2.png'), '2014-05-24 09:46:30', '2014-05-24', 3, 'test', '09:46:30')");
changes.setEndPointNow();
- Table table = new Table(jdbcConnectionProvider, "test");
- Table table2 = new Table(jdbcConnectionProvider, "test2");
+ Table table = assertDbConnection.table("test").build();
+ Table table2 = assertDbConnection.table("test2").build();
try {
assertThat(changes).change().column("var12").isText(false);
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnColumnType_IsTime_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnColumnType_IsTime_Test.java
index 8b12a6e2..f79e8eea 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnColumnType_IsTime_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnColumnType_IsTime_Test.java
@@ -39,12 +39,12 @@ public class AssertOnColumnType_IsTime_Test extends AbstractTest {
@Test
@NeedReload
public void test_is_time() {
- Changes changes = new Changes(jdbcConnectionProvider).setStartPointNow();
+ Changes changes = assertDbConnection.changes().build().setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
update("insert into test(var1, var2, var11, var10, var9, var3, var12, var8) values(5, true, FILE_READ('classpath:h2-logo-2.png'), '2014-05-24 09:46:30', '2014-05-24', 3, 'test', '09:46:30')");
changes.setEndPointNow();
- Table table = new Table(jdbcConnectionProvider, "test");
- Table table2 = new Table(jdbcConnectionProvider, "test2");
+ Table table = assertDbConnection.table("test").build();
+ Table table2 = assertDbConnection.table("test2").build();
ChangeColumnAssert changeColumnAssert1 = assertThat(changes).change().column("var8");
ChangeColumnAssert changeColumnAssertReturn1 = changeColumnAssert1.isTime(true);
@@ -66,12 +66,12 @@ public void test_is_time() {
@Test
@NeedReload
public void should_fail_because_value_have_different_type() {
- Changes changes = new Changes(jdbcConnectionProvider).setStartPointNow();
+ Changes changes = assertDbConnection.changes().build().setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
update("insert into test(var1, var2, var11, var10, var9, var3, var12, var8) values(5, true, FILE_READ('classpath:h2-logo-2.png'), '2014-05-24 09:46:30', '2014-05-24', 3, 'test', '09:46:30')");
changes.setEndPointNow();
- Table table = new Table(jdbcConnectionProvider, "test");
- Table table2 = new Table(jdbcConnectionProvider, "test2");
+ Table table = assertDbConnection.table("test").build();
+ Table table2 = assertDbConnection.table("test2").build();
try {
assertThat(changes).change().column("var8").isTime(false);
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnColumnType_IsUUID_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnColumnType_IsUUID_Test.java
index 50b7fcc1..7be00e34 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnColumnType_IsUUID_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnColumnType_IsUUID_Test.java
@@ -38,13 +38,13 @@ public class AssertOnColumnType_IsUUID_Test extends AbstractTest {
@Test
@NeedReload
public void test_is_UUID() {
- Changes changes = new Changes(jdbcConnectionProvider).setStartPointNow();
+ Changes changes = assertDbConnection.changes().build().setStartPointNow();
update("update test set var15 = '0E2A1269-EFF0-4233-B87B-B53E8B6F164D' where var1 = 1");
update(
"insert into test(var1, var2, var11, var10, var9, var3, var12, var8, var15) values(5, true, FILE_READ('classpath:h2-logo-2.png'), '2014-05-24 09:46:30', '2014-05-24', 3, 'test', '09:46:30', '2B0D1BDD-909E-4362-BA10-C930BA82718D')");
changes.setEndPointNow();
- Table table = new Table(jdbcConnectionProvider, "test");
- Table table2 = new Table(jdbcConnectionProvider, "test2");
+ Table table = assertDbConnection.table("test").build();
+ Table table2 = assertDbConnection.table("test2").build();
ChangeColumnAssert changeColumnAssert1 = assertThat(changes).change().column("var15");
ChangeColumnAssert changeColumnAssertReturn1 = changeColumnAssert1.isUUID(true);
@@ -66,13 +66,13 @@ public void test_is_UUID() {
@Test
@NeedReload
public void should_fail_because_value_have_different_type() {
- Changes changes = new Changes(jdbcConnectionProvider).setStartPointNow();
+ Changes changes = assertDbConnection.changes().build().setStartPointNow();
update("update test set var15 = null where var1 = 1");
update(
"insert into test(var1, var2, var11, var10, var9, var3, var12, var8, var15) values(5, true, FILE_READ('classpath:h2-logo-2.png'), '2014-05-24 09:46:30', '2014-05-24', 3, 'test', '09:46:30', null)");
changes.setEndPointNow();
- Table table = new Table(jdbcConnectionProvider, "test");
- Table table2 = new Table(jdbcConnectionProvider, "test2");
+ Table table = assertDbConnection.table("test").build();
+ Table table2 = assertDbConnection.table("test2").build();
try {
assertThat(changes).change().column("var15").isUUID(false);
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnDataType_IsOnDataType_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnDataType_IsOnDataType_Test.java
index f54e0a4b..704f2a1a 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnDataType_IsOnDataType_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnDataType_IsOnDataType_Test.java
@@ -39,9 +39,9 @@ public class AssertOnDataType_IsOnDataType_Test extends AbstractTest {
*/
@Test
@NeedReload
- public void test_is_on_data_type() throws Exception {
- Table table = new Table(jdbcConnectionProvider, "actor");
- Changes changes = new Changes(table).setStartPointNow();
+ public void test_is_on_data_type() {
+ Table table = assertDbConnection.table("actor").build();
+ Changes changes = assertDbConnection.changes().tables(table).build().setStartPointNow();
updateChangesForTests();
changes.setEndPointNow();
@@ -55,9 +55,9 @@ public void test_is_on_data_type() throws Exception {
*/
@Test
@NeedReload
- public void should_fail_because_data_type_is_different() throws Exception {
- Request request = new Request(jdbcConnectionProvider, "select * from actor");
- Changes changes = new Changes(request).setStartPointNow();
+ public void should_fail_because_data_type_is_different() {
+ Request request = assertDbConnection.request("select * from actor").build();
+ Changes changes = assertDbConnection.changes().request(request).build().setStartPointNow();
updateChangesForTests();
changes.setEndPointNow();
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnDataType_IsOnRequest_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnDataType_IsOnRequest_Test.java
index 2307acf1..43a816f5 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnDataType_IsOnRequest_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnDataType_IsOnRequest_Test.java
@@ -38,9 +38,9 @@ public class AssertOnDataType_IsOnRequest_Test extends AbstractTest {
*/
@Test
@NeedReload
- public void test_is_on_request() throws Exception {
- Request request = new Request(jdbcConnectionProvider, "select * from actor");
- Changes changes = new Changes(request).setStartPointNow();
+ public void test_is_on_request() {
+ Request request = assertDbConnection.request("select * from actor").build();
+ Changes changes = assertDbConnection.changes().request(request).build().setStartPointNow();
updateChangesForTests();
changes.setEndPointNow();
@@ -54,9 +54,9 @@ public void test_is_on_request() throws Exception {
*/
@Test
@NeedReload
- public void should_fail_because_data_type_is_different() throws Exception {
- Table table = new Table(jdbcConnectionProvider, "actor");
- Changes changes = new Changes(table).setStartPointNow();
+ public void should_fail_because_data_type_is_different() {
+ Table table = assertDbConnection.table("actor").build();
+ Changes changes = assertDbConnection.changes().tables(table).build().setStartPointNow();
updateChangesForTests();
changes.setEndPointNow();
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnDataType_IsOnTable_Name_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnDataType_IsOnTable_Name_Test.java
index fe9260ea..49984e70 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnDataType_IsOnTable_Name_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnDataType_IsOnTable_Name_Test.java
@@ -12,6 +12,9 @@
*/
package org.assertj.db.api.assertions;
+import static org.assertj.db.api.Assertions.assertThat;
+import static org.junit.Assert.fail;
+
import org.assertj.core.api.Assertions;
import org.assertj.db.api.ChangeAssert;
import org.assertj.db.common.AbstractTest;
@@ -21,9 +24,6 @@
import org.assertj.db.type.Table;
import org.junit.Test;
-import static org.assertj.db.api.Assertions.assertThat;
-import static org.junit.Assert.fail;
-
/**
* Tests on {@link org.assertj.db.api.assertions.AssertOnDataType} class :
* {@link org.assertj.db.api.assertions.AssertOnDataType#isOnTable(String)} method.
@@ -38,9 +38,9 @@ public class AssertOnDataType_IsOnTable_Name_Test extends AbstractTest {
*/
@Test
@NeedReload
- public void test_is_on_table() throws Exception {
- Table table = new Table(jdbcConnectionProvider, "actor");
- Changes changes = new Changes(table).setStartPointNow();
+ public void test_is_on_table() {
+ Table table = assertDbConnection.table("actor").build();
+ Changes changes = assertDbConnection.changes().tables(table).build().setStartPointNow();
updateChangesForTests();
changes.setEndPointNow();
@@ -54,9 +54,9 @@ public void test_is_on_table() throws Exception {
*/
@Test
@NeedReload
- public void should_fail_because_data_type_is_different() throws Exception {
- Request request = new Request(jdbcConnectionProvider, "select * from actor");
- Changes changes = new Changes(request).setStartPointNow();
+ public void should_fail_because_data_type_is_different() {
+ Request request = assertDbConnection.request("select * from actor").build();
+ Changes changes = assertDbConnection.changes().request(request).build().setStartPointNow();
updateChangesForTests();
changes.setEndPointNow();
@@ -78,9 +78,9 @@ public void should_fail_because_data_type_is_different() throws Exception {
*/
@Test
@NeedReload
- public void should_fail_because_table_name_is_different() throws Exception {
- Table table = new Table(jdbcConnectionProvider, "actor");
- Changes changes = new Changes(table).setStartPointNow();
+ public void should_fail_because_table_name_is_different() {
+ Table table = assertDbConnection.table("actor").build();
+ Changes changes = assertDbConnection.changes().tables(table).build().setStartPointNow();
updateChangesForTests();
changes.setEndPointNow();
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnDataType_IsOnTable_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnDataType_IsOnTable_Test.java
index c1bcba49..af98826c 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnDataType_IsOnTable_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnDataType_IsOnTable_Test.java
@@ -38,9 +38,9 @@ public class AssertOnDataType_IsOnTable_Test extends AbstractTest {
*/
@Test
@NeedReload
- public void test_is_on_table() throws Exception {
- Table table = new Table(jdbcConnectionProvider, "actor");
- Changes changes = new Changes(table).setStartPointNow();
+ public void test_is_on_table() {
+ Table table = assertDbConnection.table("actor").build();
+ Changes changes = assertDbConnection.changes().tables(table).build().setStartPointNow();
updateChangesForTests();
changes.setEndPointNow();
@@ -54,9 +54,9 @@ public void test_is_on_table() throws Exception {
*/
@Test
@NeedReload
- public void should_fail_because_data_type_is_different() throws Exception {
- Request request = new Request(jdbcConnectionProvider, "select * from actor");
- Changes changes = new Changes(request).setStartPointNow();
+ public void should_fail_because_data_type_is_different() {
+ Request request = assertDbConnection.request("select * from actor").build();
+ Changes changes = assertDbConnection.changes().request(request).build().setStartPointNow();
updateChangesForTests();
changes.setEndPointNow();
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnExistence_DoesNotExist_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnExistence_DoesNotExist_Test.java
index a03dadef..3d67fa0d 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnExistence_DoesNotExist_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnExistence_DoesNotExist_Test.java
@@ -36,7 +36,7 @@ public class AssertOnExistence_DoesNotExist_Test extends AbstractTest {
@Test
@NeedReload
public void test_table_does_not_exist() {
- Table table = new Table(jdbcConnectionProvider, "not-exist-test");
+ Table table = assertDbConnection.table("not-exist-test").build();
TableAssert tableAssert = assertThat(table);
TableAssert tableAssertExistReturn = tableAssert.doesNotExist();
Assertions.assertThat(tableAssert).isSameAs(tableAssertExistReturn);
@@ -48,7 +48,7 @@ public void test_table_does_not_exist() {
@Test
@NeedReload
public void should_fail_because_table_exist() {
- Table table = new Table(jdbcConnectionProvider, "test");
+ Table table = assertDbConnection.table("test").build();
try {
assertThat(table).doesNotExist();
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnExistence_Exists_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnExistence_Exists_Test.java
index 2260b6be..7ccbf59b 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnExistence_Exists_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnExistence_Exists_Test.java
@@ -36,7 +36,7 @@ public class AssertOnExistence_Exists_Test extends AbstractTest {
@Test
@NeedReload
public void test_table_exists() {
- Table table = new Table(jdbcConnectionProvider, "test");
+ Table table = assertDbConnection.table("test").build();
TableAssert tableAssert = assertThat(table);
TableAssert tableAssertExistReturn = tableAssert.exists();
Assertions.assertThat(tableAssert).isSameAs(tableAssertExistReturn);
@@ -48,7 +48,7 @@ public void test_table_exists() {
@Test
@NeedReload
public void should_fail_because_table_not_exist() {
- Table table = new Table(jdbcConnectionProvider, "not-exist-test");
+ Table table = assertDbConnection.table("not-exist-test").build();
try {
assertThat(table).exists();
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnModifiedColumn_IsModified_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnModifiedColumn_IsModified_Test.java
index 44ede8e8..3739cf51 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnModifiedColumn_IsModified_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnModifiedColumn_IsModified_Test.java
@@ -37,7 +37,7 @@ public class AssertOnModifiedColumn_IsModified_Test extends AbstractTest {
@Test
@NeedReload
public void test_is_modified() {
- Changes changes = new Changes(jdbcConnectionProvider).setStartPointNow();
+ Changes changes = assertDbConnection.changes().build().setStartPointNow();
updateChangesForTests();
changes.setEndPointNow();
@@ -52,7 +52,7 @@ public void test_is_modified() {
@Test
@NeedReload
public void should_fail_because_column_is_not_modified() {
- Changes changes = new Changes(jdbcConnectionProvider).setStartPointNow();
+ Changes changes = assertDbConnection.changes().build().setStartPointNow();
updateChangesForTests();
changes.setEndPointNow();
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnModifiedColumn_IsNotModified_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnModifiedColumn_IsNotModified_Test.java
index bb56e7ce..d08e5320 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnModifiedColumn_IsNotModified_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnModifiedColumn_IsNotModified_Test.java
@@ -37,7 +37,7 @@ public class AssertOnModifiedColumn_IsNotModified_Test extends AbstractTest {
@Test
@NeedReload
public void test_is_not_modified() {
- Changes changes = new Changes(jdbcConnectionProvider).setStartPointNow();
+ Changes changes = assertDbConnection.changes().build().setStartPointNow();
updateChangesForTests();
changes.setEndPointNow();
@@ -52,7 +52,7 @@ public void test_is_not_modified() {
@Test
@NeedReload
public void should_fail_because_column_is_modified() {
- Changes changes = new Changes(jdbcConnectionProvider).setStartPointNow();
+ Changes changes = assertDbConnection.changes().build().setStartPointNow();
updateChangesForTests();
changes.setEndPointNow();
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnModifiedColumns_HasModifiedColumns_Integer_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnModifiedColumns_HasModifiedColumns_Integer_Test.java
index c23be81e..ec56dcfa 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnModifiedColumns_HasModifiedColumns_Integer_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnModifiedColumns_HasModifiedColumns_Integer_Test.java
@@ -36,8 +36,8 @@ public class AssertOnModifiedColumns_HasModifiedColumns_Integer_Test extends Abs
*/
@Test
@NeedReload
- public void test_has_modified_columns() throws Exception {
- Changes changes = new Changes(jdbcConnectionProvider).setStartPointNow();
+ public void test_has_modified_columns() {
+ Changes changes = assertDbConnection.changes().build().setStartPointNow();
updateChangesForTests();
changes.setEndPointNow();
@@ -51,8 +51,8 @@ public void test_has_modified_columns() throws Exception {
*/
@Test
@NeedReload
- public void should_fail_because_modified_columns_are_different() throws Exception {
- Changes changes = new Changes(jdbcConnectionProvider).setStartPointNow();
+ public void should_fail_because_modified_columns_are_different() {
+ Changes changes = assertDbConnection.changes().build().setStartPointNow();
updateChangesForTests();
changes.setEndPointNow();
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnModifiedColumns_HasModifiedColumns_String_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnModifiedColumns_HasModifiedColumns_String_Test.java
index 7acb7bd1..2302d03d 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnModifiedColumns_HasModifiedColumns_String_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnModifiedColumns_HasModifiedColumns_String_Test.java
@@ -36,8 +36,8 @@ public class AssertOnModifiedColumns_HasModifiedColumns_String_Test extends Abst
*/
@Test
@NeedReload
- public void test_has_modified_columns() throws Exception {
- Changes changes = new Changes(jdbcConnectionProvider).setStartPointNow();
+ public void test_has_modified_columns() {
+ Changes changes = assertDbConnection.changes().build().setStartPointNow();
updateChangesForTests();
changes.setEndPointNow();
@@ -51,8 +51,8 @@ public void test_has_modified_columns() throws Exception {
*/
@Test
@NeedReload
- public void should_fail_because_modified_columns_are_different() throws Exception {
- Changes changes = new Changes(jdbcConnectionProvider).setStartPointNow();
+ public void should_fail_because_modified_columns_are_different() {
+ Changes changes = assertDbConnection.changes().build().setStartPointNow();
updateChangesForTests();
changes.setEndPointNow();
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnModifiedColumns_HasNumberOfModifiedColumnsGreaterThanOrEqualTo_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnModifiedColumns_HasNumberOfModifiedColumnsGreaterThanOrEqualTo_Test.java
index e6e24dba..dfb3326d 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnModifiedColumns_HasNumberOfModifiedColumnsGreaterThanOrEqualTo_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnModifiedColumns_HasNumberOfModifiedColumnsGreaterThanOrEqualTo_Test.java
@@ -36,8 +36,8 @@ public class AssertOnModifiedColumns_HasNumberOfModifiedColumnsGreaterThanOrEqua
*/
@Test
@NeedReload
- public void test_has_number_of_modified_columns_greater_than_or_equal_to() throws Exception {
- Changes changes = new Changes(jdbcConnectionProvider).setStartPointNow();
+ public void test_has_number_of_modified_columns_greater_than_or_equal_to() {
+ Changes changes = assertDbConnection.changes().build().setStartPointNow();
updateChangesForTests();
changes.setEndPointNow();
@@ -51,8 +51,8 @@ public void test_has_number_of_modified_columns_greater_than_or_equal_to() throw
*/
@Test
@NeedReload
- public void should_fail_because_number_of_modified_columns_is_less() throws Exception {
- Changes changes = new Changes(jdbcConnectionProvider).setStartPointNow();
+ public void should_fail_because_number_of_modified_columns_is_less() {
+ Changes changes = assertDbConnection.changes().build().setStartPointNow();
updateChangesForTests();
changes.setEndPointNow();
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnModifiedColumns_HasNumberOfModifiedColumnsGreaterThan_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnModifiedColumns_HasNumberOfModifiedColumnsGreaterThan_Test.java
index 7e9ef9af..4e2e4d14 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnModifiedColumns_HasNumberOfModifiedColumnsGreaterThan_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnModifiedColumns_HasNumberOfModifiedColumnsGreaterThan_Test.java
@@ -36,8 +36,8 @@ public class AssertOnModifiedColumns_HasNumberOfModifiedColumnsGreaterThan_Test
*/
@Test
@NeedReload
- public void test_has_number_of_modified_columns_greater_than() throws Exception {
- Changes changes = new Changes(jdbcConnectionProvider).setStartPointNow();
+ public void test_has_number_of_modified_columns_greater_than() {
+ Changes changes = assertDbConnection.changes().build().setStartPointNow();
updateChangesForTests();
changes.setEndPointNow();
@@ -51,8 +51,8 @@ public void test_has_number_of_modified_columns_greater_than() throws Exception
*/
@Test
@NeedReload
- public void should_fail_because_number_of_modified_columns_is_less_or_equal() throws Exception {
- Changes changes = new Changes(jdbcConnectionProvider).setStartPointNow();
+ public void should_fail_because_number_of_modified_columns_is_less_or_equal() {
+ Changes changes = assertDbConnection.changes().build().setStartPointNow();
updateChangesForTests();
changes.setEndPointNow();
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnModifiedColumns_HasNumberOfModifiedColumnsLessThanOrEqualTo_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnModifiedColumns_HasNumberOfModifiedColumnsLessThanOrEqualTo_Test.java
index fc2f954f..c2ff9a20 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnModifiedColumns_HasNumberOfModifiedColumnsLessThanOrEqualTo_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnModifiedColumns_HasNumberOfModifiedColumnsLessThanOrEqualTo_Test.java
@@ -36,8 +36,8 @@ public class AssertOnModifiedColumns_HasNumberOfModifiedColumnsLessThanOrEqualTo
*/
@Test
@NeedReload
- public void test_has_number_of_modified_columns_less_than_or_equal_to() throws Exception {
- Changes changes = new Changes(jdbcConnectionProvider).setStartPointNow();
+ public void test_has_number_of_modified_columns_less_than_or_equal_to() {
+ Changes changes = assertDbConnection.changes().build().setStartPointNow();
updateChangesForTests();
changes.setEndPointNow();
@@ -51,8 +51,8 @@ public void test_has_number_of_modified_columns_less_than_or_equal_to() throws E
*/
@Test
@NeedReload
- public void should_fail_because_number_of_modified_columns_is_greater() throws Exception {
- Changes changes = new Changes(jdbcConnectionProvider).setStartPointNow();
+ public void should_fail_because_number_of_modified_columns_is_greater() {
+ Changes changes = assertDbConnection.changes().build().setStartPointNow();
updateChangesForTests();
changes.setEndPointNow();
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnModifiedColumns_HasNumberOfModifiedColumnsLessThan_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnModifiedColumns_HasNumberOfModifiedColumnsLessThan_Test.java
index 952d2122..8cde3f6a 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnModifiedColumns_HasNumberOfModifiedColumnsLessThan_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnModifiedColumns_HasNumberOfModifiedColumnsLessThan_Test.java
@@ -36,8 +36,8 @@ public class AssertOnModifiedColumns_HasNumberOfModifiedColumnsLessThan_Test ext
*/
@Test
@NeedReload
- public void test_has_number_of_modified_columns_less_than() throws Exception {
- Changes changes = new Changes(jdbcConnectionProvider).setStartPointNow();
+ public void test_has_number_of_modified_columns_less_than() {
+ Changes changes = assertDbConnection.changes().build().setStartPointNow();
updateChangesForTests();
changes.setEndPointNow();
@@ -51,8 +51,8 @@ public void test_has_number_of_modified_columns_less_than() throws Exception {
*/
@Test
@NeedReload
- public void should_fail_because_number_of_modified_columns_is_greater_or_equal() throws Exception {
- Changes changes = new Changes(jdbcConnectionProvider).setStartPointNow();
+ public void should_fail_because_number_of_modified_columns_is_greater_or_equal() {
+ Changes changes = assertDbConnection.changes().build().setStartPointNow();
updateChangesForTests();
changes.setEndPointNow();
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnModifiedColumns_HasNumberOfModifiedColumns_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnModifiedColumns_HasNumberOfModifiedColumns_Test.java
index 54ab0e04..236be136 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnModifiedColumns_HasNumberOfModifiedColumns_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnModifiedColumns_HasNumberOfModifiedColumns_Test.java
@@ -36,8 +36,8 @@ public class AssertOnModifiedColumns_HasNumberOfModifiedColumns_Test extends Abs
*/
@Test
@NeedReload
- public void test_has_number_of_modified_columns() throws Exception {
- Changes changes = new Changes(jdbcConnectionProvider).setStartPointNow();
+ public void test_has_number_of_modified_columns() {
+ Changes changes = assertDbConnection.changes().build().setStartPointNow();
updateChangesForTests();
changes.setEndPointNow();
@@ -51,8 +51,8 @@ public void test_has_number_of_modified_columns() throws Exception {
*/
@Test
@NeedReload
- public void should_fail_because_number_of_modified_columns_is_different() throws Exception {
- Changes changes = new Changes(jdbcConnectionProvider).setStartPointNow();
+ public void should_fail_because_number_of_modified_columns_is_different() {
+ Changes changes = assertDbConnection.changes().build().setStartPointNow();
updateChangesForTests();
changes.setEndPointNow();
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnNumberOfChanges_HasNumberOfChangesGreaterThanOrEqualTo_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnNumberOfChanges_HasNumberOfChangesGreaterThanOrEqualTo_Test.java
index 7d1f467f..01686b2d 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnNumberOfChanges_HasNumberOfChangesGreaterThanOrEqualTo_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnNumberOfChanges_HasNumberOfChangesGreaterThanOrEqualTo_Test.java
@@ -38,9 +38,9 @@ public class AssertOnNumberOfChanges_HasNumberOfChangesGreaterThanOrEqualTo_Test
*/
@Test
@NeedReload
- public void test_has_number_of_changes_greater_than_or_equal_to() throws Exception {
- Table table = new Table(jdbcConnectionProvider, "actor");
- Changes changes = new Changes(table).setStartPointNow();
+ public void test_has_number_of_changes_greater_than_or_equal_to() {
+ Table table = assertDbConnection.table("actor").build();
+ Changes changes = assertDbConnection.changes().tables(table).build().setStartPointNow();
updateChangesForTests();
changes.setEndPointNow();
@@ -54,9 +54,9 @@ public void test_has_number_of_changes_greater_than_or_equal_to() throws Excepti
*/
@Test
@NeedReload
- public void should_fail_because_number_of_changes_is_less() throws Exception {
- Request request = new Request(jdbcConnectionProvider, "select * from actor");
- Changes changes = new Changes(request).setStartPointNow();
+ public void should_fail_because_number_of_changes_is_less() {
+ Request request = assertDbConnection.request("select * from actor").build();
+ Changes changes = assertDbConnection.changes().request(request).build().setStartPointNow();
updateChangesForTests();
changes.setEndPointNow();
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnNumberOfChanges_HasNumberOfChangesGreaterThan_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnNumberOfChanges_HasNumberOfChangesGreaterThan_Test.java
index 455ca024..980d71c2 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnNumberOfChanges_HasNumberOfChangesGreaterThan_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnNumberOfChanges_HasNumberOfChangesGreaterThan_Test.java
@@ -38,9 +38,9 @@ public class AssertOnNumberOfChanges_HasNumberOfChangesGreaterThan_Test extends
*/
@Test
@NeedReload
- public void test_has_number_of_changes_greater_than() throws Exception {
- Table table = new Table(jdbcConnectionProvider, "actor");
- Changes changes = new Changes(table).setStartPointNow();
+ public void test_has_number_of_changes_greater_than() {
+ Table table = assertDbConnection.table("actor").build();
+ Changes changes = assertDbConnection.changes().tables(table).build().setStartPointNow();
updateChangesForTests();
changes.setEndPointNow();
@@ -54,9 +54,9 @@ public void test_has_number_of_changes_greater_than() throws Exception {
*/
@Test
@NeedReload
- public void should_fail_because_number_of_changes_is_less_or_equal() throws Exception {
- Request request = new Request(jdbcConnectionProvider, "select * from actor");
- Changes changes = new Changes(request).setStartPointNow();
+ public void should_fail_because_number_of_changes_is_less_or_equal() {
+ Request request = assertDbConnection.request("select * from actor").build();
+ Changes changes = assertDbConnection.changes().request(request).build().setStartPointNow();
updateChangesForTests();
changes.setEndPointNow();
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnNumberOfChanges_HasNumberOfChangesLessThanOrEqualTo_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnNumberOfChanges_HasNumberOfChangesLessThanOrEqualTo_Test.java
index 413f80b8..173271d8 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnNumberOfChanges_HasNumberOfChangesLessThanOrEqualTo_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnNumberOfChanges_HasNumberOfChangesLessThanOrEqualTo_Test.java
@@ -20,7 +20,6 @@
import org.assertj.db.common.AbstractTest;
import org.assertj.db.common.NeedReload;
import org.assertj.db.type.Changes;
-import org.assertj.db.type.Request;
import org.assertj.db.type.Table;
import org.junit.Test;
@@ -38,9 +37,9 @@ public class AssertOnNumberOfChanges_HasNumberOfChangesLessThanOrEqualTo_Test ex
*/
@Test
@NeedReload
- public void test_has_number_of_changes_greater_than_or_equal_to() throws Exception {
- Table table = new Table(jdbcConnectionProvider, "actor");
- Changes changes = new Changes(table).setStartPointNow();
+ public void test_has_number_of_changes_greater_than_or_equal_to() {
+ Table table = assertDbConnection.table("actor").build();
+ Changes changes = assertDbConnection.changes().tables(table).build().setStartPointNow();
updateChangesForTests();
changes.setEndPointNow();
@@ -54,9 +53,8 @@ public void test_has_number_of_changes_greater_than_or_equal_to() throws Excepti
*/
@Test
@NeedReload
- public void should_fail_because_number_of_changes_is_greater() throws Exception {
- Request request = new Request(jdbcConnectionProvider, "select * from actor");
- Changes changes = new Changes(request).setStartPointNow();
+ public void should_fail_because_number_of_changes_is_greater() {
+ Changes changes = assertDbConnection.changes().request("select * from actor").build().setStartPointNow();
updateChangesForTests();
changes.setEndPointNow();
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnNumberOfChanges_HasNumberOfChangesLessThan_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnNumberOfChanges_HasNumberOfChangesLessThan_Test.java
index 3388ff65..1c3a58cb 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnNumberOfChanges_HasNumberOfChangesLessThan_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnNumberOfChanges_HasNumberOfChangesLessThan_Test.java
@@ -38,9 +38,9 @@ public class AssertOnNumberOfChanges_HasNumberOfChangesLessThan_Test extends Abs
*/
@Test
@NeedReload
- public void test_has_number_of_changes_greater_than() throws Exception {
- Table table = new Table(jdbcConnectionProvider, "actor");
- Changes changes = new Changes(table).setStartPointNow();
+ public void test_has_number_of_changes_greater_than() {
+ Table table = assertDbConnection.table("actor").build();
+ Changes changes = assertDbConnection.changes().tables(table).build().setStartPointNow();
updateChangesForTests();
changes.setEndPointNow();
@@ -54,9 +54,9 @@ public void test_has_number_of_changes_greater_than() throws Exception {
*/
@Test
@NeedReload
- public void should_fail_because_number_of_changes_is_greater_or_equal() throws Exception {
- Request request = new Request(jdbcConnectionProvider, "select * from actor");
- Changes changes = new Changes(request).setStartPointNow();
+ public void should_fail_because_number_of_changes_is_greater_or_equal() {
+ Request request = assertDbConnection.request("select * from actor").build();
+ Changes changes = assertDbConnection.changes().request(request).build().setStartPointNow();
updateChangesForTests();
changes.setEndPointNow();
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnNumberOfChanges_HasNumberOfChanges_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnNumberOfChanges_HasNumberOfChanges_Test.java
index 5ec3713e..79a4380e 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnNumberOfChanges_HasNumberOfChanges_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnNumberOfChanges_HasNumberOfChanges_Test.java
@@ -38,9 +38,9 @@ public class AssertOnNumberOfChanges_HasNumberOfChanges_Test extends AbstractTes
*/
@Test
@NeedReload
- public void test_has_number_of_changes() throws Exception {
- Table table = new Table(jdbcConnectionProvider, "actor");
- Changes changes = new Changes(table).setStartPointNow();
+ public void test_has_number_of_changes() {
+ Table table = assertDbConnection.table("actor").build();
+ Changes changes = assertDbConnection.changes().tables(table).build().setStartPointNow();
updateChangesForTests();
changes.setEndPointNow();
@@ -48,7 +48,7 @@ public void test_has_number_of_changes() throws Exception {
ChangesAssert changesAssert2 = changesAssert.hasNumberOfChanges(3);
Assertions.assertThat(changesAssert).isSameAs(changesAssert2);
- assertThat(new Changes(table).setStartPointNow().setEndPointNow()).hasNumberOfChanges(0);
+ assertThat(assertDbConnection.changes().tables(table).build().setStartPointNow().setEndPointNow()).hasNumberOfChanges(0);
}
/**
@@ -56,9 +56,9 @@ public void test_has_number_of_changes() throws Exception {
*/
@Test
@NeedReload
- public void should_fail_because_number_of_changes_is_different() throws Exception {
- Request request = new Request(jdbcConnectionProvider, "select * from actor");
- Changes changes = new Changes(request).setStartPointNow();
+ public void should_fail_because_number_of_changes_is_different() {
+ Request request = assertDbConnection.request("select * from actor").build();
+ Changes changes = assertDbConnection.changes().request(request).build().setStartPointNow();
updateChangesForTests();
changes.setEndPointNow();
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnNumberOfColumns_HasNumberOfColumnsGreaterThanOrEqualTo_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnNumberOfColumns_HasNumberOfColumnsGreaterThanOrEqualTo_Test.java
index 31c353a8..df2498c7 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnNumberOfColumns_HasNumberOfColumnsGreaterThanOrEqualTo_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnNumberOfColumns_HasNumberOfColumnsGreaterThanOrEqualTo_Test.java
@@ -42,8 +42,8 @@ public class AssertOnNumberOfColumns_HasNumberOfColumnsGreaterThanOrEqualTo_Test
@Test
@NeedReload
public void test_has_number_of_columns() {
- Table table = new Table(jdbcConnectionProvider, "actor");
- Changes changes = new Changes(table).setStartPointNow();
+ Table table = assertDbConnection.table("actor").build();
+ Changes changes = assertDbConnection.changes().tables(table).build().setStartPointNow();
updateChangesForTests();
changes.setEndPointNow();
@@ -70,8 +70,8 @@ public void test_has_number_of_columns() {
@Test
@NeedReload
public void should_fail_because_number_of_columns_is_greater() {
- Request request = new Request(jdbcConnectionProvider, "select * from actor");
- Changes changes = new Changes(request).setStartPointNow();
+ Request request = assertDbConnection.request("select * from actor").build();
+ Changes changes = assertDbConnection.changes().request(request).build().setStartPointNow();
updateChangesForTests();
changes.setEndPointNow();
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnNumberOfColumns_HasNumberOfColumnsGreaterThan_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnNumberOfColumns_HasNumberOfColumnsGreaterThan_Test.java
index d89e1a12..8bb12601 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnNumberOfColumns_HasNumberOfColumnsGreaterThan_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnNumberOfColumns_HasNumberOfColumnsGreaterThan_Test.java
@@ -42,8 +42,8 @@ public class AssertOnNumberOfColumns_HasNumberOfColumnsGreaterThan_Test extends
@Test
@NeedReload
public void test_has_number_of_columns() {
- Table table = new Table(jdbcConnectionProvider, "actor");
- Changes changes = new Changes(table).setStartPointNow();
+ Table table = assertDbConnection.table("actor").build();
+ Changes changes = assertDbConnection.changes().tables(table).build().setStartPointNow();
updateChangesForTests();
changes.setEndPointNow();
@@ -70,8 +70,8 @@ public void test_has_number_of_columns() {
@Test
@NeedReload
public void should_fail_because_number_of_columns_is_different() {
- Request request = new Request(jdbcConnectionProvider, "select * from actor");
- Changes changes = new Changes(request).setStartPointNow();
+ Request request = assertDbConnection.request("select * from actor").build();
+ Changes changes = assertDbConnection.changes().request(request).build().setStartPointNow();
updateChangesForTests();
changes.setEndPointNow();
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnNumberOfColumns_HasNumberOfColumnsLessThanOrEqualTo_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnNumberOfColumns_HasNumberOfColumnsLessThanOrEqualTo_Test.java
index f18270f7..3b907c53 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnNumberOfColumns_HasNumberOfColumnsLessThanOrEqualTo_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnNumberOfColumns_HasNumberOfColumnsLessThanOrEqualTo_Test.java
@@ -42,8 +42,8 @@ public class AssertOnNumberOfColumns_HasNumberOfColumnsLessThanOrEqualTo_Test ex
@Test
@NeedReload
public void test_has_number_of_columns_less_than_or_equal() {
- Table table = new Table(jdbcConnectionProvider, "actor");
- Changes changes = new Changes(table).setStartPointNow();
+ Table table = assertDbConnection.table("actor").build();
+ Changes changes = assertDbConnection.changes().tables(table).build().setStartPointNow();
updateChangesForTests();
changes.setEndPointNow();
@@ -70,8 +70,8 @@ public void test_has_number_of_columns_less_than_or_equal() {
@Test
@NeedReload
public void should_fail_because_number_of_columns_is_less() {
- Request request = new Request(jdbcConnectionProvider, "select * from actor");
- Changes changes = new Changes(request).setStartPointNow();
+ Request request = assertDbConnection.request("select * from actor").build();
+ Changes changes = assertDbConnection.changes().request(request).build().setStartPointNow();
updateChangesForTests();
changes.setEndPointNow();
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnNumberOfColumns_HasNumberOfColumnsLessThan_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnNumberOfColumns_HasNumberOfColumnsLessThan_Test.java
index 60a360f8..60400399 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnNumberOfColumns_HasNumberOfColumnsLessThan_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnNumberOfColumns_HasNumberOfColumnsLessThan_Test.java
@@ -42,8 +42,8 @@ public class AssertOnNumberOfColumns_HasNumberOfColumnsLessThan_Test extends Abs
@Test
@NeedReload
public void test_has_number_of_columns_less_than() {
- Table table = new Table(jdbcConnectionProvider, "actor");
- Changes changes = new Changes(table).setStartPointNow();
+ Table table = assertDbConnection.table("actor").build();
+ Changes changes = assertDbConnection.changes().tables(table).build().setStartPointNow();
updateChangesForTests();
changes.setEndPointNow();
@@ -70,8 +70,8 @@ public void test_has_number_of_columns_less_than() {
@Test
@NeedReload
public void should_fail_because_number_of_columns_is_greater_or_equal() {
- Request request = new Request(jdbcConnectionProvider, "select * from actor");
- Changes changes = new Changes(request).setStartPointNow();
+ Request request = assertDbConnection.request("select * from actor").build();
+ Changes changes = assertDbConnection.changes().request(request).build().setStartPointNow();
updateChangesForTests();
changes.setEndPointNow();
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnNumberOfColumns_HasNumberOfColumns_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnNumberOfColumns_HasNumberOfColumns_Test.java
index 2faca76c..ccb75af1 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnNumberOfColumns_HasNumberOfColumns_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnNumberOfColumns_HasNumberOfColumns_Test.java
@@ -42,8 +42,8 @@ public class AssertOnNumberOfColumns_HasNumberOfColumns_Test extends AbstractTes
@Test
@NeedReload
public void test_has_number_of_columns() {
- Table table = new Table(jdbcConnectionProvider, "actor");
- Changes changes = new Changes(table).setStartPointNow();
+ Table table = assertDbConnection.table("actor").build();
+ Changes changes = assertDbConnection.changes().tables(table).build().setStartPointNow();
updateChangesForTests();
changes.setEndPointNow();
@@ -70,8 +70,8 @@ public void test_has_number_of_columns() {
@Test
@NeedReload
public void should_fail_because_number_of_columns_is_different() {
- Request request = new Request(jdbcConnectionProvider, "select * from actor");
- Changes changes = new Changes(request).setStartPointNow();
+ Request request = assertDbConnection.request("select * from actor").build();
+ Changes changes = assertDbConnection.changes().request(request).build().setStartPointNow();
updateChangesForTests();
changes.setEndPointNow();
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnNumberOfRows_HasNumberOfRowsGreaterThanOrEqualTo_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnNumberOfRows_HasNumberOfRowsGreaterThanOrEqualTo_Test.java
index 6e0b2c9a..542a9073 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnNumberOfRows_HasNumberOfRowsGreaterThanOrEqualTo_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnNumberOfRows_HasNumberOfRowsGreaterThanOrEqualTo_Test.java
@@ -37,7 +37,7 @@ public class AssertOnNumberOfRows_HasNumberOfRowsGreaterThanOrEqualTo_Test exten
*/
@Test
public void test_has_number_of_rows_greater_than_or_equal_to() {
- Table table = new Table(jdbcConnectionProvider, "actor");
+ Table table = assertDbConnection.table("actor").build();
TableAssert tableAssert = assertThat(table);
TableAssert tableAssert2 = tableAssert.hasNumberOfRowsGreaterThanOrEqualTo(3);
Assertions.assertThat(tableAssert).isSameAs(tableAssert2);
@@ -51,7 +51,7 @@ public void test_has_number_of_rows_greater_than_or_equal_to() {
*/
@Test
public void should_fail_because_number_of_rows_is_less() {
- Request request = new Request(jdbcConnectionProvider, "select * from actor");
+ Request request = assertDbConnection.request("select * from actor").build();
try {
assertThat(request).hasNumberOfRowsGreaterThanOrEqualTo(9);
fail("An exception must be raised");
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnNumberOfRows_HasNumberOfRowsGreaterThan_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnNumberOfRows_HasNumberOfRowsGreaterThan_Test.java
index a1398277..c311d733 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnNumberOfRows_HasNumberOfRowsGreaterThan_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnNumberOfRows_HasNumberOfRowsGreaterThan_Test.java
@@ -37,7 +37,7 @@ public class AssertOnNumberOfRows_HasNumberOfRowsGreaterThan_Test extends Abstra
*/
@Test
public void test_has_number_of_rows_greater_than() {
- Table table = new Table(jdbcConnectionProvider, "actor");
+ Table table = assertDbConnection.table("actor").build();
TableAssert tableAssert = assertThat(table);
TableAssert tableAssert2 = tableAssert.hasNumberOfRowsGreaterThan(2);
Assertions.assertThat(tableAssert).isSameAs(tableAssert2);
@@ -51,7 +51,7 @@ public void test_has_number_of_rows_greater_than() {
*/
@Test
public void should_fail_because_number_of_rows_is_less_or_equal() {
- Request request = new Request(jdbcConnectionProvider, "select * from actor");
+ Request request = assertDbConnection.request("select * from actor").build();
try {
assertThat(request).hasNumberOfRowsGreaterThan(9);
fail("An exception must be raised");
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnNumberOfRows_HasNumberOfRowsLessThanOrEqualTo_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnNumberOfRows_HasNumberOfRowsLessThanOrEqualTo_Test.java
index 148c8cbe..71b6c551 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnNumberOfRows_HasNumberOfRowsLessThanOrEqualTo_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnNumberOfRows_HasNumberOfRowsLessThanOrEqualTo_Test.java
@@ -37,7 +37,7 @@ public class AssertOnNumberOfRows_HasNumberOfRowsLessThanOrEqualTo_Test extends
*/
@Test
public void test_has_number_of_rows_less_than_or_equal_to() {
- Table table = new Table(jdbcConnectionProvider, "actor");
+ Table table = assertDbConnection.table("actor").build();
TableAssert tableAssert = assertThat(table);
TableAssert tableAssert2 = tableAssert.hasNumberOfRowsLessThanOrEqualTo(3);
Assertions.assertThat(tableAssert).isSameAs(tableAssert2);
@@ -51,7 +51,7 @@ public void test_has_number_of_rows_less_than_or_equal_to() {
*/
@Test
public void should_fail_because_number_of_rows_is_greater() {
- Request request = new Request(jdbcConnectionProvider, "select * from actor");
+ Request request = assertDbConnection.request("select * from actor").build();
try {
assertThat(request).hasNumberOfRowsLessThanOrEqualTo(2);
fail("An exception must be raised");
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnNumberOfRows_HasNumberOfRowsLessThan_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnNumberOfRows_HasNumberOfRowsLessThan_Test.java
index 4669ee4e..c774757d 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnNumberOfRows_HasNumberOfRowsLessThan_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnNumberOfRows_HasNumberOfRowsLessThan_Test.java
@@ -37,7 +37,7 @@ public class AssertOnNumberOfRows_HasNumberOfRowsLessThan_Test extends AbstractT
*/
@Test
public void test_has_number_of_rows_less_than() {
- Table table = new Table(jdbcConnectionProvider, "actor");
+ Table table = assertDbConnection.table("actor").build();
TableAssert tableAssert = assertThat(table);
TableAssert tableAssert2 = tableAssert.hasNumberOfRowsLessThan(4);
Assertions.assertThat(tableAssert).isSameAs(tableAssert2);
@@ -51,7 +51,7 @@ public void test_has_number_of_rows_less_than() {
*/
@Test
public void should_fail_because_number_of_rows_is_greater_or_equal() {
- Request request = new Request(jdbcConnectionProvider, "select * from actor");
+ Request request = assertDbConnection.request("select * from actor").build();
try {
assertThat(request).hasNumberOfRowsLessThan(2);
fail("An exception must be raised");
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnNumberOfRows_HasNumberOfRows_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnNumberOfRows_HasNumberOfRows_Test.java
index 76cdf01a..1393c080 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnNumberOfRows_HasNumberOfRows_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnNumberOfRows_HasNumberOfRows_Test.java
@@ -37,7 +37,7 @@ public class AssertOnNumberOfRows_HasNumberOfRows_Test extends AbstractTest {
*/
@Test
public void test_has_number_of_rows() {
- Table table = new Table(jdbcConnectionProvider, "actor");
+ Table table = assertDbConnection.table("actor").build();
TableAssert tableAssert = assertThat(table);
TableAssert tableAssert2 = tableAssert.hasNumberOfRows(3);
Assertions.assertThat(tableAssert).isSameAs(tableAssert2);
@@ -51,7 +51,7 @@ public void test_has_number_of_rows() {
*/
@Test
public void should_fail_because_number_of_rows_is_different() {
- Request request = new Request(jdbcConnectionProvider, "select * from actor");
+ Request request = assertDbConnection.request("select * from actor").build();
try {
assertThat(request).hasNumberOfRows(9);
fail("An exception must be raised");
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnNumberOfRows_IsEmpty_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnNumberOfRows_IsEmpty_Test.java
index f9a3e927..fd7f744d 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnNumberOfRows_IsEmpty_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnNumberOfRows_IsEmpty_Test.java
@@ -37,7 +37,7 @@ public class AssertOnNumberOfRows_IsEmpty_Test extends AbstractTest {
@Test
public void test_is_empty() {
update("delete from test");
- Table table = new Table(jdbcConnectionProvider, "test");
+ Table table = assertDbConnection.table("test").build();
TableAssert tableAssert = assertThat(table);
TableAssert tableAssert2 = tableAssert.isEmpty();
Assertions.assertThat(tableAssert).isSameAs(tableAssert2);
@@ -51,7 +51,7 @@ public void test_is_empty() {
*/
@Test
public void should_fail_because_table_is_not_empty() {
- Request request = new Request(jdbcConnectionProvider, "select * from actor");
+ Request request = assertDbConnection.request("select * from actor").build();
try {
assertThat(request).isEmpty();
fail("An exception must be raised");
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnPrimaryKey_HasPksNames_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnPrimaryKey_HasPksNames_Test.java
index 6292ab5f..3d806a50 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnPrimaryKey_HasPksNames_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnPrimaryKey_HasPksNames_Test.java
@@ -36,8 +36,8 @@ public class AssertOnPrimaryKey_HasPksNames_Test extends AbstractTest {
*/
@Test
@NeedReload
- public void test_has_pks_names() throws Exception {
- Changes changes = new Changes(jdbcConnectionProvider).setStartPointNow();
+ public void test_has_pks_names() {
+ Changes changes = assertDbConnection.changes().build().setStartPointNow();
updateChangesForTests();
changes.setEndPointNow();
@@ -51,8 +51,8 @@ public void test_has_pks_names() throws Exception {
*/
@Test
@NeedReload
- public void should_fail_because_pks_names_are_different() throws Exception {
- Changes changes = new Changes(jdbcConnectionProvider).setStartPointNow();
+ public void should_fail_because_pks_names_are_different() {
+ Changes changes = assertDbConnection.changes().build().setStartPointNow();
updateChangesForTests();
changes.setEndPointNow();
@@ -73,8 +73,8 @@ public void should_fail_because_pks_names_are_different() throws Exception {
*/
@Test
@NeedReload
- public void should_fail_because_number_of_pks_names_are_different() throws Exception {
- Changes changes = new Changes(jdbcConnectionProvider).setStartPointNow();
+ public void should_fail_because_number_of_pks_names_are_different() {
+ Changes changes = assertDbConnection.changes().build().setStartPointNow();
updateChangesForTests();
changes.setEndPointNow();
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnPrimaryKey_HasPksValues_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnPrimaryKey_HasPksValues_Test.java
index 049b9c90..effa9d6e 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnPrimaryKey_HasPksValues_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnPrimaryKey_HasPksValues_Test.java
@@ -12,6 +12,9 @@
*/
package org.assertj.db.api.assertions;
+import static org.assertj.db.api.Assertions.assertThat;
+import static org.junit.Assert.fail;
+
import org.assertj.core.api.Assertions;
import org.assertj.db.api.ChangeAssert;
import org.assertj.db.common.AbstractTest;
@@ -19,9 +22,6 @@
import org.assertj.db.type.Changes;
import org.junit.Test;
-import static org.assertj.db.api.Assertions.assertThat;
-import static org.junit.Assert.fail;
-
/**
* Tests on {@link org.assertj.db.api.assertions.AssertOnPrimaryKey} class :
* {@link org.assertj.db.api.assertions.AssertOnPrimaryKey#hasPksValues(Object...)} method.
@@ -36,8 +36,8 @@ public class AssertOnPrimaryKey_HasPksValues_Test extends AbstractTest {
*/
@Test
@NeedReload
- public void test_has_pks_values() throws Exception {
- Changes changes = new Changes(jdbcConnectionProvider).setStartPointNow();
+ public void test_has_pks_values() {
+ Changes changes = assertDbConnection.changes().build().setStartPointNow();
updateChangesForTests();
changes.setEndPointNow();
@@ -51,8 +51,8 @@ public void test_has_pks_values() throws Exception {
*/
@Test
@NeedReload
- public void should_fail_because_pks_values_are_different() throws Exception {
- Changes changes = new Changes(jdbcConnectionProvider).setStartPointNow();
+ public void should_fail_because_pks_values_are_different() {
+ Changes changes = assertDbConnection.changes().build().setStartPointNow();
updateChangesForTests();
changes.setEndPointNow();
@@ -73,8 +73,8 @@ public void should_fail_because_pks_values_are_different() throws Exception {
*/
@Test
@NeedReload
- public void should_fail_because_number_of_pks_values_are_different() throws Exception {
- Changes changes = new Changes(jdbcConnectionProvider).setStartPointNow();
+ public void should_fail_because_number_of_pks_values_are_different() {
+ Changes changes = assertDbConnection.changes().build().setStartPointNow();
updateChangesForTests();
changes.setEndPointNow();
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnRowCondition_HasValuesSatisfying_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnRowCondition_HasValuesSatisfying_Test.java
index 16cdc3e4..ccb13ef3 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnRowCondition_HasValuesSatisfying_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnRowCondition_HasValuesSatisfying_Test.java
@@ -42,8 +42,8 @@ public class AssertOnRowCondition_HasValuesSatisfying_Test extends AbstractTest
@Test
@NeedReload
public void test_has_values() {
- Table table = new Table(jdbcConnectionProvider, "actor");
- Changes changes = new Changes(table).setStartPointNow();
+ Table table = assertDbConnection.table("actor").build();
+ Changes changes = assertDbConnection.changes().tables(table).build().setStartPointNow();
updateChangesForTests();
changes.setEndPointNow();
@@ -90,8 +90,8 @@ public void test_has_values() {
@Test
@NeedReload
public void should_fail_because_values_are_different() {
- Table table = new Table(jdbcConnectionProvider, "actor");
- Changes changes = new Changes(table).setStartPointNow();
+ Table table = assertDbConnection.table("actor").build();
+ Changes changes = assertDbConnection.changes().tables(table).build().setStartPointNow();
updateChangesForTests();
changes.setEndPointNow();
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnRowEquality_HasValues_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnRowEquality_HasValues_Test.java
index 63a6dc52..497b7800 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnRowEquality_HasValues_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnRowEquality_HasValues_Test.java
@@ -40,8 +40,8 @@ public class AssertOnRowEquality_HasValues_Test extends AbstractTest {
@Test
@NeedReload
public void test_has_values() {
- Table table = new Table(jdbcConnectionProvider, "actor");
- Changes changes = new Changes(table).setStartPointNow();
+ Table table = assertDbConnection.table("actor").build();
+ Changes changes = assertDbConnection.changes().tables(table).build().setStartPointNow();
updateChangesForTests();
changes.setEndPointNow();
@@ -63,8 +63,8 @@ public void test_has_values() {
@Test
@NeedReload
public void should_fail_because_values_are_different() {
- Table table = new Table(jdbcConnectionProvider, "actor");
- Changes changes = new Changes(table).setStartPointNow();
+ Table table = assertDbConnection.table("actor").build();
+ Changes changes = assertDbConnection.changes().tables(table).build().setStartPointNow();
updateChangesForTests();
changes.setEndPointNow();
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnRowNullity_HasOnlyNotNullValues_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnRowNullity_HasOnlyNotNullValues_Test.java
index 13b1343e..6c3ae337 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnRowNullity_HasOnlyNotNullValues_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnRowNullity_HasOnlyNotNullValues_Test.java
@@ -32,7 +32,7 @@ public class AssertOnRowNullity_HasOnlyNotNullValues_Test extends AbstractTest {
*/
@Test
public void test_has_only_not_null_values() {
- Table table = new Table(jdbcConnectionProvider, "test");
+ Table table = assertDbConnection.table("test").build();
TableRowAssert tableRowAssert = assertThat(table).row();
TableRowAssert tableRowAssert2 = tableRowAssert.hasOnlyNotNullValues();
Assertions.assertThat(tableRowAssert).isSameAs(tableRowAssert2);
@@ -42,8 +42,8 @@ public void test_has_only_not_null_values() {
* This method should fail because the row has a null value.
*/
@Test
- public void should_fail_because_row_has_null_value() throws Exception {
- Table table = new Table(jdbcConnectionProvider, "test2");
+ public void should_fail_because_row_has_null_value() {
+ Table table = assertDbConnection.table("test2").build();
TableRowAssert tableRowAssert = assertThat(table).row().row();
try {
tableRowAssert.hasOnlyNotNullValues();
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnRowOfChangeExistence_DoesNotExist_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnRowOfChangeExistence_DoesNotExist_Test.java
index e90fa6a6..42007162 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnRowOfChangeExistence_DoesNotExist_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnRowOfChangeExistence_DoesNotExist_Test.java
@@ -35,8 +35,8 @@ public class AssertOnRowOfChangeExistence_DoesNotExist_Test extends AbstractTest
*/
@Test
@NeedReload
- public void test_does_not_exists() throws Exception {
- Changes changes = new Changes(jdbcConnectionProvider).setStartPointNow();
+ public void test_does_not_exists() {
+ Changes changes = assertDbConnection.changes().build().setStartPointNow();
updateChangesForTests();
changes.setEndPointNow();
@@ -50,8 +50,8 @@ public void test_does_not_exists() throws Exception {
*/
@Test
@NeedReload
- public void should_fail_because_row_exists() throws Exception {
- Changes changes = new Changes(jdbcConnectionProvider).setStartPointNow();
+ public void should_fail_because_row_exists() {
+ Changes changes = assertDbConnection.changes().build().setStartPointNow();
updateChangesForTests();
changes.setEndPointNow();
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnRowOfChangeExistence_Exists_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnRowOfChangeExistence_Exists_Test.java
index d76ee90a..017f92d5 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnRowOfChangeExistence_Exists_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnRowOfChangeExistence_Exists_Test.java
@@ -35,8 +35,8 @@ public class AssertOnRowOfChangeExistence_Exists_Test extends AbstractTest {
*/
@Test
@NeedReload
- public void test_exists() throws Exception {
- Changes changes = new Changes(jdbcConnectionProvider).setStartPointNow();
+ public void test_exists() {
+ Changes changes = assertDbConnection.changes().build().setStartPointNow();
updateChangesForTests();
changes.setEndPointNow();
@@ -50,8 +50,8 @@ public void test_exists() throws Exception {
*/
@Test
@NeedReload
- public void should_fail_because_row_does_not_exist() throws Exception {
- Changes changes = new Changes(jdbcConnectionProvider).setStartPointNow();
+ public void should_fail_because_row_does_not_exist() {
+ Changes changes = assertDbConnection.changes().build().setStartPointNow();
updateChangesForTests();
changes.setEndPointNow();
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnValueChronology_IsAfterOrEqualTo_DateTimeValue_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnValueChronology_IsAfterOrEqualTo_DateTimeValue_Test.java
index 68b7dc6c..75fb6f82 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnValueChronology_IsAfterOrEqualTo_DateTimeValue_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnValueChronology_IsAfterOrEqualTo_DateTimeValue_Test.java
@@ -42,8 +42,8 @@ public class AssertOnValueChronology_IsAfterOrEqualTo_DateTimeValue_Test extends
@Test
@NeedReload
public void test_is_after_or_equal_to() throws ParseException {
- Table table = new Table(jdbcConnectionProvider, "test");
- Changes changes = new Changes(table).setStartPointNow();
+ Table table = assertDbConnection.table("test").build();
+ Changes changes = assertDbConnection.changes().tables(table).build().setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
changes.setEndPointNow();
@@ -64,8 +64,8 @@ public void test_is_after_or_equal_to() throws ParseException {
@Test
@NeedReload
public void should_fail_because_value_is_before() throws ParseException {
- Table table = new Table(jdbcConnectionProvider, "test");
- Changes changes = new Changes(table).setStartPointNow();
+ Table table = assertDbConnection.table("test").build();
+ Changes changes = assertDbConnection.changes().tables(table).build().setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
changes.setEndPointNow();
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnValueChronology_IsAfterOrEqualTo_DateValue_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnValueChronology_IsAfterOrEqualTo_DateValue_Test.java
index 909e154b..dacc05f2 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnValueChronology_IsAfterOrEqualTo_DateValue_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnValueChronology_IsAfterOrEqualTo_DateValue_Test.java
@@ -42,8 +42,8 @@ public class AssertOnValueChronology_IsAfterOrEqualTo_DateValue_Test extends Abs
@Test
@NeedReload
public void test_is_after_or_equal_to() throws ParseException {
- Table table = new Table(jdbcConnectionProvider, "test");
- Changes changes = new Changes(table).setStartPointNow();
+ Table table = assertDbConnection.table("test").build();
+ Changes changes = assertDbConnection.changes().tables(table).build().setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
changes.setEndPointNow();
@@ -64,8 +64,8 @@ public void test_is_after_or_equal_to() throws ParseException {
@Test
@NeedReload
public void should_fail_because_value_is_before() throws ParseException {
- Table table = new Table(jdbcConnectionProvider, "test");
- Changes changes = new Changes(table).setStartPointNow();
+ Table table = assertDbConnection.table("test").build();
+ Changes changes = assertDbConnection.changes().tables(table).build().setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
changes.setEndPointNow();
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnValueChronology_IsAfterOrEqualTo_LocalDateTime_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnValueChronology_IsAfterOrEqualTo_LocalDateTime_Test.java
index 63dedeb3..15e2dc49 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnValueChronology_IsAfterOrEqualTo_LocalDateTime_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnValueChronology_IsAfterOrEqualTo_LocalDateTime_Test.java
@@ -40,8 +40,8 @@ public class AssertOnValueChronology_IsAfterOrEqualTo_LocalDateTime_Test extends
@Test
@NeedReload
public void test_is_after_or_equal_to() {
- Table table = new Table(jdbcConnectionProvider, "test");
- Changes changes = new Changes(table).setStartPointNow();
+ Table table = assertDbConnection.table("test").build();
+ Changes changes = assertDbConnection.changes().tables(table).build().setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
changes.setEndPointNow();
@@ -60,8 +60,8 @@ public void test_is_after_or_equal_to() {
@Test
@NeedReload
public void should_fail_because_value_is_before() {
- Table table = new Table(jdbcConnectionProvider, "test");
- Changes changes = new Changes(table).setStartPointNow();
+ Table table = assertDbConnection.table("test").build();
+ Changes changes = assertDbConnection.changes().tables(table).build().setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
changes.setEndPointNow();
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnValueChronology_IsAfterOrEqualTo_LocalDate_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnValueChronology_IsAfterOrEqualTo_LocalDate_Test.java
index 099bc8f8..d25f9cef 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnValueChronology_IsAfterOrEqualTo_LocalDate_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnValueChronology_IsAfterOrEqualTo_LocalDate_Test.java
@@ -40,8 +40,8 @@ public class AssertOnValueChronology_IsAfterOrEqualTo_LocalDate_Test extends Abs
@Test
@NeedReload
public void test_is_after_or_equal_to() {
- Table table = new Table(jdbcConnectionProvider, "test");
- Changes changes = new Changes(table).setStartPointNow();
+ Table table = assertDbConnection.table("test").build();
+ Changes changes = assertDbConnection.changes().tables(table).build().setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
changes.setEndPointNow();
@@ -60,8 +60,8 @@ public void test_is_after_or_equal_to() {
@Test
@NeedReload
public void should_fail_because_value_is_before() {
- Table table = new Table(jdbcConnectionProvider, "test");
- Changes changes = new Changes(table).setStartPointNow();
+ Table table = assertDbConnection.table("test").build();
+ Changes changes = assertDbConnection.changes().tables(table).build().setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
changes.setEndPointNow();
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnValueChronology_IsAfterOrEqualTo_LocalTime_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnValueChronology_IsAfterOrEqualTo_LocalTime_Test.java
index 04af4ae3..93f1356e 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnValueChronology_IsAfterOrEqualTo_LocalTime_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnValueChronology_IsAfterOrEqualTo_LocalTime_Test.java
@@ -40,8 +40,8 @@ public class AssertOnValueChronology_IsAfterOrEqualTo_LocalTime_Test extends Abs
@Test
@NeedReload
public void test_is_after_or_equal_to() {
- Table table = new Table(jdbcConnectionProvider, "test");
- Changes changes = new Changes(table).setStartPointNow();
+ Table table = assertDbConnection.table("test").build();
+ Changes changes = assertDbConnection.changes().tables(table).build().setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
changes.setEndPointNow();
@@ -60,8 +60,8 @@ public void test_is_after_or_equal_to() {
@Test
@NeedReload
public void should_fail_because_value_is_before() {
- Table table = new Table(jdbcConnectionProvider, "test");
- Changes changes = new Changes(table).setStartPointNow();
+ Table table = assertDbConnection.table("test").build();
+ Changes changes = assertDbConnection.changes().tables(table).build().setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
changes.setEndPointNow();
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnValueChronology_IsAfterOrEqualTo_String_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnValueChronology_IsAfterOrEqualTo_String_Test.java
index 9c60dca2..e0020e95 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnValueChronology_IsAfterOrEqualTo_String_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnValueChronology_IsAfterOrEqualTo_String_Test.java
@@ -39,8 +39,8 @@ public class AssertOnValueChronology_IsAfterOrEqualTo_String_Test extends Abstra
@Test
@NeedReload
public void test_is_after_or_equal_to() {
- Table table = new Table(jdbcConnectionProvider, "test");
- Changes changes = new Changes(table).setStartPointNow();
+ Table table = assertDbConnection.table("test").build();
+ Changes changes = assertDbConnection.changes().tables(table).build().setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
changes.setEndPointNow();
@@ -59,8 +59,8 @@ public void test_is_after_or_equal_to() {
@Test
@NeedReload
public void should_fail_because_value_is_before() {
- Table table = new Table(jdbcConnectionProvider, "test");
- Changes changes = new Changes(table).setStartPointNow();
+ Table table = assertDbConnection.table("test").build();
+ Changes changes = assertDbConnection.changes().tables(table).build().setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
changes.setEndPointNow();
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnValueChronology_IsAfterOrEqualTo_TimeValue_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnValueChronology_IsAfterOrEqualTo_TimeValue_Test.java
index 6ee24bdb..2efad82c 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnValueChronology_IsAfterOrEqualTo_TimeValue_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnValueChronology_IsAfterOrEqualTo_TimeValue_Test.java
@@ -42,8 +42,8 @@ public class AssertOnValueChronology_IsAfterOrEqualTo_TimeValue_Test extends Abs
@Test
@NeedReload
public void test_is_after_or_equal_to() throws ParseException {
- Table table = new Table(jdbcConnectionProvider, "test");
- Changes changes = new Changes(table).setStartPointNow();
+ Table table = assertDbConnection.table("test").build();
+ Changes changes = assertDbConnection.changes().tables(table).build().setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
changes.setEndPointNow();
@@ -64,8 +64,8 @@ public void test_is_after_or_equal_to() throws ParseException {
@Test
@NeedReload
public void should_fail_because_value_is_before() throws ParseException {
- Table table = new Table(jdbcConnectionProvider, "test");
- Changes changes = new Changes(table).setStartPointNow();
+ Table table = assertDbConnection.table("test").build();
+ Changes changes = assertDbConnection.changes().tables(table).build().setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
changes.setEndPointNow();
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnValueChronology_IsAfter_DateTimeValue_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnValueChronology_IsAfter_DateTimeValue_Test.java
index 9fada804..5f4f8929 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnValueChronology_IsAfter_DateTimeValue_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnValueChronology_IsAfter_DateTimeValue_Test.java
@@ -42,8 +42,8 @@ public class AssertOnValueChronology_IsAfter_DateTimeValue_Test extends Abstract
@Test
@NeedReload
public void test_is_after() throws ParseException {
- Table table = new Table(jdbcConnectionProvider, "test");
- Changes changes = new Changes(table).setStartPointNow();
+ Table table = assertDbConnection.table("test").build();
+ Changes changes = assertDbConnection.changes().tables(table).build().setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
changes.setEndPointNow();
@@ -62,8 +62,8 @@ public void test_is_after() throws ParseException {
@Test
@NeedReload
public void should_fail_because_value_is_before_or_equal_to() throws ParseException {
- Table table = new Table(jdbcConnectionProvider, "test");
- Changes changes = new Changes(table).setStartPointNow();
+ Table table = assertDbConnection.table("test").build();
+ Changes changes = assertDbConnection.changes().tables(table).build().setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
changes.setEndPointNow();
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnValueChronology_IsAfter_DateValue_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnValueChronology_IsAfter_DateValue_Test.java
index 67f12022..b67bed1c 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnValueChronology_IsAfter_DateValue_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnValueChronology_IsAfter_DateValue_Test.java
@@ -42,8 +42,8 @@ public class AssertOnValueChronology_IsAfter_DateValue_Test extends AbstractTest
@Test
@NeedReload
public void test_is_after() throws ParseException {
- Table table = new Table(jdbcConnectionProvider, "test");
- Changes changes = new Changes(table).setStartPointNow();
+ Table table = assertDbConnection.table("test").build();
+ Changes changes = assertDbConnection.changes().tables(table).build().setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
changes.setEndPointNow();
@@ -63,8 +63,8 @@ public void test_is_after() throws ParseException {
@Test
@NeedReload
public void should_fail_because_value_is_before_or_equal_to() throws ParseException {
- Table table = new Table(jdbcConnectionProvider, "test");
- Changes changes = new Changes(table).setStartPointNow();
+ Table table = assertDbConnection.table("test").build();
+ Changes changes = assertDbConnection.changes().tables(table).build().setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
changes.setEndPointNow();
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnValueChronology_IsAfter_LocalDateTime_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnValueChronology_IsAfter_LocalDateTime_Test.java
index 50c76b8e..1e56867b 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnValueChronology_IsAfter_LocalDateTime_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnValueChronology_IsAfter_LocalDateTime_Test.java
@@ -40,8 +40,8 @@ public class AssertOnValueChronology_IsAfter_LocalDateTime_Test extends Abstract
@Test
@NeedReload
public void test_is_after() {
- Table table = new Table(jdbcConnectionProvider, "test");
- Changes changes = new Changes(table).setStartPointNow();
+ Table table = assertDbConnection.table("test").build();
+ Changes changes = assertDbConnection.changes().tables(table).build().setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
changes.setEndPointNow();
@@ -60,8 +60,8 @@ public void test_is_after() {
@Test
@NeedReload
public void should_fail_because_value_is_before_or_equal_to() {
- Table table = new Table(jdbcConnectionProvider, "test");
- Changes changes = new Changes(table).setStartPointNow();
+ Table table = assertDbConnection.table("test").build();
+ Changes changes = assertDbConnection.changes().tables(table).build().setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
changes.setEndPointNow();
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnValueChronology_IsAfter_LocalDate_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnValueChronology_IsAfter_LocalDate_Test.java
index 58408a0d..db6df0dd 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnValueChronology_IsAfter_LocalDate_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnValueChronology_IsAfter_LocalDate_Test.java
@@ -40,8 +40,8 @@ public class AssertOnValueChronology_IsAfter_LocalDate_Test extends AbstractTest
@Test
@NeedReload
public void test_is_after() {
- Table table = new Table(jdbcConnectionProvider, "test");
- Changes changes = new Changes(table).setStartPointNow();
+ Table table = assertDbConnection.table("test").build();
+ Changes changes = assertDbConnection.changes().tables(table).build().setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
changes.setEndPointNow();
@@ -60,8 +60,8 @@ public void test_is_after() {
@Test
@NeedReload
public void should_fail_because_value_is_before_or_equal_to() {
- Table table = new Table(jdbcConnectionProvider, "test");
- Changes changes = new Changes(table).setStartPointNow();
+ Table table = assertDbConnection.table("test").build();
+ Changes changes = assertDbConnection.changes().tables(table).build().setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
changes.setEndPointNow();
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnValueChronology_IsAfter_LocalTime_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnValueChronology_IsAfter_LocalTime_Test.java
index e9d4f258..bb786ea8 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnValueChronology_IsAfter_LocalTime_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnValueChronology_IsAfter_LocalTime_Test.java
@@ -40,8 +40,8 @@ public class AssertOnValueChronology_IsAfter_LocalTime_Test extends AbstractTest
@Test
@NeedReload
public void test_is_after() {
- Table table = new Table(jdbcConnectionProvider, "test");
- Changes changes = new Changes(table).setStartPointNow();
+ Table table = assertDbConnection.table("test").build();
+ Changes changes = assertDbConnection.changes().tables(table).build().setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
changes.setEndPointNow();
@@ -60,8 +60,8 @@ public void test_is_after() {
@Test
@NeedReload
public void should_fail_because_value_is_before_or_equal_to() {
- Table table = new Table(jdbcConnectionProvider, "test");
- Changes changes = new Changes(table).setStartPointNow();
+ Table table = assertDbConnection.table("test").build();
+ Changes changes = assertDbConnection.changes().tables(table).build().setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
changes.setEndPointNow();
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnValueChronology_IsAfter_String_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnValueChronology_IsAfter_String_Test.java
index 3b084e6b..0dbb2165 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnValueChronology_IsAfter_String_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnValueChronology_IsAfter_String_Test.java
@@ -39,8 +39,8 @@ public class AssertOnValueChronology_IsAfter_String_Test extends AbstractTest {
@Test
@NeedReload
public void test_is_after() {
- Table table = new Table(jdbcConnectionProvider, "test");
- Changes changes = new Changes(table).setStartPointNow();
+ Table table = assertDbConnection.table("test").build();
+ Changes changes = assertDbConnection.changes().tables(table).build().setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
changes.setEndPointNow();
@@ -59,8 +59,8 @@ public void test_is_after() {
@Test
@NeedReload
public void should_fail_because_value_is_before_or_equal_to() {
- Table table = new Table(jdbcConnectionProvider, "test");
- Changes changes = new Changes(table).setStartPointNow();
+ Table table = assertDbConnection.table("test").build();
+ Changes changes = assertDbConnection.changes().tables(table).build().setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
changes.setEndPointNow();
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnValueChronology_IsAfter_TimeValue_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnValueChronology_IsAfter_TimeValue_Test.java
index 65a77924..3d6f546b 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnValueChronology_IsAfter_TimeValue_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnValueChronology_IsAfter_TimeValue_Test.java
@@ -42,8 +42,8 @@ public class AssertOnValueChronology_IsAfter_TimeValue_Test extends AbstractTest
@Test
@NeedReload
public void test_is_after() throws ParseException {
- Table table = new Table(jdbcConnectionProvider, "test");
- Changes changes = new Changes(table).setStartPointNow();
+ Table table = assertDbConnection.table("test").build();
+ Changes changes = assertDbConnection.changes().tables(table).build().setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
changes.setEndPointNow();
@@ -62,8 +62,8 @@ public void test_is_after() throws ParseException {
@Test
@NeedReload
public void should_fail_because_value_is_before_or_equal_to() throws ParseException {
- Table table = new Table(jdbcConnectionProvider, "test");
- Changes changes = new Changes(table).setStartPointNow();
+ Table table = assertDbConnection.table("test").build();
+ Changes changes = assertDbConnection.changes().tables(table).build().setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
changes.setEndPointNow();
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnValueChronology_IsBeforeOrEqualTo_DateTimeValue_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnValueChronology_IsBeforeOrEqualTo_DateTimeValue_Test.java
index 3acd718b..0b736b61 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnValueChronology_IsBeforeOrEqualTo_DateTimeValue_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnValueChronology_IsBeforeOrEqualTo_DateTimeValue_Test.java
@@ -42,8 +42,8 @@ public class AssertOnValueChronology_IsBeforeOrEqualTo_DateTimeValue_Test extend
@Test
@NeedReload
public void test_is_before_or_equal_to() throws ParseException {
- Table table = new Table(jdbcConnectionProvider, "test");
- Changes changes = new Changes(table).setStartPointNow();
+ Table table = assertDbConnection.table("test").build();
+ Changes changes = assertDbConnection.changes().tables(table).build().setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
changes.setEndPointNow();
@@ -63,8 +63,8 @@ public void test_is_before_or_equal_to() throws ParseException {
@Test
@NeedReload
public void should_fail_because_value_is_after() throws ParseException {
- Table table = new Table(jdbcConnectionProvider, "test");
- Changes changes = new Changes(table).setStartPointNow();
+ Table table = assertDbConnection.table("test").build();
+ Changes changes = assertDbConnection.changes().tables(table).build().setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
changes.setEndPointNow();
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnValueChronology_IsBeforeOrEqualTo_DateValue_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnValueChronology_IsBeforeOrEqualTo_DateValue_Test.java
index 396dcff9..2cfa5439 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnValueChronology_IsBeforeOrEqualTo_DateValue_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnValueChronology_IsBeforeOrEqualTo_DateValue_Test.java
@@ -42,8 +42,8 @@ public class AssertOnValueChronology_IsBeforeOrEqualTo_DateValue_Test extends Ab
@Test
@NeedReload
public void test_is_before_or_equal_to() throws ParseException {
- Table table = new Table(jdbcConnectionProvider, "test");
- Changes changes = new Changes(table).setStartPointNow();
+ Table table = assertDbConnection.table("test").build();
+ Changes changes = assertDbConnection.changes().tables(table).build().setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
changes.setEndPointNow();
@@ -64,8 +64,8 @@ public void test_is_before_or_equal_to() throws ParseException {
@Test
@NeedReload
public void should_fail_because_value_is_after() throws ParseException {
- Table table = new Table(jdbcConnectionProvider, "test");
- Changes changes = new Changes(table).setStartPointNow();
+ Table table = assertDbConnection.table("test").build();
+ Changes changes = assertDbConnection.changes().tables(table).build().setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
changes.setEndPointNow();
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnValueChronology_IsBeforeOrEqualTo_LocalDateTime_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnValueChronology_IsBeforeOrEqualTo_LocalDateTime_Test.java
index c9d05b93..02519f7b 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnValueChronology_IsBeforeOrEqualTo_LocalDateTime_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnValueChronology_IsBeforeOrEqualTo_LocalDateTime_Test.java
@@ -40,8 +40,8 @@ public class AssertOnValueChronology_IsBeforeOrEqualTo_LocalDateTime_Test extend
@Test
@NeedReload
public void test_is_before_or_equal_to() {
- Table table = new Table(jdbcConnectionProvider, "test");
- Changes changes = new Changes(table).setStartPointNow();
+ Table table = assertDbConnection.table("test").build();
+ Changes changes = assertDbConnection.changes().tables(table).build().setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
changes.setEndPointNow();
@@ -60,8 +60,8 @@ public void test_is_before_or_equal_to() {
@Test
@NeedReload
public void should_fail_because_value_is_after() {
- Table table = new Table(jdbcConnectionProvider, "test");
- Changes changes = new Changes(table).setStartPointNow();
+ Table table = assertDbConnection.table("test").build();
+ Changes changes = assertDbConnection.changes().tables(table).build().setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
changes.setEndPointNow();
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnValueChronology_IsBeforeOrEqualTo_LocalDate_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnValueChronology_IsBeforeOrEqualTo_LocalDate_Test.java
index dc209045..a81d3881 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnValueChronology_IsBeforeOrEqualTo_LocalDate_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnValueChronology_IsBeforeOrEqualTo_LocalDate_Test.java
@@ -40,8 +40,8 @@ public class AssertOnValueChronology_IsBeforeOrEqualTo_LocalDate_Test extends Ab
@Test
@NeedReload
public void test_is_before_or_equal_to() {
- Table table = new Table(jdbcConnectionProvider, "test");
- Changes changes = new Changes(table).setStartPointNow();
+ Table table = assertDbConnection.table("test").build();
+ Changes changes = assertDbConnection.changes().tables(table).build().setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
changes.setEndPointNow();
@@ -60,8 +60,8 @@ public void test_is_before_or_equal_to() {
@Test
@NeedReload
public void should_fail_because_value_is_after() {
- Table table = new Table(jdbcConnectionProvider, "test");
- Changes changes = new Changes(table).setStartPointNow();
+ Table table = assertDbConnection.table("test").build();
+ Changes changes = assertDbConnection.changes().tables(table).build().setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
changes.setEndPointNow();
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnValueChronology_IsBeforeOrEqualTo_LocalTime_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnValueChronology_IsBeforeOrEqualTo_LocalTime_Test.java
index de667aed..aa6ac61c 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnValueChronology_IsBeforeOrEqualTo_LocalTime_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnValueChronology_IsBeforeOrEqualTo_LocalTime_Test.java
@@ -40,8 +40,8 @@ public class AssertOnValueChronology_IsBeforeOrEqualTo_LocalTime_Test extends Ab
@Test
@NeedReload
public void test_is_before_or_equal_to() {
- Table table = new Table(jdbcConnectionProvider, "test");
- Changes changes = new Changes(table).setStartPointNow();
+ Table table = assertDbConnection.table("test").build();
+ Changes changes = assertDbConnection.changes().tables(table).build().setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
changes.setEndPointNow();
@@ -60,8 +60,8 @@ public void test_is_before_or_equal_to() {
@Test
@NeedReload
public void should_fail_because_value_is_after() {
- Table table = new Table(jdbcConnectionProvider, "test");
- Changes changes = new Changes(table).setStartPointNow();
+ Table table = assertDbConnection.table("test").build();
+ Changes changes = assertDbConnection.changes().tables(table).build().setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
changes.setEndPointNow();
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnValueChronology_IsBeforeOrEqualTo_String_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnValueChronology_IsBeforeOrEqualTo_String_Test.java
index 27045cc5..f979ee2b 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnValueChronology_IsBeforeOrEqualTo_String_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnValueChronology_IsBeforeOrEqualTo_String_Test.java
@@ -39,8 +39,8 @@ public class AssertOnValueChronology_IsBeforeOrEqualTo_String_Test extends Abstr
@Test
@NeedReload
public void test_is_before_or_equal_to() {
- Table table = new Table(jdbcConnectionProvider, "test");
- Changes changes = new Changes(table).setStartPointNow();
+ Table table = assertDbConnection.table("test").build();
+ Changes changes = assertDbConnection.changes().tables(table).build().setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
changes.setEndPointNow();
@@ -59,8 +59,8 @@ public void test_is_before_or_equal_to() {
@Test
@NeedReload
public void should_fail_because_value_is_after() {
- Table table = new Table(jdbcConnectionProvider, "test");
- Changes changes = new Changes(table).setStartPointNow();
+ Table table = assertDbConnection.table("test").build();
+ Changes changes = assertDbConnection.changes().tables(table).build().setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
changes.setEndPointNow();
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnValueChronology_IsBeforeOrEqualTo_TimeValue_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnValueChronology_IsBeforeOrEqualTo_TimeValue_Test.java
index 78a7a45f..c19a8c73 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnValueChronology_IsBeforeOrEqualTo_TimeValue_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnValueChronology_IsBeforeOrEqualTo_TimeValue_Test.java
@@ -42,8 +42,8 @@ public class AssertOnValueChronology_IsBeforeOrEqualTo_TimeValue_Test extends Ab
@Test
@NeedReload
public void test_is_before_or_equal_to() throws ParseException {
- Table table = new Table(jdbcConnectionProvider, "test");
- Changes changes = new Changes(table).setStartPointNow();
+ Table table = assertDbConnection.table("test").build();
+ Changes changes = assertDbConnection.changes().tables(table).build().setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
changes.setEndPointNow();
@@ -64,8 +64,8 @@ public void test_is_before_or_equal_to() throws ParseException {
@Test
@NeedReload
public void should_fail_because_value_is_after() throws ParseException {
- Table table = new Table(jdbcConnectionProvider, "test");
- Changes changes = new Changes(table).setStartPointNow();
+ Table table = assertDbConnection.table("test").build();
+ Changes changes = assertDbConnection.changes().tables(table).build().setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
changes.setEndPointNow();
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnValueChronology_IsBefore_DateTimeValue_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnValueChronology_IsBefore_DateTimeValue_Test.java
index dee9c3f0..d94fd80b 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnValueChronology_IsBefore_DateTimeValue_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnValueChronology_IsBefore_DateTimeValue_Test.java
@@ -42,8 +42,8 @@ public class AssertOnValueChronology_IsBefore_DateTimeValue_Test extends Abstrac
@Test
@NeedReload
public void test_is_before() throws ParseException {
- Table table = new Table(jdbcConnectionProvider, "test");
- Changes changes = new Changes(table).setStartPointNow();
+ Table table = assertDbConnection.table("test").build();
+ Changes changes = assertDbConnection.changes().tables(table).build().setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
changes.setEndPointNow();
@@ -64,8 +64,8 @@ public void test_is_before() throws ParseException {
@Test
@NeedReload
public void should_fail_because_value_is_after_or_equal_to() throws ParseException {
- Table table = new Table(jdbcConnectionProvider, "test");
- Changes changes = new Changes(table).setStartPointNow();
+ Table table = assertDbConnection.table("test").build();
+ Changes changes = assertDbConnection.changes().tables(table).build().setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
changes.setEndPointNow();
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnValueChronology_IsBefore_DateValue_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnValueChronology_IsBefore_DateValue_Test.java
index 8dc6ec1d..7ca82e5a 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnValueChronology_IsBefore_DateValue_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnValueChronology_IsBefore_DateValue_Test.java
@@ -42,8 +42,8 @@ public class AssertOnValueChronology_IsBefore_DateValue_Test extends AbstractTes
@Test
@NeedReload
public void test_is_before() throws ParseException {
- Table table = new Table(jdbcConnectionProvider, "test");
- Changes changes = new Changes(table).setStartPointNow();
+ Table table = assertDbConnection.table("test").build();
+ Changes changes = assertDbConnection.changes().tables(table).build().setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
changes.setEndPointNow();
@@ -63,8 +63,8 @@ public void test_is_before() throws ParseException {
@Test
@NeedReload
public void should_fail_because_value_is_after_or_equal_to() throws ParseException {
- Table table = new Table(jdbcConnectionProvider, "test");
- Changes changes = new Changes(table).setStartPointNow();
+ Table table = assertDbConnection.table("test").build();
+ Changes changes = assertDbConnection.changes().tables(table).build().setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
changes.setEndPointNow();
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnValueChronology_IsBefore_LocalDateTime_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnValueChronology_IsBefore_LocalDateTime_Test.java
index 032bcd4d..b51c2e34 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnValueChronology_IsBefore_LocalDateTime_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnValueChronology_IsBefore_LocalDateTime_Test.java
@@ -40,8 +40,8 @@ public class AssertOnValueChronology_IsBefore_LocalDateTime_Test extends Abstrac
@Test
@NeedReload
public void test_is_before() {
- Table table = new Table(jdbcConnectionProvider, "test");
- Changes changes = new Changes(table).setStartPointNow();
+ Table table = assertDbConnection.table("test").build();
+ Changes changes = assertDbConnection.changes().tables(table).build().setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
changes.setEndPointNow();
@@ -60,8 +60,8 @@ public void test_is_before() {
@Test
@NeedReload
public void should_fail_because_value_is_after_or_equal_to() {
- Table table = new Table(jdbcConnectionProvider, "test");
- Changes changes = new Changes(table).setStartPointNow();
+ Table table = assertDbConnection.table("test").build();
+ Changes changes = assertDbConnection.changes().tables(table).build().setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
changes.setEndPointNow();
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnValueChronology_IsBefore_LocalDate_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnValueChronology_IsBefore_LocalDate_Test.java
index 1a75cb7a..a19e3d80 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnValueChronology_IsBefore_LocalDate_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnValueChronology_IsBefore_LocalDate_Test.java
@@ -40,8 +40,8 @@ public class AssertOnValueChronology_IsBefore_LocalDate_Test extends AbstractTes
@Test
@NeedReload
public void test_is_before() {
- Table table = new Table(jdbcConnectionProvider, "test");
- Changes changes = new Changes(table).setStartPointNow();
+ Table table = assertDbConnection.table("test").build();
+ Changes changes = assertDbConnection.changes().tables(table).build().setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
changes.setEndPointNow();
@@ -60,8 +60,8 @@ public void test_is_before() {
@Test
@NeedReload
public void should_fail_because_value_is_after_or_equal_to() {
- Table table = new Table(jdbcConnectionProvider, "test");
- Changes changes = new Changes(table).setStartPointNow();
+ Table table = assertDbConnection.table("test").build();
+ Changes changes = assertDbConnection.changes().tables(table).build().setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
changes.setEndPointNow();
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnValueChronology_IsBefore_LocalTime_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnValueChronology_IsBefore_LocalTime_Test.java
index 97afce5c..23b3ddf1 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnValueChronology_IsBefore_LocalTime_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnValueChronology_IsBefore_LocalTime_Test.java
@@ -40,8 +40,8 @@ public class AssertOnValueChronology_IsBefore_LocalTime_Test extends AbstractTes
@Test
@NeedReload
public void test_is_before() {
- Table table = new Table(jdbcConnectionProvider, "test");
- Changes changes = new Changes(table).setStartPointNow();
+ Table table = assertDbConnection.table("test").build();
+ Changes changes = assertDbConnection.changes().tables(table).build().setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
changes.setEndPointNow();
@@ -60,8 +60,8 @@ public void test_is_before() {
@Test
@NeedReload
public void should_fail_because_value_is_after_or_equal_to() {
- Table table = new Table(jdbcConnectionProvider, "test");
- Changes changes = new Changes(table).setStartPointNow();
+ Table table = assertDbConnection.table("test").build();
+ Changes changes = assertDbConnection.changes().tables(table).build().setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
changes.setEndPointNow();
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnValueChronology_IsBefore_String_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnValueChronology_IsBefore_String_Test.java
index 56f1d69d..cc7a70e1 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnValueChronology_IsBefore_String_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnValueChronology_IsBefore_String_Test.java
@@ -39,8 +39,8 @@ public class AssertOnValueChronology_IsBefore_String_Test extends AbstractTest {
@Test
@NeedReload
public void test_is_before() {
- Table table = new Table(jdbcConnectionProvider, "test");
- Changes changes = new Changes(table).setStartPointNow();
+ Table table = assertDbConnection.table("test").build();
+ Changes changes = assertDbConnection.changes().tables(table).build().setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
changes.setEndPointNow();
@@ -59,8 +59,8 @@ public void test_is_before() {
@Test
@NeedReload
public void should_fail_because_value_is_after_or_equal_to() {
- Table table = new Table(jdbcConnectionProvider, "test");
- Changes changes = new Changes(table).setStartPointNow();
+ Table table = assertDbConnection.table("test").build();
+ Changes changes = assertDbConnection.changes().tables(table).build().setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
changes.setEndPointNow();
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnValueChronology_IsBefore_TimeValue_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnValueChronology_IsBefore_TimeValue_Test.java
index baa7f6b7..f7724b15 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnValueChronology_IsBefore_TimeValue_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnValueChronology_IsBefore_TimeValue_Test.java
@@ -42,8 +42,8 @@ public class AssertOnValueChronology_IsBefore_TimeValue_Test extends AbstractTes
@Test
@NeedReload
public void test_is_before() throws ParseException {
- Table table = new Table(jdbcConnectionProvider, "test");
- Changes changes = new Changes(table).setStartPointNow();
+ Table table = assertDbConnection.table("test").build();
+ Changes changes = assertDbConnection.changes().tables(table).build().setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
changes.setEndPointNow();
@@ -62,8 +62,8 @@ public void test_is_before() throws ParseException {
@Test
@NeedReload
public void should_fail_because_value_is_after_or_equal_to() throws ParseException {
- Table table = new Table(jdbcConnectionProvider, "test");
- Changes changes = new Changes(table).setStartPointNow();
+ Table table = assertDbConnection.table("test").build();
+ Changes changes = assertDbConnection.changes().tables(table).build().setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
changes.setEndPointNow();
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnValueClass_IsOfClass_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnValueClass_IsOfClass_Test.java
index aaa71923..67313b62 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnValueClass_IsOfClass_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnValueClass_IsOfClass_Test.java
@@ -39,8 +39,8 @@ public class AssertOnValueClass_IsOfClass_Test extends AbstractTest {
@Test
@NeedReload
public void test_is_of_type() {
- Table table = new Table(jdbcConnectionProvider, "test");
- Changes changes = new Changes(table).setStartPointNow();
+ Table table = assertDbConnection.table("test").build();
+ Changes changes = assertDbConnection.changes().tables(table).build().setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
changes.setEndPointNow();
@@ -59,8 +59,8 @@ public void test_is_of_type() {
@Test
@NeedReload
public void should_fail_because_value_is_not_of_type() {
- Table table = new Table(jdbcConnectionProvider, "test");
- Changes changes = new Changes(table).setStartPointNow();
+ Table table = assertDbConnection.table("test").build();
+ Changes changes = assertDbConnection.changes().tables(table).build().setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
changes.setEndPointNow();
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnValueCloseness_IsCloseTo_DateTimeValue_DateTimeValue_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnValueCloseness_IsCloseTo_DateTimeValue_DateTimeValue_Test.java
index 250d5b81..317b3c5c 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnValueCloseness_IsCloseTo_DateTimeValue_DateTimeValue_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnValueCloseness_IsCloseTo_DateTimeValue_DateTimeValue_Test.java
@@ -42,8 +42,8 @@ public class AssertOnValueCloseness_IsCloseTo_DateTimeValue_DateTimeValue_Test e
@Test
@NeedReload
public void test_is_close_to() {
- Table table = new Table(jdbcConnectionProvider, "test");
- Changes changes = new Changes(table).setStartPointNow();
+ Table table = assertDbConnection.table("test").build();
+ Changes changes = assertDbConnection.changes().tables(table).build().setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
changes.setEndPointNow();
@@ -65,8 +65,8 @@ public void test_is_close_to() {
@Test
@NeedReload
public void should_fail_because_value_is_not_close_to() {
- Table table = new Table(jdbcConnectionProvider, "test");
- Changes changes = new Changes(table).setStartPointNow();
+ Table table = assertDbConnection.table("test").build();
+ Changes changes = assertDbConnection.changes().tables(table).build().setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
changes.setEndPointNow();
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnValueCloseness_IsCloseTo_DateTimeValue_DateValue_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnValueCloseness_IsCloseTo_DateTimeValue_DateValue_Test.java
index bdba0fde..99126655 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnValueCloseness_IsCloseTo_DateTimeValue_DateValue_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnValueCloseness_IsCloseTo_DateTimeValue_DateValue_Test.java
@@ -42,8 +42,8 @@ public class AssertOnValueCloseness_IsCloseTo_DateTimeValue_DateValue_Test exten
@Test
@NeedReload
public void test_is_close_to() {
- Table table = new Table(jdbcConnectionProvider, "test");
- Changes changes = new Changes(table).setStartPointNow();
+ Table table = assertDbConnection.table("test").build();
+ Changes changes = assertDbConnection.changes().tables(table).build().setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
changes.setEndPointNow();
@@ -65,8 +65,8 @@ public void test_is_close_to() {
@Test
@NeedReload
public void should_fail_because_value_is_not_close_to() {
- Table table = new Table(jdbcConnectionProvider, "test");
- Changes changes = new Changes(table).setStartPointNow();
+ Table table = assertDbConnection.table("test").build();
+ Changes changes = assertDbConnection.changes().tables(table).build().setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
changes.setEndPointNow();
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnValueCloseness_IsCloseTo_DateTimeValue_TimeValue_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnValueCloseness_IsCloseTo_DateTimeValue_TimeValue_Test.java
index 1411a3a4..617ca5b5 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnValueCloseness_IsCloseTo_DateTimeValue_TimeValue_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnValueCloseness_IsCloseTo_DateTimeValue_TimeValue_Test.java
@@ -42,8 +42,8 @@ public class AssertOnValueCloseness_IsCloseTo_DateTimeValue_TimeValue_Test exten
@Test
@NeedReload
public void test_is_close_to() {
- Table table = new Table(jdbcConnectionProvider, "test");
- Changes changes = new Changes(table).setStartPointNow();
+ Table table = assertDbConnection.table("test").build();
+ Changes changes = assertDbConnection.changes().tables(table).build().setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
changes.setEndPointNow();
@@ -65,8 +65,8 @@ public void test_is_close_to() {
@Test
@NeedReload
public void should_fail_because_value_is_not_close_to() {
- Table table = new Table(jdbcConnectionProvider, "test");
- Changes changes = new Changes(table).setStartPointNow();
+ Table table = assertDbConnection.table("test").build();
+ Changes changes = assertDbConnection.changes().tables(table).build().setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
changes.setEndPointNow();
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnValueCloseness_IsCloseTo_DateValue_DateTimeValue_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnValueCloseness_IsCloseTo_DateValue_DateTimeValue_Test.java
index f3739bc4..295a5680 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnValueCloseness_IsCloseTo_DateValue_DateTimeValue_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnValueCloseness_IsCloseTo_DateValue_DateTimeValue_Test.java
@@ -41,8 +41,8 @@ public class AssertOnValueCloseness_IsCloseTo_DateValue_DateTimeValue_Test exten
@Test
@NeedReload
public void test_is_close_to() {
- Table table = new Table(jdbcConnectionProvider, "test");
- Changes changes = new Changes(table).setStartPointNow();
+ Table table = assertDbConnection.table("test").build();
+ Changes changes = assertDbConnection.changes().tables(table).build().setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
changes.setEndPointNow();
@@ -62,8 +62,8 @@ public void test_is_close_to() {
@Test
@NeedReload
public void should_fail_because_value_is_not_close_to() {
- Table table = new Table(jdbcConnectionProvider, "test");
- Changes changes = new Changes(table).setStartPointNow();
+ Table table = assertDbConnection.table("test").build();
+ Changes changes = assertDbConnection.changes().tables(table).build().setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
changes.setEndPointNow();
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnValueCloseness_IsCloseTo_DateValue_DateValue_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnValueCloseness_IsCloseTo_DateValue_DateValue_Test.java
index f8e1ece9..e6dad5e2 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnValueCloseness_IsCloseTo_DateValue_DateValue_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnValueCloseness_IsCloseTo_DateValue_DateValue_Test.java
@@ -40,8 +40,8 @@ public class AssertOnValueCloseness_IsCloseTo_DateValue_DateValue_Test extends A
@Test
@NeedReload
public void test_is_close_to() {
- Table table = new Table(jdbcConnectionProvider, "test");
- Changes changes = new Changes(table).setStartPointNow();
+ Table table = assertDbConnection.table("test").build();
+ Changes changes = assertDbConnection.changes().tables(table).build().setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
changes.setEndPointNow();
@@ -60,8 +60,8 @@ public void test_is_close_to() {
@Test
@NeedReload
public void should_fail_because_value_is_not_close_to() {
- Table table = new Table(jdbcConnectionProvider, "test");
- Changes changes = new Changes(table).setStartPointNow();
+ Table table = assertDbConnection.table("test").build();
+ Changes changes = assertDbConnection.changes().tables(table).build().setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
changes.setEndPointNow();
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnValueCloseness_IsCloseTo_DateValue_TimeValue_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnValueCloseness_IsCloseTo_DateValue_TimeValue_Test.java
index 044b71d5..80688be4 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnValueCloseness_IsCloseTo_DateValue_TimeValue_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnValueCloseness_IsCloseTo_DateValue_TimeValue_Test.java
@@ -41,8 +41,8 @@ public class AssertOnValueCloseness_IsCloseTo_DateValue_TimeValue_Test extends A
@Test
@NeedReload
public void test_is_close_to() {
- Table table = new Table(jdbcConnectionProvider, "test");
- Changes changes = new Changes(table).setStartPointNow();
+ Table table = assertDbConnection.table("test").build();
+ Changes changes = assertDbConnection.changes().tables(table).build().setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
changes.setEndPointNow();
@@ -61,8 +61,8 @@ public void test_is_close_to() {
@Test
@NeedReload
public void should_fail_because_value_is_not_close_to() {
- Table table = new Table(jdbcConnectionProvider, "test");
- Changes changes = new Changes(table).setStartPointNow();
+ Table table = assertDbConnection.table("test").build();
+ Changes changes = assertDbConnection.changes().tables(table).build().setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
changes.setEndPointNow();
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnValueCloseness_IsCloseTo_Number_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnValueCloseness_IsCloseTo_Number_Test.java
index 3e4de844..db0eb0d9 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnValueCloseness_IsCloseTo_Number_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnValueCloseness_IsCloseTo_Number_Test.java
@@ -39,8 +39,8 @@ public class AssertOnValueCloseness_IsCloseTo_Number_Test extends AbstractTest {
@Test
@NeedReload
public void test_is_close_to() {
- Table table = new Table(jdbcConnectionProvider, "test");
- Changes changes = new Changes(table).setStartPointNow();
+ Table table = assertDbConnection.table("test").build();
+ Changes changes = assertDbConnection.changes().tables(table).build().setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
changes.setEndPointNow();
@@ -59,8 +59,8 @@ public void test_is_close_to() {
@Test
@NeedReload
public void should_fail_because_value_is_not_close_to() {
- Table table = new Table(jdbcConnectionProvider, "test");
- Changes changes = new Changes(table).setStartPointNow();
+ Table table = assertDbConnection.table("test").build();
+ Changes changes = assertDbConnection.changes().tables(table).build().setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
changes.setEndPointNow();
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnValueCloseness_IsCloseTo_TimeValue_TimeValue_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnValueCloseness_IsCloseTo_TimeValue_TimeValue_Test.java
index 9b70bdbb..9e6c4089 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnValueCloseness_IsCloseTo_TimeValue_TimeValue_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnValueCloseness_IsCloseTo_TimeValue_TimeValue_Test.java
@@ -40,8 +40,8 @@ public class AssertOnValueCloseness_IsCloseTo_TimeValue_TimeValue_Test extends A
@Test
@NeedReload
public void test_is_close_to() {
- Table table = new Table(jdbcConnectionProvider, "test");
- Changes changes = new Changes(table).setStartPointNow();
+ Table table = assertDbConnection.table("test").build();
+ Changes changes = assertDbConnection.changes().tables(table).build().setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
changes.setEndPointNow();
@@ -60,8 +60,8 @@ public void test_is_close_to() {
@Test
@NeedReload
public void should_fail_because_value_is_not_close_to() {
- Table table = new Table(jdbcConnectionProvider, "test");
- Changes changes = new Changes(table).setStartPointNow();
+ Table table = assertDbConnection.table("test").build();
+ Changes changes = assertDbConnection.changes().tables(table).build().setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
changes.setEndPointNow();
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnValueComparison_IsGreaterThanOrEqualTo_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnValueComparison_IsGreaterThanOrEqualTo_Test.java
index a1e7612d..6bca3e68 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnValueComparison_IsGreaterThanOrEqualTo_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnValueComparison_IsGreaterThanOrEqualTo_Test.java
@@ -40,8 +40,8 @@ public class AssertOnValueComparison_IsGreaterThanOrEqualTo_Test extends Abstrac
@Test
@NeedReload
public void test_is_greater_than_or_equal_to() {
- Table table = new Table(jdbcConnectionProvider, "test");
- Changes changes = new Changes(table).setStartPointNow();
+ Table table = assertDbConnection.table("test").build();
+ Changes changes = assertDbConnection.changes().tables(table).build().setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
changes.setEndPointNow();
@@ -60,8 +60,8 @@ public void test_is_greater_than_or_equal_to() {
@Test
@NeedReload
public void should_fail_because_value_is_less_than() {
- Table table = new Table(jdbcConnectionProvider, "test");
- Changes changes = new Changes(table).setStartPointNow();
+ Table table = assertDbConnection.table("test").build();
+ Changes changes = assertDbConnection.changes().tables(table).build().setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
changes.setEndPointNow();
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnValueComparison_IsGreaterThan_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnValueComparison_IsGreaterThan_Test.java
index c76b1c67..a64aa1a5 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnValueComparison_IsGreaterThan_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnValueComparison_IsGreaterThan_Test.java
@@ -40,8 +40,8 @@ public class AssertOnValueComparison_IsGreaterThan_Test extends AbstractTest {
@Test
@NeedReload
public void test_is_less_than() {
- Table table = new Table(jdbcConnectionProvider, "test");
- Changes changes = new Changes(table).setStartPointNow();
+ Table table = assertDbConnection.table("test").build();
+ Changes changes = assertDbConnection.changes().tables(table).build().setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
changes.setEndPointNow();
@@ -60,8 +60,8 @@ public void test_is_less_than() {
@Test
@NeedReload
public void should_fail_because_value_is_greater_than_or_equal_to() {
- Table table = new Table(jdbcConnectionProvider, "test");
- Changes changes = new Changes(table).setStartPointNow();
+ Table table = assertDbConnection.table("test").build();
+ Changes changes = assertDbConnection.changes().tables(table).build().setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
changes.setEndPointNow();
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnValueComparison_IsLessThanOrEqualTo_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnValueComparison_IsLessThanOrEqualTo_Test.java
index ddd01fda..fabdb461 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnValueComparison_IsLessThanOrEqualTo_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnValueComparison_IsLessThanOrEqualTo_Test.java
@@ -40,8 +40,8 @@ public class AssertOnValueComparison_IsLessThanOrEqualTo_Test extends AbstractTe
@Test
@NeedReload
public void test_is_less_than_or_equal_to() {
- Table table = new Table(jdbcConnectionProvider, "test");
- Changes changes = new Changes(table).setStartPointNow();
+ Table table = assertDbConnection.table("test").build();
+ Changes changes = assertDbConnection.changes().tables(table).build().setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
changes.setEndPointNow();
@@ -60,8 +60,8 @@ public void test_is_less_than_or_equal_to() {
@Test
@NeedReload
public void should_fail_because_value_is_greater_than() {
- Table table = new Table(jdbcConnectionProvider, "test");
- Changes changes = new Changes(table).setStartPointNow();
+ Table table = assertDbConnection.table("test").build();
+ Changes changes = assertDbConnection.changes().tables(table).build().setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
changes.setEndPointNow();
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnValueComparison_IsLessThan_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnValueComparison_IsLessThan_Test.java
index 24e58102..05af8128 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnValueComparison_IsLessThan_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnValueComparison_IsLessThan_Test.java
@@ -40,8 +40,8 @@ public class AssertOnValueComparison_IsLessThan_Test extends AbstractTest {
@Test
@NeedReload
public void test_is_less_than() {
- Table table = new Table(jdbcConnectionProvider, "test");
- Changes changes = new Changes(table).setStartPointNow();
+ Table table = assertDbConnection.table("test").build();
+ Changes changes = assertDbConnection.changes().tables(table).build().setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
changes.setEndPointNow();
@@ -60,8 +60,8 @@ public void test_is_less_than() {
@Test
@NeedReload
public void should_fail_because_value_is_greater_than_or_equal_to() {
- Table table = new Table(jdbcConnectionProvider, "test");
- Changes changes = new Changes(table).setStartPointNow();
+ Table table = assertDbConnection.table("test").build();
+ Changes changes = assertDbConnection.changes().tables(table).build().setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
changes.setEndPointNow();
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnValueCondition_DoesNotHave_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnValueCondition_DoesNotHave_Test.java
index 44b8b430..c39fcfaa 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnValueCondition_DoesNotHave_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnValueCondition_DoesNotHave_Test.java
@@ -46,8 +46,8 @@ public boolean matches(Byte value) {
@Test
@NeedReload
public void test_does_not_have() {
- Table table = new Table(jdbcConnectionProvider, "test");
- Changes changes = new Changes(table).setStartPointNow();
+ Table table = assertDbConnection.table("test").build();
+ Changes changes = assertDbConnection.changes().tables(table).build().setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
changes.setEndPointNow();
@@ -66,8 +66,8 @@ public void test_does_not_have() {
@Test
@NeedReload
public void should_fail_because_value_not_match_with_condition() {
- Table table = new Table(jdbcConnectionProvider, "test");
- Changes changes = new Changes(table).setStartPointNow();
+ Table table = assertDbConnection.table("test").build();
+ Changes changes = assertDbConnection.changes().tables(table).build().setStartPointNow();
update("update test set var14 = 1 where var1 = 1000");
changes.setEndPointNow();
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnValueCondition_Has_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnValueCondition_Has_Test.java
index 7c2acfba..e6fe6224 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnValueCondition_Has_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnValueCondition_Has_Test.java
@@ -46,8 +46,8 @@ public boolean matches(Byte value) {
@Test
@NeedReload
public void test_has() {
- Table table = new Table(jdbcConnectionProvider, "test");
- Changes changes = new Changes(table).setStartPointNow();
+ Table table = assertDbConnection.table("test").build();
+ Changes changes = assertDbConnection.changes().tables(table).build().setStartPointNow();
update("update test set var14 = 1 where var1 = 1000");
changes.setEndPointNow();
@@ -66,8 +66,8 @@ public void test_has() {
@Test
@NeedReload
public void should_fail_because_value_not_match_with_condition() {
- Table table = new Table(jdbcConnectionProvider, "test");
- Changes changes = new Changes(table).setStartPointNow();
+ Table table = assertDbConnection.table("test").build();
+ Changes changes = assertDbConnection.changes().tables(table).build().setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
changes.setEndPointNow();
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnValueCondition_IsNot_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnValueCondition_IsNot_Test.java
index b9951e6b..3d822ce6 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnValueCondition_IsNot_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnValueCondition_IsNot_Test.java
@@ -46,8 +46,8 @@ public boolean matches(Byte value) {
@Test
@NeedReload
public void test_is_not() {
- Table table = new Table(jdbcConnectionProvider, "test");
- Changes changes = new Changes(table).setStartPointNow();
+ Table table = assertDbConnection.table("test").build();
+ Changes changes = assertDbConnection.changes().tables(table).build().setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
changes.setEndPointNow();
@@ -66,8 +66,8 @@ public void test_is_not() {
@Test
@NeedReload
public void should_fail_because_value_not_match_with_condition() {
- Table table = new Table(jdbcConnectionProvider, "test");
- Changes changes = new Changes(table).setStartPointNow();
+ Table table = assertDbConnection.table("test").build();
+ Changes changes = assertDbConnection.changes().tables(table).build().setStartPointNow();
update("update test set var14 = 1 where var1 = 1000");
changes.setEndPointNow();
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnValueCondition_Is_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnValueCondition_Is_Test.java
index 77722515..84c0c137 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnValueCondition_Is_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnValueCondition_Is_Test.java
@@ -46,8 +46,8 @@ public boolean matches(Byte value) {
@Test
@NeedReload
public void test_is() {
- Table table = new Table(jdbcConnectionProvider, "test");
- Changes changes = new Changes(table).setStartPointNow();
+ Table table = assertDbConnection.table("test").build();
+ Changes changes = assertDbConnection.changes().tables(table).build().setStartPointNow();
update("update test set var14 = 1 where var1 = 1000");
changes.setEndPointNow();
@@ -66,8 +66,8 @@ public void test_is() {
@Test
@NeedReload
public void should_fail_because_value_not_match_with_condition() {
- Table table = new Table(jdbcConnectionProvider, "test");
- Changes changes = new Changes(table).setStartPointNow();
+ Table table = assertDbConnection.table("test").build();
+ Changes changes = assertDbConnection.changes().tables(table).build().setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
changes.setEndPointNow();
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnValueCondition_Satisfies_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnValueCondition_Satisfies_Test.java
index ddc1eab8..dce376f1 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnValueCondition_Satisfies_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnValueCondition_Satisfies_Test.java
@@ -46,8 +46,8 @@ public boolean matches(Byte value) {
@Test
@NeedReload
public void test_satisfies() {
- Table table = new Table(jdbcConnectionProvider, "test");
- Changes changes = new Changes(table).setStartPointNow();
+ Table table = assertDbConnection.table("test").build();
+ Changes changes = assertDbConnection.changes().tables(table).build().setStartPointNow();
update("update test set var14 = 1 where var1 = 1000");
changes.setEndPointNow();
@@ -66,8 +66,8 @@ public void test_satisfies() {
@Test
@NeedReload
public void should_fail_because_value_not_match_with_condition() {
- Table table = new Table(jdbcConnectionProvider, "test");
- Changes changes = new Changes(table).setStartPointNow();
+ Table table = assertDbConnection.table("test").build();
+ Changes changes = assertDbConnection.changes().tables(table).build().setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
changes.setEndPointNow();
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnValueEquality_IsEqualTo_Boolean_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnValueEquality_IsEqualTo_Boolean_Test.java
index 576fa572..3df11177 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnValueEquality_IsEqualTo_Boolean_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnValueEquality_IsEqualTo_Boolean_Test.java
@@ -39,8 +39,8 @@ public class AssertOnValueEquality_IsEqualTo_Boolean_Test extends AbstractTest {
@Test
@NeedReload
public void test_is_equal_to() {
- Table table = new Table(jdbcConnectionProvider, "test");
- Changes changes = new Changes(table).setStartPointNow();
+ Table table = assertDbConnection.table("test").build();
+ Changes changes = assertDbConnection.changes().tables(table).build().setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
changes.setEndPointNow();
@@ -59,8 +59,8 @@ public void test_is_equal_to() {
@Test
@NeedReload
public void should_fail_because_value_is_not_equal_to() {
- Table table = new Table(jdbcConnectionProvider, "test");
- Changes changes = new Changes(table).setStartPointNow();
+ Table table = assertDbConnection.table("test").build();
+ Changes changes = assertDbConnection.changes().tables(table).build().setStartPointNow();
update("update test set var14 = 1 where var1 = 10");
changes.setEndPointNow();
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnValueEquality_IsEqualTo_Bytes_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnValueEquality_IsEqualTo_Bytes_Test.java
index 3c862cdd..1c6d06cd 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnValueEquality_IsEqualTo_Bytes_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnValueEquality_IsEqualTo_Bytes_Test.java
@@ -42,8 +42,8 @@ public class AssertOnValueEquality_IsEqualTo_Bytes_Test extends AbstractTest {
public void test_is_equal_to() {
byte[] bytesH2 = bytesContentFromClassPathOf("h2-logo-2.png");
- Table table = new Table(jdbcConnectionProvider, "test");
- Changes changes = new Changes(table).setStartPointNow();
+ Table table = assertDbConnection.table("test").build();
+ Changes changes = assertDbConnection.changes().tables(table).build().setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
changes.setEndPointNow();
@@ -62,8 +62,8 @@ public void test_is_equal_to() {
@Test
@NeedReload
public void should_fail_because_value_is_not_equal_to() {
- Table table = new Table(jdbcConnectionProvider, "test");
- Changes changes = new Changes(table).setStartPointNow();
+ Table table = assertDbConnection.table("test").build();
+ Changes changes = assertDbConnection.changes().tables(table).build().setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
changes.setEndPointNow();
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnValueEquality_IsEqualTo_Character_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnValueEquality_IsEqualTo_Character_Test.java
index 6ab020ff..0442cd3c 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnValueEquality_IsEqualTo_Character_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnValueEquality_IsEqualTo_Character_Test.java
@@ -39,8 +39,8 @@ public class AssertOnValueEquality_IsEqualTo_Character_Test extends AbstractTest
@Test
@NeedReload
public void test_is_equal_to() {
- Table table = new Table(jdbcConnectionProvider, "test");
- Changes changes = new Changes(table).setStartPointNow();
+ Table table = assertDbConnection.table("test").build();
+ Changes changes = assertDbConnection.changes().tables(table).build().setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
changes.setEndPointNow();
@@ -59,8 +59,8 @@ public void test_is_equal_to() {
@Test
@NeedReload
public void should_fail_because_value_is_not_equal_to() {
- Table table = new Table(jdbcConnectionProvider, "test");
- Changes changes = new Changes(table).setStartPointNow();
+ Table table = assertDbConnection.table("test").build();
+ Changes changes = assertDbConnection.changes().tables(table).build().setStartPointNow();
update("update test set var14 = 1 where var1 = 10");
changes.setEndPointNow();
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnValueEquality_IsEqualTo_DateTimeValue_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnValueEquality_IsEqualTo_DateTimeValue_Test.java
index e2fd68ff..5b8f17b0 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnValueEquality_IsEqualTo_DateTimeValue_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnValueEquality_IsEqualTo_DateTimeValue_Test.java
@@ -42,8 +42,8 @@ public class AssertOnValueEquality_IsEqualTo_DateTimeValue_Test extends Abstract
@Test
@NeedReload
public void test_is_equal_to() {
- Table table = new Table(jdbcConnectionProvider, "test");
- Changes changes = new Changes(table).setStartPointNow();
+ Table table = assertDbConnection.table("test").build();
+ Changes changes = assertDbConnection.changes().tables(table).build().setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
changes.setEndPointNow();
@@ -63,8 +63,8 @@ public void test_is_equal_to() {
@Test
@NeedReload
public void should_fail_because_value_is_not_equal_to() {
- Table table = new Table(jdbcConnectionProvider, "test");
- Changes changes = new Changes(table).setStartPointNow();
+ Table table = assertDbConnection.table("test").build();
+ Changes changes = assertDbConnection.changes().tables(table).build().setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
changes.setEndPointNow();
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnValueEquality_IsEqualTo_DateValue_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnValueEquality_IsEqualTo_DateValue_Test.java
index 7d0b9c2d..4352dfb9 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnValueEquality_IsEqualTo_DateValue_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnValueEquality_IsEqualTo_DateValue_Test.java
@@ -40,8 +40,8 @@ public class AssertOnValueEquality_IsEqualTo_DateValue_Test extends AbstractTest
@Test
@NeedReload
public void test_is_equal_to() {
- Table table = new Table(jdbcConnectionProvider, "test");
- Changes changes = new Changes(table).setStartPointNow();
+ Table table = assertDbConnection.table("test").build();
+ Changes changes = assertDbConnection.changes().tables(table).build().setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
changes.setEndPointNow();
@@ -60,8 +60,8 @@ public void test_is_equal_to() {
@Test
@NeedReload
public void should_fail_because_value_is_not_equal_to() {
- Table table = new Table(jdbcConnectionProvider, "test");
- Changes changes = new Changes(table).setStartPointNow();
+ Table table = assertDbConnection.table("test").build();
+ Changes changes = assertDbConnection.changes().tables(table).build().setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
changes.setEndPointNow();
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnValueEquality_IsEqualTo_LocalDateTime_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnValueEquality_IsEqualTo_LocalDateTime_Test.java
index a5564720..837ff48b 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnValueEquality_IsEqualTo_LocalDateTime_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnValueEquality_IsEqualTo_LocalDateTime_Test.java
@@ -40,8 +40,8 @@ public class AssertOnValueEquality_IsEqualTo_LocalDateTime_Test extends Abstract
@Test
@NeedReload
public void test_is_equal_to() {
- Table table = new Table(jdbcConnectionProvider, "test");
- Changes changes = new Changes(table).setStartPointNow();
+ Table table = assertDbConnection.table("test").build();
+ Changes changes = assertDbConnection.changes().tables(table).build().setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
changes.setEndPointNow();
@@ -60,8 +60,8 @@ public void test_is_equal_to() {
@Test
@NeedReload
public void should_fail_because_value_is_not_equal_to() {
- Table table = new Table(jdbcConnectionProvider, "test");
- Changes changes = new Changes(table).setStartPointNow();
+ Table table = assertDbConnection.table("test").build();
+ Changes changes = assertDbConnection.changes().tables(table).build().setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
changes.setEndPointNow();
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnValueEquality_IsEqualTo_LocalDate_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnValueEquality_IsEqualTo_LocalDate_Test.java
index cd2692b4..d9533b11 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnValueEquality_IsEqualTo_LocalDate_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnValueEquality_IsEqualTo_LocalDate_Test.java
@@ -40,8 +40,8 @@ public class AssertOnValueEquality_IsEqualTo_LocalDate_Test extends AbstractTest
@Test
@NeedReload
public void test_is_equal_to() {
- Table table = new Table(jdbcConnectionProvider, "test");
- Changes changes = new Changes(table).setStartPointNow();
+ Table table = assertDbConnection.table("test").build();
+ Changes changes = assertDbConnection.changes().tables(table).build().setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
changes.setEndPointNow();
@@ -60,8 +60,8 @@ public void test_is_equal_to() {
@Test
@NeedReload
public void should_fail_because_value_is_not_equal_to() {
- Table table = new Table(jdbcConnectionProvider, "test");
- Changes changes = new Changes(table).setStartPointNow();
+ Table table = assertDbConnection.table("test").build();
+ Changes changes = assertDbConnection.changes().tables(table).build().setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
changes.setEndPointNow();
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnValueEquality_IsEqualTo_LocalTime_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnValueEquality_IsEqualTo_LocalTime_Test.java
index 916bf203..3b86fbf0 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnValueEquality_IsEqualTo_LocalTime_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnValueEquality_IsEqualTo_LocalTime_Test.java
@@ -40,8 +40,8 @@ public class AssertOnValueEquality_IsEqualTo_LocalTime_Test extends AbstractTest
@Test
@NeedReload
public void test_is_equal_to() {
- Table table = new Table(jdbcConnectionProvider, "test");
- Changes changes = new Changes(table).setStartPointNow();
+ Table table = assertDbConnection.table("test").build();
+ Changes changes = assertDbConnection.changes().tables(table).build().setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
changes.setEndPointNow();
@@ -60,8 +60,8 @@ public void test_is_equal_to() {
@Test
@NeedReload
public void should_fail_because_value_is_not_equal_to() {
- Table table = new Table(jdbcConnectionProvider, "test");
- Changes changes = new Changes(table).setStartPointNow();
+ Table table = assertDbConnection.table("test").build();
+ Changes changes = assertDbConnection.changes().tables(table).build().setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
changes.setEndPointNow();
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnValueEquality_IsEqualTo_Number_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnValueEquality_IsEqualTo_Number_Test.java
index 81bf99ee..d3331a51 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnValueEquality_IsEqualTo_Number_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnValueEquality_IsEqualTo_Number_Test.java
@@ -39,8 +39,8 @@ public class AssertOnValueEquality_IsEqualTo_Number_Test extends AbstractTest {
@Test
@NeedReload
public void test_is_equal_to() {
- Table table = new Table(jdbcConnectionProvider, "test");
- Changes changes = new Changes(table).setStartPointNow();
+ Table table = assertDbConnection.table("test").build();
+ Changes changes = assertDbConnection.changes().tables(table).build().setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
changes.setEndPointNow();
@@ -59,8 +59,8 @@ public void test_is_equal_to() {
@Test
@NeedReload
public void should_fail_because_value_is_not_equal_to() {
- Table table = new Table(jdbcConnectionProvider, "test");
- Changes changes = new Changes(table).setStartPointNow();
+ Table table = assertDbConnection.table("test").build();
+ Changes changes = assertDbConnection.changes().tables(table).build().setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
changes.setEndPointNow();
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnValueEquality_IsEqualTo_Object_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnValueEquality_IsEqualTo_Object_Test.java
index 990d4d49..6a3ae767 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnValueEquality_IsEqualTo_Object_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnValueEquality_IsEqualTo_Object_Test.java
@@ -39,8 +39,8 @@ public class AssertOnValueEquality_IsEqualTo_Object_Test extends AbstractTest {
@Test
@NeedReload
public void test_is_null() {
- Table table = new Table(jdbcConnectionProvider, "test2");
- Changes changes = new Changes(table).setStartPointNow();
+ Table table = assertDbConnection.table("test2").build();
+ Changes changes = assertDbConnection.changes().tables(table).build().setStartPointNow();
update("update test2 set var14 = 1 where var1 is null");
changes.setEndPointNow();
@@ -59,8 +59,8 @@ public void test_is_null() {
@Test
@NeedReload
public void should_fail_because_value_is_not_null() {
- Table table = new Table(jdbcConnectionProvider, "test");
- Changes changes = new Changes(table).setStartPointNow();
+ Table table = assertDbConnection.table("test").build();
+ Changes changes = assertDbConnection.changes().tables(table).build().setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
changes.setEndPointNow();
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnValueEquality_IsEqualTo_String_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnValueEquality_IsEqualTo_String_Test.java
index f1aae8a9..53f8afb1 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnValueEquality_IsEqualTo_String_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnValueEquality_IsEqualTo_String_Test.java
@@ -39,8 +39,8 @@ public class AssertOnValueEquality_IsEqualTo_String_Test extends AbstractTest {
@Test
@NeedReload
public void test_is_equal_to() {
- Table table = new Table(jdbcConnectionProvider, "test");
- Changes changes = new Changes(table).setStartPointNow();
+ Table table = assertDbConnection.table("test").build();
+ Changes changes = assertDbConnection.changes().tables(table).build().setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
changes.setEndPointNow();
@@ -59,8 +59,8 @@ public void test_is_equal_to() {
@Test
@NeedReload
public void should_fail_because_value_is_not_equal_to() {
- Table table = new Table(jdbcConnectionProvider, "test");
- Changes changes = new Changes(table).setStartPointNow();
+ Table table = assertDbConnection.table("test").build();
+ Changes changes = assertDbConnection.changes().tables(table).build().setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
changes.setEndPointNow();
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnValueEquality_IsEqualTo_TimeValue_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnValueEquality_IsEqualTo_TimeValue_Test.java
index 12f5e628..39d02a14 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnValueEquality_IsEqualTo_TimeValue_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnValueEquality_IsEqualTo_TimeValue_Test.java
@@ -40,8 +40,8 @@ public class AssertOnValueEquality_IsEqualTo_TimeValue_Test extends AbstractTest
@Test
@NeedReload
public void test_is_equal_to() {
- Table table = new Table(jdbcConnectionProvider, "test");
- Changes changes = new Changes(table).setStartPointNow();
+ Table table = assertDbConnection.table("test").build();
+ Changes changes = assertDbConnection.changes().tables(table).build().setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
changes.setEndPointNow();
@@ -60,8 +60,8 @@ public void test_is_equal_to() {
@Test
@NeedReload
public void should_fail_because_value_is_not_equal_to() {
- Table table = new Table(jdbcConnectionProvider, "test");
- Changes changes = new Changes(table).setStartPointNow();
+ Table table = assertDbConnection.table("test").build();
+ Changes changes = assertDbConnection.changes().tables(table).build().setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
changes.setEndPointNow();
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnValueEquality_IsEqualTo_UUID_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnValueEquality_IsEqualTo_UUID_Test.java
index f8d676f1..40fd56fa 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnValueEquality_IsEqualTo_UUID_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnValueEquality_IsEqualTo_UUID_Test.java
@@ -40,8 +40,8 @@ public class AssertOnValueEquality_IsEqualTo_UUID_Test extends AbstractTest {
@Test
@NeedReload
public void test_is_equal_to() {
- Table table = new Table(jdbcConnectionProvider, "test");
- Changes changes = new Changes(table).setStartPointNow();
+ Table table = assertDbConnection.table("test").build();
+ Changes changes = assertDbConnection.changes().tables(table).build().setStartPointNow();
update("update test set var15 = '2B0D1BDD-909E-4362-BA10-C930BA82718D' where var1 = 1");
changes.setEndPointNow();
@@ -62,8 +62,8 @@ public void test_is_equal_to() {
@Test
@NeedReload
public void should_fail_because_value_is_not_equal_to() {
- Table table = new Table(jdbcConnectionProvider, "test");
- Changes changes = new Changes(table).setStartPointNow();
+ Table table = assertDbConnection.table("test").build();
+ Changes changes = assertDbConnection.changes().tables(table).build().setStartPointNow();
update("update test set var15 = '2B0D1BDD-909E-4362-BA10-C930BA82718D' where var1 = 10");
changes.setEndPointNow();
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnValueEquality_IsFalse_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnValueEquality_IsFalse_Test.java
index bbe14623..a000d4b3 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnValueEquality_IsFalse_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnValueEquality_IsFalse_Test.java
@@ -39,8 +39,8 @@ public class AssertOnValueEquality_IsFalse_Test extends AbstractTest {
@Test
@NeedReload
public void test_is_false() {
- Table table = new Table(jdbcConnectionProvider, "test");
- Changes changes = new Changes(table).setStartPointNow();
+ Table table = assertDbConnection.table("test").build();
+ Changes changes = assertDbConnection.changes().tables(table).build().setStartPointNow();
update("update test set var14 = 1 where var1 = 10");
changes.setEndPointNow();
@@ -59,8 +59,8 @@ public void test_is_false() {
@Test
@NeedReload
public void should_fail_because_value_is_true() {
- Table table = new Table(jdbcConnectionProvider, "test");
- Changes changes = new Changes(table).setStartPointNow();
+ Table table = assertDbConnection.table("test").build();
+ Changes changes = assertDbConnection.changes().tables(table).build().setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
changes.setEndPointNow();
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnValueEquality_IsTrue_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnValueEquality_IsTrue_Test.java
index 003f7dd0..fd23a89c 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnValueEquality_IsTrue_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnValueEquality_IsTrue_Test.java
@@ -39,8 +39,8 @@ public class AssertOnValueEquality_IsTrue_Test extends AbstractTest {
@Test
@NeedReload
public void test_is_true() {
- Table table = new Table(jdbcConnectionProvider, "test");
- Changes changes = new Changes(table).setStartPointNow();
+ Table table = assertDbConnection.table("test").build();
+ Changes changes = assertDbConnection.changes().tables(table).build().setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
changes.setEndPointNow();
@@ -59,8 +59,8 @@ public void test_is_true() {
@Test
@NeedReload
public void should_fail_because_value_is_false() {
- Table table = new Table(jdbcConnectionProvider, "test");
- Changes changes = new Changes(table).setStartPointNow();
+ Table table = assertDbConnection.table("test").build();
+ Changes changes = assertDbConnection.changes().tables(table).build().setStartPointNow();
update("update test set var14 = 1 where var1 = 10");
changes.setEndPointNow();
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnValueEquality_IsZero_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnValueEquality_IsZero_Test.java
index 0a59d8b9..42e956b4 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnValueEquality_IsZero_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnValueEquality_IsZero_Test.java
@@ -39,8 +39,8 @@ public class AssertOnValueEquality_IsZero_Test extends AbstractTest {
@Test
@NeedReload
public void test_is_zero() {
- Table table = new Table(jdbcConnectionProvider, "test");
- Changes changes = new Changes(table).setStartPointNow();
+ Table table = assertDbConnection.table("test").build();
+ Changes changes = assertDbConnection.changes().tables(table).build().setStartPointNow();
update("update test set var14 = 1 where var1 = 1000");
changes.setEndPointNow();
@@ -59,8 +59,8 @@ public void test_is_zero() {
@Test
@NeedReload
public void should_fail_because_value_is_not_zero() {
- Table table = new Table(jdbcConnectionProvider, "test");
- Changes changes = new Changes(table).setStartPointNow();
+ Table table = assertDbConnection.table("test").build();
+ Changes changes = assertDbConnection.changes().tables(table).build().setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
changes.setEndPointNow();
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnValueInequality_IsNotEqualTo_Boolean_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnValueInequality_IsNotEqualTo_Boolean_Test.java
index 9dcb4cf5..7c2e23d6 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnValueInequality_IsNotEqualTo_Boolean_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnValueInequality_IsNotEqualTo_Boolean_Test.java
@@ -39,8 +39,8 @@ public class AssertOnValueInequality_IsNotEqualTo_Boolean_Test extends AbstractT
@Test
@NeedReload
public void test_is_not_equal_to() {
- Table table = new Table(jdbcConnectionProvider, "test");
- Changes changes = new Changes(table).setStartPointNow();
+ Table table = assertDbConnection.table("test").build();
+ Changes changes = assertDbConnection.changes().tables(table).build().setStartPointNow();
update("update test set var14 = 1 where var1 = 10");
changes.setEndPointNow();
@@ -59,8 +59,8 @@ public void test_is_not_equal_to() {
@Test
@NeedReload
public void should_fail_because_value_is_equal_to() {
- Table table = new Table(jdbcConnectionProvider, "test");
- Changes changes = new Changes(table).setStartPointNow();
+ Table table = assertDbConnection.table("test").build();
+ Changes changes = assertDbConnection.changes().tables(table).build().setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
changes.setEndPointNow();
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnValueInequality_IsNotEqualTo_Bytes_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnValueInequality_IsNotEqualTo_Bytes_Test.java
index 779fe075..7035f24f 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnValueInequality_IsNotEqualTo_Bytes_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnValueInequality_IsNotEqualTo_Bytes_Test.java
@@ -40,8 +40,8 @@ public class AssertOnValueInequality_IsNotEqualTo_Bytes_Test extends AbstractTes
@Test
@NeedReload
public void test_is_not_equal_to() {
- Table table = new Table(jdbcConnectionProvider, "test");
- Changes changes = new Changes(table).setStartPointNow();
+ Table table = assertDbConnection.table("test").build();
+ Changes changes = assertDbConnection.changes().tables(table).build().setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
changes.setEndPointNow();
@@ -62,8 +62,8 @@ public void test_is_not_equal_to() {
public void should_fail_because_value_is_equal_to() {
byte[] bytesH2 = bytesContentFromClassPathOf("h2-logo-2.png");
- Table table = new Table(jdbcConnectionProvider, "test");
- Changes changes = new Changes(table).setStartPointNow();
+ Table table = assertDbConnection.table("test").build();
+ Changes changes = assertDbConnection.changes().tables(table).build().setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
changes.setEndPointNow();
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnValueInequality_IsNotEqualTo_Character_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnValueInequality_IsNotEqualTo_Character_Test.java
index 348ef178..f364e742 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnValueInequality_IsNotEqualTo_Character_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnValueInequality_IsNotEqualTo_Character_Test.java
@@ -39,8 +39,8 @@ public class AssertOnValueInequality_IsNotEqualTo_Character_Test extends Abstrac
@Test
@NeedReload
public void test_is_not_equal_to() {
- Table table = new Table(jdbcConnectionProvider, "test");
- Changes changes = new Changes(table).setStartPointNow();
+ Table table = assertDbConnection.table("test").build();
+ Changes changes = assertDbConnection.changes().tables(table).build().setStartPointNow();
update("update test set var14 = 1 where var1 = 10");
changes.setEndPointNow();
@@ -59,8 +59,8 @@ public void test_is_not_equal_to() {
@Test
@NeedReload
public void should_fail_because_value_is_equal_to() {
- Table table = new Table(jdbcConnectionProvider, "test");
- Changes changes = new Changes(table).setStartPointNow();
+ Table table = assertDbConnection.table("test").build();
+ Changes changes = assertDbConnection.changes().tables(table).build().setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
changes.setEndPointNow();
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnValueInequality_IsNotEqualTo_DateTimeValue_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnValueInequality_IsNotEqualTo_DateTimeValue_Test.java
index 79d4204e..3c05d0bc 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnValueInequality_IsNotEqualTo_DateTimeValue_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnValueInequality_IsNotEqualTo_DateTimeValue_Test.java
@@ -42,8 +42,8 @@ public class AssertOnValueInequality_IsNotEqualTo_DateTimeValue_Test extends Abs
@Test
@NeedReload
public void test_is_not_equal_to() {
- Table table = new Table(jdbcConnectionProvider, "test");
- Changes changes = new Changes(table).setStartPointNow();
+ Table table = assertDbConnection.table("test").build();
+ Changes changes = assertDbConnection.changes().tables(table).build().setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
changes.setEndPointNow();
@@ -64,8 +64,8 @@ public void test_is_not_equal_to() {
@Test
@NeedReload
public void should_fail_because_value_is_equal_to() {
- Table table = new Table(jdbcConnectionProvider, "test");
- Changes changes = new Changes(table).setStartPointNow();
+ Table table = assertDbConnection.table("test").build();
+ Changes changes = assertDbConnection.changes().tables(table).build().setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
changes.setEndPointNow();
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnValueInequality_IsNotEqualTo_DateValue_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnValueInequality_IsNotEqualTo_DateValue_Test.java
index 897957ee..cc6ef554 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnValueInequality_IsNotEqualTo_DateValue_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnValueInequality_IsNotEqualTo_DateValue_Test.java
@@ -40,8 +40,8 @@ public class AssertOnValueInequality_IsNotEqualTo_DateValue_Test extends Abstrac
@Test
@NeedReload
public void test_is_not_equal_to() {
- Table table = new Table(jdbcConnectionProvider, "test");
- Changes changes = new Changes(table).setStartPointNow();
+ Table table = assertDbConnection.table("test").build();
+ Changes changes = assertDbConnection.changes().tables(table).build().setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
changes.setEndPointNow();
@@ -60,8 +60,8 @@ public void test_is_not_equal_to() {
@Test
@NeedReload
public void should_fail_because_value_is_equal_to() {
- Table table = new Table(jdbcConnectionProvider, "test");
- Changes changes = new Changes(table).setStartPointNow();
+ Table table = assertDbConnection.table("test").build();
+ Changes changes = assertDbConnection.changes().tables(table).build().setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
changes.setEndPointNow();
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnValueInequality_IsNotEqualTo_LocalDateTime_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnValueInequality_IsNotEqualTo_LocalDateTime_Test.java
index 2f5be9d5..916d2549 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnValueInequality_IsNotEqualTo_LocalDateTime_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnValueInequality_IsNotEqualTo_LocalDateTime_Test.java
@@ -40,8 +40,8 @@ public class AssertOnValueInequality_IsNotEqualTo_LocalDateTime_Test extends Abs
@Test
@NeedReload
public void test_is_not_equal_to() {
- Table table = new Table(jdbcConnectionProvider, "test");
- Changes changes = new Changes(table).setStartPointNow();
+ Table table = assertDbConnection.table("test").build();
+ Changes changes = assertDbConnection.changes().tables(table).build().setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
changes.setEndPointNow();
@@ -60,8 +60,8 @@ public void test_is_not_equal_to() {
@Test
@NeedReload
public void should_fail_because_value_is_equal_to() {
- Table table = new Table(jdbcConnectionProvider, "test");
- Changes changes = new Changes(table).setStartPointNow();
+ Table table = assertDbConnection.table("test").build();
+ Changes changes = assertDbConnection.changes().tables(table).build().setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
changes.setEndPointNow();
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnValueInequality_IsNotEqualTo_LocalDate_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnValueInequality_IsNotEqualTo_LocalDate_Test.java
index 75c85962..2be92f57 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnValueInequality_IsNotEqualTo_LocalDate_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnValueInequality_IsNotEqualTo_LocalDate_Test.java
@@ -40,8 +40,8 @@ public class AssertOnValueInequality_IsNotEqualTo_LocalDate_Test extends Abstrac
@Test
@NeedReload
public void test_is_not_equal_to() {
- Table table = new Table(jdbcConnectionProvider, "test");
- Changes changes = new Changes(table).setStartPointNow();
+ Table table = assertDbConnection.table("test").build();
+ Changes changes = assertDbConnection.changes().tables(table).build().setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
changes.setEndPointNow();
@@ -60,8 +60,8 @@ public void test_is_not_equal_to() {
@Test
@NeedReload
public void should_fail_because_value_is_equal_to() {
- Table table = new Table(jdbcConnectionProvider, "test");
- Changes changes = new Changes(table).setStartPointNow();
+ Table table = assertDbConnection.table("test").build();
+ Changes changes = assertDbConnection.changes().tables(table).build().setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
changes.setEndPointNow();
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnValueInequality_IsNotEqualTo_LocalTime_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnValueInequality_IsNotEqualTo_LocalTime_Test.java
index 6612d846..71117a46 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnValueInequality_IsNotEqualTo_LocalTime_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnValueInequality_IsNotEqualTo_LocalTime_Test.java
@@ -40,8 +40,8 @@ public class AssertOnValueInequality_IsNotEqualTo_LocalTime_Test extends Abstrac
@Test
@NeedReload
public void test_is_not_equal_to() {
- Table table = new Table(jdbcConnectionProvider, "test");
- Changes changes = new Changes(table).setStartPointNow();
+ Table table = assertDbConnection.table("test").build();
+ Changes changes = assertDbConnection.changes().tables(table).build().setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
changes.setEndPointNow();
@@ -60,8 +60,8 @@ public void test_is_not_equal_to() {
@Test
@NeedReload
public void should_fail_because_value_is_equal_to() {
- Table table = new Table(jdbcConnectionProvider, "test");
- Changes changes = new Changes(table).setStartPointNow();
+ Table table = assertDbConnection.table("test").build();
+ Changes changes = assertDbConnection.changes().tables(table).build().setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
changes.setEndPointNow();
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnValueInequality_IsNotEqualTo_Number_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnValueInequality_IsNotEqualTo_Number_Test.java
index c8186b75..a5c6a3e4 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnValueInequality_IsNotEqualTo_Number_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnValueInequality_IsNotEqualTo_Number_Test.java
@@ -39,8 +39,8 @@ public class AssertOnValueInequality_IsNotEqualTo_Number_Test extends AbstractTe
@Test
@NeedReload
public void test_is_not_equal_to() {
- Table table = new Table(jdbcConnectionProvider, "test");
- Changes changes = new Changes(table).setStartPointNow();
+ Table table = assertDbConnection.table("test").build();
+ Changes changes = assertDbConnection.changes().tables(table).build().setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
changes.setEndPointNow();
@@ -59,8 +59,8 @@ public void test_is_not_equal_to() {
@Test
@NeedReload
public void should_fail_because_value_is_equal_to() {
- Table table = new Table(jdbcConnectionProvider, "test");
- Changes changes = new Changes(table).setStartPointNow();
+ Table table = assertDbConnection.table("test").build();
+ Changes changes = assertDbConnection.changes().tables(table).build().setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
changes.setEndPointNow();
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnValueInequality_IsNotEqualTo_Object_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnValueInequality_IsNotEqualTo_Object_Test.java
index b8aa4663..e862bab5 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnValueInequality_IsNotEqualTo_Object_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnValueInequality_IsNotEqualTo_Object_Test.java
@@ -39,8 +39,8 @@ public class AssertOnValueInequality_IsNotEqualTo_Object_Test extends AbstractTe
@Test
@NeedReload
public void test_is_not_equal_to() {
- Table table = new Table(jdbcConnectionProvider, "test");
- Changes changes = new Changes(table).setStartPointNow();
+ Table table = assertDbConnection.table("test").build();
+ Changes changes = assertDbConnection.changes().tables(table).build().setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
changes.setEndPointNow();
@@ -59,8 +59,8 @@ public void test_is_not_equal_to() {
@Test
@NeedReload
public void should_fail_because_value_is_equal_to() {
- Table table = new Table(jdbcConnectionProvider, "test2");
- Changes changes = new Changes(table).setStartPointNow();
+ Table table = assertDbConnection.table("test2").build();
+ Changes changes = assertDbConnection.changes().tables(table).build().setStartPointNow();
update("update test2 set var14 = 1 where var1 is null");
changes.setEndPointNow();
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnValueInequality_IsNotEqualTo_String_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnValueInequality_IsNotEqualTo_String_Test.java
index 948928d2..ec7e2337 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnValueInequality_IsNotEqualTo_String_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnValueInequality_IsNotEqualTo_String_Test.java
@@ -39,8 +39,8 @@ public class AssertOnValueInequality_IsNotEqualTo_String_Test extends AbstractTe
@Test
@NeedReload
public void test_is_not_equal_to() {
- Table table = new Table(jdbcConnectionProvider, "test");
- Changes changes = new Changes(table).setStartPointNow();
+ Table table = assertDbConnection.table("test").build();
+ Changes changes = assertDbConnection.changes().tables(table).build().setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
changes.setEndPointNow();
@@ -59,8 +59,8 @@ public void test_is_not_equal_to() {
@Test
@NeedReload
public void should_fail_because_value_is_equal_to() {
- Table table = new Table(jdbcConnectionProvider, "test");
- Changes changes = new Changes(table).setStartPointNow();
+ Table table = assertDbConnection.table("test").build();
+ Changes changes = assertDbConnection.changes().tables(table).build().setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
changes.setEndPointNow();
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnValueInequality_IsNotEqualTo_TimeValue_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnValueInequality_IsNotEqualTo_TimeValue_Test.java
index 11ea8036..9be7c252 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnValueInequality_IsNotEqualTo_TimeValue_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnValueInequality_IsNotEqualTo_TimeValue_Test.java
@@ -40,8 +40,8 @@ public class AssertOnValueInequality_IsNotEqualTo_TimeValue_Test extends Abstrac
@Test
@NeedReload
public void test_is_not_equal_to() {
- Table table = new Table(jdbcConnectionProvider, "test");
- Changes changes = new Changes(table).setStartPointNow();
+ Table table = assertDbConnection.table("test").build();
+ Changes changes = assertDbConnection.changes().tables(table).build().setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
changes.setEndPointNow();
@@ -60,8 +60,8 @@ public void test_is_not_equal_to() {
@Test
@NeedReload
public void should_fail_because_value_is_equal_to() {
- Table table = new Table(jdbcConnectionProvider, "test");
- Changes changes = new Changes(table).setStartPointNow();
+ Table table = assertDbConnection.table("test").build();
+ Changes changes = assertDbConnection.changes().tables(table).build().setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
changes.setEndPointNow();
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnValueInequality_IsNotEqualTo_UUID_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnValueInequality_IsNotEqualTo_UUID_Test.java
index c53aff5f..72fb0a08 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnValueInequality_IsNotEqualTo_UUID_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnValueInequality_IsNotEqualTo_UUID_Test.java
@@ -40,8 +40,8 @@ public class AssertOnValueInequality_IsNotEqualTo_UUID_Test extends AbstractTest
@Test
@NeedReload
public void test_is_not_equal_to() {
- Table table = new Table(jdbcConnectionProvider, "test");
- Changes changes = new Changes(table).setStartPointNow();
+ Table table = assertDbConnection.table("test").build();
+ Changes changes = assertDbConnection.changes().tables(table).build().setStartPointNow();
update("update test set var15 = 'F96EC595-CE91-47CC-9152-CCC8AC48AAD6' where var1 = 10");
changes.setEndPointNow();
@@ -62,8 +62,8 @@ public void test_is_not_equal_to() {
@Test
@NeedReload
public void should_fail_because_value_is_equal_to() {
- Table table = new Table(jdbcConnectionProvider, "test");
- Changes changes = new Changes(table).setStartPointNow();
+ Table table = assertDbConnection.table("test").build();
+ Changes changes = assertDbConnection.changes().tables(table).build().setStartPointNow();
update("update test set var15 = 'F96EC595-CE91-47CC-9152-CCC8AC48AAD6' where var1 = 1");
changes.setEndPointNow();
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnValueInequality_IsNotZero_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnValueInequality_IsNotZero_Test.java
index 262fe947..9e4ac919 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnValueInequality_IsNotZero_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnValueInequality_IsNotZero_Test.java
@@ -39,8 +39,8 @@ public class AssertOnValueInequality_IsNotZero_Test extends AbstractTest {
@Test
@NeedReload
public void test_is_not_zero() {
- Table table = new Table(jdbcConnectionProvider, "test");
- Changes changes = new Changes(table).setStartPointNow();
+ Table table = assertDbConnection.table("test").build();
+ Changes changes = assertDbConnection.changes().tables(table).build().setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
changes.setEndPointNow();
@@ -59,8 +59,8 @@ public void test_is_not_zero() {
@Test
@NeedReload
public void should_fail_because_value_is_zero() {
- Table table = new Table(jdbcConnectionProvider, "test");
- Changes changes = new Changes(table).setStartPointNow();
+ Table table = assertDbConnection.table("test").build();
+ Changes changes = assertDbConnection.changes().tables(table).build().setStartPointNow();
update("update test set var14 = 1 where var1 = 1000");
changes.setEndPointNow();
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnValueNullity_IsNotNull_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnValueNullity_IsNotNull_Test.java
index 93067a89..40beba62 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnValueNullity_IsNotNull_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnValueNullity_IsNotNull_Test.java
@@ -12,6 +12,9 @@
*/
package org.assertj.db.api.assertions;
+import static org.assertj.db.api.Assertions.assertThat;
+import static org.junit.Assert.fail;
+
import org.assertj.core.api.Assertions;
import org.assertj.db.api.ChangeColumnValueAssert;
import org.assertj.db.api.TableColumnValueAssert;
@@ -21,9 +24,6 @@
import org.assertj.db.type.Table;
import org.junit.Test;
-import static org.assertj.db.api.Assertions.assertThat;
-import static org.junit.Assert.fail;
-
/**
* Tests on {@link org.assertj.db.api.assertions.AssertOnValueNullity} class :
* {@link org.assertj.db.api.assertions.AssertOnValueNullity#isNotNull()} method.
@@ -39,8 +39,8 @@ public class AssertOnValueNullity_IsNotNull_Test extends AbstractTest {
@Test
@NeedReload
public void test_is_not_null() {
- Table table = new Table(jdbcConnectionProvider, "test");
- Changes changes = new Changes(table).setStartPointNow();
+ Table table = assertDbConnection.table("test").build();
+ Changes changes = assertDbConnection.changes().tables(table).build().setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
changes.setEndPointNow();
@@ -59,8 +59,8 @@ public void test_is_not_null() {
@Test
@NeedReload
public void should_fail_because_value_is_null() {
- Table table = new Table(jdbcConnectionProvider, "test2");
- Changes changes = new Changes(table).setStartPointNow();
+ Table table = assertDbConnection.table("test2").build();
+ Changes changes = assertDbConnection.changes().tables(table).build().setStartPointNow();
update("update test2 set var14 = 1 where var1 is null");
changes.setEndPointNow();
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnValueNullity_IsNull_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnValueNullity_IsNull_Test.java
index bb58a844..2ad40701 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnValueNullity_IsNull_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnValueNullity_IsNull_Test.java
@@ -39,8 +39,8 @@ public class AssertOnValueNullity_IsNull_Test extends AbstractTest {
@Test
@NeedReload
public void test_is_null() {
- Table table = new Table(jdbcConnectionProvider, "test2");
- Changes changes = new Changes(table).setStartPointNow();
+ Table table = assertDbConnection.table("test2").build();
+ Changes changes = assertDbConnection.changes().tables(table).build().setStartPointNow();
update("update test2 set var14 = 1 where var1 is null");
changes.setEndPointNow();
@@ -59,8 +59,8 @@ public void test_is_null() {
@Test
@NeedReload
public void should_fail_because_value_is_not_null() {
- Table table = new Table(jdbcConnectionProvider, "test");
- Changes changes = new Changes(table).setStartPointNow();
+ Table table = assertDbConnection.table("test").build();
+ Changes changes = assertDbConnection.changes().tables(table).build().setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
changes.setEndPointNow();
@@ -68,13 +68,13 @@ public void should_fail_because_value_is_not_null() {
assertThat(changes).change().column("var3").valueAtEndPoint().isNull();
fail("An exception must be raised");
} catch (AssertionError e) {
- Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Value at end point of Column at index 2 (column name : VAR3) of Change at index 0 (with primary key : [1]) of Changes on TEST table of 'sa/jdbc:h2:mem:test'] expected: but was:<2>"));
+ Assertions.assertThat(e.getMessage()).isEqualTo("[Value at end point of Column at index 2 (column name : VAR3) of Change at index 0 (with primary key : [1]) of Changes on TEST table of 'sa/jdbc:h2:mem:test'] expected: but was:<2>");
}
try {
assertThat(table).column("var3").value().isNull();
fail("An exception must be raised");
} catch (AssertionError e) {
- Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Value at index 0 of Column at index 2 (column name : VAR3) of TEST table] expected: but was:<2>"));
+ Assertions.assertThat(e.getMessage()).isEqualTo("[Value at index 0 of Column at index 2 (column name : VAR3) of TEST table] expected: but was:<2>");
}
}
}
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnValueType_IsBoolean_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnValueType_IsBoolean_Test.java
index 739dc3f3..4a815855 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnValueType_IsBoolean_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnValueType_IsBoolean_Test.java
@@ -39,8 +39,8 @@ public class AssertOnValueType_IsBoolean_Test extends AbstractTest {
@Test
@NeedReload
public void test_is_boolean() {
- Table table = new Table(jdbcConnectionProvider, "test");
- Changes changes = new Changes(table).setStartPointNow();
+ Table table = assertDbConnection.table("test").build();
+ Changes changes = assertDbConnection.changes().tables(table).build().setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
changes.setEndPointNow();
@@ -59,8 +59,8 @@ public void test_is_boolean() {
@Test
@NeedReload
public void should_fail_because_value_is_not_a_boolean() {
- Table table = new Table(jdbcConnectionProvider, "test");
- Changes changes = new Changes(table).setStartPointNow();
+ Table table = assertDbConnection.table("test").build();
+ Changes changes = assertDbConnection.changes().tables(table).build().setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
changes.setEndPointNow();
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnValueType_IsBytes_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnValueType_IsBytes_Test.java
index 01142997..1963d67c 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnValueType_IsBytes_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnValueType_IsBytes_Test.java
@@ -39,8 +39,8 @@ public class AssertOnValueType_IsBytes_Test extends AbstractTest {
@Test
@NeedReload
public void test_is_bytes() {
- Table table = new Table(jdbcConnectionProvider, "test");
- Changes changes = new Changes(table).setStartPointNow();
+ Table table = assertDbConnection.table("test").build();
+ Changes changes = assertDbConnection.changes().table("test").build().setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
changes.setEndPointNow();
@@ -59,8 +59,8 @@ public void test_is_bytes() {
@Test
@NeedReload
public void should_fail_because_value_is_not_bytes() {
- Table table = new Table(jdbcConnectionProvider, "test");
- Changes changes = new Changes(table).setStartPointNow();
+ Table table = assertDbConnection.table("test").build();
+ Changes changes = assertDbConnection.changes().tables(table).build().setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
changes.setEndPointNow();
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnValueType_IsDateTime_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnValueType_IsDateTime_Test.java
index 43cca907..21d4f2ee 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnValueType_IsDateTime_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnValueType_IsDateTime_Test.java
@@ -39,8 +39,8 @@ public class AssertOnValueType_IsDateTime_Test extends AbstractTest {
@Test
@NeedReload
public void test_is_date_time() {
- Table table = new Table(jdbcConnectionProvider, "test");
- Changes changes = new Changes(table).setStartPointNow();
+ Table table = assertDbConnection.table("test").build();
+ Changes changes = assertDbConnection.changes().tables(table).build().setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
changes.setEndPointNow();
@@ -59,8 +59,8 @@ public void test_is_date_time() {
@Test
@NeedReload
public void should_fail_because_value_is_not_a_date_time() {
- Table table = new Table(jdbcConnectionProvider, "test");
- Changes changes = new Changes(table).setStartPointNow();
+ Table table = assertDbConnection.table("test").build();
+ Changes changes = assertDbConnection.changes().tables(table).build().setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
changes.setEndPointNow();
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnValueType_IsDate_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnValueType_IsDate_Test.java
index af5400a6..3b944690 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnValueType_IsDate_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnValueType_IsDate_Test.java
@@ -39,8 +39,8 @@ public class AssertOnValueType_IsDate_Test extends AbstractTest {
@Test
@NeedReload
public void test_is_date() {
- Table table = new Table(jdbcConnectionProvider, "test");
- Changes changes = new Changes(table).setStartPointNow();
+ Table table = assertDbConnection.table("test").build();
+ Changes changes = assertDbConnection.changes().tables(table).build().setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
changes.setEndPointNow();
@@ -59,8 +59,8 @@ public void test_is_date() {
@Test
@NeedReload
public void should_fail_because_value_is_not_a_date() {
- Table table = new Table(jdbcConnectionProvider, "test");
- Changes changes = new Changes(table).setStartPointNow();
+ Table table = assertDbConnection.table("test").build();
+ Changes changes = assertDbConnection.changes().tables(table).build().setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
changes.setEndPointNow();
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnValueType_IsNumber_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnValueType_IsNumber_Test.java
index a0acdb49..1e1cf711 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnValueType_IsNumber_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnValueType_IsNumber_Test.java
@@ -39,8 +39,8 @@ public class AssertOnValueType_IsNumber_Test extends AbstractTest {
@Test
@NeedReload
public void test_is_number() {
- Table table = new Table(jdbcConnectionProvider, "test");
- Changes changes = new Changes(table).setStartPointNow();
+ Table table = assertDbConnection.table("test").build();
+ Changes changes = assertDbConnection.changes().tables(table).build().setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
changes.setEndPointNow();
@@ -59,8 +59,8 @@ public void test_is_number() {
@Test
@NeedReload
public void should_fail_because_value_is_not_a_number() {
- Table table = new Table(jdbcConnectionProvider, "test");
- Changes changes = new Changes(table).setStartPointNow();
+ Table table = assertDbConnection.table("test").build();
+ Changes changes = assertDbConnection.changes().tables(table).build().setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
changes.setEndPointNow();
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnValueType_IsOfAnyTypeIn_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnValueType_IsOfAnyTypeIn_Test.java
index 7149a422..6a1dd8fd 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnValueType_IsOfAnyTypeIn_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnValueType_IsOfAnyTypeIn_Test.java
@@ -12,6 +12,9 @@
*/
package org.assertj.db.api.assertions;
+import static org.assertj.db.api.Assertions.assertThat;
+import static org.junit.Assert.fail;
+
import org.assertj.core.api.Assertions;
import org.assertj.db.api.ChangeColumnValueAssert;
import org.assertj.db.api.TableColumnValueAssert;
@@ -22,9 +25,6 @@
import org.assertj.db.type.ValueType;
import org.junit.Test;
-import static org.assertj.db.api.Assertions.assertThat;
-import static org.junit.Assert.fail;
-
/**
* Tests on {@link org.assertj.db.api.assertions.AssertOnValueType} class :
* {@link org.assertj.db.api.assertions.AssertOnValueType#isOfAnyTypeIn(org.assertj.db.type.ValueType...)} method.
@@ -40,8 +40,8 @@ public class AssertOnValueType_IsOfAnyTypeIn_Test extends AbstractTest {
@Test
@NeedReload
public void test_is_of_any_of_types() {
- Table table = new Table(jdbcConnectionProvider, "test");
- Changes changes = new Changes(table).setStartPointNow();
+ Table table = assertDbConnection.table("test").build();
+ Changes changes = assertDbConnection.changes().tables(table).build().setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
changes.setEndPointNow();
@@ -60,8 +60,8 @@ public void test_is_of_any_of_types() {
@Test
@NeedReload
public void should_fail_because_value_is_not_of_any_of_types() {
- Table table = new Table(jdbcConnectionProvider, "test");
- Changes changes = new Changes(table).setStartPointNow();
+ Table table = assertDbConnection.table("test").build();
+ Changes changes = assertDbConnection.changes().tables(table).build().setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
changes.setEndPointNow();
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnValueType_IsOfType_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnValueType_IsOfType_Test.java
index 96e468e3..5de77737 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnValueType_IsOfType_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnValueType_IsOfType_Test.java
@@ -40,8 +40,8 @@ public class AssertOnValueType_IsOfType_Test extends AbstractTest {
@Test
@NeedReload
public void test_is_of_type() {
- Table table = new Table(jdbcConnectionProvider, "test");
- Changes changes = new Changes(table).setStartPointNow();
+ Table table = assertDbConnection.table("test").build();
+ Changes changes = assertDbConnection.changes().tables(table).build().setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
changes.setEndPointNow();
@@ -60,8 +60,8 @@ public void test_is_of_type() {
@Test
@NeedReload
public void should_fail_because_value_is_not_of_type() {
- Table table = new Table(jdbcConnectionProvider, "test");
- Changes changes = new Changes(table).setStartPointNow();
+ Table table = assertDbConnection.table("test").build();
+ Changes changes = assertDbConnection.changes().tables(table).build().setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
changes.setEndPointNow();
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnValueType_IsText_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnValueType_IsText_Test.java
index 1eb9a74e..9db7862b 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnValueType_IsText_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnValueType_IsText_Test.java
@@ -39,8 +39,8 @@ public class AssertOnValueType_IsText_Test extends AbstractTest {
@Test
@NeedReload
public void test_is_text() {
- Table table = new Table(jdbcConnectionProvider, "test");
- Changes changes = new Changes(table).setStartPointNow();
+ Table table = assertDbConnection.table("test").build();
+ Changes changes = assertDbConnection.changes().tables(table).build().setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
changes.setEndPointNow();
@@ -59,8 +59,8 @@ public void test_is_text() {
@Test
@NeedReload
public void should_fail_because_value_is_not_a_text() {
- Table table = new Table(jdbcConnectionProvider, "test");
- Changes changes = new Changes(table).setStartPointNow();
+ Table table = assertDbConnection.table("test").build();
+ Changes changes = assertDbConnection.changes().tables(table).build().setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
changes.setEndPointNow();
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnValueType_IsTime_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnValueType_IsTime_Test.java
index 3b4a9d6f..0b9627ee 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnValueType_IsTime_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnValueType_IsTime_Test.java
@@ -39,8 +39,8 @@ public class AssertOnValueType_IsTime_Test extends AbstractTest {
@Test
@NeedReload
public void test_is_time() {
- Table table = new Table(jdbcConnectionProvider, "test");
- Changes changes = new Changes(table).setStartPointNow();
+ Table table = assertDbConnection.table("test").build();
+ Changes changes = assertDbConnection.changes().tables(table).build().setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
changes.setEndPointNow();
@@ -59,8 +59,8 @@ public void test_is_time() {
@Test
@NeedReload
public void should_fail_because_value_is_not_a_time() {
- Table table = new Table(jdbcConnectionProvider, "test");
- Changes changes = new Changes(table).setStartPointNow();
+ Table table = assertDbConnection.table("test").build();
+ Changes changes = assertDbConnection.changes().tables(table).build().setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
changes.setEndPointNow();
diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnValueType_IsUUID_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnValueType_IsUUID_Test.java
index 657b567d..36f58a3b 100644
--- a/src/test/java/org/assertj/db/api/assertions/AssertOnValueType_IsUUID_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/AssertOnValueType_IsUUID_Test.java
@@ -38,8 +38,8 @@ public class AssertOnValueType_IsUUID_Test extends AbstractTest {
@Test
@NeedReload
public void test_is_UUID() {
- Table table = new Table(jdbcConnectionProvider, "test");
- Changes changes = new Changes(table).setStartPointNow();
+ Table table = assertDbConnection.table("test").build();
+ Changes changes = assertDbConnection.changes().tables(table).build().setStartPointNow();
update("update test set var15 = 'F96EC595-CE91-47CC-9152-CCC8AC48AAD6' where var1 = 1");
changes.setEndPointNow();
@@ -58,8 +58,8 @@ public void test_is_UUID() {
@Test
@NeedReload
public void should_fail_because_value_is_not_a_UUID() {
- Table table = new Table(jdbcConnectionProvider, "test");
- Changes changes = new Changes(table).setStartPointNow();
+ Table table = assertDbConnection.table("test").build();
+ Changes changes = assertDbConnection.changes().tables(table).build().setStartPointNow();
update("update test set var14 = 1 where var1 = 1");
changes.setEndPointNow();
diff --git a/src/test/java/org/assertj/db/api/assertions/BDDAssertions_Test.java b/src/test/java/org/assertj/db/api/assertions/BDDAssertions_Test.java
index 1cab257a..1126658e 100644
--- a/src/test/java/org/assertj/db/api/assertions/BDDAssertions_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/BDDAssertions_Test.java
@@ -36,8 +36,8 @@ public class BDDAssertions_Test extends AbstractTest {
* This method tests the {@code then} method for {@code Table}.
*/
@Test
- public void test_then_for_table() throws Exception {
- Table table = new Table(jdbcConnectionProvider, "test");
+ public void test_then_for_table() {
+ Table table = assertDbConnection.table("test").build();
Assertions.assertThat(then(table)).isInstanceOf(TableAssert.class);
}
@@ -45,8 +45,8 @@ public void test_then_for_table() throws Exception {
* This method tests the {@code then} method for {@code Request}.
*/
@Test
- public void test_then_for_request() throws Exception {
- Request request = new Request(jdbcConnectionProvider, "select * from test");
+ public void test_then_for_request() {
+ Request request = assertDbConnection.request("select * from test").build();
Assertions.assertThat(then(request)).isInstanceOf(RequestAssert.class);
}
@@ -54,8 +54,8 @@ public void test_then_for_request() throws Exception {
* This method tests the {@code then} method for {@code Changes}.
*/
@Test
- public void test_then_for_changes() throws Exception {
- Changes changes = new Changes(jdbcConnectionProvider);
+ public void test_then_for_changes() {
+ Changes changes = assertDbConnection.changes().build();
Assertions.assertThat(then(changes)).isInstanceOf(ChangesAssert.class);
}
}
diff --git a/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnChangeType_IsCreation_Test.java b/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnChangeType_IsCreation_Test.java
index 91dd3975..ad5592c4 100644
--- a/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnChangeType_IsCreation_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnChangeType_IsCreation_Test.java
@@ -12,7 +12,6 @@
*/
package org.assertj.db.api.assertions.impl;
-import static org.assertj.db.api.Assertions.assertThat;
import static org.junit.Assert.fail;
import org.assertj.core.api.Assertions;
@@ -23,7 +22,6 @@
import org.assertj.db.type.ChangeType;
import org.assertj.db.type.DataType;
import org.assertj.db.type.Row;
-import org.assertj.db.type.Table;
import org.junit.Test;
/**
@@ -40,8 +38,7 @@ public class AssertionsOnChangeType_IsCreation_Test extends AbstractTest {
@Test
public void test_is_creation() throws Exception {
WritableAssertionInfo info = new WritableAssertionInfo();
- Table table = new Table();
- TableAssert tableAssert = assertThat(table);
+ TableAssert tableAssert = new TableAssert(null);
Row rowAtStartPoint = getRow(null, null, null);
Row rowAtEndPoint = getRow(null, null, null);
Change change = getChange(DataType.TABLE, "test", ChangeType.CREATION, rowAtStartPoint, rowAtEndPoint);
@@ -56,8 +53,7 @@ public void test_is_creation() throws Exception {
public void should_fail_because_type_of_change_is_different() throws Exception {
WritableAssertionInfo info = new WritableAssertionInfo();
info.description("description");
- Table table = new Table();
- TableAssert tableAssert = assertThat(table);
+ TableAssert tableAssert = new TableAssert(null);
Row rowAtStartPoint = getRow(null, null, null);
Row rowAtEndPoint = getRow(null, null, null);
Change change = getChange(DataType.TABLE, "test", ChangeType.MODIFICATION, rowAtStartPoint, rowAtEndPoint);
diff --git a/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnChangeType_IsDeletion_Test.java b/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnChangeType_IsDeletion_Test.java
index aea2e669..74697fa5 100644
--- a/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnChangeType_IsDeletion_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnChangeType_IsDeletion_Test.java
@@ -12,7 +12,6 @@
*/
package org.assertj.db.api.assertions.impl;
-import static org.assertj.db.api.Assertions.assertThat;
import static org.junit.Assert.fail;
import org.assertj.core.api.Assertions;
@@ -23,7 +22,6 @@
import org.assertj.db.type.ChangeType;
import org.assertj.db.type.DataType;
import org.assertj.db.type.Row;
-import org.assertj.db.type.Table;
import org.junit.Test;
/**
@@ -40,8 +38,7 @@ public class AssertionsOnChangeType_IsDeletion_Test extends AbstractTest {
@Test
public void test_is_deletion() throws Exception {
WritableAssertionInfo info = new WritableAssertionInfo();
- Table table = new Table();
- TableAssert tableAssert = assertThat(table);
+ TableAssert tableAssert = new TableAssert(null);
Row rowAtStartPoint = getRow(null, null, null);
Row rowAtEndPoint = getRow(null, null, null);
Change change = getChange(DataType.TABLE, "test", ChangeType.DELETION, rowAtStartPoint, rowAtEndPoint);
@@ -56,8 +53,7 @@ public void test_is_deletion() throws Exception {
public void should_fail_because_type_of_change_is_different() throws Exception {
WritableAssertionInfo info = new WritableAssertionInfo();
info.description("description");
- Table table = new Table();
- TableAssert tableAssert = assertThat(table);
+ TableAssert tableAssert = new TableAssert(null);
Row rowAtStartPoint = getRow(null, null, null);
Row rowAtEndPoint = getRow(null, null, null);
Change change = getChange(DataType.TABLE, "test", ChangeType.CREATION, rowAtStartPoint, rowAtEndPoint);
diff --git a/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnChangeType_IsModification_Test.java b/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnChangeType_IsModification_Test.java
index 430c39ed..969c5fdd 100644
--- a/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnChangeType_IsModification_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnChangeType_IsModification_Test.java
@@ -12,7 +12,6 @@
*/
package org.assertj.db.api.assertions.impl;
-import static org.assertj.db.api.Assertions.assertThat;
import static org.junit.Assert.fail;
import org.assertj.core.api.Assertions;
@@ -23,7 +22,6 @@
import org.assertj.db.type.ChangeType;
import org.assertj.db.type.DataType;
import org.assertj.db.type.Row;
-import org.assertj.db.type.Table;
import org.junit.Test;
/**
@@ -40,8 +38,7 @@ public class AssertionsOnChangeType_IsModification_Test extends AbstractTest {
@Test
public void test_is_modification() throws Exception {
WritableAssertionInfo info = new WritableAssertionInfo();
- Table table = new Table();
- TableAssert tableAssert = assertThat(table);
+ TableAssert tableAssert = new TableAssert(null);
Row rowAtStartPoint = getRow(null, null, null);
Row rowAtEndPoint = getRow(null, null, null);
Change change = getChange(DataType.TABLE, "test", ChangeType.MODIFICATION, rowAtStartPoint, rowAtEndPoint);
@@ -56,8 +53,7 @@ public void test_is_modification() throws Exception {
public void should_fail_because_type_of_change_is_different() throws Exception {
WritableAssertionInfo info = new WritableAssertionInfo();
info.description("description");
- Table table = new Table();
- TableAssert tableAssert = assertThat(table);
+ TableAssert tableAssert = new TableAssert(null);
Row rowAtStartPoint = getRow(null, null, null);
Row rowAtEndPoint = getRow(null, null, null);
Change change = getChange(DataType.TABLE, "test", ChangeType.CREATION, rowAtStartPoint, rowAtEndPoint);
diff --git a/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnChangeType_IsOfType_Test.java b/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnChangeType_IsOfType_Test.java
index 521ba803..cdb75314 100644
--- a/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnChangeType_IsOfType_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnChangeType_IsOfType_Test.java
@@ -13,7 +13,6 @@
package org.assertj.db.api.assertions.impl;
import static org.assertj.core.api.Assertions.assertThat;
-import static org.assertj.db.api.Assertions.assertThat;
import static org.junit.Assert.fail;
import org.assertj.core.api.WritableAssertionInfo;
@@ -23,7 +22,6 @@
import org.assertj.db.type.ChangeType;
import org.assertj.db.type.DataType;
import org.assertj.db.type.Row;
-import org.assertj.db.type.Table;
import org.junit.Test;
/**
@@ -40,8 +38,7 @@ public class AssertionsOnChangeType_IsOfType_Test extends AbstractTest {
@Test
public void test_is_of_type() throws Exception {
WritableAssertionInfo info = new WritableAssertionInfo();
- Table table = new Table();
- TableAssert tableAssert = assertThat(table);
+ TableAssert tableAssert = new TableAssert(null);
Row rowAtStartPoint = getRow(null, null, null);
Row rowAtEndPoint = getRow(null, null, null);
Change change = getChange(DataType.TABLE, "test", ChangeType.CREATION, rowAtStartPoint, rowAtEndPoint);
@@ -56,8 +53,7 @@ public void test_is_of_type() throws Exception {
public void should_fail_because_type_of_change_is_different() throws Exception {
WritableAssertionInfo info = new WritableAssertionInfo();
info.description("description");
- Table table = new Table();
- TableAssert tableAssert = assertThat(table);
+ TableAssert tableAssert = new TableAssert(null);
Row rowAtStartPoint = getRow(null, null, null);
Row rowAtEndPoint = getRow(null, null, null);
Change change = getChange(DataType.TABLE, "test", ChangeType.CREATION, rowAtStartPoint, rowAtEndPoint);
diff --git a/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnColumnClass_IsOfClass_Test.java b/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnColumnClass_IsOfClass_Test.java
index 2d79abc2..810302d9 100644
--- a/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnColumnClass_IsOfClass_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnColumnClass_IsOfClass_Test.java
@@ -12,7 +12,6 @@
*/
package org.assertj.db.api.assertions.impl;
-import static org.assertj.db.api.Assertions.assertThat;
import static org.junit.Assert.fail;
import java.util.ArrayList;
@@ -24,7 +23,6 @@
import org.assertj.db.api.TableAssert;
import org.assertj.db.common.AbstractTest;
import org.assertj.db.exception.AssertJDBException;
-import org.assertj.db.type.Table;
import org.assertj.db.type.Value;
import org.junit.Test;
@@ -42,8 +40,7 @@ public class AssertionsOnColumnClass_IsOfClass_Test extends AbstractTest {
@Test
public void test_is_of_type() throws Exception {
WritableAssertionInfo info = new WritableAssertionInfo();
- Table table = new Table();
- TableAssert tableAssert = assertThat(table);
+ TableAssert tableAssert = new TableAssert(null);
List list = new ArrayList<>(Arrays.asList(getValue(null, "test"), getValue(null, "test")));
TableAssert tableAssert2 = AssertionsOnColumnClass.isOfClass(tableAssert, info, list, String.class, false);
Assertions.assertThat(tableAssert2).isSameAs(tableAssert);
@@ -62,8 +59,7 @@ public void test_is_of_type() throws Exception {
public void should_fail_because_value_is_not_of_class() throws Exception {
WritableAssertionInfo info = new WritableAssertionInfo();
info.description("description");
- Table table = new Table();
- TableAssert tableAssert = assertThat(table);
+ TableAssert tableAssert = new TableAssert(null);
try {
List list = new ArrayList<>(Arrays.asList(getValue(null, 8), getValue(null, "test")));
AssertionsOnColumnClass.isOfClass(tableAssert, info, list, String.class, false);
@@ -97,8 +93,7 @@ public void should_fail_because_value_is_not_of_class() throws Exception {
public void should_fail_because_value_is_not_of_type_with_lenience() throws Exception {
WritableAssertionInfo info = new WritableAssertionInfo();
info.description("description");
- Table table = new Table();
- TableAssert tableAssert = assertThat(table);
+ TableAssert tableAssert = new TableAssert(null);
try {
List list = new ArrayList<>(Arrays.asList(getValue(null, "test"), getValue(null, 8)));
AssertionsOnColumnClass.isOfClass(tableAssert, info, list, String.class, true);
@@ -121,8 +116,7 @@ public void should_fail_because_value_is_not_of_type_with_lenience() throws Exce
public void should_fail_because_value_is_a_stringbuilder() throws Exception {
WritableAssertionInfo info = new WritableAssertionInfo();
info.description("description");
- Table table = new Table();
- TableAssert tableAssert = assertThat(table);
+ TableAssert tableAssert = new TableAssert(null);
try {
List list = new ArrayList<>(Arrays.asList(getValue(null, new StringBuilder("test")), getValue(null, true)));
AssertionsOnColumnClass.isOfClass(tableAssert, info, list, String.class, false);
@@ -145,8 +139,7 @@ public void should_fail_because_value_is_a_stringbuilder() throws Exception {
public void should_fail_because_class_value_is_null() throws Exception {
WritableAssertionInfo info = new WritableAssertionInfo();
info.description("description");
- Table table = new Table();
- TableAssert tableAssert = assertThat(table);
+ TableAssert tableAssert = new TableAssert(null);
List list = new ArrayList<>(Arrays.asList(getValue(null, "test"), getValue(null, "test")));
try {
AssertionsOnColumnClass.isOfClass(tableAssert, info, list, null, false);
diff --git a/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnColumnContent_ContainsValues_Boolean_Test.java b/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnColumnContent_ContainsValues_Boolean_Test.java
index c1bb4ac1..a1297c6c 100644
--- a/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnColumnContent_ContainsValues_Boolean_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnColumnContent_ContainsValues_Boolean_Test.java
@@ -12,7 +12,6 @@
*/
package org.assertj.db.api.assertions.impl;
-import static org.assertj.db.api.Assertions.assertThat;
import static org.junit.Assert.fail;
import java.util.ArrayList;
@@ -23,7 +22,6 @@
import org.assertj.core.api.WritableAssertionInfo;
import org.assertj.db.api.TableAssert;
import org.assertj.db.common.AbstractTest;
-import org.assertj.db.type.Table;
import org.assertj.db.type.Value;
import org.junit.Test;
@@ -41,8 +39,7 @@ public class AssertionsOnColumnContent_ContainsValues_Boolean_Test extends Abstr
@Test
public void test_contains_values() throws Exception {
WritableAssertionInfo info = new WritableAssertionInfo();
- Table table = new Table();
- TableAssert tableAssert = assertThat(table);
+ TableAssert tableAssert = new TableAssert(null);
List list = new ArrayList<>(Arrays.asList(getValue(null, true), getValue(null, false), getValue(null, null)));
TableAssert tableAssert2 = AssertionsOnColumnContent.containsValues(tableAssert, info, list, Boolean.TRUE,
Boolean.FALSE, null);
@@ -67,8 +64,7 @@ public void test_contains_values() throws Exception {
public void should_fail_because_values_are_different() throws Exception {
WritableAssertionInfo info = new WritableAssertionInfo();
info.description("description");
- Table table = new Table();
- TableAssert tableAssert = assertThat(table);
+ TableAssert tableAssert = new TableAssert(null);
List list = new ArrayList<>(Arrays.asList(getValue(null, true), getValue(null, false), getValue(null, null)));
try {
AssertionsOnColumnContent.containsValues(tableAssert, info, list, null, null,
@@ -105,8 +101,7 @@ public void should_fail_because_values_are_different() throws Exception {
public void should_fail_because_one_value_is_not_a_boolean() throws Exception {
WritableAssertionInfo info = new WritableAssertionInfo();
info.description("description");
- Table table = new Table();
- TableAssert tableAssert = assertThat(table);
+ TableAssert tableAssert = new TableAssert(null);
List list = new ArrayList<>(Arrays.asList(getValue(null, "other"), getValue(null, false)));
try {
AssertionsOnColumnContent.containsValues(tableAssert, info, list, Boolean.TRUE, Boolean.FALSE);
@@ -129,8 +124,7 @@ public void should_fail_because_one_value_is_not_a_boolean() throws Exception {
public void should_fail_because_the_number_of_values_is_different() throws Exception {
WritableAssertionInfo info = new WritableAssertionInfo();
info.description("description");
- Table table = new Table();
- TableAssert tableAssert = assertThat(table);
+ TableAssert tableAssert = new TableAssert(null);
List list = new ArrayList<>(Arrays.asList(getValue(null, true), getValue(null, false)));
try {
AssertionsOnColumnContent.containsValues(tableAssert, info, list, Boolean.TRUE, Boolean.FALSE, Boolean.FALSE);
diff --git a/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnColumnContent_ContainsValues_Bytes_Test.java b/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnColumnContent_ContainsValues_Bytes_Test.java
index 453da7df..50bfb49e 100644
--- a/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnColumnContent_ContainsValues_Bytes_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnColumnContent_ContainsValues_Bytes_Test.java
@@ -12,7 +12,6 @@
*/
package org.assertj.db.api.assertions.impl;
-import static org.assertj.db.api.Assertions.assertThat;
import static org.junit.Assert.fail;
import java.util.ArrayList;
@@ -23,7 +22,6 @@
import org.assertj.core.api.WritableAssertionInfo;
import org.assertj.db.api.TableAssert;
import org.assertj.db.common.AbstractTest;
-import org.assertj.db.type.Table;
import org.assertj.db.type.Value;
import org.junit.Test;
@@ -41,8 +39,7 @@ public class AssertionsOnColumnContent_ContainsValues_Bytes_Test extends Abstrac
@Test
public void test_contains_values() throws Exception {
WritableAssertionInfo info = new WritableAssertionInfo();
- Table table = new Table();
- TableAssert tableAssert = assertThat(table);
+ TableAssert tableAssert = new TableAssert(null);
List list = new ArrayList<>(Arrays.asList(getValue(null, new byte[]{0, 1}), getValue(null, new byte[]{2, 3})));
TableAssert tableAssert2 = AssertionsOnColumnContent.containsValues(tableAssert, info, list, new byte[]{0, 1}, new byte[]{2, 3});
Assertions.assertThat(tableAssert2).isSameAs(tableAssert);
@@ -61,8 +58,7 @@ public void test_contains_values() throws Exception {
public void should_fail_because_values_are_different() throws Exception {
WritableAssertionInfo info = new WritableAssertionInfo();
info.description("description");
- Table table = new Table();
- TableAssert tableAssert = assertThat(table);
+ TableAssert tableAssert = new TableAssert(null);
List list = new ArrayList<>(Arrays.asList(getValue(null, new byte[]{0, 1}), getValue(null, new byte[]{2, 3}), getValue(
null, null), getValue(null, new byte[]{2, 3})));
try {
@@ -82,8 +78,7 @@ public void should_fail_because_values_are_different() throws Exception {
public void should_fail_because_one_value_is_not_a_bytes() throws Exception {
WritableAssertionInfo info = new WritableAssertionInfo();
info.description("description");
- Table table = new Table();
- TableAssert tableAssert = assertThat(table);
+ TableAssert tableAssert = new TableAssert(null);
List list = new ArrayList<>(Arrays.asList(getValue(null, "other"), getValue(null, new byte[]{2, 3})));
try {
AssertionsOnColumnContent.containsValues(tableAssert, info, list, new byte[]{0, 1}, new byte[]{2, 3});
@@ -106,8 +101,7 @@ public void should_fail_because_one_value_is_not_a_bytes() throws Exception {
public void should_fail_because_the_number_of_values_is_different() throws Exception {
WritableAssertionInfo info = new WritableAssertionInfo();
info.description("description");
- Table table = new Table();
- TableAssert tableAssert = assertThat(table);
+ TableAssert tableAssert = new TableAssert(null);
List list = new ArrayList<>(Arrays.asList(getValue(null, new byte[]{0, 1}), getValue(null, new byte[]{2, 3})));
try {
AssertionsOnColumnContent.containsValues(tableAssert, info, list, new byte[]{0, 1}, new byte[]{2, 3}, new byte[]{2, 3});
diff --git a/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnColumnContent_ContainsValues_Character_Test.java b/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnColumnContent_ContainsValues_Character_Test.java
index d6d595a2..d1f0f890 100644
--- a/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnColumnContent_ContainsValues_Character_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnColumnContent_ContainsValues_Character_Test.java
@@ -12,7 +12,6 @@
*/
package org.assertj.db.api.assertions.impl;
-import static org.assertj.db.api.Assertions.assertThat;
import static org.junit.Assert.fail;
import java.util.ArrayList;
@@ -23,7 +22,6 @@
import org.assertj.core.api.WritableAssertionInfo;
import org.assertj.db.api.TableAssert;
import org.assertj.db.common.AbstractTest;
-import org.assertj.db.type.Table;
import org.assertj.db.type.Value;
import org.junit.Test;
@@ -41,8 +39,7 @@ public class AssertionsOnColumnContent_ContainsValues_Character_Test extends Abs
@Test
public void test_contains_values() throws Exception {
WritableAssertionInfo info = new WritableAssertionInfo();
- Table table = new Table();
- TableAssert tableAssert = assertThat(table);
+ TableAssert tableAssert = new TableAssert(null);
List list = new ArrayList<>(Arrays.asList(getValue(null, 'T'), getValue(null, "t"), getValue(null, null)));
TableAssert tableAssert2 = AssertionsOnColumnContent.containsValues(tableAssert, info, list, 'T',
't', null);
@@ -62,8 +59,7 @@ public void test_contains_values() throws Exception {
public void should_fail_because_values_are_different() throws Exception {
WritableAssertionInfo info = new WritableAssertionInfo();
info.description("description");
- Table table = new Table();
- TableAssert tableAssert = assertThat(table);
+ TableAssert tableAssert = new TableAssert(null);
List list = new ArrayList<>(Arrays.asList(getValue(null, 'T'), getValue(null, "t"), getValue(null, null)));
try {
AssertionsOnColumnContent.containsValues(tableAssert, info, list, null, null,
@@ -100,8 +96,7 @@ public void should_fail_because_values_are_different() throws Exception {
public void should_fail_because_one_value_is_not_a_boolean() throws Exception {
WritableAssertionInfo info = new WritableAssertionInfo();
info.description("description");
- Table table = new Table();
- TableAssert tableAssert = assertThat(table);
+ TableAssert tableAssert = new TableAssert(null);
List list = new ArrayList<>(Arrays.asList(getValue(null, "T"), getValue(null, false)));
try {
AssertionsOnColumnContent.containsValues(tableAssert, info, list, 'T', 't');
@@ -124,8 +119,7 @@ public void should_fail_because_one_value_is_not_a_boolean() throws Exception {
public void should_fail_because_the_number_of_values_is_different() throws Exception {
WritableAssertionInfo info = new WritableAssertionInfo();
info.description("description");
- Table table = new Table();
- TableAssert tableAssert = assertThat(table);
+ TableAssert tableAssert = new TableAssert(null);
List list = new ArrayList<>(Arrays.asList(getValue(null, 'T'), getValue(null, 't')));
try {
AssertionsOnColumnContent.containsValues(tableAssert, info, list, 'T', 't', 'T');
diff --git a/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnColumnContent_ContainsValues_DateTimeValue_Test.java b/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnColumnContent_ContainsValues_DateTimeValue_Test.java
index 66d860d1..43139457 100644
--- a/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnColumnContent_ContainsValues_DateTimeValue_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnColumnContent_ContainsValues_DateTimeValue_Test.java
@@ -12,7 +12,6 @@
*/
package org.assertj.db.api.assertions.impl;
-import static org.assertj.db.api.Assertions.assertThat;
import static org.junit.Assert.fail;
import java.sql.Timestamp;
@@ -26,7 +25,6 @@
import org.assertj.db.common.AbstractTest;
import org.assertj.db.type.DateTimeValue;
import org.assertj.db.type.DateValue;
-import org.assertj.db.type.Table;
import org.assertj.db.type.TimeValue;
import org.assertj.db.type.Value;
import org.junit.Test;
@@ -45,8 +43,7 @@ public class AssertionsOnColumnContent_ContainsValues_DateTimeValue_Test extends
@Test
public void test_contains_values() throws Exception {
WritableAssertionInfo info = new WritableAssertionInfo();
- Table table = new Table();
- TableAssert tableAssert = assertThat(table);
+ TableAssert tableAssert = new TableAssert(null);
List list = new ArrayList<>(Arrays.asList(getValue(null, Timestamp.valueOf("2007-12-23 09:01:00")), getValue(
null, Timestamp.valueOf("2002-07-25 03:30:05")), getValue(null, null)));
TableAssert tableAssert2 = AssertionsOnColumnContent.containsValues(tableAssert, info, list,
@@ -72,8 +69,7 @@ public void test_contains_values() throws Exception {
public void should_fail_because_values_are_different() throws Exception {
WritableAssertionInfo info = new WritableAssertionInfo();
info.description("description");
- Table table = new Table();
- TableAssert tableAssert = assertThat(table);
+ TableAssert tableAssert = new TableAssert(null);
List list = new ArrayList<>(Arrays.asList(getValue(null, Timestamp.valueOf("2007-12-23 09:01:00")), getValue(
null, Timestamp.valueOf("2002-07-25 03:30:05")), getValue(null, null)));
try {
@@ -101,8 +97,7 @@ public void should_fail_because_values_are_different() throws Exception {
public void should_fail_because_one_value_is_not_a_date_time() throws Exception {
WritableAssertionInfo info = new WritableAssertionInfo();
info.description("description");
- Table table = new Table();
- TableAssert tableAssert = assertThat(table);
+ TableAssert tableAssert = new TableAssert(null);
List list = new ArrayList<>(Arrays.asList(getValue(null, "other"), getValue(
null, Timestamp.valueOf("2002-07-25 03:30:05"))));
try {
@@ -130,8 +125,7 @@ public void should_fail_because_one_value_is_not_a_date_time() throws Exception
public void should_fail_because_the_number_of_values_is_different() throws Exception {
WritableAssertionInfo info = new WritableAssertionInfo();
info.description("description");
- Table table = new Table();
- TableAssert tableAssert = assertThat(table);
+ TableAssert tableAssert = new TableAssert(null);
List list = new ArrayList<>(Arrays.asList(getValue(null, Timestamp.valueOf("2007-12-23 09:01:00")),
getValue(null, Timestamp.valueOf("2002-07-25 03:30:05"))));
try {
diff --git a/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnColumnContent_ContainsValues_DateValue_Test.java b/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnColumnContent_ContainsValues_DateValue_Test.java
index 55aae8f8..714c94bd 100644
--- a/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnColumnContent_ContainsValues_DateValue_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnColumnContent_ContainsValues_DateValue_Test.java
@@ -12,7 +12,6 @@
*/
package org.assertj.db.api.assertions.impl;
-import static org.assertj.db.api.Assertions.assertThat;
import static org.junit.Assert.fail;
import java.sql.Date;
@@ -25,7 +24,6 @@
import org.assertj.db.api.TableAssert;
import org.assertj.db.common.AbstractTest;
import org.assertj.db.type.DateValue;
-import org.assertj.db.type.Table;
import org.assertj.db.type.Value;
import org.junit.Test;
@@ -43,8 +41,7 @@ public class AssertionsOnColumnContent_ContainsValues_DateValue_Test extends Abs
@Test
public void test_contains_values() throws Exception {
WritableAssertionInfo info = new WritableAssertionInfo();
- Table table = new Table();
- TableAssert tableAssert = assertThat(table);
+ TableAssert tableAssert = new TableAssert(null);
List list = new ArrayList<>(Arrays.asList(getValue(null, Date.valueOf("2007-12-23")),
getValue(null, Date.valueOf("2002-07-25")),
getValue(null, null)));
@@ -67,8 +64,7 @@ public void test_contains_values() throws Exception {
public void should_fail_because_values_are_different() throws Exception {
WritableAssertionInfo info = new WritableAssertionInfo();
info.description("description");
- Table table = new Table();
- TableAssert tableAssert = assertThat(table);
+ TableAssert tableAssert = new TableAssert(null);
List list = new ArrayList<>(Arrays.asList(getValue(null, Date.valueOf("2007-12-23")),
getValue(null, Date.valueOf("2002-07-25")),
getValue(null, null)));
@@ -97,8 +93,7 @@ public void should_fail_because_values_are_different() throws Exception {
public void should_fail_because_one_value_is_not_a_date() throws Exception {
WritableAssertionInfo info = new WritableAssertionInfo();
info.description("description");
- Table table = new Table();
- TableAssert tableAssert = assertThat(table);
+ TableAssert tableAssert = new TableAssert(null);
List list = new ArrayList<>(Arrays.asList(getValue(null, "other"),
getValue(null, Date.valueOf("2002-07-25"))));
try {
@@ -124,8 +119,7 @@ public void should_fail_because_one_value_is_not_a_date() throws Exception {
public void should_fail_because_the_number_of_values_is_different() throws Exception {
WritableAssertionInfo info = new WritableAssertionInfo();
info.description("description");
- Table table = new Table();
- TableAssert tableAssert = assertThat(table);
+ TableAssert tableAssert = new TableAssert(null);
List list = new ArrayList<>(Arrays.asList(getValue(null, Date.valueOf("2007-12-23")),
getValue(null, Date.valueOf("2002-07-25"))));
try {
diff --git a/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnColumnContent_ContainsValues_Number_Test.java b/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnColumnContent_ContainsValues_Number_Test.java
index f5a49006..45cef88c 100644
--- a/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnColumnContent_ContainsValues_Number_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnColumnContent_ContainsValues_Number_Test.java
@@ -12,7 +12,6 @@
*/
package org.assertj.db.api.assertions.impl;
-import static org.assertj.db.api.Assertions.assertThat;
import static org.junit.Assert.fail;
import java.util.ArrayList;
@@ -23,7 +22,6 @@
import org.assertj.core.api.WritableAssertionInfo;
import org.assertj.db.api.TableAssert;
import org.assertj.db.common.AbstractTest;
-import org.assertj.db.type.Table;
import org.assertj.db.type.Value;
import org.junit.Test;
@@ -41,8 +39,7 @@ public class AssertionsOnColumnContent_ContainsValues_Number_Test extends Abstra
@Test
public void test_contains_values() throws Exception {
WritableAssertionInfo info = new WritableAssertionInfo();
- Table table = new Table();
- TableAssert tableAssert = assertThat(table);
+ TableAssert tableAssert = new TableAssert(null);
List list = new ArrayList<>(Arrays.asList(getValue(null, 7), getValue(null, 8), getValue(null, null)));
TableAssert tableAssert2 = AssertionsOnColumnContent.containsValues(tableAssert, info, list, 7,
8, null);
@@ -62,8 +59,7 @@ public void test_contains_values() throws Exception {
public void should_fail_because_values_are_different() throws Exception {
WritableAssertionInfo info = new WritableAssertionInfo();
info.description("description");
- Table table = new Table();
- TableAssert tableAssert = assertThat(table);
+ TableAssert tableAssert = new TableAssert(null);
List list = new ArrayList<>(Arrays.asList(getValue(null, 7), getValue(null, 8), getValue(null, null)));
try {
AssertionsOnColumnContent.containsValues(tableAssert, info, list, null, null,
@@ -99,8 +95,7 @@ public void should_fail_because_values_are_different() throws Exception {
public void should_fail_because_one_value_is_not_a_number() throws Exception {
WritableAssertionInfo info = new WritableAssertionInfo();
info.description("description");
- Table table = new Table();
- TableAssert tableAssert = assertThat(table);
+ TableAssert tableAssert = new TableAssert(null);
List list = new ArrayList<>(Arrays.asList(getValue(null, "other"), getValue(null, 8)));
try {
AssertionsOnColumnContent.containsValues(tableAssert, info, list, 7, 8);
@@ -123,8 +118,7 @@ public void should_fail_because_one_value_is_not_a_number() throws Exception {
public void should_fail_because_the_number_of_values_is_different() throws Exception {
WritableAssertionInfo info = new WritableAssertionInfo();
info.description("description");
- Table table = new Table();
- TableAssert tableAssert = assertThat(table);
+ TableAssert tableAssert = new TableAssert(null);
List list = new ArrayList<>(Arrays.asList(getValue(null, 7), getValue(null, 8)));
try {
AssertionsOnColumnContent.containsValues(tableAssert, info, list, 8, 7, 7);
diff --git a/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnColumnContent_ContainsValues_Object_Test.java b/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnColumnContent_ContainsValues_Object_Test.java
index f07b30f9..52846bff 100644
--- a/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnColumnContent_ContainsValues_Object_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnColumnContent_ContainsValues_Object_Test.java
@@ -12,7 +12,6 @@
*/
package org.assertj.db.api.assertions.impl;
-import static org.assertj.db.api.Assertions.assertThat;
import static org.junit.Assert.fail;
import java.util.ArrayList;
@@ -24,7 +23,6 @@
import org.assertj.core.api.WritableAssertionInfo;
import org.assertj.db.api.TableAssert;
import org.assertj.db.common.AbstractTest;
-import org.assertj.db.type.Table;
import org.assertj.db.type.Value;
import org.junit.Test;
@@ -42,8 +40,7 @@ public class AssertionsOnColumnContent_ContainsValues_Object_Test extends Abstra
@Test
public void test_contains_values() throws Exception {
WritableAssertionInfo info = new WritableAssertionInfo();
- Table table = new Table();
- TableAssert tableAssert = assertThat(table);
+ TableAssert tableAssert = new TableAssert(null);
List list = new ArrayList<>(Arrays.asList(getValue(null, Locale.FRENCH), getValue(null, Locale.ENGLISH), getValue(
null, Locale.FRENCH), getValue(null, null)));
TableAssert tableAssert2 = AssertionsOnColumnContent.containsValues(tableAssert, info, list, Locale.FRENCH, Locale.ENGLISH, Locale.FRENCH, null);
@@ -67,8 +64,7 @@ public void test_contains_values() throws Exception {
public void should_fail_because_values_are_different() throws Exception {
WritableAssertionInfo info = new WritableAssertionInfo();
info.description("description");
- Table table = new Table();
- TableAssert tableAssert = assertThat(table);
+ TableAssert tableAssert = new TableAssert(null);
List list = new ArrayList<>(Arrays.asList(getValue(null, Locale.FRENCH), getValue(null, Locale.ENGLISH), getValue(
null, Locale.FRENCH), getValue(null, null)));
try {
@@ -106,8 +102,7 @@ public void should_fail_because_values_are_different() throws Exception {
public void should_fail_because_one_value_is_not_of_class() throws Exception {
WritableAssertionInfo info = new WritableAssertionInfo();
info.description("description");
- Table table = new Table();
- TableAssert tableAssert = assertThat(table);
+ TableAssert tableAssert = new TableAssert(null);
List list = new ArrayList<>(Arrays.asList(getValue(null, "other"), getValue(null, Locale.FRENCH)));
try {
AssertionsOnColumnContent.containsValues(tableAssert, info, list, Locale.FRENCH, Locale.FRENCH);
@@ -129,8 +124,7 @@ public void should_fail_because_one_value_is_not_of_class() throws Exception {
public void should_fail_because_the_number_of_values_is_different() throws Exception {
WritableAssertionInfo info = new WritableAssertionInfo();
info.description("description");
- Table table = new Table();
- TableAssert tableAssert = assertThat(table);
+ TableAssert tableAssert = new TableAssert(null);
List list = new ArrayList<>(Arrays.asList(getValue(null, Locale.FRENCH), getValue(null, Boolean.FALSE)));
try {
AssertionsOnColumnContent.containsValues(tableAssert, info, list, Locale.FRENCH, Boolean.FALSE, Boolean.FALSE);
diff --git a/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnColumnContent_ContainsValues_String_Test.java b/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnColumnContent_ContainsValues_String_Test.java
index 0418bc32..84acaa94 100644
--- a/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnColumnContent_ContainsValues_String_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnColumnContent_ContainsValues_String_Test.java
@@ -12,7 +12,6 @@
*/
package org.assertj.db.api.assertions.impl;
-import static org.assertj.db.api.Assertions.assertThat;
import static org.junit.Assert.fail;
import java.util.ArrayList;
@@ -23,7 +22,6 @@
import org.assertj.core.api.WritableAssertionInfo;
import org.assertj.db.api.TableAssert;
import org.assertj.db.common.AbstractTest;
-import org.assertj.db.type.Table;
import org.assertj.db.type.Value;
import org.junit.Test;
@@ -41,8 +39,7 @@ public class AssertionsOnColumnContent_ContainsValues_String_Test extends Abstra
@Test
public void test_contains_values() throws Exception {
WritableAssertionInfo info = new WritableAssertionInfo();
- Table table = new Table();
- TableAssert tableAssert = assertThat(table);
+ TableAssert tableAssert = new TableAssert(null);
List list = new ArrayList<>(Arrays.asList(getValue(null, "test1"), getValue(null, "test2"), getValue(null,
"test1"), getValue(
null, null)));
@@ -61,8 +58,7 @@ public void test_contains_values() throws Exception {
public void should_fail_because_values_are_different() throws Exception {
WritableAssertionInfo info = new WritableAssertionInfo();
info.description("description");
- Table table = new Table();
- TableAssert tableAssert = assertThat(table);
+ TableAssert tableAssert = new TableAssert(null);
List list = new ArrayList<>(Arrays.asList(getValue(null, "test1"), getValue(null, "test2"), getValue(null,
"test1"), getValue(
null, null)));
@@ -100,8 +96,7 @@ public void should_fail_because_values_are_different() throws Exception {
public void should_fail_because_one_value_is_not_a_text() throws Exception {
WritableAssertionInfo info = new WritableAssertionInfo();
info.description("description");
- Table table = new Table();
- TableAssert tableAssert = assertThat(table);
+ TableAssert tableAssert = new TableAssert(null);
List list = new ArrayList<>(Arrays.asList(getValue(null, "other"), getValue(null, false)));
try {
AssertionsOnColumnContent.containsValues(tableAssert, info, list, "test1", "test2");
@@ -124,8 +119,7 @@ public void should_fail_because_one_value_is_not_a_text() throws Exception {
public void should_fail_because_the_number_of_values_is_different() throws Exception {
WritableAssertionInfo info = new WritableAssertionInfo();
info.description("description");
- Table table = new Table();
- TableAssert tableAssert = assertThat(table);
+ TableAssert tableAssert = new TableAssert(null);
List list = new ArrayList<>(Arrays.asList(getValue(null, "test1"), getValue(null, "test2")));
try {
AssertionsOnColumnContent.containsValues(tableAssert, info, list, "test1", "test2", "test2");
diff --git a/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnColumnContent_ContainsValues_TimeValue_Test.java b/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnColumnContent_ContainsValues_TimeValue_Test.java
index 1fad791a..630fbaaa 100644
--- a/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnColumnContent_ContainsValues_TimeValue_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnColumnContent_ContainsValues_TimeValue_Test.java
@@ -12,7 +12,6 @@
*/
package org.assertj.db.api.assertions.impl;
-import static org.assertj.db.api.Assertions.assertThat;
import static org.junit.Assert.fail;
import java.sql.Time;
@@ -24,7 +23,6 @@
import org.assertj.core.api.WritableAssertionInfo;
import org.assertj.db.api.TableAssert;
import org.assertj.db.common.AbstractTest;
-import org.assertj.db.type.Table;
import org.assertj.db.type.TimeValue;
import org.assertj.db.type.Value;
import org.junit.Test;
@@ -43,8 +41,7 @@ public class AssertionsOnColumnContent_ContainsValues_TimeValue_Test extends Abs
@Test
public void test_contains_values() throws Exception {
WritableAssertionInfo info = new WritableAssertionInfo();
- Table table = new Table();
- TableAssert tableAssert = assertThat(table);
+ TableAssert tableAssert = new TableAssert(null);
List list = new ArrayList<>(Arrays.asList(getValue(null, Time.valueOf("09:01:00")),
getValue(null, Time.valueOf("03:30:05")), getValue(null,
null)));
@@ -67,8 +64,7 @@ public void test_contains_values() throws Exception {
public void should_fail_because_values_are_different() throws Exception {
WritableAssertionInfo info = new WritableAssertionInfo();
info.description("description");
- Table table = new Table();
- TableAssert tableAssert = assertThat(table);
+ TableAssert tableAssert = new TableAssert(null);
List list = new ArrayList<>(Arrays.asList(getValue(null, Time.valueOf("09:01:00")),
getValue(null, Time.valueOf("03:30:05")), getValue(null, null)));
try {
@@ -94,8 +90,7 @@ public void should_fail_because_values_are_different() throws Exception {
public void should_fail_because_one_value_is_not_a_time() throws Exception {
WritableAssertionInfo info = new WritableAssertionInfo();
info.description("description");
- Table table = new Table();
- TableAssert tableAssert = assertThat(table);
+ TableAssert tableAssert = new TableAssert(null);
List list = new ArrayList<>(Arrays.asList(getValue(null, "other"), getValue(null, Time.valueOf("03:30:05"))));
try {
AssertionsOnColumnContent.containsValues(tableAssert, info, list,
@@ -120,8 +115,7 @@ public void should_fail_because_one_value_is_not_a_time() throws Exception {
public void should_fail_because_the_number_of_values_is_different() throws Exception {
WritableAssertionInfo info = new WritableAssertionInfo();
info.description("description");
- Table table = new Table();
- TableAssert tableAssert = assertThat(table);
+ TableAssert tableAssert = new TableAssert(null);
List list = new ArrayList<>(Arrays.asList(getValue(null, Time.valueOf("09:01:00")), getValue(null, Time.valueOf(
"03:30:05"))));
try {
diff --git a/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnColumnContent_ContainsValues_UUID_Test.java b/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnColumnContent_ContainsValues_UUID_Test.java
index 0952741b..944b00c2 100644
--- a/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnColumnContent_ContainsValues_UUID_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnColumnContent_ContainsValues_UUID_Test.java
@@ -12,7 +12,6 @@
*/
package org.assertj.db.api.assertions.impl;
-import static org.assertj.db.api.Assertions.assertThat;
import static org.junit.Assert.fail;
import java.util.ArrayList;
@@ -24,7 +23,6 @@
import org.assertj.core.api.WritableAssertionInfo;
import org.assertj.db.api.TableAssert;
import org.assertj.db.common.AbstractTest;
-import org.assertj.db.type.Table;
import org.assertj.db.type.Value;
import org.junit.Test;
@@ -42,8 +40,7 @@ public class AssertionsOnColumnContent_ContainsValues_UUID_Test extends Abstract
@Test
public void test_contains_values() throws Exception {
WritableAssertionInfo info = new WritableAssertionInfo();
- Table table = new Table();
- TableAssert tableAssert = assertThat(table);
+ TableAssert tableAssert = new TableAssert(null);
List list = new ArrayList<>(Arrays.asList(
getValue(null, UUID.fromString("30B443AE-C0C9-4790-9BEC-CE1380808435")),
getValue(null, UUID.fromString("30B443AE-C0C9-4790-9BEC-CE1380808435")),
@@ -76,8 +73,7 @@ public void test_contains_values() throws Exception {
public void should_fail_because_values_are_different() throws Exception {
WritableAssertionInfo info = new WritableAssertionInfo();
info.description("description");
- Table table = new Table();
- TableAssert tableAssert = assertThat(table);
+ TableAssert tableAssert = new TableAssert(null);
List list = new ArrayList<>(Arrays.asList(
getValue(null, UUID.fromString("30B443AE-C0C9-4790-9BEC-CE1380808435")),
getValue(null, UUID.fromString("30B443AE-C0C9-4790-9BEC-CE1380808435")),
@@ -134,8 +130,7 @@ public void should_fail_because_values_are_different() throws Exception {
public void should_fail_because_one_value_is_not_a_uuid() throws Exception {
WritableAssertionInfo info = new WritableAssertionInfo();
info.description("description");
- Table table = new Table();
- TableAssert tableAssert = assertThat(table);
+ TableAssert tableAssert = new TableAssert(null);
List list = new ArrayList<>(Arrays.asList(getValue(null, "other"),
getValue(null, UUID.fromString("30B443AE-C0C9-4790-9BEC-CE1380808435"))));
try {
@@ -159,8 +154,7 @@ public void should_fail_because_one_value_is_not_a_uuid() throws Exception {
public void should_fail_because_the_number_of_values_is_different() throws Exception {
WritableAssertionInfo info = new WritableAssertionInfo();
info.description("description");
- Table table = new Table();
- TableAssert tableAssert = assertThat(table);
+ TableAssert tableAssert = new TableAssert(null);
List list = new ArrayList<>(Arrays.asList(getValue(null, UUID.fromString("30B443AE-C0C9-4790-9BEC-CE1380808435")),
getValue(null, UUID.fromString("30B443AE-C0C9-4790-9BEC-CE1380808435"))));
try {
diff --git a/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnColumnEquality_HasValues_Boolean_Test.java b/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnColumnEquality_HasValues_Boolean_Test.java
index ea8102fd..93b940e4 100644
--- a/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnColumnEquality_HasValues_Boolean_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnColumnEquality_HasValues_Boolean_Test.java
@@ -13,7 +13,6 @@
package org.assertj.db.api.assertions.impl;
import static org.assertj.core.api.Assertions.assertThat;
-import static org.assertj.db.api.Assertions.assertThat;
import static org.junit.Assert.fail;
import java.util.ArrayList;
@@ -23,7 +22,6 @@
import org.assertj.core.api.WritableAssertionInfo;
import org.assertj.db.api.TableAssert;
import org.assertj.db.common.AbstractTest;
-import org.assertj.db.type.Table;
import org.assertj.db.type.Value;
import org.junit.Test;
@@ -41,8 +39,7 @@ public class AssertionsOnColumnEquality_HasValues_Boolean_Test extends AbstractT
@Test
public void test_has_values() throws Exception {
WritableAssertionInfo info = new WritableAssertionInfo();
- Table table = new Table();
- TableAssert tableAssert = assertThat(table);
+ TableAssert tableAssert = new TableAssert(null);
List list = new ArrayList<>(Arrays.asList(getValue(null, true), getValue(null, false), getValue(null, null)));
TableAssert tableAssert2 = AssertionsOnColumnEquality.hasValues(tableAssert, info, list, Boolean.TRUE,
Boolean.FALSE, null);
@@ -56,8 +53,7 @@ public void test_has_values() throws Exception {
public void should_fail_because_values_are_different() throws Exception {
WritableAssertionInfo info = new WritableAssertionInfo();
info.description("description");
- Table table = new Table();
- TableAssert tableAssert = assertThat(table);
+ TableAssert tableAssert = new TableAssert(null);
List list = new ArrayList<>(Arrays.asList(getValue(null, false), getValue(null, false)));
try {
AssertionsOnColumnEquality.hasValues(tableAssert, info, list, Boolean.TRUE, Boolean.FALSE);
@@ -78,8 +74,7 @@ public void should_fail_because_values_are_different() throws Exception {
public void should_fail_because_one_value_is_not_a_boolean() throws Exception {
WritableAssertionInfo info = new WritableAssertionInfo();
info.description("description");
- Table table = new Table();
- TableAssert tableAssert = assertThat(table);
+ TableAssert tableAssert = new TableAssert(null);
List list = new ArrayList<>(Arrays.asList(getValue(null, "other"), getValue(null, false)));
try {
AssertionsOnColumnEquality.hasValues(tableAssert, info, list, Boolean.TRUE, Boolean.FALSE);
@@ -102,8 +97,7 @@ public void should_fail_because_one_value_is_not_a_boolean() throws Exception {
public void should_fail_because_the_number_of_values_is_different() throws Exception {
WritableAssertionInfo info = new WritableAssertionInfo();
info.description("description");
- Table table = new Table();
- TableAssert tableAssert = assertThat(table);
+ TableAssert tableAssert = new TableAssert(null);
List list = new ArrayList<>(Arrays.asList(getValue(null, true), getValue(null, false)));
try {
AssertionsOnColumnEquality.hasValues(tableAssert, info, list, Boolean.TRUE, Boolean.FALSE, Boolean.FALSE);
diff --git a/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnColumnEquality_HasValues_Bytes_Test.java b/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnColumnEquality_HasValues_Bytes_Test.java
index 50a5e228..d4444191 100644
--- a/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnColumnEquality_HasValues_Bytes_Test.java
+++ b/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnColumnEquality_HasValues_Bytes_Test.java
@@ -12,7 +12,6 @@
*/
package org.assertj.db.api.assertions.impl;
-import static org.assertj.db.api.Assertions.assertThat;
import static org.junit.Assert.fail;
import java.util.ArrayList;
@@ -23,7 +22,6 @@
import org.assertj.core.api.WritableAssertionInfo;
import org.assertj.db.api.TableAssert;
import org.assertj.db.common.AbstractTest;
-import org.assertj.db.type.Table;
import org.assertj.db.type.Value;
import org.junit.Test;
@@ -41,8 +39,7 @@ public class AssertionsOnColumnEquality_HasValues_Bytes_Test extends AbstractTes
@Test
public void test_has_values() throws Exception {
WritableAssertionInfo info = new WritableAssertionInfo();
- Table table = new Table();
- TableAssert tableAssert = assertThat(table);
+ TableAssert tableAssert = new TableAssert(null);
List list = new ArrayList<>(Arrays.asList(getValue(null, new byte[]{0, 1}), getValue(null, new byte[]{2, 3})));
TableAssert tableAssert2 = AssertionsOnColumnEquality.hasValues(tableAssert, info, list, new byte[]{0, 1},
new byte[]{2, 3});
@@ -56,8 +53,7 @@ public void test_has_values() throws Exception {
public void should_fail_because_values_are_different() throws Exception {
WritableAssertionInfo info = new WritableAssertionInfo();
info.description("description");
- Table table = new Table();
- TableAssert tableAssert = assertThat(table);
+ TableAssert tableAssert = new TableAssert(null);
List list = new ArrayList<>(Arrays.asList(getValue(null, new byte[]{0, 1}), getValue(null, new byte[]{2, 3}), getValue(
null, null)));
try {
@@ -76,8 +72,7 @@ public void should_fail_because_values_are_different() throws Exception {
public void should_fail_because_one_value_is_not_bytes() throws Exception {
WritableAssertionInfo info = new WritableAssertionInfo();
info.description("description");
- Table table = new Table();
- TableAssert tableAssert = assertThat(table);
+ TableAssert tableAssert = new TableAssert(null);
List list = new ArrayList<>(Arrays.asList(getValue(null, "other"), getValue(null, new byte[]{2, 3})));
try {
AssertionsOnColumnEquality.hasValues(tableAssert, info, list, new byte[]{0, 1}, new byte[]{2, 3});
@@ -100,8 +95,7 @@ public void should_fail_because_one_value_is_not_bytes() throws Exception {
public void should_fail_because_the_number_of_values_is_different() throws Exception {
WritableAssertionInfo info = new WritableAssertionInfo();
info.description("description");
- Table table = new Table();
- TableAssert tableAssert = assertThat(table);
+ TableAssert tableAssert = new TableAssert(null);
List