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 list = new ArrayList<>(Arrays.asList(getValue(null, new byte[]{0, 1}), getValue(null, new byte[]{2, 3}))); try { AssertionsOnColumnEquality.hasValues(tableAssert, info, list, new byte[]{0, 1}, new byte[]{2, 3}, diff --git a/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnColumnEquality_HasValues_Character_Test.java b/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnColumnEquality_HasValues_Character_Test.java index 94309097..b37bb6b4 100644 --- a/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnColumnEquality_HasValues_Character_Test.java +++ b/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnColumnEquality_HasValues_Character_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_Character_Test extends Abstrac @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, 'T'), getValue(null, "t"), getValue(null, null))); TableAssert tableAssert2 = AssertionsOnColumnEquality.hasValues(tableAssert, info, list, 'T', 't', 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, 'T'), getValue(null, 'T'))); try { AssertionsOnColumnEquality.hasValues(tableAssert, info, list, 't', 'T'); @@ -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, "T"), getValue(null, false))); try { AssertionsOnColumnEquality.hasValues(tableAssert, info, list, 'T', 't'); @@ -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, 'T'), getValue(null, 't'))); try { AssertionsOnColumnEquality.hasValues(tableAssert, info, list, 'T', 't', 'T'); diff --git a/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnColumnEquality_HasValues_DateTimeValue_Test.java b/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnColumnEquality_HasValues_DateTimeValue_Test.java index dd5cc42d..5fa76dcb 100644 --- a/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnColumnEquality_HasValues_DateTimeValue_Test.java +++ b/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnColumnEquality_HasValues_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.Date; @@ -27,7 +26,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; @@ -46,8 +44,7 @@ public class AssertionsOnColumnEquality_HasValues_DateTimeValue_Test extends Abs @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, Timestamp.valueOf("2007-12-23 09:01:00")), getValue(null, Timestamp.valueOf("2002-07-25 03:30:05")), getValue(null, null))); @@ -74,8 +71,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); try { 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")))); @@ -113,8 +109,7 @@ public void should_fail_because_values_are_different() throws Exception { public void should_fail_because_one_value_is_not_a_datetime() 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, Timestamp.valueOf("2002-07-25 03:30:05")))); try { @@ -140,8 +135,7 @@ public void should_fail_because_one_value_is_not_a_datetime() 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/AssertionsOnColumnEquality_HasValues_DateValue_Test.java b/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnColumnEquality_HasValues_DateValue_Test.java index 10ea509e..02f06564 100644 --- a/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnColumnEquality_HasValues_DateValue_Test.java +++ b/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnColumnEquality_HasValues_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; @@ -26,7 +25,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; @@ -44,8 +42,7 @@ public class AssertionsOnColumnEquality_HasValues_DateValue_Test extends Abstrac @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, Date.valueOf("2007-12-23")), getValue( null, Date.valueOf("2002-07-25")), getValue(null, null))); TableAssert tableAssert2 = AssertionsOnColumnEquality.hasValues(tableAssert, info, list, DateValue.of(2007, 12, 23), @@ -66,8 +63,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); try { List list = new ArrayList<>(Arrays.asList(getValue(null, Date.valueOf("2007-12-23")), getValue(null, Date.valueOf( "2002-07-25")))); @@ -103,8 +99,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, false), getValue(null, Date.valueOf("2002-07-25")))); try { AssertionsOnColumnEquality.hasValues(tableAssert, info, list, DateValue.of(2007, 12, 23), @@ -128,8 +123,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/AssertionsOnColumnEquality_HasValues_Number_Test.java b/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnColumnEquality_HasValues_Number_Test.java index 3953067a..bc69d0dc 100644 --- a/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnColumnEquality_HasValues_Number_Test.java +++ b/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnColumnEquality_HasValues_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 AssertionsOnColumnEquality_HasValues_Number_Test extends AbstractTe @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, 7), getValue(null, 8), getValue(null, null))); TableAssert tableAssert2 = AssertionsOnColumnEquality.hasValues(tableAssert, info, list, 7, 8, null); Assertions.assertThat(tableAssert2).isSameAs(tableAssert); @@ -55,8 +52,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, 8), getValue(null, 8))); try { AssertionsOnColumnEquality.hasValues(tableAssert, info, list, 7, 8); @@ -77,8 +73,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 { AssertionsOnColumnEquality.hasValues(tableAssert, info, list, 7, 8); @@ -101,8 +96,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 { AssertionsOnColumnEquality.hasValues(tableAssert, info, list, 7, 8, 8); diff --git a/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnColumnEquality_HasValues_Object_Test.java b/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnColumnEquality_HasValues_Object_Test.java index 5e690973..08dcd5ca 100644 --- a/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnColumnEquality_HasValues_Object_Test.java +++ b/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnColumnEquality_HasValues_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 AssertionsOnColumnEquality_HasValues_Object_Test extends AbstractTe @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, Locale.FRENCH), getValue(null, Locale.ENGLISH), getValue( null, null))); TableAssert tableAssert2 = AssertionsOnColumnEquality.hasValues(tableAssert, info, list, Locale.FRENCH, Locale.ENGLISH, null); @@ -57,8 +54,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, Locale.ENGLISH), getValue(null, Locale.ENGLISH))); List list2 = new ArrayList<>(Arrays.asList(getValue(null, null), getValue(null, Locale.ENGLISH))); try { @@ -100,8 +96,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.ENGLISH))); try { AssertionsOnColumnEquality.hasValues(tableAssert, info, list, Locale.FRENCH, Locale.ENGLISH); @@ -124,8 +119,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, Locale.ENGLISH))); try { AssertionsOnColumnEquality.hasValues(tableAssert, info, list, Locale.FRENCH, Locale.ENGLISH, Locale.ENGLISH); diff --git a/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnColumnEquality_HasValues_String_Test.java b/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnColumnEquality_HasValues_String_Test.java index 8fc773c0..63dfef07 100644 --- a/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnColumnEquality_HasValues_String_Test.java +++ b/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnColumnEquality_HasValues_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.sql.Date; @@ -26,7 +25,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; @@ -44,8 +42,7 @@ public class AssertionsOnColumnEquality_HasValues_String_Test extends AbstractTe @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, "test1"), getValue(null, "test2"), getValue(null, null))); TableAssert tableAssert2 = AssertionsOnColumnEquality.hasValues(tableAssert, info, list, "test1", "test2", null); @@ -75,8 +72,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); try { List list = new ArrayList<>(Arrays.asList(getValue(null, "test"), getValue(null, "test2"))); AssertionsOnColumnEquality.hasValues(tableAssert, info, list, "test1", "test2"); @@ -144,8 +140,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, false), getValue(null, "test2"))); try { AssertionsOnColumnEquality.hasValues(tableAssert, info, list, "test1", "test2"); @@ -168,8 +163,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 { AssertionsOnColumnEquality.hasValues(tableAssert, info, list, "test1", "test2", "test3"); diff --git a/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnColumnEquality_HasValues_TimeValue_Test.java b/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnColumnEquality_HasValues_TimeValue_Test.java index ea7d9532..c1a9cd2f 100644 --- a/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnColumnEquality_HasValues_TimeValue_Test.java +++ b/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnColumnEquality_HasValues_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 AssertionsOnColumnEquality_HasValues_TimeValue_Test extends Abstrac @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, Time.valueOf("09:01:00")), getValue( null, Time.valueOf("03:30:05")), getValue(null, null))); TableAssert tableAssert2 = AssertionsOnColumnEquality.hasValues(tableAssert, info, list, @@ -59,8 +56,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); try { List list = new ArrayList<>(Arrays.asList(getValue(null, Time.valueOf("09:01:00")), getValue(null, Time.valueOf( "03:30:05")))); @@ -82,8 +78,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, false), getValue(null, Time.valueOf("03:30:05")))); try { AssertionsOnColumnEquality.hasValues(tableAssert, info, list, TimeValue.of(9, 1), TimeValue.of(3, 30, 5)); @@ -106,8 +101,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/AssertionsOnColumnEquality_HasValues_UUID_Test.java b/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnColumnEquality_HasValues_UUID_Test.java index 4d96ded3..94af6d13 100644 --- a/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnColumnEquality_HasValues_UUID_Test.java +++ b/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnColumnEquality_HasValues_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 AssertionsOnColumnEquality_HasValues_UUID_Test extends AbstractTest @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, UUID.fromString("30B443AE-C0C9-4790-9BEC-CE1380808435")), getValue(null, UUID.fromString("30B443AE-C0C9-4790-9BEC-CE1380808435")), @@ -64,8 +61,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); try { List list = new ArrayList<>(Arrays.asList( getValue(null, UUID.fromString("30B443AE-C0C9-4790-9BEC-CE1380808435")), @@ -90,8 +86,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, false), getValue(null, UUID.fromString("30B443AE-C0C9-4790-9BEC-CE1380808435")))); try { @@ -117,8 +112,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/AssertionsOnColumnName_HasColumnName_Test.java b/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnColumnName_HasColumnName_Test.java index 114a8df1..a0d62313 100644 --- a/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnColumnName_HasColumnName_Test.java +++ b/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnColumnName_HasColumnName_Test.java @@ -12,13 +12,11 @@ */ 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; -import org.assertj.db.type.Table; import org.assertj.db.type.lettercase.LetterCase; import org.junit.Test; @@ -36,8 +34,7 @@ public class AssertionsOnColumnName_HasColumnName_Test { @Test public void test_has_column_name() { WritableAssertionInfo info = new WritableAssertionInfo(); - Table table = new Table(); - TableAssert tableAssert = assertThat(table); + TableAssert tableAssert = new TableAssert(null); TableAssert tableAssert2 = AssertionsOnColumnName.hasColumnName(tableAssert, info, "test", "test", LetterCase.COLUMN_DEFAULT); Assertions.assertThat(tableAssert2).isSameAs(tableAssert); } @@ -49,8 +46,7 @@ public void test_has_column_name() { public void should_fail_because_column_name_is_different() { WritableAssertionInfo info = new WritableAssertionInfo(); info.description("description"); - Table table = new Table(); - TableAssert tableAssert = assertThat(table); + TableAssert tableAssert = new TableAssert(null); try { AssertionsOnColumnName.hasColumnName(tableAssert, info, "test1", "test", LetterCase.COLUMN_DEFAULT); fail("An exception must be raised"); @@ -70,8 +66,7 @@ public void should_fail_because_column_name_is_different() { public void should_fail_because_column_name_is_null() { WritableAssertionInfo info = new WritableAssertionInfo(); info.description("description"); - Table table = new Table(); - TableAssert tableAssert = assertThat(table); + TableAssert tableAssert = new TableAssert(null); try { AssertionsOnColumnName.hasColumnName(tableAssert, info, "test", null, LetterCase.COLUMN_DEFAULT); fail("An exception must be raised"); diff --git a/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnColumnOfChangeClass_IsOfClass_Test.java b/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnColumnOfChangeClass_IsOfClass_Test.java index d7aaf232..8fcf525b 100644 --- a/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnColumnOfChangeClass_IsOfClass_Test.java +++ b/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnColumnOfChangeClass_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 org.assertj.core.api.Assertions; @@ -20,7 +19,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.junit.Test; /** @@ -37,8 +35,7 @@ public class AssertionsOnColumnOfChangeClass_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); TableAssert tableAssert2 = AssertionsOnColumnOfChangeClass.isOfClass(tableAssert, info, getValue(null, "test"), getValue(null, "test"), @@ -68,8 +65,7 @@ public void test_is_of_type() throws Exception { public void should_fail_because_value_at_start_point_have_different_type() throws Exception { WritableAssertionInfo info = new WritableAssertionInfo(); info.description("description"); - Table table = new Table(); - TableAssert tableAssert = assertThat(table); + TableAssert tableAssert = new TableAssert(null); try { AssertionsOnColumnOfChangeClass.isOfClass(tableAssert, info, getValue(null, 8), @@ -120,8 +116,7 @@ public void should_fail_because_value_at_start_point_have_different_type() throw public void should_fail_because_value_at_end_point_have_different_type() throws Exception { WritableAssertionInfo info = new WritableAssertionInfo(); info.description("description"); - Table table = new Table(); - TableAssert tableAssert = assertThat(table); + TableAssert tableAssert = new TableAssert(null); try { AssertionsOnColumnOfChangeClass.isOfClass(tableAssert, info, getValue(null, "test"), @@ -172,8 +167,7 @@ public void should_fail_because_value_at_end_point_have_different_type() throws public void should_fail_because_value_at_start_point_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 { AssertionsOnColumnOfChangeClass.isOfClass(tableAssert, info, getValue(null, new StringBuilder("test")), @@ -213,8 +207,7 @@ public void should_fail_because_value_at_start_point_is_a_stringbuilder() throws public void should_fail_because_value_at_end_point_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 { AssertionsOnColumnOfChangeClass.isOfClass(tableAssert, info, getValue(null, "test"), @@ -254,8 +247,7 @@ public void should_fail_because_value_at_end_point_is_a_stringbuilder() throws E 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); try { AssertionsOnColumnOfChangeClass.isOfClass(tableAssert, info, getValue(null, "test"), diff --git a/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnColumnOfChangeEquality_HasValues_One_Boolean_Test.java b/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnColumnOfChangeEquality_HasValues_One_Boolean_Test.java index 2d6d6556..5e4f26c3 100644 --- a/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnColumnOfChangeEquality_HasValues_One_Boolean_Test.java +++ b/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnColumnOfChangeEquality_HasValues_One_Boolean_Test.java @@ -12,14 +12,12 @@ */ 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; import org.assertj.db.common.AbstractTest; -import org.assertj.db.type.Table; import org.junit.Test; /** @@ -36,8 +34,7 @@ public class AssertionsOnColumnOfChangeEquality_HasValues_One_Boolean_Test exten @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); TableAssert tableAssert2 = AssertionsOnColumnOfChangeEquality.hasValues(tableAssert, info, getValue(null, true), getValue(null, true), @@ -52,8 +49,7 @@ public void test_has_values() throws Exception { public void should_fail_because_value_at_start_point_is_different() throws Exception { WritableAssertionInfo info = new WritableAssertionInfo(); info.description("description"); - Table table = new Table(); - TableAssert tableAssert = assertThat(table); + TableAssert tableAssert = new TableAssert(null); try { AssertionsOnColumnOfChangeEquality.hasValues(tableAssert, info, getValue(null, false), @@ -76,8 +72,7 @@ public void should_fail_because_value_at_start_point_is_different() throws Excep public void should_fail_because_value_at_end_point_is_different() throws Exception { WritableAssertionInfo info = new WritableAssertionInfo(); info.description("description"); - Table table = new Table(); - TableAssert tableAssert = assertThat(table); + TableAssert tableAssert = new TableAssert(null); try { AssertionsOnColumnOfChangeEquality.hasValues(tableAssert, info, getValue(null, false), @@ -100,8 +95,7 @@ public void should_fail_because_value_at_end_point_is_different() throws Excepti 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); try { AssertionsOnColumnOfChangeEquality.hasValues(tableAssert, info, getValue(null, "other"), diff --git a/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnColumnOfChangeEquality_HasValues_One_Bytes_Test.java b/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnColumnOfChangeEquality_HasValues_One_Bytes_Test.java index 775a4959..96cea9d1 100644 --- a/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnColumnOfChangeEquality_HasValues_One_Bytes_Test.java +++ b/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnColumnOfChangeEquality_HasValues_One_Bytes_Test.java @@ -12,14 +12,12 @@ */ 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; import org.assertj.db.common.AbstractTest; -import org.assertj.db.type.Table; import org.junit.Test; /** @@ -36,8 +34,7 @@ public class AssertionsOnColumnOfChangeEquality_HasValues_One_Bytes_Test extends @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); TableAssert tableAssert2 = AssertionsOnColumnOfChangeEquality.hasValues(tableAssert, info, getValue(null, new byte[]{0, 1}), getValue(null, new byte[]{0, 1}), new byte[]{0, 1}); Assertions.assertThat(tableAssert2).isSameAs(tableAssert); @@ -50,8 +47,7 @@ public void test_has_values() throws Exception { public void should_fail_because_value_at_start_point_is_different() throws Exception { WritableAssertionInfo info = new WritableAssertionInfo(); info.description("description"); - Table table = new Table(); - TableAssert tableAssert = assertThat(table); + TableAssert tableAssert = new TableAssert(null); try { AssertionsOnColumnOfChangeEquality.hasValues(tableAssert, info, getValue(null, new byte[]{0, 1}), getValue( null, new byte[]{2, 3}), @@ -70,8 +66,7 @@ public void should_fail_because_value_at_start_point_is_different() throws Excep public void should_fail_because_value_at_end_point_is_different() throws Exception { WritableAssertionInfo info = new WritableAssertionInfo(); info.description("description"); - Table table = new Table(); - TableAssert tableAssert = assertThat(table); + TableAssert tableAssert = new TableAssert(null); try { AssertionsOnColumnOfChangeEquality.hasValues(tableAssert, info, getValue(null, new byte[]{0, 1}), getValue( null, new byte[]{2, 3}), @@ -90,8 +85,7 @@ public void should_fail_because_value_at_end_point_is_different() throws Excepti 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); try { AssertionsOnColumnOfChangeEquality.hasValues(tableAssert, info, getValue(null, "other"), getValue(null, new byte[]{2, 3}), new byte[]{0, 1}); fail("An exception must be raised"); diff --git a/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnColumnOfChangeEquality_HasValues_One_Character_Test.java b/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnColumnOfChangeEquality_HasValues_One_Character_Test.java index 54f8d74b..531f6101 100644 --- a/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnColumnOfChangeEquality_HasValues_One_Character_Test.java +++ b/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnColumnOfChangeEquality_HasValues_One_Character_Test.java @@ -12,14 +12,12 @@ */ 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; import org.assertj.db.common.AbstractTest; -import org.assertj.db.type.Table; import org.junit.Test; /** @@ -36,8 +34,7 @@ public class AssertionsOnColumnOfChangeEquality_HasValues_One_Character_Test ext @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); TableAssert tableAssert2 = AssertionsOnColumnOfChangeEquality.hasValues(tableAssert, info, getValue(null, 'T'), getValue(null, 'T'), @@ -67,8 +64,7 @@ public void test_has_values() throws Exception { public void should_fail_because_value_at_start_point_is_different() throws Exception { WritableAssertionInfo info = new WritableAssertionInfo(); info.description("description"); - Table table = new Table(); - TableAssert tableAssert = assertThat(table); + TableAssert tableAssert = new TableAssert(null); try { AssertionsOnColumnOfChangeEquality.hasValues(tableAssert, info, getValue(null, 't'), @@ -117,8 +113,7 @@ public void should_fail_because_value_at_start_point_is_different() throws Excep public void should_fail_because_value_at_end_point_is_different() throws Exception { WritableAssertionInfo info = new WritableAssertionInfo(); info.description("description"); - Table table = new Table(); - TableAssert tableAssert = assertThat(table); + TableAssert tableAssert = new TableAssert(null); try { AssertionsOnColumnOfChangeEquality.hasValues(tableAssert, info, getValue(null, 'T'), @@ -167,8 +162,7 @@ public void should_fail_because_value_at_end_point_is_different() throws Excepti 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); try { AssertionsOnColumnOfChangeEquality.hasValues(tableAssert, info, getValue(null, "T"), diff --git a/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnColumnOfChangeEquality_HasValues_One_DateTimeValue_Test.java b/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnColumnOfChangeEquality_HasValues_One_DateTimeValue_Test.java index 30163e10..44f1a303 100644 --- a/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnColumnOfChangeEquality_HasValues_One_DateTimeValue_Test.java +++ b/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnColumnOfChangeEquality_HasValues_One_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.Date; @@ -24,7 +23,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.junit.Test; @@ -42,8 +40,7 @@ public class AssertionsOnColumnOfChangeEquality_HasValues_One_DateTimeValue_Test @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); TableAssert tableAssert2 = AssertionsOnColumnOfChangeEquality.hasValues(tableAssert, info, getValue(null, Timestamp.valueOf( "2007-12-23 09:01:00")), @@ -67,8 +64,7 @@ public void test_has_values() throws Exception { public void should_fail_because_value_at_start_point_is_different() throws Exception { WritableAssertionInfo info = new WritableAssertionInfo(); info.description("description"); - Table table = new Table(); - TableAssert tableAssert = assertThat(table); + TableAssert tableAssert = new TableAssert(null); try { AssertionsOnColumnOfChangeEquality.hasValues(tableAssert, info, getValue(null, Timestamp.valueOf("2007-12-23 09:01:05")), @@ -104,8 +100,7 @@ public void should_fail_because_value_at_start_point_is_different() throws Excep public void should_fail_because_value_at_end_point_is_different() throws Exception { WritableAssertionInfo info = new WritableAssertionInfo(); info.description("description"); - Table table = new Table(); - TableAssert tableAssert = assertThat(table); + TableAssert tableAssert = new TableAssert(null); try { AssertionsOnColumnOfChangeEquality.hasValues(tableAssert, info, getValue(null, Timestamp.valueOf("2007-12-23 09:01:00")), @@ -141,8 +136,7 @@ public void should_fail_because_value_at_end_point_is_different() throws Excepti 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); try { AssertionsOnColumnOfChangeEquality.hasValues(tableAssert, info, getValue(null, "other"), diff --git a/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnColumnOfChangeEquality_HasValues_One_DateValue_Test.java b/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnColumnOfChangeEquality_HasValues_One_DateValue_Test.java index 2a704ca5..67feaf69 100644 --- a/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnColumnOfChangeEquality_HasValues_One_DateValue_Test.java +++ b/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnColumnOfChangeEquality_HasValues_One_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; @@ -23,7 +22,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.junit.Test; /** @@ -40,8 +38,7 @@ public class AssertionsOnColumnOfChangeEquality_HasValues_One_DateValue_Test ext @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); TableAssert tableAssert2 = AssertionsOnColumnOfChangeEquality.hasValues(tableAssert, info, getValue(null, Date.valueOf("2007-12-23")), getValue(null, Date.valueOf("2007-12-23")), @@ -61,8 +58,7 @@ public void test_has_values() throws Exception { public void should_fail_because_value_at_start_point_is_different() throws Exception { WritableAssertionInfo info = new WritableAssertionInfo(); info.description("description"); - Table table = new Table(); - TableAssert tableAssert = assertThat(table); + TableAssert tableAssert = new TableAssert(null); try { AssertionsOnColumnOfChangeEquality.hasValues(tableAssert, info, getValue(null, Date.valueOf("2007-12-23")), @@ -98,8 +94,7 @@ public void should_fail_because_value_at_start_point_is_different() throws Excep public void should_fail_because_value_at_end_point_is_different() throws Exception { WritableAssertionInfo info = new WritableAssertionInfo(); info.description("description"); - Table table = new Table(); - TableAssert tableAssert = assertThat(table); + TableAssert tableAssert = new TableAssert(null); try { AssertionsOnColumnOfChangeEquality.hasValues(tableAssert, info, getValue(null, Date.valueOf("2007-12-23")), @@ -135,8 +130,7 @@ public void should_fail_because_value_at_end_point_is_different() throws Excepti 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); try { AssertionsOnColumnOfChangeEquality.hasValues(tableAssert, info, getValue(null, "other"), diff --git a/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnColumnOfChangeEquality_HasValues_One_Number_Test.java b/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnColumnOfChangeEquality_HasValues_One_Number_Test.java index 1005cffe..a691345d 100644 --- a/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnColumnOfChangeEquality_HasValues_One_Number_Test.java +++ b/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnColumnOfChangeEquality_HasValues_One_Number_Test.java @@ -12,14 +12,12 @@ */ 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; import org.assertj.db.common.AbstractTest; -import org.assertj.db.type.Table; import org.junit.Test; /** @@ -36,8 +34,7 @@ public class AssertionsOnColumnOfChangeEquality_HasValues_One_Number_Test extend @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); TableAssert tableAssert2 = AssertionsOnColumnOfChangeEquality.hasValues(tableAssert, info, getValue(null, 1), getValue(null, 1), @@ -52,8 +49,7 @@ public void test_has_values() throws Exception { public void should_fail_because_value_at_start_point_is_different() throws Exception { WritableAssertionInfo info = new WritableAssertionInfo(); info.description("description"); - Table table = new Table(); - TableAssert tableAssert = assertThat(table); + TableAssert tableAssert = new TableAssert(null); try { AssertionsOnColumnOfChangeEquality.hasValues(tableAssert, info, getValue(null, 0), @@ -75,8 +71,7 @@ public void should_fail_because_value_at_start_point_is_different() throws Excep public void should_fail_because_value_at_end_point_is_different() throws Exception { WritableAssertionInfo info = new WritableAssertionInfo(); info.description("description"); - Table table = new Table(); - TableAssert tableAssert = assertThat(table); + TableAssert tableAssert = new TableAssert(null); try { AssertionsOnColumnOfChangeEquality.hasValues(tableAssert, info, getValue(null, 1), @@ -98,8 +93,7 @@ public void should_fail_because_value_at_end_point_is_different() throws Excepti 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); try { AssertionsOnColumnOfChangeEquality.hasValues(tableAssert, info, getValue(null, "other"), diff --git a/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnColumnOfChangeEquality_HasValues_One_Object_Test.java b/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnColumnOfChangeEquality_HasValues_One_Object_Test.java index b7cecb54..f48c0205 100644 --- a/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnColumnOfChangeEquality_HasValues_One_Object_Test.java +++ b/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnColumnOfChangeEquality_HasValues_One_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.Locale; @@ -21,7 +20,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.junit.Test; /** @@ -38,8 +36,7 @@ public class AssertionsOnColumnOfChangeEquality_HasValues_One_Object_Test extend @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); TableAssert tableAssert2 = AssertionsOnColumnOfChangeEquality.hasValues(tableAssert, info, getValue(null, Locale.FRENCH), getValue(null, Locale.FRENCH), @@ -59,8 +56,7 @@ public void test_has_values() throws Exception { public void should_fail_because_value_at_start_point_is_different() throws Exception { WritableAssertionInfo info = new WritableAssertionInfo(); info.description("description"); - Table table = new Table(); - TableAssert tableAssert = assertThat(table); + TableAssert tableAssert = new TableAssert(null); try { AssertionsOnColumnOfChangeEquality.hasValues(tableAssert, info, getValue(null, Locale.ENGLISH), @@ -96,8 +92,7 @@ public void should_fail_because_value_at_start_point_is_different() throws Excep public void should_fail_because_value_at_end_point_is_different() throws Exception { WritableAssertionInfo info = new WritableAssertionInfo(); info.description("description"); - Table table = new Table(); - TableAssert tableAssert = assertThat(table); + TableAssert tableAssert = new TableAssert(null); try { AssertionsOnColumnOfChangeEquality.hasValues(tableAssert, info, getValue(null, Locale.FRENCH), @@ -120,8 +115,7 @@ public void should_fail_because_value_at_end_point_is_different() throws Excepti public void should_fail_because_one_value_is_not_a_object() throws Exception { WritableAssertionInfo info = new WritableAssertionInfo(); info.description("description"); - Table table = new Table(); - TableAssert tableAssert = assertThat(table); + TableAssert tableAssert = new TableAssert(null); try { AssertionsOnColumnOfChangeEquality.hasValues(tableAssert, info, getValue(null, "other"), diff --git a/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnColumnOfChangeEquality_HasValues_One_String_Test.java b/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnColumnOfChangeEquality_HasValues_One_String_Test.java index 7f090cab..712cf2fc 100644 --- a/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnColumnOfChangeEquality_HasValues_One_String_Test.java +++ b/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnColumnOfChangeEquality_HasValues_One_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.sql.Date; @@ -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.junit.Test; /** @@ -40,8 +38,7 @@ public class AssertionsOnColumnOfChangeEquality_HasValues_One_String_Test extend @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); TableAssert tableAssert2 = AssertionsOnColumnOfChangeEquality.hasValues(tableAssert, info, getValue(null, "test1"), getValue(null, "test1"), @@ -76,8 +73,7 @@ public void test_has_values() throws Exception { public void should_fail_because_value_at_start_point_is_different() throws Exception { WritableAssertionInfo info = new WritableAssertionInfo(); info.description("description"); - Table table = new Table(); - TableAssert tableAssert = assertThat(table); + TableAssert tableAssert = new TableAssert(null); try { AssertionsOnColumnOfChangeEquality.hasValues(tableAssert, info, getValue(null, "test1"), @@ -152,8 +148,7 @@ public void should_fail_because_value_at_start_point_is_different() throws Excep public void should_fail_because_value_at_end_point_is_different() throws Exception { WritableAssertionInfo info = new WritableAssertionInfo(); info.description("description"); - Table table = new Table(); - TableAssert tableAssert = assertThat(table); + TableAssert tableAssert = new TableAssert(null); try { AssertionsOnColumnOfChangeEquality.hasValues(tableAssert, info, getValue(null, "test1"), @@ -228,8 +223,7 @@ public void should_fail_because_value_at_end_point_is_different() throws Excepti 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); try { AssertionsOnColumnOfChangeEquality.hasValues(tableAssert, info, getValue(null, false), 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 0cefbf3a..fbd6a967 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,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; @@ -21,7 +20,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.junit.Test; @@ -39,8 +37,7 @@ public class AssertionsOnColumnOfChangeEquality_HasValues_One_TimeValue_Test ext @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); TableAssert tableAssert2 = AssertionsOnColumnOfChangeEquality.hasValues(tableAssert, info, getValue(null, Time.valueOf("09:01:00")), getValue(null, Time.valueOf("09:01:00")), @@ -55,8 +52,7 @@ public void test_has_values() throws Exception { public void should_fail_because_value_at_start_point_is_different() throws Exception { WritableAssertionInfo info = new WritableAssertionInfo(); info.description("description"); - Table table = new Table(); - TableAssert tableAssert = assertThat(table); + TableAssert tableAssert = new TableAssert(null); try { AssertionsOnColumnOfChangeEquality.hasValues(tableAssert, info, getValue(null, Time.valueOf("09:01:05")), @@ -79,8 +75,7 @@ public void should_fail_because_value_at_start_point_is_different() throws Excep public void should_fail_because_value_at_end_point_is_different() throws Exception { WritableAssertionInfo info = new WritableAssertionInfo(); info.description("description"); - Table table = new Table(); - TableAssert tableAssert = assertThat(table); + TableAssert tableAssert = new TableAssert(null); try { AssertionsOnColumnOfChangeEquality.hasValues(tableAssert, info, getValue(null, Time.valueOf("09:01:00")), @@ -103,8 +98,7 @@ public void should_fail_because_value_at_end_point_is_different() throws Excepti 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); try { AssertionsOnColumnOfChangeEquality.hasValues(tableAssert, info, getValue(null, "other"), diff --git a/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnColumnOfChangeEquality_HasValues_One_UUID_Test.java b/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnColumnOfChangeEquality_HasValues_One_UUID_Test.java index 6631172e..dbccede9 100644 --- a/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnColumnOfChangeEquality_HasValues_One_UUID_Test.java +++ b/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnColumnOfChangeEquality_HasValues_One_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.UUID; @@ -21,7 +20,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.junit.Test; /** @@ -38,8 +36,7 @@ public class AssertionsOnColumnOfChangeEquality_HasValues_One_UUID_Test extends @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); TableAssert tableAssert2 = AssertionsOnColumnOfChangeEquality.hasValues(tableAssert, info, getValue(null, UUID.fromString( "30B443AE-C0C9-4790-9BEC-CE1380808435")), @@ -57,8 +54,7 @@ public void test_has_values() throws Exception { public void should_fail_because_value_at_start_point_is_different() throws Exception { WritableAssertionInfo info = new WritableAssertionInfo(); info.description("description"); - Table table = new Table(); - TableAssert tableAssert = assertThat(table); + TableAssert tableAssert = new TableAssert(null); try { AssertionsOnColumnOfChangeEquality.hasValues(tableAssert, info, getValue(null, UUID.fromString( @@ -82,8 +78,7 @@ public void should_fail_because_value_at_start_point_is_different() throws Excep public void should_fail_because_value_at_end_point_is_different() throws Exception { WritableAssertionInfo info = new WritableAssertionInfo(); info.description("description"); - Table table = new Table(); - TableAssert tableAssert = assertThat(table); + TableAssert tableAssert = new TableAssert(null); try { AssertionsOnColumnOfChangeEquality.hasValues(tableAssert, info, getValue(null, UUID.fromString("30B443AE-C0C9-4790-9BEC-CE1380808435")), @@ -107,8 +102,7 @@ public void should_fail_because_value_at_end_point_is_different() throws Excepti 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); try { AssertionsOnColumnOfChangeEquality.hasValues(tableAssert, info, getValue(null, "other"), diff --git a/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnColumnOfChangeEquality_HasValues_Two_Boolean_Test.java b/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnColumnOfChangeEquality_HasValues_Two_Boolean_Test.java index cc7f250b..6669cf90 100644 --- a/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnColumnOfChangeEquality_HasValues_Two_Boolean_Test.java +++ b/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnColumnOfChangeEquality_HasValues_Two_Boolean_Test.java @@ -12,14 +12,12 @@ */ 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; import org.assertj.db.common.AbstractTest; -import org.assertj.db.type.Table; import org.junit.Test; /** @@ -36,8 +34,7 @@ public class AssertionsOnColumnOfChangeEquality_HasValues_Two_Boolean_Test exten @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); TableAssert tableAssert2 = AssertionsOnColumnOfChangeEquality.hasValues(tableAssert, info, getValue(null, true), getValue(null, true), @@ -53,8 +50,7 @@ public void test_has_values() throws Exception { public void should_fail_because_value_at_start_point_is_different() throws Exception { WritableAssertionInfo info = new WritableAssertionInfo(); info.description("description"); - Table table = new Table(); - TableAssert tableAssert = assertThat(table); + TableAssert tableAssert = new TableAssert(null); try { AssertionsOnColumnOfChangeEquality.hasValues(tableAssert, info, getValue(null, false), @@ -77,8 +73,7 @@ public void should_fail_because_value_at_start_point_is_different() throws Excep public void should_fail_because_value_at_end_point_is_different() throws Exception { WritableAssertionInfo info = new WritableAssertionInfo(); info.description("description"); - Table table = new Table(); - TableAssert tableAssert = assertThat(table); + TableAssert tableAssert = new TableAssert(null); try { AssertionsOnColumnOfChangeEquality.hasValues(tableAssert, info, getValue(null, false), @@ -101,8 +96,7 @@ public void should_fail_because_value_at_end_point_is_different() throws Excepti 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); try { AssertionsOnColumnOfChangeEquality.hasValues(tableAssert, info, getValue(null, "other"), diff --git a/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnColumnOfChangeEquality_HasValues_Two_Bytes_Test.java b/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnColumnOfChangeEquality_HasValues_Two_Bytes_Test.java index e77f1d8b..e79a694e 100644 --- a/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnColumnOfChangeEquality_HasValues_Two_Bytes_Test.java +++ b/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnColumnOfChangeEquality_HasValues_Two_Bytes_Test.java @@ -12,14 +12,12 @@ */ 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; import org.assertj.db.common.AbstractTest; -import org.assertj.db.type.Table; import org.junit.Test; /** @@ -36,8 +34,7 @@ public class AssertionsOnColumnOfChangeEquality_HasValues_Two_Bytes_Test extends @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); TableAssert tableAssert2 = AssertionsOnColumnOfChangeEquality.hasValues(tableAssert, info, getValue(null, new byte[]{0, 1}), getValue(null, new byte[]{2, 3}), @@ -53,8 +50,7 @@ public void test_has_values() throws Exception { public void should_fail_because_value_at_start_point_is_different() throws Exception { WritableAssertionInfo info = new WritableAssertionInfo(); info.description("description"); - Table table = new Table(); - TableAssert tableAssert = assertThat(table); + TableAssert tableAssert = new TableAssert(null); try { AssertionsOnColumnOfChangeEquality.hasValues(tableAssert, info, getValue(null, new byte[]{0, 1}), @@ -74,8 +70,7 @@ public void should_fail_because_value_at_start_point_is_different() throws Excep public void should_fail_because_value_at_end_point_is_different() throws Exception { WritableAssertionInfo info = new WritableAssertionInfo(); info.description("description"); - Table table = new Table(); - TableAssert tableAssert = assertThat(table); + TableAssert tableAssert = new TableAssert(null); try { AssertionsOnColumnOfChangeEquality.hasValues(tableAssert, info, getValue(null, new byte[]{0, 1}), @@ -95,8 +90,7 @@ public void should_fail_because_value_at_end_point_is_different() throws Excepti 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); try { AssertionsOnColumnOfChangeEquality.hasValues(tableAssert, info, getValue(null, "other"), diff --git a/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnColumnOfChangeEquality_HasValues_Two_Character_Test.java b/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnColumnOfChangeEquality_HasValues_Two_Character_Test.java index a8441fb1..63e3a1e4 100644 --- a/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnColumnOfChangeEquality_HasValues_Two_Character_Test.java +++ b/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnColumnOfChangeEquality_HasValues_Two_Character_Test.java @@ -12,14 +12,12 @@ */ 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; import org.assertj.db.common.AbstractTest; -import org.assertj.db.type.Table; import org.junit.Test; /** @@ -36,8 +34,7 @@ public class AssertionsOnColumnOfChangeEquality_HasValues_Two_Character_Test ext @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); TableAssert tableAssert2 = AssertionsOnColumnOfChangeEquality.hasValues(tableAssert, info, getValue(null, 'T'), getValue(null, "T"), @@ -53,8 +50,7 @@ public void test_has_values() throws Exception { public void should_fail_because_value_at_start_point_is_different() throws Exception { WritableAssertionInfo info = new WritableAssertionInfo(); info.description("description"); - Table table = new Table(); - TableAssert tableAssert = assertThat(table); + TableAssert tableAssert = new TableAssert(null); try { AssertionsOnColumnOfChangeEquality.hasValues(tableAssert, info, getValue(null, 't'), @@ -90,8 +86,7 @@ public void should_fail_because_value_at_start_point_is_different() throws Excep public void should_fail_because_value_at_end_point_is_different() throws Exception { WritableAssertionInfo info = new WritableAssertionInfo(); info.description("description"); - Table table = new Table(); - TableAssert tableAssert = assertThat(table); + TableAssert tableAssert = new TableAssert(null); try { AssertionsOnColumnOfChangeEquality.hasValues(tableAssert, info, getValue(null, 'T'), @@ -127,8 +122,7 @@ public void should_fail_because_value_at_end_point_is_different() throws Excepti 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); try { AssertionsOnColumnOfChangeEquality.hasValues(tableAssert, info, getValue(null, true), diff --git a/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnColumnOfChangeEquality_HasValues_Two_DateTimeValue_Test.java b/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnColumnOfChangeEquality_HasValues_Two_DateTimeValue_Test.java index 1efec3b0..f53409da 100644 --- a/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnColumnOfChangeEquality_HasValues_Two_DateTimeValue_Test.java +++ b/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnColumnOfChangeEquality_HasValues_Two_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.Date; @@ -24,7 +23,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.junit.Test; @@ -42,8 +40,7 @@ public class AssertionsOnColumnOfChangeEquality_HasValues_Two_DateTimeValue_Test @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); TableAssert tableAssert2 = AssertionsOnColumnOfChangeEquality.hasValues(tableAssert, info, getValue(null, Timestamp.valueOf( "2007-12-23 09:01:00")), @@ -69,8 +66,7 @@ public void test_has_values() throws Exception { public void should_fail_because_value_at_start_point_is_different() throws Exception { WritableAssertionInfo info = new WritableAssertionInfo(); info.description("description"); - Table table = new Table(); - TableAssert tableAssert = assertThat(table); + TableAssert tableAssert = new TableAssert(null); try { AssertionsOnColumnOfChangeEquality.hasValues(tableAssert, info, getValue(null, Timestamp.valueOf("2007-12-23 09:01:05")), @@ -108,8 +104,7 @@ public void should_fail_because_value_at_start_point_is_different() throws Excep public void should_fail_because_value_at_end_point_is_different() throws Exception { WritableAssertionInfo info = new WritableAssertionInfo(); info.description("description"); - Table table = new Table(); - TableAssert tableAssert = assertThat(table); + TableAssert tableAssert = new TableAssert(null); try { AssertionsOnColumnOfChangeEquality.hasValues(tableAssert, info, getValue(null, Timestamp.valueOf("2007-12-23 09:01:00")), @@ -147,8 +142,7 @@ public void should_fail_because_value_at_end_point_is_different() throws Excepti 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); try { AssertionsOnColumnOfChangeEquality.hasValues(tableAssert, info, getValue(null, "other"), diff --git a/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnColumnOfChangeEquality_HasValues_Two_DateValue_Test.java b/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnColumnOfChangeEquality_HasValues_Two_DateValue_Test.java index d15dd74d..08f5cdb2 100644 --- a/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnColumnOfChangeEquality_HasValues_Two_DateValue_Test.java +++ b/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnColumnOfChangeEquality_HasValues_Two_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; @@ -23,7 +22,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.junit.Test; /** @@ -40,8 +38,7 @@ public class AssertionsOnColumnOfChangeEquality_HasValues_Two_DateValue_Test ext @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); TableAssert tableAssert2 = AssertionsOnColumnOfChangeEquality.hasValues(tableAssert, info, getValue(null, Date.valueOf("2007-12-23")), getValue(null, Date.valueOf("2002-07-25")), @@ -62,8 +59,7 @@ public void test_has_values() throws Exception { public void should_fail_because_value_at_start_point_is_different() throws Exception { WritableAssertionInfo info = new WritableAssertionInfo(); info.description("description"); - Table table = new Table(); - TableAssert tableAssert = assertThat(table); + TableAssert tableAssert = new TableAssert(null); try { AssertionsOnColumnOfChangeEquality.hasValues(tableAssert, info, getValue(null, Date.valueOf("2007-12-23")), @@ -99,8 +95,7 @@ public void should_fail_because_value_at_start_point_is_different() throws Excep public void should_fail_because_value_at_end_point_is_different() throws Exception { WritableAssertionInfo info = new WritableAssertionInfo(); info.description("description"); - Table table = new Table(); - TableAssert tableAssert = assertThat(table); + TableAssert tableAssert = new TableAssert(null); try { AssertionsOnColumnOfChangeEquality.hasValues(tableAssert, info, getValue(null, Date.valueOf("2007-12-23")), @@ -136,8 +131,7 @@ public void should_fail_because_value_at_end_point_is_different() throws Excepti 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); try { AssertionsOnColumnOfChangeEquality.hasValues(tableAssert, info, getValue(null, "other"), diff --git a/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnColumnOfChangeEquality_HasValues_Two_Number_Test.java b/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnColumnOfChangeEquality_HasValues_Two_Number_Test.java index 614a1c08..540ce0b4 100644 --- a/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnColumnOfChangeEquality_HasValues_Two_Number_Test.java +++ b/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnColumnOfChangeEquality_HasValues_Two_Number_Test.java @@ -12,14 +12,12 @@ */ 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; import org.assertj.db.common.AbstractTest; -import org.assertj.db.type.Table; import org.junit.Test; /** @@ -36,8 +34,7 @@ public class AssertionsOnColumnOfChangeEquality_HasValues_Two_Number_Test extend @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); TableAssert tableAssert2 = AssertionsOnColumnOfChangeEquality.hasValues(tableAssert, info, getValue(null, 1), getValue(null, 2), 1, 2); @@ -51,8 +48,7 @@ public void test_has_values() throws Exception { public void should_fail_because_value_at_start_point_is_different() throws Exception { WritableAssertionInfo info = new WritableAssertionInfo(); info.description("description"); - Table table = new Table(); - TableAssert tableAssert = assertThat(table); + TableAssert tableAssert = new TableAssert(null); try { AssertionsOnColumnOfChangeEquality.hasValues(tableAssert, info, getValue(null, 1), @@ -74,8 +70,7 @@ public void should_fail_because_value_at_start_point_is_different() throws Excep public void should_fail_because_value_at_end_point_is_different() throws Exception { WritableAssertionInfo info = new WritableAssertionInfo(); info.description("description"); - Table table = new Table(); - TableAssert tableAssert = assertThat(table); + TableAssert tableAssert = new TableAssert(null); try { AssertionsOnColumnOfChangeEquality.hasValues(tableAssert, info, getValue(null, 1), @@ -97,8 +92,7 @@ public void should_fail_because_value_at_end_point_is_different() throws Excepti 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); try { AssertionsOnColumnOfChangeEquality.hasValues(tableAssert, info, getValue(null, "other"), diff --git a/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnColumnOfChangeEquality_HasValues_Two_Objects_Test.java b/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnColumnOfChangeEquality_HasValues_Two_Objects_Test.java index d774ad1c..24bf9426 100644 --- a/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnColumnOfChangeEquality_HasValues_Two_Objects_Test.java +++ b/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnColumnOfChangeEquality_HasValues_Two_Objects_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.Locale; @@ -21,7 +20,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.junit.Test; /** @@ -38,8 +36,7 @@ public class AssertionsOnColumnOfChangeEquality_HasValues_Two_Objects_Test exten @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); TableAssert tableAssert2 = AssertionsOnColumnOfChangeEquality.hasValues(tableAssert, info, getValue(null, Locale.FRENCH), getValue(null, Locale.ENGLISH), Locale.FRENCH, Locale.ENGLISH); @@ -61,8 +58,7 @@ public void test_has_values() throws Exception { public void should_fail_because_value_at_start_point_is_different() throws Exception { WritableAssertionInfo info = new WritableAssertionInfo(); info.description("description"); - Table table = new Table(); - TableAssert tableAssert = assertThat(table); + TableAssert tableAssert = new TableAssert(null); try { AssertionsOnColumnOfChangeEquality.hasValues(tableAssert, info, getValue(null, Locale.FRENCH), getValue(null, Locale.ENGLISH), @@ -120,8 +116,7 @@ public void should_fail_because_value_at_start_point_is_different() throws Excep public void should_fail_because_value_at_end_point_is_different() throws Exception { WritableAssertionInfo info = new WritableAssertionInfo(); info.description("description"); - Table table = new Table(); - TableAssert tableAssert = assertThat(table); + TableAssert tableAssert = new TableAssert(null); try { AssertionsOnColumnOfChangeEquality.hasValues(tableAssert, info, getValue(null, Locale.FRENCH), getValue(null, Locale.ENGLISH), Locale.FRENCH, Locale.FRENCH); @@ -142,8 +137,7 @@ public void should_fail_because_value_at_end_point_is_different() throws Excepti public void should_fail_because_one_value_is_not_a_object() throws Exception { WritableAssertionInfo info = new WritableAssertionInfo(); info.description("description"); - Table table = new Table(); - TableAssert tableAssert = assertThat(table); + TableAssert tableAssert = new TableAssert(null); try { AssertionsOnColumnOfChangeEquality.hasValues(tableAssert, info, getValue(null, "other"), getValue(null, Locale.ENGLISH), Locale.FRENCH, Locale.ENGLISH); fail("An exception must be raised"); diff --git a/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnColumnOfChangeEquality_HasValues_Two_String_Test.java b/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnColumnOfChangeEquality_HasValues_Two_String_Test.java index 27b98766..1ee9d7f8 100644 --- a/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnColumnOfChangeEquality_HasValues_Two_String_Test.java +++ b/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnColumnOfChangeEquality_HasValues_Two_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.sql.Date; @@ -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.junit.Test; /** @@ -40,8 +38,7 @@ public class AssertionsOnColumnOfChangeEquality_HasValues_Two_String_Test extend @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); TableAssert tableAssert2 = AssertionsOnColumnOfChangeEquality.hasValues(tableAssert, info, getValue(null, "test1"), getValue(null, "test2"), @@ -75,8 +72,7 @@ public void test_has_values() throws Exception { public void should_fail_because_value_at_start_point_is_different() throws Exception { WritableAssertionInfo info = new WritableAssertionInfo(); info.description("description"); - Table table = new Table(); - TableAssert tableAssert = assertThat(table); + TableAssert tableAssert = new TableAssert(null); try { AssertionsOnColumnOfChangeEquality.hasValues(tableAssert, info, getValue(null, "test1"), getValue(null, "test2"), @@ -149,8 +145,7 @@ public void should_fail_because_value_at_start_point_is_different() throws Excep public void should_fail_because_value_at_end_point_is_different() throws Exception { WritableAssertionInfo info = new WritableAssertionInfo(); info.description("description"); - Table table = new Table(); - TableAssert tableAssert = assertThat(table); + TableAssert tableAssert = new TableAssert(null); try { AssertionsOnColumnOfChangeEquality.hasValues(tableAssert, info, getValue(null, "test1"), getValue(null, "test1"), @@ -223,8 +218,7 @@ public void should_fail_because_value_at_end_point_is_different() throws Excepti 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); try { AssertionsOnColumnOfChangeEquality.hasValues(tableAssert, info, getValue(null, false), getValue(null, "test2"), diff --git a/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnColumnOfChangeEquality_HasValues_Two_TimeValue_Test.java b/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnColumnOfChangeEquality_HasValues_Two_TimeValue_Test.java index cab0b904..13a43441 100644 --- a/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnColumnOfChangeEquality_HasValues_Two_TimeValue_Test.java +++ b/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnColumnOfChangeEquality_HasValues_Two_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; @@ -21,7 +20,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.junit.Test; @@ -39,8 +37,7 @@ public class AssertionsOnColumnOfChangeEquality_HasValues_Two_TimeValue_Test ext @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); TableAssert tableAssert2 = AssertionsOnColumnOfChangeEquality.hasValues(tableAssert, info, getValue(null, Time.valueOf("09:01:00")), getValue(null, Time.valueOf("03:30:05")), @@ -55,8 +52,7 @@ public void test_has_values() throws Exception { public void should_fail_because_value_at_start_point_is_different() throws Exception { WritableAssertionInfo info = new WritableAssertionInfo(); info.description("description"); - Table table = new Table(); - TableAssert tableAssert = assertThat(table); + TableAssert tableAssert = new TableAssert(null); try { AssertionsOnColumnOfChangeEquality.hasValues(tableAssert, info, getValue(null, Time.valueOf("09:01:05")), @@ -79,8 +75,7 @@ public void should_fail_because_value_at_start_point_is_different() throws Excep public void should_fail_because_value_at_end_point_is_different() throws Exception { WritableAssertionInfo info = new WritableAssertionInfo(); info.description("description"); - Table table = new Table(); - TableAssert tableAssert = assertThat(table); + TableAssert tableAssert = new TableAssert(null); try { AssertionsOnColumnOfChangeEquality.hasValues(tableAssert, info, getValue(null, Time.valueOf("09:01:00")), @@ -103,8 +98,7 @@ public void should_fail_because_value_at_end_point_is_different() throws Excepti 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); try { AssertionsOnColumnOfChangeEquality.hasValues(tableAssert, info, getValue(null, "other"), diff --git a/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnColumnOfChangeEquality_HasValues_Two_UUID_Test.java b/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnColumnOfChangeEquality_HasValues_Two_UUID_Test.java index 08559514..54f5235e 100644 --- a/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnColumnOfChangeEquality_HasValues_Two_UUID_Test.java +++ b/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnColumnOfChangeEquality_HasValues_Two_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.UUID; @@ -21,7 +20,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.junit.Test; /** @@ -38,8 +36,7 @@ public class AssertionsOnColumnOfChangeEquality_HasValues_Two_UUID_Test extends @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); TableAssert tableAssert2 = AssertionsOnColumnOfChangeEquality.hasValues(tableAssert, info, getValue(null, UUID.fromString( "30B443AE-C0C9-4790-9BEC-CE1380808435")), @@ -57,8 +54,7 @@ public void test_has_values() throws Exception { public void should_fail_because_value_at_start_point_is_different() throws Exception { WritableAssertionInfo info = new WritableAssertionInfo(); info.description("description"); - Table table = new Table(); - TableAssert tableAssert = assertThat(table); + TableAssert tableAssert = new TableAssert(null); try { AssertionsOnColumnOfChangeEquality.hasValues(tableAssert, info, getValue(null, UUID.fromString("0E2A1269-EFF0-4233-B87B-B53E8B6F164D")), @@ -85,8 +81,7 @@ public void should_fail_because_value_at_start_point_is_different() throws Excep public void should_fail_because_value_at_end_point_is_different() throws Exception { WritableAssertionInfo info = new WritableAssertionInfo(); info.description("description"); - Table table = new Table(); - TableAssert tableAssert = assertThat(table); + TableAssert tableAssert = new TableAssert(null); try { AssertionsOnColumnOfChangeEquality.hasValues(tableAssert, info, getValue(null, UUID.fromString("30B443AE-C0C9-4790-9BEC-CE1380808435")), @@ -113,8 +108,7 @@ public void should_fail_because_value_at_end_point_is_different() throws Excepti 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); try { AssertionsOnColumnOfChangeEquality.hasValues(tableAssert, info, getValue(null, "other"), 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 202f5a6b..9fafe1db 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,14 +12,12 @@ */ 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; import org.assertj.db.common.AbstractTest; -import org.assertj.db.type.Table; import org.junit.Test; /** @@ -36,8 +34,7 @@ public class AssertionsOnColumnOfChangeType_IsBoolean_Test extends AbstractTest @Test public void test_is_boolean() throws Exception { WritableAssertionInfo info = new WritableAssertionInfo(); - Table table = new Table(); - TableAssert tableAssert = assertThat(table); + TableAssert tableAssert = new TableAssert(null); TableAssert tableAssert2 = AssertionsOnColumnOfChangeType.isBoolean(tableAssert, info, getValue(null, true), getValue( null, true), false); Assertions.assertThat(tableAssert2).isSameAs(tableAssert); @@ -54,8 +51,7 @@ public void test_is_boolean() throws Exception { public void should_fail_because_value_at_start_point_have_different_type() throws Exception { WritableAssertionInfo info = new WritableAssertionInfo(); info.description("description"); - Table table = new Table(); - TableAssert tableAssert = assertThat(table); + TableAssert tableAssert = new TableAssert(null); try { AssertionsOnColumnOfChangeType.isBoolean(tableAssert, info, getValue(null, "test"), getValue(null, true), false); @@ -78,8 +74,7 @@ public void should_fail_because_value_at_start_point_have_different_type() throw public void should_fail_because_value_at_end_point_have_different_type() throws Exception { WritableAssertionInfo info = new WritableAssertionInfo(); info.description("description"); - Table table = new Table(); - TableAssert tableAssert = assertThat(table); + TableAssert tableAssert = new TableAssert(null); try { AssertionsOnColumnOfChangeType.isBoolean(tableAssert, info, getValue(null, false), getValue(null, "test"), false); @@ -102,8 +97,7 @@ public void should_fail_because_value_at_end_point_have_different_type() throws public void should_fail_because_value_at_start_point_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 { AssertionsOnColumnOfChangeType.isBoolean(tableAssert, info, getValue(null, new StringBuilder("test")), getValue(null, true), false); @@ -126,8 +120,7 @@ public void should_fail_because_value_at_start_point_is_a_stringbuilder() throws public void should_fail_because_value_at_end_point_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 { AssertionsOnColumnOfChangeType.isBoolean(tableAssert, info, getValue(null, false), getValue(null, new StringBuilder("test")), false); diff --git a/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnColumnOfChangeType_IsBytes_Test.java b/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnColumnOfChangeType_IsBytes_Test.java index f4040669..21ba0f82 100644 --- a/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnColumnOfChangeType_IsBytes_Test.java +++ b/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnColumnOfChangeType_IsBytes_Test.java @@ -12,14 +12,12 @@ */ 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; import org.assertj.db.common.AbstractTest; -import org.assertj.db.type.Table; import org.junit.Test; /** @@ -36,8 +34,7 @@ public class AssertionsOnColumnOfChangeType_IsBytes_Test extends AbstractTest { @Test public void test_is_bytes() throws Exception { WritableAssertionInfo info = new WritableAssertionInfo(); - Table table = new Table(); - TableAssert tableAssert = assertThat(table); + TableAssert tableAssert = new TableAssert(null); TableAssert tableAssert2 = AssertionsOnColumnOfChangeType.isBytes(tableAssert, info, getValue(null, new byte[]{0, 1}), getValue( null, new byte[]{2, 3}), false); Assertions.assertThat(tableAssert2).isSameAs(tableAssert); @@ -55,8 +52,7 @@ public void test_is_bytes() throws Exception { public void should_fail_because_value_at_start_point_have_different_type() throws Exception { WritableAssertionInfo info = new WritableAssertionInfo(); info.description("description"); - Table table = new Table(); - TableAssert tableAssert = assertThat(table); + TableAssert tableAssert = new TableAssert(null); try { AssertionsOnColumnOfChangeType.isBytes(tableAssert, info, getValue(null, "test"), @@ -80,8 +76,7 @@ public void should_fail_because_value_at_start_point_have_different_type() throw public void should_fail_because_value_at_end_point_have_different_type() throws Exception { WritableAssertionInfo info = new WritableAssertionInfo(); info.description("description"); - Table table = new Table(); - TableAssert tableAssert = assertThat(table); + TableAssert tableAssert = new TableAssert(null); try { AssertionsOnColumnOfChangeType.isBytes(tableAssert, info, getValue(null, new byte[]{2, 3}), @@ -105,8 +100,7 @@ public void should_fail_because_value_at_end_point_have_different_type() throws public void should_fail_because_value_at_start_point_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 { AssertionsOnColumnOfChangeType.isBytes(tableAssert, info, getValue(null, new StringBuilder("test")), @@ -130,8 +124,7 @@ public void should_fail_because_value_at_start_point_is_a_stringbuilder() throws public void should_fail_because_value_at_end_point_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 { AssertionsOnColumnOfChangeType.isBytes(tableAssert, info, getValue(null, new byte[]{2, 3}), diff --git a/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnColumnOfChangeType_IsDateTime_Test.java b/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnColumnOfChangeType_IsDateTime_Test.java index b43d4add..eb7b802e 100644 --- a/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnColumnOfChangeType_IsDateTime_Test.java +++ b/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnColumnOfChangeType_IsDateTime_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; @@ -21,7 +20,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.junit.Test; /** @@ -38,8 +36,7 @@ public class AssertionsOnColumnOfChangeType_IsDateTime_Test extends AbstractTest @Test public void test_is_date_time() throws Exception { WritableAssertionInfo info = new WritableAssertionInfo(); - Table table = new Table(); - TableAssert tableAssert = assertThat(table); + TableAssert tableAssert = new TableAssert(null); TableAssert tableAssert2 = AssertionsOnColumnOfChangeType.isDateTime(tableAssert, info, getValue(null, Timestamp.valueOf( "2007-12-23 09:01:00")), @@ -63,8 +60,7 @@ public void test_is_date_time() throws Exception { public void should_fail_because_value_at_start_point_have_different_type() throws Exception { WritableAssertionInfo info = new WritableAssertionInfo(); info.description("description"); - Table table = new Table(); - TableAssert tableAssert = assertThat(table); + TableAssert tableAssert = new TableAssert(null); try { AssertionsOnColumnOfChangeType.isDateTime(tableAssert, info, getValue(null, "test"), @@ -88,8 +84,7 @@ public void should_fail_because_value_at_start_point_have_different_type() throw public void should_fail_because_value_at_end_point_have_different_type() throws Exception { WritableAssertionInfo info = new WritableAssertionInfo(); info.description("description"); - Table table = new Table(); - TableAssert tableAssert = assertThat(table); + TableAssert tableAssert = new TableAssert(null); try { AssertionsOnColumnOfChangeType.isDateTime(tableAssert, info, getValue(null, Timestamp.valueOf("2007-12-23 09:01:00")), @@ -113,8 +108,7 @@ public void should_fail_because_value_at_end_point_have_different_type() throws public void should_fail_because_value_at_start_point_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 { AssertionsOnColumnOfChangeType.isDateTime(tableAssert, info, getValue(null, new StringBuilder("test")), @@ -139,8 +133,7 @@ public void should_fail_because_value_at_start_point_is_a_stringbuilder() throws public void should_fail_because_value_at_end_point_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 { AssertionsOnColumnOfChangeType.isDateTime(tableAssert, info, getValue(null, Timestamp.valueOf("2007-12-23 09:01:00")), diff --git a/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnColumnOfChangeType_IsDate_Test.java b/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnColumnOfChangeType_IsDate_Test.java index f65afba9..2c10740f 100644 --- a/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnColumnOfChangeType_IsDate_Test.java +++ b/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnColumnOfChangeType_IsDate_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; @@ -21,7 +20,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.junit.Test; /** @@ -38,8 +36,7 @@ public class AssertionsOnColumnOfChangeType_IsDate_Test extends AbstractTest { @Test public void test_is_date() throws Exception { WritableAssertionInfo info = new WritableAssertionInfo(); - Table table = new Table(); - TableAssert tableAssert = assertThat(table); + TableAssert tableAssert = new TableAssert(null); TableAssert tableAssert2 = AssertionsOnColumnOfChangeType.isDate(tableAssert, info, getValue(null, Date.valueOf("2007-12-23")), getValue(null, Date.valueOf("2002-07-25")), false); @@ -60,8 +57,7 @@ public void test_is_date() throws Exception { public void should_fail_because_value_at_start_point_have_different_type() throws Exception { WritableAssertionInfo info = new WritableAssertionInfo(); info.description("description"); - Table table = new Table(); - TableAssert tableAssert = assertThat(table); + TableAssert tableAssert = new TableAssert(null); try { AssertionsOnColumnOfChangeType.isDate(tableAssert, info, getValue(null, "test"), @@ -85,8 +81,7 @@ public void should_fail_because_value_at_start_point_have_different_type() throw public void should_fail_because_value_at_end_point_have_different_type() throws Exception { WritableAssertionInfo info = new WritableAssertionInfo(); info.description("description"); - Table table = new Table(); - TableAssert tableAssert = assertThat(table); + TableAssert tableAssert = new TableAssert(null); try { AssertionsOnColumnOfChangeType.isDate(tableAssert, info, getValue(null, Date.valueOf("2007-12-23")), @@ -110,8 +105,7 @@ public void should_fail_because_value_at_end_point_have_different_type() throws public void should_fail_because_value_at_start_point_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 { AssertionsOnColumnOfChangeType.isDate(tableAssert, info, getValue(null, new StringBuilder("test")), @@ -135,8 +129,7 @@ public void should_fail_because_value_at_start_point_is_a_stringbuilder() throws public void should_fail_because_value_at_end_point_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 { AssertionsOnColumnOfChangeType.isDate(tableAssert, info, getValue(null, Date.valueOf("2007-12-23")), 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 2b0ead39..337f5f02 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,14 +12,12 @@ */ 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; import org.assertj.db.common.AbstractTest; -import org.assertj.db.type.Table; import org.junit.Test; /** @@ -36,8 +34,7 @@ public class AssertionsOnColumnOfChangeType_IsNumber_Test extends AbstractTest { @Test public void test_is_number() throws Exception { WritableAssertionInfo info = new WritableAssertionInfo(); - Table table = new Table(); - TableAssert tableAssert = assertThat(table); + TableAssert tableAssert = new TableAssert(null); TableAssert tableAssert2 = AssertionsOnColumnOfChangeType.isNumber(tableAssert, info, getValue(null, 8), getValue( null, 9), false); Assertions.assertThat(tableAssert2).isSameAs(tableAssert); @@ -54,8 +51,7 @@ public void test_is_number() throws Exception { public void should_fail_because_value_at_start_point_have_different_type() throws Exception { WritableAssertionInfo info = new WritableAssertionInfo(); info.description("description"); - Table table = new Table(); - TableAssert tableAssert = assertThat(table); + TableAssert tableAssert = new TableAssert(null); try { AssertionsOnColumnOfChangeType.isNumber(tableAssert, info, getValue(null, "test"), getValue(null, 8), false); @@ -78,8 +74,7 @@ public void should_fail_because_value_at_start_point_have_different_type() throw public void should_fail_because_value_at_end_point_have_different_type() throws Exception { WritableAssertionInfo info = new WritableAssertionInfo(); info.description("description"); - Table table = new Table(); - TableAssert tableAssert = assertThat(table); + TableAssert tableAssert = new TableAssert(null); try { AssertionsOnColumnOfChangeType.isNumber(tableAssert, info, getValue(null, 8), getValue(null, "test"), false); @@ -102,8 +97,7 @@ public void should_fail_because_value_at_end_point_have_different_type() throws public void should_fail_because_value_at_start_point_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 { AssertionsOnColumnOfChangeType.isNumber(tableAssert, info, getValue(null, new StringBuilder("test")), getValue(null, 8), false); @@ -126,8 +120,7 @@ public void should_fail_because_value_at_start_point_is_a_stringbuilder() throws public void should_fail_because_value_at_end_point_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 { AssertionsOnColumnOfChangeType.isNumber(tableAssert, info, getValue(null, 8), getValue(null, new StringBuilder("test")), false); diff --git a/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnColumnOfChangeType_IsOfAnyOfTypes_Test.java b/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnColumnOfChangeType_IsOfAnyOfTypes_Test.java index 19019620..5a67ae63 100644 --- a/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnColumnOfChangeType_IsOfAnyOfTypes_Test.java +++ b/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnColumnOfChangeType_IsOfAnyOfTypes_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.Locale; @@ -21,7 +20,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.ValueType; import org.junit.Test; @@ -39,8 +37,7 @@ public class AssertionsOnColumnOfChangeType_IsOfAnyOfTypes_Test extends Abstract @Test public void test_is_of_any_of_types() throws Exception { WritableAssertionInfo info = new WritableAssertionInfo(); - Table table = new Table(); - TableAssert tableAssert = assertThat(table); + TableAssert tableAssert = new TableAssert(null); TableAssert tableAssert2 = AssertionsOnColumnOfChangeType.isOfAnyTypeIn(tableAssert, info, getValue(null, "test"), getValue(null, "test"), ValueType.TEXT); @@ -64,8 +61,7 @@ public void test_is_of_any_of_types() throws Exception { public void should_fail_because_value_at_start_point_have_different_type() throws Exception { WritableAssertionInfo info = new WritableAssertionInfo(); info.description("description"); - Table table = new Table(); - TableAssert tableAssert = assertThat(table); + TableAssert tableAssert = new TableAssert(null); try { AssertionsOnColumnOfChangeType.isOfAnyTypeIn(tableAssert, info, getValue(null, 8), getValue(null, "test"), @@ -117,8 +113,7 @@ public void should_fail_because_value_at_start_point_have_different_type() throw public void should_fail_because_value_at_end_point_have_different_type() throws Exception { WritableAssertionInfo info = new WritableAssertionInfo(); info.description("description"); - Table table = new Table(); - TableAssert tableAssert = assertThat(table); + TableAssert tableAssert = new TableAssert(null); try { AssertionsOnColumnOfChangeType.isOfAnyTypeIn(tableAssert, info, getValue(null, "test"), @@ -170,8 +165,7 @@ public void should_fail_because_value_at_end_point_have_different_type() throws public void should_fail_because_value_at_start_point_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 { AssertionsOnColumnOfChangeType.isOfAnyTypeIn(tableAssert, info, getValue(null, new StringBuilder("test")), @@ -195,8 +189,7 @@ public void should_fail_because_value_at_start_point_is_a_stringbuilder() throws public void should_fail_because_value_at_end_point_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 { AssertionsOnColumnOfChangeType.isOfAnyTypeIn(tableAssert, info, getValue(null, "test"), 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 3d33b807..3ef38267 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,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.Locale; @@ -21,7 +20,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.ValueType; import org.junit.Test; @@ -39,8 +37,7 @@ public class AssertionsOnColumnOfChangeType_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); TableAssert tableAssert2 = AssertionsOnColumnOfChangeType.isOfType(tableAssert, info, getValue(null, "test"), getValue(null, "test"), ValueType.TEXT, false); @@ -62,8 +59,7 @@ public void test_is_of_type() throws Exception { public void should_fail_because_value_at_start_point_have_different_type() throws Exception { WritableAssertionInfo info = new WritableAssertionInfo(); info.description("description"); - Table table = new Table(); - TableAssert tableAssert = assertThat(table); + TableAssert tableAssert = new TableAssert(null); try { AssertionsOnColumnOfChangeType.isOfType(tableAssert, info, getValue(null, 8), getValue(null, "test"), ValueType.TEXT, false); @@ -112,8 +108,7 @@ public void should_fail_because_value_at_start_point_have_different_type() throw public void should_fail_because_value_at_end_point_have_different_type() throws Exception { WritableAssertionInfo info = new WritableAssertionInfo(); info.description("description"); - Table table = new Table(); - TableAssert tableAssert = assertThat(table); + TableAssert tableAssert = new TableAssert(null); try { AssertionsOnColumnOfChangeType.isOfType(tableAssert, info, getValue(null, "test"), getValue(null, 8), ValueType.TEXT, false); @@ -162,8 +157,7 @@ public void should_fail_because_value_at_end_point_have_different_type() throws public void should_fail_because_value_at_start_point_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 { AssertionsOnColumnOfChangeType.isOfType(tableAssert, info, getValue(null, new StringBuilder("test")), getValue(null, "test"), ValueType.TEXT, false); @@ -186,8 +180,7 @@ public void should_fail_because_value_at_start_point_is_a_stringbuilder() throws public void should_fail_because_value_at_end_point_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 { AssertionsOnColumnOfChangeType.isOfType(tableAssert, info, getValue(null, "test"), getValue(null, new StringBuilder("test")), ValueType.TEXT, false); diff --git a/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnColumnOfChangeType_IsText_Test.java b/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnColumnOfChangeType_IsText_Test.java index e960fb9e..d1178652 100644 --- a/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnColumnOfChangeType_IsText_Test.java +++ b/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnColumnOfChangeType_IsText_Test.java @@ -12,14 +12,12 @@ */ 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; import org.assertj.db.common.AbstractTest; -import org.assertj.db.type.Table; import org.junit.Test; /** @@ -36,8 +34,7 @@ public class AssertionsOnColumnOfChangeType_IsText_Test extends AbstractTest { @Test public void test_is_text() throws Exception { WritableAssertionInfo info = new WritableAssertionInfo(); - Table table = new Table(); - TableAssert tableAssert = assertThat(table); + TableAssert tableAssert = new TableAssert(null); TableAssert tableAssert2 = AssertionsOnColumnOfChangeType.isText(tableAssert, info, getValue(null, "test"), getValue( null, "test"), false); Assertions.assertThat(tableAssert2).isSameAs(tableAssert); @@ -55,8 +52,7 @@ public void test_is_text() throws Exception { public void should_fail_because_value_at_start_point_have_different_type() throws Exception { WritableAssertionInfo info = new WritableAssertionInfo(); info.description("description"); - Table table = new Table(); - TableAssert tableAssert = assertThat(table); + TableAssert tableAssert = new TableAssert(null); try { AssertionsOnColumnOfChangeType.isText(tableAssert, info, getValue(null, true), getValue(null, "test"), false); @@ -79,8 +75,7 @@ public void should_fail_because_value_at_start_point_have_different_type() throw public void should_fail_because_value_at_end_point_have_different_type() throws Exception { WritableAssertionInfo info = new WritableAssertionInfo(); info.description("description"); - Table table = new Table(); - TableAssert tableAssert = assertThat(table); + TableAssert tableAssert = new TableAssert(null); try { AssertionsOnColumnOfChangeType.isText(tableAssert, info, getValue(null, "test"), getValue(null, false), false); @@ -103,8 +98,7 @@ public void should_fail_because_value_at_end_point_have_different_type() throws public void should_fail_because_value_at_start_point_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 { AssertionsOnColumnOfChangeType.isTime(tableAssert, info, getValue(null, new StringBuilder("test")), getValue(null, "test"), false); @@ -127,8 +121,7 @@ public void should_fail_because_value_at_start_point_is_a_stringbuilder() throws public void should_fail_because_value_at_end_point_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 { AssertionsOnColumnOfChangeType.isText(tableAssert, info, getValue(null, "test"), getValue(null, new StringBuilder("test")), false); diff --git a/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnColumnOfChangeType_IsTime_Test.java b/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnColumnOfChangeType_IsTime_Test.java index d6d81e86..a52904f0 100644 --- a/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnColumnOfChangeType_IsTime_Test.java +++ b/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnColumnOfChangeType_IsTime_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; @@ -21,7 +20,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.junit.Test; /** @@ -38,8 +36,7 @@ public class AssertionsOnColumnOfChangeType_IsTime_Test extends AbstractTest { @Test public void test_is_time() throws Exception { WritableAssertionInfo info = new WritableAssertionInfo(); - Table table = new Table(); - TableAssert tableAssert = assertThat(table); + TableAssert tableAssert = new TableAssert(null); TableAssert tableAssert2 = AssertionsOnColumnOfChangeType.isTime(tableAssert, info, getValue(null, Time.valueOf("09:01:00")), getValue(null, Time.valueOf("09:01:00")), false); @@ -61,8 +58,7 @@ public void test_is_time() throws Exception { public void should_fail_because_value_at_start_point_have_different_type() throws Exception { WritableAssertionInfo info = new WritableAssertionInfo(); info.description("description"); - Table table = new Table(); - TableAssert tableAssert = assertThat(table); + TableAssert tableAssert = new TableAssert(null); try { AssertionsOnColumnOfChangeType.isTime(tableAssert, info, getValue(null, "test"), @@ -86,8 +82,7 @@ public void should_fail_because_value_at_start_point_have_different_type() throw public void should_fail_because_value_at_end_point_have_different_type() throws Exception { WritableAssertionInfo info = new WritableAssertionInfo(); info.description("description"); - Table table = new Table(); - TableAssert tableAssert = assertThat(table); + TableAssert tableAssert = new TableAssert(null); try { AssertionsOnColumnOfChangeType.isTime(tableAssert, info, getValue(null, Time.valueOf("09:01:00")), @@ -111,8 +106,7 @@ public void should_fail_because_value_at_end_point_have_different_type() throws public void should_fail_because_value_at_start_point_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 { AssertionsOnColumnOfChangeType.isTime(tableAssert, info, getValue(null, new StringBuilder("test")), @@ -136,8 +130,7 @@ public void should_fail_because_value_at_start_point_is_a_stringbuilder() throws public void should_fail_because_value_at_end_point_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 { AssertionsOnColumnOfChangeType.isTime(tableAssert, info, getValue(null, Time.valueOf("09:01:00")), diff --git a/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnColumnType_IsBoolean_Test.java b/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnColumnType_IsBoolean_Test.java index 17873629..7e4c2053 100644 --- a/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnColumnType_IsBoolean_Test.java +++ b/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnColumnType_IsBoolean_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 AssertionsOnColumnType_IsBoolean_Test extends AbstractTest { @Test public void test_is_boolean() 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, true))); TableAssert tableAssert2 = AssertionsOnColumnType.isBoolean(tableAssert, info, list, false); Assertions.assertThat(tableAssert2).isSameAs(tableAssert); @@ -61,8 +58,7 @@ public void test_is_boolean() throws Exception { public void should_fail_because_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); try { List list = new ArrayList<>(Arrays.asList(getValue(null, "test"), getValue(null, true))); AssertionsOnColumnType.isBoolean(tableAssert, info, list, false); @@ -85,8 +81,7 @@ public void should_fail_because_value_is_not_a_boolean() throws Exception { public void should_fail_because_value_is_not_a_boolean_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, false), getValue(null, "test"))); AssertionsOnColumnType.isBoolean(tableAssert, info, list, false); @@ -109,8 +104,7 @@ public void should_fail_because_value_is_not_a_boolean_with_lenience() throws Ex 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))); AssertionsOnColumnType.isBoolean(tableAssert, info, list, false); diff --git a/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnColumnType_IsBytes_Test.java b/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnColumnType_IsBytes_Test.java index 7cd7fccd..0e6a6902 100644 --- a/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnColumnType_IsBytes_Test.java +++ b/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnColumnType_IsBytes_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 AssertionsOnColumnType_IsBytes_Test extends AbstractTest { @Test public void test_is_bytes() 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 = AssertionsOnColumnType.isBytes(tableAssert, info, list, false); Assertions.assertThat(tableAssert2).isSameAs(tableAssert); @@ -61,8 +58,7 @@ public void test_is_bytes() throws Exception { public void should_fail_because_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); try { List list = new ArrayList<>(Arrays.asList(getValue(null, "test"), getValue(null, new byte[]{2, 3}))); AssertionsOnColumnType.isBytes(tableAssert, info, list, false); @@ -85,8 +81,7 @@ public void should_fail_because_value_is_not_bytes() throws Exception { public void should_fail_because_value_is_not_bytes_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, new byte[]{2, 3}), getValue(null, "test"))); AssertionsOnColumnType.isBytes(tableAssert, info, list, false); @@ -109,8 +104,7 @@ public void should_fail_because_value_is_not_bytes_with_lenience() throws Except 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))); AssertionsOnColumnType.isBytes(tableAssert, info, list, false); diff --git a/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnColumnType_IsDateTime_Test.java b/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnColumnType_IsDateTime_Test.java index caa8faa3..99ca8872 100644 --- a/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnColumnType_IsDateTime_Test.java +++ b/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnColumnType_IsDateTime_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; @@ -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 AssertionsOnColumnType_IsDateTime_Test extends AbstractTest { @Test public void test_is_date_time() 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")))); TableAssert tableAssert2 = AssertionsOnColumnType.isDateTime(tableAssert, info, list, false); @@ -65,8 +62,7 @@ public void test_is_date_time() throws Exception { public void should_fail_because_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); try { List list = new ArrayList<>(Arrays.asList(getValue(null, "test"), getValue(null, Timestamp.valueOf("2002-07-25 03:30:05")))); @@ -90,8 +86,7 @@ public void should_fail_because_value_is_not_a_date_time() throws Exception { public void should_fail_because_value_is_not_a_date_time_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, Timestamp.valueOf("2007-12-23 09:01:00")), getValue(null, "test"))); @@ -115,8 +110,7 @@ public void should_fail_because_value_is_not_a_date_time_with_lenience() throws 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))); diff --git a/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnColumnType_IsDate_Test.java b/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnColumnType_IsDate_Test.java index 9e04a7ec..96e4f5c3 100644 --- a/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnColumnType_IsDate_Test.java +++ b/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnColumnType_IsDate_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; @@ -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 AssertionsOnColumnType_IsDate_Test extends AbstractTest { @Test public void test_is_date() 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")))); TableAssert tableAssert2 = AssertionsOnColumnType.isDate(tableAssert, info, list, false); @@ -65,8 +62,7 @@ public void test_is_date() throws Exception { public void should_fail_because_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); try { List list = new ArrayList<>(Arrays.asList(getValue(null, "test"), getValue(null, Date.valueOf("2002-07-25")))); AssertionsOnColumnType.isDate(tableAssert, info, list, false); @@ -89,8 +85,7 @@ public void should_fail_because_value_is_not_a_date() throws Exception { public void should_fail_because_value_is_not_a_date_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, Date.valueOf("2007-12-23")), getValue(null, "test"))); AssertionsOnColumnType.isDate(tableAssert, info, list, false); @@ -113,8 +108,7 @@ public void should_fail_because_value_is_not_a_date_with_lenience() throws Excep 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))); AssertionsOnColumnType.isDate(tableAssert, info, list, false); diff --git a/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnColumnType_IsNumber_Test.java b/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnColumnType_IsNumber_Test.java index 5bc64f72..29bf7a52 100644 --- a/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnColumnType_IsNumber_Test.java +++ b/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnColumnType_IsNumber_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 AssertionsOnColumnType_IsNumber_Test extends AbstractTest { @Test public void test_is_number() 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, 8), getValue(null, 9))); TableAssert tableAssert2 = AssertionsOnColumnType.isNumber(tableAssert, info, list, false); Assertions.assertThat(tableAssert2).isSameAs(tableAssert); @@ -61,8 +58,7 @@ public void test_is_number() throws Exception { public void should_fail_because_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); try { List list = new ArrayList<>(Arrays.asList(getValue(null, "test"), getValue(null, 8))); AssertionsOnColumnType.isNumber(tableAssert, info, list, false); @@ -85,8 +81,7 @@ public void should_fail_because_value_is_not_a_number() throws Exception { public void should_fail_because_value_is_not_a_number_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, 8), getValue(null, "test"))); AssertionsOnColumnType.isNumber(tableAssert, info, list, false); @@ -109,8 +104,7 @@ public void should_fail_because_value_is_not_a_number_with_lenience() throws Exc 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))); AssertionsOnColumnType.isNumber(tableAssert, info, list, false); diff --git a/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnColumnType_IsOfAnyTypeIn_Test.java b/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnColumnType_IsOfAnyTypeIn_Test.java index 7b83213b..5d1dc65c 100644 --- a/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnColumnType_IsOfAnyTypeIn_Test.java +++ b/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnColumnType_IsOfAnyTypeIn_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.assertj.db.type.ValueType; import org.junit.Test; @@ -43,8 +41,7 @@ public class AssertionsOnColumnType_IsOfAnyTypeIn_Test extends AbstractTest { @Test public void test_is_of_any_of_types() 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 = AssertionsOnColumnType.isOfAnyTypeIn(tableAssert, info, list, ValueType.TEXT); @@ -65,8 +62,7 @@ public void test_is_of_any_of_types() throws Exception { public void should_fail_because_value_is_not_of_any_of_types() 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"))); AssertionsOnColumnType.isOfAnyTypeIn(tableAssert, info, list, ValueType.TEXT, ValueType.DATE); @@ -115,8 +111,7 @@ public void should_fail_because_value_is_not_of_any_of_types() throws Exception public void should_fail_because_value_is_not_of_any_of_types_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))); AssertionsOnColumnType.isOfAnyTypeIn(tableAssert, info, list, ValueType.TEXT, ValueType.DATE); @@ -139,8 +134,7 @@ public void should_fail_because_value_is_not_of_any_of_types_with_lenience() thr 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))); AssertionsOnColumnType.isOfAnyTypeIn(tableAssert, info, list, ValueType.TEXT, ValueType.DATE); diff --git a/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnColumnType_IsOfType_Test.java b/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnColumnType_IsOfType_Test.java index abcac28f..68b74d3a 100644 --- a/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnColumnType_IsOfType_Test.java +++ b/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnColumnType_IsOfType_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.assertj.db.type.ValueType; import org.junit.Test; @@ -43,8 +41,7 @@ public class AssertionsOnColumnType_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); List list = new ArrayList<>(Arrays.asList(getValue(null, "test"), getValue(null, "test"))); TableAssert tableAssert2 = AssertionsOnColumnType.isOfType(tableAssert, info, list, ValueType.TEXT, false); Assertions.assertThat(tableAssert2).isSameAs(tableAssert); @@ -63,8 +60,7 @@ public void test_is_of_type() throws Exception { public void should_fail_because_value_is_not_of_type() 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"))); AssertionsOnColumnType.isOfType(tableAssert, info, list, ValueType.TEXT, false); @@ -113,8 +109,7 @@ public void should_fail_because_value_is_not_of_type() 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))); AssertionsOnColumnType.isOfType(tableAssert, info, list, ValueType.TEXT, false); @@ -137,8 +132,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))); AssertionsOnColumnType.isOfType(tableAssert, info, list, ValueType.TEXT, false); diff --git a/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnColumnType_IsText_Test.java b/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnColumnType_IsText_Test.java index afc6ff87..1e73827b 100644 --- a/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnColumnType_IsText_Test.java +++ b/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnColumnType_IsText_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 AssertionsOnColumnType_IsText_Test extends AbstractTest { @Test public void test_is_text() 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 = AssertionsOnColumnType.isText(tableAssert, info, list, false); Assertions.assertThat(tableAssert2).isSameAs(tableAssert); @@ -61,8 +58,7 @@ public void test_is_text() throws Exception { public void should_fail_because_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); try { List list = new ArrayList<>(Arrays.asList(getValue(null, true), getValue(null, "test"))); AssertionsOnColumnType.isText(tableAssert, info, list, false); @@ -85,8 +81,7 @@ public void should_fail_because_value_is_not_a_text() throws Exception { public void should_fail_because_value_is_not_a_text_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, false))); AssertionsOnColumnType.isText(tableAssert, info, list, false); @@ -109,8 +104,7 @@ public void should_fail_because_value_is_not_a_text_with_lenience() throws Excep 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))); AssertionsOnColumnType.isText(tableAssert, info, list, false); diff --git a/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnColumnType_IsTime_Test.java b/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnColumnType_IsTime_Test.java index 3b836f87..09a20788 100644 --- a/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnColumnType_IsTime_Test.java +++ b/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnColumnType_IsTime_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.Value; import org.junit.Test; @@ -42,8 +40,7 @@ public class AssertionsOnColumnType_IsTime_Test extends AbstractTest { @Test public void test_is_time() 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("09:01:00")))); TableAssert tableAssert2 = AssertionsOnColumnType.isTime(tableAssert, info, list, false); @@ -65,8 +62,7 @@ public void test_is_time() throws Exception { public void should_fail_because_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); try { List list = new ArrayList<>(Arrays.asList(getValue(null, "test"), getValue(null, Time.valueOf("09:01:00")))); AssertionsOnColumnType.isTime(tableAssert, info, list, false); @@ -89,8 +85,7 @@ public void should_fail_because_value_is_not_a_time() throws Exception { public void should_fail_because_value_is_not_a_time_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, Time.valueOf("09:01:00")), getValue(null, "test"))); AssertionsOnColumnType.isTime(tableAssert, info, list, false); @@ -113,8 +108,7 @@ public void should_fail_because_value_is_not_a_time_with_lenience() throws Excep 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))); AssertionsOnColumnType.isTime(tableAssert, info, list, false); diff --git a/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnColumnType_IsUUID_Test.java b/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnColumnType_IsUUID_Test.java index 9df8517e..39076658 100644 --- a/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnColumnType_IsUUID_Test.java +++ b/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnColumnType_IsUUID_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 AssertionsOnColumnType_IsUUID_Test extends AbstractTest { @Test public void test_is_time() 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")))); @@ -66,8 +63,7 @@ public void test_is_time() throws Exception { public void should_fail_because_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); try { List list = new ArrayList<>(Arrays.asList(getValue(null, "test"), getValue(null, UUID.fromString( @@ -92,8 +88,7 @@ public void should_fail_because_value_is_not_a_uuid() throws Exception { public void should_fail_because_value_is_not_a_uuid_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, UUID.fromString("30B443AE-C0C9-4790-9BEC-CE1380808435")), getValue(null, "test"))); @@ -117,8 +112,7 @@ public void should_fail_because_value_is_not_a_uuid_with_lenience() throws Excep 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))); AssertionsOnColumnType.isUUID(tableAssert, info, list, false); diff --git a/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnDataType_IsOnDataType_Test.java b/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnDataType_IsOnDataType_Test.java index 8c1dcfb5..9fc0b540 100644 --- a/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnDataType_IsOnDataType_Test.java +++ b/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnDataType_IsOnDataType_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 AssertionsOnDataType_IsOnDataType_Test extends AbstractTest { @Test public void test_is_on_data_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_on_data_type() throws Exception { public void should_fail_because_data_type_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/AssertionsOnDataType_IsOnRequest_Test.java b/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnDataType_IsOnRequest_Test.java index 348b2183..6cf169da 100644 --- a/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnDataType_IsOnRequest_Test.java +++ b/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnDataType_IsOnRequest_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 AssertionsOnDataType_IsOnRequest_Test extends AbstractTest { @Test public void test_is_on_request() 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.REQUEST, "test", ChangeType.CREATION, rowAtStartPoint, rowAtEndPoint); @@ -56,8 +53,7 @@ public void test_is_on_request() throws Exception { public void should_fail_because_data_type_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/AssertionsOnDataType_IsOnTable_Name_Test.java b/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnDataType_IsOnTable_Name_Test.java index b10688b3..3baeef5b 100644 --- a/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnDataType_IsOnTable_Name_Test.java +++ b/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnDataType_IsOnTable_Name_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; @@ -24,7 +23,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.assertj.db.type.lettercase.LetterCase; import org.junit.Test; @@ -42,8 +40,7 @@ public class AssertionsOnDataType_IsOnTable_Name_Test extends AbstractTest { @Test public void test_is_on_table() 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); @@ -58,8 +55,7 @@ public void test_is_on_table() throws Exception { public void should_fail_because_data_type_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.REQUEST, "test", ChangeType.CREATION, rowAtStartPoint, rowAtEndPoint); @@ -83,8 +79,7 @@ public void should_fail_because_data_type_is_different() throws Exception { public void should_fail_because_table_name_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); @@ -107,8 +102,7 @@ public void should_fail_because_table_name_is_different() throws Exception { public void should_fail_because_expected_table_name_is_null() 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/AssertionsOnDataType_IsOnTable_Test.java b/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnDataType_IsOnTable_Test.java index 063fef24..83ddaf30 100644 --- a/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnDataType_IsOnTable_Test.java +++ b/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnDataType_IsOnTable_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 AssertionsOnDataType_IsOnTable_Test extends AbstractTest { @Test public void test_is_on_table() 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_on_table() throws Exception { public void should_fail_because_data_type_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.REQUEST, "test", ChangeType.CREATION, rowAtStartPoint, rowAtEndPoint); diff --git a/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnModifiedColumn_IsModified_Test.java b/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnModifiedColumn_IsModified_Test.java index 24b35aec..5f83cc69 100644 --- a/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnModifiedColumn_IsModified_Test.java +++ b/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnModifiedColumn_IsModified_Test.java @@ -12,14 +12,12 @@ */ 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; import org.assertj.db.common.AbstractTest; -import org.assertj.db.type.Table; import org.junit.Test; /** @@ -36,8 +34,7 @@ public class AssertionsOnModifiedColumn_IsModified_Test extends AbstractTest { @Test public void test_is_modified() throws Exception { WritableAssertionInfo info = new WritableAssertionInfo(); - Table table = new Table(); - TableAssert tableAssert = assertThat(table); + TableAssert tableAssert = new TableAssert(null); TableAssert tableAssert2 = AssertionsOnModifiedColumn.isModified(tableAssert, info, getValue(null, null), getValue( null, "test")); Assertions.assertThat(tableAssert2).isSameAs(tableAssert); @@ -55,8 +52,7 @@ public void test_is_modified() throws Exception { public void should_fail_because_column_is_not_modified() throws Exception { WritableAssertionInfo info = new WritableAssertionInfo(); info.description("description"); - Table table = new Table(); - TableAssert tableAssert = assertThat(table); + TableAssert tableAssert = new TableAssert(null); try { AssertionsOnModifiedColumn.isModified(tableAssert, info, getValue(null, null), getValue(null, null)); fail("An exception must be raised"); diff --git a/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnModifiedColumn_IsNotModified_Test.java b/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnModifiedColumn_IsNotModified_Test.java index 9f000fbd..2c7af0b3 100644 --- a/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnModifiedColumn_IsNotModified_Test.java +++ b/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnModifiedColumn_IsNotModified_Test.java @@ -12,14 +12,12 @@ */ 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; import org.assertj.db.common.AbstractTest; -import org.assertj.db.type.Table; import org.junit.Test; /** @@ -36,8 +34,7 @@ public class AssertionsOnModifiedColumn_IsNotModified_Test extends AbstractTest @Test public void test_is_not_modified() throws Exception { WritableAssertionInfo info = new WritableAssertionInfo(); - Table table = new Table(); - TableAssert tableAssert = assertThat(table); + TableAssert tableAssert = new TableAssert(null); TableAssert tableAssert2 = AssertionsOnModifiedColumn.isNotModified(tableAssert, info, getValue(null, null), getValue( null, null)); Assertions.assertThat(tableAssert2).isSameAs(tableAssert); @@ -53,8 +50,7 @@ public void test_is_not_modified() throws Exception { public void should_fail_because_column_is_modified() throws Exception { WritableAssertionInfo info = new WritableAssertionInfo(); info.description("description"); - Table table = new Table(); - TableAssert tableAssert = assertThat(table); + TableAssert tableAssert = new TableAssert(null); try { AssertionsOnModifiedColumn.isNotModified(tableAssert, info, getValue(null, null), getValue(null, "test")); fail("An exception must be raised"); diff --git a/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnModifiedColumns_HasModifiedColumns_Integer_Test.java b/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnModifiedColumns_HasModifiedColumns_Integer_Test.java index 5124f1af..64ca0522 100644 --- a/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnModifiedColumns_HasModifiedColumns_Integer_Test.java +++ b/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnModifiedColumns_HasModifiedColumns_Integer_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; @@ -26,7 +25,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; /** @@ -43,8 +41,7 @@ public class AssertionsOnModifiedColumns_HasModifiedColumns_Integer_Test extends @Test public void test_has_modified_columns() throws Exception { WritableAssertionInfo info = new WritableAssertionInfo(); - Table table = new Table(); - TableAssert tableAssert = assertThat(table); + TableAssert tableAssert = new TableAssert(null); Row rowAtStartPoint = getRow(null, Arrays.asList("ID", "NAME", "FIRSTNAME", "BIRTH"), Arrays.asList(getValue(null, 1), getValue(null, "Weaver"), getValue(null, "Sigourney"), @@ -67,8 +64,7 @@ public void test_has_modified_columns() throws Exception { public void should_fail_because_modified_columns_are_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, Arrays.asList("ID", "NAME", "FIRSTNAME", "BIRTH"), Arrays.asList(getValue(null, 1), getValue(null, "Weaver"), getValue(null, "Sigourney"), @@ -97,8 +93,7 @@ public void should_fail_because_modified_columns_are_different() throws Exceptio public void should_fail_because_expected_index_must_be_not_null() 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, Arrays.asList("ID", "NAME", "FIRSTNAME", "BIRTH"), Arrays.asList(getValue(null, 1), getValue(null, "Weaver"), getValue(null, "Sigourney"), @@ -123,8 +118,7 @@ public void should_fail_because_expected_index_must_be_not_null() throws Excepti public void should_fail_because_expected_indexes_must_be_not_null() 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, Arrays.asList("ID", "NAME", "FIRSTNAME", "BIRTH"), Arrays.asList(getValue(null, 1), getValue(null, "Weaver"), getValue(null, "Sigourney"), diff --git a/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnModifiedColumns_HasModifiedColumns_String_Test.java b/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnModifiedColumns_HasModifiedColumns_String_Test.java index 8c9f3154..fdf63d07 100644 --- a/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnModifiedColumns_HasModifiedColumns_String_Test.java +++ b/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnModifiedColumns_HasModifiedColumns_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.sql.Date; @@ -26,7 +25,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.assertj.db.type.lettercase.CaseComparisons; import org.assertj.db.type.lettercase.CaseConversions; import org.assertj.db.type.lettercase.LetterCase; @@ -46,8 +44,7 @@ public class AssertionsOnModifiedColumns_HasModifiedColumns_String_Test extends @Test public void test_has_modified_columns() throws Exception { WritableAssertionInfo info = new WritableAssertionInfo(); - Table table = new Table(); - TableAssert tableAssert = assertThat(table); + TableAssert tableAssert = new TableAssert(null); Row rowAtStartPoint = getRow(null, Arrays.asList("ID", "NAME", "FIRSTNAME", "BIRTH"), Arrays.asList(getValue(null, 1), getValue(null, "Weaver"), getValue(null, "Sigourney"), @@ -72,8 +69,7 @@ public void test_has_modified_columns() throws Exception { public void should_fail_because_column_names_are_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, Arrays.asList("ID", "NAME", "FIRSTNAME", "BIRTH"), Arrays.asList(getValue(null, 1), getValue(null, "Weaver"), getValue(null, "Sigourney"), @@ -147,8 +143,7 @@ public void should_fail_because_column_names_are_different() throws Exception { public void should_fail_because_number_of_modified_columns_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, Arrays.asList("ID", "NAME", "FIRSTNAME", "BIRTH"), Arrays.asList(getValue(null, 1), getValue(null, "Weaver"), getValue(null, "Sigourney"), @@ -177,8 +172,7 @@ public void should_fail_because_number_of_modified_columns_is_different() throws public void should_fail_because_expected_name_must_be_not_null() 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, Arrays.asList("ID", "NAME", "FIRSTNAME", "BIRTH"), Arrays.asList(getValue(null, 1), getValue(null, "Weaver"), getValue(null, "Sigourney"), @@ -203,8 +197,7 @@ public void should_fail_because_expected_name_must_be_not_null() throws Exceptio public void should_fail_because_expected_names_must_be_not_null() 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, Arrays.asList("ID", "NAME", "FIRSTNAME", "BIRTH"), Arrays.asList(getValue(null, 1), getValue(null, "Weaver"), getValue(null, "Sigourney"), diff --git a/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnModifiedColumns_HasNumberOfModifiedColumnsGreaterThanOrEqualTo_Test.java b/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnModifiedColumns_HasNumberOfModifiedColumnsGreaterThanOrEqualTo_Test.java index 6c8ce672..eafa3a75 100644 --- a/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnModifiedColumns_HasNumberOfModifiedColumnsGreaterThanOrEqualTo_Test.java +++ b/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnModifiedColumns_HasNumberOfModifiedColumnsGreaterThanOrEqualTo_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; @@ -26,7 +25,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; /** @@ -43,8 +41,7 @@ public class AssertionsOnModifiedColumns_HasNumberOfModifiedColumnsGreaterThanOr @Test public void test_has_number_of_modified_columns_greater_than_or_equal_to() throws Exception { WritableAssertionInfo info = new WritableAssertionInfo(); - Table table = new Table(); - TableAssert tableAssert = assertThat(table); + TableAssert tableAssert = new TableAssert(null); Row rowAtStartPoint = getRow(null, Arrays.asList("ID", "NAME", "FIRSTNAME", "BIRTH"), Arrays.asList(getValue(null, 1), getValue(null, "Weaver"), getValue(null, "Sigourney"), @@ -67,8 +64,7 @@ public void test_has_number_of_modified_columns_greater_than_or_equal_to() throw public void should_fail_because_number_of_modified_columns_is_less() 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, Arrays.asList("ID", "NAME", "FIRSTNAME", "BIRTH"), Arrays.asList(getValue(null, 1), getValue(null, "Weaver"), getValue(null, "Sigourney"), diff --git a/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnModifiedColumns_HasNumberOfModifiedColumnsGreaterThan_Test.java b/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnModifiedColumns_HasNumberOfModifiedColumnsGreaterThan_Test.java index 1ee7665d..41a7ca28 100644 --- a/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnModifiedColumns_HasNumberOfModifiedColumnsGreaterThan_Test.java +++ b/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnModifiedColumns_HasNumberOfModifiedColumnsGreaterThan_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; @@ -26,7 +25,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; /** @@ -43,8 +41,7 @@ public class AssertionsOnModifiedColumns_HasNumberOfModifiedColumnsGreaterThan_T @Test public void test_has_number_of_modified_columns_greater_than() throws Exception { WritableAssertionInfo info = new WritableAssertionInfo(); - Table table = new Table(); - TableAssert tableAssert = assertThat(table); + TableAssert tableAssert = new TableAssert(null); Row rowAtStartPoint = getRow(null, Arrays.asList("ID", "NAME", "FIRSTNAME", "BIRTH"), Arrays.asList(getValue(null, 1), getValue(null, "Weaver"), getValue(null, "Sigourney"), @@ -67,8 +64,7 @@ public void test_has_number_of_modified_columns_greater_than() throws Exception public void should_fail_because_number_of_modified_columns_is_less_or_equal() 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, Arrays.asList("ID", "NAME", "FIRSTNAME", "BIRTH"), Arrays.asList(getValue(null, 1), getValue(null, "Weaver"), getValue(null, "Sigourney"), diff --git a/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnModifiedColumns_HasNumberOfModifiedColumnsLessThanOrEqualTo_Test.java b/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnModifiedColumns_HasNumberOfModifiedColumnsLessThanOrEqualTo_Test.java index 3b70d52f..2f2c5ab1 100644 --- a/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnModifiedColumns_HasNumberOfModifiedColumnsLessThanOrEqualTo_Test.java +++ b/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnModifiedColumns_HasNumberOfModifiedColumnsLessThanOrEqualTo_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; @@ -26,7 +25,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; /** @@ -43,8 +41,7 @@ public class AssertionsOnModifiedColumns_HasNumberOfModifiedColumnsLessThanOrEqu @Test public void test_has_number_of_modified_columns_less_than_or_equal_to() throws Exception { WritableAssertionInfo info = new WritableAssertionInfo(); - Table table = new Table(); - TableAssert tableAssert = assertThat(table); + TableAssert tableAssert = new TableAssert(null); Row rowAtStartPoint = getRow(null, Arrays.asList("ID", "NAME", "FIRSTNAME", "BIRTH"), Arrays.asList(getValue(null, 1), getValue(null, "Weaver"), getValue(null, "Sigourney"), @@ -66,8 +63,7 @@ public void test_has_number_of_modified_columns_less_than_or_equal_to() throws E public void should_fail_because_number_of_modified_columns_is_greater() 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, Arrays.asList("ID", "NAME", "FIRSTNAME", "BIRTH"), Arrays.asList(getValue(null, 1), getValue(null, "Weaver"), getValue(null, "Sigourney"), diff --git a/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnModifiedColumns_HasNumberOfModifiedColumnsLessThan_Test.java b/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnModifiedColumns_HasNumberOfModifiedColumnsLessThan_Test.java index e627c4e7..84453fd8 100644 --- a/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnModifiedColumns_HasNumberOfModifiedColumnsLessThan_Test.java +++ b/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnModifiedColumns_HasNumberOfModifiedColumnsLessThan_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; @@ -26,7 +25,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; /** @@ -43,8 +41,7 @@ public class AssertionsOnModifiedColumns_HasNumberOfModifiedColumnsLessThan_Test @Test public void test_has_number_of_modified_columns_less_than() throws Exception { WritableAssertionInfo info = new WritableAssertionInfo(); - Table table = new Table(); - TableAssert tableAssert = assertThat(table); + TableAssert tableAssert = new TableAssert(null); Row rowAtStartPoint = getRow(null, Arrays.asList("ID", "NAME", "FIRSTNAME", "BIRTH"), Arrays.asList(getValue(null, 1), getValue(null, "Weaver"), getValue(null, "Sigourney"), @@ -66,8 +63,7 @@ public void test_has_number_of_modified_columns_less_than() throws Exception { public void should_fail_because_number_of_modified_columns_is_greater_or_equal() 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, Arrays.asList("ID", "NAME", "FIRSTNAME", "BIRTH"), Arrays.asList(getValue(null, 1), getValue(null, "Weaver"), getValue(null, "Sigourney"), diff --git a/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnModifiedColumns_HasNumberOfModifiedColumns_Test.java b/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnModifiedColumns_HasNumberOfModifiedColumns_Test.java index 70f3330e..a5563858 100644 --- a/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnModifiedColumns_HasNumberOfModifiedColumns_Test.java +++ b/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnModifiedColumns_HasNumberOfModifiedColumns_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; @@ -26,7 +25,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; /** @@ -43,8 +41,7 @@ public class AssertionsOnModifiedColumns_HasNumberOfModifiedColumns_Test extends @Test public void test_has_number_of_modified_columns() throws Exception { WritableAssertionInfo info = new WritableAssertionInfo(); - Table table = new Table(); - TableAssert tableAssert = assertThat(table); + TableAssert tableAssert = new TableAssert(null); Row rowAtStartPoint = getRow(null, Arrays.asList("ID", "NAME", "FIRSTNAME", "BIRTH"), Arrays.asList(getValue(null, 1), getValue(null, "Weaver"), getValue(null, "Sigourney"), @@ -65,8 +62,7 @@ public void test_has_number_of_modified_columns() throws Exception { public void should_fail_because_number_of_modified_columns_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, Arrays.asList("ID", "NAME", "FIRSTNAME", "BIRTH"), Arrays.asList(getValue(null, 1), getValue(null, "Weaver"), getValue(null, "Sigourney"), diff --git a/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnNumberOfChanges_HasNumberOfChangesGreaterThanOrEqualTo_Test.java b/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnNumberOfChanges_HasNumberOfChangesGreaterThanOrEqualTo_Test.java index 96e9695a..9840e407 100644 --- a/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnNumberOfChanges_HasNumberOfChangesGreaterThanOrEqualTo_Test.java +++ b/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnNumberOfChanges_HasNumberOfChangesGreaterThanOrEqualTo_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; @@ -27,7 +26,6 @@ import org.assertj.db.type.Changes; import org.assertj.db.type.DataType; import org.assertj.db.type.Row; -import org.assertj.db.type.Table; import org.junit.Test; /** @@ -44,8 +42,7 @@ public class AssertionsOnNumberOfChanges_HasNumberOfChangesGreaterThanOrEqualTo_ @Test public void test_has_number_of_changes_greater_than_or_equal_to() throws Exception { WritableAssertionInfo info = new WritableAssertionInfo(); - Table table = new Table(); - TableAssert tableAssert = assertThat(table); + TableAssert tableAssert = new TableAssert(null); Row rowAtStartPoint = getRow(Arrays.asList("ID"), Arrays.asList("ID", "NAME", "FIRSTNAME", "BIRTH"), Arrays.asList(getValue(null, 1), getValue(null, "Weaver"), getValue(null, "Sigourney"), @@ -68,8 +65,7 @@ public void test_has_number_of_changes_greater_than_or_equal_to() throws Excepti public void should_fail_because_number_of_changes_is_less() 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(Arrays.asList("ID"), Arrays.asList("ID", "NAME", "FIRSTNAME", "BIRTH"), Arrays.asList(getValue(null, 1), getValue(null, "Weaver"), getValue(null, "Sigourney"), diff --git a/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnNumberOfChanges_HasNumberOfChangesGreaterThan_Test.java b/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnNumberOfChanges_HasNumberOfChangesGreaterThan_Test.java index 0ed570b8..7028894b 100644 --- a/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnNumberOfChanges_HasNumberOfChangesGreaterThan_Test.java +++ b/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnNumberOfChanges_HasNumberOfChangesGreaterThan_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; @@ -27,7 +26,6 @@ import org.assertj.db.type.Changes; import org.assertj.db.type.DataType; import org.assertj.db.type.Row; -import org.assertj.db.type.Table; import org.junit.Test; /** @@ -44,8 +42,7 @@ public class AssertionsOnNumberOfChanges_HasNumberOfChangesGreaterThan_Test exte @Test public void test_has_number_of_changes_greater_than_or_equal_to() throws Exception { WritableAssertionInfo info = new WritableAssertionInfo(); - Table table = new Table(); - TableAssert tableAssert = assertThat(table); + TableAssert tableAssert = new TableAssert(null); Row rowAtStartPoint = getRow(Arrays.asList("ID"), Arrays.asList("ID", "NAME", "FIRSTNAME", "BIRTH"), Arrays.asList(getValue(null, 1), getValue(null, "Weaver"), getValue(null, "Sigourney"), @@ -68,8 +65,7 @@ public void test_has_number_of_changes_greater_than_or_equal_to() throws Excepti public void should_fail_because_number_of_changes_is_less_or_equal() 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(Arrays.asList("ID"), Arrays.asList("ID", "NAME", "FIRSTNAME", "BIRTH"), Arrays.asList(getValue(null, 1), getValue(null, "Weaver"), getValue(null, "Sigourney"), diff --git a/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnNumberOfChanges_HasNumberOfChangesLessThanOrEqualTo_Test.java b/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnNumberOfChanges_HasNumberOfChangesLessThanOrEqualTo_Test.java index 07b999c9..b14ecc89 100644 --- a/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnNumberOfChanges_HasNumberOfChangesLessThanOrEqualTo_Test.java +++ b/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnNumberOfChanges_HasNumberOfChangesLessThanOrEqualTo_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; @@ -27,7 +26,6 @@ import org.assertj.db.type.Changes; import org.assertj.db.type.DataType; import org.assertj.db.type.Row; -import org.assertj.db.type.Table; import org.junit.Test; /** @@ -44,8 +42,7 @@ public class AssertionsOnNumberOfChanges_HasNumberOfChangesLessThanOrEqualTo_Tes @Test public void test_has_number_of_changes_less_than_or_equal_to() throws Exception { WritableAssertionInfo info = new WritableAssertionInfo(); - Table table = new Table(); - TableAssert tableAssert = assertThat(table); + TableAssert tableAssert = new TableAssert(null); Row rowAtStartPoint = getRow(Arrays.asList("ID"), Arrays.asList("ID", "NAME", "FIRSTNAME", "BIRTH"), Arrays.asList(getValue(null, 1), getValue(null, "Weaver"), getValue(null, "Sigourney"), @@ -68,8 +65,7 @@ public void test_has_number_of_changes_less_than_or_equal_to() throws Exception public void should_fail_because_number_of_changes_is_greater() 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(Arrays.asList("ID"), Arrays.asList("ID", "NAME", "FIRSTNAME", "BIRTH"), Arrays.asList(getValue(null, 1), getValue(null, "Weaver"), getValue(null, "Sigourney"), diff --git a/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnNumberOfChanges_HasNumberOfChangesLessThan_Test.java b/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnNumberOfChanges_HasNumberOfChangesLessThan_Test.java index 9a770747..1d196922 100644 --- a/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnNumberOfChanges_HasNumberOfChangesLessThan_Test.java +++ b/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnNumberOfChanges_HasNumberOfChangesLessThan_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; @@ -27,7 +26,6 @@ import org.assertj.db.type.Changes; import org.assertj.db.type.DataType; import org.assertj.db.type.Row; -import org.assertj.db.type.Table; import org.junit.Test; /** @@ -44,8 +42,7 @@ public class AssertionsOnNumberOfChanges_HasNumberOfChangesLessThan_Test extends @Test public void test_has_number_of_changes_less_than() throws Exception { WritableAssertionInfo info = new WritableAssertionInfo(); - Table table = new Table(); - TableAssert tableAssert = assertThat(table); + TableAssert tableAssert = new TableAssert(null); Row rowAtStartPoint = getRow(Arrays.asList("ID"), Arrays.asList("ID", "NAME", "FIRSTNAME", "BIRTH"), Arrays.asList(getValue(null, 1), getValue(null, "Weaver"), getValue(null, "Sigourney"), @@ -68,8 +65,7 @@ public void test_has_number_of_changes_less_than() throws Exception { public void should_fail_because_number_of_changes_is_greater_or_equal() 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(Arrays.asList("ID"), Arrays.asList("ID", "NAME", "FIRSTNAME", "BIRTH"), Arrays.asList(getValue(null, 1), getValue(null, "Weaver"), getValue(null, "Sigourney"), diff --git a/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnNumberOfChanges_HasNumberOfChanges_Test.java b/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnNumberOfChanges_HasNumberOfChanges_Test.java index 4b5b1d55..5a9fc417 100644 --- a/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnNumberOfChanges_HasNumberOfChanges_Test.java +++ b/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnNumberOfChanges_HasNumberOfChanges_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; @@ -27,7 +26,6 @@ import org.assertj.db.type.Changes; import org.assertj.db.type.DataType; import org.assertj.db.type.Row; -import org.assertj.db.type.Table; import org.junit.Test; /** @@ -44,8 +42,7 @@ public class AssertionsOnNumberOfChanges_HasNumberOfChanges_Test extends Abstrac @Test public void test_has_number_of_changes() throws Exception { WritableAssertionInfo info = new WritableAssertionInfo(); - Table table = new Table(); - TableAssert tableAssert = assertThat(table); + TableAssert tableAssert = new TableAssert(null); Row rowAtStartPoint = getRow(Arrays.asList("ID"), Arrays.asList("ID", "NAME", "FIRSTNAME", "BIRTH"), Arrays.asList(getValue(null, 1), getValue(null, "Weaver"), getValue(null, "Sigourney"), @@ -67,8 +64,7 @@ public void test_has_number_of_changes() throws Exception { public void should_fail_because_number_of_changes_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(Arrays.asList("ID"), Arrays.asList("ID", "NAME", "FIRSTNAME", "BIRTH"), Arrays.asList(getValue(null, 1), getValue(null, "Weaver"), getValue(null, "Sigourney"), diff --git a/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnNumberOfColumns_HasNumberOfColumnsGreaterThanOrEqualTo_Test.java b/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnNumberOfColumns_HasNumberOfColumnsGreaterThanOrEqualTo_Test.java index 292a5160..b997a575 100644 --- a/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnNumberOfColumns_HasNumberOfColumnsGreaterThanOrEqualTo_Test.java +++ b/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnNumberOfColumns_HasNumberOfColumnsGreaterThanOrEqualTo_Test.java @@ -12,13 +12,11 @@ */ 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; -import org.assertj.db.type.Table; import org.junit.Test; /** @@ -35,8 +33,7 @@ public class AssertionsOnNumberOfColumns_HasNumberOfColumnsGreaterThanOrEqualTo_ @Test public void test_has_number_of_columns_greater_than_or_equal_to() { WritableAssertionInfo info = new WritableAssertionInfo(); - Table table = new Table(); - TableAssert tableAssert = assertThat(table); + TableAssert tableAssert = new TableAssert(null); TableAssert tableAssert2 = AssertionsOnNumberOfColumns.hasNumberOfColumnsGreaterThanOrEqualTo(tableAssert, info, 3, 3); Assertions.assertThat(tableAssert2).isSameAs(tableAssert); @@ -49,8 +46,7 @@ public void test_has_number_of_columns_greater_than_or_equal_to() { public void should_fail_because_number_of_columns_is_less() { WritableAssertionInfo info = new WritableAssertionInfo(); info.description("description"); - Table table = new Table(); - TableAssert tableAssert = assertThat(table); + TableAssert tableAssert = new TableAssert(null); try { AssertionsOnNumberOfColumns.hasNumberOfColumnsGreaterThanOrEqualTo(tableAssert, info, 3, 4); fail("An exception must be raised"); diff --git a/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnNumberOfColumns_HasNumberOfColumnsGreaterThan_Test.java b/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnNumberOfColumns_HasNumberOfColumnsGreaterThan_Test.java index f46a455a..d8f93020 100644 --- a/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnNumberOfColumns_HasNumberOfColumnsGreaterThan_Test.java +++ b/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnNumberOfColumns_HasNumberOfColumnsGreaterThan_Test.java @@ -12,13 +12,11 @@ */ 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; -import org.assertj.db.type.Table; import org.junit.Test; /** @@ -35,8 +33,7 @@ public class AssertionsOnNumberOfColumns_HasNumberOfColumnsGreaterThan_Test { @Test public void test_has_number_of_columns_greater_than() { WritableAssertionInfo info = new WritableAssertionInfo(); - Table table = new Table(); - TableAssert tableAssert = assertThat(table); + TableAssert tableAssert = new TableAssert(null); TableAssert tableAssert2 = AssertionsOnNumberOfColumns.hasNumberOfColumnsGreaterThan(tableAssert, info, 3, 2); Assertions.assertThat(tableAssert2).isSameAs(tableAssert); } @@ -48,8 +45,7 @@ public void test_has_number_of_columns_greater_than() { public void should_fail_because_number_of_columns_is_equal() { WritableAssertionInfo info = new WritableAssertionInfo(); info.description("description"); - Table table = new Table(); - TableAssert tableAssert = assertThat(table); + TableAssert tableAssert = new TableAssert(null); try { AssertionsOnNumberOfColumns.hasNumberOfColumnsGreaterThan(tableAssert, info, 3, 3); fail("An exception must be raised"); diff --git a/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnNumberOfColumns_HasNumberOfColumnsLessThanOrEqualTo_Test.java b/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnNumberOfColumns_HasNumberOfColumnsLessThanOrEqualTo_Test.java index 459bcd68..040f5d3a 100644 --- a/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnNumberOfColumns_HasNumberOfColumnsLessThanOrEqualTo_Test.java +++ b/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnNumberOfColumns_HasNumberOfColumnsLessThanOrEqualTo_Test.java @@ -12,13 +12,11 @@ */ 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; -import org.assertj.db.type.Table; import org.junit.Test; /** @@ -35,8 +33,7 @@ public class AssertionsOnNumberOfColumns_HasNumberOfColumnsLessThanOrEqualTo_Tes @Test public void test_has_number_of_columns_less_than_or_equal_to() { WritableAssertionInfo info = new WritableAssertionInfo(); - Table table = new Table(); - TableAssert tableAssert = assertThat(table); + TableAssert tableAssert = new TableAssert(null); TableAssert tableAssert2 = AssertionsOnNumberOfColumns.hasNumberOfColumnsLessThanOrEqualTo(tableAssert, info, 3, 3); Assertions.assertThat(tableAssert2).isSameAs(tableAssert); } @@ -48,8 +45,7 @@ public void test_has_number_of_columns_less_than_or_equal_to() { public void should_fail_because_number_of_columns_is_more() { WritableAssertionInfo info = new WritableAssertionInfo(); info.description("description"); - Table table = new Table(); - TableAssert tableAssert = assertThat(table); + TableAssert tableAssert = new TableAssert(null); try { AssertionsOnNumberOfColumns.hasNumberOfColumnsLessThanOrEqualTo(tableAssert, info, 3, 2); fail("An exception must be raised"); diff --git a/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnNumberOfColumns_HasNumberOfColumnsLessThan_Test.java b/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnNumberOfColumns_HasNumberOfColumnsLessThan_Test.java index bac6f45c..5dbea0af 100644 --- a/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnNumberOfColumns_HasNumberOfColumnsLessThan_Test.java +++ b/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnNumberOfColumns_HasNumberOfColumnsLessThan_Test.java @@ -12,13 +12,11 @@ */ 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; -import org.assertj.db.type.Table; import org.junit.Test; /** @@ -35,8 +33,7 @@ public class AssertionsOnNumberOfColumns_HasNumberOfColumnsLessThan_Test { @Test public void test_has_number_of_columns_less_than() { WritableAssertionInfo info = new WritableAssertionInfo(); - Table table = new Table(); - TableAssert tableAssert = assertThat(table); + TableAssert tableAssert = new TableAssert(null); TableAssert tableAssert2 = AssertionsOnNumberOfColumns.hasNumberOfColumnsLessThan(tableAssert, info, 3, 4); Assertions.assertThat(tableAssert2).isSameAs(tableAssert); } @@ -48,8 +45,7 @@ public void test_has_number_of_columns_less_than() { public void should_fail_because_number_of_columns_is_equal() { WritableAssertionInfo info = new WritableAssertionInfo(); info.description("description"); - Table table = new Table(); - TableAssert tableAssert = assertThat(table); + TableAssert tableAssert = new TableAssert(null); try { AssertionsOnNumberOfColumns.hasNumberOfColumnsLessThan(tableAssert, info, 3, 3); fail("An exception must be raised"); diff --git a/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnNumberOfColumns_HasNumberOfColumns_Test.java b/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnNumberOfColumns_HasNumberOfColumns_Test.java index 3b3ed9bc..7d941139 100644 --- a/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnNumberOfColumns_HasNumberOfColumns_Test.java +++ b/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnNumberOfColumns_HasNumberOfColumns_Test.java @@ -12,13 +12,11 @@ */ 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; -import org.assertj.db.type.Table; import org.junit.Test; /** @@ -35,8 +33,7 @@ public class AssertionsOnNumberOfColumns_HasNumberOfColumns_Test { @Test public void test_has_number_of_columns() { WritableAssertionInfo info = new WritableAssertionInfo(); - Table table = new Table(); - TableAssert tableAssert = assertThat(table); + TableAssert tableAssert = new TableAssert(null); TableAssert tableAssert2 = AssertionsOnNumberOfColumns.hasNumberOfColumns(tableAssert, info, 3, 3); Assertions.assertThat(tableAssert2).isSameAs(tableAssert); } @@ -48,8 +45,7 @@ public void test_has_number_of_columns() { public void should_fail_because_number_of_columns_is_different() { WritableAssertionInfo info = new WritableAssertionInfo(); info.description("description"); - Table table = new Table(); - TableAssert tableAssert = assertThat(table); + TableAssert tableAssert = new TableAssert(null); try { AssertionsOnNumberOfColumns.hasNumberOfColumns(tableAssert, info, 3, 4); fail("An exception must be raised"); diff --git a/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnNumberOfRows_HasNumberOfRowsGreaterThanOrEqualTo_Test.java b/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnNumberOfRows_HasNumberOfRowsGreaterThanOrEqualTo_Test.java index f947ac03..a0daf3fc 100644 --- a/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnNumberOfRows_HasNumberOfRowsGreaterThanOrEqualTo_Test.java +++ b/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnNumberOfRows_HasNumberOfRowsGreaterThanOrEqualTo_Test.java @@ -12,13 +12,11 @@ */ 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; -import org.assertj.db.type.Table; import org.junit.Test; /** @@ -35,8 +33,7 @@ public class AssertionsOnNumberOfRows_HasNumberOfRowsGreaterThanOrEqualTo_Test { @Test public void test_has_number_of_rows_greater_than_or_equal_to() { WritableAssertionInfo info = new WritableAssertionInfo(); - Table table = new Table(); - TableAssert tableAssert = assertThat(table); + TableAssert tableAssert = new TableAssert(null); TableAssert tableAssert2 = AssertionsOnNumberOfRows.hasNumberOfRowsGreaterThanOrEqualTo(tableAssert, info, 8, 8); Assertions.assertThat(tableAssert2).isSameAs(tableAssert); } @@ -48,8 +45,7 @@ public void test_has_number_of_rows_greater_than_or_equal_to() { public void should_fail_because_number_of_rows_is_less() { WritableAssertionInfo info = new WritableAssertionInfo(); info.description("description"); - Table table = new Table(); - TableAssert tableAssert = assertThat(table); + TableAssert tableAssert = new TableAssert(null); try { AssertionsOnNumberOfRows.hasNumberOfRowsGreaterThanOrEqualTo(tableAssert, info, 8, 9); fail("An exception must be raised"); diff --git a/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnNumberOfRows_HasNumberOfRowsGreaterThan_Test.java b/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnNumberOfRows_HasNumberOfRowsGreaterThan_Test.java index 0f6835c4..2450330b 100644 --- a/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnNumberOfRows_HasNumberOfRowsGreaterThan_Test.java +++ b/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnNumberOfRows_HasNumberOfRowsGreaterThan_Test.java @@ -12,13 +12,11 @@ */ 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; -import org.assertj.db.type.Table; import org.junit.Test; /** @@ -35,8 +33,7 @@ public class AssertionsOnNumberOfRows_HasNumberOfRowsGreaterThan_Test { @Test public void test_has_number_of_rows_greater() { WritableAssertionInfo info = new WritableAssertionInfo(); - Table table = new Table(); - TableAssert tableAssert = assertThat(table); + TableAssert tableAssert = new TableAssert(null); TableAssert tableAssert2 = AssertionsOnNumberOfRows.hasNumberOfRowsGreaterThan(tableAssert, info, 8, 7); Assertions.assertThat(tableAssert2).isSameAs(tableAssert); } @@ -48,8 +45,7 @@ public void test_has_number_of_rows_greater() { public void should_fail_because_number_of_rows_is_less_than_or_equal() { WritableAssertionInfo info = new WritableAssertionInfo(); info.description("description"); - Table table = new Table(); - TableAssert tableAssert = assertThat(table); + TableAssert tableAssert = new TableAssert(null); try { AssertionsOnNumberOfRows.hasNumberOfRowsGreaterThan(tableAssert, info, 8, 8); fail("An exception must be raised"); diff --git a/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnNumberOfRows_HasNumberOfRowsLessThanOrEqualTo_Test.java b/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnNumberOfRows_HasNumberOfRowsLessThanOrEqualTo_Test.java index b910c000..0de442a3 100644 --- a/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnNumberOfRows_HasNumberOfRowsLessThanOrEqualTo_Test.java +++ b/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnNumberOfRows_HasNumberOfRowsLessThanOrEqualTo_Test.java @@ -12,13 +12,11 @@ */ 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; -import org.assertj.db.type.Table; import org.junit.Test; /** @@ -35,8 +33,7 @@ public class AssertionsOnNumberOfRows_HasNumberOfRowsLessThanOrEqualTo_Test { @Test public void test_has_number_of_rows_less_than_or_equal_to() { WritableAssertionInfo info = new WritableAssertionInfo(); - Table table = new Table(); - TableAssert tableAssert = assertThat(table); + TableAssert tableAssert = new TableAssert(null); TableAssert tableAssert2 = AssertionsOnNumberOfRows.hasNumberOfRowsLessThanOrEqualTo(tableAssert, info, 8, 8); Assertions.assertThat(tableAssert2).isSameAs(tableAssert); } @@ -48,8 +45,7 @@ public void test_has_number_of_rows_less_than_or_equal_to() { public void should_fail_because_number_of_rows_is_greater() { WritableAssertionInfo info = new WritableAssertionInfo(); info.description("description"); - Table table = new Table(); - TableAssert tableAssert = assertThat(table); + TableAssert tableAssert = new TableAssert(null); try { AssertionsOnNumberOfRows.hasNumberOfRowsLessThanOrEqualTo(tableAssert, info, 8, 7); fail("An exception must be raised"); diff --git a/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnNumberOfRows_HasNumberOfRowsLessThan_Test.java b/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnNumberOfRows_HasNumberOfRowsLessThan_Test.java index 1b698271..9a557c22 100644 --- a/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnNumberOfRows_HasNumberOfRowsLessThan_Test.java +++ b/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnNumberOfRows_HasNumberOfRowsLessThan_Test.java @@ -12,13 +12,11 @@ */ 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; -import org.assertj.db.type.Table; import org.junit.Test; /** @@ -35,8 +33,7 @@ public class AssertionsOnNumberOfRows_HasNumberOfRowsLessThan_Test { @Test public void test_has_number_of_rows_less() { WritableAssertionInfo info = new WritableAssertionInfo(); - Table table = new Table(); - TableAssert tableAssert = assertThat(table); + TableAssert tableAssert = new TableAssert(null); TableAssert tableAssert2 = AssertionsOnNumberOfRows.hasNumberOfRowsLessThan(tableAssert, info, 8, 9); Assertions.assertThat(tableAssert2).isSameAs(tableAssert); } @@ -48,8 +45,7 @@ public void test_has_number_of_rows_less() { public void should_fail_because_number_of_rows_is_greater_than_or_equal() { WritableAssertionInfo info = new WritableAssertionInfo(); info.description("description"); - Table table = new Table(); - TableAssert tableAssert = assertThat(table); + TableAssert tableAssert = new TableAssert(null); try { AssertionsOnNumberOfRows.hasNumberOfRowsLessThan(tableAssert, info, 8, 8); fail("An exception must be raised"); diff --git a/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnNumberOfRows_HasNumberOfRows_Test.java b/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnNumberOfRows_HasNumberOfRows_Test.java index 5fc6aa43..7033d7da 100644 --- a/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnNumberOfRows_HasNumberOfRows_Test.java +++ b/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnNumberOfRows_HasNumberOfRows_Test.java @@ -12,13 +12,11 @@ */ 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; -import org.assertj.db.type.Table; import org.junit.Test; /** @@ -35,8 +33,7 @@ public class AssertionsOnNumberOfRows_HasNumberOfRows_Test { @Test public void test_has_number_of_rows() { WritableAssertionInfo info = new WritableAssertionInfo(); - Table table = new Table(); - TableAssert tableAssert = assertThat(table); + TableAssert tableAssert = new TableAssert(null); TableAssert tableAssert2 = AssertionsOnNumberOfRows.hasNumberOfRows(tableAssert, info, 8, 8); Assertions.assertThat(tableAssert2).isSameAs(tableAssert); } @@ -48,8 +45,7 @@ public void test_has_number_of_rows() { public void should_fail_because_number_of_rows_is_different() { WritableAssertionInfo info = new WritableAssertionInfo(); info.description("description"); - Table table = new Table(); - TableAssert tableAssert = assertThat(table); + TableAssert tableAssert = new TableAssert(null); try { AssertionsOnNumberOfRows.hasNumberOfRows(tableAssert, info, 8, 9); fail("An exception must be raised"); diff --git a/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnPrimaryKey_HasPksNames_Test.java b/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnPrimaryKey_HasPksNames_Test.java index b04f5189..fdb13ce4 100644 --- a/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnPrimaryKey_HasPksNames_Test.java +++ b/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnPrimaryKey_HasPksNames_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; @@ -26,7 +25,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.assertj.db.type.lettercase.CaseComparisons; import org.assertj.db.type.lettercase.CaseConversions; import org.assertj.db.type.lettercase.LetterCase; @@ -46,8 +44,7 @@ public class AssertionsOnPrimaryKey_HasPksNames_Test extends AbstractTest { @Test public void test_has_pks_names() throws Exception { WritableAssertionInfo info = new WritableAssertionInfo(); - Table table = new Table(); - TableAssert tableAssert = assertThat(table); + TableAssert tableAssert = new TableAssert(null); Row rowAtStartPoint = getRow(Arrays.asList("ID", "ID2"), Arrays.asList("ID", "NAME", "FIRSTNAME", "BIRTH"), Arrays.asList(getValue(null, 1), getValue(null, "Weaver"), getValue(null, "Sigourney"), @@ -72,8 +69,7 @@ public void test_has_pks_names() throws Exception { public void should_fail_because_pks_names_are_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(Arrays.asList("ID", "ID2"), Arrays.asList("ID", "NAME", "FIRSTNAME", "BIRTH"), Arrays.asList(getValue(null, 1), getValue(null, "Weaver"), getValue(null, "Sigourney"), @@ -124,8 +120,7 @@ public void should_fail_because_pks_names_are_different() throws Exception { public void should_fail_because_number_of_pks_names_are_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(Arrays.asList("ID", "ID2"), Arrays.asList("ID", "NAME", "FIRSTNAME", "BIRTH"), Arrays.asList(getValue(null, 1), getValue(null, "Weaver"), getValue(null, "Sigourney"), @@ -164,8 +159,7 @@ public void should_fail_because_number_of_pks_names_are_different() throws Excep public void should_fail_because_expected_name_must_be_not_null() 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(Arrays.asList("ID", "ID2"), Arrays.asList("ID", "NAME", "FIRSTNAME", "BIRTH"), Arrays.asList(getValue(null, 1), getValue(null, "Weaver"), getValue(null, "Sigourney"), @@ -190,8 +184,7 @@ public void should_fail_because_expected_name_must_be_not_null() throws Exceptio public void should_fail_because_expected_names_must_be_not_null() 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(Arrays.asList("ID", "ID2"), Arrays.asList("ID", "NAME", "FIRSTNAME", "BIRTH"), Arrays.asList(getValue(null, 1), getValue(null, "Weaver"), getValue(null, "Sigourney"), diff --git a/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnPrimaryKey_HasPksValues_Test.java b/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnPrimaryKey_HasPksValues_Test.java index f14d3979..f7a8fc09 100644 --- a/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnPrimaryKey_HasPksValues_Test.java +++ b/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnPrimaryKey_HasPksValues_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; @@ -26,7 +25,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; /** @@ -43,8 +41,7 @@ public class AssertionsOnPrimaryKey_HasPksValues_Test extends AbstractTest { @Test public void test_has_pks_values() throws Exception { WritableAssertionInfo info = new WritableAssertionInfo(); - Table table = new Table(); - TableAssert tableAssert = assertThat(table); + TableAssert tableAssert = new TableAssert(null); Row rowAtStartPoint = getRow(Arrays.asList("ID", "NAME"), Arrays.asList("ID", "NAME", "FIRSTNAME", "BIRTH"), Arrays.asList(getValue(null, 1), getValue(null, "Weaver"), getValue(null, "Sigourney"), @@ -65,8 +62,7 @@ public void test_has_pks_values() throws Exception { public void should_fail_because_pks_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); Row rowAtStartPoint = getRow(Arrays.asList("ID", "NAME"), Arrays.asList("ID", "NAME", "FIRSTNAME", "BIRTH"), Arrays.asList(getValue(null, 1), getValue(null, "Weaver"), getValue(null, "Sigourney"), @@ -95,8 +91,7 @@ public void should_fail_because_pks_values_are_different() throws Exception { public void should_fail_because_number_of_pks_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); Row rowAtStartPoint = getRow(Arrays.asList("ID", "NAME"), Arrays.asList("ID", "NAME", "FIRSTNAME", "BIRTH"), Arrays.asList(getValue(null, 1), getValue(null, "Weaver"), getValue(null, "Sigourney"), diff --git a/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnRowCondition_HasValues_Satisfying_Test.java b/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnRowCondition_HasValues_Satisfying_Test.java index 60b3ad0b..9c5de919 100644 --- a/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnRowCondition_HasValues_Satisfying_Test.java +++ b/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnRowCondition_HasValues_Satisfying_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; @@ -27,7 +26,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.hamcrest.CoreMatchers; import org.junit.Test; @@ -46,8 +44,7 @@ public class AssertionsOnRowCondition_HasValues_Satisfying_Test extends Abstract @Test public void test_has_values_satisfying() throws Exception { WritableAssertionInfo info = new WritableAssertionInfo(); - Table table = new Table(); - TableAssert tableAssert = assertThat(table); + TableAssert tableAssert = new TableAssert(null); List list = Arrays.asList(getValue(null, 1), getValue(null, "Weaver"), getValue(null, "Sigourney"), @@ -73,8 +70,7 @@ public void test_has_values_satisfying() 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, 1), getValue(null, "Weaver"), getValue(null, "Sigourney"), @@ -102,8 +98,7 @@ public void should_fail_because_values_are_different() throws Exception { public void should_fail_because_values_not_satisfying() 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, 1), getValue(null, "Weaver"), getValue(null, "Sigourney"), @@ -127,8 +122,7 @@ public void should_fail_because_values_not_satisfying() throws Exception { public void should_fail_because_types_are_not_compatible() 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, 1), getValue(null, "Weaver"), getValue(null, null), @@ -172,8 +166,7 @@ public void should_fail_because_types_are_not_compatible() throws Exception { public void should_fail_because_bytes_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, 1), getValue(null, new byte[]{0, 1}), getValue(null, "Sigourney"), getValue(null, Date.valueOf("1949-10-08")))); diff --git a/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnRowEquality_HasValues_Test.java b/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnRowEquality_HasValues_Test.java index 83facd98..74d935fc 100644 --- a/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnRowEquality_HasValues_Test.java +++ b/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnRowEquality_HasValues_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.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; @@ -43,8 +41,7 @@ public class AssertionsOnRowEquality_HasValues_Test extends AbstractTest { @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, 1), getValue(null, "Weaver"), getValue(null, "Sigourney"), getValue(null, Date.valueOf("1949-10-08")), getValue(null, new Locale("fr")))); @@ -60,8 +57,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, 1), getValue(null, "Weaver"), getValue(null, "Sigourney"), getValue(null, Date.valueOf("1949-10-08")))); @@ -84,8 +80,7 @@ public void should_fail_because_values_are_different() throws Exception { public void should_fail_because_types_are_not_compatible() 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, 1), getValue(null, "Weaver"), getValue(null, null), getValue(null, Date.valueOf("1949-10-08")))); @@ -128,8 +123,7 @@ public void should_fail_because_types_are_not_compatible() throws Exception { public void should_fail_because_bytes_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, 1), getValue(null, new byte[]{0, 1}), getValue(null, "Sigourney"), getValue(null, Date.valueOf("1949-10-08")))); diff --git a/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnRowOfChangeExistence_DoesNotExist_Test.java b/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnRowOfChangeExistence_DoesNotExist_Test.java index 0dd9ccdd..30a1f486 100644 --- a/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnRowOfChangeExistence_DoesNotExist_Test.java +++ b/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnRowOfChangeExistence_DoesNotExist_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; @@ -23,7 +22,6 @@ import org.assertj.db.api.TableAssert; import org.assertj.db.common.AbstractTest; import org.assertj.db.type.Row; -import org.assertj.db.type.Table; import org.junit.Test; /** @@ -40,8 +38,7 @@ public class AssertionsOnRowOfChangeExistence_DoesNotExist_Test extends Abstract @Test public void test_does_not_exists() throws Exception { WritableAssertionInfo info = new WritableAssertionInfo(); - Table table = new Table(); - TableAssert tableAssert = assertThat(table); + TableAssert tableAssert = new TableAssert(null); TableAssert tableAssert2 = AssertionsOnRowOfChangeExistence.doesNotExist(tableAssert, info, null); Assertions.assertThat(tableAssert2).isSameAs(tableAssert); } @@ -53,8 +50,7 @@ public void test_does_not_exists() throws Exception { public void should_fail_because_row_exists() throws Exception { WritableAssertionInfo info = new WritableAssertionInfo(); info.description("description"); - Table table = new Table(); - TableAssert tableAssert = assertThat(table); + TableAssert tableAssert = new TableAssert(null); Row row = getRow(null, Arrays.asList("ID", "NAME", "FIRSTNAME", "BIRTH"), Arrays.asList(getValue(null, 1), getValue(null, "Weaver"), getValue(null, "Sigourney"), getValue(null, Date.valueOf("1949-10-08")))); 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 07fdc600..8b3e8be6 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,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; @@ -23,7 +22,6 @@ import org.assertj.db.api.TableAssert; import org.assertj.db.common.AbstractTest; import org.assertj.db.type.Row; -import org.assertj.db.type.Table; import org.junit.Test; /** @@ -40,8 +38,7 @@ public class AssertionsOnRowOfChangeExistence_Exists_Test extends AbstractTest { @Test public void test_exists() throws Exception { WritableAssertionInfo info = new WritableAssertionInfo(); - Table table = new Table(); - TableAssert tableAssert = assertThat(table); + TableAssert tableAssert = new TableAssert(null); Row row = getRow(null, Arrays.asList("ID", "NAME", "FIRSTNAME", "BIRTH"), Arrays.asList(getValue(null, 1), getValue(null, "Weaver"), getValue(null, "Sigourney"), getValue(null, Date.valueOf("1949-10-08")))); @@ -56,8 +53,7 @@ public void test_exists() throws Exception { public void should_fail_because_row_does_not_exist() throws Exception { WritableAssertionInfo info = new WritableAssertionInfo(); info.description("description"); - Table table = new Table(); - TableAssert tableAssert = assertThat(table); + TableAssert tableAssert = new TableAssert(null); try { AssertionsOnRowOfChangeExistence.exists(tableAssert, info, null); fail("An exception must be raised"); 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 3c18f841..0321affa 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,9 +12,9 @@ */ package org.assertj.db.api.assertions.impl; -import static org.assertj.db.api.Assertions.assertThat; import static org.junit.Assert.fail; +import java.sql.SQLException; import javax.sql.DataSource; import org.assertj.core.api.Assertions; @@ -22,8 +22,8 @@ import org.assertj.db.api.AbstractDbAssert; import org.assertj.db.api.TableAssert; import org.assertj.db.common.AbstractTest; +import org.assertj.db.common.DefaultConnectionProvider; import org.assertj.db.type.JdbcUrlConnectionProvider; -import org.assertj.db.type.Table; import org.junit.Test; /** @@ -38,35 +38,25 @@ public class AssertionsOnTableExistence_DoesNotExist_Test extends AbstractTest { * This method tests the {@code doesNotExists} assertion method. */ @Test - public void test_does_not_exists() { + public void test_does_not_exists() throws SQLException { + DefaultConnectionProvider connectionProvider = new DefaultConnectionProvider(this.dataSource.getConnection()); WritableAssertionInfo info = new WritableAssertionInfo(); - Table table = new Table(); - TableAssert tableAssert = assertThat(table); - TableAssert tableAssert2 = AssertionsOnTableExistence.doesNotExists(tableAssert, info, "not-exist-test", jdbcConnectionProvider); + TableAssert tableAssert = new TableAssert(null); + TableAssert tableAssert2 = AssertionsOnTableExistence.doesNotExists(tableAssert, info, "not-exist-test", connectionProvider); Assertions.assertThat(tableAssert2).isSameAs(tableAssert); - TableAssert tableAssert3 = AssertionsOnTableExistence.doesNotExists(tableAssert, info, "not-exist-test", dsConnectionProvider); - Assertions.assertThat(tableAssert3).isSameAs(tableAssert); } /** * This method should fail because the table exists. */ @Test - public void should_fail_because_table_exists() { + public void should_fail_because_table_exists() throws SQLException { + DefaultConnectionProvider connectionProvider = new DefaultConnectionProvider(this.dataSource.getConnection()); WritableAssertionInfo info = new WritableAssertionInfo(); info.description("description"); - Table table = new Table(); - TableAssert tableAssert = assertThat(table); + TableAssert tableAssert = new TableAssert(null); try { - AssertionsOnTableExistence.doesNotExists(tableAssert, info, "TEST", jdbcConnectionProvider); - fail("An exception must be raised"); - } catch (AssertionError e) { - Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[description] %n" - + "Expecting not exist but exists")); - } - - try { - AssertionsOnTableExistence.doesNotExists(tableAssert, info, "TEST", dsConnectionProvider); + AssertionsOnTableExistence.doesNotExists(tableAssert, info, "TEST", connectionProvider); 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 1bb0e369..9646523d 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 @@ -12,23 +12,21 @@ */ 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 java.sql.SQLException; 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.JdbcUrlConnectionProvider; -import org.assertj.db.type.Table; +import org.assertj.db.common.DefaultConnectionProvider; import org.junit.Test; /** * Tests on {@link AssertionsOnTableExistence} class : - * {@link AssertionsOnTableExistence#exists(AbstractDbAssert, WritableAssertionInfo, String, JdbcUrlConnectionProvider, DataSource)} method. + * {@link AssertionsOnTableExistence#exists(AbstractDbAssert, WritableAssertionInfo, String, org.assertj.db.type.ConnectionProvider)} method. * * @author Julien Roy */ @@ -38,35 +36,25 @@ public class AssertionsOnTableExistence_Exists_Test extends AbstractTest { * This method tests the {@code exists} assertion method. */ @Test - public void test_exists() { + public void test_exists() throws SQLException { + DefaultConnectionProvider connectionProvider = new DefaultConnectionProvider(this.dataSource.getConnection()); WritableAssertionInfo info = new WritableAssertionInfo(); - Table table = new Table(); - TableAssert tableAssert = assertThat(table); - TableAssert tableAssert2 = AssertionsOnTableExistence.exists(tableAssert, info, "TEST", jdbcConnectionProvider); + TableAssert tableAssert = new TableAssert(null); + TableAssert tableAssert2 = AssertionsOnTableExistence.exists(tableAssert, info, "TEST", connectionProvider); Assertions.assertThat(tableAssert2).isSameAs(tableAssert); - TableAssert tableAssert3 = AssertionsOnTableExistence.exists(tableAssert, info, "TEST", dsConnectionProvider); - Assertions.assertThat(tableAssert3).isSameAs(tableAssert); } /** * This method should fail because the table does not exist. */ @Test - public void should_fail_because_table_does_not_exist() { + public void should_fail_because_table_does_not_exist() throws SQLException { + DefaultConnectionProvider connectionProvider = new DefaultConnectionProvider(this.dataSource.getConnection()); WritableAssertionInfo info = new WritableAssertionInfo(); info.description("description"); - Table table = new Table(); - TableAssert tableAssert = assertThat(table); + TableAssert tableAssert = new TableAssert(null); try { - 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" - + "Expecting exist but do not exist")); - } - - try { - AssertionsOnTableExistence.exists(tableAssert, info, "not-exist-test", dsConnectionProvider); + AssertionsOnTableExistence.exists(tableAssert, info, "not-exist-test", connectionProvider); 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/AssertionsOnValueChronology_IsAfterOrEqualTo_DateTimeValue_Test.java b/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnValueChronology_IsAfterOrEqualTo_DateTimeValue_Test.java index 2fd0f964..f2840046 100644 --- a/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnValueChronology_IsAfterOrEqualTo_DateTimeValue_Test.java +++ b/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnValueChronology_IsAfterOrEqualTo_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.Date; @@ -24,7 +23,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.junit.Test; @@ -42,8 +40,7 @@ public class AssertionsOnValueChronology_IsAfterOrEqualTo_DateTimeValue_Test ext @Test public void test_is_after_or_equal_to() throws Exception { WritableAssertionInfo info = new WritableAssertionInfo(); - Table table = new Table(); - TableAssert tableAssert = assertThat(table); + TableAssert tableAssert = new TableAssert(null); TableAssert tableAssert2 = AssertionsOnValueChronology.isAfterOrEqualTo(tableAssert, info, getValue(null, Timestamp.valueOf( "2007-12-23 09:01:05")), @@ -74,8 +71,7 @@ public void test_is_after_or_equal_to() throws Exception { public void should_fail_because_value_is_before() throws Exception { WritableAssertionInfo info = new WritableAssertionInfo(); info.description("description"); - Table table = new Table(); - TableAssert tableAssert = assertThat(table); + TableAssert tableAssert = new TableAssert(null); try { AssertionsOnValueChronology.isAfterOrEqualTo(tableAssert, info, getValue(null, Timestamp.valueOf("2007-12-23 09:01:05")), @@ -110,8 +106,7 @@ public void should_fail_because_value_is_before() throws Exception { public void should_fail_because_value_is_not_compatible() throws Exception { WritableAssertionInfo info = new WritableAssertionInfo(); info.description("description"); - Table table = new Table(); - TableAssert tableAssert = assertThat(table); + TableAssert tableAssert = new TableAssert(null); try { AssertionsOnValueChronology.isAfterOrEqualTo(tableAssert, info, getValue(null, "test"), diff --git a/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnValueChronology_IsAfterOrEqualTo_DateValue_Test.java b/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnValueChronology_IsAfterOrEqualTo_DateValue_Test.java index c1076f19..e822e2b7 100644 --- a/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnValueChronology_IsAfterOrEqualTo_DateValue_Test.java +++ b/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnValueChronology_IsAfterOrEqualTo_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; @@ -23,7 +22,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.junit.Test; /** @@ -40,8 +38,7 @@ public class AssertionsOnValueChronology_IsAfterOrEqualTo_DateValue_Test extends @Test public void test_is_after_or_equal_to() throws Exception { WritableAssertionInfo info = new WritableAssertionInfo(); - Table table = new Table(); - TableAssert tableAssert = assertThat(table); + TableAssert tableAssert = new TableAssert(null); TableAssert tableAssert2 = AssertionsOnValueChronology.isAfterOrEqualTo(tableAssert, info, getValue(null, Timestamp.valueOf("2007-12-23 00:00:00")), DateValue.of(2007, 12, 23)); @@ -67,8 +64,7 @@ public void test_is_after_or_equal_to() throws Exception { public void should_fail_because_value_is_before() throws Exception { WritableAssertionInfo info = new WritableAssertionInfo(); info.description("description"); - Table table = new Table(); - TableAssert tableAssert = assertThat(table); + TableAssert tableAssert = new TableAssert(null); try { AssertionsOnValueChronology.isAfterOrEqualTo(tableAssert, info, getValue(null, Timestamp.valueOf("2007-12-23 09:01:05")), @@ -102,8 +98,7 @@ public void should_fail_because_value_is_before() throws Exception { public void should_fail_because_value_is_not_compatible() throws Exception { WritableAssertionInfo info = new WritableAssertionInfo(); info.description("description"); - Table table = new Table(); - TableAssert tableAssert = assertThat(table); + TableAssert tableAssert = new TableAssert(null); try { AssertionsOnValueChronology.isAfterOrEqualTo(tableAssert, info, getValue(null, "test"), diff --git a/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnValueChronology_IsAfterOrEqualTo_String_Test.java b/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnValueChronology_IsAfterOrEqualTo_String_Test.java index 760eb6c3..ae6437fc 100644 --- a/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnValueChronology_IsAfterOrEqualTo_String_Test.java +++ b/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnValueChronology_IsAfterOrEqualTo_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.sql.Date; @@ -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.junit.Test; /** @@ -41,8 +39,7 @@ public class AssertionsOnValueChronology_IsAfterOrEqualTo_String_Test extends Ab @Test public void test_is_after_or_equal_to() throws Exception { WritableAssertionInfo info = new WritableAssertionInfo(); - Table table = new Table(); - TableAssert tableAssert = assertThat(table); + TableAssert tableAssert = new TableAssert(null); TableAssert tableAssert2 = AssertionsOnValueChronology.isAfterOrEqualTo(tableAssert, info, getValue(null, Timestamp.valueOf( "2007-12-23 09:01:05")), @@ -93,8 +90,7 @@ public void test_is_after_or_equal_to() throws Exception { public void should_fail_because_value_is_before() throws Exception { WritableAssertionInfo info = new WritableAssertionInfo(); info.description("description"); - Table table = new Table(); - TableAssert tableAssert = assertThat(table); + TableAssert tableAssert = new TableAssert(null); try { AssertionsOnValueChronology.isAfterOrEqualTo(tableAssert, info, getValue(null, Timestamp.valueOf("2007-12-23 09:01:05")), @@ -164,8 +160,7 @@ public void should_fail_because_value_is_before() throws Exception { public void should_fail_because_value_is_not_compatible() throws Exception { WritableAssertionInfo info = new WritableAssertionInfo(); info.description("description"); - Table table = new Table(); - TableAssert tableAssert = assertThat(table); + TableAssert tableAssert = new TableAssert(null); try { AssertionsOnValueChronology.isAfterOrEqualTo(tableAssert, info, getValue(null, "test"), @@ -189,8 +184,7 @@ public void should_fail_because_value_is_not_compatible() throws Exception { public void should_fail_because_expected_string_is_not_correct_to_compare_to_time() throws Exception { WritableAssertionInfo info = new WritableAssertionInfo(); info.description("description"); - Table table = new Table(); - TableAssert tableAssert = assertThat(table); + TableAssert tableAssert = new TableAssert(null); try { AssertionsOnValueChronology.isAfterOrEqualTo(tableAssert, info, getValue(null, Time.valueOf("09:01:05")), @@ -208,8 +202,7 @@ public void should_fail_because_expected_string_is_not_correct_to_compare_to_tim public void should_fail_because_expected_string_is_not_correct_to_compare_to() throws Exception { WritableAssertionInfo info = new WritableAssertionInfo(); info.description("description"); - Table table = new Table(); - TableAssert tableAssert = assertThat(table); + TableAssert tableAssert = new TableAssert(null); try { AssertionsOnValueChronology.isAfterOrEqualTo(tableAssert, info, getValue(null, Date.valueOf("2007-12-23")), diff --git a/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnValueChronology_IsAfterOrEqualTo_TimeValue_Test.java b/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnValueChronology_IsAfterOrEqualTo_TimeValue_Test.java index 3b5173df..97384bd1 100644 --- a/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnValueChronology_IsAfterOrEqualTo_TimeValue_Test.java +++ b/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnValueChronology_IsAfterOrEqualTo_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; @@ -21,7 +20,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.junit.Test; @@ -39,8 +37,7 @@ public class AssertionsOnValueChronology_IsAfterOrEqualTo_TimeValue_Test extends @Test public void test_is_after_or_equal_to() throws Exception { WritableAssertionInfo info = new WritableAssertionInfo(); - Table table = new Table(); - TableAssert tableAssert = assertThat(table); + TableAssert tableAssert = new TableAssert(null); TableAssert tableAssert2 = AssertionsOnValueChronology.isAfterOrEqualTo(tableAssert, info, getValue(null, Time.valueOf("09:01:05")), TimeValue.of(9, 1, 5)); @@ -58,8 +55,7 @@ public void test_is_after_or_equal_to() throws Exception { public void should_fail_because_value_is_before() throws Exception { WritableAssertionInfo info = new WritableAssertionInfo(); info.description("description"); - Table table = new Table(); - TableAssert tableAssert = assertThat(table); + TableAssert tableAssert = new TableAssert(null); try { AssertionsOnValueChronology.isAfterOrEqualTo(tableAssert, info, getValue(null, Time.valueOf("09:01:05")), @@ -81,8 +77,7 @@ public void should_fail_because_value_is_before() throws Exception { public void should_fail_because_value_is_not_compatible() throws Exception { WritableAssertionInfo info = new WritableAssertionInfo(); info.description("description"); - Table table = new Table(); - TableAssert tableAssert = assertThat(table); + TableAssert tableAssert = new TableAssert(null); try { AssertionsOnValueChronology.isAfterOrEqualTo(tableAssert, info, getValue(null, "test"), diff --git a/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnValueChronology_IsAfter_DateTimeValue_Test.java b/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnValueChronology_IsAfter_DateTimeValue_Test.java index 70044e3a..b2c626c8 100644 --- a/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnValueChronology_IsAfter_DateTimeValue_Test.java +++ b/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnValueChronology_IsAfter_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.Date; @@ -24,7 +23,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.junit.Test; @@ -42,8 +40,7 @@ public class AssertionsOnValueChronology_IsAfter_DateTimeValue_Test extends Abst @Test public void test_is_after() throws Exception { WritableAssertionInfo info = new WritableAssertionInfo(); - Table table = new Table(); - TableAssert tableAssert = assertThat(table); + TableAssert tableAssert = new TableAssert(null); TableAssert tableAssert2 = AssertionsOnValueChronology.isAfter(tableAssert, info, getValue(null, Timestamp.valueOf("2007-12-23 09:01:05")), DateTimeValue.of(DateValue.of(2007, 12, 23), @@ -62,8 +59,7 @@ public void test_is_after() throws Exception { public void should_fail_because_value_is_before_or_equal_to() throws Exception { WritableAssertionInfo info = new WritableAssertionInfo(); info.description("description"); - Table table = new Table(); - TableAssert tableAssert = assertThat(table); + TableAssert tableAssert = new TableAssert(null); try { AssertionsOnValueChronology.isAfter(tableAssert, info, getValue(null, Timestamp.valueOf("2007-12-23 09:01:05")), @@ -124,8 +120,7 @@ public void should_fail_because_value_is_before_or_equal_to() throws Exception { public void should_fail_because_value_is_not_compatible() throws Exception { WritableAssertionInfo info = new WritableAssertionInfo(); info.description("description"); - Table table = new Table(); - TableAssert tableAssert = assertThat(table); + TableAssert tableAssert = new TableAssert(null); try { AssertionsOnValueChronology.isAfter(tableAssert, info, getValue(null, "test"), diff --git a/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnValueChronology_IsAfter_DateValue_Test.java b/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnValueChronology_IsAfter_DateValue_Test.java index 8d2d943b..e68181b7 100644 --- a/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnValueChronology_IsAfter_DateValue_Test.java +++ b/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnValueChronology_IsAfter_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; @@ -23,7 +22,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.junit.Test; /** @@ -40,8 +38,7 @@ public class AssertionsOnValueChronology_IsAfter_DateValue_Test extends Abstract @Test public void test_is_after() throws Exception { WritableAssertionInfo info = new WritableAssertionInfo(); - Table table = new Table(); - TableAssert tableAssert = assertThat(table); + TableAssert tableAssert = new TableAssert(null); TableAssert tableAssert2 = AssertionsOnValueChronology.isAfter(tableAssert, info, getValue(null, Timestamp.valueOf("2007-12-23 09:01:05")), DateValue.of(2007, 12, 23)); @@ -59,8 +56,7 @@ public void test_is_after() throws Exception { public void should_fail_because_value_is_before_or_equal_to() throws Exception { WritableAssertionInfo info = new WritableAssertionInfo(); info.description("description"); - Table table = new Table(); - TableAssert tableAssert = assertThat(table); + TableAssert tableAssert = new TableAssert(null); try { AssertionsOnValueChronology.isAfter(tableAssert, info, getValue(null, Timestamp.valueOf("2007-12-23 00:00:00")), @@ -118,8 +114,7 @@ public void should_fail_because_value_is_before_or_equal_to() throws Exception { public void should_fail_because_value_is_not_compatible() throws Exception { WritableAssertionInfo info = new WritableAssertionInfo(); info.description("description"); - Table table = new Table(); - TableAssert tableAssert = assertThat(table); + TableAssert tableAssert = new TableAssert(null); try { AssertionsOnValueChronology.isAfter(tableAssert, info, getValue(null, "test"), diff --git a/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnValueChronology_IsAfter_String_Test.java b/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnValueChronology_IsAfter_String_Test.java index 90fc9fed..da6c1680 100644 --- a/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnValueChronology_IsAfter_String_Test.java +++ b/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnValueChronology_IsAfter_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.sql.Date; @@ -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.junit.Test; /** @@ -41,8 +39,7 @@ public class AssertionsOnValueChronology_IsAfter_String_Test extends AbstractTes @Test public void test_is_after() throws Exception { WritableAssertionInfo info = new WritableAssertionInfo(); - Table table = new Table(); - TableAssert tableAssert = assertThat(table); + TableAssert tableAssert = new TableAssert(null); TableAssert tableAssert2 = AssertionsOnValueChronology.isAfter(tableAssert, info, getValue(null, Timestamp.valueOf("2007-12-23 09:01:05")), "2007-12-23T09:01:00"); @@ -72,8 +69,7 @@ public void test_is_after() throws Exception { public void should_fail_because_value_is_before_or_equal_to() throws Exception { WritableAssertionInfo info = new WritableAssertionInfo(); info.description("description"); - Table table = new Table(); - TableAssert tableAssert = assertThat(table); + TableAssert tableAssert = new TableAssert(null); try { AssertionsOnValueChronology.isAfter(tableAssert, info, getValue(null, Timestamp.valueOf("2007-12-23 09:01:05")), @@ -203,8 +199,7 @@ public void should_fail_because_value_is_before_or_equal_to() throws Exception { public void should_fail_because_value_is_not_compatible() throws Exception { WritableAssertionInfo info = new WritableAssertionInfo(); info.description("description"); - Table table = new Table(); - TableAssert tableAssert = assertThat(table); + TableAssert tableAssert = new TableAssert(null); try { AssertionsOnValueChronology.isAfter(tableAssert, info, getValue(null, "test"), @@ -228,8 +223,7 @@ public void should_fail_because_value_is_not_compatible() throws Exception { public void should_fail_because_expected_string_is_not_correct_to_compare_to_time() throws Exception { WritableAssertionInfo info = new WritableAssertionInfo(); info.description("description"); - Table table = new Table(); - TableAssert tableAssert = assertThat(table); + TableAssert tableAssert = new TableAssert(null); try { AssertionsOnValueChronology.isAfter(tableAssert, info, getValue(null, Time.valueOf("09:01:05")), @@ -247,8 +241,7 @@ public void should_fail_because_expected_string_is_not_correct_to_compare_to_tim public void should_fail_because_expected_string_is_not_correct_to_compare_to() throws Exception { WritableAssertionInfo info = new WritableAssertionInfo(); info.description("description"); - Table table = new Table(); - TableAssert tableAssert = assertThat(table); + TableAssert tableAssert = new TableAssert(null); try { AssertionsOnValueChronology.isAfter(tableAssert, info, getValue(null, Date.valueOf("2007-12-23")), diff --git a/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnValueChronology_IsAfter_TimeValue_Test.java b/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnValueChronology_IsAfter_TimeValue_Test.java index 80882cbc..9ab969ff 100644 --- a/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnValueChronology_IsAfter_TimeValue_Test.java +++ b/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnValueChronology_IsAfter_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; @@ -21,7 +20,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.junit.Test; @@ -39,8 +37,7 @@ public class AssertionsOnValueChronology_IsAfter_TimeValue_Test extends Abstract @Test public void test_is_after() throws Exception { WritableAssertionInfo info = new WritableAssertionInfo(); - Table table = new Table(); - TableAssert tableAssert = assertThat(table); + TableAssert tableAssert = new TableAssert(null); TableAssert tableAssert2 = AssertionsOnValueChronology.isAfter(tableAssert, info, getValue(null, Time.valueOf("09:01:05")), TimeValue.of(9, 1, 0)); @@ -54,8 +51,7 @@ public void test_is_after() throws Exception { public void should_fail_because_value_is_before_or_equal_to() throws Exception { WritableAssertionInfo info = new WritableAssertionInfo(); info.description("description"); - Table table = new Table(); - TableAssert tableAssert = assertThat(table); + TableAssert tableAssert = new TableAssert(null); try { AssertionsOnValueChronology.isAfter(tableAssert, info, getValue(null, Time.valueOf("09:01:05")), @@ -89,8 +85,7 @@ public void should_fail_because_value_is_before_or_equal_to() throws Exception { public void should_fail_because_value_is_not_compatible() throws Exception { WritableAssertionInfo info = new WritableAssertionInfo(); info.description("description"); - Table table = new Table(); - TableAssert tableAssert = assertThat(table); + TableAssert tableAssert = new TableAssert(null); try { AssertionsOnValueChronology.isAfter(tableAssert, info, getValue(null, "test"), diff --git a/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnValueChronology_IsBeforeOrEqualTo_DateTimeValue_Test.java b/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnValueChronology_IsBeforeOrEqualTo_DateTimeValue_Test.java index 12fad78c..e73b936c 100644 --- a/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnValueChronology_IsBeforeOrEqualTo_DateTimeValue_Test.java +++ b/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnValueChronology_IsBeforeOrEqualTo_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.Date; @@ -24,7 +23,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.junit.Test; @@ -42,8 +40,7 @@ public class AssertionsOnValueChronology_IsBeforeOrEqualTo_DateTimeValue_Test ex @Test public void test_is_before_or_equal_to() throws Exception { WritableAssertionInfo info = new WritableAssertionInfo(); - Table table = new Table(); - TableAssert tableAssert = assertThat(table); + TableAssert tableAssert = new TableAssert(null); TableAssert tableAssert2 = AssertionsOnValueChronology.isBeforeOrEqualTo(tableAssert, info, getValue(null, Timestamp.valueOf("2007-12-23 09:01:05")), DateTimeValue @@ -73,8 +70,7 @@ public void test_is_before_or_equal_to() throws Exception { public void should_fail_because_value_is_after() throws Exception { WritableAssertionInfo info = new WritableAssertionInfo(); info.description("description"); - Table table = new Table(); - TableAssert tableAssert = assertThat(table); + TableAssert tableAssert = new TableAssert(null); try { AssertionsOnValueChronology.isBeforeOrEqualTo(tableAssert, info, getValue(null, Timestamp.valueOf("2007-12-23 09:01:05")), @@ -109,8 +105,7 @@ public void should_fail_because_value_is_after() throws Exception { public void should_fail_because_value_is_not_compatible() throws Exception { WritableAssertionInfo info = new WritableAssertionInfo(); info.description("description"); - Table table = new Table(); - TableAssert tableAssert = assertThat(table); + TableAssert tableAssert = new TableAssert(null); try { AssertionsOnValueChronology.isBeforeOrEqualTo(tableAssert, info, getValue(null, "test"), diff --git a/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnValueChronology_IsBeforeOrEqualTo_DateValue_Test.java b/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnValueChronology_IsBeforeOrEqualTo_DateValue_Test.java index da87b657..103f42ed 100644 --- a/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnValueChronology_IsBeforeOrEqualTo_DateValue_Test.java +++ b/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnValueChronology_IsBeforeOrEqualTo_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; @@ -23,7 +22,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.junit.Test; /** @@ -40,8 +38,7 @@ public class AssertionsOnValueChronology_IsBeforeOrEqualTo_DateValue_Test extend @Test public void test_is_before_or_equal_to() throws Exception { WritableAssertionInfo info = new WritableAssertionInfo(); - Table table = new Table(); - TableAssert tableAssert = assertThat(table); + TableAssert tableAssert = new TableAssert(null); TableAssert tableAssert2 = AssertionsOnValueChronology.isBeforeOrEqualTo(tableAssert, info, getValue(null, Timestamp.valueOf("2007-12-23 00:00:00")), DateValue.of(2007, 12, 23)); @@ -67,8 +64,7 @@ public void test_is_before_or_equal_to() throws Exception { public void should_fail_because_value_is_after() throws Exception { WritableAssertionInfo info = new WritableAssertionInfo(); info.description("description"); - Table table = new Table(); - TableAssert tableAssert = assertThat(table); + TableAssert tableAssert = new TableAssert(null); try { AssertionsOnValueChronology.isBeforeOrEqualTo(tableAssert, info, getValue(null, Timestamp.valueOf("2007-12-23 09:01:05")), @@ -102,8 +98,7 @@ public void should_fail_because_value_is_after() throws Exception { public void should_fail_because_value_is_not_compatible() throws Exception { WritableAssertionInfo info = new WritableAssertionInfo(); info.description("description"); - Table table = new Table(); - TableAssert tableAssert = assertThat(table); + TableAssert tableAssert = new TableAssert(null); try { AssertionsOnValueChronology.isBeforeOrEqualTo(tableAssert, info, getValue(null, "test"), diff --git a/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnValueChronology_IsBeforeOrEqualTo_String_Test.java b/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnValueChronology_IsBeforeOrEqualTo_String_Test.java index cb60b2f8..862bc039 100644 --- a/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnValueChronology_IsBeforeOrEqualTo_String_Test.java +++ b/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnValueChronology_IsBeforeOrEqualTo_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.sql.Date; @@ -26,7 +25,6 @@ import org.assertj.db.exception.AssertJDBException; 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.junit.Test; @@ -44,8 +42,7 @@ public class AssertionsOnValueChronology_IsBeforeOrEqualTo_String_Test extends A @Test public void test_is_before_or_equal_to() throws Exception { WritableAssertionInfo info = new WritableAssertionInfo(); - Table table = new Table(); - TableAssert tableAssert = assertThat(table); + TableAssert tableAssert = new TableAssert(null); TableAssert tableAssert2 = AssertionsOnValueChronology.isBeforeOrEqualTo(tableAssert, info, getValue(null, Timestamp.valueOf( "2007-12-23 09:01:05")), @@ -96,8 +93,7 @@ public void test_is_before_or_equal_to() throws Exception { public void should_fail_because_value_is_after() throws Exception { WritableAssertionInfo info = new WritableAssertionInfo(); info.description("description"); - Table table = new Table(); - TableAssert tableAssert = assertThat(table); + TableAssert tableAssert = new TableAssert(null); try { AssertionsOnValueChronology.isBeforeOrEqualTo(tableAssert, info, getValue(null, Timestamp.valueOf("2007-12-23 09:01:05")), @@ -167,8 +163,7 @@ public void should_fail_because_value_is_after() throws Exception { public void should_fail_because_value_is_not_compatible() throws Exception { WritableAssertionInfo info = new WritableAssertionInfo(); info.description("description"); - Table table = new Table(); - TableAssert tableAssert = assertThat(table); + TableAssert tableAssert = new TableAssert(null); try { AssertionsOnValueChronology.isBeforeOrEqualTo(tableAssert, info, getValue(null, "test"), @@ -194,8 +189,7 @@ public void should_fail_because_value_is_not_compatible() throws Exception { public void should_fail_because_expected_string_is_not_correct_to_compare_to_time() throws Exception { WritableAssertionInfo info = new WritableAssertionInfo(); info.description("description"); - Table table = new Table(); - TableAssert tableAssert = assertThat(table); + TableAssert tableAssert = new TableAssert(null); try { AssertionsOnValueChronology.isBeforeOrEqualTo(tableAssert, info, getValue(null, Time.valueOf("09:01:05")), @@ -213,8 +207,7 @@ public void should_fail_because_expected_string_is_not_correct_to_compare_to_tim public void should_fail_because_expected_string_is_not_correct_to_compare_to() throws Exception { WritableAssertionInfo info = new WritableAssertionInfo(); info.description("description"); - Table table = new Table(); - TableAssert tableAssert = assertThat(table); + TableAssert tableAssert = new TableAssert(null); try { AssertionsOnValueChronology.isBeforeOrEqualTo(tableAssert, info, getValue(null, Date.valueOf("2007-12-23")), diff --git a/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnValueChronology_IsBeforeOrEqualTo_TimeValue_Test.java b/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnValueChronology_IsBeforeOrEqualTo_TimeValue_Test.java index 26195bda..ec7f5a51 100644 --- a/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnValueChronology_IsBeforeOrEqualTo_TimeValue_Test.java +++ b/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnValueChronology_IsBeforeOrEqualTo_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; @@ -21,7 +20,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.junit.Test; @@ -39,8 +37,7 @@ public class AssertionsOnValueChronology_IsBeforeOrEqualTo_TimeValue_Test extend @Test public void test_is_before_or_equal_to() throws Exception { WritableAssertionInfo info = new WritableAssertionInfo(); - Table table = new Table(); - TableAssert tableAssert = assertThat(table); + TableAssert tableAssert = new TableAssert(null); TableAssert tableAssert2 = AssertionsOnValueChronology.isBeforeOrEqualTo(tableAssert, info, getValue(null, Time.valueOf("09:01:05")), TimeValue.of(9, 1, 5)); @@ -58,8 +55,7 @@ public void test_is_before_or_equal_to() throws Exception { public void should_fail_because_value_is_after() throws Exception { WritableAssertionInfo info = new WritableAssertionInfo(); info.description("description"); - Table table = new Table(); - TableAssert tableAssert = assertThat(table); + TableAssert tableAssert = new TableAssert(null); try { AssertionsOnValueChronology.isBeforeOrEqualTo(tableAssert, info, getValue(null, Time.valueOf("09:01:05")), @@ -81,8 +77,7 @@ public void should_fail_because_value_is_after() throws Exception { public void should_fail_because_value_is_not_compatible() throws Exception { WritableAssertionInfo info = new WritableAssertionInfo(); info.description("description"); - Table table = new Table(); - TableAssert tableAssert = assertThat(table); + TableAssert tableAssert = new TableAssert(null); try { AssertionsOnValueChronology.isBeforeOrEqualTo(tableAssert, info, getValue(null, "test"), diff --git a/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnValueChronology_IsBefore_DateTimeValue_Test.java b/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnValueChronology_IsBefore_DateTimeValue_Test.java index 1020d810..9f34d2cd 100644 --- a/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnValueChronology_IsBefore_DateTimeValue_Test.java +++ b/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnValueChronology_IsBefore_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.Date; @@ -24,7 +23,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.junit.Test; @@ -42,8 +40,7 @@ public class AssertionsOnValueChronology_IsBefore_DateTimeValue_Test extends Abs @Test public void test_is_before() throws Exception { WritableAssertionInfo info = new WritableAssertionInfo(); - Table table = new Table(); - TableAssert tableAssert = assertThat(table); + TableAssert tableAssert = new TableAssert(null); TableAssert tableAssert2 = AssertionsOnValueChronology.isBefore(tableAssert, info, getValue(null, Timestamp.valueOf("2007-12-23 09:01:05")), DateTimeValue.of(DateValue.of(2007, 12, 23), @@ -62,8 +59,7 @@ public void test_is_before() throws Exception { public void should_fail_because_value_is_after_or_equal_to() throws Exception { WritableAssertionInfo info = new WritableAssertionInfo(); info.description("description"); - Table table = new Table(); - TableAssert tableAssert = assertThat(table); + TableAssert tableAssert = new TableAssert(null); try { AssertionsOnValueChronology.isBefore(tableAssert, info, getValue(null, Timestamp.valueOf("2007-12-23 09:01:05")), @@ -124,8 +120,7 @@ public void should_fail_because_value_is_after_or_equal_to() throws Exception { public void should_fail_because_value_is_not_compatible() throws Exception { WritableAssertionInfo info = new WritableAssertionInfo(); info.description("description"); - Table table = new Table(); - TableAssert tableAssert = assertThat(table); + TableAssert tableAssert = new TableAssert(null); try { AssertionsOnValueChronology.isBefore(tableAssert, info, getValue(null, "test"), diff --git a/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnValueChronology_IsBefore_DateValue_Test.java b/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnValueChronology_IsBefore_DateValue_Test.java index 0e81b7e7..f423327f 100644 --- a/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnValueChronology_IsBefore_DateValue_Test.java +++ b/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnValueChronology_IsBefore_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; @@ -23,7 +22,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.junit.Test; /** @@ -40,8 +38,7 @@ public class AssertionsOnValueChronology_IsBefore_DateValue_Test extends Abstrac @Test public void test_is_before() throws Exception { WritableAssertionInfo info = new WritableAssertionInfo(); - Table table = new Table(); - TableAssert tableAssert = assertThat(table); + TableAssert tableAssert = new TableAssert(null); TableAssert tableAssert2 = AssertionsOnValueChronology.isBefore(tableAssert, info, getValue(null, Timestamp.valueOf("2007-12-23 09:01:05")), DateValue.of(2007, 12, 24)); @@ -59,8 +56,7 @@ public void test_is_before() throws Exception { public void should_fail_because_value_is_after_or_equal_to() throws Exception { WritableAssertionInfo info = new WritableAssertionInfo(); info.description("description"); - Table table = new Table(); - TableAssert tableAssert = assertThat(table); + TableAssert tableAssert = new TableAssert(null); try { AssertionsOnValueChronology.isBefore(tableAssert, info, getValue(null, Timestamp.valueOf("2007-12-23 00:00:00")), @@ -118,8 +114,7 @@ public void should_fail_because_value_is_after_or_equal_to() throws Exception { public void should_fail_because_value_is_not_compatible() throws Exception { WritableAssertionInfo info = new WritableAssertionInfo(); info.description("description"); - Table table = new Table(); - TableAssert tableAssert = assertThat(table); + TableAssert tableAssert = new TableAssert(null); try { AssertionsOnValueChronology.isBefore(tableAssert, info, getValue(null, "test"), diff --git a/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnValueChronology_IsBefore_String_Test.java b/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnValueChronology_IsBefore_String_Test.java index edd5c120..363bf30f 100644 --- a/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnValueChronology_IsBefore_String_Test.java +++ b/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnValueChronology_IsBefore_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.sql.Date; @@ -26,7 +25,6 @@ import org.assertj.db.exception.AssertJDBException; 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.junit.Test; @@ -44,8 +42,7 @@ public class AssertionsOnValueChronology_IsBefore_String_Test extends AbstractTe @Test public void test_is_before() throws Exception { WritableAssertionInfo info = new WritableAssertionInfo(); - Table table = new Table(); - TableAssert tableAssert = assertThat(table); + TableAssert tableAssert = new TableAssert(null); TableAssert tableAssert2 = AssertionsOnValueChronology.isBefore(tableAssert, info, getValue(null, Timestamp.valueOf("2007-12-23 09:01:05")), "2007-12-23T09:01:06"); @@ -75,8 +72,7 @@ public void test_is_before() throws Exception { public void should_fail_because_value_is_after_or_equal_to() throws Exception { WritableAssertionInfo info = new WritableAssertionInfo(); info.description("description"); - Table table = new Table(); - TableAssert tableAssert = assertThat(table); + TableAssert tableAssert = new TableAssert(null); try { AssertionsOnValueChronology.isBefore(tableAssert, info, getValue(null, Timestamp.valueOf("2007-12-23 09:01:05")), @@ -206,8 +202,7 @@ public void should_fail_because_value_is_after_or_equal_to() throws Exception { public void should_fail_because_value_is_not_compatible() throws Exception { WritableAssertionInfo info = new WritableAssertionInfo(); info.description("description"); - Table table = new Table(); - TableAssert tableAssert = assertThat(table); + TableAssert tableAssert = new TableAssert(null); try { AssertionsOnValueChronology.isBefore(tableAssert, info, getValue(null, "test"), @@ -232,8 +227,7 @@ public void should_fail_because_value_is_not_compatible() throws Exception { public void should_fail_because_expected_string_is_not_correct_to_compare_to_time() throws Exception { WritableAssertionInfo info = new WritableAssertionInfo(); info.description("description"); - Table table = new Table(); - TableAssert tableAssert = assertThat(table); + TableAssert tableAssert = new TableAssert(null); try { AssertionsOnValueChronology.isBefore(tableAssert, info, getValue(null, Time.valueOf("09:01:05")), @@ -251,8 +245,7 @@ public void should_fail_because_expected_string_is_not_correct_to_compare_to_tim public void should_fail_because_expected_string_is_not_correct_to_compare_to() throws Exception { WritableAssertionInfo info = new WritableAssertionInfo(); info.description("description"); - Table table = new Table(); - TableAssert tableAssert = assertThat(table); + TableAssert tableAssert = new TableAssert(null); try { AssertionsOnValueChronology.isBefore(tableAssert, info, getValue(null, Date.valueOf("2007-12-23")), diff --git a/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnValueChronology_IsBefore_TimeValue_Test.java b/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnValueChronology_IsBefore_TimeValue_Test.java index 7f74d8d1..9cc66053 100644 --- a/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnValueChronology_IsBefore_TimeValue_Test.java +++ b/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnValueChronology_IsBefore_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; @@ -21,7 +20,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.junit.Test; @@ -39,8 +37,7 @@ public class AssertionsOnValueChronology_IsBefore_TimeValue_Test extends Abstrac @Test public void test_is_before() throws Exception { WritableAssertionInfo info = new WritableAssertionInfo(); - Table table = new Table(); - TableAssert tableAssert = assertThat(table); + TableAssert tableAssert = new TableAssert(null); TableAssert tableAssert2 = AssertionsOnValueChronology.isBefore(tableAssert, info, getValue(null, Time.valueOf("09:01:05")), TimeValue.of(9, 1, 6)); @@ -54,8 +51,7 @@ public void test_is_before() throws Exception { public void should_fail_because_value_is_after_or_equal_to() throws Exception { WritableAssertionInfo info = new WritableAssertionInfo(); info.description("description"); - Table table = new Table(); - TableAssert tableAssert = assertThat(table); + TableAssert tableAssert = new TableAssert(null); try { AssertionsOnValueChronology.isBefore(tableAssert, info, getValue(null, Time.valueOf("09:01:05")), @@ -89,8 +85,7 @@ public void should_fail_because_value_is_after_or_equal_to() throws Exception { public void should_fail_because_value_is_not_compatible() throws Exception { WritableAssertionInfo info = new WritableAssertionInfo(); info.description("description"); - Table table = new Table(); - TableAssert tableAssert = assertThat(table); + TableAssert tableAssert = new TableAssert(null); try { AssertionsOnValueChronology.isBefore(tableAssert, info, getValue(null, "test"), diff --git a/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnValueClass_IsOfClass_Test.java b/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnValueClass_IsOfClass_Test.java index 686689d5..77842cd5 100644 --- a/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnValueClass_IsOfClass_Test.java +++ b/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnValueClass_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 org.assertj.core.api.Assertions; @@ -20,7 +19,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.junit.Test; /** @@ -37,8 +35,7 @@ public class AssertionsOnValueClass_IsOfClass_Test extends AbstractTest { @Test public void test_is_of_class() throws Exception { WritableAssertionInfo info = new WritableAssertionInfo(); - Table table = new Table(); - TableAssert tableAssert = assertThat(table); + TableAssert tableAssert = new TableAssert(null); TableAssert tableAssert2 = AssertionsOnValueClass.isOfClass(tableAssert, info, getValue(null, "test"), String.class); Assertions.assertThat(tableAssert2).isSameAs(tableAssert); tableAssert2 = AssertionsOnValueClass.isOfClass(tableAssert, info, getValue(null, "test"), CharSequence.class); @@ -54,8 +51,7 @@ public void test_is_of_class() 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 { AssertionsOnValueClass.isOfClass(tableAssert, info, getValue(null, 8), String.class); fail("An exception must be raised"); @@ -87,8 +83,7 @@ public void should_fail_because_value_is_not_of_class() 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); try { AssertionsOnValueClass.isOfClass(tableAssert, info, getValue(null, 8), null); fail("An exception must be raised"); diff --git a/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnValueCloseness_IsCloseTo_DateTimeValue_DateTimeValue_Test.java b/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnValueCloseness_IsCloseTo_DateTimeValue_DateTimeValue_Test.java index e8ad87d8..2e78da8d 100644 --- a/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnValueCloseness_IsCloseTo_DateTimeValue_DateTimeValue_Test.java +++ b/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnValueCloseness_IsCloseTo_DateTimeValue_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.Date; @@ -24,7 +23,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.junit.Test; @@ -42,8 +40,7 @@ public class AssertionsOnValueCloseness_IsCloseTo_DateTimeValue_DateTimeValue_Te @Test public void test_is_close_to() throws Exception { WritableAssertionInfo info = new WritableAssertionInfo(); - Table table = new Table(); - TableAssert tableAssert = assertThat(table); + TableAssert tableAssert = new TableAssert(null); TableAssert tableAssert2 = AssertionsOnValueCloseness.isCloseTo(tableAssert, info, getValue( null, Date.valueOf("2007-12-23")), DateTimeValue.of(DateValue.of(2007, 12, 23)), DateTimeValue.of(DateValue.of(0, 0, 0))); Assertions.assertThat(tableAssert2).isSameAs(tableAssert); @@ -62,8 +59,7 @@ public void test_is_close_to() throws Exception { public void should_fail_because_value_is_not_close_to() throws Exception { WritableAssertionInfo info = new WritableAssertionInfo(); info.description("description"); - Table table = new Table(); - TableAssert tableAssert = assertThat(table); + TableAssert tableAssert = new TableAssert(null); try { AssertionsOnValueCloseness.isCloseTo(tableAssert, info, getValue(null, Date.valueOf("2007-12-24")), DateTimeValue.of(DateValue.of(2007, 12, 23)), DateTimeValue.of(DateValue.of(0, 0, 0))); @@ -122,8 +118,7 @@ public void should_fail_because_value_is_not_close_to() throws Exception { public void should_fail_because_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); try { AssertionsOnValueCloseness.isCloseTo(tableAssert, info, getValue(null, 8), DateTimeValue.of(DateValue.of(2007, 12, 23)), DateTimeValue.of(DateValue.of(0, 0, 1))); diff --git a/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnValueCloseness_IsCloseTo_DateTimeValue_DateValue_Test.java b/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnValueCloseness_IsCloseTo_DateTimeValue_DateValue_Test.java index ba9c6cc7..fa8f5e5e 100644 --- a/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnValueCloseness_IsCloseTo_DateTimeValue_DateValue_Test.java +++ b/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnValueCloseness_IsCloseTo_DateTimeValue_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; @@ -24,7 +23,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.junit.Test; @@ -42,8 +40,7 @@ public class AssertionsOnValueCloseness_IsCloseTo_DateTimeValue_DateValue_Test e @Test public void test_is_close_to() throws Exception { WritableAssertionInfo info = new WritableAssertionInfo(); - Table table = new Table(); - TableAssert tableAssert = assertThat(table); + TableAssert tableAssert = new TableAssert(null); TableAssert tableAssert2 = AssertionsOnValueCloseness.isCloseTo(tableAssert, info, getValue( null, Date.valueOf("2007-12-23")), DateTimeValue.of(DateValue.of(2007, 12, 23)), DateValue.of(0, 0, 0)); Assertions.assertThat(tableAssert2).isSameAs(tableAssert); @@ -62,8 +59,7 @@ public void test_is_close_to() throws Exception { public void should_fail_because_value_is_not_close_to() throws Exception { WritableAssertionInfo info = new WritableAssertionInfo(); info.description("description"); - Table table = new Table(); - TableAssert tableAssert = assertThat(table); + TableAssert tableAssert = new TableAssert(null); try { AssertionsOnValueCloseness.isCloseTo(tableAssert, info, getValue(null, Date.valueOf("2007-12-24")), DateTimeValue.of(DateValue.of(2007, 12, 23)), DateValue.of(0, 0, 0)); @@ -122,8 +118,7 @@ public void should_fail_because_value_is_not_close_to() throws Exception { public void should_fail_because_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); try { AssertionsOnValueCloseness.isCloseTo(tableAssert, info, getValue(null, 8), DateTimeValue.of(DateValue.of(2007, 12, 23)), DateValue.of(0, 0, 1)); diff --git a/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnValueCloseness_IsCloseTo_DateTimeValue_TimeValue_Test.java b/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnValueCloseness_IsCloseTo_DateTimeValue_TimeValue_Test.java index d6bd0139..1712863c 100644 --- a/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnValueCloseness_IsCloseTo_DateTimeValue_TimeValue_Test.java +++ b/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnValueCloseness_IsCloseTo_DateTimeValue_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.Date; @@ -24,7 +23,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.junit.Test; @@ -43,8 +41,7 @@ public class AssertionsOnValueCloseness_IsCloseTo_DateTimeValue_TimeValue_Test e @Test public void test_is_close_to() throws Exception { WritableAssertionInfo info = new WritableAssertionInfo(); - Table table = new Table(); - TableAssert tableAssert = assertThat(table); + TableAssert tableAssert = new TableAssert(null); TableAssert tableAssert2 = AssertionsOnValueCloseness.isCloseTo(tableAssert, info, getValue( null, Date.valueOf("2007-12-23")), DateTimeValue.of(DateValue.of(2007, 12, 23)), TimeValue.of(0, 0, 0)); @@ -70,8 +67,7 @@ public void test_is_close_to() throws Exception { public void should_fail_because_value_is_not_close_to() throws Exception { WritableAssertionInfo info = new WritableAssertionInfo(); info.description("description"); - Table table = new Table(); - TableAssert tableAssert = assertThat(table); + TableAssert tableAssert = new TableAssert(null); try { AssertionsOnValueCloseness.isCloseTo(tableAssert, info, getValue(null, Date.valueOf("2007-12-24")), DateTimeValue.of(DateValue.of(2007, 12, 23)), TimeValue.of(0, 0, 0)); @@ -130,8 +126,7 @@ public void should_fail_because_value_is_not_close_to() throws Exception { public void should_fail_because_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); try { AssertionsOnValueCloseness.isCloseTo(tableAssert, info, getValue(null, 8), DateTimeValue.of(DateValue.of(2007, 12, 23)), TimeValue.of(0, 0, 1)); diff --git a/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnValueCloseness_IsCloseTo_DateValue_DateTimeValue_Test.java b/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnValueCloseness_IsCloseTo_DateValue_DateTimeValue_Test.java index b73f62c7..0f5192ab 100644 --- a/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnValueCloseness_IsCloseTo_DateValue_DateTimeValue_Test.java +++ b/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnValueCloseness_IsCloseTo_DateValue_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.Date; @@ -24,7 +23,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.junit.Test; /** @@ -41,8 +39,7 @@ public class AssertionsOnValueCloseness_IsCloseTo_DateValue_DateTimeValue_Test e @Test public void test_is_close_to() throws Exception { WritableAssertionInfo info = new WritableAssertionInfo(); - Table table = new Table(); - TableAssert tableAssert = assertThat(table); + TableAssert tableAssert = new TableAssert(null); TableAssert tableAssert2 = AssertionsOnValueCloseness.isCloseTo(tableAssert, info, getValue( null, Date.valueOf("2007-12-23")), DateValue.of(2007, 12, 23), DateTimeValue.of(DateValue.of(0, 0, 0))); Assertions.assertThat(tableAssert2).isSameAs(tableAssert); @@ -60,8 +57,7 @@ public void test_is_close_to() throws Exception { public void should_fail_because_value_is_not_close_to() throws Exception { WritableAssertionInfo info = new WritableAssertionInfo(); info.description("description"); - Table table = new Table(); - TableAssert tableAssert = assertThat(table); + TableAssert tableAssert = new TableAssert(null); try { AssertionsOnValueCloseness.isCloseTo(tableAssert, info, getValue(null, Date.valueOf("2007-12-24")), DateValue.of(2007, 12, 23), DateTimeValue.of(DateValue.of(0, 0, 0))); @@ -119,8 +115,7 @@ public void should_fail_because_value_is_not_close_to() throws Exception { public void should_fail_because_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); try { AssertionsOnValueCloseness.isCloseTo(tableAssert, info, getValue(null, 8), DateValue.of(2007, 12, 23), DateTimeValue.of(DateValue.of(0, 0, 0))); diff --git a/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnValueCloseness_IsCloseTo_DateValue_DateValue_Test.java b/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnValueCloseness_IsCloseTo_DateValue_DateValue_Test.java index e75ad7cf..f4b0e7c2 100644 --- a/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnValueCloseness_IsCloseTo_DateValue_DateValue_Test.java +++ b/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnValueCloseness_IsCloseTo_DateValue_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; @@ -23,7 +22,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.junit.Test; /** @@ -40,8 +38,7 @@ public class AssertionsOnValueCloseness_IsCloseTo_DateValue_DateValue_Test exten @Test public void test_is_close_to() throws Exception { WritableAssertionInfo info = new WritableAssertionInfo(); - Table table = new Table(); - TableAssert tableAssert = assertThat(table); + TableAssert tableAssert = new TableAssert(null); TableAssert tableAssert2 = AssertionsOnValueCloseness.isCloseTo(tableAssert, info, getValue( null, Date.valueOf("2007-12-23")), DateValue.of(2007, 12, 23), DateValue.of(0, 0, 0)); Assertions.assertThat(tableAssert2).isSameAs(tableAssert); @@ -59,8 +56,7 @@ public void test_is_close_to() throws Exception { public void should_fail_because_value_is_not_close_to() throws Exception { WritableAssertionInfo info = new WritableAssertionInfo(); info.description("description"); - Table table = new Table(); - TableAssert tableAssert = assertThat(table); + TableAssert tableAssert = new TableAssert(null); try { AssertionsOnValueCloseness.isCloseTo(tableAssert, info, getValue(null, Date.valueOf("2007-12-24")), DateValue.of(2007, 12, 23), DateValue.of(0, 0, 0)); @@ -118,8 +114,7 @@ public void should_fail_because_value_is_not_close_to() throws Exception { public void should_fail_because_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); try { AssertionsOnValueCloseness.isCloseTo(tableAssert, info, getValue(null, 8), DateValue.of(2007, 12, 23), DateValue.of(0, 0, 0)); diff --git a/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnValueCloseness_IsCloseTo_DateValue_TimeValue_Test.java b/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnValueCloseness_IsCloseTo_DateValue_TimeValue_Test.java index 87e67e37..e5088ceb 100644 --- a/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnValueCloseness_IsCloseTo_DateValue_TimeValue_Test.java +++ b/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnValueCloseness_IsCloseTo_DateValue_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.Date; @@ -23,7 +22,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.TimeValue; import org.junit.Test; @@ -41,8 +39,7 @@ public class AssertionsOnValueCloseness_IsCloseTo_DateValue_TimeValue_Test exten @Test public void test_is_close_to() throws Exception { WritableAssertionInfo info = new WritableAssertionInfo(); - Table table = new Table(); - TableAssert tableAssert = assertThat(table); + TableAssert tableAssert = new TableAssert(null); TableAssert tableAssert2 = AssertionsOnValueCloseness.isCloseTo(tableAssert, info, getValue( null, Date.valueOf("2007-12-23")), DateValue.of(2007, 12, 23), TimeValue.of(0, 0, 0)); Assertions.assertThat(tableAssert2).isSameAs(tableAssert); @@ -60,8 +57,7 @@ public void test_is_close_to() throws Exception { public void should_fail_because_value_is_not_close_to() throws Exception { WritableAssertionInfo info = new WritableAssertionInfo(); info.description("description"); - Table table = new Table(); - TableAssert tableAssert = assertThat(table); + TableAssert tableAssert = new TableAssert(null); try { AssertionsOnValueCloseness.isCloseTo(tableAssert, info, getValue(null, Date.valueOf("2007-12-24")), DateValue.of(2007, 12, 23), TimeValue.of(15, 0, 0)); @@ -119,8 +115,7 @@ public void should_fail_because_value_is_not_close_to() throws Exception { public void should_fail_because_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); try { AssertionsOnValueCloseness.isCloseTo(tableAssert, info, getValue(null, 8), DateValue.of(2007, 12, 23), TimeValue.of(0, 0, 0)); diff --git a/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnValueCloseness_IsCloseTo_Number_Test.java b/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnValueCloseness_IsCloseTo_Number_Test.java index 2863e352..8a70eac7 100644 --- a/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnValueCloseness_IsCloseTo_Number_Test.java +++ b/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnValueCloseness_IsCloseTo_Number_Test.java @@ -12,14 +12,12 @@ */ 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; import org.assertj.db.common.AbstractTest; -import org.assertj.db.type.Table; import org.junit.Test; /** @@ -36,8 +34,7 @@ public class AssertionsOnValueCloseness_IsCloseTo_Number_Test extends AbstractTe @Test public void test_is_close_to() throws Exception { WritableAssertionInfo info = new WritableAssertionInfo(); - Table table = new Table(); - TableAssert tableAssert = assertThat(table); + TableAssert tableAssert = new TableAssert(null); TableAssert tableAssert2 = AssertionsOnValueCloseness.isCloseTo(tableAssert, info, getValue(null, 8), 9, 1); Assertions.assertThat(tableAssert2).isSameAs(tableAssert); tableAssert2 = AssertionsOnValueCloseness.isCloseTo(tableAssert, info, getValue(null, null), (Number) null, 1); @@ -51,8 +48,7 @@ public void test_is_close_to() throws Exception { public void should_fail_because_value_is_not_close_to() throws Exception { WritableAssertionInfo info = new WritableAssertionInfo(); info.description("description"); - Table table = new Table(); - TableAssert tableAssert = assertThat(table); + TableAssert tableAssert = new TableAssert(null); try { AssertionsOnValueCloseness.isCloseTo(tableAssert, info, getValue(null, 9), 8, 0.5); fail("An exception must be raised"); @@ -84,8 +80,7 @@ public void should_fail_because_value_is_not_close_to() throws Exception { public void should_fail_because_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); try { AssertionsOnValueCloseness.isCloseTo(tableAssert, info, getValue(null, false), 8, 0); fail("An exception must be raised"); diff --git a/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnValueCloseness_IsCloseTo_TimeValue_TimeValue_Test.java b/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnValueCloseness_IsCloseTo_TimeValue_TimeValue_Test.java index 4cb01689..1df7d15d 100644 --- a/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnValueCloseness_IsCloseTo_TimeValue_TimeValue_Test.java +++ b/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnValueCloseness_IsCloseTo_TimeValue_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; @@ -21,7 +20,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.junit.Test; @@ -39,8 +37,7 @@ public class AssertionsOnValueCloseness_IsCloseTo_TimeValue_TimeValue_Test exten @Test public void test_is_close_to() throws Exception { WritableAssertionInfo info = new WritableAssertionInfo(); - Table table = new Table(); - TableAssert tableAssert = assertThat(table); + TableAssert tableAssert = new TableAssert(null); TableAssert tableAssert2 = AssertionsOnValueCloseness.isCloseTo(tableAssert, info, getValue(null, Time .valueOf("09:01:00")), TimeValue.of(9, 1, 1), TimeValue.of(0, 0, 1)); Assertions.assertThat(tableAssert2).isSameAs(tableAssert); @@ -55,8 +52,7 @@ public void test_is_close_to() throws Exception { public void should_fail_because_value_is_not_close_to() throws Exception { WritableAssertionInfo info = new WritableAssertionInfo(); info.description("description"); - Table table = new Table(); - TableAssert tableAssert = assertThat(table); + TableAssert tableAssert = new TableAssert(null); try { AssertionsOnValueCloseness.isCloseTo(tableAssert, info, getValue(null, Time.valueOf("09:01:05")), TimeValue.of(9, 1), TimeValue.of(0, 0, 1)); @@ -90,8 +86,7 @@ public void should_fail_because_value_is_not_close_to() throws Exception { public void should_fail_because_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); try { AssertionsOnValueCloseness.isCloseTo(tableAssert, info, getValue(null, 8), TimeValue.of(9, 1), TimeValue.of(0, 0)); fail("An exception must be raised"); diff --git a/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnValueComparison_IsGreaterThanOrEqualTo_Test.java b/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnValueComparison_IsGreaterThanOrEqualTo_Test.java index 849508e6..20086762 100644 --- a/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnValueComparison_IsGreaterThanOrEqualTo_Test.java +++ b/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnValueComparison_IsGreaterThanOrEqualTo_Test.java @@ -12,14 +12,12 @@ */ 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; import org.assertj.db.common.AbstractTest; -import org.assertj.db.type.Table; import org.junit.Test; /** @@ -36,8 +34,7 @@ public class AssertionsOnValueComparison_IsGreaterThanOrEqualTo_Test extends Abs @Test public void test_is_greater_than_or_equal_to() throws Exception { WritableAssertionInfo info = new WritableAssertionInfo(); - Table table = new Table(); - TableAssert tableAssert = assertThat(table); + TableAssert tableAssert = new TableAssert(null); TableAssert tableAssert2 = AssertionsOnValueComparison.isGreaterThanOrEqualTo(tableAssert, info, getValue(null, 8), 7); Assertions.assertThat(tableAssert2).isSameAs(tableAssert); tableAssert2 = AssertionsOnValueComparison.isGreaterThanOrEqualTo(tableAssert, info, getValue(null, 8), 8); @@ -51,8 +48,7 @@ public void test_is_greater_than_or_equal_to() throws Exception { public void should_fail_because_value_is_less_than() throws Exception { WritableAssertionInfo info = new WritableAssertionInfo(); info.description("description"); - Table table = new Table(); - TableAssert tableAssert = assertThat(table); + TableAssert tableAssert = new TableAssert(null); try { AssertionsOnValueComparison.isGreaterThanOrEqualTo(tableAssert, info, getValue(null, 8), 9); fail("An exception must be raised"); @@ -72,8 +68,7 @@ public void should_fail_because_value_is_less_than() throws Exception { public void should_fail_because_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); try { AssertionsOnValueComparison.isGreaterThanOrEqualTo(tableAssert, info, getValue(null, "8"), 8); fail("An exception must be raised"); diff --git a/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnValueComparison_IsGreaterThan_Test.java b/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnValueComparison_IsGreaterThan_Test.java index 6040c459..3c93d4b3 100644 --- a/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnValueComparison_IsGreaterThan_Test.java +++ b/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnValueComparison_IsGreaterThan_Test.java @@ -12,14 +12,12 @@ */ 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; import org.assertj.db.common.AbstractTest; -import org.assertj.db.type.Table; import org.junit.Test; /** @@ -36,8 +34,7 @@ public class AssertionsOnValueComparison_IsGreaterThan_Test extends AbstractTest @Test public void test_is_less_than() throws Exception { WritableAssertionInfo info = new WritableAssertionInfo(); - Table table = new Table(); - TableAssert tableAssert = assertThat(table); + TableAssert tableAssert = new TableAssert(null); TableAssert tableAssert2 = AssertionsOnValueComparison.isGreaterThan(tableAssert, info, getValue(null, 8), 7); Assertions.assertThat(tableAssert2).isSameAs(tableAssert); } @@ -49,8 +46,7 @@ public void test_is_less_than() throws Exception { public void should_fail_because_value_is_greater_than_or_equal_to() throws Exception { WritableAssertionInfo info = new WritableAssertionInfo(); info.description("description"); - Table table = new Table(); - TableAssert tableAssert = assertThat(table); + TableAssert tableAssert = new TableAssert(null); try { AssertionsOnValueComparison.isGreaterThan(tableAssert, info, getValue(null, 8), 8); fail("An exception must be raised"); @@ -80,8 +76,7 @@ public void should_fail_because_value_is_greater_than_or_equal_to() throws Excep public void should_fail_because_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); try { AssertionsOnValueComparison.isGreaterThan(tableAssert, info, getValue(null, "8"), 8); fail("An exception must be raised"); diff --git a/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnValueComparison_IsLessThanOrEqualTo_Test.java b/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnValueComparison_IsLessThanOrEqualTo_Test.java index 1d139348..cb069eaa 100644 --- a/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnValueComparison_IsLessThanOrEqualTo_Test.java +++ b/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnValueComparison_IsLessThanOrEqualTo_Test.java @@ -12,14 +12,12 @@ */ 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; import org.assertj.db.common.AbstractTest; -import org.assertj.db.type.Table; import org.junit.Test; /** @@ -36,8 +34,7 @@ public class AssertionsOnValueComparison_IsLessThanOrEqualTo_Test extends Abstra @Test public void test_is_less_than_or_equal_to() throws Exception { WritableAssertionInfo info = new WritableAssertionInfo(); - Table table = new Table(); - TableAssert tableAssert = assertThat(table); + TableAssert tableAssert = new TableAssert(null); TableAssert tableAssert2 = AssertionsOnValueComparison.isLessThanOrEqualTo(tableAssert, info, getValue(null, 8), 9); Assertions.assertThat(tableAssert2).isSameAs(tableAssert); tableAssert2 = AssertionsOnValueComparison.isLessThanOrEqualTo(tableAssert, info, getValue(null, 8), 8); @@ -51,8 +48,7 @@ public void test_is_less_than_or_equal_to() throws Exception { public void should_fail_because_value_is_greater_than() throws Exception { WritableAssertionInfo info = new WritableAssertionInfo(); info.description("description"); - Table table = new Table(); - TableAssert tableAssert = assertThat(table); + TableAssert tableAssert = new TableAssert(null); try { AssertionsOnValueComparison.isLessThanOrEqualTo(tableAssert, info, getValue(null, 8), 7); fail("An exception must be raised"); @@ -72,8 +68,7 @@ public void should_fail_because_value_is_greater_than() throws Exception { public void should_fail_because_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); try { AssertionsOnValueComparison.isLessThanOrEqualTo(tableAssert, info, getValue(null, "8"), 8); fail("An exception must be raised"); diff --git a/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnValueComparison_IsLessThan_Test.java b/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnValueComparison_IsLessThan_Test.java index 9843f034..ad639e50 100644 --- a/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnValueComparison_IsLessThan_Test.java +++ b/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnValueComparison_IsLessThan_Test.java @@ -12,14 +12,12 @@ */ 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; import org.assertj.db.common.AbstractTest; -import org.assertj.db.type.Table; import org.junit.Test; /** @@ -36,8 +34,7 @@ public class AssertionsOnValueComparison_IsLessThan_Test extends AbstractTest { @Test public void test_is_less_than() throws Exception { WritableAssertionInfo info = new WritableAssertionInfo(); - Table table = new Table(); - TableAssert tableAssert = assertThat(table); + TableAssert tableAssert = new TableAssert(null); TableAssert tableAssert2 = AssertionsOnValueComparison.isLessThan(tableAssert, info, getValue(null, 8), 9); Assertions.assertThat(tableAssert2).isSameAs(tableAssert); } @@ -49,8 +46,7 @@ public void test_is_less_than() throws Exception { public void should_fail_because_value_is_greater_than_or_equal_to() throws Exception { WritableAssertionInfo info = new WritableAssertionInfo(); info.description("description"); - Table table = new Table(); - TableAssert tableAssert = assertThat(table); + TableAssert tableAssert = new TableAssert(null); try { AssertionsOnValueComparison.isLessThan(tableAssert, info, getValue(null, 8), 8); fail("An exception must be raised"); @@ -80,8 +76,7 @@ public void should_fail_because_value_is_greater_than_or_equal_to() throws Excep public void should_fail_because_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); try { AssertionsOnValueComparison.isLessThan(tableAssert, info, getValue(null, "8"), 8); fail("An exception must be raised"); diff --git a/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnValueCondition_IsNot_Test.java b/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnValueCondition_IsNot_Test.java index 469b9268..58fe4d0e 100644 --- a/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnValueCondition_IsNot_Test.java +++ b/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnValueCondition_IsNot_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; @@ -20,7 +19,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.junit.Test; /** @@ -44,8 +42,7 @@ public boolean matches(Integer value) { @Test public void test_is_not() throws Exception { WritableAssertionInfo info = new WritableAssertionInfo(); - Table table = new Table(); - TableAssert tableAssert = assertThat(table); + TableAssert tableAssert = new TableAssert(null); TableAssert tableAssert2 = AssertionsOnValueCondition.isNot(tableAssert, info, getValue(null, 1), zero); Assertions.assertThat(tableAssert2).isSameAs(tableAssert); } @@ -57,8 +54,7 @@ public void test_is_not() throws Exception { public void should_fail_because_value_not_satisfies_condition() throws Exception { WritableAssertionInfo info = new WritableAssertionInfo(); info.description("description"); - Table table = new Table(); - TableAssert tableAssert = assertThat(table); + TableAssert tableAssert = new TableAssert(null); try { AssertionsOnValueCondition.isNot(tableAssert, info, getValue(null, 0), zero); fail("An exception must be raised"); diff --git a/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnValueCondition_Is_Test.java b/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnValueCondition_Is_Test.java index 130543eb..1022c84d 100644 --- a/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnValueCondition_Is_Test.java +++ b/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnValueCondition_Is_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; @@ -20,7 +19,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.junit.Test; /** @@ -44,8 +42,7 @@ public boolean matches(Integer value) { @Test public void test_is() throws Exception { WritableAssertionInfo info = new WritableAssertionInfo(); - Table table = new Table(); - TableAssert tableAssert = assertThat(table); + TableAssert tableAssert = new TableAssert(null); TableAssert tableAssert2 = AssertionsOnValueCondition.is(tableAssert, info, getValue(null, 0), zero); Assertions.assertThat(tableAssert2).isSameAs(tableAssert); } @@ -57,8 +54,7 @@ public void test_is() throws Exception { public void should_fail_because_value_not_satisfies_condition() throws Exception { WritableAssertionInfo info = new WritableAssertionInfo(); info.description("description"); - Table table = new Table(); - TableAssert tableAssert = assertThat(table); + TableAssert tableAssert = new TableAssert(null); try { AssertionsOnValueCondition.is(tableAssert, info, getValue(null, 1), zero); fail("An exception must be raised"); diff --git a/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnValueEquality_IsEqualTo_Boolean_Test.java b/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnValueEquality_IsEqualTo_Boolean_Test.java index d2ef371c..35794dc7 100644 --- a/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnValueEquality_IsEqualTo_Boolean_Test.java +++ b/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnValueEquality_IsEqualTo_Boolean_Test.java @@ -12,14 +12,12 @@ */ 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; import org.assertj.db.common.AbstractTest; -import org.assertj.db.type.Table; import org.junit.Test; /** @@ -36,8 +34,7 @@ public class AssertionsOnValueEquality_IsEqualTo_Boolean_Test extends AbstractTe @Test public void test_is_equal_to() throws Exception { WritableAssertionInfo info = new WritableAssertionInfo(); - Table table = new Table(); - TableAssert tableAssert = assertThat(table); + TableAssert tableAssert = new TableAssert(null); TableAssert tableAssert2 = AssertionsOnValueEquality.isEqualTo(tableAssert, info, getValue(null, true), true); Assertions.assertThat(tableAssert2).isSameAs(tableAssert); tableAssert2 = AssertionsOnValueEquality.isEqualTo(tableAssert, info, getValue(null, null), (Boolean) null); @@ -51,8 +48,7 @@ public void test_is_equal_to() throws Exception { public void should_fail_because_value_is_not_equal_to() throws Exception { WritableAssertionInfo info = new WritableAssertionInfo(); info.description("description"); - Table table = new Table(); - TableAssert tableAssert = assertThat(table); + TableAssert tableAssert = new TableAssert(null); try { AssertionsOnValueEquality.isEqualTo(tableAssert, info, getValue(null, true), false); fail("An exception must be raised"); @@ -82,8 +78,7 @@ public void should_fail_because_value_is_not_equal_to() throws Exception { public void should_fail_because_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); try { AssertionsOnValueEquality.isEqualTo(tableAssert, info, getValue(null, 8), true); fail("An exception must be raised"); diff --git a/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnValueEquality_IsEqualTo_Bytes_Test.java b/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnValueEquality_IsEqualTo_Bytes_Test.java index da1cbfeb..1b89434d 100644 --- a/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnValueEquality_IsEqualTo_Bytes_Test.java +++ b/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnValueEquality_IsEqualTo_Bytes_Test.java @@ -12,14 +12,12 @@ */ 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; import org.assertj.db.common.AbstractTest; -import org.assertj.db.type.Table; import org.junit.Test; /** @@ -36,8 +34,7 @@ public class AssertionsOnValueEquality_IsEqualTo_Bytes_Test extends AbstractTest @Test public void test_is_equal_to() throws Exception { WritableAssertionInfo info = new WritableAssertionInfo(); - Table table = new Table(); - TableAssert tableAssert = assertThat(table); + TableAssert tableAssert = new TableAssert(null); TableAssert tableAssert2 = AssertionsOnValueEquality.isEqualTo(tableAssert, info, getValue(null, new byte[]{0, 1}), new byte[]{0, 1}); Assertions.assertThat(tableAssert2).isSameAs(tableAssert); tableAssert2 = AssertionsOnValueEquality.isEqualTo(tableAssert, info, getValue(null, null), (byte[]) null); @@ -51,8 +48,7 @@ public void test_is_equal_to() throws Exception { public void should_fail_because_value_is_not_equal_to() throws Exception { WritableAssertionInfo info = new WritableAssertionInfo(); info.description("description"); - Table table = new Table(); - TableAssert tableAssert = assertThat(table); + TableAssert tableAssert = new TableAssert(null); try { AssertionsOnValueEquality.isEqualTo(tableAssert, info, getValue(null, new byte[]{2, 3}), new byte[]{0, 1}); fail("An exception must be raised"); @@ -76,8 +72,7 @@ public void should_fail_because_value_is_not_equal_to() throws Exception { public void should_fail_because_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); try { AssertionsOnValueEquality.isEqualTo(tableAssert, info, getValue(null, 8), new byte[]{0, 1}); fail("An exception must be raised"); diff --git a/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnValueEquality_IsEqualTo_Character_Test.java b/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnValueEquality_IsEqualTo_Character_Test.java index 4e7708a8..6acd6ea0 100644 --- a/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnValueEquality_IsEqualTo_Character_Test.java +++ b/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnValueEquality_IsEqualTo_Character_Test.java @@ -12,14 +12,12 @@ */ 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; import org.assertj.db.common.AbstractTest; -import org.assertj.db.type.Table; import org.junit.Test; /** @@ -36,8 +34,7 @@ public class AssertionsOnValueEquality_IsEqualTo_Character_Test extends Abstract @Test public void test_is_equal_to() throws Exception { WritableAssertionInfo info = new WritableAssertionInfo(); - Table table = new Table(); - TableAssert tableAssert = assertThat(table); + TableAssert tableAssert = new TableAssert(null); TableAssert tableAssert2 = AssertionsOnValueEquality.isEqualTo(tableAssert, info, getValue(null, 'T'), 'T'); Assertions.assertThat(tableAssert2).isSameAs(tableAssert); tableAssert2 = AssertionsOnValueEquality.isEqualTo(tableAssert, info, getValue(null, "T"), 'T'); @@ -53,8 +50,7 @@ public void test_is_equal_to() throws Exception { public void should_fail_because_value_is_not_equal_to() throws Exception { WritableAssertionInfo info = new WritableAssertionInfo(); info.description("description"); - Table table = new Table(); - TableAssert tableAssert = assertThat(table); + TableAssert tableAssert = new TableAssert(null); try { AssertionsOnValueEquality.isEqualTo(tableAssert, info, getValue(null, 't'), 'T'); fail("An exception must be raised"); @@ -94,8 +90,7 @@ public void should_fail_because_value_is_not_equal_to() throws Exception { public void should_fail_because_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); try { AssertionsOnValueEquality.isEqualTo(tableAssert, info, getValue(null, 8), 'T'); fail("An exception must be raised"); diff --git a/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnValueEquality_IsEqualTo_DateTimeValue_Test.java b/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnValueEquality_IsEqualTo_DateTimeValue_Test.java index ec9ebe1c..e2359596 100644 --- a/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnValueEquality_IsEqualTo_DateTimeValue_Test.java +++ b/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnValueEquality_IsEqualTo_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.Date; @@ -24,7 +23,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.junit.Test; @@ -42,8 +40,7 @@ public class AssertionsOnValueEquality_IsEqualTo_DateTimeValue_Test extends Abst @Test public void test_is_equal_to() throws Exception { WritableAssertionInfo info = new WritableAssertionInfo(); - Table table = new Table(); - TableAssert tableAssert = assertThat(table); + TableAssert tableAssert = new TableAssert(null); TableAssert tableAssert2 = AssertionsOnValueEquality.isEqualTo(tableAssert, info, getValue( null, Date.valueOf("2007-12-23")), DateTimeValue.of(DateValue.of(2007, 12, 23))); Assertions.assertThat(tableAssert2).isSameAs(tableAssert); @@ -62,8 +59,7 @@ public void test_is_equal_to() throws Exception { public void should_fail_because_value_is_not_equal_to() throws Exception { WritableAssertionInfo info = new WritableAssertionInfo(); info.description("description"); - Table table = new Table(); - TableAssert tableAssert = assertThat(table); + TableAssert tableAssert = new TableAssert(null); try { AssertionsOnValueEquality.isEqualTo(tableAssert, info, getValue(null, Date.valueOf("2007-12-24")), DateTimeValue.of(DateValue.of(2007, 12, 23))); fail("An exception must be raised"); @@ -115,8 +111,7 @@ public void should_fail_because_value_is_not_equal_to() throws Exception { public void should_fail_because_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); try { AssertionsOnValueEquality.isEqualTo(tableAssert, info, getValue(null, 8), DateTimeValue.of(DateValue.of(2007, 12, 23))); fail("An exception must be raised"); diff --git a/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnValueEquality_IsEqualTo_DateValue_Test.java b/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnValueEquality_IsEqualTo_DateValue_Test.java index c348098c..39ac241f 100644 --- a/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnValueEquality_IsEqualTo_DateValue_Test.java +++ b/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnValueEquality_IsEqualTo_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; @@ -23,7 +22,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.junit.Test; /** @@ -40,8 +38,7 @@ public class AssertionsOnValueEquality_IsEqualTo_DateValue_Test extends Abstract @Test public void test_is_equal_to() throws Exception { WritableAssertionInfo info = new WritableAssertionInfo(); - Table table = new Table(); - TableAssert tableAssert = assertThat(table); + TableAssert tableAssert = new TableAssert(null); TableAssert tableAssert2 = AssertionsOnValueEquality.isEqualTo(tableAssert, info, getValue( null, Date.valueOf("2007-12-23")), DateValue.of(2007, 12, 23)); Assertions.assertThat(tableAssert2).isSameAs(tableAssert); @@ -59,8 +56,7 @@ public void test_is_equal_to() throws Exception { public void should_fail_because_value_is_not_equal_to() throws Exception { WritableAssertionInfo info = new WritableAssertionInfo(); info.description("description"); - Table table = new Table(); - TableAssert tableAssert = assertThat(table); + TableAssert tableAssert = new TableAssert(null); try { AssertionsOnValueEquality.isEqualTo(tableAssert, info, getValue(null, Date.valueOf("2007-12-24")), DateValue.of(2007, 12, 23)); fail("An exception must be raised"); @@ -110,8 +106,7 @@ public void should_fail_because_value_is_not_equal_to() throws Exception { public void should_fail_because_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); try { AssertionsOnValueEquality.isEqualTo(tableAssert, info, getValue(null, 8), DateValue.of(2007, 12, 23)); fail("An exception must be raised"); diff --git a/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnValueEquality_IsEqualTo_Number_Test.java b/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnValueEquality_IsEqualTo_Number_Test.java index 957ffa89..b8d52601 100644 --- a/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnValueEquality_IsEqualTo_Number_Test.java +++ b/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnValueEquality_IsEqualTo_Number_Test.java @@ -12,14 +12,12 @@ */ 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; import org.assertj.db.common.AbstractTest; -import org.assertj.db.type.Table; import org.junit.Test; /** @@ -36,8 +34,7 @@ public class AssertionsOnValueEquality_IsEqualTo_Number_Test extends AbstractTes @Test public void test_is_equal_to() throws Exception { WritableAssertionInfo info = new WritableAssertionInfo(); - Table table = new Table(); - TableAssert tableAssert = assertThat(table); + TableAssert tableAssert = new TableAssert(null); TableAssert tableAssert2 = AssertionsOnValueEquality.isEqualTo(tableAssert, info, getValue(null, 8), 8); Assertions.assertThat(tableAssert2).isSameAs(tableAssert); tableAssert2 = AssertionsOnValueEquality.isEqualTo(tableAssert, info, getValue(null, null), (Number) null); @@ -51,8 +48,7 @@ public void test_is_equal_to() throws Exception { public void should_fail_because_value_is_not_equal_to() throws Exception { WritableAssertionInfo info = new WritableAssertionInfo(); info.description("description"); - Table table = new Table(); - TableAssert tableAssert = assertThat(table); + TableAssert tableAssert = new TableAssert(null); try { AssertionsOnValueEquality.isEqualTo(tableAssert, info, getValue(null, 9), 8); fail("An exception must be raised"); @@ -82,8 +78,7 @@ public void should_fail_because_value_is_not_equal_to() throws Exception { public void should_fail_because_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); try { AssertionsOnValueEquality.isEqualTo(tableAssert, info, getValue(null, false), 8); fail("An exception must be raised"); diff --git a/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnValueEquality_IsEqualTo_Object_Test.java b/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnValueEquality_IsEqualTo_Object_Test.java index ad4a5d23..227d312b 100644 --- a/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnValueEquality_IsEqualTo_Object_Test.java +++ b/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnValueEquality_IsEqualTo_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.Locale; @@ -21,7 +20,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.junit.Test; /** @@ -38,8 +36,7 @@ public class AssertionsOnValueEquality_IsEqualTo_Object_Test extends AbstractTes @Test public void test_is_equal_to() throws Exception { WritableAssertionInfo info = new WritableAssertionInfo(); - Table table = new Table(); - TableAssert tableAssert = assertThat(table); + TableAssert tableAssert = new TableAssert(null); TableAssert tableAssert2 = AssertionsOnValueEquality.isEqualTo(tableAssert, info, getValue(null, new Locale("fr")), Locale.FRENCH); @@ -57,8 +54,7 @@ public void test_is_equal_to() throws Exception { public void should_fail_because_value_is_not_equal_to() throws Exception { WritableAssertionInfo info = new WritableAssertionInfo(); info.description("description"); - Table table = new Table(); - TableAssert tableAssert = assertThat(table); + TableAssert tableAssert = new TableAssert(null); try { AssertionsOnValueEquality.isEqualTo(tableAssert, info, getValue(null, new Locale("fr")), @@ -104,8 +100,7 @@ public void should_fail_because_value_is_not_equal_to() throws Exception { public void should_fail_because_value_is_not_of_the_same_class() throws Exception { WritableAssertionInfo info = new WritableAssertionInfo(); info.description("description"); - Table table = new Table(); - TableAssert tableAssert = assertThat(table); + TableAssert tableAssert = new TableAssert(null); try { AssertionsOnValueEquality.isEqualTo(tableAssert, info, getValue(null, new StringBuilder("test1")), diff --git a/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnValueEquality_IsEqualTo_String_Test.java b/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnValueEquality_IsEqualTo_String_Test.java index 6f279ed3..a143b046 100644 --- a/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnValueEquality_IsEqualTo_String_Test.java +++ b/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnValueEquality_IsEqualTo_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.sql.Date; @@ -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.junit.Test; /** @@ -41,8 +39,7 @@ public class AssertionsOnValueEquality_IsEqualTo_String_Test extends AbstractTes @Test public void test_is_equal_to() throws Exception { WritableAssertionInfo info = new WritableAssertionInfo(); - Table table = new Table(); - TableAssert tableAssert = assertThat(table); + TableAssert tableAssert = new TableAssert(null); TableAssert tableAssert2 = AssertionsOnValueEquality.isEqualTo(tableAssert, info, getValue(null, "test"), "test"); Assertions.assertThat(tableAssert2).isSameAs(tableAssert); tableAssert2 = AssertionsOnValueEquality.isEqualTo(tableAssert, info, getValue(null, 8), "8"); @@ -73,8 +70,7 @@ public void test_is_equal_to() throws Exception { public void should_fail_because_value_is_not_equal_to() throws Exception { WritableAssertionInfo info = new WritableAssertionInfo(); info.description("description"); - Table table = new Table(); - TableAssert tableAssert = assertThat(table); + TableAssert tableAssert = new TableAssert(null); try { AssertionsOnValueEquality.isEqualTo(tableAssert, info, getValue(null, "test1"), "test"); fail("An exception must be raised"); @@ -236,8 +232,7 @@ public void should_fail_because_value_is_not_equal_to() throws Exception { public void should_fail_because_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); try { AssertionsOnValueEquality.isEqualTo(tableAssert, info, getValue(null, false), "test"); fail("An exception must be raised"); diff --git a/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnValueEquality_IsEqualTo_TimeValue_Test.java b/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnValueEquality_IsEqualTo_TimeValue_Test.java index c351a0d3..e04d3c17 100644 --- a/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnValueEquality_IsEqualTo_TimeValue_Test.java +++ b/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnValueEquality_IsEqualTo_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; @@ -21,7 +20,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.junit.Test; @@ -39,8 +37,7 @@ public class AssertionsOnValueEquality_IsEqualTo_TimeValue_Test extends Abstract @Test public void test_is_equal_to() throws Exception { WritableAssertionInfo info = new WritableAssertionInfo(); - Table table = new Table(); - TableAssert tableAssert = assertThat(table); + TableAssert tableAssert = new TableAssert(null); TableAssert tableAssert2 = AssertionsOnValueEquality.isEqualTo(tableAssert, info, getValue(null, Time.valueOf("09:01:00")), TimeValue.of(9, 1)); Assertions.assertThat(tableAssert2).isSameAs(tableAssert); tableAssert2 = AssertionsOnValueEquality.isEqualTo(tableAssert, info, getValue(null, null), (TimeValue) null); @@ -54,8 +51,7 @@ public void test_is_equal_to() throws Exception { public void should_fail_because_value_is_not_equal_to() throws Exception { WritableAssertionInfo info = new WritableAssertionInfo(); info.description("description"); - Table table = new Table(); - TableAssert tableAssert = assertThat(table); + TableAssert tableAssert = new TableAssert(null); try { AssertionsOnValueEquality.isEqualTo(tableAssert, info, getValue(null, Time.valueOf("09:01:05")), TimeValue.of(9, 1)); fail("An exception must be raised"); @@ -85,8 +81,7 @@ public void should_fail_because_value_is_not_equal_to() throws Exception { public void should_fail_because_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); try { AssertionsOnValueEquality.isEqualTo(tableAssert, info, getValue(null, 8), TimeValue.of(9, 1)); fail("An exception must be raised"); diff --git a/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnValueEquality_IsEqualTo_UUID_Test.java b/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnValueEquality_IsEqualTo_UUID_Test.java index e102d976..9a970f5b 100644 --- a/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnValueEquality_IsEqualTo_UUID_Test.java +++ b/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnValueEquality_IsEqualTo_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.UUID; @@ -21,7 +20,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.junit.Test; /** @@ -38,8 +36,7 @@ public class AssertionsOnValueEquality_IsEqualTo_UUID_Test extends AbstractTest @Test public void test_is_equal_to() throws Exception { WritableAssertionInfo info = new WritableAssertionInfo(); - Table table = new Table(); - TableAssert tableAssert = assertThat(table); + TableAssert tableAssert = new TableAssert(null); TableAssert tableAssert2 = AssertionsOnValueEquality.isEqualTo(tableAssert, info, getValue(null, UUID.fromString( "30B443AE-C0C9-4790-9BEC-CE1380808435")), @@ -58,8 +55,7 @@ public void test_is_equal_to() throws Exception { public void should_fail_because_value_is_not_equal_to() throws Exception { WritableAssertionInfo info = new WritableAssertionInfo(); info.description("description"); - Table table = new Table(); - TableAssert tableAssert = assertThat(table); + TableAssert tableAssert = new TableAssert(null); try { AssertionsOnValueEquality.isEqualTo(tableAssert, info, getValue(null, UUID.fromString("30B443AE-C0C9-4790-9BEC-CE1380808435")), @@ -93,8 +89,7 @@ public void should_fail_because_value_is_not_equal_to() throws Exception { public void should_fail_because_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); try { AssertionsOnValueEquality.isEqualTo(tableAssert, info, getValue(null, 8), UUID.fromString("30B443AE-C0C9-4790-9BEC-CE1380808435")); diff --git a/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnValueEquality_IsFalse_Test.java b/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnValueEquality_IsFalse_Test.java index 9abb05b5..f28c4834 100644 --- a/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnValueEquality_IsFalse_Test.java +++ b/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnValueEquality_IsFalse_Test.java @@ -12,14 +12,12 @@ */ 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; import org.assertj.db.common.AbstractTest; -import org.assertj.db.type.Table; import org.junit.Test; /** @@ -36,8 +34,7 @@ public class AssertionsOnValueEquality_IsFalse_Test extends AbstractTest { @Test public void test_is_false() throws Exception { WritableAssertionInfo info = new WritableAssertionInfo(); - Table table = new Table(); - TableAssert tableAssert = assertThat(table); + TableAssert tableAssert = new TableAssert(null); TableAssert tableAssert2 = AssertionsOnValueEquality.isFalse(tableAssert, info, getValue(null, false)); Assertions.assertThat(tableAssert2).isSameAs(tableAssert); } @@ -49,8 +46,7 @@ public void test_is_false() throws Exception { public void should_fail_because_value_is_true() throws Exception { WritableAssertionInfo info = new WritableAssertionInfo(); info.description("description"); - Table table = new Table(); - TableAssert tableAssert = assertThat(table); + TableAssert tableAssert = new TableAssert(null); try { AssertionsOnValueEquality.isFalse(tableAssert, info, getValue(null, true)); fail("An exception must be raised"); @@ -70,8 +66,7 @@ public void should_fail_because_value_is_true() throws Exception { public void should_fail_because_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); try { AssertionsOnValueEquality.isFalse(tableAssert, info, getValue(null, 8)); fail("An exception must be raised"); diff --git a/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnValueEquality_IsTrue_Test.java b/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnValueEquality_IsTrue_Test.java index c307c1c4..5d388f2c 100644 --- a/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnValueEquality_IsTrue_Test.java +++ b/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnValueEquality_IsTrue_Test.java @@ -12,14 +12,12 @@ */ 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; import org.assertj.db.common.AbstractTest; -import org.assertj.db.type.Table; import org.junit.Test; /** @@ -36,8 +34,7 @@ public class AssertionsOnValueEquality_IsTrue_Test extends AbstractTest { @Test public void test_is_true() throws Exception { WritableAssertionInfo info = new WritableAssertionInfo(); - Table table = new Table(); - TableAssert tableAssert = assertThat(table); + TableAssert tableAssert = new TableAssert(null); TableAssert tableAssert2 = AssertionsOnValueEquality.isTrue(tableAssert, info, getValue(null, true)); Assertions.assertThat(tableAssert2).isSameAs(tableAssert); } @@ -49,8 +46,7 @@ public void test_is_true() throws Exception { public void should_fail_because_value_is_false() throws Exception { WritableAssertionInfo info = new WritableAssertionInfo(); info.description("description"); - Table table = new Table(); - TableAssert tableAssert = assertThat(table); + TableAssert tableAssert = new TableAssert(null); try { AssertionsOnValueEquality.isTrue(tableAssert, info, getValue(null, false)); fail("An exception must be raised"); @@ -70,8 +66,7 @@ public void should_fail_because_value_is_false() throws Exception { public void should_fail_because_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); try { AssertionsOnValueEquality.isTrue(tableAssert, info, getValue(null, 8)); fail("An exception must be raised"); diff --git a/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnValueEquality_IsZero_Test.java b/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnValueEquality_IsZero_Test.java index a98fa337..bb4f78ce 100644 --- a/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnValueEquality_IsZero_Test.java +++ b/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnValueEquality_IsZero_Test.java @@ -12,14 +12,12 @@ */ 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; import org.assertj.db.common.AbstractTest; -import org.assertj.db.type.Table; import org.junit.Test; /** @@ -36,8 +34,7 @@ public class AssertionsOnValueEquality_IsZero_Test extends AbstractTest { @Test public void test_is_zero() throws Exception { WritableAssertionInfo info = new WritableAssertionInfo(); - Table table = new Table(); - TableAssert tableAssert = assertThat(table); + TableAssert tableAssert = new TableAssert(null); TableAssert tableAssert2 = AssertionsOnValueEquality.isZero(tableAssert, info, getValue(null, 0)); Assertions.assertThat(tableAssert2).isSameAs(tableAssert); } @@ -49,8 +46,7 @@ public void test_is_zero() throws Exception { public void should_fail_because_value_is_not_zero() throws Exception { WritableAssertionInfo info = new WritableAssertionInfo(); info.description("description"); - Table table = new Table(); - TableAssert tableAssert = assertThat(table); + TableAssert tableAssert = new TableAssert(null); try { AssertionsOnValueEquality.isZero(tableAssert, info, getValue(null, 1)); fail("An exception must be raised"); @@ -70,8 +66,7 @@ public void should_fail_because_value_is_not_zero() throws Exception { public void should_fail_because_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); try { AssertionsOnValueEquality.isZero(tableAssert, info, getValue(null, false)); fail("An exception must be raised"); diff --git a/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnValueInequality_IsNotEqualTo_Boolean_Test.java b/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnValueInequality_IsNotEqualTo_Boolean_Test.java index aa64e027..6ada55bd 100644 --- a/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnValueInequality_IsNotEqualTo_Boolean_Test.java +++ b/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnValueInequality_IsNotEqualTo_Boolean_Test.java @@ -12,14 +12,12 @@ */ 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; import org.assertj.db.common.AbstractTest; -import org.assertj.db.type.Table; import org.junit.Test; /** @@ -36,8 +34,7 @@ public class AssertionsOnValueInequality_IsNotEqualTo_Boolean_Test extends Abstr @Test public void test_is_not_equal_to() throws Exception { WritableAssertionInfo info = new WritableAssertionInfo(); - Table table = new Table(); - TableAssert tableAssert = assertThat(table); + TableAssert tableAssert = new TableAssert(null); TableAssert tableAssert2 = AssertionsOnValueInequality.isNotEqualTo(tableAssert, info, getValue(null, true), false); Assertions.assertThat(tableAssert2).isSameAs(tableAssert); tableAssert2 = AssertionsOnValueInequality.isNotEqualTo(tableAssert, info, getValue(null, true), (Boolean) null); @@ -51,8 +48,7 @@ public void test_is_not_equal_to() throws Exception { public void should_fail_because_value_is_equal_to() throws Exception { WritableAssertionInfo info = new WritableAssertionInfo(); info.description("description"); - Table table = new Table(); - TableAssert tableAssert = assertThat(table); + TableAssert tableAssert = new TableAssert(null); try { AssertionsOnValueInequality.isNotEqualTo(tableAssert, info, getValue(null, true), true); fail("An exception must be raised"); @@ -82,8 +78,7 @@ public void should_fail_because_value_is_equal_to() throws Exception { public void should_fail_because_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); try { AssertionsOnValueInequality.isNotEqualTo(tableAssert, info, getValue(null, 8), true); fail("An exception must be raised"); diff --git a/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnValueInequality_IsNotEqualTo_Bytes_Test.java b/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnValueInequality_IsNotEqualTo_Bytes_Test.java index 8c7b6c06..a38d0d89 100644 --- a/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnValueInequality_IsNotEqualTo_Bytes_Test.java +++ b/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnValueInequality_IsNotEqualTo_Bytes_Test.java @@ -12,14 +12,12 @@ */ 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; import org.assertj.db.common.AbstractTest; -import org.assertj.db.type.Table; import org.junit.Test; /** @@ -36,8 +34,7 @@ public class AssertionsOnValueInequality_IsNotEqualTo_Bytes_Test extends Abstrac @Test public void test_is_not_equal_to() throws Exception { WritableAssertionInfo info = new WritableAssertionInfo(); - Table table = new Table(); - TableAssert tableAssert = assertThat(table); + TableAssert tableAssert = new TableAssert(null); TableAssert tableAssert2 = AssertionsOnValueInequality.isNotEqualTo(tableAssert, info, getValue(null, new byte[]{2, 3}), new byte[]{0, 1}); Assertions.assertThat(tableAssert2).isSameAs(tableAssert); tableAssert2 = AssertionsOnValueInequality.isNotEqualTo(tableAssert, info, getValue(null, new byte[]{2, 3}), (byte[]) null); @@ -51,8 +48,7 @@ public void test_is_not_equal_to() throws Exception { public void should_fail_because_value_is_equal_to() throws Exception { WritableAssertionInfo info = new WritableAssertionInfo(); info.description("description"); - Table table = new Table(); - TableAssert tableAssert = assertThat(table); + TableAssert tableAssert = new TableAssert(null); try { AssertionsOnValueInequality.isNotEqualTo(tableAssert, info, getValue(null, new byte[]{0, 1}), new byte[]{0, 1}); fail("An exception must be raised"); @@ -76,8 +72,7 @@ public void should_fail_because_value_is_equal_to() throws Exception { public void should_fail_because_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); try { AssertionsOnValueInequality.isNotEqualTo(tableAssert, info, getValue(null, 8), new byte[]{0, 1}); fail("An exception must be raised"); diff --git a/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnValueInequality_IsNotEqualTo_Character_Test.java b/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnValueInequality_IsNotEqualTo_Character_Test.java index 0e382b42..a0ad55d0 100644 --- a/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnValueInequality_IsNotEqualTo_Character_Test.java +++ b/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnValueInequality_IsNotEqualTo_Character_Test.java @@ -12,14 +12,12 @@ */ 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; import org.assertj.db.common.AbstractTest; -import org.assertj.db.type.Table; import org.junit.Test; /** @@ -36,8 +34,7 @@ public class AssertionsOnValueInequality_IsNotEqualTo_Character_Test extends Abs @Test public void test_is_not_equal_to() throws Exception { WritableAssertionInfo info = new WritableAssertionInfo(); - Table table = new Table(); - TableAssert tableAssert = assertThat(table); + TableAssert tableAssert = new TableAssert(null); TableAssert tableAssert2 = AssertionsOnValueInequality.isNotEqualTo(tableAssert, info, getValue(null, 'T'), 't'); Assertions.assertThat(tableAssert2).isSameAs(tableAssert); tableAssert2 = AssertionsOnValueInequality.isNotEqualTo(tableAssert, info, getValue(null, "T"), 't'); @@ -53,8 +50,7 @@ public void test_is_not_equal_to() throws Exception { public void should_fail_because_value_is_equal_to() throws Exception { WritableAssertionInfo info = new WritableAssertionInfo(); info.description("description"); - Table table = new Table(); - TableAssert tableAssert = assertThat(table); + TableAssert tableAssert = new TableAssert(null); try { AssertionsOnValueInequality.isNotEqualTo(tableAssert, info, getValue(null, 'T'), 'T'); fail("An exception must be raised"); @@ -94,8 +90,7 @@ public void should_fail_because_value_is_equal_to() throws Exception { public void should_fail_because_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); try { AssertionsOnValueInequality.isNotEqualTo(tableAssert, info, getValue(null, 8), 'T'); fail("An exception must be raised"); diff --git a/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnValueInequality_IsNotEqualTo_DateTimeValue_Test.java b/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnValueInequality_IsNotEqualTo_DateTimeValue_Test.java index 56281a8e..e2288e44 100644 --- a/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnValueInequality_IsNotEqualTo_DateTimeValue_Test.java +++ b/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnValueInequality_IsNotEqualTo_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.Date; @@ -24,7 +23,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.junit.Test; @@ -42,8 +40,7 @@ public class AssertionsOnValueInequality_IsNotEqualTo_DateTimeValue_Test extends @Test public void test_is_not_equal_to() throws Exception { WritableAssertionInfo info = new WritableAssertionInfo(); - Table table = new Table(); - TableAssert tableAssert = assertThat(table); + TableAssert tableAssert = new TableAssert(null); TableAssert tableAssert2 = AssertionsOnValueInequality.isNotEqualTo(tableAssert, info, getValue(null, Date.valueOf("2007-12-24")), DateTimeValue.of(DateValue.of(2007, 12, 23))); @@ -69,8 +66,7 @@ public void test_is_not_equal_to() throws Exception { public void should_fail_because_value_is_equal_to() throws Exception { WritableAssertionInfo info = new WritableAssertionInfo(); info.description("description"); - Table table = new Table(); - TableAssert tableAssert = assertThat(table); + TableAssert tableAssert = new TableAssert(null); try { AssertionsOnValueInequality.isNotEqualTo(tableAssert, info, getValue(null, Date.valueOf("2007-12-23")), @@ -115,8 +111,7 @@ public void should_fail_because_value_is_equal_to() throws Exception { public void should_fail_because_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); try { AssertionsOnValueInequality.isNotEqualTo(tableAssert, info, getValue(null, 8), DateTimeValue.of(DateValue.of(2007, 12, 23))); fail("An exception must be raised"); diff --git a/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnValueInequality_IsNotEqualTo_DateValue_Test.java b/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnValueInequality_IsNotEqualTo_DateValue_Test.java index 1b576765..1e4a70bb 100644 --- a/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnValueInequality_IsNotEqualTo_DateValue_Test.java +++ b/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnValueInequality_IsNotEqualTo_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; @@ -23,7 +22,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.junit.Test; /** @@ -40,8 +38,7 @@ public class AssertionsOnValueInequality_IsNotEqualTo_DateValue_Test extends Abs @Test public void test_is_not_equal_to() throws Exception { WritableAssertionInfo info = new WritableAssertionInfo(); - Table table = new Table(); - TableAssert tableAssert = assertThat(table); + TableAssert tableAssert = new TableAssert(null); TableAssert tableAssert2 = AssertionsOnValueInequality.isNotEqualTo(tableAssert, info, getValue(null, Date.valueOf("2007-12-24")), DateValue.of(2007, 12, 23)); @@ -67,8 +64,7 @@ public void test_is_not_equal_to() throws Exception { public void should_fail_because_value_is_equal_to() throws Exception { WritableAssertionInfo info = new WritableAssertionInfo(); info.description("description"); - Table table = new Table(); - TableAssert tableAssert = assertThat(table); + TableAssert tableAssert = new TableAssert(null); try { AssertionsOnValueInequality.isNotEqualTo(tableAssert, info, getValue(null, Date.valueOf("2007-12-23")), @@ -112,8 +108,7 @@ public void should_fail_because_value_is_equal_to() throws Exception { public void should_fail_because_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); try { AssertionsOnValueInequality.isNotEqualTo(tableAssert, info, getValue(null, 8), DateValue.of(2007, 12, 23)); fail("An exception must be raised"); diff --git a/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnValueInequality_IsNotEqualTo_Number_Test.java b/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnValueInequality_IsNotEqualTo_Number_Test.java index d94b2671..de052089 100644 --- a/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnValueInequality_IsNotEqualTo_Number_Test.java +++ b/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnValueInequality_IsNotEqualTo_Number_Test.java @@ -12,14 +12,12 @@ */ 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; import org.assertj.db.common.AbstractTest; -import org.assertj.db.type.Table; import org.junit.Test; /** @@ -36,8 +34,7 @@ public class AssertionsOnValueInequality_IsNotEqualTo_Number_Test extends Abstra @Test public void test_is_not_equal_to() throws Exception { WritableAssertionInfo info = new WritableAssertionInfo(); - Table table = new Table(); - TableAssert tableAssert = assertThat(table); + TableAssert tableAssert = new TableAssert(null); TableAssert tableAssert2 = AssertionsOnValueInequality.isNotEqualTo(tableAssert, info, getValue(null, 9), 8); Assertions.assertThat(tableAssert2).isSameAs(tableAssert); tableAssert2 = AssertionsOnValueInequality.isNotEqualTo(tableAssert, info, getValue(null, 9), (Number) null); @@ -51,8 +48,7 @@ public void test_is_not_equal_to() throws Exception { public void should_fail_because_value_is_equal_to() throws Exception { WritableAssertionInfo info = new WritableAssertionInfo(); info.description("description"); - Table table = new Table(); - TableAssert tableAssert = assertThat(table); + TableAssert tableAssert = new TableAssert(null); try { AssertionsOnValueInequality.isNotEqualTo(tableAssert, info, getValue(null, 8), 8); fail("An exception must be raised"); @@ -82,8 +78,7 @@ public void should_fail_because_value_is_equal_to() throws Exception { public void should_fail_because_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); try { AssertionsOnValueInequality.isNotEqualTo(tableAssert, info, getValue(null, false), 8); fail("An exception must be raised"); diff --git a/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnValueInequality_IsNotEqualTo_Object_Test.java b/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnValueInequality_IsNotEqualTo_Object_Test.java index 7f25e439..86497fba 100644 --- a/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnValueInequality_IsNotEqualTo_Object_Test.java +++ b/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnValueInequality_IsNotEqualTo_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.Locale; @@ -21,7 +20,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.junit.Test; /** @@ -38,8 +36,7 @@ public class AssertionsOnValueInequality_IsNotEqualTo_Object_Test extends Abstra @Test public void test_is_not_equal_to() throws Exception { WritableAssertionInfo info = new WritableAssertionInfo(); - Table table = new Table(); - TableAssert tableAssert = assertThat(table); + TableAssert tableAssert = new TableAssert(null); TableAssert tableAssert2 = AssertionsOnValueInequality.isNotEqualTo(tableAssert, info, getValue(null, new Locale("fr")), new Locale("en")); @@ -65,8 +62,7 @@ public void test_is_not_equal_to() throws Exception { public void should_fail_because_value_is_equal_to() throws Exception { WritableAssertionInfo info = new WritableAssertionInfo(); info.description("description"); - Table table = new Table(); - TableAssert tableAssert = assertThat(table); + TableAssert tableAssert = new TableAssert(null); try { AssertionsOnValueInequality.isNotEqualTo(tableAssert, info, getValue(null, new Locale("fr")), @@ -100,8 +96,7 @@ public void should_fail_because_value_is_equal_to() throws Exception { public void should_fail_because_value_is_not_of_the_same_class() throws Exception { WritableAssertionInfo info = new WritableAssertionInfo(); info.description("description"); - Table table = new Table(); - TableAssert tableAssert = assertThat(table); + TableAssert tableAssert = new TableAssert(null); try { AssertionsOnValueInequality.isNotEqualTo(tableAssert, info, getValue(null, new StringBuilder("test1")), diff --git a/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnValueInequality_IsNotEqualTo_String_Test.java b/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnValueInequality_IsNotEqualTo_String_Test.java index dc5ed501..c1865fb4 100644 --- a/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnValueInequality_IsNotEqualTo_String_Test.java +++ b/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnValueInequality_IsNotEqualTo_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.sql.Date; @@ -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.junit.Test; /** @@ -41,8 +39,7 @@ public class AssertionsOnValueInequality_IsNotEqualTo_String_Test extends Abstra @Test public void test_is_not_equal_to() throws Exception { WritableAssertionInfo info = new WritableAssertionInfo(); - Table table = new Table(); - TableAssert tableAssert = assertThat(table); + TableAssert tableAssert = new TableAssert(null); TableAssert tableAssert2 = AssertionsOnValueInequality.isNotEqualTo(tableAssert, info, getValue(null, "test1"), "test"); Assertions.assertThat(tableAssert2).isSameAs(tableAssert); tableAssert2 = AssertionsOnValueInequality.isNotEqualTo(tableAssert, info, getValue(null, 9), "8"); @@ -109,8 +106,7 @@ public void test_is_not_equal_to() throws Exception { public void should_fail_because_value_is_equal_to() throws Exception { WritableAssertionInfo info = new WritableAssertionInfo(); info.description("description"); - Table table = new Table(); - TableAssert tableAssert = assertThat(table); + TableAssert tableAssert = new TableAssert(null); try { AssertionsOnValueInequality.isNotEqualTo(tableAssert, info, getValue(null, "test"), "test"); fail("An exception must be raised"); @@ -216,8 +212,7 @@ public void should_fail_because_value_is_equal_to() throws Exception { public void should_fail_because_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); try { AssertionsOnValueInequality.isNotEqualTo(tableAssert, info, getValue(null, false), "test"); fail("An exception must be raised"); diff --git a/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnValueInequality_IsNotEqualTo_TimeValue_Test.java b/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnValueInequality_IsNotEqualTo_TimeValue_Test.java index e0c88352..445a5470 100644 --- a/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnValueInequality_IsNotEqualTo_TimeValue_Test.java +++ b/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnValueInequality_IsNotEqualTo_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; @@ -21,7 +20,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.junit.Test; @@ -39,8 +37,7 @@ public class AssertionsOnValueInequality_IsNotEqualTo_TimeValue_Test extends Abs @Test public void test_is_not_equal_to() throws Exception { WritableAssertionInfo info = new WritableAssertionInfo(); - Table table = new Table(); - TableAssert tableAssert = assertThat(table); + TableAssert tableAssert = new TableAssert(null); TableAssert tableAssert2 = AssertionsOnValueInequality.isNotEqualTo(tableAssert, info, getValue(null, Time.valueOf("09:01:05")), TimeValue.of(9, 1)); @@ -58,8 +55,7 @@ public void test_is_not_equal_to() throws Exception { public void should_fail_because_value_is_equal_to() throws Exception { WritableAssertionInfo info = new WritableAssertionInfo(); info.description("description"); - Table table = new Table(); - TableAssert tableAssert = assertThat(table); + TableAssert tableAssert = new TableAssert(null); try { AssertionsOnValueInequality.isNotEqualTo(tableAssert, info, getValue(null, Time.valueOf("09:01:00")), @@ -91,8 +87,7 @@ public void should_fail_because_value_is_equal_to() throws Exception { public void should_fail_because_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); try { AssertionsOnValueInequality.isNotEqualTo(tableAssert, info, getValue(null, 8), TimeValue.of(9, 1)); fail("An exception must be raised"); diff --git a/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnValueInequality_IsNotEqualTo_UUID_Test.java b/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnValueInequality_IsNotEqualTo_UUID_Test.java index 439608de..beb29a10 100644 --- a/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnValueInequality_IsNotEqualTo_UUID_Test.java +++ b/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnValueInequality_IsNotEqualTo_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.UUID; @@ -21,7 +20,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.junit.Test; /** @@ -38,8 +36,7 @@ public class AssertionsOnValueInequality_IsNotEqualTo_UUID_Test extends Abstract @Test public void test_is_not_equal_to() throws Exception { WritableAssertionInfo info = new WritableAssertionInfo(); - Table table = new Table(); - TableAssert tableAssert = assertThat(table); + TableAssert tableAssert = new TableAssert(null); TableAssert tableAssert2 = AssertionsOnValueInequality.isNotEqualTo(tableAssert, info, getValue(null, UUID.fromString( "30B443AE-C0C9-4790-9BEC-CE1380808435")), @@ -60,8 +57,7 @@ public void test_is_not_equal_to() throws Exception { public void should_fail_because_value_is_equal_to() throws Exception { WritableAssertionInfo info = new WritableAssertionInfo(); info.description("description"); - Table table = new Table(); - TableAssert tableAssert = assertThat(table); + TableAssert tableAssert = new TableAssert(null); try { AssertionsOnValueInequality.isNotEqualTo(tableAssert, info, getValue(null, UUID.fromString("30B443AE-C0C9-4790-9BEC-CE1380808435")), @@ -95,8 +91,7 @@ public void should_fail_because_value_is_equal_to() throws Exception { public void should_fail_because_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); try { AssertionsOnValueInequality.isNotEqualTo(tableAssert, info, getValue(null, 8), UUID.fromString("30B443AE-C0C9-4790-9BEC-CE1380808435")); diff --git a/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnValueInequality_IsNotZero_Test.java b/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnValueInequality_IsNotZero_Test.java index 16f0d391..337c2637 100644 --- a/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnValueInequality_IsNotZero_Test.java +++ b/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnValueInequality_IsNotZero_Test.java @@ -12,14 +12,12 @@ */ 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; import org.assertj.db.common.AbstractTest; -import org.assertj.db.type.Table; import org.junit.Test; /** @@ -36,8 +34,7 @@ public class AssertionsOnValueInequality_IsNotZero_Test extends AbstractTest { @Test public void test_is_not_zero() throws Exception { WritableAssertionInfo info = new WritableAssertionInfo(); - Table table = new Table(); - TableAssert tableAssert = assertThat(table); + TableAssert tableAssert = new TableAssert(null); TableAssert tableAssert2 = AssertionsOnValueInequality.isNotZero(tableAssert, info, getValue(null, 1)); Assertions.assertThat(tableAssert2).isSameAs(tableAssert); } @@ -49,8 +46,7 @@ public void test_is_not_zero() throws Exception { public void should_fail_because_value_is_zero() throws Exception { WritableAssertionInfo info = new WritableAssertionInfo(); info.description("description"); - Table table = new Table(); - TableAssert tableAssert = assertThat(table); + TableAssert tableAssert = new TableAssert(null); try { AssertionsOnValueInequality.isNotZero(tableAssert, info, getValue(null, 0)); fail("An exception must be raised"); @@ -70,8 +66,7 @@ public void should_fail_because_value_is_zero() throws Exception { public void should_fail_because_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); try { AssertionsOnValueInequality.isNotZero(tableAssert, info, getValue(null, false)); fail("An exception must be raised"); diff --git a/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnValueNullity_IsNotNull_Test.java b/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnValueNullity_IsNotNull_Test.java index 03c2ba9e..ecaa530c 100644 --- a/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnValueNullity_IsNotNull_Test.java +++ b/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnValueNullity_IsNotNull_Test.java @@ -12,14 +12,12 @@ */ 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; import org.assertj.db.common.AbstractTest; -import org.assertj.db.type.Table; import org.junit.Test; /** @@ -36,8 +34,7 @@ public class AssertionsOnValueNullity_IsNotNull_Test extends AbstractTest { @Test public void test_is_not_null() throws Exception { WritableAssertionInfo info = new WritableAssertionInfo(); - Table table = new Table(); - TableAssert tableAssert = assertThat(table); + TableAssert tableAssert = new TableAssert(null); TableAssert tableAssert2 = AssertionsOnValueNullity.isNotNull(tableAssert, info, getValue(null, 1)); Assertions.assertThat(tableAssert2).isSameAs(tableAssert); } @@ -49,8 +46,7 @@ public void test_is_not_null() throws Exception { public void should_fail_because_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); try { AssertionsOnValueNullity.isNotNull(tableAssert, info, getValue(null, null)); fail("An exception must be raised"); diff --git a/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnValueNullity_IsNull_Test.java b/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnValueNullity_IsNull_Test.java index 644e02f8..f2fe67c0 100644 --- a/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnValueNullity_IsNull_Test.java +++ b/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnValueNullity_IsNull_Test.java @@ -12,14 +12,12 @@ */ 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; import org.assertj.db.common.AbstractTest; -import org.assertj.db.type.Table; import org.junit.Test; /** @@ -36,8 +34,7 @@ public class AssertionsOnValueNullity_IsNull_Test extends AbstractTest { @Test public void test_is_null() throws Exception { WritableAssertionInfo info = new WritableAssertionInfo(); - Table table = new Table(); - TableAssert tableAssert = assertThat(table); + TableAssert tableAssert = new TableAssert(null); TableAssert tableAssert2 = AssertionsOnValueNullity.isNull(tableAssert, info, getValue(null, null)); Assertions.assertThat(tableAssert2).isSameAs(tableAssert); } @@ -49,8 +46,7 @@ public void test_is_null() throws Exception { public void should_fail_because_value_is_not_null() { WritableAssertionInfo info = new WritableAssertionInfo(); info.description("description"); - Table table = new Table(); - TableAssert tableAssert = assertThat(table); + TableAssert tableAssert = new TableAssert(null); try { AssertionsOnValueNullity.isNull(tableAssert, info, getValue(null, 0)); fail("An exception must be raised"); diff --git a/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnValueType_IsBoolean_Test.java b/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnValueType_IsBoolean_Test.java index 51f09763..2a75f987 100644 --- a/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnValueType_IsBoolean_Test.java +++ b/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnValueType_IsBoolean_Test.java @@ -12,14 +12,12 @@ */ 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; import org.assertj.db.common.AbstractTest; -import org.assertj.db.type.Table; import org.junit.Test; /** @@ -36,8 +34,7 @@ public class AssertionsOnValueType_IsBoolean_Test extends AbstractTest { @Test public void test_is_boolean() throws Exception { WritableAssertionInfo info = new WritableAssertionInfo(); - Table table = new Table(); - TableAssert tableAssert = assertThat(table); + TableAssert tableAssert = new TableAssert(null); TableAssert tableAssert2 = AssertionsOnValueType.isBoolean(tableAssert, info, getValue(null, true)); Assertions.assertThat(tableAssert2).isSameAs(tableAssert); } @@ -49,8 +46,7 @@ public void test_is_boolean() throws Exception { public void should_fail_because_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); try { AssertionsOnValueType.isBoolean(tableAssert, info, getValue(null, "text")); fail("An exception must be raised"); @@ -72,8 +68,7 @@ public void should_fail_because_value_is_not_a_boolean() throws Exception { 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 { AssertionsOnValueType.isBoolean(tableAssert, info, getValue(null, new StringBuilder("text"))); fail("An exception must be raised"); diff --git a/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnValueType_IsBytes_Test.java b/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnValueType_IsBytes_Test.java index 68b817e9..9ce07b63 100644 --- a/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnValueType_IsBytes_Test.java +++ b/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnValueType_IsBytes_Test.java @@ -12,14 +12,12 @@ */ 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; import org.assertj.db.common.AbstractTest; -import org.assertj.db.type.Table; import org.junit.Test; /** @@ -36,8 +34,7 @@ public class AssertionsOnValueType_IsBytes_Test extends AbstractTest { @Test public void test_is_bytes() throws Exception { WritableAssertionInfo info = new WritableAssertionInfo(); - Table table = new Table(); - TableAssert tableAssert = assertThat(table); + TableAssert tableAssert = new TableAssert(null); TableAssert tableAssert2 = AssertionsOnValueType.isBytes(tableAssert, info, getValue(null, new byte[]{0, 1})); Assertions.assertThat(tableAssert2).isSameAs(tableAssert); } @@ -49,8 +46,7 @@ public void test_is_bytes() throws Exception { public void should_fail_because_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); try { AssertionsOnValueType.isBytes(tableAssert, info, getValue(null, "test")); fail("An exception must be raised"); @@ -72,8 +68,7 @@ public void should_fail_because_value_is_not_bytes() throws Exception { 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 { AssertionsOnValueType.isBytes(tableAssert, info, getValue(null, new StringBuilder("text"))); fail("An exception must be raised"); diff --git a/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnValueType_IsDateTime_Test.java b/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnValueType_IsDateTime_Test.java index 9454d585..8671a301 100644 --- a/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnValueType_IsDateTime_Test.java +++ b/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnValueType_IsDateTime_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; @@ -21,7 +20,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.junit.Test; /** @@ -38,8 +36,7 @@ public class AssertionsOnValueType_IsDateTime_Test extends AbstractTest { @Test public void test_is_date_time() throws Exception { WritableAssertionInfo info = new WritableAssertionInfo(); - Table table = new Table(); - TableAssert tableAssert = assertThat(table); + TableAssert tableAssert = new TableAssert(null); TableAssert tableAssert2 = AssertionsOnValueType.isDateTime(tableAssert, info, getValue( null, Timestamp.valueOf("2007-12-23 09:01:00"))); Assertions.assertThat(tableAssert2).isSameAs(tableAssert); @@ -52,8 +49,7 @@ public void test_is_date_time() throws Exception { public void should_fail_because_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); try { AssertionsOnValueType.isDateTime(tableAssert, info, getValue(null, "test")); fail("An exception must be raised"); @@ -75,8 +71,7 @@ public void should_fail_because_value_is_not_a_date_time() throws Exception { 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 { AssertionsOnValueType.isDateTime(tableAssert, info, getValue(null, new StringBuilder("text"))); fail("An exception must be raised"); diff --git a/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnValueType_IsDate_Test.java b/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnValueType_IsDate_Test.java index 851e4103..01a2c8bc 100644 --- a/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnValueType_IsDate_Test.java +++ b/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnValueType_IsDate_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; @@ -21,7 +20,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.junit.Test; /** @@ -38,8 +36,7 @@ public class AssertionsOnValueType_IsDate_Test extends AbstractTest { @Test public void test_is_date() throws Exception { WritableAssertionInfo info = new WritableAssertionInfo(); - Table table = new Table(); - TableAssert tableAssert = assertThat(table); + TableAssert tableAssert = new TableAssert(null); TableAssert tableAssert2 = AssertionsOnValueType.isDate(tableAssert, info, getValue(null, Date.valueOf("2007-12-23"))); Assertions.assertThat(tableAssert2).isSameAs(tableAssert); } @@ -51,8 +48,7 @@ public void test_is_date() throws Exception { public void should_fail_because_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); try { AssertionsOnValueType.isDate(tableAssert, info, getValue(null, "test")); fail("An exception must be raised"); @@ -74,8 +70,7 @@ public void should_fail_because_value_is_not_a_date() throws Exception { 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 { AssertionsOnValueType.isDate(tableAssert, info, getValue(null, new StringBuilder("text"))); fail("An exception must be raised"); diff --git a/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnValueType_IsNumber_Test.java b/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnValueType_IsNumber_Test.java index 92122e48..433ced0e 100644 --- a/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnValueType_IsNumber_Test.java +++ b/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnValueType_IsNumber_Test.java @@ -12,14 +12,12 @@ */ 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; import org.assertj.db.common.AbstractTest; -import org.assertj.db.type.Table; import org.junit.Test; /** @@ -36,8 +34,7 @@ public class AssertionsOnValueType_IsNumber_Test extends AbstractTest { @Test public void test_is_number() throws Exception { WritableAssertionInfo info = new WritableAssertionInfo(); - Table table = new Table(); - TableAssert tableAssert = assertThat(table); + TableAssert tableAssert = new TableAssert(null); TableAssert tableAssert2 = AssertionsOnValueType.isNumber(tableAssert, info, getValue(null, 8)); Assertions.assertThat(tableAssert2).isSameAs(tableAssert); } @@ -49,8 +46,7 @@ public void test_is_number() throws Exception { public void should_fail_because_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); try { AssertionsOnValueType.isNumber(tableAssert, info, getValue(null, "test")); fail("An exception must be raised"); @@ -72,8 +68,7 @@ public void should_fail_because_value_is_not_a_number() throws Exception { 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 { AssertionsOnValueType.isNumber(tableAssert, info, getValue(null, new StringBuilder("text"))); fail("An exception must be raised"); diff --git a/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnValueType_IsOfAnyTypeIn_Test.java b/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnValueType_IsOfAnyTypeIn_Test.java index 46f0e96d..c4a74714 100644 --- a/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnValueType_IsOfAnyTypeIn_Test.java +++ b/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnValueType_IsOfAnyTypeIn_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.Locale; @@ -21,7 +20,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.ValueType; import org.junit.Test; @@ -39,8 +37,7 @@ public class AssertionsOnValueType_IsOfAnyTypeIn_Test extends AbstractTest { @Test public void test_is_of_any_of_types() throws Exception { WritableAssertionInfo info = new WritableAssertionInfo(); - Table table = new Table(); - TableAssert tableAssert = assertThat(table); + TableAssert tableAssert = new TableAssert(null); TableAssert tableAssert2 = AssertionsOnValueType.isOfAnyTypeIn(tableAssert, info, getValue(null, "test"), ValueType.TEXT); Assertions.assertThat(tableAssert2).isSameAs(tableAssert); @@ -55,8 +52,7 @@ public void test_is_of_any_of_types() throws Exception { public void should_fail_because_value_is_not_of_any_of_types() throws Exception { WritableAssertionInfo info = new WritableAssertionInfo(); info.description("description"); - Table table = new Table(); - TableAssert tableAssert = assertThat(table); + TableAssert tableAssert = new TableAssert(null); try { AssertionsOnValueType.isOfAnyTypeIn(tableAssert, info, getValue(null, 8), ValueType.TEXT, ValueType.DATE); fail("An exception must be raised"); @@ -102,8 +98,7 @@ public void should_fail_because_value_is_not_of_any_of_types() throws Exception 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 { AssertionsOnValueType.isOfAnyTypeIn(tableAssert, info, getValue(null, new StringBuilder("text")), ValueType.TEXT, ValueType.DATE); fail("An exception must be raised"); diff --git a/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnValueType_IsOfType_Test.java b/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnValueType_IsOfType_Test.java index 7a91739a..b8ba4b9b 100644 --- a/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnValueType_IsOfType_Test.java +++ b/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnValueType_IsOfType_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.Locale; @@ -21,7 +20,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.ValueType; import org.junit.Test; @@ -39,8 +37,7 @@ public class AssertionsOnValueType_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); TableAssert tableAssert2 = AssertionsOnValueType.isOfType(tableAssert, info, getValue(null, "test"), ValueType.TEXT); Assertions.assertThat(tableAssert2).isSameAs(tableAssert); } @@ -52,8 +49,7 @@ public void test_is_of_type() throws Exception { public void should_fail_because_value_is_not_of_type() throws Exception { WritableAssertionInfo info = new WritableAssertionInfo(); info.description("description"); - Table table = new Table(); - TableAssert tableAssert = assertThat(table); + TableAssert tableAssert = new TableAssert(null); try { AssertionsOnValueType.isOfType(tableAssert, info, getValue(null, 8), ValueType.TEXT); fail("An exception must be raised"); @@ -99,8 +95,7 @@ public void should_fail_because_value_is_not_of_type() throws Exception { 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 { AssertionsOnValueType.isOfType(tableAssert, info, getValue(null, new StringBuilder("text")), ValueType.TEXT); fail("An exception must be raised"); diff --git a/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnValueType_IsText_Test.java b/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnValueType_IsText_Test.java index d3e0bcd6..f8d065b0 100644 --- a/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnValueType_IsText_Test.java +++ b/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnValueType_IsText_Test.java @@ -12,14 +12,12 @@ */ 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; import org.assertj.db.common.AbstractTest; -import org.assertj.db.type.Table; import org.junit.Test; /** @@ -36,8 +34,7 @@ public class AssertionsOnValueType_IsText_Test extends AbstractTest { @Test public void test_is_text() throws Exception { WritableAssertionInfo info = new WritableAssertionInfo(); - Table table = new Table(); - TableAssert tableAssert = assertThat(table); + TableAssert tableAssert = new TableAssert(null); TableAssert tableAssert2 = AssertionsOnValueType.isText(tableAssert, info, getValue(null, "test")); Assertions.assertThat(tableAssert2).isSameAs(tableAssert); } @@ -49,8 +46,7 @@ public void test_is_text() throws Exception { public void should_fail_because_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); try { AssertionsOnValueType.isText(tableAssert, info, getValue(null, true)); fail("An exception must be raised"); @@ -72,8 +68,7 @@ public void should_fail_because_value_is_not_a_text() throws Exception { 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 { AssertionsOnValueType.isText(tableAssert, info, getValue(null, new StringBuilder("text"))); fail("An exception must be raised"); diff --git a/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnValueType_IsTime_Test.java b/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnValueType_IsTime_Test.java index 51a0c512..196e19d0 100644 --- a/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnValueType_IsTime_Test.java +++ b/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnValueType_IsTime_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; @@ -21,7 +20,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.junit.Test; /** @@ -38,8 +36,7 @@ public class AssertionsOnValueType_IsTime_Test extends AbstractTest { @Test public void test_is_time() throws Exception { WritableAssertionInfo info = new WritableAssertionInfo(); - Table table = new Table(); - TableAssert tableAssert = assertThat(table); + TableAssert tableAssert = new TableAssert(null); TableAssert tableAssert2 = AssertionsOnValueType.isTime(tableAssert, info, getValue(null, Time.valueOf("09:01:00"))); Assertions.assertThat(tableAssert2).isSameAs(tableAssert); } @@ -51,8 +48,7 @@ public void test_is_time() throws Exception { public void should_fail_because_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); try { AssertionsOnValueType.isTime(tableAssert, info, getValue(null, "test")); fail("An exception must be raised"); @@ -74,8 +70,7 @@ public void should_fail_because_value_is_not_a_time() throws Exception { 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 { AssertionsOnValueType.isTime(tableAssert, info, getValue(null, new StringBuilder("text"))); fail("An exception must be raised"); diff --git a/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnValueType_IsUUID_Test.java b/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnValueType_IsUUID_Test.java index d4d925e3..630abe04 100644 --- a/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnValueType_IsUUID_Test.java +++ b/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnValueType_IsUUID_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.UUID; @@ -21,7 +20,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.junit.Test; /** @@ -38,8 +36,7 @@ public class AssertionsOnValueType_IsUUID_Test extends AbstractTest { @Test public void test_is_uuid() throws Exception { WritableAssertionInfo info = new WritableAssertionInfo(); - Table table = new Table(); - TableAssert tableAssert = assertThat(table); + TableAssert tableAssert = new TableAssert(null); TableAssert tableAssert2 = AssertionsOnValueType.isUUID(tableAssert, info, getValue(null, UUID .fromString("30B443AE-C0C9-4790-9BEC-CE1380808435"))); Assertions.assertThat(tableAssert2).isSameAs(tableAssert); @@ -52,8 +49,7 @@ public void test_is_uuid() throws Exception { public void should_fail_because_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); try { AssertionsOnValueType.isUUID(tableAssert, info, getValue(null, "test")); fail("An exception must be raised"); @@ -75,8 +71,7 @@ public void should_fail_because_value_is_not_a_time() throws Exception { 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 { AssertionsOnValueType.isUUID(tableAssert, info, getValue(null, new StringBuilder("text"))); fail("An exception must be raised"); diff --git a/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnValuesNullity_HasOnlyNotNullValues_Test.java b/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnValuesNullity_HasOnlyNotNullValues_Test.java index 1b257d90..12e4dac0 100644 --- a/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnValuesNullity_HasOnlyNotNullValues_Test.java +++ b/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnValuesNullity_HasOnlyNotNullValues_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 AssertionsOnValuesNullity_HasOnlyNotNullValues_Test extends Abstrac @Test public void test_has_only_not_null_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, "test"), getValue(null, 6))); TableAssert tableAssert2 = AssertionsOnValuesNullity.hasOnlyNotNullValues(tableAssert, info, list); Assertions.assertThat(tableAssert2).isSameAs(tableAssert); @@ -55,8 +52,7 @@ public void test_has_only_not_null_values() throws Exception { public void should_fail_because_column_contains_null_values() 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, null), getValue(null, "test"))); try { AssertionsOnValuesNullity.hasOnlyNotNullValues(tableAssert, info, list); diff --git a/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnValuesNullity_HasOnlyNullValues_Test.java b/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnValuesNullity_HasOnlyNullValues_Test.java index 0473ec13..f8757a98 100644 --- a/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnValuesNullity_HasOnlyNullValues_Test.java +++ b/src/test/java/org/assertj/db/api/assertions/impl/AssertionsOnValuesNullity_HasOnlyNullValues_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 AssertionsOnValuesNullity_HasOnlyNullValues_Test extends AbstractTe @Test public void test_has_only_null_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, null), getValue(null, null))); TableAssert tableAssert2 = AssertionsOnValuesNullity.hasOnlyNullValues(tableAssert, info, list); Assertions.assertThat(tableAssert2).isSameAs(tableAssert); @@ -55,8 +52,7 @@ public void test_has_only_null_values() throws Exception { public void should_fail_because_column_contains_not_null_values() 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, null), getValue(null, "test"))); try { AssertionsOnValuesNullity.hasOnlyNullValues(tableAssert, info, list); diff --git a/src/test/java/org/assertj/db/common/AbstractTest.java b/src/test/java/org/assertj/db/common/AbstractTest.java index 3290ca42..33d75960 100644 --- a/src/test/java/org/assertj/db/common/AbstractTest.java +++ b/src/test/java/org/assertj/db/common/AbstractTest.java @@ -33,12 +33,12 @@ import org.assertj.db.configuration.TestsConfiguration; import org.assertj.db.type.AbstractDbData; +import org.assertj.db.type.AssertDbConnection; +import org.assertj.db.type.AssertDbConnectionFactory; import org.assertj.db.type.Change; 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; @@ -131,12 +131,11 @@ 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 ConnectionProvider jdbcConnectionProvider = ConnectionProviderFactory.of("jdbc:h2:mem:test", "sa", "").create(); + protected final AssertDbConnection assertDbConnection = AssertDbConnectionFactory.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}. @@ -161,9 +160,9 @@ protected static Value getValue(String columnName, Object object) throws Excepti * @throws Exception Exception */ protected static Changes getChanges(List changesList) throws Exception { - Constructor constructor = Changes.class.getDeclaredConstructor(ConnectionProvider.class); + Constructor constructor = Changes.class.getDeclaredConstructor(); constructor.setAccessible(true); - Changes changes = constructor.newInstance((ConnectionProvider) null); + Changes changes = constructor.newInstance(); Field field = Changes.class.getDeclaredField("changesList"); field.setAccessible(true); field.set(changes, changesList); @@ -320,11 +319,6 @@ 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); @@ -352,7 +346,7 @@ public void determineIfReloadIsNeeded() throws NoSuchMethodException, SecurityEx * @param parameters The parameters of the request. */ protected void update(String request, Object... parameters) { - try (Connection connection = dsConnectionProvider.getConnection()) { + try (Connection connection = dataSource.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/DefaultConnectionProvider.java b/src/test/java/org/assertj/db/common/DefaultConnectionProvider.java new file mode 100644 index 00000000..c4ab74ce --- /dev/null +++ b/src/test/java/org/assertj/db/common/DefaultConnectionProvider.java @@ -0,0 +1,54 @@ +/* + * 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.common; + +import java.sql.Connection; +import java.sql.SQLException; + +import org.assertj.db.type.ConnectionProvider; +import org.assertj.db.type.SchemaMetadata; +import org.assertj.db.type.lettercase.LetterCase; + +public class DefaultConnectionProvider implements ConnectionProvider { + + private final Connection connection; + + public DefaultConnectionProvider(Connection connection) { + this.connection = connection; + } + + @Override + public LetterCase getTableLetterCase() { + return null; + } + + @Override + public LetterCase getPrimaryKeyLetterCase() { + return null; + } + + @Override + public LetterCase getColumnLetterCase() { + return null; + } + + @Override + public Connection getConnection() throws SQLException { + return this.connection; + } + + @Override + public SchemaMetadata getMetaData() { + return null; + } +} 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 13dbe121..c80a5681 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.ConnectionProvider; -import org.assertj.db.type.ConnectionProviderFactory; +import org.assertj.db.type.AssertDbConnection; +import org.assertj.db.type.AssertDbConnectionFactory; import org.assertj.db.type.lettercase.LetterCase; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.test.context.ContextConfiguration; @@ -78,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 ConnectionProvider jdbcConnectionDDD = ConnectionProviderFactory.of("jdbc:h2:mem:testH2", "sa", "").letterCase( + protected final AssertDbConnection jdbcConnectionDDD = AssertDbConnectionFactory.of("jdbc:h2:mem:testH2", "sa", "").letterCase( LetterCase.TABLE_DEFAULT, LetterCase.COLUMN_DEFAULT, LetterCase.PRIMARY_KEY_DEFAULT).create(); - protected final ConnectionProvider jdbcConnectionUIUIUI = ConnectionProviderFactory.of("jdbc:h2:mem:testH2", "sa", "").letterCase( + protected final AssertDbConnection jdbcConnectionUIUIUI = AssertDbConnectionFactory.of("jdbc:h2:mem:testH2", "sa", "").letterCase( letterCaseUI, letterCaseUI, letterCaseUI).create(); - protected final ConnectionProvider jdbcConnectionNSNSNS = ConnectionProviderFactory.of("jdbc:h2:mem:testH2", "sa", "").letterCase( + protected final AssertDbConnection jdbcConnectionNSNSNS = AssertDbConnectionFactory.of("jdbc:h2:mem:testH2", "sa", "").letterCase( letterCaseNS, letterCaseNS, letterCaseNS).create(); protected DataSource dataSource; - protected ConnectionProvider dsConnectionDDD; - protected ConnectionProvider dsConnectionUIUIUI; - protected ConnectionProvider dsConnectionNSNSNS; + protected AssertDbConnection dsConnectionDDD; + protected AssertDbConnection dsConnectionUIUIUI; + protected AssertDbConnection dsConnectionNSNSNS; protected DbSetup getDbSetup() { return DB_SETUP; @@ -106,9 +106,9 @@ protected DbSetupTracker getDbSetupTracker() { @Autowired protected void setDataSource(DataSource dataSource) { this.dataSource = dataSource; - 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(); + this.dsConnectionDDD = AssertDbConnectionFactory.of(dataSource).letterCase(LetterCase.TABLE_DEFAULT, LetterCase.COLUMN_DEFAULT, LetterCase.PRIMARY_KEY_DEFAULT).create(); + this.dsConnectionUIUIUI = AssertDbConnectionFactory.of(dataSource).letterCase(letterCaseUI, letterCaseUI, letterCaseUI).create(); + this.dsConnectionNSNSNS = AssertDbConnectionFactory.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 dee9034e..fa04824a 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.ConnectionProvider; -import org.assertj.db.type.ConnectionProviderFactory; +import org.assertj.db.type.AssertDbConnection; +import org.assertj.db.type.AssertDbConnectionFactory; import org.assertj.db.type.lettercase.LetterCase; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.test.context.ContextConfiguration; @@ -51,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 ConnectionProvider jdbcConnectionDDD = ConnectionProviderFactory.of("jdbc:h2:mem:testReservedH2", "sa", "").letterCase( + protected final AssertDbConnection jdbcConnectionDDD = AssertDbConnectionFactory.of("jdbc:h2:mem:testReservedH2", "sa", "").letterCase( LetterCase.TABLE_DEFAULT, LetterCase.COLUMN_DEFAULT, LetterCase.PRIMARY_KEY_DEFAULT).create(); - protected final ConnectionProvider jdbcConnectionUIUIUI = ConnectionProviderFactory.of("jdbc:h2:mem:testReservedH2", "sa", "").letterCase( + protected final AssertDbConnection jdbcConnectionUIUIUI = AssertDbConnectionFactory.of("jdbc:h2:mem:testReservedH2", "sa", "").letterCase( letterCaseUI, letterCaseUI, letterCaseUI).create(); - protected final ConnectionProvider jdbcConnectionNSNSNS = ConnectionProviderFactory.of("jdbc:h2:mem:testReservedH2", "sa", "").letterCase( + protected final AssertDbConnection jdbcConnectionNSNSNS = AssertDbConnectionFactory.of("jdbc:h2:mem:testReservedH2", "sa", "").letterCase( letterCaseNS, letterCaseNS, letterCaseNS).create(); protected DataSource dataSource; - protected ConnectionProvider dsConnectionDDD; - protected ConnectionProvider dsConnectionUIUIUI; - protected ConnectionProvider dsConnectionNSNSNS; + protected AssertDbConnection dsConnectionDDD; + protected AssertDbConnection dsConnectionUIUIUI; + protected AssertDbConnection dsConnectionNSNSNS; protected DbSetup getDbSetup() { return DB_SETUP; @@ -79,9 +79,9 @@ protected DbSetupTracker getDbSetupTracker() { @Autowired protected void setDataSource(DataSource dataSource) { this.dataSource = dataSource; - 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(); + this.dsConnectionDDD = AssertDbConnectionFactory.of(dataSource).letterCase(LetterCase.TABLE_DEFAULT, LetterCase.COLUMN_DEFAULT, LetterCase.PRIMARY_KEY_DEFAULT).create(); + this.dsConnectionUIUIUI = AssertDbConnectionFactory.of(dataSource).letterCase(letterCaseUI, letterCaseUI, letterCaseUI).create(); + this.dsConnectionNSNSNS = AssertDbConnectionFactory.of(dataSource).letterCase(letterCaseNS, letterCaseNS, letterCaseNS).create(); } protected void update() { diff --git a/src/test/java/org/assertj/db/database/h2/H2DataBase_JdbcUrl_DDD_Test.java b/src/test/java/org/assertj/db/database/h2/H2DataBase_JdbcUrl_DDD_Test.java index 5946663a..9abb2ef6 100644 --- a/src/test/java/org/assertj/db/database/h2/H2DataBase_JdbcUrl_DDD_Test.java +++ b/src/test/java/org/assertj/db/database/h2/H2DataBase_JdbcUrl_DDD_Test.java @@ -27,10 +27,10 @@ import org.assertj.core.api.Assertions; import org.assertj.db.common.NeedReload; import org.assertj.db.output.Outputs; +import org.assertj.db.type.AssertDbConnection; 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; @@ -51,18 +51,18 @@ */ public class H2DataBase_JdbcUrl_DDD_Test extends AbstractH2Test { - private ConnectionProvider connectionProvider; + private AssertDbConnection connection; @Before public void init() { - connectionProvider = jdbcConnectionDDD; + connection = jdbcConnectionDDD; } @Test @NeedReload public void test_Outputs_output() { - Table table = new Table(connectionProvider, "test"); - Changes changes = new Changes(table).setStartPointNow(); + Table table = connection.table("test").build(); + Changes changes = connection.changes().tables(table).build().setStartPointNow(); update(); changes.setEndPointNow(); @@ -90,7 +90,7 @@ public void test_Outputs_output() { .column().toStream(byteArrayOutputStream9) .valueAtEndPoint().toStream(byteArrayOutputStream10); - Assertions.assertThat(byteArrayOutputStream0.toString()).isEqualTo(String.format("[TEST table]%n" + Assertions.assertThat(byteArrayOutputStream0).hasToString(String.format("[TEST table]%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" @@ -99,21 +99,21 @@ public void test_Outputs_output() { + "|-----------|---------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|--------------------|------------|-------------------------------|-------------------------------|-------------------------------|------------|------------|------------|------------|------------|-------------------------------------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|--------------------------------------|------------------|------------------|%n" + "| Index : 0 | 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(byteArrayOutputStream1.toString()).isEqualTo(String.format("[Column at index 0 (column name : VAR1) of TEST table]%n" + Assertions.assertThat(byteArrayOutputStream1).hasToString(String.format("[Column at index 0 (column name : VAR1) of TEST table]%n" + "|-----------|----------|%n" + "| | VAR1 |%n" + "| | (NUMBER) |%n" + "|-----------|----------|%n" + "| Index : 0 | 1 |%n" + "|-----------|----------|%n")); - Assertions.assertThat(byteArrayOutputStream2.toString()).isEqualTo(String.format("[Value at index 0 of Column at index 0 (column name : VAR1) of TEST table]%n" + Assertions.assertThat(byteArrayOutputStream2).hasToString(String.format("[Value at index 0 of Column at index 0 (column name : VAR1) of TEST table]%n" + "|----------|%n" + "| VAR1 |%n" + "| (NUMBER) |%n" + "|----------|%n" + "| 1 |%n" + "|----------|%n")); - Assertions.assertThat(byteArrayOutputStream3.toString()).isEqualTo(String.format("[Row at index 0 of TEST table]%n" + Assertions.assertThat(byteArrayOutputStream3).hasToString(String.format("[Row at index 0 of TEST table]%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" @@ -122,14 +122,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(byteArrayOutputStream4.toString()).isEqualTo(String.format("[Value at index 0 (column name : VAR1) of Row at index 0 of TEST table]%n" + Assertions.assertThat(byteArrayOutputStream4).hasToString(String.format("[Value at index 0 (column name : VAR1) of Row at index 0 of TEST table]%n" + "|----------|%n" + "| VAR1 |%n" + "| (NUMBER) |%n" + "|----------|%n" + "| 1 |%n" + "|----------|%n")); - Assertions.assertThat(byteArrayOutputStream5.toString()).isEqualTo(String.format("[Changes on TEST table of 'sa/jdbc:h2:mem:testH2']%n" + Assertions.assertThat(byteArrayOutputStream5).hasToString(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']%n" + Assertions.assertThat(byteArrayOutputStream6).hasToString(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']%n" + Assertions.assertThat(byteArrayOutputStream7).hasToString(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']%n" + Assertions.assertThat(byteArrayOutputStream8).hasToString(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']%n" + Assertions.assertThat(byteArrayOutputStream9).hasToString(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']%n" + Assertions.assertThat(byteArrayOutputStream10).hasToString(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,8 +188,8 @@ public void test_Outputs_output() { @Test @NeedReload public void test_PrimaryKey_hasPksNames() { - Table table = new Table(connectionProvider, "test"); - Changes changes = new Changes(table).setStartPointNow(); + Table table = connection.table("test").build(); + Changes changes = connection.changes().tables(table).build().setStartPointNow(); update(); changes.setEndPointNow(); @@ -200,8 +200,8 @@ public void test_PrimaryKey_hasPksNames() { @Test @NeedReload public void test_ColumnName_hasColumnName() { - Table table = new Table(connectionProvider, "test"); - Changes changes = new Changes(table).setStartPointNow(); + Table table = connection.table("test").build(); + Changes changes = connection.changes().tables(table).build().setStartPointNow(); update(); changes.setEndPointNow(); @@ -337,8 +337,8 @@ public void test_ColumnName_hasColumnName() { @Test @NeedReload public void test_ColumnClass_isOfClass() { - Table table = new Table(connectionProvider, "test"); - Changes changes = new Changes(table).setStartPointNow(); + Table table = connection.table("test").build(); + Changes changes = connection.changes().tables(table).build().setStartPointNow(); update(); changes.setEndPointNow(); @@ -474,8 +474,8 @@ public void test_ColumnClass_isOfClass() { @Test @NeedReload public void test_ColumnEquality_hasValues() { - Table table = new Table(connectionProvider, "test"); - Changes changes = new Changes(table).setStartPointNow(); + Table table = connection.table("test").build(); + Changes changes = connection.changes().tables(table).build().setStartPointNow(); update(); changes.setEndPointNow(); @@ -610,8 +610,8 @@ public void test_ColumnEquality_hasValues() { @Test @NeedReload public void test_ColumnEquality_containsValues() { - Table table = new Table(connectionProvider, "test"); - Changes changes = new Changes(table).setStartPointNow(); + Table table = connection.table("test").build(); + Changes changes = connection.changes().tables(table).build().setStartPointNow(); update(); changes.setEndPointNow(); @@ -682,8 +682,8 @@ public void test_ColumnEquality_containsValues() { @Test @NeedReload public void test_ColumnType_isOfType() { - Table table = new Table(connectionProvider, "test"); - Changes changes = new Changes(table).setStartPointNow(); + Table table = connection.table("test").build(); + Changes changes = connection.changes().tables(table).build().setStartPointNow(); update(); changes.setEndPointNow(); @@ -818,8 +818,8 @@ public void test_ColumnType_isOfType() { @Test @NeedReload public void test_ColumnOfChangeEquality_hasValues() { - Table table = new Table(connectionProvider, "test"); - Changes changes = new Changes(table).setStartPointNow(); + Table table = connection.table("test").build(); + Changes changes = connection.changes().tables(table).build().setStartPointNow(); update(); changes.setEndPointNow(); @@ -970,8 +970,8 @@ public void test_ColumnOfChangeEquality_hasValues() { @Test @NeedReload public void test_RowEquality_hasValues() { - Table table = new Table(connectionProvider, "test"); - Changes changes = new Changes(table).setStartPointNow(); + Table table = connection.table("test").build(); + Changes changes = connection.changes().tables(table).build().setStartPointNow(); update(); changes.setEndPointNow(); @@ -1107,8 +1107,8 @@ public void test_RowEquality_hasValues() { @Test @NeedReload public void test_ValueClass_isOfClass() { - Table table = new Table(connectionProvider, "test"); - Changes changes = new Changes(table).setStartPointNow(); + Table table = connection.table("test").build(); + Changes changes = connection.changes().tables(table).build().setStartPointNow(); update(); changes.setEndPointNow(); @@ -1244,8 +1244,8 @@ public void test_ValueClass_isOfClass() { @Test @NeedReload public void test_ValueEquality_isEqualTo() { - Table table = new Table(connectionProvider, "test"); - Changes changes = new Changes(table).setStartPointNow(); + Table table = connection.table("test").build(); + Changes changes = connection.changes().tables(table).build().setStartPointNow(); update(); changes.setEndPointNow(); @@ -1381,8 +1381,8 @@ public void test_ValueEquality_isEqualTo() { @Test @NeedReload public void test_ValueNonEquality_isNotEqualTo() { - Table table = new Table(connectionProvider, "test"); - Changes changes = new Changes(table).setStartPointNow(); + Table table = connection.table("test").build(); + Changes changes = connection.changes().tables(table).build().setStartPointNow(); update(); changes.setEndPointNow(); @@ -1518,8 +1518,8 @@ public void test_ValueNonEquality_isNotEqualTo() { @Test @NeedReload public void test_ValueType_isOfType() { - Table table = new Table(connectionProvider, "test"); - Changes changes = new Changes(table).setStartPointNow(); + Table table = connection.table("test").build(); + Changes changes = connection.changes().tables(table).build().setStartPointNow(); update(); changes.setEndPointNow(); @@ -1655,18 +1655,16 @@ public void test_ValueType_isOfType() { @Test @NeedReload public void test_getTableLetterCase() { - Table table = new Table(connectionProvider, "test"); + Table table = connection.table("test").build(); - Request request = new Request(connectionProvider, "select * from test"); + Request request = connection.request("select * from test").build(); - Changes changes = new Changes(table).setStartPointNow(); + Changes changes = connection.changes().tables(table).build().setStartPointNow(); update(); changes.setEndPointNow(); Change change = changes.getChangesList().get(0); - Assertions.assertThat(connectionProvider.getTableLetterCase().getConversionName()).isSameAs(LetterCase.TABLE_DEFAULT.getConversionName()); - Assertions.assertThat(table.getTableLetterCase().getConversionName()).isSameAs(LetterCase.TABLE_DEFAULT.getConversionName()); Assertions.assertThat(request.getTableLetterCase().getConversionName()).isSameAs(LetterCase.TABLE_DEFAULT.getConversionName()); @@ -1674,9 +1672,6 @@ public void test_getTableLetterCase() { Assertions.assertThat(changes.getTableLetterCase().getConversionName()).isSameAs(LetterCase.TABLE_DEFAULT.getConversionName()); Assertions.assertThat(change.getTableLetterCase().getConversionName()).isSameAs(LetterCase.TABLE_DEFAULT.getConversionName()); - - Assertions.assertThat(connectionProvider.getTableLetterCase().getComparisonName()).isSameAs(LetterCase.TABLE_DEFAULT.getComparisonName()); - Assertions.assertThat(table.getTableLetterCase().getComparisonName()).isSameAs(LetterCase.TABLE_DEFAULT.getComparisonName()); Assertions.assertThat(request.getTableLetterCase().getComparisonName()).isSameAs(LetterCase.TABLE_DEFAULT.getComparisonName()); @@ -1688,19 +1683,19 @@ public void test_getTableLetterCase() { @Test @NeedReload public void test_getColumnLetterCase() { - Table table = new Table(connectionProvider, "test"); + Table table = connection.table("test").build(); Row tableRow = table.getRow(0); Column tableColumn = table.getColumn(0); Value tableRowValue = tableRow.getColumnValue(0); Value tableColumnValue = tableColumn.getRowValue(0); - Request request = new Request(connectionProvider, "select * from test"); + Request request = connection.request("select * from test").build(); Row requestRow = request.getRow(0); Column requestColumn = request.getColumn(0); Value requestRowValue = requestRow.getColumnValue(0); Value requestColumnValue = requestColumn.getRowValue(0); - Changes changes = new Changes(table).setStartPointNow(); + Changes changes = connection.changes().tables(table).build().setStartPointNow(); update(); changes.setEndPointNow(); Change change = changes.getChangesList().get(0); @@ -1709,9 +1704,6 @@ public void test_getColumnLetterCase() { Value valueAtStartPoint = rowAtStartPoint.getColumnValue(0); Value valueAtEndPoint = rowAtEndPoint.getColumnValue(0); - - 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()); Assertions.assertThat(tableColumn.getColumnLetterCase().getConversionName()).isSameAs(LetterCase.COLUMN_DEFAULT.getConversionName()); @@ -1731,9 +1723,6 @@ public void test_getColumnLetterCase() { Assertions.assertThat(valueAtStartPoint.getColumnLetterCase().getConversionName()).isSameAs(LetterCase.COLUMN_DEFAULT.getConversionName()); Assertions.assertThat(valueAtEndPoint.getColumnLetterCase().getConversionName()).isSameAs(LetterCase.COLUMN_DEFAULT.getConversionName()); - - 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()); Assertions.assertThat(tableColumn.getColumnLetterCase().getComparisonName()).isSameAs(LetterCase.COLUMN_DEFAULT.getComparisonName()); @@ -1757,13 +1746,13 @@ public void test_getColumnLetterCase() { @Test @NeedReload public void test_getPrimaryKeyLetterCase() { - Table table = new Table(connectionProvider, "test"); + Table table = connection.table("test").build(); Row tableRow = table.getRow(0); - Request request = new Request(connectionProvider, "select * from test"); + Request request = connection.request("select * from test").build(); Row requestRow = request.getRow(0); - Changes changes = new Changes(table).setStartPointNow(); + Changes changes = connection.changes().tables(table).build().setStartPointNow(); update(); changes.setEndPointNow(); Change change = changes.getChangesList().get(0); @@ -1771,8 +1760,6 @@ public void test_getPrimaryKeyLetterCase() { Row rowAtEndPoint = change.getRowAtEndPoint(); - 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()); @@ -1785,8 +1772,6 @@ public void test_getPrimaryKeyLetterCase() { Assertions.assertThat(rowAtEndPoint.getPrimaryKeyLetterCase().getConversionName()).isSameAs(LetterCase.PRIMARY_KEY_DEFAULT.getConversionName()); - 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_DDD_Test.java b/src/test/java/org/assertj/db/database/h2/H2Database_DataSource_DDD_Test.java index 11be7e6e..75e6f29f 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 @@ -27,10 +27,10 @@ import org.assertj.core.api.Assertions; import org.assertj.db.common.NeedReload; import org.assertj.db.output.Outputs; +import org.assertj.db.type.AssertDbConnection; 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; @@ -51,18 +51,18 @@ */ public class H2Database_DataSource_DDD_Test extends AbstractH2Test { - private ConnectionProvider connectionProvider; + private AssertDbConnection connection; @Before public void init() { - connectionProvider = dsConnectionDDD; + connection = dsConnectionDDD; } @Test @NeedReload public void test_Outputs_output() { - Table table = new Table(connectionProvider, "test"); - Changes changes = new Changes(table).setStartPointNow(); + Table table = connection.table("test").build(); + Changes changes = connection.changes().tables(table).build().setStartPointNow(); update(); changes.setEndPointNow(); @@ -90,7 +90,7 @@ public void test_Outputs_output() { .column().toStream(byteArrayOutputStream9) .valueAtEndPoint().toStream(byteArrayOutputStream10); - Assertions.assertThat(byteArrayOutputStream0.toString()).isEqualTo(String.format("[TEST table]%n" + Assertions.assertThat(byteArrayOutputStream0).hasToString(String.format("[TEST table]%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" @@ -99,21 +99,21 @@ public void test_Outputs_output() { + "|-----------|---------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|--------------------|------------|-------------------------------|-------------------------------|-------------------------------|------------|------------|------------|------------|------------|-------------------------------------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|--------------------------------------|------------------|------------------|%n" + "| Index : 0 | 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(byteArrayOutputStream1.toString()).isEqualTo(String.format("[Column at index 0 (column name : VAR1) of TEST table]%n" + Assertions.assertThat(byteArrayOutputStream1).hasToString(String.format("[Column at index 0 (column name : VAR1) of TEST table]%n" + "|-----------|----------|%n" + "| | VAR1 |%n" + "| | (NUMBER) |%n" + "|-----------|----------|%n" + "| Index : 0 | 1 |%n" + "|-----------|----------|%n")); - Assertions.assertThat(byteArrayOutputStream2.toString()).isEqualTo(String.format("[Value at index 0 of Column at index 0 (column name : VAR1) of TEST table]%n" + Assertions.assertThat(byteArrayOutputStream2).hasToString(String.format("[Value at index 0 of Column at index 0 (column name : VAR1) of TEST table]%n" + "|----------|%n" + "| VAR1 |%n" + "| (NUMBER) |%n" + "|----------|%n" + "| 1 |%n" + "|----------|%n")); - Assertions.assertThat(byteArrayOutputStream3.toString()).isEqualTo(String.format("[Row at index 0 of TEST table]%n" + Assertions.assertThat(byteArrayOutputStream3).hasToString(String.format("[Row at index 0 of TEST table]%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" @@ -122,14 +122,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(byteArrayOutputStream4.toString()).isEqualTo(String.format("[Value at index 0 (column name : VAR1) of Row at index 0 of TEST table]%n" + Assertions.assertThat(byteArrayOutputStream4).hasToString(String.format("[Value at index 0 (column name : VAR1) of Row at index 0 of TEST table]%n" + "|----------|%n" + "| VAR1 |%n" + "| (NUMBER) |%n" + "|----------|%n" + "| 1 |%n" + "|----------|%n")); - Assertions.assertThat(byteArrayOutputStream5.toString()).isEqualTo(String.format("[Changes on TEST table of 'data source']%n" + Assertions.assertThat(byteArrayOutputStream5).hasToString(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 'data source']%n" + Assertions.assertThat(byteArrayOutputStream6).hasToString(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 'data source']%n" + Assertions.assertThat(byteArrayOutputStream7).hasToString(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 'data source']%n" + Assertions.assertThat(byteArrayOutputStream8).hasToString(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 'data source']%n" + Assertions.assertThat(byteArrayOutputStream9).hasToString(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 'data source']%n" + Assertions.assertThat(byteArrayOutputStream10).hasToString(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,8 +188,8 @@ public void test_Outputs_output() { @Test @NeedReload public void test_PrimaryKey_hasPksNames() { - Table table = new Table(connectionProvider, "test"); - Changes changes = new Changes(table).setStartPointNow(); + Table table = connection.table("test").build(); + Changes changes = connection.changes().tables(table).build().setStartPointNow(); update(); changes.setEndPointNow(); @@ -200,8 +200,8 @@ public void test_PrimaryKey_hasPksNames() { @Test @NeedReload public void test_ColumnName_hasColumnName() { - Table table = new Table(connectionProvider, "test"); - Changes changes = new Changes(table).setStartPointNow(); + Table table = connection.table("test").build(); + Changes changes = connection.changes().tables(table).build().setStartPointNow(); update(); changes.setEndPointNow(); @@ -337,8 +337,8 @@ public void test_ColumnName_hasColumnName() { @Test @NeedReload public void test_ColumnClass_isOfClass() { - Table table = new Table(connectionProvider, "test"); - Changes changes = new Changes(table).setStartPointNow(); + Table table = connection.table("test").build(); + Changes changes = connection.changes().tables(table).build().setStartPointNow(); update(); changes.setEndPointNow(); @@ -474,8 +474,8 @@ public void test_ColumnClass_isOfClass() { @Test @NeedReload public void test_ColumnEquality_hasValues() { - Table table = new Table(connectionProvider, "test"); - Changes changes = new Changes(table).setStartPointNow(); + Table table = connection.table("test").build(); + Changes changes = connection.changes().tables(table).build().setStartPointNow(); update(); changes.setEndPointNow(); @@ -610,8 +610,8 @@ public void test_ColumnEquality_hasValues() { @Test @NeedReload public void test_ColumnEquality_containsValues() { - Table table = new Table(connectionProvider, "test"); - Changes changes = new Changes(table).setStartPointNow(); + Table table = connection.table("test").build(); + Changes changes = connection.changes().tables(table).build().setStartPointNow(); update(); changes.setEndPointNow(); @@ -682,8 +682,8 @@ public void test_ColumnEquality_containsValues() { @Test @NeedReload public void test_ColumnType_isOfType() { - Table table = new Table(connectionProvider, "test"); - Changes changes = new Changes(table).setStartPointNow(); + Table table = connection.table("test").build(); + Changes changes = connection.changes().tables(table).build().setStartPointNow(); update(); changes.setEndPointNow(); @@ -818,8 +818,8 @@ public void test_ColumnType_isOfType() { @Test @NeedReload public void test_ColumnOfChangeEquality_hasValues() { - Table table = new Table(connectionProvider, "test"); - Changes changes = new Changes(table).setStartPointNow(); + Table table = connection.table("test").build(); + Changes changes = connection.changes().tables(table).build().setStartPointNow(); update(); changes.setEndPointNow(); @@ -970,8 +970,8 @@ public void test_ColumnOfChangeEquality_hasValues() { @Test @NeedReload public void test_RowEquality_hasValues() { - Table table = new Table(connectionProvider, "test"); - Changes changes = new Changes(table).setStartPointNow(); + Table table = connection.table("test").build(); + Changes changes = connection.changes().tables(table).build().setStartPointNow(); update(); changes.setEndPointNow(); @@ -1107,8 +1107,8 @@ public void test_RowEquality_hasValues() { @Test @NeedReload public void test_ValueClass_isOfClass() { - Table table = new Table(connectionProvider, "test"); - Changes changes = new Changes(table).setStartPointNow(); + Table table = connection.table("test").build(); + Changes changes = connection.changes().tables(table).build().setStartPointNow(); update(); changes.setEndPointNow(); @@ -1244,8 +1244,8 @@ public void test_ValueClass_isOfClass() { @Test @NeedReload public void test_ValueEquality_isEqualTo() { - Table table = new Table(connectionProvider, "test"); - Changes changes = new Changes(table).setStartPointNow(); + Table table = connection.table("test").build(); + Changes changes = connection.changes().tables(table).build().setStartPointNow(); update(); changes.setEndPointNow(); @@ -1381,8 +1381,8 @@ public void test_ValueEquality_isEqualTo() { @Test @NeedReload public void test_ValueNonEquality_isNotEqualTo() { - Table table = new Table(connectionProvider, "test"); - Changes changes = new Changes(table).setStartPointNow(); + Table table = connection.table("test").build(); + Changes changes = connection.changes().tables(table).build().setStartPointNow(); update(); changes.setEndPointNow(); @@ -1518,8 +1518,8 @@ public void test_ValueNonEquality_isNotEqualTo() { @Test @NeedReload public void test_ValueType_isOfType() { - Table table = new Table(connectionProvider, "test"); - Changes changes = new Changes(table).setStartPointNow(); + Table table = connection.table("test").build(); + Changes changes = connection.changes().tables(table).build().setStartPointNow(); update(); changes.setEndPointNow(); @@ -1655,18 +1655,16 @@ public void test_ValueType_isOfType() { @Test @NeedReload public void test_getTableLetterCase() { - Table table = new Table(connectionProvider, "test"); + Table table = connection.table("test").build(); - Request request = new Request(connectionProvider, "select * from test"); + Request request = connection.request("select * from test").build(); - Changes changes = new Changes(table).setStartPointNow(); + Changes changes = connection.changes().tables(table).build().setStartPointNow(); update(); changes.setEndPointNow(); Change change = changes.getChangesList().get(0); - Assertions.assertThat(connectionProvider.getTableLetterCase().getConversionName()).isSameAs(LetterCase.TABLE_DEFAULT.getConversionName()); - Assertions.assertThat(table.getTableLetterCase().getConversionName()).isSameAs(LetterCase.TABLE_DEFAULT.getConversionName()); Assertions.assertThat(request.getTableLetterCase().getConversionName()).isSameAs(LetterCase.TABLE_DEFAULT.getConversionName()); @@ -1674,9 +1672,6 @@ public void test_getTableLetterCase() { Assertions.assertThat(changes.getTableLetterCase().getConversionName()).isSameAs(LetterCase.TABLE_DEFAULT.getConversionName()); Assertions.assertThat(change.getTableLetterCase().getConversionName()).isSameAs(LetterCase.TABLE_DEFAULT.getConversionName()); - - Assertions.assertThat(connectionProvider.getTableLetterCase().getComparisonName()).isSameAs(LetterCase.TABLE_DEFAULT.getComparisonName()); - Assertions.assertThat(table.getTableLetterCase().getComparisonName()).isSameAs(LetterCase.TABLE_DEFAULT.getComparisonName()); Assertions.assertThat(request.getTableLetterCase().getComparisonName()).isSameAs(LetterCase.TABLE_DEFAULT.getComparisonName()); @@ -1688,19 +1683,19 @@ public void test_getTableLetterCase() { @Test @NeedReload public void test_getColumnLetterCase() { - Table table = new Table(connectionProvider, "test"); + Table table = connection.table("test").build(); Row tableRow = table.getRow(0); Column tableColumn = table.getColumn(0); Value tableRowValue = tableRow.getColumnValue(0); Value tableColumnValue = tableColumn.getRowValue(0); - Request request = new Request(connectionProvider, "select * from test"); + Request request = connection.request("select * from test").build(); Row requestRow = request.getRow(0); Column requestColumn = request.getColumn(0); Value requestRowValue = requestRow.getColumnValue(0); Value requestColumnValue = requestColumn.getRowValue(0); - Changes changes = new Changes(table).setStartPointNow(); + Changes changes = connection.changes().tables(table).build().setStartPointNow(); update(); changes.setEndPointNow(); Change change = changes.getChangesList().get(0); @@ -1709,9 +1704,6 @@ public void test_getColumnLetterCase() { Value valueAtStartPoint = rowAtStartPoint.getColumnValue(0); Value valueAtEndPoint = rowAtEndPoint.getColumnValue(0); - - 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()); Assertions.assertThat(tableColumn.getColumnLetterCase().getConversionName()).isSameAs(LetterCase.COLUMN_DEFAULT.getConversionName()); @@ -1731,9 +1723,6 @@ public void test_getColumnLetterCase() { Assertions.assertThat(valueAtStartPoint.getColumnLetterCase().getConversionName()).isSameAs(LetterCase.COLUMN_DEFAULT.getConversionName()); Assertions.assertThat(valueAtEndPoint.getColumnLetterCase().getConversionName()).isSameAs(LetterCase.COLUMN_DEFAULT.getConversionName()); - - 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()); Assertions.assertThat(tableColumn.getColumnLetterCase().getComparisonName()).isSameAs(LetterCase.COLUMN_DEFAULT.getComparisonName()); @@ -1757,22 +1746,19 @@ public void test_getColumnLetterCase() { @Test @NeedReload public void test_getPrimaryKeyLetterCase() { - Table table = new Table(connectionProvider, "test"); + Table table = connection.table("test").build(); Row tableRow = table.getRow(0); - Request request = new Request(connectionProvider, "select * from test"); + Request request = connection.request("select * from test").build(); Row requestRow = request.getRow(0); - Changes changes = new Changes(table).setStartPointNow(); + Changes changes = connection.changes().tables(table).build().setStartPointNow(); update(); changes.setEndPointNow(); Change change = changes.getChangesList().get(0); Row rowAtStartPoint = change.getRowAtStartPoint(); Row rowAtEndPoint = change.getRowAtEndPoint(); - - 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()); @@ -1784,9 +1770,6 @@ public void test_getPrimaryKeyLetterCase() { Assertions.assertThat(rowAtStartPoint.getPrimaryKeyLetterCase().getConversionName()).isSameAs(LetterCase.PRIMARY_KEY_DEFAULT.getConversionName()); Assertions.assertThat(rowAtEndPoint.getPrimaryKeyLetterCase().getConversionName()).isSameAs(LetterCase.PRIMARY_KEY_DEFAULT.getConversionName()); - - 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 bb20827f..a438d2d1 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 @@ -22,11 +22,11 @@ import org.assertj.db.common.NeedReload; import org.assertj.db.exception.AssertJDBException; import org.assertj.db.output.Outputs; +import org.assertj.db.type.AssertDbConnection; import org.assertj.db.type.Change; 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.Table; @@ -44,20 +44,20 @@ */ public class H2Database_DataSource_NSNSNS_Test extends AbstractH2Test { - private ConnectionProvider connectionProvider; + private AssertDbConnection connection; @Before public void init() { - connectionProvider = dsConnectionNSNSNS; + connection = dsConnectionNSNSNS; } @Test @NeedReload public void test_Outputs_output() { - Table table = new Table(connectionProvider, "test"); - Changes changes = new Changes(table).setStartPointNow(); - Changes changes2 = new Changes(connectionProvider).setStartPointNow(); + Table table = connection.table("test").build(); + Changes changes = connection.changes().tables(table).build().setStartPointNow(); + Changes changes2 = connection.changes().build().setStartPointNow(); update(); changes.setEndPointNow(); changes2.setEndPointNow(); @@ -259,9 +259,9 @@ public void test_Outputs_output() { @Test @NeedReload public void should_fail_because_primary_key_is_different() { - Table table = new Table(connectionProvider, "test"); - Changes changes = new Changes(table).setStartPointNow(); - Changes changes2 = new Changes(connectionProvider).setStartPointNow(); + Table table = connection.table("test").build(); + Changes changes = connection.changes().tables(table).build().setStartPointNow(); + Changes changes2 = connection.changes().build().setStartPointNow(); update(); changes.setEndPointNow(); changes2.setEndPointNow(); @@ -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(connectionProvider, "test"); - Changes changes = new Changes(table).setStartPointNow(); - Changes changes2 = new Changes(connectionProvider).setStartPointNow(); + Table table = connection.table("test").build(); + Changes changes = connection.changes().tables(table).build().setStartPointNow(); + Changes changes2 = connection.changes().build().setStartPointNow(); update(); changes.setEndPointNow(); changes2.setEndPointNow(); @@ -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(connectionProvider, "test"); - Changes changes = new Changes(table).setStartPointNow(); - Changes changes2 = new Changes(connectionProvider).setStartPointNow(); + Table table = connection.table("test").build(); + Changes changes = connection.changes().tables(table).build().setStartPointNow(); + Changes changes2 = connection.changes().build().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(connectionProvider, "test"); - Changes changes = new Changes(table).setStartPointNow(); - Changes changes2 = new Changes(connectionProvider).setStartPointNow(); + Table table = connection.table("test").build(); + Changes changes = connection.changes().tables(table).build().setStartPointNow(); + Changes changes2 = connection.changes().build().setStartPointNow(); update(); changes.setEndPointNow(); changes2.setEndPointNow(); @@ -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(connectionProvider, "test"); - Changes changes = new Changes(table).setStartPointNow(); - Changes changes2 = new Changes(connectionProvider).setStartPointNow(); + Table table = connection.table("test").build(); + Changes changes = connection.changes().tables(table).build().setStartPointNow(); + Changes changes2 = connection.changes().build().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(connectionProvider, "test"); - Changes changes = new Changes(table).setStartPointNow(); - Changes changes2 = new Changes(connectionProvider).setStartPointNow(); + Table table = connection.table("test").build(); + Changes changes = connection.changes().tables(table).build().setStartPointNow(); + Changes changes2 = connection.changes().build().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(connectionProvider, "test"); - Changes changes = new Changes(table).setStartPointNow(); - Changes changes2 = new Changes(connectionProvider).setStartPointNow(); + Table table = connection.table("test").build(); + Changes changes = connection.changes().tables(table).build().setStartPointNow(); + Changes changes2 = connection.changes().build().setStartPointNow(); update(); changes.setEndPointNow(); changes2.setEndPointNow(); @@ -541,18 +541,16 @@ public void test_ColumnClass_isOfClass() { @Test @NeedReload public void test_getTableLetterCase() { - Table table = new Table(connectionProvider, "test"); + Table table = connection.table("test").build(); - Request request = new Request(connectionProvider, "select * from test"); + Request request = connection.request("select * from test").build(); - Changes changes = new Changes(table).setStartPointNow(); + Changes changes = connection.changes().tables(table).build().setStartPointNow(); update(); changes.setEndPointNow(); Change change = changes.getChangesList().get(0); - Assertions.assertThat(connectionProvider.getTableLetterCase().getConversionName()).isSameAs(CaseConversions.NO.getConversionName()); - Assertions.assertThat(table.getTableLetterCase().getConversionName()).isSameAs(CaseConversions.NO.getConversionName()); Assertions.assertThat(request.getTableLetterCase().getConversionName()).isSameAs(CaseConversions.NO.getConversionName()); @@ -561,8 +559,6 @@ public void test_getTableLetterCase() { Assertions.assertThat(change.getTableLetterCase().getConversionName()).isSameAs(CaseConversions.NO.getConversionName()); - Assertions.assertThat(connectionProvider.getTableLetterCase().getComparisonName()).isSameAs(CaseComparisons.STRICT.getComparisonName()); - Assertions.assertThat(table.getTableLetterCase().getComparisonName()).isSameAs(CaseComparisons.STRICT.getComparisonName()); Assertions.assertThat(request.getTableLetterCase().getComparisonName()).isSameAs(CaseComparisons.STRICT.getComparisonName()); @@ -574,19 +570,19 @@ public void test_getTableLetterCase() { @Test @NeedReload public void test_getColumnLetterCase() { - Table table = new Table(connectionProvider, "test"); + Table table = connection.table("test").build(); Row tableRow = table.getRow(0); Column tableColumn = table.getColumn(0); Value tableRowValue = tableRow.getColumnValue(0); Value tableColumnValue = tableColumn.getRowValue(0); - Request request = new Request(connectionProvider, "select * from test"); + Request request = connection.request("select * from test").build(); Row requestRow = request.getRow(0); Column requestColumn = request.getColumn(0); Value requestRowValue = requestRow.getColumnValue(0); Value requestColumnValue = requestColumn.getRowValue(0); - Changes changes = new Changes(table).setStartPointNow(); + Changes changes = connection.changes().tables(table).build().setStartPointNow(); update(); changes.setEndPointNow(); Change change = changes.getChangesList().get(0); @@ -595,9 +591,6 @@ public void test_getColumnLetterCase() { Value valueAtStartPoint = rowAtStartPoint.getColumnValue(0); Value valueAtEndPoint = rowAtEndPoint.getColumnValue(0); - - 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()); Assertions.assertThat(tableColumn.getColumnLetterCase().getConversionName()).isSameAs(CaseConversions.NO.getConversionName()); @@ -617,9 +610,6 @@ public void test_getColumnLetterCase() { Assertions.assertThat(valueAtStartPoint.getColumnLetterCase().getConversionName()).isSameAs(CaseConversions.NO.getConversionName()); Assertions.assertThat(valueAtEndPoint.getColumnLetterCase().getConversionName()).isSameAs(CaseConversions.NO.getConversionName()); - - 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()); Assertions.assertThat(tableColumn.getColumnLetterCase().getComparisonName()).isSameAs(CaseComparisons.STRICT.getComparisonName()); @@ -643,22 +633,19 @@ public void test_getColumnLetterCase() { @Test @NeedReload public void test_getPrimaryKeyLetterCase() { - Table table = new Table(connectionProvider, "test"); + Table table = connection.table("test").build(); Row tableRow = table.getRow(0); - Request request = new Request(connectionProvider, "select * from test"); + Request request = connection.request("select * from test").build(); Row requestRow = request.getRow(0); - Changes changes = new Changes(table).setStartPointNow(); + Changes changes = connection.changes().tables(table).build().setStartPointNow(); update(); changes.setEndPointNow(); Change change = changes.getChangesList().get(0); Row rowAtStartPoint = changes.getChangesOfType(ChangeType.DELETION).getChangesList().get(0).getRowAtStartPoint(); Row rowAtEndPoint = change.getRowAtEndPoint(); - - 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()); @@ -670,9 +657,6 @@ public void test_getPrimaryKeyLetterCase() { Assertions.assertThat(rowAtStartPoint.getPrimaryKeyLetterCase().getConversionName()).isSameAs(CaseConversions.NO.getConversionName()); Assertions.assertThat(rowAtEndPoint.getPrimaryKeyLetterCase().getConversionName()).isSameAs(CaseConversions.NO.getConversionName()); - - 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 a8e06c17..a97974c0 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 @@ -24,10 +24,10 @@ import org.assertj.core.api.Assertions; import org.assertj.db.common.NeedReload; +import org.assertj.db.type.AssertDbConnection; 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; @@ -49,18 +49,18 @@ */ public class H2Database_DataSource_UIUIUI_Test extends AbstractH2Test { - private ConnectionProvider connectionProvider; + private AssertDbConnection connection; @Before public void init() { - connectionProvider = dsConnectionUIUIUI; + connection = dsConnectionUIUIUI; } @Test @NeedReload public void test_PrimaryKey_hasPksNames() { - Table table = new Table(connectionProvider, "test"); - Changes changes = new Changes(table).setStartPointNow(); + Table table = connection.table("test").build(); + Changes changes = connection.changes().tables(table).build().setStartPointNow(); update(); changes.setEndPointNow(); @@ -71,8 +71,8 @@ public void test_PrimaryKey_hasPksNames() { @Test @NeedReload public void test_ColumnName_hasColumnName() { - Table table = new Table(connectionProvider, "test"); - Changes changes = new Changes(table).setStartPointNow(); + Table table = connection.table("test").build(); + Changes changes = connection.changes().tables(table).build().setStartPointNow(); update(); changes.setEndPointNow(); @@ -208,8 +208,8 @@ public void test_ColumnName_hasColumnName() { @Test @NeedReload public void test_ColumnClass_isOfClass() { - Table table = new Table(connectionProvider, "test"); - Changes changes = new Changes(table).setStartPointNow(); + Table table = connection.table("test").build(); + Changes changes = connection.changes().tables(table).build().setStartPointNow(); update(); changes.setEndPointNow(); @@ -345,8 +345,8 @@ public void test_ColumnClass_isOfClass() { @Test @NeedReload public void test_ColumnEquality_hasValues() { - Table table = new Table(connectionProvider, "test"); - Changes changes = new Changes(table).setStartPointNow(); + Table table = connection.table("test").build(); + Changes changes = connection.changes().tables(table).build().setStartPointNow(); update(); changes.setEndPointNow(); @@ -481,8 +481,8 @@ public void test_ColumnEquality_hasValues() { @Test @NeedReload public void test_ColumnEquality_containsValues() { - Table table = new Table(connectionProvider, "test"); - Changes changes = new Changes(table).setStartPointNow(); + Table table = connection.table("test").build(); + Changes changes = connection.changes().tables(table).build().setStartPointNow(); update(); changes.setEndPointNow(); @@ -553,8 +553,8 @@ public void test_ColumnEquality_containsValues() { @Test @NeedReload public void test_ColumnType_isOfType() { - Table table = new Table(connectionProvider, "test"); - Changes changes = new Changes(table).setStartPointNow(); + Table table = connection.table("test").build(); + Changes changes = connection.changes().tables(table).build().setStartPointNow(); update(); changes.setEndPointNow(); @@ -689,8 +689,8 @@ public void test_ColumnType_isOfType() { @Test @NeedReload public void test_ColumnOfChangeEquality_hasValues() { - Table table = new Table(connectionProvider, "test"); - Changes changes = new Changes(table).setStartPointNow(); + Table table = connection.table("test").build(); + Changes changes = connection.changes().tables(table).build().setStartPointNow(); update(); changes.setEndPointNow(); @@ -841,8 +841,8 @@ public void test_ColumnOfChangeEquality_hasValues() { @Test @NeedReload public void test_RowEquality_hasValues() { - Table table = new Table(connectionProvider, "test"); - Changes changes = new Changes(table).setStartPointNow(); + Table table = connection.table("test").build(); + Changes changes = connection.changes().tables(table).build().setStartPointNow(); update(); changes.setEndPointNow(); @@ -978,8 +978,8 @@ public void test_RowEquality_hasValues() { @Test @NeedReload public void test_ValueClass_isOfClass() { - Table table = new Table(connectionProvider, "test"); - Changes changes = new Changes(table).setStartPointNow(); + Table table = connection.table("test").build(); + Changes changes = connection.changes().tables(table).build().setStartPointNow(); update(); changes.setEndPointNow(); @@ -1115,8 +1115,8 @@ public void test_ValueClass_isOfClass() { @Test @NeedReload public void test_ValueEquality_isEqualTo() { - Table table = new Table(connectionProvider, "test"); - Changes changes = new Changes(table).setStartPointNow(); + Table table = connection.table("test").build(); + Changes changes = connection.changes().tables(table).build().setStartPointNow(); update(); changes.setEndPointNow(); @@ -1252,8 +1252,8 @@ public void test_ValueEquality_isEqualTo() { @Test @NeedReload public void test_ValueNonEquality_isNotEqualTo() { - Table table = new Table(connectionProvider, "test"); - Changes changes = new Changes(table).setStartPointNow(); + Table table = connection.table("test").build(); + Changes changes = connection.changes().tables(table).build().setStartPointNow(); update(); changes.setEndPointNow(); @@ -1389,8 +1389,8 @@ public void test_ValueNonEquality_isNotEqualTo() { @Test @NeedReload public void test_ValueType_isOfType() { - Table table = new Table(connectionProvider, "test"); - Changes changes = new Changes(table).setStartPointNow(); + Table table = connection.table("test").build(); + Changes changes = connection.changes().tables(table).build().setStartPointNow(); update(); changes.setEndPointNow(); @@ -1526,18 +1526,16 @@ public void test_ValueType_isOfType() { @Test @NeedReload public void test_getTableLetterCase() { - Table table = new Table(connectionProvider, "test"); + Table table = connection.table("test").build(); - Request request = new Request(connectionProvider, "select * from test"); + Request request = connection.request("select * from test").build(); - Changes changes = new Changes(table).setStartPointNow(); + Changes changes = connection.changes().tables(table).build().setStartPointNow(); update(); changes.setEndPointNow(); Change change = changes.getChangesList().get(0); - Assertions.assertThat(connectionProvider.getTableLetterCase().getConversionName()).isSameAs(CaseConversions.UPPER.getConversionName()); - Assertions.assertThat(table.getTableLetterCase().getConversionName()).isSameAs(CaseConversions.UPPER.getConversionName()); Assertions.assertThat(request.getTableLetterCase().getConversionName()).isSameAs(CaseConversions.UPPER.getConversionName()); @@ -1546,8 +1544,6 @@ public void test_getTableLetterCase() { Assertions.assertThat(change.getTableLetterCase().getConversionName()).isSameAs(CaseConversions.UPPER.getConversionName()); - Assertions.assertThat(connectionProvider.getTableLetterCase().getComparisonName()).isSameAs(CaseComparisons.IGNORE.getComparisonName()); - Assertions.assertThat(table.getTableLetterCase().getComparisonName()).isSameAs(CaseComparisons.IGNORE.getComparisonName()); Assertions.assertThat(request.getTableLetterCase().getComparisonName()).isSameAs(CaseComparisons.IGNORE.getComparisonName()); @@ -1559,19 +1555,19 @@ public void test_getTableLetterCase() { @Test @NeedReload public void test_getColumnLetterCase() { - Table table = new Table(connectionProvider, "test"); + Table table = connection.table("test").build(); Row tableRow = table.getRow(0); Column tableColumn = table.getColumn(0); Value tableRowValue = tableRow.getColumnValue(0); Value tableColumnValue = tableColumn.getRowValue(0); - Request request = new Request(connectionProvider, "select * from test"); + Request request = connection.request("select * from test").build(); Row requestRow = request.getRow(0); Column requestColumn = request.getColumn(0); Value requestRowValue = requestRow.getColumnValue(0); Value requestColumnValue = requestColumn.getRowValue(0); - Changes changes = new Changes(table).setStartPointNow(); + Changes changes = connection.changes().tables(table).build().setStartPointNow(); update(); changes.setEndPointNow(); Change change = changes.getChangesList().get(0); @@ -1580,9 +1576,6 @@ public void test_getColumnLetterCase() { Value valueAtStartPoint = rowAtStartPoint.getColumnValue(0); Value valueAtEndPoint = rowAtEndPoint.getColumnValue(0); - - 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()); Assertions.assertThat(tableColumn.getColumnLetterCase().getConversionName()).isSameAs(CaseConversions.UPPER.getConversionName()); @@ -1602,9 +1595,6 @@ public void test_getColumnLetterCase() { Assertions.assertThat(valueAtStartPoint.getColumnLetterCase().getConversionName()).isSameAs(CaseConversions.UPPER.getConversionName()); Assertions.assertThat(valueAtEndPoint.getColumnLetterCase().getConversionName()).isSameAs(CaseConversions.UPPER.getConversionName()); - - 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()); Assertions.assertThat(tableColumn.getColumnLetterCase().getComparisonName()).isSameAs(CaseComparisons.IGNORE.getComparisonName()); @@ -1628,13 +1618,13 @@ public void test_getColumnLetterCase() { @Test @NeedReload public void test_getPrimaryKeyLetterCase() { - Table table = new Table(connectionProvider, "test"); + Table table = connection.table("test").build(); Row tableRow = table.getRow(0); - Request request = new Request(connectionProvider, "select * from test"); + Request request = connection.request("select * from test").build(); Row requestRow = request.getRow(0); - Changes changes = new Changes(table).setStartPointNow(); + Changes changes = connection.changes().tables(table).build().setStartPointNow(); update(); changes.setEndPointNow(); Change change = changes.getChangesList().get(0); @@ -1642,8 +1632,6 @@ public void test_getPrimaryKeyLetterCase() { Row rowAtEndPoint = change.getRowAtEndPoint(); - 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()); @@ -1656,8 +1644,6 @@ public void test_getPrimaryKeyLetterCase() { Assertions.assertThat(rowAtEndPoint.getPrimaryKeyLetterCase().getConversionName()).isSameAs(CaseConversions.UPPER.getConversionName()); - 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_JdbcUrl_NSNSNS_Test.java b/src/test/java/org/assertj/db/database/h2/H2Database_JdbcUrl_NSNSNS_Test.java index 6e32fe7c..0da63285 100644 --- a/src/test/java/org/assertj/db/database/h2/H2Database_JdbcUrl_NSNSNS_Test.java +++ b/src/test/java/org/assertj/db/database/h2/H2Database_JdbcUrl_NSNSNS_Test.java @@ -22,11 +22,11 @@ import org.assertj.db.common.NeedReload; import org.assertj.db.exception.AssertJDBException; import org.assertj.db.output.Outputs; +import org.assertj.db.type.AssertDbConnection; import org.assertj.db.type.Change; 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.Table; @@ -44,18 +44,18 @@ */ public class H2Database_JdbcUrl_NSNSNS_Test extends AbstractH2Test { - private ConnectionProvider connectionProvider; + private AssertDbConnection connection; @Before public void init() { - connectionProvider = jdbcConnectionNSNSNS; + connection = jdbcConnectionNSNSNS; } @NeedReload public void test_Outputs_output() { - Table table = new Table(connectionProvider, "test"); - Changes changes = new Changes(table).setStartPointNow(); - Changes changes2 = new Changes(connectionProvider).setStartPointNow(); + Table table = connection.table("test").build(); + Changes changes = connection.changes().tables(table).build().setStartPointNow(); + Changes changes2 = connection.changes().build().setStartPointNow(); update(); changes.setEndPointNow(); changes2.setEndPointNow(); @@ -95,7 +95,7 @@ public void test_Outputs_output() { .column().toStream(byteArrayOutputStream15) .valueAtEndPoint().toStream(byteArrayOutputStream16); - Assertions.assertThat(byteArrayOutputStream0.toString()).isEqualTo(String.format("[TEST table]%n" + Assertions.assertThat(byteArrayOutputStream0).hasToString(String.format("[TEST table]%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" @@ -104,21 +104,21 @@ public void test_Outputs_output() { + "|-----------|---------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|--------------------|------------|-------------------------------|-------------------------------|-------------------------------|------------|------------|------------|------------|------------|-------------------------------------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|--------------------------------------|------------------|------------------|%n" + "| Index : 0 | | 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(byteArrayOutputStream1.toString()).isEqualTo(String.format("[Column at index 0 (column name : VAR1) of TEST table]%n" + Assertions.assertThat(byteArrayOutputStream1).hasToString(String.format("[Column at index 0 (column name : VAR1) of TEST table]%n" + "|-----------|----------|%n" + "| | VAR1 |%n" + "| | (NUMBER) |%n" + "|-----------|----------|%n" + "| Index : 0 | 1 |%n" + "|-----------|----------|%n")); - Assertions.assertThat(byteArrayOutputStream2.toString()).isEqualTo(String.format("[Value at index 0 of Column at index 0 (column name : VAR1) of TEST table]%n" + Assertions.assertThat(byteArrayOutputStream2).hasToString(String.format("[Value at index 0 of Column at index 0 (column name : VAR1) of TEST table]%n" + "|----------|%n" + "| VAR1 |%n" + "| (NUMBER) |%n" + "|----------|%n" + "| 1 |%n" + "|----------|%n")); - Assertions.assertThat(byteArrayOutputStream3.toString()).isEqualTo(String.format("[Row at index 0 of TEST table]%n" + Assertions.assertThat(byteArrayOutputStream3).hasToString(String.format("[Row at index 0 of TEST table]%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" @@ -127,14 +127,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(byteArrayOutputStream4.toString()).isEqualTo(String.format("[Value at index 0 (column name : VAR1) of Row at index 0 of TEST table]%n" + Assertions.assertThat(byteArrayOutputStream4).hasToString(String.format("[Value at index 0 (column name : VAR1) of Row at index 0 of TEST table]%n" + "|----------|%n" + "| VAR1 |%n" + "| (NUMBER) |%n" + "|----------|%n" + "| 1 |%n" + "|----------|%n")); - Assertions.assertThat(byteArrayOutputStream5.toString()).isEqualTo(String.format("[Changes on TEST table of 'data source']%n" + Assertions.assertThat(byteArrayOutputStream5).hasToString(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 'data source']%n" + Assertions.assertThat(byteArrayOutputStream6).hasToString(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 'data source']%n" + Assertions.assertThat(byteArrayOutputStream7).hasToString(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 'data source']%n" + Assertions.assertThat(byteArrayOutputStream8).hasToString(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 'data source']%n" + Assertions.assertThat(byteArrayOutputStream9).hasToString(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 'data source']%n" + Assertions.assertThat(byteArrayOutputStream10).hasToString(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 'data source']%n" + Assertions.assertThat(byteArrayOutputStream11).hasToString(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 'data source']%n" + Assertions.assertThat(byteArrayOutputStream12).hasToString(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 'data source']%n" + Assertions.assertThat(byteArrayOutputStream13).hasToString(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 'data source']%n" + Assertions.assertThat(byteArrayOutputStream14).hasToString(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 'data source']%n" + Assertions.assertThat(byteArrayOutputStream15).hasToString(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 'data source']%n" + Assertions.assertThat(byteArrayOutputStream16).hasToString(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(connectionProvider, "test"); - Changes changes = new Changes(table).setStartPointNow(); - Changes changes2 = new Changes(connectionProvider).setStartPointNow(); + Table table = connection.table("test").build(); + Changes changes = connection.changes().tables(table).build().setStartPointNow(); + Changes changes2 = connection.changes().build().setStartPointNow(); update(); changes.setEndPointNow(); changes2.setEndPointNow(); @@ -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(connectionProvider, "test"); - Changes changes = new Changes(table).setStartPointNow(); - Changes changes2 = new Changes(connectionProvider).setStartPointNow(); + Table table = connection.table("test").build(); + Changes changes = connection.changes().tables(table).build().setStartPointNow(); + Changes changes2 = connection.changes().build().setStartPointNow(); update(); changes.setEndPointNow(); changes2.setEndPointNow(); @@ -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(connectionProvider, "test"); - Changes changes = new Changes(table).setStartPointNow(); - Changes changes2 = new Changes(connectionProvider).setStartPointNow(); + Table table = connection.table("test").build(); + Changes changes = connection.changes().tables(table).build().setStartPointNow(); + Changes changes2 = connection.changes().build().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(connectionProvider, "test"); - Changes changes = new Changes(table).setStartPointNow(); - Changes changes2 = new Changes(connectionProvider).setStartPointNow(); + Table table = connection.table("test").build(); + Changes changes = connection.changes().tables(table).build().setStartPointNow(); + Changes changes2 = connection.changes().build().setStartPointNow(); update(); changes.setEndPointNow(); changes2.setEndPointNow(); @@ -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(connectionProvider, "test"); - Changes changes = new Changes(table).setStartPointNow(); - Changes changes2 = new Changes(connectionProvider).setStartPointNow(); + Table table = connection.table("test").build(); + Changes changes = connection.changes().tables(table).build().setStartPointNow(); + Changes changes2 = connection.changes().build().setStartPointNow(); update(); changes.setEndPointNow(); changes2.setEndPointNow(); @@ -480,47 +480,47 @@ public void should_fail_because_table_name_is_wrong_to_navigate() { assertThat(changes).changeOnTable("teSt"); fail("An exception must be raised"); } catch (AssertJDBException e) { - Assertions.assertThat(e.getMessage()).isEqualTo(String.format("Index 0 out of the limits [0, 0[")); + Assertions.assertThat(e.getMessage()).isEqualTo("Index 0 out of the limits [0, 0["); } try { assertThat(changes).changeOnTable("teSt", 0); fail("An exception must be raised"); } catch (AssertJDBException e) { - Assertions.assertThat(e.getMessage()).isEqualTo(String.format("Index 0 out of the limits [0, 0[")); + Assertions.assertThat(e.getMessage()).isEqualTo("Index 0 out of the limits [0, 0["); } try { assertThat(changes).changeOnTableWithPks("teSt", 1); fail("An exception must be raised"); } catch (AssertJDBException e) { - Assertions.assertThat(e.getMessage()).isEqualTo(String.format("No change found for table teSt and primary keys [1]")); + Assertions.assertThat(e.getMessage()).isEqualTo("No change found for table teSt and primary keys [1]"); } try { assertThat(changes2).changeOnTable("teSt"); fail("An exception must be raised"); } catch (AssertJDBException e) { - Assertions.assertThat(e.getMessage()).isEqualTo(String.format("Index 0 out of the limits [0, 0[")); + Assertions.assertThat(e.getMessage()).isEqualTo("Index 0 out of the limits [0, 0["); } try { assertThat(changes2).changeOnTable("teSt", 0); fail("An exception must be raised"); } catch (AssertJDBException e) { - Assertions.assertThat(e.getMessage()).isEqualTo(String.format("Index 0 out of the limits [0, 0[")); + Assertions.assertThat(e.getMessage()).isEqualTo("Index 0 out of the limits [0, 0["); } try { assertThat(changes2).changeOnTableWithPks("teSt", 1); fail("An exception must be raised"); } catch (AssertJDBException e) { - Assertions.assertThat(e.getMessage()).isEqualTo(String.format("No change found for table teSt and primary keys [1]")); + Assertions.assertThat(e.getMessage()).isEqualTo("No change found for table teSt and primary keys [1]"); } } @Test @NeedReload public void test_ColumnName_hasColumnName() { - Table table = new Table(connectionProvider, "test"); - Changes changes = new Changes(table).setStartPointNow(); - Changes changes2 = new Changes(connectionProvider).setStartPointNow(); + Table table = connection.table("test").build(); + Changes changes = connection.changes().tables(table).build().setStartPointNow(); + Changes changes2 = connection.changes().build().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(connectionProvider, "test"); - Changes changes = new Changes(table).setStartPointNow(); - Changes changes2 = new Changes(connectionProvider).setStartPointNow(); + Table table = connection.table("test").build(); + Changes changes = connection.changes().tables(table).build().setStartPointNow(); + Changes changes2 = connection.changes().build().setStartPointNow(); update(); changes.setEndPointNow(); changes2.setEndPointNow(); @@ -550,18 +550,15 @@ public void test_ColumnClass_isOfClass() { @Test @NeedReload public void test_getTableLetterCase() { - Table table = new Table(connectionProvider, "test"); + Table table = connection.table("test").build(); - Request request = new Request(connectionProvider, "select * from test"); + Request request = connection.request("select * from test").build(); - Changes changes = new Changes(table).setStartPointNow(); + Changes changes = connection.changes().tables(table).build().setStartPointNow(); update(); changes.setEndPointNow(); Change change = changes.getChangesList().get(0); - - Assertions.assertThat(connectionProvider.getTableLetterCase().getConversionName()).isSameAs(CaseConversions.NO.getConversionName()); - Assertions.assertThat(table.getTableLetterCase().getConversionName()).isSameAs(CaseConversions.NO.getConversionName()); Assertions.assertThat(request.getTableLetterCase().getConversionName()).isSameAs(CaseConversions.NO.getConversionName()); @@ -569,9 +566,6 @@ public void test_getTableLetterCase() { Assertions.assertThat(changes.getTableLetterCase().getConversionName()).isSameAs(CaseConversions.NO.getConversionName()); Assertions.assertThat(change.getTableLetterCase().getConversionName()).isSameAs(CaseConversions.NO.getConversionName()); - - Assertions.assertThat(connectionProvider.getTableLetterCase().getComparisonName()).isSameAs(CaseComparisons.STRICT.getComparisonName()); - Assertions.assertThat(table.getTableLetterCase().getComparisonName()).isSameAs(CaseComparisons.STRICT.getComparisonName()); Assertions.assertThat(request.getTableLetterCase().getComparisonName()).isSameAs(CaseComparisons.STRICT.getComparisonName()); @@ -583,19 +577,19 @@ public void test_getTableLetterCase() { @Test @NeedReload public void test_getColumnLetterCase() { - Table table = new Table(connectionProvider, "test"); + Table table = connection.table("test").build(); Row tableRow = table.getRow(0); Column tableColumn = table.getColumn(0); Value tableRowValue = tableRow.getColumnValue(0); Value tableColumnValue = tableColumn.getRowValue(0); - Request request = new Request(connectionProvider, "select * from test"); + Request request = connection.request("select * from test").build(); Row requestRow = request.getRow(0); Column requestColumn = request.getColumn(0); Value requestRowValue = requestRow.getColumnValue(0); Value requestColumnValue = requestColumn.getRowValue(0); - Changes changes = new Changes(table).setStartPointNow(); + Changes changes = connection.changes().tables(table).build().setStartPointNow(); update(); changes.setEndPointNow(); Change change = changes.getChangesList().get(0); @@ -604,9 +598,6 @@ public void test_getColumnLetterCase() { Value valueAtStartPoint = rowAtStartPoint.getColumnValue(0); Value valueAtEndPoint = rowAtEndPoint.getColumnValue(0); - - 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()); Assertions.assertThat(tableColumn.getColumnLetterCase().getConversionName()).isSameAs(CaseConversions.NO.getConversionName()); @@ -626,9 +617,6 @@ public void test_getColumnLetterCase() { Assertions.assertThat(valueAtStartPoint.getColumnLetterCase().getConversionName()).isSameAs(CaseConversions.NO.getConversionName()); Assertions.assertThat(valueAtEndPoint.getColumnLetterCase().getConversionName()).isSameAs(CaseConversions.NO.getConversionName()); - - 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()); Assertions.assertThat(tableColumn.getColumnLetterCase().getComparisonName()).isSameAs(CaseComparisons.STRICT.getComparisonName()); @@ -652,22 +640,19 @@ public void test_getColumnLetterCase() { @Test @NeedReload public void test_getPrimaryKeyLetterCase() { - Table table = new Table(connectionProvider, "test"); + Table table = connection.table("test").build(); Row tableRow = table.getRow(0); - Request request = new Request(connectionProvider, "select * from test"); + Request request = connection.request("select * from test").build(); Row requestRow = request.getRow(0); - Changes changes = new Changes(table).setStartPointNow(); + Changes changes = connection.changes().tables(table).build().setStartPointNow(); update(); changes.setEndPointNow(); Change change = changes.getChangesList().get(0); Row rowAtStartPoint = changes.getChangesOfType(ChangeType.DELETION).getChangesList().get(0).getRowAtStartPoint(); Row rowAtEndPoint = change.getRowAtEndPoint(); - - 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()); @@ -679,9 +664,6 @@ public void test_getPrimaryKeyLetterCase() { Assertions.assertThat(rowAtStartPoint.getPrimaryKeyLetterCase().getConversionName()).isSameAs(CaseConversions.NO.getConversionName()); Assertions.assertThat(rowAtEndPoint.getPrimaryKeyLetterCase().getConversionName()).isSameAs(CaseConversions.NO.getConversionName()); - - 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_JdbcUrl_UIUIUI_Test.java b/src/test/java/org/assertj/db/database/h2/H2Database_JdbcUrl_UIUIUI_Test.java index 48f7fc5f..29454d7a 100644 --- a/src/test/java/org/assertj/db/database/h2/H2Database_JdbcUrl_UIUIUI_Test.java +++ b/src/test/java/org/assertj/db/database/h2/H2Database_JdbcUrl_UIUIUI_Test.java @@ -24,10 +24,10 @@ import org.assertj.core.api.Assertions; import org.assertj.db.common.NeedReload; +import org.assertj.db.type.AssertDbConnection; 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; @@ -49,18 +49,18 @@ */ public class H2Database_JdbcUrl_UIUIUI_Test extends AbstractH2Test { - private ConnectionProvider connectionProvider; + private AssertDbConnection connection; @Before public void init() { - connectionProvider = jdbcConnectionUIUIUI; + connection = jdbcConnectionUIUIUI; } @Test @NeedReload public void test_PrimaryKey_hasPksNames() { - Table table = new Table(connectionProvider, "test"); - Changes changes = new Changes(table).setStartPointNow(); + Table table = connection.table("test").build(); + Changes changes = connection.changes().tables(table).build().setStartPointNow(); update(); changes.setEndPointNow(); @@ -71,8 +71,8 @@ public void test_PrimaryKey_hasPksNames() { @Test @NeedReload public void test_ColumnName_hasColumnName() { - Table table = new Table(connectionProvider, "test"); - Changes changes = new Changes(table).setStartPointNow(); + Table table = connection.table("test").build(); + Changes changes = connection.changes().tables(table).build().setStartPointNow(); update(); changes.setEndPointNow(); @@ -208,8 +208,8 @@ public void test_ColumnName_hasColumnName() { @Test @NeedReload public void test_ColumnClass_isOfClass() { - Table table = new Table(connectionProvider, "test"); - Changes changes = new Changes(table).setStartPointNow(); + Table table = connection.table("test").build(); + Changes changes = connection.changes().tables(table).build().setStartPointNow(); update(); changes.setEndPointNow(); @@ -345,8 +345,8 @@ public void test_ColumnClass_isOfClass() { @Test @NeedReload public void test_ColumnEquality_hasValues() { - Table table = new Table(connectionProvider, "test"); - Changes changes = new Changes(table).setStartPointNow(); + Table table = connection.table("test").build(); + Changes changes = connection.changes().tables(table).build().setStartPointNow(); update(); changes.setEndPointNow(); @@ -481,8 +481,8 @@ public void test_ColumnEquality_hasValues() { @Test @NeedReload public void test_ColumnEquality_containsValues() { - Table table = new Table(connectionProvider, "test"); - Changes changes = new Changes(table).setStartPointNow(); + Table table = connection.table("test").build(); + Changes changes = connection.changes().tables(table).build().setStartPointNow(); update(); changes.setEndPointNow(); @@ -553,8 +553,8 @@ public void test_ColumnEquality_containsValues() { @Test @NeedReload public void test_ColumnType_isOfType() { - Table table = new Table(connectionProvider, "test"); - Changes changes = new Changes(table).setStartPointNow(); + Table table = connection.table("test").build(); + Changes changes = connection.changes().tables(table).build().setStartPointNow(); update(); changes.setEndPointNow(); @@ -689,8 +689,8 @@ public void test_ColumnType_isOfType() { @Test @NeedReload public void test_ColumnOfChangeEquality_hasValues() { - Table table = new Table(connectionProvider, "test"); - Changes changes = new Changes(table).setStartPointNow(); + Table table = connection.table("test").build(); + Changes changes = connection.changes().tables(table).build().setStartPointNow(); update(); changes.setEndPointNow(); @@ -841,8 +841,8 @@ public void test_ColumnOfChangeEquality_hasValues() { @Test @NeedReload public void test_RowEquality_hasValues() { - Table table = new Table(connectionProvider, "test"); - Changes changes = new Changes(table).setStartPointNow(); + Table table = connection.table("test").build(); + Changes changes = connection.changes().tables(table).build().setStartPointNow(); update(); changes.setEndPointNow(); @@ -978,8 +978,8 @@ public void test_RowEquality_hasValues() { @Test @NeedReload public void test_ValueClass_isOfClass() { - Table table = new Table(connectionProvider, "test"); - Changes changes = new Changes(table).setStartPointNow(); + Table table = connection.table("test").build(); + Changes changes = connection.changes().tables(table).build().setStartPointNow(); update(); changes.setEndPointNow(); @@ -1115,8 +1115,8 @@ public void test_ValueClass_isOfClass() { @Test @NeedReload public void test_ValueEquality_isEqualTo() { - Table table = new Table(connectionProvider, "test"); - Changes changes = new Changes(table).setStartPointNow(); + Table table = connection.table("test").build(); + Changes changes = connection.changes().tables(table).build().setStartPointNow(); update(); changes.setEndPointNow(); @@ -1252,8 +1252,8 @@ public void test_ValueEquality_isEqualTo() { @Test @NeedReload public void test_ValueNonEquality_isNotEqualTo() { - Table table = new Table(connectionProvider, "test"); - Changes changes = new Changes(table).setStartPointNow(); + Table table = connection.table("test").build(); + Changes changes = connection.changes().tables(table).build().setStartPointNow(); update(); changes.setEndPointNow(); @@ -1389,8 +1389,8 @@ public void test_ValueNonEquality_isNotEqualTo() { @Test @NeedReload public void test_ValueType_isOfType() { - Table table = new Table(connectionProvider, "test"); - Changes changes = new Changes(table).setStartPointNow(); + Table table = connection.table("test").build(); + Changes changes = connection.changes().tables(table).build().setStartPointNow(); update(); changes.setEndPointNow(); @@ -1526,18 +1526,15 @@ public void test_ValueType_isOfType() { @Test @NeedReload public void test_getTableLetterCase() { - Table table = new Table(connectionProvider, "test"); + Table table = connection.table("test").build(); - Request request = new Request(connectionProvider, "select * from test"); + Request request = connection.request("select * from test").build(); - Changes changes = new Changes(table).setStartPointNow(); + Changes changes = connection.changes().tables(table).build().setStartPointNow(); update(); changes.setEndPointNow(); Change change = changes.getChangesList().get(0); - - Assertions.assertThat(connectionProvider.getTableLetterCase().getConversionName()).isSameAs(CaseConversions.UPPER.getConversionName()); - Assertions.assertThat(table.getTableLetterCase().getConversionName()).isSameAs(CaseConversions.UPPER.getConversionName()); Assertions.assertThat(request.getTableLetterCase().getConversionName()).isSameAs(CaseConversions.UPPER.getConversionName()); @@ -1545,9 +1542,6 @@ public void test_getTableLetterCase() { Assertions.assertThat(changes.getTableLetterCase().getConversionName()).isSameAs(CaseConversions.UPPER.getConversionName()); Assertions.assertThat(change.getTableLetterCase().getConversionName()).isSameAs(CaseConversions.UPPER.getConversionName()); - - Assertions.assertThat(connectionProvider.getTableLetterCase().getComparisonName()).isSameAs(CaseComparisons.IGNORE.getComparisonName()); - Assertions.assertThat(table.getTableLetterCase().getComparisonName()).isSameAs(CaseComparisons.IGNORE.getComparisonName()); Assertions.assertThat(request.getTableLetterCase().getComparisonName()).isSameAs(CaseComparisons.IGNORE.getComparisonName()); @@ -1559,19 +1553,19 @@ public void test_getTableLetterCase() { @Test @NeedReload public void test_getColumnLetterCase() { - Table table = new Table(connectionProvider, "test"); + Table table = connection.table("test").build(); Row tableRow = table.getRow(0); Column tableColumn = table.getColumn(0); Value tableRowValue = tableRow.getColumnValue(0); Value tableColumnValue = tableColumn.getRowValue(0); - Request request = new Request(connectionProvider, "select * from test"); + Request request = connection.request("select * from test").build(); Row requestRow = request.getRow(0); Column requestColumn = request.getColumn(0); Value requestRowValue = requestRow.getColumnValue(0); Value requestColumnValue = requestColumn.getRowValue(0); - Changes changes = new Changes(table).setStartPointNow(); + Changes changes = connection.changes().tables(table).build().setStartPointNow(); update(); changes.setEndPointNow(); Change change = changes.getChangesList().get(0); @@ -1580,9 +1574,6 @@ public void test_getColumnLetterCase() { Value valueAtStartPoint = rowAtStartPoint.getColumnValue(0); Value valueAtEndPoint = rowAtEndPoint.getColumnValue(0); - - 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()); Assertions.assertThat(tableColumn.getColumnLetterCase().getConversionName()).isSameAs(CaseConversions.UPPER.getConversionName()); @@ -1602,9 +1593,6 @@ public void test_getColumnLetterCase() { Assertions.assertThat(valueAtStartPoint.getColumnLetterCase().getConversionName()).isSameAs(CaseConversions.UPPER.getConversionName()); Assertions.assertThat(valueAtEndPoint.getColumnLetterCase().getConversionName()).isSameAs(CaseConversions.UPPER.getConversionName()); - - 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()); Assertions.assertThat(tableColumn.getColumnLetterCase().getComparisonName()).isSameAs(CaseComparisons.IGNORE.getComparisonName()); @@ -1628,22 +1616,19 @@ public void test_getColumnLetterCase() { @Test @NeedReload public void test_getPrimaryKeyLetterCase() { - Table table = new Table(connectionProvider, "test"); + Table table = connection.table("test").build(); Row tableRow = table.getRow(0); - Request request = new Request(connectionProvider, "select * from test"); + Request request = connection.request("select * from test").build(); Row requestRow = request.getRow(0); - Changes changes = new Changes(table).setStartPointNow(); + Changes changes = connection.changes().tables(table).build().setStartPointNow(); update(); changes.setEndPointNow(); Change change = changes.getChangesList().get(0); Row rowAtStartPoint = change.getRowAtStartPoint(); Row rowAtEndPoint = change.getRowAtEndPoint(); - - 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()); @@ -1655,9 +1640,6 @@ public void test_getPrimaryKeyLetterCase() { Assertions.assertThat(rowAtStartPoint.getPrimaryKeyLetterCase().getConversionName()).isSameAs(CaseConversions.UPPER.getConversionName()); Assertions.assertThat(rowAtEndPoint.getPrimaryKeyLetterCase().getConversionName()).isSameAs(CaseConversions.UPPER.getConversionName()); - - 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_DataSource_DDD_Test.java b/src/test/java/org/assertj/db/database/h2/ReservedH2Database_DataSource_DDD_Test.java index bc49ab63..29bf831f 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 @@ -15,8 +15,8 @@ import static org.assertj.db.api.Assertions.assertThat; import org.assertj.db.common.NeedReload; +import org.assertj.db.type.AssertDbConnection; 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; @@ -30,20 +30,18 @@ */ public class ReservedH2Database_DataSource_DDD_Test extends AbstractReservedH2Test { - private ConnectionProvider connectionProvider; + private AssertDbConnection connection; @Before public void init() { - connectionProvider = dsConnectionDDD; + connection = dsConnectionDDD; } @Test @NeedReload public void test_PrimaryKey_hasPksNames() { - 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(); + Changes changes1 = connection.changes().table("group", t -> t.delimiters('`', '`')).build().setStartPointNow(); + Changes changes2 = connection.changes().table("two words", t -> t.delimiters('`', '`')).build().setStartPointNow(); update(); changes1.setEndPointNow(); changes2.setEndPointNow(); @@ -58,10 +56,10 @@ public void test_PrimaryKey_hasPksNames() { @Test @NeedReload public void test_ColumnName_hasColumnName() { - 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(); + Table table1 = connection.table("group").delimiters('`', '`').build(); + Table table2 = connection.table("two words").delimiters('`', '`').build(); + Changes changes1 = connection.changes().tables(table1).build().setStartPointNow(); + Changes changes2 = connection.changes().tables(table2).build().setStartPointNow(); update(); changes1.setEndPointNow(); changes2.setEndPointNow(); @@ -100,16 +98,18 @@ public void test_ColumnName_hasColumnName() { @Test @NeedReload public void test_ColumnName_hasColumnName_with_columns_to_check() { - Table table1 = new Table(connectionProvider, "group", '`', '`') - .setColumnsToCheck(new String[]{ + Table table1 = connection.table("group") + .delimiters('`', '`') + .columnsToCheck(new String[]{ "read", "by", "select", "from" - }); - Table table2 = new Table(connectionProvider, "two words", '`', '`') - .setColumnsToCheck(new String[]{ + }).build(); + Table table2 = connection.table("two words") + .delimiters('`', '`') + .columnsToCheck(new String[]{ "primary key", "column name", "test%test" - }); - Changes changes1 = new Changes(table1).setStartPointNow(); - Changes changes2 = new Changes(table2).setStartPointNow(); + }).build(); + Changes changes1 = connection.changes().tables(table1).build().setStartPointNow(); + Changes changes2 = connection.changes().tables(table2).build().setStartPointNow(); update(); changes1.setEndPointNow(); changes2.setEndPointNow(); @@ -144,16 +144,18 @@ public void test_ColumnName_hasColumnName_with_columns_to_check() { @Test @NeedReload public void test_ColumnName_hasColumnName_with_columns_to_exclude() { - Table table1 = new Table(connectionProvider, "group", '`', '`') - .setColumnsToExclude(new String[]{ + Table table1 = connection.table("group") + .delimiters('`', '`') + .columnsToExclude(new String[]{ "read", "by", "from" - }); - Table table2 = new Table(connectionProvider, "two words", '`', '`') - .setColumnsToExclude(new String[]{ + }).build(); + Table table2 = connection.table("two words") + .delimiters('`', '`') + .columnsToExclude(new String[]{ "column name" - }); - Changes changes1 = new Changes(table1).setStartPointNow(); - Changes changes2 = new Changes(table2).setStartPointNow(); + }).build(); + Changes changes1 = connection.changes().tables(table1).build().setStartPointNow(); + Changes changes2 = connection.changes().tables(table2).build().setStartPointNow(); update(); changes1.setEndPointNow(); changes2.setEndPointNow(); @@ -184,16 +186,18 @@ public void test_ColumnName_hasColumnName_with_columns_to_exclude() { @Test @NeedReload public void test_ColumnName_hasColumnName_with_order() { - Table table1 = new Table(connectionProvider, "group", '`', '`') - .setColumnsToOrder(new Order[]{ + Table table1 = connection.table("group") + .delimiters('`', '`') + .columnsToOrder(new Order[]{ Order.asc("where") - }); - Table table2 = new Table(connectionProvider, "two words", '`', '`') - .setColumnsToOrder(new Order[]{ + }).build(); + Table table2 = connection.table("two words") + .delimiters('`', '`') + .columnsToOrder(new Order[]{ Order.asc("primary key") - }); - Changes changes1 = new Changes(table1).setStartPointNow(); - Changes changes2 = new Changes(table2).setStartPointNow(); + }).build(); + Changes changes1 = connection.changes().tables(table1).build().setStartPointNow(); + Changes changes2 = connection.changes().tables(table2).build().setStartPointNow(); update(); changes1.setEndPointNow(); changes2.setEndPointNow(); 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 e062982a..d4179a8d 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 @@ -15,8 +15,8 @@ import static org.assertj.db.api.Assertions.assertThat; import org.assertj.db.common.NeedReload; +import org.assertj.db.type.AssertDbConnection; 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; @@ -30,20 +30,20 @@ */ public class ReservedH2Database_DataSource_NSNSNS_Test extends AbstractReservedH2Test { - private ConnectionProvider connectionProvider; + private AssertDbConnection connection; @Before public void init() { - connectionProvider = dsConnectionNSNSNS; + connection = dsConnectionNSNSNS; } @Test @NeedReload public void test_PrimaryKey_hasPksNames() { - 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(); + Table table1 = connection.table("GROUP").delimiters('`', '`').build(); + Table table2 = connection.table("TWO WORDS").delimiters('`', '`').build(); + Changes changes1 = connection.changes().tables(table1).build().setStartPointNow(); + Changes changes2 = connection.changes().tables(table2).build().setStartPointNow(); update(); changes1.setEndPointNow(); changes2.setEndPointNow(); @@ -57,10 +57,10 @@ public void test_PrimaryKey_hasPksNames() { @Test @NeedReload public void test_ColumnName_hasColumnName() { - 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(); + Table table1 = connection.table("GROUP").delimiters('`', '`').build(); + Table table2 = connection.table("TWO WORDS").delimiters('`', '`').build(); + Changes changes1 = connection.changes().tables(table1).build().setStartPointNow(); + Changes changes2 = connection.changes().tables(table2).build().setStartPointNow(); update(); changes1.setEndPointNow(); changes2.setEndPointNow(); @@ -99,16 +99,18 @@ public void test_ColumnName_hasColumnName() { @Test @NeedReload public void test_ColumnName_hasColumnName_with_columns_to_check() { - Table table1 = new Table(connectionProvider, "GROUP", '`', '`') - .setColumnsToCheck(new String[]{ + Table table1 = connection.table("GROUP") + .delimiters('`', '`') + .columnsToCheck(new String[]{ "READ", "BY", "SELECT", "FROM" - }); - Table table2 = new Table(connectionProvider, "TWO WORDS", '`', '`') - .setColumnsToCheck(new String[]{ + }).build(); + Table table2 = connection.table("TWO WORDS") + .delimiters('`', '`') + .columnsToCheck(new String[]{ "PRIMARY KEY", "COLUMN NAME", "TEST%TEST" - }); - Changes changes1 = new Changes(table1).setStartPointNow(); - Changes changes2 = new Changes(table2).setStartPointNow(); + }).build(); + Changes changes1 = connection.changes().tables(table1).build().setStartPointNow(); + Changes changes2 = connection.changes().tables(table2).build().setStartPointNow(); update(); changes1.setEndPointNow(); changes2.setEndPointNow(); @@ -143,16 +145,18 @@ public void test_ColumnName_hasColumnName_with_columns_to_check() { @Test @NeedReload public void test_ColumnName_hasColumnName_with_columns_to_exclude() { - Table table1 = new Table(connectionProvider, "GROUP", '`', '`') - .setColumnsToExclude(new String[]{ + Table table1 = connection.table("GROUP") + .delimiters('`', '`') + .columnsToExclude(new String[]{ "READ", "BY", "FROM" - }); - Table table2 = new Table(connectionProvider, "TWO WORDS", '`', '`') - .setColumnsToExclude(new String[]{ + }).build(); + Table table2 = connection.table("TWO WORDS") + .delimiters('`', '`') + .columnsToExclude(new String[]{ "COLUMN NAME" - }); - Changes changes1 = new Changes(table1).setStartPointNow(); - Changes changes2 = new Changes(table2).setStartPointNow(); + }).build(); + Changes changes1 = connection.changes().tables(table1).build().setStartPointNow(); + Changes changes2 = connection.changes().tables(table2).build().setStartPointNow(); update(); changes1.setEndPointNow(); changes2.setEndPointNow(); @@ -183,16 +187,18 @@ public void test_ColumnName_hasColumnName_with_columns_to_exclude() { @Test @NeedReload public void test_ColumnName_hasColumnName_with_order() { - Table table1 = new Table(connectionProvider, "GROUP", '`', '`') - .setColumnsToOrder(new Order[]{ + Table table1 = connection.table("GROUP") + .delimiters('`', '`') + .columnsToOrder(new Order[]{ Order.asc("WHERE") - }); - Table table2 = new Table(connectionProvider, "TWO WORDS", '`', '`') - .setColumnsToOrder(new Order[]{ + }).build(); + Table table2 = connection.table("TWO WORDS") + .delimiters('`', '`') + .columnsToOrder(new Order[]{ Order.asc("PRIMARY KEY") - }); - Changes changes1 = new Changes(table1).setStartPointNow(); - Changes changes2 = new Changes(table2).setStartPointNow(); + }).build(); + Changes changes1 = connection.changes().tables(table1).build().setStartPointNow(); + Changes changes2 = connection.changes().tables(table2).build().setStartPointNow(); update(); changes1.setEndPointNow(); changes2.setEndPointNow(); 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 befbc0ea..600886f5 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 @@ -15,8 +15,8 @@ import static org.assertj.db.api.Assertions.assertThat; import org.assertj.db.common.NeedReload; +import org.assertj.db.type.AssertDbConnection; 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; @@ -30,20 +30,21 @@ */ public class ReservedH2Database_DataSource_UIUIUI_Test extends AbstractReservedH2Test { - private ConnectionProvider connectionProvider; + private AssertDbConnection connection; @Before public void init() { - connectionProvider = dsConnectionUIUIUI; + connection = dsConnectionUIUIUI; } @Test @NeedReload public void test_PrimaryKey_hasPksNames() { - 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(); + Table table1 = connection.table("group").delimiters('`', '`').build(); + Table table2 = connection.table("two words").delimiters('`', '`').build(); + Changes changes1 = connection.changes().tables(table1).build().setStartPointNow(); + Changes changes2 = connection.changes().tables(table2).build().setStartPointNow(); + update(); changes1.setEndPointNow(); changes2.setEndPointNow(); @@ -58,10 +59,10 @@ public void test_PrimaryKey_hasPksNames() { @Test @NeedReload public void test_ColumnName_hasColumnName() { - 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(); + Table table1 = connection.table("group").delimiters('`', '`').build(); + Table table2 = connection.table("two words").delimiters('`', '`').build(); + Changes changes1 = connection.changes().tables(table1).build().setStartPointNow(); + Changes changes2 = connection.changes().tables(table2).build().setStartPointNow(); update(); changes1.setEndPointNow(); changes2.setEndPointNow(); @@ -100,16 +101,18 @@ public void test_ColumnName_hasColumnName() { @Test @NeedReload public void test_ColumnName_hasColumnName_with_columns_to_check() { - Table table1 = new Table(connectionProvider, "group", '`', '`') - .setColumnsToCheck(new String[]{ + Table table1 = connection.table("group") + .delimiters('`', '`') + .columnsToCheck(new String[]{ "read", "by", "select", "from" - }); - Table table2 = new Table(connectionProvider, "two words", '`', '`') - .setColumnsToCheck(new String[]{ + }).build(); + Table table2 = connection.table("two words") + .delimiters('`', '`') + .columnsToCheck(new String[]{ "primary key", "column name", "test%test" - }); - Changes changes1 = new Changes(table1).setStartPointNow(); - Changes changes2 = new Changes(table2).setStartPointNow(); + }).build(); + Changes changes1 = connection.changes().tables(table1).build().setStartPointNow(); + Changes changes2 = connection.changes().tables(table2).build().setStartPointNow(); update(); changes1.setEndPointNow(); changes2.setEndPointNow(); @@ -144,16 +147,18 @@ public void test_ColumnName_hasColumnName_with_columns_to_check() { @Test @NeedReload public void test_ColumnName_hasColumnName_with_columns_to_exclude() { - Table table1 = new Table(connectionProvider, "group", '`', '`') - .setColumnsToExclude(new String[]{ + Table table1 = connection.table("group") + .delimiters('`', '`') + .columnsToExclude(new String[]{ "read", "by", "from" - }); - Table table2 = new Table(connectionProvider, "two words", '`', '`') - .setColumnsToExclude(new String[]{ + }).build(); + Table table2 = connection.table("two words") + .delimiters('`', '`') + .columnsToExclude(new String[]{ "column name" - }); - Changes changes1 = new Changes(table1).setStartPointNow(); - Changes changes2 = new Changes(table2).setStartPointNow(); + }).build(); + Changes changes1 = connection.changes().tables(table1).build().setStartPointNow(); + Changes changes2 = connection.changes().tables(table2).build().setStartPointNow(); update(); changes1.setEndPointNow(); changes2.setEndPointNow(); @@ -184,16 +189,18 @@ public void test_ColumnName_hasColumnName_with_columns_to_exclude() { @Test @NeedReload public void test_ColumnName_hasColumnName_with_order() { - Table table1 = new Table(connectionProvider, "group", '`', '`') - .setColumnsToOrder(new Order[]{ + Table table1 = connection.table("group") + .delimiters('`', '`') + .columnsToOrder(new Order[]{ Order.asc("where") - }); - Table table2 = new Table(connectionProvider, "two words", '`', '`') - .setColumnsToOrder(new Order[]{ + }).build(); + Table table2 = connection.table("two words") + .delimiters('`', '`') + .columnsToOrder(new Order[]{ Order.asc("primary key") - }); - Changes changes1 = new Changes(table1).setStartPointNow(); - Changes changes2 = new Changes(table2).setStartPointNow(); + }).build(); + Changes changes1 = connection.changes().tables(table1).build().setStartPointNow(); + Changes changes2 = connection.changes().tables(table2).build().setStartPointNow(); update(); changes1.setEndPointNow(); changes2.setEndPointNow(); diff --git a/src/test/java/org/assertj/db/database/h2/ReservedH2Database_JdbcUrl_DDD_Test.java b/src/test/java/org/assertj/db/database/h2/ReservedH2Database_JdbcUrl_DDD_Test.java index 0d668687..d5bb24cf 100644 --- a/src/test/java/org/assertj/db/database/h2/ReservedH2Database_JdbcUrl_DDD_Test.java +++ b/src/test/java/org/assertj/db/database/h2/ReservedH2Database_JdbcUrl_DDD_Test.java @@ -15,8 +15,8 @@ import static org.assertj.db.api.Assertions.assertThat; import org.assertj.db.common.NeedReload; +import org.assertj.db.type.AssertDbConnection; 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; @@ -30,20 +30,20 @@ */ public class ReservedH2Database_JdbcUrl_DDD_Test extends AbstractReservedH2Test { - private ConnectionProvider connectionProvider; + private AssertDbConnection connection; @Before public void init() { - connectionProvider = jdbcConnectionDDD; + connection = jdbcConnectionDDD; } @Test @NeedReload public void test_PrimaryKey_hasPksNames() { - 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(); + Table table1 = connection.table("group").delimiters('`', '`').build(); + Table table2 = connection.table("two words").delimiters('`', '`').build(); + Changes changes1 = connection.changes().tables(table1).build().setStartPointNow(); + Changes changes2 = connection.changes().tables(table2).build().setStartPointNow(); update(); changes1.setEndPointNow(); changes2.setEndPointNow(); @@ -57,10 +57,10 @@ public void test_PrimaryKey_hasPksNames() { @Test @NeedReload public void test_ColumnName_hasColumnName() { - 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(); + Table table1 = connection.table("group").delimiters('`', '`').build(); + Table table2 = connection.table("two words").delimiters('`', '`').build(); + Changes changes1 = connection.changes().tables(table1).build().setStartPointNow(); + Changes changes2 = connection.changes().tables(table2).build().setStartPointNow(); update(); changes1.setEndPointNow(); changes2.setEndPointNow(); @@ -99,16 +99,18 @@ public void test_ColumnName_hasColumnName() { @Test @NeedReload public void test_ColumnName_hasColumnName_with_columns_to_check() { - Table table1 = new Table(connectionProvider, "group", '`', '`') - .setColumnsToCheck(new String[]{ + Table table1 = connection.table("group") + .delimiters('`', '`') + .columnsToCheck(new String[]{ "read", "by", "select", "from" - }); - Table table2 = new Table(connectionProvider, "two words", '`', '`') - .setColumnsToCheck(new String[]{ + }).build(); + Table table2 = connection.table("two words") + .delimiters('`', '`') + .columnsToCheck(new String[]{ "primary key", "column name", "test%test" - }); - Changes changes1 = new Changes(table1).setStartPointNow(); - Changes changes2 = new Changes(table2).setStartPointNow(); + }).build(); + Changes changes1 = connection.changes().tables(table1).build().setStartPointNow(); + Changes changes2 = connection.changes().tables(table2).build().setStartPointNow(); update(); changes1.setEndPointNow(); changes2.setEndPointNow(); @@ -143,16 +145,18 @@ public void test_ColumnName_hasColumnName_with_columns_to_check() { @Test @NeedReload public void test_ColumnName_hasColumnName_with_columns_to_exclude() { - Table table1 = new Table(connectionProvider, "group", '`', '`') - .setColumnsToExclude(new String[]{ + Table table1 = connection.table("group") + .delimiters('`', '`') + .columnsToExclude(new String[]{ "read", "by", "from" - }); - Table table2 = new Table(connectionProvider, "two words", '`', '`') - .setColumnsToExclude(new String[]{ + }).build(); + Table table2 = connection.table("two words") + .delimiters('`', '`') + .columnsToExclude(new String[]{ "column name" - }); - Changes changes1 = new Changes(table1).setStartPointNow(); - Changes changes2 = new Changes(table2).setStartPointNow(); + }).build(); + Changes changes1 = connection.changes().tables(table1).build().setStartPointNow(); + Changes changes2 = connection.changes().tables(table2).build().setStartPointNow(); update(); changes1.setEndPointNow(); changes2.setEndPointNow(); @@ -183,16 +187,18 @@ public void test_ColumnName_hasColumnName_with_columns_to_exclude() { @Test @NeedReload public void test_ColumnName_hasColumnName_with_order() { - Table table1 = new Table(connectionProvider, "group", '`', '`') - .setColumnsToOrder(new Order[]{ + Table table1 = connection.table("group") + .delimiters('`', '`') + .columnsToOrder(new Order[]{ Order.asc("where") - }); - Table table2 = new Table(connectionProvider, "two words", '`', '`') - .setColumnsToOrder(new Order[]{ + }).build(); + Table table2 = connection.table("two words") + .delimiters('`', '`') + .columnsToOrder(new Order[]{ Order.asc("primary key") - }); - Changes changes1 = new Changes(table1).setStartPointNow(); - Changes changes2 = new Changes(table2).setStartPointNow(); + }).build(); + Changes changes1 = connection.changes().tables(table1).build().setStartPointNow(); + Changes changes2 = connection.changes().tables(table2).build().setStartPointNow(); update(); changes1.setEndPointNow(); changes2.setEndPointNow(); @@ -227,5 +233,4 @@ public void test_ColumnName_hasColumnName_with_order() { .column().hasColumnName("test%test") ; } - } diff --git a/src/test/java/org/assertj/db/database/h2/ReservedH2Database_JdbcUrl_NSNSNS_Test.java b/src/test/java/org/assertj/db/database/h2/ReservedH2Database_JdbcUrl_NSNSNS_Test.java index 05d3ddac..d27bbc09 100644 --- a/src/test/java/org/assertj/db/database/h2/ReservedH2Database_JdbcUrl_NSNSNS_Test.java +++ b/src/test/java/org/assertj/db/database/h2/ReservedH2Database_JdbcUrl_NSNSNS_Test.java @@ -15,8 +15,8 @@ import static org.assertj.db.api.Assertions.assertThat; import org.assertj.db.common.NeedReload; +import org.assertj.db.type.AssertDbConnection; 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; @@ -30,20 +30,20 @@ */ public class ReservedH2Database_JdbcUrl_NSNSNS_Test extends AbstractReservedH2Test { - private ConnectionProvider connectionProvider; + private AssertDbConnection connection; @Before public void init() { - connectionProvider = jdbcConnectionNSNSNS; + connection = jdbcConnectionNSNSNS; } @Test @NeedReload public void test_PrimaryKey_hasPksNames() { - 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(); + Table table1 = connection.table("GROUP").delimiters('`', '`').build(); + Table table2 = connection.table("TWO WORDS").delimiters('`', '`').build(); + Changes changes1 = connection.changes().tables(table1).build().setStartPointNow(); + Changes changes2 = connection.changes().tables(table2).build().setStartPointNow(); update(); changes1.setEndPointNow(); changes2.setEndPointNow(); @@ -57,10 +57,10 @@ public void test_PrimaryKey_hasPksNames() { @Test @NeedReload public void test_ColumnName_hasColumnName() { - 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(); + Table table1 = connection.table("GROUP").delimiters('`', '`').build(); + Table table2 = connection.table("TWO WORDS").delimiters('`', '`').build(); + Changes changes1 = connection.changes().tables(table1).build().setStartPointNow(); + Changes changes2 = connection.changes().tables(table2).build().setStartPointNow(); update(); changes1.setEndPointNow(); changes2.setEndPointNow(); @@ -99,16 +99,18 @@ public void test_ColumnName_hasColumnName() { @Test @NeedReload public void test_ColumnName_hasColumnName_with_columns_to_check() { - Table table1 = new Table(connectionProvider, "GROUP", '`', '`') - .setColumnsToCheck(new String[]{ + Table table1 = connection.table("GROUP") + .delimiters('`', '`') + .columnsToCheck(new String[]{ "READ", "BY", "SELECT", "FROM" - }); - Table table2 = new Table(connectionProvider, "TWO WORDS", '`', '`') - .setColumnsToCheck(new String[]{ + }).build(); + Table table2 = connection.table("TWO WORDS") + .delimiters('`', '`') + .columnsToCheck(new String[]{ "PRIMARY KEY", "COLUMN NAME", "TEST%TEST" - }); - Changes changes1 = new Changes(table1).setStartPointNow(); - Changes changes2 = new Changes(table2).setStartPointNow(); + }).build(); + Changes changes1 = connection.changes().tables(table1).build().setStartPointNow(); + Changes changes2 = connection.changes().tables(table2).build().setStartPointNow(); update(); changes1.setEndPointNow(); changes2.setEndPointNow(); @@ -143,16 +145,18 @@ public void test_ColumnName_hasColumnName_with_columns_to_check() { @Test @NeedReload public void test_ColumnName_hasColumnName_with_columns_to_exclude() { - Table table1 = new Table(connectionProvider, "GROUP", '`', '`') - .setColumnsToExclude(new String[]{ + Table table1 = connection.table("GROUP") + .delimiters('`', '`') + .columnsToExclude(new String[]{ "READ", "BY", "FROM" - }); - Table table2 = new Table(connectionProvider, "TWO WORDS", '`', '`') - .setColumnsToExclude(new String[]{ + }).build(); + Table table2 = connection.table("TWO WORDS") + .delimiters('`', '`') + .columnsToExclude(new String[]{ "COLUMN NAME" - }); - Changes changes1 = new Changes(table1).setStartPointNow(); - Changes changes2 = new Changes(table2).setStartPointNow(); + }).build(); + Changes changes1 = connection.changes().tables(table1).build().setStartPointNow(); + Changes changes2 = connection.changes().tables(table2).build().setStartPointNow(); update(); changes1.setEndPointNow(); changes2.setEndPointNow(); @@ -183,16 +187,18 @@ public void test_ColumnName_hasColumnName_with_columns_to_exclude() { @Test @NeedReload public void test_ColumnName_hasColumnName_with_order() { - Table table1 = new Table(connectionProvider, "GROUP", '`', '`') - .setColumnsToOrder(new Order[]{ + Table table1 = connection.table("GROUP") + .delimiters('`', '`') + .columnsToOrder(new Order[]{ Order.asc("WHERE") - }); - Table table2 = new Table(connectionProvider, "TWO WORDS", '`', '`') - .setColumnsToOrder(new Order[]{ + }).build(); + Table table2 = connection.table("TWO WORDS") + .delimiters('`', '`') + .columnsToOrder(new Order[]{ Order.asc("PRIMARY KEY") - }); - Changes changes1 = new Changes(table1).setStartPointNow(); - Changes changes2 = new Changes(table2).setStartPointNow(); + }).build(); + Changes changes1 = connection.changes().tables(table1).build().setStartPointNow(); + Changes changes2 = connection.changes().tables(table2).build().setStartPointNow(); update(); changes1.setEndPointNow(); changes2.setEndPointNow(); diff --git a/src/test/java/org/assertj/db/database/h2/ReservedH2Database_JdbcUrl_UIUIUI_Test.java b/src/test/java/org/assertj/db/database/h2/ReservedH2Database_JdbcUrl_UIUIUI_Test.java index cbec650a..1f6141fb 100644 --- a/src/test/java/org/assertj/db/database/h2/ReservedH2Database_JdbcUrl_UIUIUI_Test.java +++ b/src/test/java/org/assertj/db/database/h2/ReservedH2Database_JdbcUrl_UIUIUI_Test.java @@ -15,8 +15,8 @@ import static org.assertj.db.api.Assertions.assertThat; import org.assertj.db.common.NeedReload; +import org.assertj.db.type.AssertDbConnection; 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; @@ -30,20 +30,20 @@ */ public class ReservedH2Database_JdbcUrl_UIUIUI_Test extends AbstractReservedH2Test { - private ConnectionProvider connectionProvider; + private AssertDbConnection connection; @Before public void init() { - connectionProvider = jdbcConnectionUIUIUI; + connection = jdbcConnectionUIUIUI; } @Test @NeedReload public void test_PrimaryKey_hasPksNames() { - 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(); + Table table1 = connection.table("group").delimiters('`', '`').build(); + Table table2 = connection.table("two words").delimiters('`', '`').build(); + Changes changes1 = connection.changes().tables(table1).build().setStartPointNow(); + Changes changes2 = connection.changes().tables(table2).build().setStartPointNow(); update(); changes1.setEndPointNow(); changes2.setEndPointNow(); @@ -58,10 +58,10 @@ public void test_PrimaryKey_hasPksNames() { @Test @NeedReload public void test_ColumnName_hasColumnName() { - 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(); + Table table1 = connection.table("group").delimiters('`', '`').build(); + Table table2 = connection.table("two words").delimiters('`', '`').build(); + Changes changes1 = connection.changes().tables(table1).build().setStartPointNow(); + Changes changes2 = connection.changes().tables(table2).build().setStartPointNow(); update(); changes1.setEndPointNow(); changes2.setEndPointNow(); @@ -100,16 +100,18 @@ public void test_ColumnName_hasColumnName() { @Test @NeedReload public void test_ColumnName_hasColumnName_with_columns_to_check() { - Table table1 = new Table(connectionProvider, "group", '`', '`') - .setColumnsToCheck(new String[]{ + Table table1 = connection.table("group") + .delimiters('`', '`') + .columnsToCheck(new String[]{ "read", "by", "select", "from" - }); - Table table2 = new Table(connectionProvider, "two words", '`', '`') - .setColumnsToCheck(new String[]{ + }).build(); + Table table2 = connection.table("two words") + .delimiters('`', '`') + .columnsToCheck(new String[]{ "primary key", "column name", "test%test" - }); - Changes changes1 = new Changes(table1).setStartPointNow(); - Changes changes2 = new Changes(table2).setStartPointNow(); + }).build(); + Changes changes1 = connection.changes().tables(table1).build().setStartPointNow(); + Changes changes2 = connection.changes().tables(table2).build().setStartPointNow(); update(); changes1.setEndPointNow(); changes2.setEndPointNow(); @@ -144,16 +146,18 @@ public void test_ColumnName_hasColumnName_with_columns_to_check() { @Test @NeedReload public void test_ColumnName_hasColumnName_with_columns_to_exclude() { - Table table1 = new Table(connectionProvider, "group", '`', '`') - .setColumnsToExclude(new String[]{ + Table table1 = connection.table("group") + .delimiters('`', '`') + .columnsToExclude(new String[]{ "read", "by", "from" - }); - Table table2 = new Table(connectionProvider, "two words", '`', '`') - .setColumnsToExclude(new String[]{ + }).build(); + Table table2 = connection.table("two words") + .delimiters('`', '`') + .columnsToExclude(new String[]{ "column name" - }); - Changes changes1 = new Changes(table1).setStartPointNow(); - Changes changes2 = new Changes(table2).setStartPointNow(); + }).build(); + Changes changes1 = connection.changes().tables(table1).build().setStartPointNow(); + Changes changes2 = connection.changes().tables(table2).build().setStartPointNow(); update(); changes1.setEndPointNow(); changes2.setEndPointNow(); @@ -184,16 +188,18 @@ public void test_ColumnName_hasColumnName_with_columns_to_exclude() { @Test @NeedReload public void test_ColumnName_hasColumnName_with_order() { - Table table1 = new Table(connectionProvider, "group", '`', '`') - .setColumnsToOrder(new Order[]{ + Table table1 = connection.table("group") + .delimiters('`', '`') + .columnsToOrder(new Order[]{ Order.asc("where") - }); - Table table2 = new Table(connectionProvider, "two words", '`', '`') - .setColumnsToOrder(new Order[]{ + }).build(); + Table table2 = connection.table("two words") + .delimiters('`', '`') + .columnsToOrder(new Order[]{ Order.asc("primary key") - }); - Changes changes1 = new Changes(table1).setStartPointNow(); - Changes changes2 = new Changes(table2).setStartPointNow(); + }).build(); + Changes changes1 = connection.changes().tables(table1).build().setStartPointNow(); + Changes changes2 = connection.changes().tables(table2).build().setStartPointNow(); update(); changes1.setEndPointNow(); changes2.setEndPointNow(); 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 1af758f1..31f26fd7 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.ConnectionProvider; -import org.assertj.db.type.ConnectionProviderFactory; +import org.assertj.db.type.AssertDbConnection; +import org.assertj.db.type.AssertDbConnectionFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.test.context.ContextConfiguration; @@ -78,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 ConnectionProvider jdbcConnectionUIUIUI = ConnectionProviderFactory.of("jdbc:hsqldb:mem:testHsqldb", "SA", "").letterCase( + protected final AssertDbConnection jdbcConnectionUIUIUI = AssertDbConnectionFactory.of("jdbc:hsqldb:mem:testHsqldb", "SA", "").letterCase( letterCaseUI, letterCaseUI, letterCaseUI).create(); - protected ConnectionProvider dsConnectionUIUIUI; - protected ConnectionProvider dsConnectionNSNSNS; + protected AssertDbConnection dsConnectionUIUIUI; + protected AssertDbConnection dsConnectionNSNSNS; protected DbSetup getDbSetup() { return DB_SETUP; @@ -95,8 +95,8 @@ protected DbSetupTracker getDbSetupTracker() { @Autowired protected void setDataSource(DataSource dataSource) { - this.dsConnectionUIUIUI = ConnectionProviderFactory.of(dataSource).letterCase(letterCaseUI, letterCaseUI, letterCaseUI).create(); - this.dsConnectionNSNSNS = ConnectionProviderFactory.of(dataSource).letterCase(letterCaseNS, letterCaseNS, letterCaseNS).create(); + this.dsConnectionUIUIUI = AssertDbConnectionFactory.of(dataSource).letterCase(letterCaseUI, letterCaseUI, letterCaseUI).create(); + this.dsConnectionNSNSNS = AssertDbConnectionFactory.of(dataSource).letterCase(letterCaseNS, letterCaseNS, letterCaseNS).create(); } protected void update() { diff --git a/src/test/java/org/assertj/db/database/hsqldb/HsqldbDatabase_JdbcUrl_UIUIUI_Test.java b/src/test/java/org/assertj/db/database/hsqldb/HsqldbDatabase_JdbcUrl_UIUIUI_Test.java index d889a8f6..cf5a3be5 100644 --- a/src/test/java/org/assertj/db/database/hsqldb/HsqldbDatabase_JdbcUrl_UIUIUI_Test.java +++ b/src/test/java/org/assertj/db/database/hsqldb/HsqldbDatabase_JdbcUrl_UIUIUI_Test.java @@ -22,8 +22,8 @@ import java.util.Locale; import org.assertj.db.common.NeedReload; +import org.assertj.db.type.AssertDbConnection; 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.Table; @@ -40,18 +40,18 @@ */ public class HsqldbDatabase_JdbcUrl_UIUIUI_Test extends AbstractHsqldbTest { - private ConnectionProvider connectionProvider = jdbcConnectionUIUIUI; + private AssertDbConnection connection = jdbcConnectionUIUIUI; @Before public void init() { - connectionProvider = jdbcConnectionUIUIUI; + connection = jdbcConnectionUIUIUI; } @Test @NeedReload public void test_PrimaryKey_hasPksNames() { - Table table = new Table(connectionProvider, "test"); - Changes changes = new Changes(table).setStartPointNow(); + Table table = connection.table("test").build(); + Changes changes = connection.changes().tables(table).build().setStartPointNow(); update(); changes.setEndPointNow(); @@ -62,8 +62,8 @@ public void test_PrimaryKey_hasPksNames() { @Test @NeedReload public void test_ColumnName_hasColumnName() { - Table table = new Table(connectionProvider, "test"); - Changes changes = new Changes(table).setStartPointNow(); + Table table = connection.table("test").build(); + Changes changes = connection.changes().tables(table).build().setStartPointNow(); update(); changes.setEndPointNow(); @@ -129,8 +129,8 @@ public void test_ColumnName_hasColumnName() { @Test @NeedReload public void test_ColumnClass_isOfClass() { - Table table = new Table(connectionProvider, "test"); - Changes changes = new Changes(table).setStartPointNow(); + Table table = connection.table("test").build(); + Changes changes = connection.changes().tables(table).build().setStartPointNow(); update(); changes.setEndPointNow(); @@ -196,8 +196,8 @@ public void test_ColumnClass_isOfClass() { @Test @NeedReload public void test_ColumnEquality_hasValues() { - Table table = new Table(connectionProvider, "test"); - Changes changes = new Changes(table).setStartPointNow(); + Table table = connection.table("test").build(); + Changes changes = connection.changes().tables(table).build().setStartPointNow(); update(); changes.setEndPointNow(); @@ -263,8 +263,8 @@ public void test_ColumnEquality_hasValues() { @Test @NeedReload public void test_ColumnEquality_containsValues() { - Table table = new Table(connectionProvider, "test"); - Changes changes = new Changes(table).setStartPointNow(); + Table table = connection.table("test").build(); + Changes changes = connection.changes().tables(table).build().setStartPointNow(); update(); changes.setEndPointNow(); @@ -301,8 +301,8 @@ public void test_ColumnEquality_containsValues() { @Test @NeedReload public void test_ColumnType_isOfType() { - Table table = new Table(connectionProvider, "test"); - Changes changes = new Changes(table).setStartPointNow(); + Table table = connection.table("test").build(); + Changes changes = connection.changes().tables(table).build().setStartPointNow(); update(); changes.setEndPointNow(); @@ -368,8 +368,8 @@ public void test_ColumnType_isOfType() { @Test @NeedReload public void test_ColumnOfChangeEquality_hasValues() { - Table table = new Table(connectionProvider, "test"); - Changes changes = new Changes(table).setStartPointNow(); + Table table = connection.table("test").build(); + Changes changes = connection.changes().tables(table).build().setStartPointNow(); update(); changes.setEndPointNow(); @@ -442,8 +442,8 @@ public void test_ColumnOfChangeEquality_hasValues() { @Test @NeedReload public void test_RowEquality_hasValues() { - Table table = new Table(connectionProvider, "test"); - Changes changes = new Changes(table).setStartPointNow(); + Table table = connection.table("test").build(); + Changes changes = connection.changes().tables(table).build().setStartPointNow(); update(); changes.setEndPointNow(); @@ -509,8 +509,8 @@ public void test_RowEquality_hasValues() { @Test @NeedReload public void test_ValueClass_isOfClass() { - Table table = new Table(connectionProvider, "test"); - Changes changes = new Changes(table).setStartPointNow(); + Table table = connection.table("test").build(); + Changes changes = connection.changes().tables(table).build().setStartPointNow(); update(); changes.setEndPointNow(); @@ -576,8 +576,8 @@ public void test_ValueClass_isOfClass() { @Test @NeedReload public void test_ValueEquality_isEqualTo() { - Table table = new Table(connectionProvider, "test"); - Changes changes = new Changes(table).setStartPointNow(); + Table table = connection.table("test").build(); + Changes changes = connection.changes().tables(table).build().setStartPointNow(); update(); changes.setEndPointNow(); @@ -643,8 +643,8 @@ public void test_ValueEquality_isEqualTo() { @Test @NeedReload public void test_ValueNonEquality_isNotEqualTo() { - Table table = new Table(connectionProvider, "test"); - Changes changes = new Changes(table).setStartPointNow(); + Table table = connection.table("test").build(); + Changes changes = connection.changes().tables(table).build().setStartPointNow(); update(); changes.setEndPointNow(); @@ -710,8 +710,8 @@ public void test_ValueNonEquality_isNotEqualTo() { @Test @NeedReload public void test_ValueType_isOfType() { - Table table = new Table(connectionProvider, "test"); - Changes changes = new Changes(table).setStartPointNow(); + Table table = connection.table("test").build(); + Changes changes = connection.changes().tables(table).build().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 e8d9573f..3f93fd52 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.ConnectionProvider; -import org.assertj.db.type.ConnectionProviderFactory; +import org.assertj.db.type.AssertDbConnection; +import org.assertj.db.type.AssertDbConnectionFactory; import org.assertj.db.type.lettercase.LetterCase; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.test.context.ContextConfiguration; @@ -76,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 ConnectionProvider jdbcConnectionDDD = ConnectionProviderFactory.of("jdbc:sqlite:target/testDerby.db", "", "").letterCase( + protected final AssertDbConnection jdbcConnectionDDD = AssertDbConnectionFactory.of("jdbc:sqlite:target/testDerby.db", "", "").letterCase( LetterCase.TABLE_DEFAULT, LetterCase.COLUMN_DEFAULT, LetterCase.PRIMARY_KEY_DEFAULT).create(); - protected final ConnectionProvider jdbcConnectionUIUIUI = ConnectionProviderFactory.of("jdbc:sqlite:target/testDerby.db", "", "").letterCase( + protected final AssertDbConnection jdbcConnectionUIUIUI = AssertDbConnectionFactory.of("jdbc:sqlite:target/testDerby.db", "", "").letterCase( letterCaseUI, letterCaseUI, letterCaseUI).create(); - protected final ConnectionProvider jdbcConnectionNSNSNS = ConnectionProviderFactory.of("jdbc:sqlite:target/testDerby.db", "", "").letterCase( + protected final AssertDbConnection jdbcConnectionNSNSNS = AssertDbConnectionFactory.of("jdbc:sqlite:target/testDerby.db", "", "").letterCase( letterCaseNS, letterCaseNS, letterCaseNS).create(); protected DataSource dataSource; - protected ConnectionProvider dsConnectionDDD; - protected ConnectionProvider dsConnectionUIUIUI; - protected ConnectionProvider dsConnectionNSNSNS; + protected AssertDbConnection dsConnectionDDD; + protected AssertDbConnection dsConnectionUIUIUI; + protected AssertDbConnection dsConnectionNSNSNS; protected DbSetup getDbSetup() { return DB_SETUP; @@ -104,9 +104,9 @@ protected DbSetupTracker getDbSetupTracker() { @Autowired protected void setDataSource(DataSource dataSource) { this.dataSource = dataSource; - 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(); + this.dsConnectionDDD = AssertDbConnectionFactory.of(dataSource).letterCase(LetterCase.TABLE_DEFAULT, LetterCase.COLUMN_DEFAULT, LetterCase.PRIMARY_KEY_DEFAULT).create(); + this.dsConnectionUIUIUI = AssertDbConnectionFactory.of(dataSource).letterCase(letterCaseUI, letterCaseUI, letterCaseUI).create(); + this.dsConnectionNSNSNS = AssertDbConnectionFactory.of(dataSource).letterCase(letterCaseNS, letterCaseNS, letterCaseNS).create(); } protected void update() { 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 be3b89d1..fcad6b51 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 @@ -21,8 +21,8 @@ import org.assertj.core.api.Assertions; import org.assertj.db.common.NeedReload; import org.assertj.db.output.Outputs; +import org.assertj.db.type.AssertDbConnection; 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; @@ -37,18 +37,18 @@ */ public class SqliteDatabase_DataSource_DDD_Test extends AbstractSqliteTest { - private ConnectionProvider connectionProvider; + private AssertDbConnection connection; @Before public void init() { - connectionProvider = dsConnectionDDD; + connection = dsConnectionDDD; } @Test @NeedReload public void test_Outputs_output() { - Table table = new Table(connectionProvider, "test", null, new String[]{"var20"}); - Changes changes = new Changes(table).setStartPointNow(); + Table table = connection.table("test").columnsToExclude(new String[]{"var20"}).build(); + Changes changes = connection.changes().tables(table).build().setStartPointNow(); update(); changes.setEndPointNow(); @@ -76,7 +76,7 @@ public void test_Outputs_output() { .column().toStream(byteArrayOutputStream9) .valueAtEndPoint().toStream(byteArrayOutputStream10); - Assertions.assertThat(byteArrayOutputStream0.toString()).isEqualTo(String.format("[teSt table]%n" + Assertions.assertThat(byteArrayOutputStream0).hasToString(String.format("[teSt table]%n" + "|-----------|---------|-----------|-----------|-----------|-----------|-----------|------------|-----------|-----------|-----------|-----------|------------|------------|------------|------------|------------|------------|------------|-----------------------|------------|%n" + "| | | * | | | | | | | | | | | | | | | | | | |%n" + "| | PRIMARY | VAR1 | VAR2 | VAR3 | VAR4 | VAR5 | VAR6 | VAR7 | VAR8 | VAR9 | VAR10 | VAR11 | VAR12 | VAR13 | VAR14 | VAR15 | VAR16 | VAR17 | VAR18 | VAR19 |%n" @@ -85,21 +85,21 @@ public void test_Outputs_output() { + "|-----------|---------|-----------|-----------|-----------|-----------|-----------|------------|-----------|-----------|-----------|-----------|------------|------------|------------|------------|------------|------------|------------|-----------------------|------------|%n" + "| Index : 0 | 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(byteArrayOutputStream1.toString()).isEqualTo(String.format("[Column at index 0 (column name : VAR1) of teSt table]%n" + Assertions.assertThat(byteArrayOutputStream1).hasToString(String.format("[Column at index 0 (column name : VAR1) of teSt table]%n" + "|-----------|----------|%n" + "| | VAR1 |%n" + "| | (NUMBER) |%n" + "|-----------|----------|%n" + "| Index : 0 | 1 |%n" + "|-----------|----------|%n")); - Assertions.assertThat(byteArrayOutputStream2.toString()).isEqualTo(String.format("[Value at index 0 of Column at index 0 (column name : VAR1) of teSt table]%n" + Assertions.assertThat(byteArrayOutputStream2).hasToString(String.format("[Value at index 0 of Column at index 0 (column name : VAR1) of teSt table]%n" + "|----------|%n" + "| VAR1 |%n" + "| (NUMBER) |%n" + "|----------|%n" + "| 1 |%n" + "|----------|%n")); - Assertions.assertThat(byteArrayOutputStream3.toString()).isEqualTo(String.format("[Row at index 0 of teSt table]%n" + Assertions.assertThat(byteArrayOutputStream3).hasToString(String.format("[Row at index 0 of teSt table]%n" + "|---------|-----------|-----------|-----------|-----------|-----------|------------|-----------|-----------|-----------|-----------|------------|------------|------------|------------|------------|------------|------------|-----------------------|------------|%n" + "| | * | | | | | | | | | | | | | | | | | | |%n" + "| PRIMARY | VAR1 | VAR2 | VAR3 | VAR4 | VAR5 | VAR6 | VAR7 | VAR8 | VAR9 | VAR10 | VAR11 | VAR12 | VAR13 | VAR14 | VAR15 | VAR16 | VAR17 | VAR18 | VAR19 |%n" @@ -108,14 +108,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(byteArrayOutputStream4.toString()).isEqualTo(String.format("[Value at index 0 (column name : VAR1) of Row at index 0 of teSt table]%n" + Assertions.assertThat(byteArrayOutputStream4).hasToString(String.format("[Value at index 0 (column name : VAR1) of Row at index 0 of teSt table]%n" + "|----------|%n" + "| VAR1 |%n" + "| (NUMBER) |%n" + "|----------|%n" + "| 1 |%n" + "|----------|%n")); - Assertions.assertThat(byteArrayOutputStream5.toString()).isEqualTo(String.format("[Changes on teSt table of 'data source']%n" + Assertions.assertThat(byteArrayOutputStream5).hasToString(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" @@ -126,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 'data source']%n" + Assertions.assertThat(byteArrayOutputStream6).hasToString(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" @@ -137,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 'data source']%n" + Assertions.assertThat(byteArrayOutputStream7).hasToString(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" @@ -146,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 'data source']%n" + Assertions.assertThat(byteArrayOutputStream8).hasToString(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 'data source']%n" + Assertions.assertThat(byteArrayOutputStream9).hasToString(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" @@ -162,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 'data source']%n" + Assertions.assertThat(byteArrayOutputStream10).hasToString(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" @@ -174,8 +174,8 @@ public void test_Outputs_output() { @Test @NeedReload public void test_PrimaryKey_hasPksNames() { - Table table = new Table(connectionProvider, "test"); - Changes changes = new Changes(table).setStartPointNow(); + Table table = connection.table("test").build(); + Changes changes = connection.changes().tables(table).build().setStartPointNow(); update(); changes.setEndPointNow(); @@ -186,8 +186,8 @@ public void test_PrimaryKey_hasPksNames() { @Test @NeedReload public void test_ColumnName_hasColumnName() { - Table table = new Table(connectionProvider, "test"); - Changes changes = new Changes(table).setStartPointNow(); + Table table = connection.table("test").build(); + Changes changes = connection.changes().tables(table).build().setStartPointNow(); update(); changes.setEndPointNow(); @@ -241,8 +241,8 @@ public void test_ColumnName_hasColumnName() { @Test @NeedReload public void test_ColumnClass_isOfClass() { - Table table = new Table(connectionProvider, "test"); - Changes changes = new Changes(table).setStartPointNow(); + Table table = connection.table("test").build(); + Changes changes = connection.changes().tables(table).build().setStartPointNow(); update(); changes.setEndPointNow(); @@ -296,8 +296,8 @@ public void test_ColumnClass_isOfClass() { @Test @NeedReload public void test_ColumnEquality_hasValues() { - Table table = new Table(connectionProvider, "test", null, new String[]{"var20"}); - Changes changes = new Changes(table).setStartPointNow(); + Table table = connection.table("test").columnsToExclude(new String[]{"var20"}).build(); + Changes changes = connection.changes().tables(table).build().setStartPointNow(); update(); changes.setEndPointNow(); @@ -348,8 +348,8 @@ public void test_ColumnEquality_hasValues() { @Test @NeedReload public void test_ColumnEquality_containsValues() { - Table table = new Table(connectionProvider, "test", null, new String[]{"var20"}); - Changes changes = new Changes(table).setStartPointNow(); + Table table = connection.table("test").columnsToExclude(new String[]{"var20"}).build(); + Changes changes = connection.changes().tables(table).build().setStartPointNow(); update(); changes.setEndPointNow(); @@ -378,8 +378,8 @@ public void test_ColumnEquality_containsValues() { @Test @NeedReload public void test_ColumnType_isOfType() { - Table table = new Table(connectionProvider, "test"); - Changes changes = new Changes(table).setStartPointNow(); + Table table = connection.table("test").build(); + Changes changes = connection.changes().tables(table).build().setStartPointNow(); update(); changes.setEndPointNow(); @@ -432,8 +432,8 @@ public void test_ColumnType_isOfType() { @Test @NeedReload public void test_ColumnOfChangeEquality_hasValues() { - Table table = new Table(connectionProvider, "test", null, new String[]{"var20"}); - Changes changes = new Changes(table).setStartPointNow(); + Table table = connection.table("test").columnsToExclude(new String[]{"var20"}).build(); + Changes changes = connection.changes().tables(table).build().setStartPointNow(); update(); changes.setEndPointNow(); @@ -485,8 +485,8 @@ public void test_ColumnOfChangeEquality_hasValues() { @Test @NeedReload public void test_RowEquality_hasValues() { - Table table = new Table(connectionProvider, "test", null, new String[]{"var20"}); - Changes changes = new Changes(table).setStartPointNow(); + Table table = connection.table("test").columnsToExclude(new String[]{"var20"}).build(); + Changes changes = connection.changes().tables(table).build().setStartPointNow(); update(); changes.setEndPointNow(); @@ -508,8 +508,8 @@ public void test_RowEquality_hasValues() { @Test @NeedReload public void test_ValueClass_isOfClass() { - Table table = new Table(connectionProvider, "test"); - Changes changes = new Changes(table).setStartPointNow(); + Table table = connection.table("test").build(); + Changes changes = connection.changes().tables(table).build().setStartPointNow(); update(); changes.setEndPointNow(); @@ -563,8 +563,8 @@ public void test_ValueClass_isOfClass() { @Test @NeedReload public void test_ValueEquality_isEqualTo() { - Table table = new Table(connectionProvider, "test"); - Changes changes = new Changes(table).setStartPointNow(); + Table table = connection.table("test").build(); + Changes changes = connection.changes().tables(table).build().setStartPointNow(); update(); changes.setEndPointNow(); @@ -616,8 +616,8 @@ public void test_ValueEquality_isEqualTo() { @Test @NeedReload public void test_ValueNonEquality_isNotEqualTo() { - Table table = new Table(connectionProvider, "test"); - Changes changes = new Changes(table).setStartPointNow(); + Table table = connection.table("test").build(); + Changes changes = connection.changes().tables(table).build().setStartPointNow(); update(); changes.setEndPointNow(); @@ -669,8 +669,8 @@ public void test_ValueNonEquality_isNotEqualTo() { @Test @NeedReload public void test_ValueType_isOfType() { - Table table = new Table(connectionProvider, "test"); - Changes changes = new Changes(table).setStartPointNow(); + Table table = connection.table("test").build(); + Changes changes = connection.changes().tables(table).build().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 4b6a1560..164f9db3 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 @@ -22,8 +22,8 @@ import org.assertj.db.common.NeedReload; import org.assertj.db.exception.AssertJDBException; import org.assertj.db.output.Outputs; +import org.assertj.db.type.AssertDbConnection; 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; @@ -36,18 +36,18 @@ */ public class SqliteDatabase_DataSource_NSNSNS_Test extends AbstractSqliteTest { - private ConnectionProvider connectionProvider; + private AssertDbConnection connection; @Before public void init() { - connectionProvider = dsConnectionNSNSNS; + connection = dsConnectionNSNSNS; } @Test @NeedReload public void test_Outputs_output() { - Table table = new Table(connectionProvider, "test", null, new String[]{"var20"}); - Changes changes = new Changes(table).setStartPointNow(); + Table table = connection.table("test").columnsToExclude(new String[]{"var20"}).build(); + Changes changes = connection.changes().tables(table).build().setStartPointNow(); update(); changes.setEndPointNow(); @@ -74,7 +74,7 @@ public void test_Outputs_output() { .column().toStream(byteArrayOutputStream9) .valueAtEndPoint().toStream(byteArrayOutputStream10); - Assertions.assertThat(byteArrayOutputStream0.toString()).isEqualTo(String.format("[test table]%n" + Assertions.assertThat(byteArrayOutputStream0).hasToString(String.format("[test table]%n" + "|-----------|---------|-----------|-----------|-----------|-----------|-----------|------------|-----------|-----------|-----------|-----------|------------|------------|------------|------------|------------|------------|------------|-----------------------|------------|%n" + "| | | * | | | | | | | | | | | | | | | | | | |%n" + "| | PRIMARY | Var1 | vAr2 | vaR3 | var4 | var5 | var6 | var7 | var8 | var9 | var10 | var11 | var12 | var13 | var14 | var15 | var16 | var17 | var18 | var19 |%n" @@ -83,21 +83,21 @@ public void test_Outputs_output() { + "|-----------|---------|-----------|-----------|-----------|-----------|-----------|------------|-----------|-----------|-----------|-----------|------------|------------|------------|------------|------------|------------|------------|-----------------------|------------|%n" + "| Index : 0 | 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(byteArrayOutputStream1.toString()).isEqualTo(String.format("[Column at index 0 (column name : Var1) of test table]%n" + Assertions.assertThat(byteArrayOutputStream1).hasToString(String.format("[Column at index 0 (column name : Var1) of test table]%n" + "|-----------|----------|%n" + "| | Var1 |%n" + "| | (NUMBER) |%n" + "|-----------|----------|%n" + "| Index : 0 | 1 |%n" + "|-----------|----------|%n")); - Assertions.assertThat(byteArrayOutputStream2.toString()).isEqualTo(String.format("[Value at index 0 of Column at index 0 (column name : Var1) of test table]%n" + Assertions.assertThat(byteArrayOutputStream2).hasToString(String.format("[Value at index 0 of Column at index 0 (column name : Var1) of test table]%n" + "|----------|%n" + "| Var1 |%n" + "| (NUMBER) |%n" + "|----------|%n" + "| 1 |%n" + "|----------|%n")); - Assertions.assertThat(byteArrayOutputStream3.toString()).isEqualTo(String.format("[Row at index 0 of test table]%n" + Assertions.assertThat(byteArrayOutputStream3).hasToString(String.format("[Row at index 0 of test table]%n" + "|---------|-----------|-----------|-----------|-----------|-----------|------------|-----------|-----------|-----------|-----------|------------|------------|------------|------------|------------|------------|------------|-----------------------|------------|%n" + "| | * | | | | | | | | | | | | | | | | | | |%n" + "| PRIMARY | Var1 | vAr2 | vaR3 | var4 | var5 | var6 | var7 | var8 | var9 | var10 | var11 | var12 | var13 | var14 | var15 | var16 | var17 | var18 | var19 |%n" @@ -106,14 +106,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(byteArrayOutputStream4.toString()).isEqualTo(String.format("[Value at index 0 (column name : Var1) of Row at index 0 of test table]%n" + Assertions.assertThat(byteArrayOutputStream4).hasToString(String.format("[Value at index 0 (column name : Var1) of Row at index 0 of test table]%n" + "|----------|%n" + "| Var1 |%n" + "| (NUMBER) |%n" + "|----------|%n" + "| 1 |%n" + "|----------|%n")); - Assertions.assertThat(byteArrayOutputStream5.toString()).isEqualTo(String.format("[Changes on test table of 'data source']%n" + Assertions.assertThat(byteArrayOutputStream5).hasToString(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" @@ -124,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 'data source']%n" + Assertions.assertThat(byteArrayOutputStream6).hasToString(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" @@ -135,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 'data source']%n" + Assertions.assertThat(byteArrayOutputStream7).hasToString(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" @@ -144,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 'data source']%n" + Assertions.assertThat(byteArrayOutputStream8).hasToString(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 'data source']%n" + Assertions.assertThat(byteArrayOutputStream9).hasToString(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" @@ -160,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 'data source']%n" + Assertions.assertThat(byteArrayOutputStream10).hasToString(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" @@ -172,9 +172,9 @@ public void test_Outputs_output() { @Test @NeedReload public void should_fail_because_primary_key_is_different() { - Table table = new Table(connectionProvider, "test"); - Changes changes = new Changes(table).setStartPointNow(); - Changes changes2 = new Changes(connectionProvider).setStartPointNow(); + Table table = connection.table("test").build(); + Changes changes = connection.changes().tables(table).build().setStartPointNow(); + Changes changes2 = connection.changes().build().setStartPointNow(); update(); changes.setEndPointNow(); changes2.setEndPointNow(); @@ -205,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(connectionProvider, "test"); - Changes changes = new Changes(table).setStartPointNow(); - Changes changes2 = new Changes(connectionProvider).setStartPointNow(); + Table table = connection.table("test").build(); + Changes changes = connection.changes().tables(table).build().setStartPointNow(); + Changes changes2 = connection.changes().build().setStartPointNow(); update(); changes.setEndPointNow(); changes2.setEndPointNow(); @@ -279,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(connectionProvider, "test"); - Changes changes = new Changes(table).setStartPointNow(); - Changes changes2 = new Changes(connectionProvider).setStartPointNow(); + Table table = connection.table("test").build(); + Changes changes = connection.changes().tables(table).build().setStartPointNow(); + Changes changes2 = connection.changes().build().setStartPointNow(); update(); changes.setEndPointNow(); changes2.setEndPointNow(); @@ -341,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(connectionProvider, "test"); - Changes changes = new Changes(table).setStartPointNow(); - Changes changes2 = new Changes(connectionProvider).setStartPointNow(); + Table table = connection.table("test").build(); + Changes changes = connection.changes().tables(table).build().setStartPointNow(); + Changes changes2 = connection.changes().build().setStartPointNow(); update(); changes.setEndPointNow(); changes2.setEndPointNow(); @@ -373,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(connectionProvider, "test"); - Changes changes = new Changes(table).setStartPointNow(); - Changes changes2 = new Changes(connectionProvider).setStartPointNow(); + Table table = connection.table("test").build(); + Changes changes = connection.changes().tables(table).build().setStartPointNow(); + Changes changes2 = connection.changes().build().setStartPointNow(); update(); changes.setEndPointNow(); changes2.setEndPointNow(); @@ -422,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(connectionProvider, "test"); - Changes changes = new Changes(table).setStartPointNow(); - Changes changes2 = new Changes(connectionProvider).setStartPointNow(); + Table table = connection.table("test").build(); + Changes changes = connection.changes().tables(table).build().setStartPointNow(); + Changes changes2 = connection.changes().build().setStartPointNow(); update(); changes.setEndPointNow(); changes2.setEndPointNow(); @@ -438,9 +438,9 @@ public void test_ColumnName_hasColumnName() { @Test @NeedReload public void test_ColumnClass_isOfClass() { - Table table = new Table(connectionProvider, "test"); - Changes changes = new Changes(table).setStartPointNow(); - Changes changes2 = new Changes(connectionProvider).setStartPointNow(); + Table table = connection.table("test").build(); + Changes changes = connection.changes().tables(table).build().setStartPointNow(); + Changes changes2 = connection.changes().build().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 9101ad0e..a7a1ef7b 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 @@ -21,8 +21,8 @@ import org.assertj.core.api.Assertions; import org.assertj.db.common.NeedReload; import org.assertj.db.output.Outputs; +import org.assertj.db.type.AssertDbConnection; 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; @@ -37,18 +37,18 @@ */ public class SqliteDatabase_DataSource_UIUIUI_Test extends AbstractSqliteTest { - private ConnectionProvider connectionProvider; + private AssertDbConnection connection; @Before public void init() { - connectionProvider = dsConnectionUIUIUI; + connection = dsConnectionUIUIUI; } @Test @NeedReload public void test_Outputs_output() { - Table table = new Table(connectionProvider, "test", null, new String[]{"var20"}); - Changes changes = new Changes(table).setStartPointNow(); + Table table = connection.table("test").columnsToExclude(new String[]{"var20"}).build(); + Changes changes = connection.changes().tables(table).build().setStartPointNow(); update(); changes.setEndPointNow(); @@ -76,7 +76,7 @@ public void test_Outputs_output() { .column().toStream(byteArrayOutputStream9) .valueAtEndPoint().toStream(byteArrayOutputStream10); - Assertions.assertThat(byteArrayOutputStream0.toString()).isEqualTo(String.format("[TEST table]%n" + Assertions.assertThat(byteArrayOutputStream0).hasToString(String.format("[TEST table]%n" + "|-----------|---------|-----------|-----------|-----------|-----------|-----------|------------|-----------|-----------|-----------|-----------|------------|------------|------------|------------|------------|------------|------------|-----------------------|------------|%n" + "| | | * | | | | | | | | | | | | | | | | | | |%n" + "| | PRIMARY | VAR1 | VAR2 | VAR3 | VAR4 | VAR5 | VAR6 | VAR7 | VAR8 | VAR9 | VAR10 | VAR11 | VAR12 | VAR13 | VAR14 | VAR15 | VAR16 | VAR17 | VAR18 | VAR19 |%n" @@ -85,21 +85,21 @@ public void test_Outputs_output() { + "|-----------|---------|-----------|-----------|-----------|-----------|-----------|------------|-----------|-----------|-----------|-----------|------------|------------|------------|------------|------------|------------|------------|-----------------------|------------|%n" + "| Index : 0 | 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(byteArrayOutputStream1.toString()).isEqualTo(String.format("[Column at index 0 (column name : VAR1) of TEST table]%n" + Assertions.assertThat(byteArrayOutputStream1).hasToString(String.format("[Column at index 0 (column name : VAR1) of TEST table]%n" + "|-----------|----------|%n" + "| | VAR1 |%n" + "| | (NUMBER) |%n" + "|-----------|----------|%n" + "| Index : 0 | 1 |%n" + "|-----------|----------|%n")); - Assertions.assertThat(byteArrayOutputStream2.toString()).isEqualTo(String.format("[Value at index 0 of Column at index 0 (column name : VAR1) of TEST table]%n" + Assertions.assertThat(byteArrayOutputStream2).hasToString(String.format("[Value at index 0 of Column at index 0 (column name : VAR1) of TEST table]%n" + "|----------|%n" + "| VAR1 |%n" + "| (NUMBER) |%n" + "|----------|%n" + "| 1 |%n" + "|----------|%n")); - Assertions.assertThat(byteArrayOutputStream3.toString()).isEqualTo(String.format("[Row at index 0 of TEST table]%n" + Assertions.assertThat(byteArrayOutputStream3).hasToString(String.format("[Row at index 0 of TEST table]%n" + "|---------|-----------|-----------|-----------|-----------|-----------|------------|-----------|-----------|-----------|-----------|------------|------------|------------|------------|------------|------------|------------|-----------------------|------------|%n" + "| | * | | | | | | | | | | | | | | | | | | |%n" + "| PRIMARY | VAR1 | VAR2 | VAR3 | VAR4 | VAR5 | VAR6 | VAR7 | VAR8 | VAR9 | VAR10 | VAR11 | VAR12 | VAR13 | VAR14 | VAR15 | VAR16 | VAR17 | VAR18 | VAR19 |%n" @@ -108,14 +108,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(byteArrayOutputStream4.toString()).isEqualTo(String.format("[Value at index 0 (column name : VAR1) of Row at index 0 of TEST table]%n" + Assertions.assertThat(byteArrayOutputStream4).hasToString(String.format("[Value at index 0 (column name : VAR1) of Row at index 0 of TEST table]%n" + "|----------|%n" + "| VAR1 |%n" + "| (NUMBER) |%n" + "|----------|%n" + "| 1 |%n" + "|----------|%n")); - Assertions.assertThat(byteArrayOutputStream5.toString()).isEqualTo(String.format("[Changes on TEST table of 'data source']%n" + Assertions.assertThat(byteArrayOutputStream5).hasToString(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" @@ -126,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 'data source']%n" + Assertions.assertThat(byteArrayOutputStream6).hasToString(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" @@ -137,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 'data source']%n" + Assertions.assertThat(byteArrayOutputStream7).hasToString(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" @@ -146,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 'data source']%n" + Assertions.assertThat(byteArrayOutputStream8).hasToString(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 'data source']%n" + Assertions.assertThat(byteArrayOutputStream9).hasToString(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" @@ -162,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 'data source']%n" + Assertions.assertThat(byteArrayOutputStream10).hasToString(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" @@ -174,8 +174,8 @@ public void test_Outputs_output() { @Test @NeedReload public void test_PrimaryKey_hasPksNames() { - Table table = new Table(connectionProvider, "test"); - Changes changes = new Changes(table).setStartPointNow(); + Table table = connection.table("test").build(); + Changes changes = connection.changes().tables(table).build().setStartPointNow(); update(); changes.setEndPointNow(); @@ -186,8 +186,8 @@ public void test_PrimaryKey_hasPksNames() { @Test @NeedReload public void test_ColumnName_hasColumnName() { - Table table = new Table(connectionProvider, "test"); - Changes changes = new Changes(table).setStartPointNow(); + Table table = connection.table("test").build(); + Changes changes = connection.changes().tables(table).build().setStartPointNow(); update(); changes.setEndPointNow(); @@ -241,8 +241,8 @@ public void test_ColumnName_hasColumnName() { @Test @NeedReload public void test_ColumnClass_isOfClass() { - Table table = new Table(connectionProvider, "test"); - Changes changes = new Changes(table).setStartPointNow(); + Table table = connection.table("test").build(); + Changes changes = connection.changes().tables(table).build().setStartPointNow(); update(); changes.setEndPointNow(); @@ -296,8 +296,8 @@ public void test_ColumnClass_isOfClass() { @Test @NeedReload public void test_ColumnEquality_hasValues() { - Table table = new Table(connectionProvider, "test", null, new String[]{"var20"}); - Changes changes = new Changes(table).setStartPointNow(); + Table table = connection.table("test").columnsToExclude(new String[]{"var20"}).build(); + Changes changes = connection.changes().tables(table).build().setStartPointNow(); update(); changes.setEndPointNow(); @@ -348,8 +348,8 @@ public void test_ColumnEquality_hasValues() { @Test @NeedReload public void test_ColumnEquality_containsValues() { - Table table = new Table(connectionProvider, "test", null, new String[]{"var20"}); - Changes changes = new Changes(table).setStartPointNow(); + Table table = connection.table("test").columnsToExclude(new String[]{"var20"}).build(); + Changes changes = connection.changes().tables(table).build().setStartPointNow(); update(); changes.setEndPointNow(); @@ -378,8 +378,8 @@ public void test_ColumnEquality_containsValues() { @Test @NeedReload public void test_ColumnType_isOfType() { - Table table = new Table(connectionProvider, "test"); - Changes changes = new Changes(table).setStartPointNow(); + Table table = connection.table("test").build(); + Changes changes = connection.changes().tables(table).build().setStartPointNow(); update(); changes.setEndPointNow(); @@ -432,8 +432,8 @@ public void test_ColumnType_isOfType() { @Test @NeedReload public void test_ColumnOfChangeEquality_hasValues() { - Table table = new Table(connectionProvider, "test", null, new String[]{"var20"}); - Changes changes = new Changes(table).setStartPointNow(); + Table table = connection.table("test").columnsToExclude(new String[]{"var20"}).build(); + Changes changes = connection.changes().tables(table).build().setStartPointNow(); update(); changes.setEndPointNow(); @@ -485,8 +485,8 @@ public void test_ColumnOfChangeEquality_hasValues() { @Test @NeedReload public void test_RowEquality_hasValues() { - Table table = new Table(connectionProvider, "test", null, new String[]{"var20"}); - Changes changes = new Changes(table).setStartPointNow(); + Table table = connection.table("test").columnsToExclude(new String[]{"var20"}).build(); + Changes changes = connection.changes().tables(table).build().setStartPointNow(); update(); changes.setEndPointNow(); @@ -508,8 +508,8 @@ public void test_RowEquality_hasValues() { @Test @NeedReload public void test_ValueClass_isOfClass() { - Table table = new Table(connectionProvider, "test"); - Changes changes = new Changes(table).setStartPointNow(); + Table table = connection.table("test").build(); + Changes changes = connection.changes().tables(table).build().setStartPointNow(); update(); changes.setEndPointNow(); @@ -563,8 +563,8 @@ public void test_ValueClass_isOfClass() { @Test @NeedReload public void test_ValueEquality_isEqualTo() { - Table table = new Table(connectionProvider, "test"); - Changes changes = new Changes(table).setStartPointNow(); + Table table = connection.table("test").build(); + Changes changes = connection.changes().tables(table).build().setStartPointNow(); update(); changes.setEndPointNow(); @@ -616,8 +616,8 @@ public void test_ValueEquality_isEqualTo() { @Test @NeedReload public void test_ValueNonEquality_isNotEqualTo() { - Table table = new Table(connectionProvider, "test"); - Changes changes = new Changes(table).setStartPointNow(); + Table table = connection.table("test").build(); + Changes changes = connection.changes().tables(table).build().setStartPointNow(); update(); changes.setEndPointNow(); @@ -669,8 +669,8 @@ public void test_ValueNonEquality_isNotEqualTo() { @Test @NeedReload public void test_ValueType_isOfType() { - Table table = new Table(connectionProvider, "test"); - Changes changes = new Changes(table).setStartPointNow(); + Table table = connection.table("test").build(); + Changes changes = connection.changes().tables(table).build().setStartPointNow(); update(); changes.setEndPointNow(); diff --git a/src/test/java/org/assertj/db/database/sqlite/SqliteDatabase_JdbcUrl_DDD_Test.java b/src/test/java/org/assertj/db/database/sqlite/SqliteDatabase_JdbcUrl_DDD_Test.java index f4cb7761..3496222a 100644 --- a/src/test/java/org/assertj/db/database/sqlite/SqliteDatabase_JdbcUrl_DDD_Test.java +++ b/src/test/java/org/assertj/db/database/sqlite/SqliteDatabase_JdbcUrl_DDD_Test.java @@ -21,8 +21,8 @@ import org.assertj.core.api.Assertions; import org.assertj.db.common.NeedReload; import org.assertj.db.output.Outputs; +import org.assertj.db.type.AssertDbConnection; 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; @@ -37,18 +37,18 @@ */ public class SqliteDatabase_JdbcUrl_DDD_Test extends AbstractSqliteTest { - private ConnectionProvider connectionProvider; + private AssertDbConnection connection; @Before public void init() { - connectionProvider = jdbcConnectionDDD; + connection = jdbcConnectionDDD; } @Test @NeedReload public void test_Outputs_output() { - Table table = new Table(connectionProvider, "test", null, new String[]{"var20"}); - Changes changes = new Changes(table).setStartPointNow(); + Table table = connection.table("test").columnsToExclude(new String[]{"var20"}).build(); + Changes changes = connection.changes().tables(table).build().setStartPointNow(); update(); changes.setEndPointNow(); @@ -76,7 +76,7 @@ public void test_Outputs_output() { .column().toStream(byteArrayOutputStream9) .valueAtEndPoint().toStream(byteArrayOutputStream10); - Assertions.assertThat(byteArrayOutputStream0.toString()).isEqualTo(String.format("[teSt table]%n" + Assertions.assertThat(byteArrayOutputStream0).hasToString(String.format("[teSt table]%n" + "|-----------|---------|-----------|-----------|-----------|-----------|-----------|------------|-----------|-----------|-----------|-----------|------------|------------|------------|------------|------------|------------|------------|-----------------------|------------|%n" + "| | | * | | | | | | | | | | | | | | | | | | |%n" + "| | PRIMARY | VAR1 | VAR2 | VAR3 | VAR4 | VAR5 | VAR6 | VAR7 | VAR8 | VAR9 | VAR10 | VAR11 | VAR12 | VAR13 | VAR14 | VAR15 | VAR16 | VAR17 | VAR18 | VAR19 |%n" @@ -85,21 +85,21 @@ public void test_Outputs_output() { + "|-----------|---------|-----------|-----------|-----------|-----------|-----------|------------|-----------|-----------|-----------|-----------|------------|------------|------------|------------|------------|------------|------------|-----------------------|------------|%n" + "| Index : 0 | 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(byteArrayOutputStream1.toString()).isEqualTo(String.format("[Column at index 0 (column name : VAR1) of teSt table]%n" + Assertions.assertThat(byteArrayOutputStream1).hasToString(String.format("[Column at index 0 (column name : VAR1) of teSt table]%n" + "|-----------|----------|%n" + "| | VAR1 |%n" + "| | (NUMBER) |%n" + "|-----------|----------|%n" + "| Index : 0 | 1 |%n" + "|-----------|----------|%n")); - Assertions.assertThat(byteArrayOutputStream2.toString()).isEqualTo(String.format("[Value at index 0 of Column at index 0 (column name : VAR1) of teSt table]%n" + Assertions.assertThat(byteArrayOutputStream2).hasToString(String.format("[Value at index 0 of Column at index 0 (column name : VAR1) of teSt table]%n" + "|----------|%n" + "| VAR1 |%n" + "| (NUMBER) |%n" + "|----------|%n" + "| 1 |%n" + "|----------|%n")); - Assertions.assertThat(byteArrayOutputStream3.toString()).isEqualTo(String.format("[Row at index 0 of teSt table]%n" + Assertions.assertThat(byteArrayOutputStream3).hasToString(String.format("[Row at index 0 of teSt table]%n" + "|---------|-----------|-----------|-----------|-----------|-----------|------------|-----------|-----------|-----------|-----------|------------|------------|------------|------------|------------|------------|------------|-----------------------|------------|%n" + "| | * | | | | | | | | | | | | | | | | | | |%n" + "| PRIMARY | VAR1 | VAR2 | VAR3 | VAR4 | VAR5 | VAR6 | VAR7 | VAR8 | VAR9 | VAR10 | VAR11 | VAR12 | VAR13 | VAR14 | VAR15 | VAR16 | VAR17 | VAR18 | VAR19 |%n" @@ -108,14 +108,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(byteArrayOutputStream4.toString()).isEqualTo(String.format("[Value at index 0 (column name : VAR1) of Row at index 0 of teSt table]%n" + Assertions.assertThat(byteArrayOutputStream4).hasToString(String.format("[Value at index 0 (column name : VAR1) of Row at index 0 of teSt table]%n" + "|----------|%n" + "| VAR1 |%n" + "| (NUMBER) |%n" + "|----------|%n" + "| 1 |%n" + "|----------|%n")); - Assertions.assertThat(byteArrayOutputStream5.toString()).isEqualTo(String.format("[Changes on teSt table of '/jdbc:sqlite:target/testDerby.db']%n" + Assertions.assertThat(byteArrayOutputStream5).hasToString(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" @@ -126,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']%n" + Assertions.assertThat(byteArrayOutputStream6).hasToString(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" @@ -137,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']%n" + Assertions.assertThat(byteArrayOutputStream7).hasToString(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" @@ -146,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']%n" + Assertions.assertThat(byteArrayOutputStream8).hasToString(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']%n" + Assertions.assertThat(byteArrayOutputStream9).hasToString(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" @@ -162,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']%n" + Assertions.assertThat(byteArrayOutputStream10).hasToString(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" @@ -174,8 +174,8 @@ public void test_Outputs_output() { @Test @NeedReload public void test_PrimaryKey_hasPksNames() { - Table table = new Table(connectionProvider, "test"); - Changes changes = new Changes(table).setStartPointNow(); + Table table = connection.table("test").build(); + Changes changes = connection.changes().tables(table).build().setStartPointNow(); update(); changes.setEndPointNow(); @@ -186,8 +186,8 @@ public void test_PrimaryKey_hasPksNames() { @Test @NeedReload public void test_ColumnName_hasColumnName() { - Table table = new Table(connectionProvider, "test"); - Changes changes = new Changes(table).setStartPointNow(); + Table table = connection.table("test").build(); + Changes changes = connection.changes().tables(table).build().setStartPointNow(); update(); changes.setEndPointNow(); @@ -241,8 +241,8 @@ public void test_ColumnName_hasColumnName() { @Test @NeedReload public void test_ColumnClass_isOfClass() { - Table table = new Table(connectionProvider, "test"); - Changes changes = new Changes(table).setStartPointNow(); + Table table = connection.table("test").build(); + Changes changes = connection.changes().tables(table).build().setStartPointNow(); update(); changes.setEndPointNow(); @@ -296,8 +296,8 @@ public void test_ColumnClass_isOfClass() { @Test @NeedReload public void test_ColumnEquality_hasValues() { - Table table = new Table(connectionProvider, "test", null, new String[]{"var20"}); - Changes changes = new Changes(table).setStartPointNow(); + Table table = connection.table("test").columnsToExclude(new String[]{"var20"}).build(); + Changes changes = connection.changes().tables(table).build().setStartPointNow(); update(); changes.setEndPointNow(); @@ -348,8 +348,8 @@ public void test_ColumnEquality_hasValues() { @Test @NeedReload public void test_ColumnEquality_containsValues() { - Table table = new Table(connectionProvider, "test", null, new String[]{"var20"}); - Changes changes = new Changes(table).setStartPointNow(); + Table table = connection.table("test").columnsToExclude(new String[]{"var20"}).build(); + Changes changes = connection.changes().tables(table).build().setStartPointNow(); update(); changes.setEndPointNow(); @@ -378,8 +378,8 @@ public void test_ColumnEquality_containsValues() { @Test @NeedReload public void test_ColumnType_isOfType() { - Table table = new Table(connectionProvider, "test"); - Changes changes = new Changes(table).setStartPointNow(); + Table table = connection.table("test").build(); + Changes changes = connection.changes().tables(table).build().setStartPointNow(); update(); changes.setEndPointNow(); @@ -432,8 +432,8 @@ public void test_ColumnType_isOfType() { @Test @NeedReload public void test_ColumnOfChangeEquality_hasValues() { - Table table = new Table(connectionProvider, "test", null, new String[]{"var20"}); - Changes changes = new Changes(table).setStartPointNow(); + Table table = connection.table("test").columnsToExclude(new String[]{"var20"}).build(); + Changes changes = connection.changes().tables(table).build().setStartPointNow(); update(); changes.setEndPointNow(); @@ -485,8 +485,8 @@ public void test_ColumnOfChangeEquality_hasValues() { @Test @NeedReload public void test_RowEquality_hasValues() { - Table table = new Table(connectionProvider, "test", null, new String[]{"var20"}); - Changes changes = new Changes(table).setStartPointNow(); + Table table = connection.table("test").columnsToExclude(new String[]{"var20"}).build(); + Changes changes = connection.changes().tables(table).build().setStartPointNow(); update(); changes.setEndPointNow(); @@ -508,8 +508,8 @@ public void test_RowEquality_hasValues() { @Test @NeedReload public void test_ValueClass_isOfClass() { - Table table = new Table(connectionProvider, "test"); - Changes changes = new Changes(table).setStartPointNow(); + Table table = connection.table("test").build(); + Changes changes = connection.changes().tables(table).build().setStartPointNow(); update(); changes.setEndPointNow(); @@ -563,8 +563,8 @@ public void test_ValueClass_isOfClass() { @Test @NeedReload public void test_ValueEquality_isEqualTo() { - Table table = new Table(connectionProvider, "test"); - Changes changes = new Changes(table).setStartPointNow(); + Table table = connection.table("test").build(); + Changes changes = connection.changes().tables(table).build().setStartPointNow(); update(); changes.setEndPointNow(); @@ -616,8 +616,8 @@ public void test_ValueEquality_isEqualTo() { @Test @NeedReload public void test_ValueNonEquality_isNotEqualTo() { - Table table = new Table(connectionProvider, "test"); - Changes changes = new Changes(table).setStartPointNow(); + Table table = connection.table("test").build(); + Changes changes = connection.changes().tables(table).build().setStartPointNow(); update(); changes.setEndPointNow(); @@ -669,8 +669,8 @@ public void test_ValueNonEquality_isNotEqualTo() { @Test @NeedReload public void test_ValueType_isOfType() { - Table table = new Table(connectionProvider, "test"); - Changes changes = new Changes(table).setStartPointNow(); + Table table = connection.table("test").build(); + Changes changes = connection.changes().tables(table).build().setStartPointNow(); update(); changes.setEndPointNow(); diff --git a/src/test/java/org/assertj/db/database/sqlite/SqliteDatabase_JdbcUrl_NSNSNS_Test.java b/src/test/java/org/assertj/db/database/sqlite/SqliteDatabase_JdbcUrl_NSNSNS_Test.java index 750f86ce..d45201dd 100644 --- a/src/test/java/org/assertj/db/database/sqlite/SqliteDatabase_JdbcUrl_NSNSNS_Test.java +++ b/src/test/java/org/assertj/db/database/sqlite/SqliteDatabase_JdbcUrl_NSNSNS_Test.java @@ -22,8 +22,8 @@ import org.assertj.db.common.NeedReload; import org.assertj.db.exception.AssertJDBException; import org.assertj.db.output.Outputs; +import org.assertj.db.type.AssertDbConnection; 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; @@ -36,18 +36,18 @@ */ public class SqliteDatabase_JdbcUrl_NSNSNS_Test extends AbstractSqliteTest { - private ConnectionProvider connectionProvider; + private AssertDbConnection connection; @Before public void init() { - connectionProvider = jdbcConnectionNSNSNS; + connection = jdbcConnectionNSNSNS; } @Test @NeedReload public void test_Outputs_output() { - Table table = new Table(connectionProvider, "test", null, new String[]{"var20"}); - Changes changes = new Changes(table).setStartPointNow(); + Table table = connection.table("test").columnsToExclude(new String[]{"var20"}).build(); + Changes changes = connection.changes().tables(table).build().setStartPointNow(); update(); changes.setEndPointNow(); @@ -74,7 +74,7 @@ public void test_Outputs_output() { .column().toStream(byteArrayOutputStream9) .valueAtEndPoint().toStream(byteArrayOutputStream10); - Assertions.assertThat(byteArrayOutputStream0.toString()).isEqualTo(String.format("[test table]%n" + Assertions.assertThat(byteArrayOutputStream0).hasToString(String.format("[test table]%n" + "|-----------|---------|-----------|-----------|-----------|-----------|-----------|------------|-----------|-----------|-----------|-----------|------------|------------|------------|------------|------------|------------|------------|-----------------------|------------|%n" + "| | | * | | | | | | | | | | | | | | | | | | |%n" + "| | PRIMARY | Var1 | vAr2 | vaR3 | var4 | var5 | var6 | var7 | var8 | var9 | var10 | var11 | var12 | var13 | var14 | var15 | var16 | var17 | var18 | var19 |%n" @@ -83,21 +83,21 @@ public void test_Outputs_output() { + "|-----------|---------|-----------|-----------|-----------|-----------|-----------|------------|-----------|-----------|-----------|-----------|------------|------------|------------|------------|------------|------------|------------|-----------------------|------------|%n" + "| Index : 0 | 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(byteArrayOutputStream1.toString()).isEqualTo(String.format("[Column at index 0 (column name : Var1) of test table]%n" + Assertions.assertThat(byteArrayOutputStream1).hasToString(String.format("[Column at index 0 (column name : Var1) of test table]%n" + "|-----------|----------|%n" + "| | Var1 |%n" + "| | (NUMBER) |%n" + "|-----------|----------|%n" + "| Index : 0 | 1 |%n" + "|-----------|----------|%n")); - Assertions.assertThat(byteArrayOutputStream2.toString()).isEqualTo(String.format("[Value at index 0 of Column at index 0 (column name : Var1) of test table]%n" + Assertions.assertThat(byteArrayOutputStream2).hasToString(String.format("[Value at index 0 of Column at index 0 (column name : Var1) of test table]%n" + "|----------|%n" + "| Var1 |%n" + "| (NUMBER) |%n" + "|----------|%n" + "| 1 |%n" + "|----------|%n")); - Assertions.assertThat(byteArrayOutputStream3.toString()).isEqualTo(String.format("[Row at index 0 of test table]%n" + Assertions.assertThat(byteArrayOutputStream3).hasToString(String.format("[Row at index 0 of test table]%n" + "|---------|-----------|-----------|-----------|-----------|-----------|------------|-----------|-----------|-----------|-----------|------------|------------|------------|------------|------------|------------|------------|-----------------------|------------|%n" + "| | * | | | | | | | | | | | | | | | | | | |%n" + "| PRIMARY | Var1 | vAr2 | vaR3 | var4 | var5 | var6 | var7 | var8 | var9 | var10 | var11 | var12 | var13 | var14 | var15 | var16 | var17 | var18 | var19 |%n" @@ -106,14 +106,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(byteArrayOutputStream4.toString()).isEqualTo(String.format("[Value at index 0 (column name : Var1) of Row at index 0 of test table]%n" + Assertions.assertThat(byteArrayOutputStream4).hasToString(String.format("[Value at index 0 (column name : Var1) of Row at index 0 of test table]%n" + "|----------|%n" + "| Var1 |%n" + "| (NUMBER) |%n" + "|----------|%n" + "| 1 |%n" + "|----------|%n")); - Assertions.assertThat(byteArrayOutputStream5.toString()).isEqualTo(String.format("[Changes on test table of '/jdbc:sqlite:target/testDerby.db']%n" + Assertions.assertThat(byteArrayOutputStream5).hasToString(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" @@ -124,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']%n" + Assertions.assertThat(byteArrayOutputStream6).hasToString(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" @@ -135,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']%n" + Assertions.assertThat(byteArrayOutputStream7).hasToString(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" @@ -144,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']%n" + Assertions.assertThat(byteArrayOutputStream8).hasToString(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']%n" + Assertions.assertThat(byteArrayOutputStream9).hasToString(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" @@ -160,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']%n" + Assertions.assertThat(byteArrayOutputStream10).hasToString(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" @@ -172,9 +172,9 @@ public void test_Outputs_output() { @Test @NeedReload public void should_fail_because_primary_key_is_different() { - Table table = new Table(connectionProvider, "test"); - Changes changes = new Changes(table).setStartPointNow(); - Changes changes2 = new Changes(connectionProvider).setStartPointNow(); + Table table = connection.table("test").build(); + Changes changes = connection.changes().tables(table).build().setStartPointNow(); + Changes changes2 = connection.changes().build().setStartPointNow(); update(); changes.setEndPointNow(); changes2.setEndPointNow(); @@ -205,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(connectionProvider, "test"); - Changes changes = new Changes(table).setStartPointNow(); - Changes changes2 = new Changes(connectionProvider).setStartPointNow(); + Table table = connection.table("test").build(); + Changes changes = connection.changes().tables(table).build().setStartPointNow(); + Changes changes2 = connection.changes().build().setStartPointNow(); update(); changes.setEndPointNow(); changes2.setEndPointNow(); @@ -279,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(connectionProvider, "test"); - Changes changes = new Changes(table).setStartPointNow(); - Changes changes2 = new Changes(connectionProvider).setStartPointNow(); + Table table = connection.table("test").build(); + Changes changes = connection.changes().tables(table).build().setStartPointNow(); + Changes changes2 = connection.changes().build().setStartPointNow(); update(); changes.setEndPointNow(); changes2.setEndPointNow(); @@ -341,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(connectionProvider, "test"); - Changes changes = new Changes(table).setStartPointNow(); - Changes changes2 = new Changes(connectionProvider).setStartPointNow(); + Table table = connection.table("test").build(); + Changes changes = connection.changes().tables(table).build().setStartPointNow(); + Changes changes2 = connection.changes().build().setStartPointNow(); update(); changes.setEndPointNow(); changes2.setEndPointNow(); @@ -373,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(connectionProvider, "test"); - Changes changes = new Changes(table).setStartPointNow(); - Changes changes2 = new Changes(connectionProvider).setStartPointNow(); + Table table = connection.table("test").build(); + Changes changes = connection.changes().tables(table).build().setStartPointNow(); + Changes changes2 = connection.changes().build().setStartPointNow(); update(); changes.setEndPointNow(); changes2.setEndPointNow(); @@ -384,47 +384,47 @@ public void should_fail_because_table_name_is_wrong_to_navigate() { assertThat(changes).changeOnTable("teSt"); fail("An exception must be raised"); } catch (AssertJDBException e) { - Assertions.assertThat(e.getMessage()).isEqualTo(String.format("Index 0 out of the limits [0, 0[")); + Assertions.assertThat(e.getMessage()).isEqualTo("Index 0 out of the limits [0, 0["); } try { assertThat(changes).changeOnTable("teSt", 0); fail("An exception must be raised"); } catch (AssertJDBException e) { - Assertions.assertThat(e.getMessage()).isEqualTo(String.format("Index 0 out of the limits [0, 0[")); + Assertions.assertThat(e.getMessage()).isEqualTo("Index 0 out of the limits [0, 0["); } try { assertThat(changes).changeOnTableWithPks("teSt", 1); fail("An exception must be raised"); } catch (AssertJDBException e) { - Assertions.assertThat(e.getMessage()).isEqualTo(String.format("No change found for table teSt and primary keys [1]")); + Assertions.assertThat(e.getMessage()).isEqualTo("No change found for table teSt and primary keys [1]"); } try { assertThat(changes2).changeOnTable("test"); fail("An exception must be raised"); } catch (AssertJDBException e) { - Assertions.assertThat(e.getMessage()).isEqualTo(String.format("Index 0 out of the limits [0, 0[")); + Assertions.assertThat(e.getMessage()).isEqualTo("Index 0 out of the limits [0, 0["); } try { assertThat(changes2).changeOnTable("test", 0); fail("An exception must be raised"); } catch (AssertJDBException e) { - Assertions.assertThat(e.getMessage()).isEqualTo(String.format("Index 0 out of the limits [0, 0[")); + Assertions.assertThat(e.getMessage()).isEqualTo("Index 0 out of the limits [0, 0["); } try { assertThat(changes2).changeOnTableWithPks("test", 1); fail("An exception must be raised"); } catch (AssertJDBException e) { - Assertions.assertThat(e.getMessage()).isEqualTo(String.format("No change found for table test and primary keys [1]")); + Assertions.assertThat(e.getMessage()).isEqualTo("No change found for table test and primary keys [1]"); } } @Test @NeedReload public void test_ColumnName_hasColumnName() { - Table table = new Table(connectionProvider, "test"); - Changes changes = new Changes(table).setStartPointNow(); - Changes changes2 = new Changes(connectionProvider).setStartPointNow(); + Table table = connection.table("test").build(); + Changes changes = connection.changes().tables(table).build().setStartPointNow(); + Changes changes2 = connection.changes().build().setStartPointNow(); update(); changes.setEndPointNow(); changes2.setEndPointNow(); @@ -438,9 +438,9 @@ public void test_ColumnName_hasColumnName() { @Test @NeedReload public void test_ColumnClass_isOfClass() { - Table table = new Table(connectionProvider, "test"); - Changes changes = new Changes(table).setStartPointNow(); - Changes changes2 = new Changes(connectionProvider).setStartPointNow(); + Table table = connection.table("test").build(); + Changes changes = connection.changes().tables(table).build().setStartPointNow(); + Changes changes2 = connection.changes().build().setStartPointNow(); update(); changes.setEndPointNow(); changes2.setEndPointNow(); diff --git a/src/test/java/org/assertj/db/database/sqlite/SqliteDatabase_JdbcUrl_UIUIUI_Test.java b/src/test/java/org/assertj/db/database/sqlite/SqliteDatabase_JdbcUrl_UIUIUI_Test.java index 65c59752..7de6a071 100644 --- a/src/test/java/org/assertj/db/database/sqlite/SqliteDatabase_JdbcUrl_UIUIUI_Test.java +++ b/src/test/java/org/assertj/db/database/sqlite/SqliteDatabase_JdbcUrl_UIUIUI_Test.java @@ -21,8 +21,8 @@ import org.assertj.core.api.Assertions; import org.assertj.db.common.NeedReload; import org.assertj.db.output.Outputs; +import org.assertj.db.type.AssertDbConnection; 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; @@ -37,18 +37,18 @@ */ public class SqliteDatabase_JdbcUrl_UIUIUI_Test extends AbstractSqliteTest { - private ConnectionProvider connectionProvider; + private AssertDbConnection connection; @Before public void init() { - connectionProvider = jdbcConnectionUIUIUI; + connection = jdbcConnectionUIUIUI; } @Test @NeedReload public void test_Outputs_output() { - Table table = new Table(connectionProvider, "test", null, new String[]{"var20"}); - Changes changes = new Changes(table).setStartPointNow(); + Table table = connection.table("test").columnsToExclude(new String[]{"var20"}).build(); + Changes changes = connection.changes().tables(table).build().setStartPointNow(); update(); changes.setEndPointNow(); @@ -76,7 +76,7 @@ public void test_Outputs_output() { .column().toStream(byteArrayOutputStream9) .valueAtEndPoint().toStream(byteArrayOutputStream10); - Assertions.assertThat(byteArrayOutputStream0.toString()).isEqualTo(String.format("[TEST table]%n" + Assertions.assertThat(byteArrayOutputStream0).hasToString(String.format("[TEST table]%n" + "|-----------|---------|-----------|-----------|-----------|-----------|-----------|------------|-----------|-----------|-----------|-----------|------------|------------|------------|------------|------------|------------|------------|-----------------------|------------|%n" + "| | | * | | | | | | | | | | | | | | | | | | |%n" + "| | PRIMARY | VAR1 | VAR2 | VAR3 | VAR4 | VAR5 | VAR6 | VAR7 | VAR8 | VAR9 | VAR10 | VAR11 | VAR12 | VAR13 | VAR14 | VAR15 | VAR16 | VAR17 | VAR18 | VAR19 |%n" @@ -85,21 +85,21 @@ public void test_Outputs_output() { + "|-----------|---------|-----------|-----------|-----------|-----------|-----------|------------|-----------|-----------|-----------|-----------|------------|------------|------------|------------|------------|------------|------------|-----------------------|------------|%n" + "| Index : 0 | 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(byteArrayOutputStream1.toString()).isEqualTo(String.format("[Column at index 0 (column name : VAR1) of TEST table]%n" + Assertions.assertThat(byteArrayOutputStream1).hasToString(String.format("[Column at index 0 (column name : VAR1) of TEST table]%n" + "|-----------|----------|%n" + "| | VAR1 |%n" + "| | (NUMBER) |%n" + "|-----------|----------|%n" + "| Index : 0 | 1 |%n" + "|-----------|----------|%n")); - Assertions.assertThat(byteArrayOutputStream2.toString()).isEqualTo(String.format("[Value at index 0 of Column at index 0 (column name : VAR1) of TEST table]%n" + Assertions.assertThat(byteArrayOutputStream2).hasToString(String.format("[Value at index 0 of Column at index 0 (column name : VAR1) of TEST table]%n" + "|----------|%n" + "| VAR1 |%n" + "| (NUMBER) |%n" + "|----------|%n" + "| 1 |%n" + "|----------|%n")); - Assertions.assertThat(byteArrayOutputStream3.toString()).isEqualTo(String.format("[Row at index 0 of TEST table]%n" + Assertions.assertThat(byteArrayOutputStream3).hasToString(String.format("[Row at index 0 of TEST table]%n" + "|---------|-----------|-----------|-----------|-----------|-----------|------------|-----------|-----------|-----------|-----------|------------|------------|------------|------------|------------|------------|------------|-----------------------|------------|%n" + "| | * | | | | | | | | | | | | | | | | | | |%n" + "| PRIMARY | VAR1 | VAR2 | VAR3 | VAR4 | VAR5 | VAR6 | VAR7 | VAR8 | VAR9 | VAR10 | VAR11 | VAR12 | VAR13 | VAR14 | VAR15 | VAR16 | VAR17 | VAR18 | VAR19 |%n" @@ -108,14 +108,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(byteArrayOutputStream4.toString()).isEqualTo(String.format("[Value at index 0 (column name : VAR1) of Row at index 0 of TEST table]%n" + Assertions.assertThat(byteArrayOutputStream4).hasToString(String.format("[Value at index 0 (column name : VAR1) of Row at index 0 of TEST table]%n" + "|----------|%n" + "| VAR1 |%n" + "| (NUMBER) |%n" + "|----------|%n" + "| 1 |%n" + "|----------|%n")); - Assertions.assertThat(byteArrayOutputStream5.toString()).isEqualTo(String.format("[Changes on TEST table of '/jdbc:sqlite:target/testDerby.db']%n" + Assertions.assertThat(byteArrayOutputStream5).hasToString(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" @@ -126,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']%n" + Assertions.assertThat(byteArrayOutputStream6).hasToString(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" @@ -137,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']%n" + Assertions.assertThat(byteArrayOutputStream7).hasToString(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" @@ -146,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']%n" + Assertions.assertThat(byteArrayOutputStream8).hasToString(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']%n" + Assertions.assertThat(byteArrayOutputStream9).hasToString(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" @@ -162,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']%n" + Assertions.assertThat(byteArrayOutputStream10).hasToString(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" @@ -174,8 +174,8 @@ public void test_Outputs_output() { @Test @NeedReload public void test_PrimaryKey_hasPksNames() { - Table table = new Table(connectionProvider, "test"); - Changes changes = new Changes(table).setStartPointNow(); + Table table = connection.table("test").build(); + Changes changes = connection.changes().tables(table).build().setStartPointNow(); update(); changes.setEndPointNow(); @@ -186,8 +186,8 @@ public void test_PrimaryKey_hasPksNames() { @Test @NeedReload public void test_ColumnName_hasColumnName() { - Table table = new Table(connectionProvider, "test"); - Changes changes = new Changes(table).setStartPointNow(); + Table table = connection.table("test").build(); + Changes changes = connection.changes().tables(table).build().setStartPointNow(); update(); changes.setEndPointNow(); @@ -241,8 +241,8 @@ public void test_ColumnName_hasColumnName() { @Test @NeedReload public void test_ColumnClass_isOfClass() { - Table table = new Table(connectionProvider, "test"); - Changes changes = new Changes(table).setStartPointNow(); + Table table = connection.table("test").build(); + Changes changes = connection.changes().tables(table).build().setStartPointNow(); update(); changes.setEndPointNow(); @@ -296,8 +296,8 @@ public void test_ColumnClass_isOfClass() { @Test @NeedReload public void test_ColumnEquality_hasValues() { - Table table = new Table(connectionProvider, "test", null, new String[]{"var20"}); - Changes changes = new Changes(table).setStartPointNow(); + Table table = connection.table("test").columnsToExclude(new String[]{"var20"}).build(); + Changes changes = connection.changes().tables(table).build().setStartPointNow(); update(); changes.setEndPointNow(); @@ -348,8 +348,8 @@ public void test_ColumnEquality_hasValues() { @Test @NeedReload public void test_ColumnEquality_containsValues() { - Table table = new Table(connectionProvider, "test", null, new String[]{"var20"}); - Changes changes = new Changes(table).setStartPointNow(); + Table table = connection.table("test").columnsToExclude(new String[]{"var20"}).build(); + Changes changes = connection.changes().tables(table).build().setStartPointNow(); update(); changes.setEndPointNow(); @@ -378,8 +378,8 @@ public void test_ColumnEquality_containsValues() { @Test @NeedReload public void test_ColumnType_isOfType() { - Table table = new Table(connectionProvider, "test"); - Changes changes = new Changes(table).setStartPointNow(); + Table table = connection.table("test").build(); + Changes changes = connection.changes().tables(table).build().setStartPointNow(); update(); changes.setEndPointNow(); @@ -432,8 +432,8 @@ public void test_ColumnType_isOfType() { @Test @NeedReload public void test_ColumnOfChangeEquality_hasValues() { - Table table = new Table(connectionProvider, "test", null, new String[]{"var20"}); - Changes changes = new Changes(table).setStartPointNow(); + Table table = connection.table("test").columnsToExclude(new String[]{"var20"}).build(); + Changes changes = connection.changes().tables(table).build().setStartPointNow(); update(); changes.setEndPointNow(); @@ -485,8 +485,8 @@ public void test_ColumnOfChangeEquality_hasValues() { @Test @NeedReload public void test_RowEquality_hasValues() { - Table table = new Table(connectionProvider, "test", null, new String[]{"var20"}); - Changes changes = new Changes(table).setStartPointNow(); + Table table = connection.table("test").columnsToExclude(new String[]{"var20"}).build(); + Changes changes = connection.changes().tables(table).build().setStartPointNow(); update(); changes.setEndPointNow(); @@ -508,8 +508,8 @@ public void test_RowEquality_hasValues() { @Test @NeedReload public void test_ValueClass_isOfClass() { - Table table = new Table(connectionProvider, "test"); - Changes changes = new Changes(table).setStartPointNow(); + Table table = connection.table("test").build(); + Changes changes = connection.changes().tables(table).build().setStartPointNow(); update(); changes.setEndPointNow(); @@ -563,8 +563,8 @@ public void test_ValueClass_isOfClass() { @Test @NeedReload public void test_ValueEquality_isEqualTo() { - Table table = new Table(connectionProvider, "test"); - Changes changes = new Changes(table).setStartPointNow(); + Table table = connection.table("test").build(); + Changes changes = connection.changes().tables(table).build().setStartPointNow(); update(); changes.setEndPointNow(); @@ -616,8 +616,8 @@ public void test_ValueEquality_isEqualTo() { @Test @NeedReload public void test_ValueNonEquality_isNotEqualTo() { - Table table = new Table(connectionProvider, "test"); - Changes changes = new Changes(table).setStartPointNow(); + Table table = connection.table("test").build(); + Changes changes = connection.changes().tables(table).build().setStartPointNow(); update(); changes.setEndPointNow(); @@ -669,8 +669,8 @@ public void test_ValueNonEquality_isNotEqualTo() { @Test @NeedReload public void test_ValueType_isOfType() { - Table table = new Table(connectionProvider, "test"); - Changes changes = new Changes(table).setStartPointNow(); + Table table = connection.table("test").build(); + Changes changes = connection.changes().tables(table).build().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 877adb79..2143e08f 100644 --- a/src/test/java/org/assertj/db/navigation/InstantiationError_Test.java +++ b/src/test/java/org/assertj/db/navigation/InstantiationError_Test.java @@ -44,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(jdbcConnectionProvider, "actor"); + Table table = assertDbConnection.table("actor").build(); TableAssert tableAssert = assertThat(table); Field field = AbstractDbAssert.class.getDeclaredField("columnPosition"); @@ -71,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(jdbcConnectionProvider, "actor"); + Table table = assertDbConnection.table("actor").build(); TableAssert tableAssert = assertThat(table); Field field = AbstractDbAssert.class.getDeclaredField("rowPosition"); @@ -98,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(jdbcConnectionProvider, "actor"); + Table table = assertDbConnection.table("actor").build(); TableColumnAssert tableColumnAssert = assertThat(table).column(); Field field = AbstractColumnAssert.class.getDeclaredField("valuePosition"); @@ -126,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(jdbcConnectionProvider).setStartPointNow(); + Changes changes = assertDbConnection.changes().build().setStartPointNow(); updateChangesForTests(); changes.setEndPointNow(); ChangesAssert changesAssert = assertThat(changes); @@ -156,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(jdbcConnectionProvider).setStartPointNow(); + Changes changes = assertDbConnection.changes().build().setStartPointNow(); updateChangesForTests(); changes.setEndPointNow(); ChangesAssert changesAssert = assertThat(changes); @@ -186,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(jdbcConnectionProvider).setStartPointNow(); + Changes changes = assertDbConnection.changes().build().setStartPointNow(); updateChangesForTests(); changes.setEndPointNow(); ChangeAssert changeAssert = assertThat(changes).change(); @@ -216,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(jdbcConnectionProvider).setStartPointNow(); + Changes changes = assertDbConnection.changes().build().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 78baaf11..3bfb9a38 100644 --- a/src/test/java/org/assertj/db/navigation/ReturnToOrigin_Test.java +++ b/src/test/java/org/assertj/db/navigation/ReturnToOrigin_Test.java @@ -69,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(jdbcConnectionProvider, "actor"); + Table table = assertDbConnection.table("actor").build(); TableAssert tableAssert = assertThat(table); TableColumnAssert tableColumnAssert = tableAssert.column(); TableAssert tableAssertBis = tableColumnAssert.returnToTable(); @@ -82,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(jdbcConnectionProvider, "actor"); + Table table = assertDbConnection.table("actor").build(); TableAssert tableAssert = assertThat(table); TableRowAssert tableRowAssert = tableAssert.row(); TableAssert tableAssertBis = tableRowAssert.returnToTable(); @@ -95,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(jdbcConnectionProvider, "select * from actor"); + Request request = assertDbConnection.request("select * from actor").build(); RequestAssert requestAssert = assertThat(request); RequestColumnAssert requestColumnAssert = requestAssert.column(); RequestAssert requestAssertBis = requestColumnAssert.returnToRequest(); @@ -108,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(jdbcConnectionProvider, "select * from actor"); + Request request = assertDbConnection.request("select * from actor").build(); RequestAssert requestAssert = assertThat(request); RequestRowAssert requestRowAssert = requestAssert.row(); RequestAssert requestAssertBis = requestRowAssert.returnToRequest(); @@ -121,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(jdbcConnectionProvider, "actor"); + Table table = assertDbConnection.table("actor").build(); TableAssert tableAssert = assertThat(table); TableColumnAssert tableColumnAssert = tableAssert.column(); TableColumnValueAssert tableColumnValueAssert = tableColumnAssert.value(); @@ -135,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(jdbcConnectionProvider, "actor"); + Table table = assertDbConnection.table("actor").build(); TableAssert tableAssert = assertThat(table); TableRowAssert tableRowAssert = tableAssert.row(); TableRowValueAssert tableRowValueAssert = tableRowAssert.value(); @@ -149,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(jdbcConnectionProvider, "select * from actor"); + Request request = assertDbConnection.request("select * from actor").build(); RequestAssert requestAssert = assertThat(request); RequestColumnAssert requestColumnAssert = requestAssert.column(); RequestColumnValueAssert requestColumnValueAssert = requestColumnAssert.value(); @@ -163,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(jdbcConnectionProvider, "select * from actor"); + Request request = assertDbConnection.request("select * from actor").build(); RequestAssert requestAssert = assertThat(request); RequestRowAssert requestRowAssert = requestAssert.row(); RequestRowValueAssert requestRowValueAssert = requestRowAssert.value(); @@ -178,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(jdbcConnectionProvider).setStartPointNow(); + Changes changes = assertDbConnection.changes().build().setStartPointNow(); updateChangesForTests(); changes.setEndPointNow(); @@ -195,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(jdbcConnectionProvider).setStartPointNow(); + Changes changes = assertDbConnection.changes().build().setStartPointNow(); updateChangesForTests(); changes.setEndPointNow(); @@ -212,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(jdbcConnectionProvider).setStartPointNow(); + Changes changes = assertDbConnection.changes().build().setStartPointNow(); updateChangesForTests(); changes.setEndPointNow(); @@ -229,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(jdbcConnectionProvider).setStartPointNow(); + Changes changes = assertDbConnection.changes().build().setStartPointNow(); updateChangesForTests(); changes.setEndPointNow(); @@ -246,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(jdbcConnectionProvider).setStartPointNow(); + Changes changes = assertDbConnection.changes().build().setStartPointNow(); updateChangesForTests(); changes.setEndPointNow(); @@ -262,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(jdbcConnectionProvider, "actor"); + Table table = assertDbConnection.table("actor").build(); TableOutputter tableOutputter = Outputs.output(table); TableColumnOutputter tableColumnOutputter = tableOutputter.column(); TableOutputter tableOutputterBis = tableColumnOutputter.returnToTable(); @@ -275,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(jdbcConnectionProvider, "actor"); + Table table = assertDbConnection.table("actor").build(); TableOutputter tableOutputter = Outputs.output(table); TableRowOutputter tableRowOutputter = tableOutputter.row(); TableOutputter tableOutputterBis = tableRowOutputter.returnToTable(); @@ -288,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(jdbcConnectionProvider, "select * from actor"); + Request request = assertDbConnection.request("select * from actor").build(); RequestOutputter requestOutputter = Outputs.output(request); RequestColumnOutputter requestColumnOutputter = requestOutputter.column(); RequestOutputter requestOutputterBis = requestColumnOutputter.returnToRequest(); @@ -301,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(jdbcConnectionProvider, "select * from actor"); + Request request = assertDbConnection.request("select * from actor").build(); RequestOutputter requestOutputter = Outputs.output(request); RequestRowOutputter requestRowOutputter = requestOutputter.row(); RequestOutputter requestOutputterBis = requestRowOutputter.returnToRequest(); @@ -314,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(jdbcConnectionProvider, "actor"); + Table table = assertDbConnection.table("actor").build(); TableOutputter tableOutputter = Outputs.output(table); TableColumnOutputter tableColumnOutputter = tableOutputter.column(); TableColumnValueOutputter tableColumnValueOutputter = tableColumnOutputter.value(); @@ -328,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(jdbcConnectionProvider, "actor"); + Table table = assertDbConnection.table("actor").build(); TableOutputter tableOutputter = Outputs.output(table); TableRowOutputter tableRowOutputter = tableOutputter.row(); TableRowValueOutputter tableRowValueOutputter = tableRowOutputter.value(); @@ -342,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(jdbcConnectionProvider, "select * from actor"); + Request request = assertDbConnection.request("select * from actor").build(); RequestOutputter requestOutputter = Outputs.output(request); RequestColumnOutputter requestColumnOutputter = requestOutputter.column(); RequestColumnValueOutputter requestColumnValueOutputter = requestColumnOutputter.value(); @@ -356,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(jdbcConnectionProvider, "select * from actor"); + Request request = assertDbConnection.request("select * from actor").build(); RequestOutputter requestOutputter = Outputs.output(request); RequestRowOutputter requestRowOutputter = requestOutputter.row(); RequestRowValueOutputter requestRowValueOutputter = requestRowOutputter.value(); @@ -371,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(jdbcConnectionProvider).setStartPointNow(); + Changes changes = assertDbConnection.changes().build().setStartPointNow(); updateChangesForTests(); changes.setEndPointNow(); @@ -388,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(jdbcConnectionProvider).setStartPointNow(); + Changes changes = assertDbConnection.changes().build().setStartPointNow(); updateChangesForTests(); changes.setEndPointNow(); @@ -405,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(jdbcConnectionProvider).setStartPointNow(); + Changes changes = assertDbConnection.changes().build().setStartPointNow(); updateChangesForTests(); changes.setEndPointNow(); @@ -422,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(jdbcConnectionProvider).setStartPointNow(); + Changes changes = assertDbConnection.changes().build().setStartPointNow(); updateChangesForTests(); changes.setEndPointNow(); @@ -439,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(jdbcConnectionProvider).setStartPointNow(); + Changes changes = assertDbConnection.changes().build().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 f65b98e4..b1304631 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 @@ -48,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(jdbcConnectionProvider).setStartPointNow(); + Changes changes = assertDbConnection.changes().build().setStartPointNow(); updateChangesForTests(); changes.setEndPointNow(); @@ -145,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(jdbcConnectionProvider).setStartPointNow(); + Changes changes = assertDbConnection.changes().build().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 39d4aeea..5f2c825e 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 @@ -48,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(jdbcConnectionProvider).setStartPointNow(); + Changes changes = assertDbConnection.changes().build().setStartPointNow(); updateChangesForTests(); changes.setEndPointNow(); @@ -129,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(jdbcConnectionProvider).setStartPointNow(); + Changes changes = assertDbConnection.changes().build().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 016695ec..82aa6e1f 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 @@ -48,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(jdbcConnectionProvider).setStartPointNow(); + Changes changes = assertDbConnection.changes().build().setStartPointNow(); updateChangesForTests(); changes.setEndPointNow(); @@ -145,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(jdbcConnectionProvider).setStartPointNow(); + Changes changes = assertDbConnection.changes().build().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 aac997ec..6c021d08 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 @@ -48,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(jdbcConnectionProvider).setStartPointNow(); + Changes changes = assertDbConnection.changes().build().setStartPointNow(); updateChangesForTests(); changes.setEndPointNow(); @@ -129,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(jdbcConnectionProvider).setStartPointNow(); + Changes changes = assertDbConnection.changes().build().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 a0348194..bb6bca11 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 @@ -48,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(jdbcConnectionProvider).setStartPointNow(); + Changes changes = assertDbConnection.changes().build().setStartPointNow(); updateChangesForTests(); changes.setEndPointNow(); @@ -134,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(jdbcConnectionProvider).setStartPointNow(); + Changes changes = assertDbConnection.changes().build().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 edd2f57d..b227b728 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 @@ -48,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(jdbcConnectionProvider).setStartPointNow(); + Changes changes = assertDbConnection.changes().build().setStartPointNow(); updateChangesForTests(); changes.setEndPointNow(); @@ -118,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(jdbcConnectionProvider).setStartPointNow(); + Changes changes = assertDbConnection.changes().build().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 8aaed8ab..98e5fda7 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 @@ -48,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(jdbcConnectionProvider).setStartPointNow(); + Changes changes = assertDbConnection.changes().build().setStartPointNow(); updateChangesForTests(); changes.setEndPointNow(); @@ -134,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(jdbcConnectionProvider).setStartPointNow(); + Changes changes = assertDbConnection.changes().build().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 8b6bb2b8..1d4c4e50 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 @@ -48,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(jdbcConnectionProvider).setStartPointNow(); + Changes changes = assertDbConnection.changes().build().setStartPointNow(); updateChangesForTests(); changes.setEndPointNow(); @@ -118,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(jdbcConnectionProvider).setStartPointNow(); + Changes changes = assertDbConnection.changes().build().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 b7fa860a..7b35968b 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 @@ -48,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(jdbcConnectionProvider).setStartPointNow(); + Changes changes = assertDbConnection.changes().build().setStartPointNow(); updateChangesForTests(); changes.setEndPointNow(); @@ -145,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(jdbcConnectionProvider).setStartPointNow(); + Changes changes = assertDbConnection.changes().build().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 f10bad25..061757dc 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 @@ -48,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(jdbcConnectionProvider).setStartPointNow(); + Changes changes = assertDbConnection.changes().build().setStartPointNow(); updateChangesForTests(); changes.setEndPointNow(); @@ -129,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(jdbcConnectionProvider).setStartPointNow(); + Changes changes = assertDbConnection.changes().build().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 ad90c950..cd138c56 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 @@ -48,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(jdbcConnectionProvider).setStartPointNow(); + Changes changes = assertDbConnection.changes().build().setStartPointNow(); updateChangesForTests(); changes.setEndPointNow(); @@ -145,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(jdbcConnectionProvider).setStartPointNow(); + Changes changes = assertDbConnection.changes().build().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 aea6dc90..0d62b975 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,6 +12,15 @@ */ 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; @@ -24,15 +33,6 @@ 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. @@ -48,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(jdbcConnectionProvider).setStartPointNow(); + Changes changes = assertDbConnection.changes().build().setStartPointNow(); updateChangesForTests(); changes.setEndPointNow(); @@ -129,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(jdbcConnectionProvider).setStartPointNow(); + Changes changes = assertDbConnection.changes().build().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 7ae09b50..edc1db90 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,6 +12,14 @@ */ 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; @@ -24,14 +32,6 @@ 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. @@ -47,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(jdbcConnectionProvider).setStartPointNow(); + Changes changes = assertDbConnection.changes().build().setStartPointNow(); updateChangesForTests(); changes.setEndPointNow(); @@ -128,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(jdbcConnectionProvider).setStartPointNow(); + Changes changes = assertDbConnection.changes().build().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 3b61d506..d03e552f 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 @@ -48,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(jdbcConnectionProvider).setStartPointNow(); + Changes changes = assertDbConnection.changes().build().setStartPointNow(); updateChangesForTests(); changes.setEndPointNow(); @@ -139,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(jdbcConnectionProvider).setStartPointNow(); + Changes changes = assertDbConnection.changes().build().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 aba577a3..3a050056 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 @@ -48,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(jdbcConnectionProvider).setStartPointNow(); + Changes changes = assertDbConnection.changes().build().setStartPointNow(); updateChangesForTests(); changes.setEndPointNow(); @@ -123,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(jdbcConnectionProvider).setStartPointNow(); + Changes changes = assertDbConnection.changes().build().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 1a79396c..0398c58d 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 @@ -49,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(jdbcConnectionProvider).setStartPointNow(); + Changes changes = assertDbConnection.changes().build().setStartPointNow(); updateChangesForTests(); changes.setEndPointNow(); @@ -186,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(jdbcConnectionProvider).setStartPointNow(); + Changes changes = assertDbConnection.changes().build().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 12dc0e87..b84d5341 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 @@ -48,7 +48,7 @@ public class ToChange_Change_Test extends AbstractTest { @Test @NeedReload public void test_change_with_assertions() throws Exception { - Changes changes = new Changes(jdbcConnectionProvider).setStartPointNow(); + Changes changes = assertDbConnection.changes().build().setStartPointNow(); updateChangesForTests(); changes.setEndPointNow(); @@ -168,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(jdbcConnectionProvider).setStartPointNow(); + Changes changes = assertDbConnection.changes().build().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 b8bbca41..065ce1a9 100644 --- a/src/test/java/org/assertj/db/navigation/ToChange_Test.java +++ b/src/test/java/org/assertj/db/navigation/ToChange_Test.java @@ -41,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(jdbcConnectionProvider).setStartPointNow(); + Changes changes = assertDbConnection.changes().build().setStartPointNow(); updateChangesForTests(); changes.setEndPointNow(); @@ -125,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(jdbcConnectionProvider).setStartPointNow(); + Changes changes = assertDbConnection.changes().build().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 39902e21..0335663e 100644 --- a/src/test/java/org/assertj/db/navigation/ToChanges_Test.java +++ b/src/test/java/org/assertj/db/navigation/ToChanges_Test.java @@ -43,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(jdbcConnectionProvider).setStartPointNow(); + Changes changes = assertDbConnection.changes().build().setStartPointNow(); updateChangesForTests(); changes.setEndPointNow(); @@ -122,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(jdbcConnectionProvider).setStartPointNow(); + Changes changes = assertDbConnection.changes().build().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 b5ad33ce..d4dfd9dc 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 @@ -50,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(jdbcConnectionProvider).setStartPointNow(); + Changes changes = assertDbConnection.changes().build().setStartPointNow(); updateChangesForTests(); changes.setEndPointNow(); @@ -186,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(jdbcConnectionProvider).setStartPointNow(); + Changes changes = assertDbConnection.changes().build().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 edddb128..d1fae56e 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 @@ -49,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(jdbcConnectionProvider).setStartPointNow(); + Changes changes = assertDbConnection.changes().build().setStartPointNow(); updateChangesForTests(); changes.setEndPointNow(); @@ -172,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(jdbcConnectionProvider).setStartPointNow(); + Changes changes = assertDbConnection.changes().build().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 dfe13def..9ebdb42e 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 @@ -50,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(jdbcConnectionProvider).setStartPointNow(); + Changes changes = assertDbConnection.changes().build().setStartPointNow(); updateChangesForTests(); changes.setEndPointNow(); @@ -166,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(jdbcConnectionProvider).setStartPointNow(); + Changes changes = assertDbConnection.changes().build().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 e0abf69c..faa83c9c 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 @@ -66,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(jdbcConnectionProvider).setStartPointNow(); + Changes changes = assertDbConnection.changes().build().setStartPointNow(); updateChangesForTests(); changes.setEndPointNow(); @@ -194,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(jdbcConnectionProvider, "actor"); + Table table = assertDbConnection.table("actor").build(); TableAssert tableAssert = assertThat(table); Position position = (Position) fieldPosition.get(tableAssert); @@ -298,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(jdbcConnectionProvider, "select * from actor"); + Request request = assertDbConnection.request("select * from actor").build(); RequestAssert requestAssert = assertThat(request); Position position = (Position) fieldPosition.get(requestAssert); Assertions.assertThat(fieldIndex.get(position)).isEqualTo(0); @@ -401,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(jdbcConnectionProvider).setStartPointNow(); + Changes changes = assertDbConnection.changes().build().setStartPointNow(); updateChangesForTests(); changes.setEndPointNow(); @@ -529,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(jdbcConnectionProvider, "actor"); + Table table = assertDbConnection.table("actor").build(); TableOutputter tableOutputter = Outputs.output(table); Position position = (Position) fieldPosition.get(tableOutputter); Assertions.assertThat(fieldIndex.get(position)).isEqualTo(0); @@ -632,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(jdbcConnectionProvider, "select * from actor"); + Request request = assertDbConnection.request("select * from actor").build(); 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 197eff18..7e708089 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 @@ -65,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(jdbcConnectionProvider).setStartPointNow(); + Changes changes = assertDbConnection.changes().build().setStartPointNow(); updateChangesForTests(); changes.setEndPointNow(); @@ -180,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(jdbcConnectionProvider, "actor"); + Table table = assertDbConnection.table("actor").build(); TableAssert tableAssert = assertThat(table); Position position = (Position) fieldPosition.get(tableAssert); Assertions.assertThat(fieldIndex.get(position)).isEqualTo(0); @@ -276,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(jdbcConnectionProvider, "select * from actor"); + Request request = assertDbConnection.request("select * from actor").build(); RequestAssert requestAssert = assertThat(request); Position position = (Position) fieldPosition.get(requestAssert); Assertions.assertThat(fieldIndex.get(position)).isEqualTo(0); @@ -366,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(jdbcConnectionProvider).setStartPointNow(); + Changes changes = assertDbConnection.changes().build().setStartPointNow(); updateChangesForTests(); changes.setEndPointNow(); @@ -481,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(jdbcConnectionProvider, "actor"); + Table table = assertDbConnection.table("actor").build(); TableOutputter tableOutputter = Outputs.output(table); Position position = (Position) fieldPosition.get(tableOutputter); @@ -579,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(jdbcConnectionProvider, "select * from actor"); + Request request = assertDbConnection.request("select * from actor").build(); 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 ec493958..36eb2c3e 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 @@ -66,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(jdbcConnectionProvider).setStartPointNow(); + Changes changes = assertDbConnection.changes().build().setStartPointNow(); updateChangesForTests(); changes.setEndPointNow(); @@ -173,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(jdbcConnectionProvider, "actor"); + Table table = assertDbConnection.table("actor").build(); TableAssert tableAssert = assertThat(table); Position position = (Position) fieldPosition.get(tableAssert); assertThat(fieldIndex.get(position)).isEqualTo(0); @@ -260,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(jdbcConnectionProvider, "select * from actor"); + Request request = assertDbConnection.request("select * from actor").build(); RequestAssert requestAssert = assertThat(request); Position position = (Position) fieldPosition.get(requestAssert); assertThat(fieldIndex.get(position)).isEqualTo(0); @@ -343,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(jdbcConnectionProvider).setStartPointNow(); + Changes changes = assertDbConnection.changes().build().setStartPointNow(); updateChangesForTests(); changes.setEndPointNow(); @@ -450,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(jdbcConnectionProvider, "actor"); + Table table = assertDbConnection.table("actor").build(); TableOutputter tableOutputter = Outputs.output(table); Position position = (Position) fieldPosition.get(tableOutputter); @@ -539,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(jdbcConnectionProvider, "select * from actor"); + Request request = assertDbConnection.request("select * from actor").build(); 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 6f1d65a4..f0ff7132 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 @@ -46,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(jdbcConnectionProvider).setStartPointNow(); + Changes changes = assertDbConnection.changes().build().setStartPointNow(); updateChangesForTests(); changes.setEndPointNow(); @@ -100,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(jdbcConnectionProvider).setStartPointNow(); + Changes changes = assertDbConnection.changes().build().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 32b9891f..5d13d348 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 @@ -46,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(jdbcConnectionProvider).setStartPointNow(); + Changes changes = assertDbConnection.changes().build().setStartPointNow(); updateChangesForTests(); changes.setEndPointNow(); @@ -100,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(jdbcConnectionProvider).setStartPointNow(); + Changes changes = assertDbConnection.changes().build().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 8e5fa1ac..40deff17 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 @@ -62,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(jdbcConnectionProvider, "actor"); + Table table = assertDbConnection.table("actor").build(); TableAssert tableAssert = assertThat(table); Position position = (Position) fieldPosition.get(tableAssert); @@ -158,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(jdbcConnectionProvider, "select * from actor"); + Request request = assertDbConnection.request("select * from actor").build(); RequestAssert requestAssert = assertThat(request); Position position = (Position) fieldPosition.get(requestAssert); @@ -260,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(jdbcConnectionProvider, "actor"); + Table table = assertDbConnection.table("actor").build(); TableOutputter tableOutputter = Outputs.output(table); Position position = (Position) fieldPosition.get(tableOutputter); @@ -356,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(jdbcConnectionProvider, "select * from actor"); + Request request = assertDbConnection.request("select * from actor").build(); 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 57cf622b..12dfd00a 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 @@ -62,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(jdbcConnectionProvider, "actor"); + Table table = assertDbConnection.table("actor").build(); TableAssert tableAssert = assertThat(table); Position position = (Position) fieldPosition.get(tableAssert); @@ -148,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(jdbcConnectionProvider, "select * from actor"); + Request request = assertDbConnection.request("select * from actor").build(); RequestAssert requestAssert = assertThat(request); Position position = (Position) fieldPosition.get(requestAssert); @@ -234,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(jdbcConnectionProvider, "actor"); + Table table = assertDbConnection.table("actor").build(); TableOutputter tableOutputter = Outputs.output(table); Position position = (Position) fieldPosition.get(tableOutputter); @@ -320,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(jdbcConnectionProvider, "select * from actor"); + Request request = assertDbConnection.request("select * from actor").build(); 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 52fb061e..5150fdef 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 @@ -50,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(jdbcConnectionProvider).setStartPointNow(); + Changes changes = assertDbConnection.changes().build().setStartPointNow(); updateChangesForTests(); changes.setEndPointNow(); @@ -107,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(jdbcConnectionProvider).setStartPointNow(); + Changes changes = assertDbConnection.changes().build().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 66676720..d1d1b90e 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 @@ -50,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(jdbcConnectionProvider).setStartPointNow(); + Changes changes = assertDbConnection.changes().build().setStartPointNow(); updateChangesForTests(); changes.setEndPointNow(); @@ -108,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(jdbcConnectionProvider).setStartPointNow(); + Changes changes = assertDbConnection.changes().build().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 4df22db4..b9fe0da1 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 @@ -58,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(jdbcConnectionProvider).setStartPointNow(); + Changes changes = assertDbConnection.changes().build().setStartPointNow(); updateChangesForTests(); changes.setEndPointNow(); @@ -76,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(jdbcConnectionProvider).setStartPointNow(); + Changes changes = assertDbConnection.changes().build().setStartPointNow(); updateChangesForTests(); changes.setEndPointNow(); @@ -166,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(jdbcConnectionProvider, "actor"); + Table table = assertDbConnection.table("actor").build(); TableAssert tableAssert = assertThat(table); TableRowAssert tableRowAssert = tableAssert.row(); Position position = (Position) fieldPosition.get(tableRowAssert); @@ -247,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(jdbcConnectionProvider, "select * from actor"); + Request request = assertDbConnection.request("select * from actor").build(); 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 75b72817..b7cd9a23 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 @@ -83,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(jdbcConnectionProvider).setStartPointNow(); + Changes changes = assertDbConnection.changes().build().setStartPointNow(); updateChangesForTests(); changes.setEndPointNow(); @@ -195,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(jdbcConnectionProvider, "actor"); + Table table = assertDbConnection.table("actor").build(); TableAssert tableAssert = assertThat(table); TableColumnAssert tableColumnAssert = tableAssert.column(); Position position = @@ -271,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(jdbcConnectionProvider, "actor"); + Table table = assertDbConnection.table("actor").build(); TableAssert tableAssert = assertThat(table); TableRowAssert tableRowAssert = tableAssert.row(); Position position = @@ -361,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(jdbcConnectionProvider, "select * from actor"); + Request request = assertDbConnection.request("select * from actor").build(); RequestAssert requestAssert = assertThat(request); RequestColumnAssert requestColumnAssert = requestAssert.column(); Position position = (Position) fieldPosition.get(requestColumnAssert); @@ -435,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(jdbcConnectionProvider, "select * from actor"); + Request request = assertDbConnection.request("select * from actor").build(); RequestAssert requestAssert = assertThat(request); RequestRowAssert requestRowAssert = requestAssert.row(); Position position = (Position) fieldPosition.get(requestRowAssert); @@ -517,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(jdbcConnectionProvider).setStartPointNow(); + Changes changes = assertDbConnection.changes().build().setStartPointNow(); updateChangesForTests(); changes.setEndPointNow(); @@ -627,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(jdbcConnectionProvider, "actor"); + Table table = assertDbConnection.table("actor").build(); TableOutputter tableOutputter = Outputs.output(table); TableColumnOutputter tableColumnOutputter = tableOutputter.column(); Position position = (Position) fieldPosition.get(tableColumnOutputter); @@ -701,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(jdbcConnectionProvider, "actor"); + Table table = assertDbConnection.table("actor").build(); TableOutputter tableOutputter = Outputs.output(table); TableRowOutputter tableRowOutputter = tableOutputter.row(); Position position = (Position) fieldPosition.get(tableRowOutputter); @@ -789,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(jdbcConnectionProvider, "select * from actor"); + Request request = assertDbConnection.request("select * from actor").build(); RequestOutputter requestOutputter = Outputs.output(request); RequestColumnOutputter requestColumnOutputter = requestOutputter.column(); Position position = (Position) fieldPosition.get(requestColumnOutputter); @@ -863,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(jdbcConnectionProvider, "select * from actor"); + Request request = assertDbConnection.request("select * from actor").build(); 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 6e10200d..a1096b19 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 @@ -83,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(jdbcConnectionProvider).setStartPointNow(); + Changes changes = assertDbConnection.changes().build().setStartPointNow(); updateChangesForTests(); changes.setEndPointNow(); @@ -177,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(jdbcConnectionProvider, "actor"); + Table table = assertDbConnection.table("actor").build(); TableAssert tableAssert = assertThat(table); TableColumnAssert tableColumnAssert = tableAssert.column(); Position position = (Position) fieldPosition.get(tableColumnAssert); @@ -235,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(jdbcConnectionProvider, "actor"); + Table table = assertDbConnection.table("actor").build(); TableAssert tableAssert = assertThat(table); TableRowAssert tableRowAssert = tableAssert.row(); Position position = (Position) fieldPosition.get(tableRowAssert); @@ -307,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(jdbcConnectionProvider, "select * from actor"); + Request request = assertDbConnection.request("select * from actor").build(); RequestAssert requestAssert = assertThat(request); RequestColumnAssert requestColumnAssert = requestAssert.column(); Position position = (Position) fieldPosition.get(requestColumnAssert); @@ -365,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(jdbcConnectionProvider, "select * from actor"); + Request request = assertDbConnection.request("select * from actor").build(); RequestAssert requestAssert = assertThat(request); RequestRowAssert requestRowAssert = requestAssert.row(); Position position = (Position) fieldPosition.get(requestRowAssert); @@ -431,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(jdbcConnectionProvider).setStartPointNow(); + Changes changes = assertDbConnection.changes().build().setStartPointNow(); updateChangesForTests(); changes.setEndPointNow(); @@ -525,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(jdbcConnectionProvider, "actor"); + Table table = assertDbConnection.table("actor").build(); TableOutputter tableOutputter = Outputs.output(table); TableColumnOutputter tableColumnOutputter = tableOutputter.column(); Position position = (Position) fieldPosition.get(tableColumnOutputter); @@ -583,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(jdbcConnectionProvider, "actor"); + Table table = assertDbConnection.table("actor").build(); TableOutputter tableOutputter = Outputs.output(table); TableRowOutputter tableRowOutputter = tableOutputter.row(); Position position = (Position) fieldPosition.get(tableRowOutputter); @@ -655,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(jdbcConnectionProvider, "select * from actor"); + Request request = assertDbConnection.request("select * from actor").build(); RequestOutputter requestOutputter = Outputs.output(request); RequestColumnOutputter requestColumnOutputter = requestOutputter.column(); Position position = (Position) fieldPosition.get(requestColumnOutputter); @@ -713,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(jdbcConnectionProvider, "select * from actor"); + Request request = assertDbConnection.request("select * from actor").build(); 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 d60f63e8..ae8c18e9 100644 --- a/src/test/java/org/assertj/db/output/OutputterChange_Test.java +++ b/src/test/java/org/assertj/db/output/OutputterChange_Test.java @@ -36,7 +36,7 @@ public class OutputterChange_Test extends AbstractTest { @Test @NeedReload public void test_output() throws Exception { - Changes changes = new Changes(jdbcConnectionProvider).setStartPointNow(); + Changes changes = assertDbConnection.changes().build().setStartPointNow(); updateChangesForTests(); changes.setEndPointNow(); @@ -56,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']%n" + Assertions.assertThat(byteArrayOutputStream0).hasToString(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" @@ -67,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']%n" + Assertions.assertThat(byteArrayOutputStream1).hasToString(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" @@ -78,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']%n" + Assertions.assertThat(byteArrayOutputStream2).hasToString(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" @@ -89,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']%n" + Assertions.assertThat(byteArrayOutputStream3).hasToString(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" @@ -100,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']%n" + Assertions.assertThat(byteArrayOutputStream4).hasToString(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" @@ -111,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']%n" + Assertions.assertThat(byteArrayOutputStream5).hasToString(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" @@ -122,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']%n" + Assertions.assertThat(byteArrayOutputStream6).hasToString(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" @@ -133,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']%n" + Assertions.assertThat(byteArrayOutputStream7).hasToString(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 cea4f6c1..787fb08a 100644 --- a/src/test/java/org/assertj/db/output/OutputterChanges_Test.java +++ b/src/test/java/org/assertj/db/output/OutputterChanges_Test.java @@ -36,13 +36,13 @@ public class OutputterChanges_Test extends AbstractTest { @Test @NeedReload public void test_output() throws Exception { - Changes changes = new Changes(jdbcConnectionProvider).setStartPointNow(); + Changes changes = assertDbConnection.changes().build().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']%n" + Assertions.assertThat(byteArrayOutputStream).hasToString(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 4959e768..5f47b318 100644 --- a/src/test/java/org/assertj/db/output/OutputterColumn_Test.java +++ b/src/test/java/org/assertj/db/output/OutputterColumn_Test.java @@ -37,7 +37,7 @@ public class OutputterColumn_Test extends AbstractTest { */ @Test public void test_output_for_table() throws Exception { - Table table = new Table(jdbcConnectionProvider, "actor"); + Table table = assertDbConnection.table("actor").build(); ByteArrayOutputStream byteArrayOutputStream0 = new ByteArrayOutputStream(); ByteArrayOutputStream byteArrayOutputStream1 = new ByteArrayOutputStream(); @@ -45,7 +45,7 @@ public void test_output_for_table() throws Exception { Outputs.output(table).column().toStream(byteArrayOutputStream0) .column(1).toStream(byteArrayOutputStream1) .column().toStream(byteArrayOutputStream2); - Assertions.assertThat(byteArrayOutputStream0.toString()).isEqualTo(String.format("[Column at index 0 (column name : ID) of ACTOR table]%n" + Assertions.assertThat(byteArrayOutputStream0).hasToString(String.format("[Column at index 0 (column name : ID) of ACTOR table]%n" + "|-----------|----------|%n" + "| | ID |%n" + "| | (NUMBER) |%n" @@ -54,7 +54,7 @@ public void test_output_for_table() throws Exception { + "| Index : 1 | 2 |%n" + "| Index : 2 | 3 |%n" + "|-----------|----------|%n")); - Assertions.assertThat(byteArrayOutputStream1.toString()).isEqualTo(String.format("[Column at index 1 (column name : NAME) of ACTOR table]%n" + Assertions.assertThat(byteArrayOutputStream1).hasToString(String.format("[Column at index 1 (column name : NAME) of ACTOR table]%n" + "|-----------|-------------|%n" + "| | NAME |%n" + "| | (TEXT) |%n" @@ -63,7 +63,7 @@ public void test_output_for_table() throws Exception { + "| Index : 1 | Phoenix |%n" + "| Index : 2 | Worthington |%n" + "|-----------|-------------|%n")); - Assertions.assertThat(byteArrayOutputStream2.toString()).isEqualTo(String.format("[Column at index 2 (column name : FIRSTNAME) of ACTOR table]%n" + Assertions.assertThat(byteArrayOutputStream2).hasToString(String.format("[Column at index 2 (column name : FIRSTNAME) of ACTOR table]%n" + "|-----------|-----------|%n" + "| | FIRSTNAME |%n" + "| | (TEXT) |%n" @@ -79,7 +79,7 @@ public void test_output_for_table() throws Exception { */ @Test public void test_output_for_request() throws Exception { - Request request = new Request(jdbcConnectionProvider, "select * from actor"); + Request request = assertDbConnection.request("select * from actor").build(); ByteArrayOutputStream byteArrayOutputStream0 = new ByteArrayOutputStream(); ByteArrayOutputStream byteArrayOutputStream1 = new ByteArrayOutputStream(); @@ -87,7 +87,7 @@ public void test_output_for_request() throws Exception { Outputs.output(request).column().toStream(byteArrayOutputStream0) .column(1).toStream(byteArrayOutputStream1) .column().toStream(byteArrayOutputStream2); - Assertions.assertThat(byteArrayOutputStream0.toString()).isEqualTo(String.format("[Column at index 0 (column name : ID) of 'select * from actor' request]%n" + Assertions.assertThat(byteArrayOutputStream0).hasToString(String.format("[Column at index 0 (column name : ID) of 'select * from actor' request]%n" + "|-----------|----------|%n" + "| | ID |%n" + "| | (NUMBER) |%n" @@ -96,7 +96,7 @@ public void test_output_for_request() throws Exception { + "| Index : 1 | 2 |%n" + "| Index : 2 | 3 |%n" + "|-----------|----------|%n")); - Assertions.assertThat(byteArrayOutputStream1.toString()).isEqualTo(String.format("[Column at index 1 (column name : NAME) of 'select * from actor' request]%n" + Assertions.assertThat(byteArrayOutputStream1).hasToString(String.format("[Column at index 1 (column name : NAME) of 'select * from actor' request]%n" + "|-----------|-------------|%n" + "| | NAME |%n" + "| | (TEXT) |%n" @@ -105,7 +105,7 @@ public void test_output_for_request() throws Exception { + "| Index : 1 | Phoenix |%n" + "| Index : 2 | Worthington |%n" + "|-----------|-------------|%n")); - Assertions.assertThat(byteArrayOutputStream2.toString()).isEqualTo(String.format("[Column at index 2 (column name : FIRSTNAME) of 'select * from actor' request]%n" + Assertions.assertThat(byteArrayOutputStream2).hasToString(String.format("[Column at index 2 (column name : FIRSTNAME) of 'select * from actor' request]%n" + "|-----------|-----------|%n" + "| | FIRSTNAME |%n" + "| | (TEXT) |%n" @@ -122,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(jdbcConnectionProvider).setStartPointNow(); + Changes changes = assertDbConnection.changes().build().setStartPointNow(); updateChangesForTests(); changes.setEndPointNow(); @@ -132,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']%n" + Assertions.assertThat(byteArrayOutputStream0).hasToString(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" @@ -141,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']%n" + Assertions.assertThat(byteArrayOutputStream1).hasToString(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" @@ -150,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']%n" + Assertions.assertThat(byteArrayOutputStream2).hasToString(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 638ca9cc..93113aa2 100644 --- a/src/test/java/org/assertj/db/output/OutputterException_Test.java +++ b/src/test/java/org/assertj/db/output/OutputterException_Test.java @@ -39,7 +39,7 @@ public class OutputterException_Test extends AbstractTest { */ @Test public void test_display_from_column_for_table() throws Exception { - Table table = new Table(jdbcConnectionProvider, "actor"); + Table table = assertDbConnection.table("actor").build(); try { Outputs.output(table).column(null); @@ -63,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(jdbcConnectionProvider, "select * from actor"); + Request request = assertDbConnection.request("select * from actor").build(); try { Outputs.output(request).column(null); @@ -88,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(jdbcConnectionProvider).setStartPointNow(); + Changes changes = assertDbConnection.changes().build().setStartPointNow(); updateChangesForTests(); changes.setEndPointNow(); @@ -119,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(jdbcConnectionProvider, "actor"); + Table table = assertDbConnection.table("actor").build(); try { Outputs.output(table).row().value(null); @@ -143,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(jdbcConnectionProvider, "select * from actor"); + Request request = assertDbConnection.request("select * from actor").build(); try { Outputs.output(request).row().value(null); @@ -164,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(jdbcConnectionProvider, "select * from actor"); + Request request = assertDbConnection.request("select * from actor").build(); 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 ed25f40b..00ac7afa 100644 --- a/src/test/java/org/assertj/db/output/OutputterRequest_Test.java +++ b/src/test/java/org/assertj/db/output/OutputterRequest_Test.java @@ -34,11 +34,11 @@ public class OutputterRequest_Test extends AbstractTest { */ @Test public void test_output() throws Exception { - Request request = new Request(jdbcConnectionProvider, "select * from actor"); + Request request = assertDbConnection.request("select * from actor").build(); ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream(); output(request).toStream(byteArrayOutputStream); - Assertions.assertThat(byteArrayOutputStream.toString()).isEqualTo(String.format("['select * from actor' request]%n" + Assertions.assertThat(byteArrayOutputStream).hasToString(String.format("['select * from actor' request]%n" + "|-----------|---------|-----------|-------------|-----------|------------|--------------------------------------|%n" + "| | | | | | | |%n" + "| | PRIMARY | ID | NAME | FIRSTNAME | BIRTH | ACTOR_IMDB |%n" @@ -56,7 +56,7 @@ public void test_output() throws Exception { */ @Test public void test_navigation() throws Exception { - Request request = new Request(jdbcConnectionProvider, "select * from actor"); + Request request = assertDbConnection.request("select * from actor").build(); 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 10e35b61..85453164 100644 --- a/src/test/java/org/assertj/db/output/OutputterRow_Test.java +++ b/src/test/java/org/assertj/db/output/OutputterRow_Test.java @@ -37,7 +37,7 @@ public class OutputterRow_Test extends AbstractTest { */ @Test public void test_output_for_table() throws Exception { - Table table = new Table(jdbcConnectionProvider, "actor"); + Table table = assertDbConnection.table("actor").build(); ByteArrayOutputStream byteArrayOutputStream0 = new ByteArrayOutputStream(); ByteArrayOutputStream byteArrayOutputStream1 = new ByteArrayOutputStream(); @@ -45,7 +45,7 @@ public void test_output_for_table() throws Exception { Outputs.output(table).row().toStream(byteArrayOutputStream0) .row(1).toStream(byteArrayOutputStream1) .row().toStream(byteArrayOutputStream2); - Assertions.assertThat(byteArrayOutputStream0.toString()).isEqualTo(String.format("[Row at index 0 of ACTOR table]%n" + Assertions.assertThat(byteArrayOutputStream0).hasToString(String.format("[Row at index 0 of ACTOR table]%n" + "|---------|-----------|-----------|-----------|------------|--------------------------------------|%n" + "| | * | | | | |%n" + "| PRIMARY | ID | NAME | FIRSTNAME | BIRTH | ACTOR_IMDB |%n" @@ -54,7 +54,7 @@ public void test_output_for_table() throws Exception { + "|---------|-----------|-----------|-----------|------------|--------------------------------------|%n" + "| 1 | 1 | Weaver | Sigourney | 1949-10-08 | 30b443ae-c0c9-4790-9bec-ce1380808435 |%n" + "|---------|-----------|-----------|-----------|------------|--------------------------------------|%n")); - Assertions.assertThat(byteArrayOutputStream1.toString()).isEqualTo(String.format("[Row at index 1 of ACTOR table]%n" + Assertions.assertThat(byteArrayOutputStream1).hasToString(String.format("[Row at index 1 of ACTOR table]%n" + "|---------|-----------|-----------|-----------|------------|--------------------------------------|%n" + "| | * | | | | |%n" + "| PRIMARY | ID | NAME | FIRSTNAME | BIRTH | ACTOR_IMDB |%n" @@ -63,7 +63,7 @@ public void test_output_for_table() throws Exception { + "|---------|-----------|-----------|-----------|------------|--------------------------------------|%n" + "| 2 | 2 | Phoenix | Joaquim | 1974-10-28 | 16319617-ae95-4087-9264-d3d21bf611b6 |%n" + "|---------|-----------|-----------|-----------|------------|--------------------------------------|%n")); - Assertions.assertThat(byteArrayOutputStream2.toString()).isEqualTo(String.format("[Row at index 2 of ACTOR table]%n" + Assertions.assertThat(byteArrayOutputStream2).hasToString(String.format("[Row at index 2 of ACTOR table]%n" + "|---------|-----------|-------------|-----------|------------|--------------------------------------|%n" + "| | * | | | | |%n" + "| PRIMARY | ID | NAME | FIRSTNAME | BIRTH | ACTOR_IMDB |%n" @@ -79,7 +79,7 @@ public void test_output_for_table() throws Exception { */ @Test public void test_output_for_request() throws Exception { - Request request = new Request(jdbcConnectionProvider, "select * from actor"); + Request request = assertDbConnection.request("select * from actor").build(); ByteArrayOutputStream byteArrayOutputStream0 = new ByteArrayOutputStream(); ByteArrayOutputStream byteArrayOutputStream1 = new ByteArrayOutputStream(); @@ -87,7 +87,7 @@ public void test_output_for_request() throws Exception { Outputs.output(request).row().toStream(byteArrayOutputStream0) .row(1).toStream(byteArrayOutputStream1) .row().toStream(byteArrayOutputStream2); - Assertions.assertThat(byteArrayOutputStream0.toString()).isEqualTo(String.format("[Row at index 0 of 'select * from actor' request]%n" + Assertions.assertThat(byteArrayOutputStream0).hasToString(String.format("[Row at index 0 of 'select * from actor' request]%n" + "|---------|-----------|-----------|-----------|------------|--------------------------------------|%n" + "| | | | | | |%n" + "| PRIMARY | ID | NAME | FIRSTNAME | BIRTH | ACTOR_IMDB |%n" @@ -96,7 +96,7 @@ public void test_output_for_request() throws Exception { + "|---------|-----------|-----------|-----------|------------|--------------------------------------|%n" + "| | 1 | Weaver | Sigourney | 1949-10-08 | 30b443ae-c0c9-4790-9bec-ce1380808435 |%n" + "|---------|-----------|-----------|-----------|------------|--------------------------------------|%n")); - Assertions.assertThat(byteArrayOutputStream1.toString()).isEqualTo(String.format("[Row at index 1 of 'select * from actor' request]%n" + Assertions.assertThat(byteArrayOutputStream1).hasToString(String.format("[Row at index 1 of 'select * from actor' request]%n" + "|---------|-----------|-----------|-----------|------------|--------------------------------------|%n" + "| | | | | | |%n" + "| PRIMARY | ID | NAME | FIRSTNAME | BIRTH | ACTOR_IMDB |%n" @@ -105,7 +105,7 @@ public void test_output_for_request() throws Exception { + "|---------|-----------|-----------|-----------|------------|--------------------------------------|%n" + "| | 2 | Phoenix | Joaquim | 1974-10-28 | 16319617-ae95-4087-9264-d3d21bf611b6 |%n" + "|---------|-----------|-----------|-----------|------------|--------------------------------------|%n")); - Assertions.assertThat(byteArrayOutputStream2.toString()).isEqualTo(String.format("[Row at index 2 of 'select * from actor' request]%n" + Assertions.assertThat(byteArrayOutputStream2).hasToString(String.format("[Row at index 2 of 'select * from actor' request]%n" + "|---------|-----------|-------------|-----------|------------|--------------------------------------|%n" + "| | | | | | |%n" + "| PRIMARY | ID | NAME | FIRSTNAME | BIRTH | ACTOR_IMDB |%n" @@ -122,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(jdbcConnectionProvider).setStartPointNow(); + Changes changes = assertDbConnection.changes().build().setStartPointNow(); updateChangesForTests(); changes.setEndPointNow(); @@ -132,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']%n" + Assertions.assertThat(byteArrayOutputStream0).hasToString(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']%n" + Assertions.assertThat(byteArrayOutputStream1).hasToString(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" @@ -143,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' (only modification changes)]%n" + Assertions.assertThat(byteArrayOutputStream2).hasToString(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 8fa8d8c4..c61d0abf 100644 --- a/src/test/java/org/assertj/db/output/OutputterTable_Test.java +++ b/src/test/java/org/assertj/db/output/OutputterTable_Test.java @@ -34,11 +34,11 @@ public class OutputterTable_Test extends AbstractTest { */ @Test public void test_output() throws Exception { - Table table = new Table(jdbcConnectionProvider, "actor"); + Table table = assertDbConnection.table("actor").build(); ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream(); output(table).toStream(byteArrayOutputStream); - Assertions.assertThat(byteArrayOutputStream.toString()).isEqualTo(String.format("[ACTOR table]%n" + Assertions.assertThat(byteArrayOutputStream).hasToString(String.format("[ACTOR table]%n" + "|-----------|---------|-----------|-------------|-----------|------------|--------------------------------------|%n" + "| | | * | | | | |%n" + "| | PRIMARY | ID | NAME | FIRSTNAME | BIRTH | ACTOR_IMDB |%n" @@ -56,7 +56,7 @@ public void test_output() throws Exception { */ @Test public void test_navigation() throws Exception { - Table table = new Table(jdbcConnectionProvider, "actor"); + Table table = assertDbConnection.table("actor").build(); 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 defa44ca..1f97b9d3 100644 --- a/src/test/java/org/assertj/db/output/OutputterToConsole_Test.java +++ b/src/test/java/org/assertj/db/output/OutputterToConsole_Test.java @@ -33,13 +33,13 @@ public class OutputterToConsole_Test extends AbstractTest { */ @Test public void test_output_to_console() throws Exception { - Table table = new Table(jdbcConnectionProvider, "actor"); + Table table = assertDbConnection.table("actor").build(); ByteArrayOutputStream byteArrayOutputStream0 = new ByteArrayOutputStream(); System.setOut(new PrintStream(byteArrayOutputStream0)); Outputs.output(table).row().value().toConsole(); System.setOut(System.out); - Assertions.assertThat(byteArrayOutputStream0.toString()).isEqualTo(String.format("[Value at index 0 (column name : ID) of Row at index 0 of ACTOR table]%n" + Assertions.assertThat(byteArrayOutputStream0).hasToString(String.format("[Value at index 0 (column name : ID) of Row at index 0 of ACTOR table]%n" + "|----------|%n" + "| ID |%n" + "| (NUMBER) |%n" 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 fe4e2d68..957d11d4 100644 --- a/src/test/java/org/assertj/db/output/OutputterToFile_Test.java +++ b/src/test/java/org/assertj/db/output/OutputterToFile_Test.java @@ -34,7 +34,7 @@ public class OutputterToFile_Test extends AbstractTest { */ @Test public void test_output_to_file() throws Exception { - Table table = new Table(jdbcConnectionProvider, "actor"); + Table table = assertDbConnection.table("actor").build(); 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 55d7e2b0..9530f26f 100644 --- a/src/test/java/org/assertj/db/output/OutputterToStream_Test.java +++ b/src/test/java/org/assertj/db/output/OutputterToStream_Test.java @@ -32,11 +32,11 @@ public class OutputterToStream_Test extends AbstractTest { */ @Test public void test_output_to_stream() throws Exception { - Table table = new Table(jdbcConnectionProvider, "actor"); + Table table = assertDbConnection.table("actor").build(); ByteArrayOutputStream byteArrayOutputStream0 = new ByteArrayOutputStream(); Outputs.output(table).row().value().toStream(byteArrayOutputStream0); - Assertions.assertThat(byteArrayOutputStream0.toString()).isEqualTo(String.format("[Value at index 0 (column name : ID) of Row at index 0 of ACTOR table]%n" + Assertions.assertThat(byteArrayOutputStream0).hasToString(String.format("[Value at index 0 (column name : ID) of Row at index 0 of ACTOR table]%n" + "|----------|%n" + "| ID |%n" + "| (NUMBER) |%n" 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 635cd8bf..75888eda 100644 --- a/src/test/java/org/assertj/db/output/OutputterValue_Test.java +++ b/src/test/java/org/assertj/db/output/OutputterValue_Test.java @@ -37,7 +37,7 @@ public class OutputterValue_Test extends AbstractTest { */ @Test public void test_output_for_row_from_table() throws Exception { - Table table = new Table(jdbcConnectionProvider, "actor"); + Table table = assertDbConnection.table("actor").build(); ByteArrayOutputStream byteArrayOutputStream0 = new ByteArrayOutputStream(); ByteArrayOutputStream byteArrayOutputStream1 = new ByteArrayOutputStream(); @@ -47,28 +47,28 @@ public void test_output_for_row_from_table() throws Exception { .value(1).toStream(byteArrayOutputStream1) .value().toStream(byteArrayOutputStream2) .row(2).value(2).toStream(byteArrayOutputStream3); - Assertions.assertThat(byteArrayOutputStream0.toString()).isEqualTo(String.format("[Value at index 0 (column name : ID) of Row at index 0 of ACTOR table]%n" + Assertions.assertThat(byteArrayOutputStream0).hasToString(String.format("[Value at index 0 (column name : ID) of Row at index 0 of ACTOR table]%n" + "|----------|%n" + "| ID |%n" + "| (NUMBER) |%n" + "|----------|%n" + "| 1 |%n" + "|----------|%n")); - Assertions.assertThat(byteArrayOutputStream1.toString()).isEqualTo(String.format("[Value at index 1 (column name : NAME) of Row at index 0 of ACTOR table]%n" + Assertions.assertThat(byteArrayOutputStream1).hasToString(String.format("[Value at index 1 (column name : NAME) of Row at index 0 of ACTOR table]%n" + "|--------|%n" + "| NAME |%n" + "| (TEXT) |%n" + "|--------|%n" + "| Weaver |%n" + "|--------|%n")); - Assertions.assertThat(byteArrayOutputStream2.toString()).isEqualTo(String.format("[Value at index 2 (column name : FIRSTNAME) of Row at index 0 of ACTOR table]%n" + Assertions.assertThat(byteArrayOutputStream2).hasToString(String.format("[Value at index 2 (column name : FIRSTNAME) of Row at index 0 of ACTOR table]%n" + "|-----------|%n" + "| FIRSTNAME |%n" + "| (TEXT) |%n" + "|-----------|%n" + "| Sigourney |%n" + "|-----------|%n")); - Assertions.assertThat(byteArrayOutputStream3.toString()).isEqualTo(String.format("[Value at index 2 (column name : FIRSTNAME) of Row at index 2 of ACTOR table]%n" + Assertions.assertThat(byteArrayOutputStream3).hasToString(String.format("[Value at index 2 (column name : FIRSTNAME) of Row at index 2 of ACTOR table]%n" + "|-----------|%n" + "| FIRSTNAME |%n" + "| (TEXT) |%n" @@ -82,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(jdbcConnectionProvider, "select * from actor"); + Request request = assertDbConnection.request("select * from actor").build(); ByteArrayOutputStream byteArrayOutputStream0 = new ByteArrayOutputStream(); ByteArrayOutputStream byteArrayOutputStream1 = new ByteArrayOutputStream(); @@ -92,28 +92,28 @@ public void test_output_for_row_from_request() throws Exception { .value(1).toStream(byteArrayOutputStream1) .value().toStream(byteArrayOutputStream2) .row(2).value(2).toStream(byteArrayOutputStream3); - Assertions.assertThat(byteArrayOutputStream0.toString()).isEqualTo(String.format("[Value at index 0 (column name : ID) of Row at index 0 of 'select * from actor' request]%n" + Assertions.assertThat(byteArrayOutputStream0).hasToString(String.format("[Value at index 0 (column name : ID) of Row at index 0 of 'select * from actor' request]%n" + "|----------|%n" + "| ID |%n" + "| (NUMBER) |%n" + "|----------|%n" + "| 1 |%n" + "|----------|%n")); - Assertions.assertThat(byteArrayOutputStream1.toString()).isEqualTo(String.format("[Value at index 1 (column name : NAME) of Row at index 0 of 'select * from actor' request]%n" + Assertions.assertThat(byteArrayOutputStream1).hasToString(String.format("[Value at index 1 (column name : NAME) of Row at index 0 of 'select * from actor' request]%n" + "|--------|%n" + "| NAME |%n" + "| (TEXT) |%n" + "|--------|%n" + "| Weaver |%n" + "|--------|%n")); - Assertions.assertThat(byteArrayOutputStream2.toString()).isEqualTo(String.format("[Value at index 2 (column name : FIRSTNAME) of Row at index 0 of 'select * from actor' request]%n" + Assertions.assertThat(byteArrayOutputStream2).hasToString(String.format("[Value at index 2 (column name : FIRSTNAME) of Row at index 0 of 'select * from actor' request]%n" + "|-----------|%n" + "| FIRSTNAME |%n" + "| (TEXT) |%n" + "|-----------|%n" + "| Sigourney |%n" + "|-----------|%n")); - Assertions.assertThat(byteArrayOutputStream3.toString()).isEqualTo(String.format("[Value at index 2 (column name : FIRSTNAME) of Row at index 2 of 'select * from actor' request]%n" + Assertions.assertThat(byteArrayOutputStream3).hasToString(String.format("[Value at index 2 (column name : FIRSTNAME) of Row at index 2 of 'select * from actor' request]%n" + "|-----------|%n" + "| FIRSTNAME |%n" + "| (TEXT) |%n" @@ -128,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(jdbcConnectionProvider).setStartPointNow(); + Changes changes = assertDbConnection.changes().build().setStartPointNow(); updateChangesForTests(); changes.setEndPointNow(); @@ -140,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']%n" + Assertions.assertThat(byteArrayOutputStream0).hasToString(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' (only modification changes)]%n" + Assertions.assertThat(byteArrayOutputStream1).hasToString(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' (only modification changes)]%n" + Assertions.assertThat(byteArrayOutputStream2).hasToString(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' (only modification changes)]%n" + Assertions.assertThat(byteArrayOutputStream3).hasToString(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" @@ -175,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(jdbcConnectionProvider, "actor"); + Table table = assertDbConnection.table("actor").build(); ByteArrayOutputStream byteArrayOutputStream0 = new ByteArrayOutputStream(); ByteArrayOutputStream byteArrayOutputStream1 = new ByteArrayOutputStream(); @@ -185,28 +185,28 @@ public void test_output_for_column_from_table() throws Exception { .value(1).toStream(byteArrayOutputStream1) .value().toStream(byteArrayOutputStream2) .column("name").value(2).toStream(byteArrayOutputStream3); - Assertions.assertThat(byteArrayOutputStream0.toString()).isEqualTo(String.format("[Value at index 0 of Column at index 0 (column name : ID) of ACTOR table]%n" + Assertions.assertThat(byteArrayOutputStream0).hasToString(String.format("[Value at index 0 of Column at index 0 (column name : ID) of ACTOR table]%n" + "|----------|%n" + "| ID |%n" + "| (NUMBER) |%n" + "|----------|%n" + "| 1 |%n" + "|----------|%n")); - Assertions.assertThat(byteArrayOutputStream1.toString()).isEqualTo(String.format("[Value at index 1 of Column at index 0 (column name : ID) of ACTOR table]%n" + Assertions.assertThat(byteArrayOutputStream1).hasToString(String.format("[Value at index 1 of Column at index 0 (column name : ID) of ACTOR table]%n" + "|----------|%n" + "| ID |%n" + "| (NUMBER) |%n" + "|----------|%n" + "| 2 |%n" + "|----------|%n")); - Assertions.assertThat(byteArrayOutputStream2.toString()).isEqualTo(String.format("[Value at index 2 of Column at index 0 (column name : ID) of ACTOR table]%n" + Assertions.assertThat(byteArrayOutputStream2).hasToString(String.format("[Value at index 2 of Column at index 0 (column name : ID) of ACTOR table]%n" + "|----------|%n" + "| ID |%n" + "| (NUMBER) |%n" + "|----------|%n" + "| 3 |%n" + "|----------|%n")); - Assertions.assertThat(byteArrayOutputStream3.toString()).isEqualTo(String.format("[Value at index 2 of Column at index 1 (column name : NAME) of ACTOR table]%n" + Assertions.assertThat(byteArrayOutputStream3).hasToString(String.format("[Value at index 2 of Column at index 1 (column name : NAME) of ACTOR table]%n" + "|-------------|%n" + "| NAME |%n" + "| (TEXT) |%n" @@ -220,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(jdbcConnectionProvider, "select * from actor"); + Request request = assertDbConnection.request("select * from actor").build(); ByteArrayOutputStream byteArrayOutputStream0 = new ByteArrayOutputStream(); ByteArrayOutputStream byteArrayOutputStream1 = new ByteArrayOutputStream(); @@ -230,7 +230,7 @@ public void test_output_for_column_from_request() throws Exception { .value(1).toStream(byteArrayOutputStream1) .value().toStream(byteArrayOutputStream2) .column("name").value(2).toStream(byteArrayOutputStream3); - Assertions.assertThat(byteArrayOutputStream0.toString()).isEqualTo(String.format( + Assertions.assertThat(byteArrayOutputStream0).hasToString(String.format( "[Value at index 0 of Column at index 0 (column name : ID) of 'select * from actor' request]%n" + "|----------|%n" + "| ID |%n" @@ -238,21 +238,21 @@ public void test_output_for_column_from_request() throws Exception { + "|----------|%n" + "| 1 |%n" + "|----------|%n")); - Assertions.assertThat(byteArrayOutputStream1.toString()).isEqualTo(String.format("[Value at index 1 of Column at index 0 (column name : ID) of 'select * from actor' request]%n" + Assertions.assertThat(byteArrayOutputStream1).hasToString(String.format("[Value at index 1 of Column at index 0 (column name : ID) of 'select * from actor' request]%n" + "|----------|%n" + "| ID |%n" + "| (NUMBER) |%n" + "|----------|%n" + "| 2 |%n" + "|----------|%n")); - Assertions.assertThat(byteArrayOutputStream2.toString()).isEqualTo(String.format("[Value at index 2 of Column at index 0 (column name : ID) of 'select * from actor' request]%n" + Assertions.assertThat(byteArrayOutputStream2).hasToString(String.format("[Value at index 2 of Column at index 0 (column name : ID) of 'select * from actor' request]%n" + "|----------|%n" + "| ID |%n" + "| (NUMBER) |%n" + "|----------|%n" + "| 3 |%n" + "|----------|%n")); - Assertions.assertThat(byteArrayOutputStream3.toString()).isEqualTo(String.format("[Value at index 2 of Column at index 1 (column name : NAME) of 'select * from actor' request]%n" + Assertions.assertThat(byteArrayOutputStream3).hasToString(String.format("[Value at index 2 of Column at index 1 (column name : NAME) of 'select * from actor' request]%n" + "|-------------|%n" + "| NAME |%n" + "| (TEXT) |%n" @@ -267,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(jdbcConnectionProvider).setStartPointNow(); + Changes changes = assertDbConnection.changes().build().setStartPointNow(); updateChangesForTests(); changes.setEndPointNow(); @@ -277,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']%n" + Assertions.assertThat(byteArrayOutputStream0).hasToString(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']%n" + Assertions.assertThat(byteArrayOutputStream1).hasToString(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']%n" + Assertions.assertThat(byteArrayOutputStream2).hasToString(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/type/CachedSchemaMetaData_Test.java b/src/test/java/org/assertj/db/type/CachedSchemaMetaData_Test.java index f1d5d61d..9dc6e478 100644 --- a/src/test/java/org/assertj/db/type/CachedSchemaMetaData_Test.java +++ b/src/test/java/org/assertj/db/type/CachedSchemaMetaData_Test.java @@ -12,16 +12,14 @@ */ package org.assertj.db.type; -import org.assertj.db.common.AbstractTest; -import org.junit.Test; +import static org.assertj.core.api.Assertions.assertThat; -import javax.xml.validation.Schema; -import java.sql.Time; -import java.text.ParseException; -import java.time.LocalTime; -import java.util.Calendar; +import java.sql.DriverManager; +import java.sql.SQLException; -import static org.assertj.core.api.Assertions.assertThat; +import org.assertj.db.common.AbstractTest; +import org.assertj.db.common.DefaultConnectionProvider; +import org.junit.Test; /** * Tests on the cached schema metadata. @@ -30,21 +28,27 @@ */ public class CachedSchemaMetaData_Test extends AbstractTest { + final DefaultConnectionProvider provider; + + public CachedSchemaMetaData_Test() throws SQLException { + this.provider = new DefaultConnectionProvider(DriverManager.getConnection("jdbc:h2:mem:test", "sa", "")); + } + @Test public void test_get_tables() { - CachedSchemaMetaData metaData = new CachedSchemaMetaData(jdbcConnectionProvider); + CachedSchemaMetaData metaData = new CachedSchemaMetaData(provider); assertThat(metaData.getTablesName()).containsExactly("ACTOR", "INTERPRETATION", "MOVIE", "TEST", "TEST2"); } @Test public void test_get_columns() { - CachedSchemaMetaData metaData = new CachedSchemaMetaData(jdbcConnectionProvider); + CachedSchemaMetaData metaData = new CachedSchemaMetaData(provider); assertThat(metaData.getColumnsName("ACTOR")).containsExactly("ID", "NAME", "FIRSTNAME", "BIRTH", "ACTOR_IMDB"); } @Test public void test_get_primary_keys() { - CachedSchemaMetaData metaData = new CachedSchemaMetaData(jdbcConnectionProvider); + CachedSchemaMetaData metaData = new CachedSchemaMetaData(provider); assertThat(metaData.getPrimaryKeys("ACTOR")).containsExactly("ID"); } } diff --git a/src/test/java/org/assertj/db/type/Change_Exception_Test.java b/src/test/java/org/assertj/db/type/Change_Exception_Test.java index 5fbf6054..13c690f7 100644 --- a/src/test/java/org/assertj/db/type/Change_Exception_Test.java +++ b/src/test/java/org/assertj/db/type/Change_Exception_Test.java @@ -19,7 +19,7 @@ import org.junit.Test; /** - * Tests on the exceptions of Change + * Tests on the exceptions to the Change * * @author RĂ©gis Pouiller */ 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 28ab6c3c..f2892a68 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 @@ -32,7 +32,7 @@ public class Change_GetDataType_Test extends AbstractTest { @Test @NeedReload public void test_getDataTypeOfTable() { - Changes changes = new Changes(jdbcConnectionProvider).setStartPointNow(); + Changes changes = assertDbConnection.changes().build().setStartPointNow(); updateChangesForTests(); changes.setEndPointNow(); @@ -45,7 +45,7 @@ public void test_getDataTypeOfTable() { @Test @NeedReload public void test_getDataTypeOfRequest() { - Changes changes = new Changes(new Request(jdbcConnectionProvider, "select * from movie")).setStartPointNow(); + Changes changes = assertDbConnection.changes().request(assertDbConnection.request("select * from movie").build()).build().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 97ac7e0d..0a88f6f7 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 @@ -30,7 +30,7 @@ public class Changes_Constructor_Test extends AbstractTest { */ @Test public void test_constructor_jdbc() { - Changes changes = new Changes(jdbcConnectionProvider); + Changes changes = assertDbConnection.changes().build(); assertThat(changes.getRequestAtStartPoint()).isNull(); assertThat(changes.getRequestAtEndPoint()).isNull(); @@ -43,19 +43,19 @@ public void test_constructor_jdbc() { assertThat(changes.getRequestAtEndPoint()).isNull(); assertThat(changes.getTablesAtStartPointList()).isNotNull(); assertThat(changes.getTablesAtStartPointList()).hasSize(5); - assertThat(changes.getTablesAtStartPointList().get(0).getConnectionProvider()).isSameAs(jdbcConnectionProvider); + assertThat(changes.getTablesAtStartPointList().get(0).getConnectionProvider()).isNotNull(); assertThat(changes.getTablesAtStartPointList().get(0).getName()).isEqualTo("ACTOR"); assertThat(changes.getTablesAtStartPointList().get(0).getRequest()).isEqualTo("SELECT * FROM ACTOR"); - assertThat(changes.getTablesAtStartPointList().get(1).getConnectionProvider()).isSameAs(jdbcConnectionProvider); + assertThat(changes.getTablesAtStartPointList().get(1).getConnectionProvider()).isNotNull(); assertThat(changes.getTablesAtStartPointList().get(1).getName()).isEqualTo("INTERPRETATION"); assertThat(changes.getTablesAtStartPointList().get(1).getRequest()).isEqualTo("SELECT * FROM INTERPRETATION"); - assertThat(changes.getTablesAtStartPointList().get(2).getConnectionProvider()).isSameAs(jdbcConnectionProvider); + assertThat(changes.getTablesAtStartPointList().get(2).getConnectionProvider()).isNotNull(); assertThat(changes.getTablesAtStartPointList().get(2).getName()).isEqualTo("MOVIE"); assertThat(changes.getTablesAtStartPointList().get(2).getRequest()).isEqualTo("SELECT * FROM MOVIE"); - assertThat(changes.getTablesAtStartPointList().get(3).getConnectionProvider()).isSameAs(jdbcConnectionProvider); + assertThat(changes.getTablesAtStartPointList().get(3).getConnectionProvider()).isNotNull(); assertThat(changes.getTablesAtStartPointList().get(3).getName()).isEqualTo("TEST"); assertThat(changes.getTablesAtStartPointList().get(3).getRequest()).isEqualTo("SELECT * FROM TEST"); - assertThat(changes.getTablesAtStartPointList().get(4).getConnectionProvider()).isSameAs(jdbcConnectionProvider); + assertThat(changes.getTablesAtStartPointList().get(4).getConnectionProvider()).isNotNull(); assertThat(changes.getTablesAtStartPointList().get(4).getName()).isEqualTo("TEST2"); assertThat(changes.getTablesAtStartPointList().get(4).getRequest()).isEqualTo("SELECT * FROM TEST2"); assertThat(changes.getTablesAtEndPointList()).isNull(); @@ -66,111 +66,36 @@ public void test_constructor_jdbc() { assertThat(changes.getRequestAtEndPoint()).isNull(); assertThat(changes.getTablesAtStartPointList()).isNotNull(); assertThat(changes.getTablesAtStartPointList()).hasSize(5); - assertThat(changes.getTablesAtStartPointList().get(0).getConnectionProvider()).isSameAs(jdbcConnectionProvider); + assertThat(changes.getTablesAtStartPointList().get(0).getConnectionProvider()).isNotNull(); assertThat(changes.getTablesAtStartPointList().get(0).getName()).isEqualTo("ACTOR"); assertThat(changes.getTablesAtStartPointList().get(0).getRequest()).isEqualTo("SELECT * FROM ACTOR"); - assertThat(changes.getTablesAtStartPointList().get(1).getConnectionProvider()).isSameAs(jdbcConnectionProvider); + assertThat(changes.getTablesAtStartPointList().get(1).getConnectionProvider()).isNotNull(); assertThat(changes.getTablesAtStartPointList().get(1).getName()).isEqualTo("INTERPRETATION"); assertThat(changes.getTablesAtStartPointList().get(1).getRequest()).isEqualTo("SELECT * FROM INTERPRETATION"); - assertThat(changes.getTablesAtStartPointList().get(2).getConnectionProvider()).isSameAs(jdbcConnectionProvider); + assertThat(changes.getTablesAtStartPointList().get(2).getConnectionProvider()).isNotNull(); assertThat(changes.getTablesAtStartPointList().get(2).getName()).isEqualTo("MOVIE"); assertThat(changes.getTablesAtStartPointList().get(2).getRequest()).isEqualTo("SELECT * FROM MOVIE"); - assertThat(changes.getTablesAtStartPointList().get(3).getConnectionProvider()).isSameAs(jdbcConnectionProvider); + assertThat(changes.getTablesAtStartPointList().get(3).getConnectionProvider()).isNotNull(); assertThat(changes.getTablesAtStartPointList().get(3).getName()).isEqualTo("TEST"); assertThat(changes.getTablesAtStartPointList().get(3).getRequest()).isEqualTo("SELECT * FROM TEST"); - assertThat(changes.getTablesAtStartPointList().get(4).getConnectionProvider()).isSameAs(jdbcConnectionProvider); + assertThat(changes.getTablesAtStartPointList().get(4).getConnectionProvider()).isNotNull(); 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()).hasSize(5); - assertThat(changes.getTablesAtEndPointList().get(0).getConnectionProvider()).isSameAs(jdbcConnectionProvider); + assertThat(changes.getTablesAtEndPointList().get(0).getConnectionProvider()).isNotNull(); assertThat(changes.getTablesAtEndPointList().get(0).getName()).isEqualTo("ACTOR"); assertThat(changes.getTablesAtEndPointList().get(0).getRequest()).isEqualTo("SELECT * FROM ACTOR"); - assertThat(changes.getTablesAtEndPointList().get(1).getConnectionProvider()).isSameAs(jdbcConnectionProvider); + assertThat(changes.getTablesAtEndPointList().get(1).getConnectionProvider()).isNotNull(); assertThat(changes.getTablesAtEndPointList().get(1).getName()).isEqualTo("INTERPRETATION"); assertThat(changes.getTablesAtEndPointList().get(1).getRequest()).isEqualTo("SELECT * FROM INTERPRETATION"); - assertThat(changes.getTablesAtEndPointList().get(2).getConnectionProvider()).isSameAs(jdbcConnectionProvider); + assertThat(changes.getTablesAtEndPointList().get(2).getConnectionProvider()).isNotNull(); assertThat(changes.getTablesAtEndPointList().get(2).getName()).isEqualTo("MOVIE"); assertThat(changes.getTablesAtEndPointList().get(2).getRequest()).isEqualTo("SELECT * FROM MOVIE"); - assertThat(changes.getTablesAtEndPointList().get(3).getConnectionProvider()).isSameAs(jdbcConnectionProvider); + assertThat(changes.getTablesAtEndPointList().get(3).getConnectionProvider()).isNotNull(); assertThat(changes.getTablesAtEndPointList().get(3).getName()).isEqualTo("TEST"); assertThat(changes.getTablesAtEndPointList().get(3).getRequest()).isEqualTo("SELECT * FROM TEST"); - 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"); - } - - /** - * This method test the constructor with datasource. - */ - @Test - public void test_constructor_datasource() { - Changes changes = new Changes(dsConnectionProvider); - - assertThat(changes.getRequestAtStartPoint()).isNull(); - assertThat(changes.getRequestAtEndPoint()).isNull(); - assertThat(changes.getTablesAtStartPointList()).isNull(); - assertThat(changes.getTablesAtEndPointList()).isNull(); - - changes.setStartPointNow(); - - assertThat(changes.getRequestAtStartPoint()).isNull(); - assertThat(changes.getRequestAtEndPoint()).isNull(); - assertThat(changes.getTablesAtStartPointList()).isNotNull(); - 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).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).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).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).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(); - - changes.setEndPointNow(); - - assertThat(changes.getRequestAtStartPoint()).isNull(); - assertThat(changes.getRequestAtEndPoint()).isNull(); - assertThat(changes.getTablesAtStartPointList()).isNotNull(); - 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).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).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).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).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()).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).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).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).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).getConnectionProvider()).isSameAs(dsConnectionProvider); + assertThat(changes.getTablesAtEndPointList().get(4).getConnectionProvider()).isNotNull(); assertThat(changes.getTablesAtEndPointList().get(4).getName()).isEqualTo("TEST2"); assertThat(changes.getTablesAtEndPointList().get(4).getRequest()).isEqualTo("SELECT * FROM TEST2"); } @@ -180,7 +105,7 @@ public void test_constructor_datasource() { */ @Test public void test_constructor_one_table() { - Changes changes = new Changes(new Table(jdbcConnectionProvider, "test")); + Changes changes = assertDbConnection.changes().tables(assertDbConnection.table("test").build()).build(); assertThat(changes.getRequestAtStartPoint()).isNull(); assertThat(changes.getRequestAtEndPoint()).isNull(); @@ -189,7 +114,8 @@ public void test_constructor_one_table() { changes.setStartPointNow(); assertThat(changes.getTablesAtStartPointList()).isNotNull(); assertThat(changes.getTablesAtStartPointList()).hasSize(1); - assertThat(changes.getTablesAtStartPointList().get(0).getConnectionProvider()).isSameAs(jdbcConnectionProvider); + assertThat(changes.getTablesAtStartPointList().get(0).getConnectionProvider()).isNotNull(); + assertThat(changes.getTablesAtStartPointList().get(0).getConnectionProvider()).isNotNull(); assertThat(changes.getTablesAtStartPointList().get(0).getName()).isEqualTo("TEST"); assertThat(changes.getTablesAtStartPointList().get(0).getRequest()).isEqualTo("SELECT * FROM TEST"); @@ -197,7 +123,7 @@ public void test_constructor_one_table() { changes.setEndPointNow(); assertThat(changes.getTablesAtEndPointList()).isNotNull(); assertThat(changes.getTablesAtEndPointList()).hasSize(1); - assertThat(changes.getTablesAtEndPointList().get(0).getConnectionProvider()).isSameAs(jdbcConnectionProvider); + assertThat(changes.getTablesAtEndPointList().get(0).getConnectionProvider()).isNotNull(); assertThat(changes.getTablesAtEndPointList().get(0).getName()).isEqualTo("TEST"); assertThat(changes.getTablesAtEndPointList().get(0).getRequest()).isEqualTo("SELECT * FROM TEST"); } @@ -207,7 +133,9 @@ public void test_constructor_one_table() { */ @Test public void test_constructor_two_tables() { - Changes changes = new Changes(new Table(jdbcConnectionProvider, "test"), new Table(dsConnectionProvider, "test2")); + Changes changes = assertDbConnection.changes() + .tables(assertDbConnection.table("test").build(), assertDbConnection.table("test2").build()) + .build(); assertThat(changes.getRequestAtStartPoint()).isNull(); assertThat(changes.getRequestAtEndPoint()).isNull(); @@ -216,10 +144,10 @@ public void test_constructor_two_tables() { changes.setStartPointNow(); assertThat(changes.getTablesAtStartPointList()).isNotNull(); assertThat(changes.getTablesAtStartPointList()).hasSize(2); - assertThat(changes.getTablesAtStartPointList().get(0).getConnectionProvider()).isSameAs(jdbcConnectionProvider); + assertThat(changes.getTablesAtStartPointList().get(0)).isNotNull(); assertThat(changes.getTablesAtStartPointList().get(0).getName()).isEqualTo("TEST"); assertThat(changes.getTablesAtStartPointList().get(0).getRequest()).isEqualTo("SELECT * FROM TEST"); - assertThat(changes.getTablesAtStartPointList().get(1).getConnectionProvider()).isSameAs(dsConnectionProvider); + assertThat(changes.getTablesAtStartPointList().get(1).getName()).isNotNull(); assertThat(changes.getTablesAtStartPointList().get(1).getName()).isEqualTo("TEST2"); assertThat(changes.getTablesAtStartPointList().get(1).getRequest()).isEqualTo("SELECT * FROM TEST2"); @@ -227,10 +155,10 @@ public void test_constructor_two_tables() { changes.setEndPointNow(); assertThat(changes.getTablesAtEndPointList()).isNotNull(); assertThat(changes.getTablesAtEndPointList()).hasSize(2); - assertThat(changes.getTablesAtEndPointList().get(0).getConnectionProvider()).isSameAs(jdbcConnectionProvider); + assertThat(changes.getTablesAtEndPointList().get(0).getName()).isNotNull(); assertThat(changes.getTablesAtEndPointList().get(0).getName()).isEqualTo("TEST"); assertThat(changes.getTablesAtEndPointList().get(0).getRequest()).isEqualTo("SELECT * FROM TEST"); - assertThat(changes.getTablesAtEndPointList().get(1).getConnectionProvider()).isSameAs(dsConnectionProvider); + assertThat(changes.getTablesAtEndPointList().get(1).getName()).isNotNull(); assertThat(changes.getTablesAtEndPointList().get(1).getName()).isEqualTo("TEST2"); assertThat(changes.getTablesAtEndPointList().get(1).getRequest()).isEqualTo("SELECT * FROM TEST2"); } @@ -240,7 +168,7 @@ public void test_constructor_two_tables() { */ @Test public void test_constructor_request() { - Changes changes = new Changes(new Request(jdbcConnectionProvider, "select * from test")); + Changes changes = assertDbConnection.changes().request(assertDbConnection.request("select * from test").build()).build(); assertThat(changes.getRequestAtStartPoint()).isNull(); assertThat(changes.getRequestAtEndPoint()).isNull(); @@ -250,7 +178,7 @@ public void test_constructor_request() { changes.setStartPointNow(); assertThat(changes.getRequestAtStartPoint()).isNotNull(); - assertThat(changes.getRequestAtStartPoint().getConnectionProvider()).isSameAs(jdbcConnectionProvider); + assertThat(changes.getRequestAtStartPoint().getConnectionProvider()).isNotNull(); assertThat(changes.getRequestAtStartPoint().getRequest()).isEqualTo("select * from test"); assertThat(changes.getRequestAtEndPoint()).isNull(); assertThat(changes.getTablesAtStartPointList()).isNull(); @@ -260,7 +188,7 @@ public void test_constructor_request() { assertThat(changes.getRequestAtStartPoint()).isNotNull(); assertThat(changes.getRequestAtEndPoint()).isNotNull(); - assertThat(changes.getRequestAtEndPoint().getConnectionProvider()).isSameAs(jdbcConnectionProvider); + assertThat(changes.getRequestAtEndPoint().getConnectionProvider()).isNotNull(); 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 adfe4d7d..65021d2e 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 @@ -39,9 +39,9 @@ public class Changes_Exception_Test extends AbstractTest { */ @Test(expected = AssertJDBException.class) public void should_fail_because_connection_throws_exception_when_getting_an_object() { - ConnectionProvider connectionProvider = ConnectionProviderFactory.of(new DefaultDataSource(dataSource)).create(); - Table table = new Table(connectionProvider, "movi"); - Changes changes = new Changes().setTables(table); + AssertDbConnection connectionProvider = AssertDbConnectionFactory.of(new DefaultDataSource(dataSource)).create(); + Table table = connectionProvider.table("movi").build(); + Changes changes = connectionProvider.changes().tables(table).build(); changes.setStartPointNow(); } @@ -63,9 +63,9 @@ public DatabaseMetaData getMetaData() throws SQLException { }; } }; - ConnectionProvider connectionProvider = ConnectionProviderFactory.of(ds).create(); - Table table = new Table(connectionProvider, "movi"); - Changes changes = new Changes().setTables(table); + AssertDbConnection connectionProvider = AssertDbConnectionFactory.of(ds).create(); + Table table = connectionProvider.table("movi").build(); + Changes changes = connectionProvider.changes().tables(table).build(); changes.setStartPointNow(); } @@ -93,9 +93,9 @@ public ResultSet executeQuery(String sql) throws SQLException { }; } }; - ConnectionProvider connectionProvider = ConnectionProviderFactory.of(ds).create(); - Table table = new Table(connectionProvider, "movi"); - Changes changes = new Changes().setTables(table); + AssertDbConnection connectionProvider = AssertDbConnectionFactory.of(ds).create(); + Table table = connectionProvider.table("movi").build(); + Changes changes = connectionProvider.changes().tables(table).build(); changes.setStartPointNow(); } @@ -116,9 +116,9 @@ public DatabaseMetaData getMetaData() throws SQLException { }; } }; - ConnectionProvider connectionProvider = ConnectionProviderFactory.of(ds).create(); - Table table = new Table(connectionProvider, "movi"); - Changes changes = new Changes().setTables(table); + AssertDbConnection connectionProvider = AssertDbConnectionFactory.of(ds).create(); + Table table = connectionProvider.table("movi").build(); + Changes changes = connectionProvider.changes().tables(table).build(); changes.setStartPointNow(); } @@ -139,9 +139,9 @@ public Statement createStatement() throws SQLException { }; } }; - ConnectionProvider connectionProvider = ConnectionProviderFactory.of(ds).create(); - Table table = new Table(connectionProvider, "movi"); - Changes changes = new Changes().setTables(table); + AssertDbConnection connectionProvider = AssertDbConnectionFactory.of(ds).create(); + Table table = connectionProvider.table("movi").build(); + Changes changes = connectionProvider.changes().tables(table).build(); changes.setStartPointNow(); } @@ -156,35 +156,19 @@ public Connection getConnection() throws SQLException { throw new SQLException(); } }; - ConnectionProvider connectionProvider = ConnectionProviderFactory.of(ds).create(); - Table table = new Table(connectionProvider, "movi"); - Changes changes = new Changes().setTables(table); + AssertDbConnection connectionProvider = AssertDbConnectionFactory.of(ds).create(); + Table table = connectionProvider.table("movi").build(); + Changes changes = connectionProvider.changes().tables(table).build(); changes.setStartPointNow(); } - /** - * This method should fail because the table is null. - */ - @Test(expected = NullPointerException.class) - public void should_fail_because_table_is_null() { - new Changes().setTables((Table) null); - } - - /** - * This method should fail because the request is null. - */ - @Test(expected = NullPointerException.class) - public void should_fail_because_request_is_null() { - new Changes().setRequest(null); - } - /** * This method should fail because setting end point before start point. */ @Test(expected = AssertJDBException.class) public void should_fail_because_end_before_start() { - Table table = new Table(dsConnectionProvider, "test"); - Changes changes = new Changes().setTables(table); + Table table = assertDbConnection.table("test").build(); + Changes changes = assertDbConnection.changes().tables(table).build(); changes.setEndPointNow(); } @@ -193,8 +177,8 @@ 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(dsConnectionProvider, "test"); - Changes changes = new Changes().setTables(table); + Table table = assertDbConnection.table("test").build(); + Changes changes = assertDbConnection.changes().tables(table).build(); changes.setStartPointNow(); changes.getChangesList(); } @@ -204,7 +188,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(jdbcConnectionProvider).getChangesOfTable(null); + assertDbConnection.changes().build().getChangesOfTable(null); } /** @@ -212,6 +196,6 @@ public void should_fail_because_tablename_is_null() { */ @Test(expected = NullPointerException.class) public void should_fail_because_type_is_null() { - new Changes(jdbcConnectionProvider).getChangesOfType(null); + assertDbConnection.changes().build().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 916fbfca..087d244f 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 @@ -36,11 +36,10 @@ public class Changes_GetChangesOfTable_Test extends AbstractTest { @Test @NeedReload public void test_getChangesOfTable() { - 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")); + Changes changesSource = assertDbConnection.changes().build(); + Changes changesRequest = assertDbConnection.changes().request(assertDbConnection.request("select interpretation.id, character, movie.title, actor.name " + + " from interpretation, movie, actor " + " where interpretation.id_movie = movie.id " + + " and interpretation.id_actor = actor.id ").pksName("id").build()).build(); changesRequest.setStartPointNow(); changesSource.setStartPointNow(); 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 2d8cc2c3..d614429c 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 @@ -36,11 +36,10 @@ public class Changes_GetChangesOfType_Test extends AbstractTest { @Test @NeedReload public void test_getChangesOfTable() { - 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")); + Changes changesSource = assertDbConnection.changes().build(); + Changes changesRequest = assertDbConnection.changes().request(assertDbConnection.request("select interpretation.id, character, movie.title, actor.name " + + " from interpretation, movie, actor " + " where interpretation.id_movie = movie.id " + + " and interpretation.id_actor = actor.id ").pksName("id").build()).build(); changesRequest.setStartPointNow(); changesSource.setStartPointNow(); 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 3e038cfc..6a60defd 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 @@ -35,7 +35,7 @@ public class Changes_GetChanges_Test extends AbstractTest { @Test @NeedReload public void test_getChangesOfTableAndType() { - Changes changesSource = new Changes(jdbcConnectionProvider); + Changes changesSource = assertDbConnection.changes().build(); changesSource.setStartPointNow(); updateChangesForTests(); @@ -66,7 +66,7 @@ public void test_getChangesOfTableAndType() { @Test @NeedReload public void test_getChangesOfTypeAndTable() { - Changes changesSource = new Changes(jdbcConnectionProvider); + Changes changesSource = assertDbConnection.changes().build(); 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 77fb41f5..206a3ad3 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 @@ -16,7 +16,6 @@ import java.math.BigDecimal; import java.sql.Date; -import java.sql.SQLException; import java.sql.Time; import java.sql.Timestamp; import java.util.UUID; @@ -38,7 +37,7 @@ public class Changes_Request_GetChangesList_Test extends AbstractTest { */ @Test public void test_when_there_is_no_change() { - Changes changes = new Changes(new Request(dsConnectionProvider, "select * from test")); + Changes changes = assertDbConnection.changes().request(assertDbConnection.request("select * from test").build()).build(); changes.setStartPointNow(); changes.setEndPointNow(); assertThat(changes.getChangesList()).hasSize(0); @@ -46,13 +45,11 @@ public void test_when_there_is_no_change() { /** * This method test when there is no change found because it is another table. - * - * @throws SQLException */ @Test @NeedReload - public void test_when_there_is_no_change_found() throws SQLException { - Changes changes = new Changes(new Request(dsConnectionProvider, "select * from test")); + public void test_when_there_is_no_change_found() { + Changes changes = assertDbConnection.changes().request(assertDbConnection.request("select * from test").build()).build(); changes.setStartPointNow(); update("delete from test2 where VAR1 is null"); changes.setEndPointNow(); @@ -61,13 +58,11 @@ public void test_when_there_is_no_change_found() throws SQLException { /** * This method test when there is a deletion change. - * - * @throws SQLException */ @Test @NeedReload - public void test_when_there_is_deletion_change() throws SQLException { - Changes changes = new Changes(new Request(dsConnectionProvider, "select * from test2")); + public void test_when_there_is_deletion_change() { + Changes changes = assertDbConnection.changes().request(assertDbConnection.request("select * from test2").build()).build(); changes.setStartPointNow(); update("delete from test2 where VAR1 is null"); changes.setEndPointNow(); @@ -100,13 +95,11 @@ public void test_when_there_is_deletion_change() throws SQLException { /** * This method test when there is a creation change. - * - * @throws SQLException */ @Test @NeedReload - public void test_when_there_is_creation_change() throws SQLException { - Changes changes = new Changes(new Request(dsConnectionProvider, "select * from test2")); + public void test_when_there_is_creation_change() { + Changes changes = assertDbConnection.changes().request(assertDbConnection.request("select * from test2").build()).build(); changes.setStartPointNow(); update("insert into test2(VAR1) values(200)"); changes.setEndPointNow(); @@ -139,13 +132,11 @@ public void test_when_there_is_creation_change() throws SQLException { /** * This method test when there is a modification change without primary key. - * - * @throws SQLException */ @Test @NeedReload - public void test_when_there_is_modification_change_without_primary_key() throws SQLException { - Changes changes = new Changes(new Request(dsConnectionProvider, "select * from test2")); + public void test_when_there_is_modification_change_without_primary_key() { + Changes changes = assertDbConnection.changes().request(assertDbConnection.request("select * from test2").build()).build(); changes.setStartPointNow(); update("update test2 set VAR12 = 'modification' where VAR1 = 1"); changes.setEndPointNow(); @@ -206,13 +197,11 @@ public void test_when_there_is_modification_change_without_primary_key() throws /** * This method test when there is a modification change with primary key. - * - * @throws SQLException */ @Test @NeedReload - public void test_when_there_is_modification_change_with_primary_key() throws SQLException { - Changes changes = new Changes(new Request(dsConnectionProvider, "select * from interpretation").setPksName("id")); + public void test_when_there_is_modification_change_with_primary_key() { + Changes changes = assertDbConnection.changes().request(assertDbConnection.request("select * from interpretation").pksName("id").build()).build(); changes.setStartPointNow(); update("update interpretation set character = 'Doctor Grace Augustine' where id = 3"); changes.setEndPointNow(); @@ -234,13 +223,11 @@ public void test_when_there_is_modification_change_with_primary_key() throws SQL /** * This method test when there is a creation change with primary key. - * - * @throws SQLException */ @Test @NeedReload - public void test_when_there_is_creation_change_with_primary_key() throws SQLException { - Changes changes = new Changes(new Request(dsConnectionProvider, "select * from movie").setPksName("id")); + public void test_when_there_is_creation_change_with_primary_key() { + Changes changes = assertDbConnection.changes().request(assertDbConnection.request("select * from movie").pksName("id").build()).build(); changes.setStartPointNow(); update("insert into movie values(4, 'Ghostbusters', 1984, '16319617-AE95-4087-9264-D3D21BF611B6')"); changes.setEndPointNow(); @@ -261,13 +248,11 @@ public void test_when_there_is_creation_change_with_primary_key() throws SQLExce /** * This method test when there is a deletion change with primary key. - * - * @throws SQLException */ @Test @NeedReload - public void test_when_there_is_deletion_change_with_primary_key() throws SQLException { - Changes changes = new Changes(new Request(dsConnectionProvider, "select * from interpretation").setPksName("id")); + public void test_when_there_is_deletion_change_with_primary_key() { + Changes changes = assertDbConnection.changes().request((assertDbConnection.request("select * from interpretation").pksName("id").build())).build(); 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 deleted file mode 100644 index 561fca75..00000000 --- a/src/test/java/org/assertj/db/type/Changes_SetTables_Test.java +++ /dev/null @@ -1,34 +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 org.assertj.db.common.AbstractTest; -import org.junit.Test; - -/** - * Tests on the setTables method. - * - * @author RĂ©gis Pouiller - * @author Julien Roy - */ -public class Changes_SetTables_Test extends AbstractTest { - - /** - * This method test when setting with empty parameters. - */ - @Test - public void test_when_setting_tables_with_empty_parameters() { - 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 c2bf257d..1a815a0b 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 @@ -39,7 +39,7 @@ public class Changes_Table_GetChangesList_Test extends AbstractTest { */ @Test public void test_when_there_is_no_change() { - Changes changes = new Changes(jdbcConnectionProvider); + Changes changes = assertDbConnection.changes().build(); changes.setStartPointNow(); changes.setEndPointNow(); assertThat(changes.getChangesList()).hasSize(0); @@ -52,8 +52,8 @@ 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(jdbcConnectionProvider, "test")); + public void test_when_there_is_no_change_found() { + Changes changes = assertDbConnection.changes().tables(assertDbConnection.table("test").build()).build(); changes.setStartPointNow(); update("delete from test2 where VAR1 is null"); changes.setEndPointNow(); @@ -67,8 +67,8 @@ 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(jdbcConnectionProvider); + public void test_when_there_is_deletion_change() { + Changes changes = assertDbConnection.changes().build(); changes.setStartPointNow(); update("delete from test2 where VAR1 is null"); changes.setEndPointNow(); @@ -106,8 +106,8 @@ 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(jdbcConnectionProvider); + public void test_when_there_is_creation_change() { + Changes changes = assertDbConnection.changes().build(); changes.setStartPointNow(); update("insert into test2(VAR1) values(200)"); changes.setEndPointNow(); @@ -146,8 +146,8 @@ 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(jdbcConnectionProvider); + public void test_when_there_is_modification_change_without_primary_key() { + Changes changes = assertDbConnection.changes().build(); changes.setStartPointNow(); update("update test2 set VAR12 = 'modification' where VAR1 = 1"); changes.setEndPointNow(); @@ -218,8 +218,8 @@ 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(jdbcConnectionProvider); + public void test_when_there_is_modification_change_with_primary_key() { + Changes changes = assertDbConnection.changes().build(); changes.setStartPointNow(); update("update interpretation set character = 'Doctor Grace Augustine' where id = 3"); changes.setEndPointNow(); @@ -246,8 +246,8 @@ 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(jdbcConnectionProvider, "movie")); + public void test_when_there_is_creation_change_with_primary_key() { + Changes changes = assertDbConnection.changes().tables(assertDbConnection.table("movie").build()).build(); changes.setStartPointNow(); update("insert into movie values(4, 'Ghostbusters', 1984, '16319617-AE95-4087-9264-D3D21BF611B6')"); changes.setEndPointNow(); @@ -273,8 +273,8 @@ 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(jdbcConnectionProvider, "interpretation")); + public void test_when_there_is_deletion_change_with_primary_key() { + Changes changes = assertDbConnection.changes().tables(assertDbConnection.table("interpretation").build()).build(); changes.setStartPointNow(); update("delete interpretation where id = 3"); changes.setEndPointNow(); diff --git a/src/test/java/org/assertj/db/type/DateTimeValue_Test.java b/src/test/java/org/assertj/db/type/DateTimeValue_Test.java index 724d305a..534c2fd7 100644 --- a/src/test/java/org/assertj/db/type/DateTimeValue_Test.java +++ b/src/test/java/org/assertj/db/type/DateTimeValue_Test.java @@ -474,9 +474,9 @@ public void test_of() throws ParseException { */ @Test public void test_toString() { - assertThat(DateTimeValue.of(DateValue.of(2007, 12, 23), TimeValue.of(9, 1, 6, 3)).toString()).isEqualTo( + assertThat(DateTimeValue.of(DateValue.of(2007, 12, 23), TimeValue.of(9, 1, 6, 3))).hasToString( "2007-12-23T09:01:06.000000003"); - assertThat(DateTimeValue.of(DateValue.of(2007, 2, 3), TimeValue.of(9, 1, 6, 3)).toString()).isEqualTo( + assertThat(DateTimeValue.of(DateValue.of(2007, 2, 3), TimeValue.of(9, 1, 6, 3))).hasToString( "2007-02-03T09:01:06.000000003"); } diff --git a/src/test/java/org/assertj/db/type/DateValue_Test.java b/src/test/java/org/assertj/db/type/DateValue_Test.java index 5103463b..e820b9fa 100644 --- a/src/test/java/org/assertj/db/type/DateValue_Test.java +++ b/src/test/java/org/assertj/db/type/DateValue_Test.java @@ -282,8 +282,8 @@ public void test_of() throws ParseException { */ @Test public void test_toString() { - assertThat(DateValue.of(2007, 12, 23).toString()).isEqualTo("2007-12-23"); - assertThat(DateValue.of(2007, 2, 3).toString()).isEqualTo("2007-02-03"); + assertThat(DateValue.of(2007, 12, 23)).hasToString("2007-12-23"); + assertThat(DateValue.of(2007, 2, 3)).hasToString("2007-02-03"); } /** 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 e1723aed..fe0f692c 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 @@ -33,30 +33,12 @@ public class Request_Columns_Name_Test extends AbstractTest { * This method test the columns name got from a {@code ConnectionProvider}. */ @Test - 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" - + " AND interpretation.id_actor = actor.id" - + " ORDER BY actor.name, movie.year"); - - assertThat(request.getColumnsNameList()).as("Columns of the request") - .hasSize(4) - .containsExactly("NAME", "FIRSTNAME", "YEAR", "CHARACTER"); - } - - /** - * This method test the columns name got from a {@code DataSource}. - */ - @Test - public void test_columns_name_with_datasource_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" - + " AND interpretation.id_actor = actor.id" - + " ORDER BY actor.name, movie.year"); + public void test_columns_name() { + Request request = assertDbConnection.request("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").build(); assertThat(request.getColumnsNameList()).as("Columns of the request") .hasSize(4) @@ -67,33 +49,16 @@ public void test_columns_name_with_datasource_set() { * This method test the columns name got from a {@code ConnectionProvider}. */ @Test - 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" - + " AND interpretation.id_actor = actor.id" - + " AND movie.year > ?" - + " ORDER BY actor.name, movie.year", 2000); - - assertThat(request.getColumnsNameList()).as("Columns of the request") - .hasSize(4) - .containsExactly("NAME", "FIRSTNAME", "YEAR", "CHARACTER"); - } - - /** - * This method test the columns name got from a {@code DataSource}. - */ - @Test - public void test_columns_name_with_datasource_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" - + " AND interpretation.id_actor = actor.id" - + " AND movie.year > ?" - + " ORDER BY actor.name, movie.year") - .setParameters(2000); + public void test_columns_name_with_parameters_set() { + Request request = assertDbConnection.request( + "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" + + " AND movie.year > ?" + + " ORDER BY actor.name, movie.year") + .parameters(2000) + .build(); assertThat(request.getColumnsNameList()).as("Columns of the request") .hasSize(4) @@ -106,7 +71,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(dsConnectionProvider, "select * from interpret"); + Table table = assertDbConnection.table("select * from interpret").build(); 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 31873329..bc5bd5c1 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 @@ -12,11 +12,11 @@ */ package org.assertj.db.type; -import static org.assertj.core.api.Assertions.assertThat; - import org.assertj.db.common.AbstractTest; import org.junit.Test; +import static org.assertj.core.api.Assertions.assertThat; + /** * Tests on the columns of {@code Request}. *

@@ -32,12 +32,12 @@ public class Request_Columns_Test extends AbstractTest { * This method test the columns got from a {@code ConnectionProvider}. */ @Test - public void test_columns_with_jdbc_set() { - Request request = new Request(jdbcConnectionProvider, "SELECT actor.name, actor.firstname, movie.year, interpretation.character " + public void test_columns() { + Request request = assertDbConnection.request("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"); + + " ORDER BY actor.name, movie.year").build(); Column columnFromIndex = request.getColumn(1); @@ -55,11 +55,11 @@ public void test_columns_with_jdbc_set() { */ @Test public void test_columns_with_datasource_set() { - Request request = new Request(dsConnectionProvider, "SELECT actor.name, actor.firstname, movie.year, interpretation.character " + Request request = assertDbConnection.request("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"); + + " ORDER BY actor.name, movie.year").build(); Column columnFromIndex = request.getColumn(1); 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 0c5cf56a..0f974732 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,15 +38,7 @@ public class Request_Exception_Test extends AbstractTest { */ @Test(expected = AssertJDBException.class) public void should_fail_because_setting_primarykey_which_donot_exist() { - new Request(dsConnectionProvider, "select var1 from test").setPksName("var2").getRowsList(); - } - - /** - * This method should fail because setting the connection provider to null. - */ - @Test(expected = NullPointerException.class) - public void should_fail_because_setting_connection_provider_to_null() { - new Request().setConnectionProvider(null); + assertDbConnection.request("select var1 from test").pksName("var2").build().getRowsList(); } /** @@ -55,8 +47,8 @@ public void should_fail_because_setting_connection_provider_to_null() { @Test(expected = AssertJDBException.class) public void should_fail_because_connection_throws_exception_when_getting_an_object() { DataSource ds = new DefaultDataSource(dataSource); - ConnectionProvider connectionProvider = ConnectionProviderFactory.of(ds).create(); - Request request = new Request(connectionProvider, "select * from movi where id = ?", 1); + AssertDbConnection connection = AssertDbConnectionFactory.of(ds).create(); + Request request = connection.request("select * from movi where id = ?").parameters(1).build(); request.getColumnsNameList(); } @@ -83,8 +75,8 @@ public ResultSet executeQuery() throws SQLException { }; } }; - ConnectionProvider connectionProvider = ConnectionProviderFactory.of(ds).create(); - Request request = new Request(connectionProvider, "select * from movi where id = ?", 1); + AssertDbConnection connection = AssertDbConnectionFactory.of(ds).create(); + Request request = connection.request("select * from movi where id = ?").parameters(1).build(); request.getColumnsNameList(); } @@ -105,8 +97,8 @@ public DatabaseMetaData getMetaData() throws SQLException { }; } }; - ConnectionProvider connectionProvider = ConnectionProviderFactory.of(ds).create(); - Request request = new Request(connectionProvider, "select * from movi where id = ?", 1); + AssertDbConnection connection = AssertDbConnectionFactory.of(ds).create(); + Request request = connection.request("select * from movi where id = ?").parameters(1).build(); request.getColumnsNameList(); } @@ -127,8 +119,8 @@ public PreparedStatement prepareStatement(String sql) throws SQLException { }; } }; - ConnectionProvider connectionProvider = ConnectionProviderFactory.of(ds).create(); - Request request = new Request(connectionProvider, "select * from movi where id = ?", 1); + AssertDbConnection connection = AssertDbConnectionFactory.of(ds).create(); + Request request = connection.request("select * from movi where id = ?").parameters(1).build(); request.getColumnsNameList(); } @@ -143,8 +135,8 @@ public Connection getConnection() throws SQLException { throw new SQLException(); } }; - ConnectionProvider connectionProvider = ConnectionProviderFactory.of(ds).create(); - Request request = new Request(connectionProvider, "select * from movi where id = ?", 1); + AssertDbConnection connection = AssertDbConnectionFactory.of(ds).create(); + Request request = connection.request("select * from movi where id = ?").parameters(1).build(); 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 beece44f..d793b129 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 @@ -32,15 +32,15 @@ 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(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"); + String sqlRequest = "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"; + Request request = assertDbConnection.request(sqlRequest).build(); assertThat(request.getRowFromPksValues(getValue(null, 1L))).isNull(); assertThat(request.getRowFromPksValues(getValue(null, 3))).isNull(); - request.setPksName("id"); + request = assertDbConnection.request(sqlRequest).pksName("id").build(); assertThat(request.getRowFromPksValues()).isNull(); assertThat(request.getRowFromPksValues(getValue(null, 1L), getValue(null, 3))).isNull(); @@ -51,10 +51,10 @@ 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(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"); + String sqlRequest = "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"; + Request request = assertDbConnection.request(sqlRequest).pksName("id").build(); assertThat(request.getRowFromPksValues(getValue(null, 3)).getValuesList().get(0).getValue()).isEqualTo("Weaver"); assertThat(request.getRowFromPksValues(getValue(null, 3)).getValuesList().get(1).getValue()).isEqualTo("Sigourney"); @@ -67,7 +67,7 @@ public void test_getting_row_from_primary_keys_values_with_finding() throws Exce assertThat(request.getRowFromPksValues(getValue(null, 1L)).getValuesList().get(3).getValue()).isEqualTo(new BigDecimal(1)); assertThat(request.getRowFromPksValues(getValue(null, 1L)).getValuesList().get(4).getValue()).isEqualTo("Ellen Louise Ripley"); - request.setPksName("character"); + request = assertDbConnection.request(sqlRequest).pksName("character").build(); assertThat(request.getRowFromPksValues(getValue(null, "Lucius Hunt")).getValuesList().get(0).getValue()).isEqualTo("Phoenix"); assertThat(request.getRowFromPksValues(getValue(null, "Lucius Hunt")).getValuesList().get(1).getValue()).isEqualTo("Joaquim"); @@ -75,7 +75,7 @@ public void test_getting_row_from_primary_keys_values_with_finding() throws Exce assertThat(request.getRowFromPksValues(getValue(null, "Lucius Hunt")).getValuesList().get(3).getValue()).isEqualTo(new BigDecimal(4)); assertThat(request.getRowFromPksValues(getValue(null, "Lucius Hunt")).getValuesList().get(4).getValue()).isEqualTo("Lucius Hunt"); - request.setPksName("name", "year"); + request = assertDbConnection.request(sqlRequest).pksName("name", "year").build(); assertThat(request.getRowFromPksValues(getValue(null, "Weaver"), getValue(null, "2004")).getValuesList().get(0).getValue()).isEqualTo("Weaver"); assertThat(request.getRowFromPksValues(getValue(null, "Weaver"), getValue(null, "2004")).getValuesList().get(1).getValue()).isEqualTo("Sigourney"); 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 240a06c0..c702e5e3 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 @@ -28,31 +28,18 @@ */ public class Request_Getters_Test extends AbstractTest { - /** - * This method test the getters of a {@code Table} when only the jdbc connection is set. - */ - @Test - public void test_getters_with_only_jdbc_connection_set() { - Request request = new Request().setConnectionProvider(jdbcConnectionProvider); - - assertThat(request.getConnectionProvider()).isSameAs(jdbcConnectionProvider); - assertThat(request.getRequest()).isNull(); - assertThat(request.getParameters()).isNull(); - } - /** * This method test the getters of a {@code Table} when the jdbc connection and the name are set. */ @Test - 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"); + public void test_getters_with_name_set() { + Request request = assertDbConnection.request("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").build(); - assertThat(request.getConnectionProvider()).as("Source of MOVIE table").isSameAs(jdbcConnectionProvider); + assertThat(request.getConnectionProvider()).isNotNull(); assertThat(request.getRequest()).isEqualTo("SELECT actor.name, actor.firstname, movie.year, interpretation.character " + " FROM movie, actor, interpretation" + " WHERE movie.id = interpretation.id_movie" @@ -66,16 +53,18 @@ public void test_getters_with_jdbc_and_name_set() { * are set. */ @Test - 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" - + " AND interpretation.id_actor = actor.id" - + " AND movie.year > ?" - + " ORDER BY actor.name, movie.year", 2000); + public void test_getters_with_name_and_columns_set() { + Request request = assertDbConnection.request( + "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" + + " AND movie.year > ?" + + " ORDER BY actor.name, movie.year") + .parameters(2000) + .build(); - assertThat(request.getConnectionProvider()).as("Source of MOVIE table").isSameAs(jdbcConnectionProvider); + assertThat(request.getConnectionProvider()).isNotNull(); 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 f8128810..4981161a 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 @@ -28,47 +28,11 @@ public class Request_Instantiation_Test extends AbstractTest { /** - * This method should throw a {@code NullPointerException}, because the {@code ConnectionProvider} parameter is {@code null}. + * This method should throw a {@code IllegalArgumentException}, because request is {@code null}. */ - @Test(expected = NullPointerException.class) - 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 ConnectionProvider} parameter is not {@code null} - * and request is {@code null}. - */ - @Test(expected = NullPointerException.class) - 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 ConnectionProvider} parameter is {@code null} - * and request is {@code null}. - */ - @Test(expected = NullPointerException.class) - 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 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_connection_provider_or_datasource() { - new Request().getColumnsNameList(); - } - - /** - * 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_connection_provider_and_without_setting_table_name() { - new Request().setConnectionProvider(jdbcConnectionProvider).getColumnsNameList(); + @Test(expected = IllegalArgumentException.class) + public void should_throw_IllegalArgumentException_if_instantiate_with_table_name_null() { + assertDbConnection.request(null).build(); } /** @@ -77,7 +41,7 @@ public void should_throw_NullPointerException_if_get_list_of_columns_name_with_s */ @Test(expected = AssertJDBException.class) 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 request = AssertDbConnectionFactory.of("jdbc:h2:mem:test", "", "").create().request("").build(); 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 5ec0dcc4..b61bef1a 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 @@ -34,12 +34,11 @@ public class Request_PrimaryKeys_Name_Test extends AbstractTest { */ @Test 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" - + " AND interpretation.id_actor = actor.id" - + " ORDER BY actor.name, movie.year"); + Request request = assertDbConnection.request("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").build(); assertThat(request.getPksNameList()).as("Primary Keys of the request") .hasSize(0); @@ -49,13 +48,12 @@ public void test_pks_name_with_jdbc_set_but_not_primary_keys() { * This method test the primary keys name got from a {@code JdbcUrlConnectionProvider}. */ @Test - 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" - + " AND interpretation.id_actor = actor.id" - + " ORDER BY actor.name, movie.year").setPksName("NAME"); + public void test_pks_name() { + Request request = assertDbConnection.request("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").pksName("NAME").build(); assertThat(request.getPksNameList()).as("Primary Keys of the request") .hasSize(1) @@ -66,31 +64,17 @@ public void test_pks_name_with_jdbc_set() { * 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(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" - + " ORDER BY actor.name, movie.year").setPksName("NAME"); - - assertThat(request.getPksNameList()).as("Primary Keys of the request") - .hasSize(1) - .containsExactly("NAME"); - } - - /** - * This method test the primary keys name got from a {@code DataSourceConnectionProvider}. - */ - @Test - 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" - + " AND interpretation.id_actor = actor.id" - + " AND movie.year > ?" - + " ORDER BY actor.name, movie.year", 2000).setPksName("NAME", "ID"); + public void test_pks_name_with_parameters_set() { + Request request = assertDbConnection.request( + "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" + + " AND movie.year > ?" + + " ORDER BY actor.name, movie.year") + .parameters(2000) + .pksName("NAME", "ID") + .build(); assertThat(request.getPksNameList()).as("Primary Keys of the request") .hasSize(2) @@ -102,14 +86,15 @@ public void test_pks_name_with_jdbc_and_parameters_set() { */ @Test public void test_pks_name_with_datasource_and_parameters_set() { - Request request = new Request(dsConnectionProvider, - "SELECT actor.name, actor.firstname, movie.year, interpretation.character " + Request request = assertDbConnection.request("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" + " AND movie.year > ?" + " ORDER BY actor.name, movie.year") - .setParameters(2000).setPksName("NAME", "ID"); + .parameters(2000) + .pksName("NAME", "ID") + .build(); assertThat(request.getPksNameList()).as("Primary Keys of the request") .hasSize(2) @@ -122,8 +107,8 @@ 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(dsConnectionProvider, "select * from interpret"); - table.getPksNameList(); + Request request = assertDbConnection.request("select * from interpret").build(); + request.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 1769dc53..832ce1b2 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 @@ -34,12 +34,12 @@ public class Request_Rows_Test extends AbstractTest { * This method test the rows got from a {@code ConnectionProvider}. */ @Test - public void test_rows_with_jdbc_set() { - Request request = new Request(jdbcConnectionProvider, "SELECT actor.name, actor.firstname, movie.year, interpretation.character " + public void test_rows() { + Request request = assertDbConnection.request("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"); + + " ORDER BY actor.name, movie.year").build(); assertThat(request.getRowsList()).as("Values of the request") .hasSize(5); @@ -70,51 +70,16 @@ public void test_rows_with_jdbc_set() { assertThat(request.getRow(4).getValuesList().get(3).getValue()).isEqualTo("Jake Sully"); } - /** - * This method test the rows got from a {@code DataSource}. - */ - @Test - public void test_rows_with_datasource_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" - + " AND interpretation.id_actor = actor.id" - + " ORDER BY actor.name, movie.year"); - - assertThat(request.getRowsList()).as("Values of the request") - .hasSize(5); - assertThat(request.getRow(0).getValuesList().get(0).getValue()).isEqualTo("Phoenix"); - assertThat(request.getRow(0).getValuesList().get(1).getValue()).isEqualTo("Joaquim"); - assertThat(request.getRow(0).getValuesList().get(2).getValue()).isEqualTo(new BigDecimal(2004)); - assertThat(request.getRow(0).getValuesList().get(3).getValue()).isEqualTo("Lucius Hunt"); - assertThat(request.getRow(1).getValuesList().get(0).getValue()).isEqualTo("Weaver"); - assertThat(request.getRow(1).getValuesList().get(1).getValue()).isEqualTo("Sigourney"); - assertThat(request.getRow(1).getValuesList().get(2).getValue()).isEqualTo(new BigDecimal(1979)); - assertThat(request.getRow(1).getValuesList().get(3).getValue()).isEqualTo("Ellen Louise Ripley"); - assertThat(request.getRow(2).getValuesList().get(0).getValue()).isEqualTo("Weaver"); - assertThat(request.getRow(2).getValuesList().get(1).getValue()).isEqualTo("Sigourney"); - assertThat(request.getRow(2).getValuesList().get(2).getValue()).isEqualTo(new BigDecimal(2004)); - assertThat(request.getRow(2).getValuesList().get(3).getValue()).isEqualTo("Alice Hunt"); - assertThat(request.getRow(3).getValuesList().get(0).getValue()).isEqualTo("Weaver"); - assertThat(request.getRow(3).getValuesList().get(1).getValue()).isEqualTo("Sigourney"); - assertThat(request.getRow(3).getValuesList().get(2).getValue()).isEqualTo(new BigDecimal(2009)); - assertThat(request.getRow(3).getValuesList().get(3).getValue()).isEqualTo("Dr Grace Augustine"); - assertThat(request.getRow(4).getValuesList().get(0).getValue()).isEqualTo("Worthington"); - assertThat(request.getRow(4).getValuesList().get(1).getValue()).isEqualTo("Sam"); - assertThat(request.getRow(4).getValuesList().get(2).getValue()).isEqualTo(new BigDecimal(2009)); - assertThat(request.getRow(4).getValuesList().get(3).getValue()).isEqualTo("Jake Sully"); - } - /** * This method should throw a {@code NullPointerException} because of calling {@code getColumnValue} with null in parameter. */ @Test(expected = NullPointerException.class) public void should_throw_NullPointerException_because_column_name_parameter_is_null_when_calling_getColumnValue() { - Request request = new Request(dsConnectionProvider, "SELECT actor.name, actor.firstname, movie.year, interpretation.character " + Request request = assertDbConnection.request("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"); + + " ORDER BY actor.name, movie.year").build(); request.getRow(0).getColumnValue(null); } @@ -123,11 +88,11 @@ 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(dsConnectionProvider, "SELECT actor.name, actor.firstname, movie.year, interpretation.character " + Request request = assertDbConnection.request("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"); + + " ORDER BY actor.name, movie.year").build(); assertThat(request.getRow(0).getColumnValue("not_exist")).isNull(); } 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 be6cb9aa..3d331bd6 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 @@ -30,70 +30,38 @@ public class Table_Columns_Name_Test extends AbstractTest { /** - * This method test the columns got from a {@code ConnectionProvider}. + * This method test the columns got from a {@code Connection}. */ @Test - public void test_columns_name_with_jdbc_set() { - Table table = new Table(jdbcConnectionProvider, "movie"); + public void test_columns_name() { + Table table = assertDbConnection.table("movie").build(); 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 DataSource}. + * This method test the columns got from a {@code Connection} when the columns to check are set. */ @Test - public void test_columns_name_with_datasource_set() { - 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 ConnectionProvider} when the columns to check are set. - */ - @Test - public void test_columns_name_to_check_with_jdbc_set() { - Table table = new Table(jdbcConnectionProvider, "actor", new String[]{"id", "name", "birth"}, null); + public void test_columns_name_to_check() { + Table table = assertDbConnection.table("actor").columnsToCheck(new String[]{"id", "name", "birth"}).build(); assertThat(table.getColumnsNameList()).as("Columns of ACTOR table").hasSize(3) .containsExactly("ID", "NAME", "BIRTH"); } /** - * This method test the columns got from a {@code DataSource} when the columns to check are set. + * This method test the columns got from a {@code Connection} when the columns to exclude are set. */ @Test - public void test_columns_name_to_check_with_datasource_set() { - 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 ConnectionProvider} when the columns to exclude are set. - */ - @Test - public void test_columns_name_to_exclude_with_jdbc_set() { - Table table = new Table(jdbcConnectionProvider, "interpretation", null, new String[]{"id"}); + public void test_columns_name_to_exclude() { + Table table = assertDbConnection.table("interpretation").columnsToExclude(new String[]{"id"}).build(); assertThat(table.getColumnsNameList()).as("Columns of INTERPRETATION table").hasSize(3) .containsExactly("ID_MOVIE", "ID_ACTOR", "CHARACTER"); } - /** - * This method test the columns got from a {@code DataSource} when the columns to exclude are set. - */ - @Test - public void test_columns_name_to_exclude_with_datasource_set() { - 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"); - } /** * This method should throw a {@code AssertJDBException} because of a {@code SQLException} caused by a table not @@ -101,7 +69,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(dsConnectionProvider, "interpret"); + Table table = assertDbConnection.table("interpret").build(); 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 95e71389..f20af99c 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 @@ -33,24 +33,8 @@ public class Table_Columns_Test extends AbstractTest { * This method test the columns got from a {@code ConnectionProvider}. */ @Test - public void test_columns_with_jdbc_set() { - Table table = new Table(jdbcConnectionProvider, "movie"); - - Column columnFromIndex = table.getColumn(1); - - assertThat(columnFromIndex.getName()).isEqualTo("TITLE"); - assertThat(columnFromIndex.getValuesList().get(0).getValue()).isEqualTo("Alien"); - assertThat(columnFromIndex.getValuesList().get(1).getValue()).isEqualTo("The Village"); - assertThat(columnFromIndex.getValuesList().get(2).getValue()).isEqualTo("Avatar"); - assertThat(columnFromIndex.getRowValue(1).getValue()).isEqualTo("The Village"); - } - - /** - * This method test the columns got from a {@code DataSource}. - */ - @Test - public void test_columns_with_datasource_set() { - Table table = new Table(dsConnectionProvider, "movie"); + public void test_columns() { + Table table = assertDbConnection.table("movie").build(); Column columnFromIndex = table.getColumn(1); @@ -66,14 +50,16 @@ public void test_columns_with_datasource_set() { */ @Test public void test_columns_to_check() { - Table table = new Table(jdbcConnectionProvider, "movie"); + Table table = assertDbConnection.table("movie").build(); assertThat(table.getColumnsToCheck()).isNull(); - table.setColumnsToCheck(new String[]{"title", "test"}); + Table tableWithCheck = assertDbConnection.table("movie") + .columnsToCheck(new String[]{"title", "test"}) + .build(); - assertThat(table.getColumnsToCheck()).hasSize(1); - assertThat(table.getColumnsToCheck()).contains("TITLE"); + assertThat(tableWithCheck.getColumnsToCheck()).hasSize(1); + assertThat(tableWithCheck.getColumnsToCheck()).contains("TITLE"); } /** @@ -81,14 +67,17 @@ public void test_columns_to_check() { */ @Test public void test_columns_to_exclude() { - Table table = new Table(jdbcConnectionProvider, "movie"); + Table table = assertDbConnection.table("movie").build(); assertThat(table.getColumnsToExclude()).isNull(); - table.setColumnsToExclude(new String[]{"title", "test"}); - assertThat(table.getColumnsToExclude()).hasSize(1); - assertThat(table.getColumnsToExclude()).contains("TITLE"); + Table tableWithExclude = assertDbConnection.table("movie") + .columnsToExclude(new String[]{"title", "test"}) + .build(); + + assertThat(tableWithExclude.getColumnsToExclude()).hasSize(1); + assertThat(tableWithExclude.getColumnsToExclude()).contains("TITLE"); } /** @@ -96,13 +85,15 @@ public void test_columns_to_exclude() { */ @Test public void test_columns_to_order() { - Table table = new Table(jdbcConnectionProvider, "movie"); + Table table = assertDbConnection.table("movie").build(); assertThat(table.getColumnsToOrder()).isNull(); - table.setColumnsToOrder(new Order[]{Order.asc("title"), Order.asc("test")}); + Table tableWithOrder = assertDbConnection.table("movie") + .columnsToOrder(new Order[]{Order.asc("title"), Order.asc("test")}) + .build(); - assertThat(table.getColumnsToOrder()).hasSize(1); - assertThat(table.getColumnsToOrder()).contains(Order.asc("TITLE")); + assertThat(tableWithOrder.getColumnsToOrder()).hasSize(1); + assertThat(tableWithOrder.getColumnsToOrder()).contains(Order.asc("TITLE")); } } 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 31f8fb15..0ef2f907 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 @@ -12,8 +12,6 @@ */ package org.assertj.db.type; -import static org.junit.Assert.fail; - import java.sql.Connection; import java.sql.DatabaseMetaData; import java.sql.ResultSet; @@ -21,13 +19,11 @@ import java.sql.Statement; import javax.sql.DataSource; -import org.assertj.core.api.Assertions; import org.assertj.db.common.AbstractTest; import org.assertj.db.common.DefaultConnection; import org.assertj.db.common.DefaultDataSource; import org.assertj.db.common.DefaultStatement; import org.assertj.db.exception.AssertJDBException; -import org.assertj.db.type.Table.Order; import org.junit.Test; /** @@ -37,91 +33,6 @@ * @author Julien Roy */ public class Table_Exception_Test extends AbstractTest { - - /** - * This method should fail because setting the connection provider to null. - */ - @Test(expected = NullPointerException.class) - public void should_fail_because_setting_connection_provider_to_null() { - new Table().setConnectionProvider(null); - } - - /** - * This method should fail because the connection throw an exception when getting an object. - */ - @Test(expected = AssertJDBException.class) - public void should_fail_because_connection_throws_exception_when_getting_an_object() { - DataSource ds = new DefaultDataSource(dataSource); - ConnectionProvider connectionProvider = ConnectionProviderFactory.of(ds).create(); - Table table = new Table(connectionProvider, "movi"); - table.getColumnsNameList(); - } - - /** - * This method should fail because trying to set the columns to check first. - */ - @Test - public void should_fail_because_trying_to_set_columns_to_check_first() { - try { - new Table().setColumnsToCheck(new String[]{"test"}); - fail("An exception must be raised"); - } catch (AssertJDBException e) { - Assertions.assertThat(e.getMessage()).isEqualTo("The table name and the connectionProvider must be set first"); - } - } - - /** - * This method should fail because trying to set the columns to exclude first. - */ - @Test - public void should_fail_because_trying_to_set_columns_to_exclude_first() { - try { - new Table().setColumnsToExclude(new String[]{"test"}); - fail("An exception must be raised"); - } catch (AssertJDBException e) { - Assertions.assertThat(e.getMessage()).isEqualTo("The table name and the connectionProvider must be set first"); - } - } - - /** - * This method should fail because trying to set the columns order first. - */ - @Test - public void should_fail_because_trying_to_set_columns_order_first() { - try { - new Table().setColumnsToOrder(new Order[]{Order.asc("test")}); - fail("An exception must be raised"); - } catch (AssertJDBException e) { - Assertions.assertThat(e.getMessage()).isEqualTo("The table name and the connectionProvider must be set first"); - } - } - - /** - * This method should fail because trying to set the columns order with order null. - */ - @Test - public void should_fail_because_trying_to_set_columns_order_with_order_null() { - try { - new Table(jdbcConnectionProvider, "test").setColumnsToOrder(new Order[]{null}); - fail("An exception must be raised"); - } catch (NullPointerException e) { - Assertions.assertThat(e.getMessage()).isEqualTo("The order can not be null"); - } - } - - /** - * This method should fail because trying to set the columns order with column null. - */ - @Test - public void should_fail_because_trying_to_set_columns_order_with_column_null() { - try { - new Table(jdbcConnectionProvider, "test").setColumnsToOrder(new Order[]{Order.asc(null)}); - fail("An exception must be raised"); - } catch (NullPointerException e) { - Assertions.assertThat(e.getMessage()).isEqualTo("The name of the column for order can not be null"); - } - } - /** * This method should fail because the connection throw an exception when executing a query. */ @@ -145,8 +56,8 @@ public ResultSet executeQuery(String sql) throws SQLException { }; } }; - ConnectionProvider connectionProvider = ConnectionProviderFactory.of(ds).create(); - Table table = new Table(connectionProvider, "movi"); + AssertDbConnection connectionProvider = AssertDbConnectionFactory.of(ds).create(); + Table table = connectionProvider.table("movi").build(); table.getColumnsNameList(); } @@ -167,8 +78,8 @@ public DatabaseMetaData getMetaData() throws SQLException { }; } }; - ConnectionProvider connectionProvider = ConnectionProviderFactory.of(ds).create(); - Table table = new Table(connectionProvider, "movi"); + AssertDbConnection connectionProvider = AssertDbConnectionFactory.of(ds).create(); + Table table = connectionProvider.table("movi").build(); table.getColumnsNameList(); } @@ -189,8 +100,8 @@ public Statement createStatement() throws SQLException { }; } }; - ConnectionProvider connectionProvider = ConnectionProviderFactory.of(ds).create(); - Table table = new Table(connectionProvider, "movi"); + AssertDbConnection connectionProvider = AssertDbConnectionFactory.of(ds).create(); + Table table = connectionProvider.table("movi").build(); table.getColumnsNameList(); } @@ -205,8 +116,8 @@ public Connection getConnection() throws SQLException { throw new SQLException(); } }; - ConnectionProvider connectionProvider = ConnectionProviderFactory.of(ds).create(); - Table table = new Table(connectionProvider, "movi"); + AssertDbConnection connectionProvider = AssertDbConnectionFactory.of(ds).create(); + Table table = connectionProvider.table("movi").build(); 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 891b862c..adf012e2 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 @@ -33,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(jdbcConnectionProvider, "movie"); + Table table = assertDbConnection.table("movie").build(); assertThat(table.getRowFromPksValues()).isNull(); assertThat(table.getRowFromPksValues(getValue(null, 1L), getValue(null, 3))).isNull(); @@ -44,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(jdbcConnectionProvider, "movie"); + Table table = assertDbConnection.table("movie").build(); 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 575b6ab6..961d2906 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 @@ -30,29 +30,14 @@ */ public class Table_Getters_Test extends AbstractTest { - /** - * This method test the getters of a {@code Table} when only the connection provider is set. - */ - @Test - public void test_getters_with_only_connection_provider_set() { - Table table = new Table().setConnectionProvider(jdbcConnectionProvider); - - assertThat(table.getConnectionProvider()).as("Source of MOVIE table").isSameAs(jdbcConnectionProvider); - 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 connection provider and the name are set. */ @Test public void test_getters_with_connection_provider_and_name_set() { - Table table = new Table(jdbcConnectionProvider, "movie"); + Table table = assertDbConnection.table("movie").build(); - assertThat(table.getConnectionProvider()).as("Source of MOVIE table").isSameAs(jdbcConnectionProvider); + assertThat(table.getConnectionProvider()).as("Source of MOVIE table").isNotNull(); assertThat(table.getName()).isEqualTo("MOVIE"); assertThat(table.getColumnsToCheck()).isNull(); assertThat(table.getColumnsToExclude()).isNull(); @@ -67,9 +52,12 @@ public void test_getters_with_connection_provider_and_name_set() { */ @Test public void test_getters_with_connection_provider_name_and_columns_set() { - Table table = new Table(jdbcConnectionProvider, "movie", new String[]{"title", "year"}, new String[]{"id"}); + Table table = assertDbConnection.table("movie") + .columnsToCheck(new String[]{"title", "year"}) + .columnsToExclude(new String[]{"id"}) + .build(); - assertThat(table.getConnectionProvider()).as("Source of MOVIE table").isSameAs(jdbcConnectionProvider); + assertThat(table.getConnectionProvider()).as("Source of MOVIE table").isNotNull(); assertThat(table.getName()).isEqualTo("MOVIE"); assertThat(table.getColumnsToCheck()).containsExactly("TITLE", "YEAR"); assertThat(table.getColumnsToExclude()).containsExactly("ID"); @@ -84,11 +72,13 @@ public void test_getters_with_connection_provider_name_and_columns_set() { */ @Test 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"}); + Table table = assertDbConnection.table("movie") + .columnsToOrder(new Table.Order[]{asc("title"), desc("year")}) + .columnsToCheck(new String[]{"title", "year"}) + .columnsToExclude(new String[]{"id"}) + .build(); - assertThat(table.getConnectionProvider()).as("Source of MOVIE table").isSameAs(jdbcConnectionProvider); + assertThat(table.getConnectionProvider()).as("Source of MOVIE table").isNotNull(); assertThat(table.getName()).isEqualTo("MOVIE"); assertThat(table.getColumnsToCheck()).containsExactly("TITLE", "YEAR"); assertThat(table.getColumnsToExclude()).containsExactly("ID"); @@ -104,10 +94,11 @@ public void test_getters_with_connection_provider_name_columns_and_order_set() { */ @Test public void test_getters_with_connection_provider_name_and_order_set() { - Table table = new Table(jdbcConnectionProvider, "movie", - new Table.Order[]{asc("title"), desc("year")}); + Table table = assertDbConnection.table("movie") + .columnsToOrder(new Table.Order[]{asc("title"), desc("year")}) + .build(); - assertThat(table.getConnectionProvider()).as("Source of MOVIE table").isSameAs(jdbcConnectionProvider); + assertThat(table.getConnectionProvider()).as("Source of MOVIE table").isNotNull(); assertThat(table.getName()).isEqualTo("MOVIE"); assertThat(table.getColumnsToCheck()).isNull(); assertThat(table.getColumnsToExclude()).isNull(); @@ -122,9 +113,9 @@ public void test_getters_with_connection_provider_name_and_order_set() { */ @Test public void test_getters_with_connection_provider_delimiters_and_name_set() { - Table table = new Table(jdbcConnectionProvider, "movie", '1', '2'); + Table table = assertDbConnection.table("movie").delimiters('1', '2').build(); - assertThat(table.getConnectionProvider()).as("Source of MOVIE table").isSameAs(jdbcConnectionProvider); + assertThat(table.getConnectionProvider()).as("Source of MOVIE table").isNotNull(); assertThat(table.getName()).isEqualTo("MOVIE"); assertThat(table.getColumnsToCheck()).isNull(); assertThat(table.getColumnsToExclude()).isNull(); @@ -139,10 +130,12 @@ public void test_getters_with_connection_provider_delimiters_and_name_set() { */ @Test 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"}); + Table table = assertDbConnection.table("movie").delimiters('1', '2') + .columnsToCheck(new String[]{"title", "year"}) + .columnsToExclude(new String[]{"id"}) + .build(); - assertThat(table.getConnectionProvider()).as("Source of MOVIE table").isSameAs(jdbcConnectionProvider); + assertThat(table.getConnectionProvider()).as("Source of MOVIE table").isNotNull(); assertThat(table.getName()).isEqualTo("MOVIE"); assertThat(table.getColumnsToCheck()).containsExactly("TITLE", "YEAR"); assertThat(table.getColumnsToExclude()).containsExactly("ID"); @@ -157,11 +150,13 @@ public void test_getters_with_connection_provider_name_delimiters_and_columns_se */ @Test 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"}); + Table table = assertDbConnection.table("movie").delimiters('1', '2') + .columnsToOrder(new Table.Order[]{asc("title"), desc("year")}) + .columnsToCheck(new String[]{"title", "year"}) + .columnsToExclude(new String[]{"id"}) + .build(); - assertThat(table.getConnectionProvider()).as("Source of MOVIE table").isSameAs(jdbcConnectionProvider); + assertThat(table.getConnectionProvider()).as("Source of MOVIE table").isNotNull(); assertThat(table.getName()).isEqualTo("MOVIE"); assertThat(table.getColumnsToCheck()).containsExactly("TITLE", "YEAR"); assertThat(table.getColumnsToExclude()).containsExactly("ID"); @@ -177,10 +172,11 @@ public void test_getters_with_connection_provider_name_columns_delimiters_and_or */ @Test 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")}); + Table table = assertDbConnection.table("movie").delimiters('1', '2') + .columnsToOrder(new Table.Order[]{asc("title"), desc("year")}) + .build(); - assertThat(table.getConnectionProvider()).as("Source of MOVIE table").isSameAs(jdbcConnectionProvider); + assertThat(table.getConnectionProvider()).as("Source of MOVIE table").isNotNull(); 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 b356b3d8..af3061d2 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 @@ -13,6 +13,7 @@ package org.assertj.db.type; import org.assertj.db.common.AbstractTest; +import org.assertj.db.common.DefaultConnectionProvider; import org.assertj.db.exception.AssertJDBException; import org.junit.Test; @@ -27,76 +28,24 @@ */ public class Table_Instantiation_Test extends AbstractTest { + private final ConnectionProvider connectionProvider = new DefaultConnectionProvider(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_connection_provider_null() { - new Table(null, null); + @Test(expected = IllegalArgumentException.class) + public void should_throw_IllegalArgumentException_if_instantiate_with_connection_provider_null() { + new Table.Builder(null, null).build(); } /** * 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_jdbc_connection_provider_not_null_and_table_name_null() { - new Table(jdbcConnectionProvider, null); - } - - /** - * This method should throw a {@code NullPointerException}, because the {@code DataSource} parameter is - * {@code null} and table name is {@code null}. - */ - @Test(expected = NullPointerException.class) - 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 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_connection_provider_or_datasource() { - new Table().getColumnsNameList(); - } - - /** - * 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_connection_provider_and_without_setting_table_name() { - new Table().setConnectionProvider(jdbcConnectionProvider).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 Table().setConnectionProvider(dsConnectionProvider).getColumnsNameList(); - } - - /** - * 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_jdbc_connection_and_without_setting_table_name() { - new Table().setConnectionProvider(jdbcConnectionProvider).getRequest(); - } - - /** - * This method should throw a {@code NullPointerException}, because the {@code DataSource} 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_datasource_and_without_setting_table_name() { - new Table().setConnectionProvider(dsConnectionProvider).getRequest(); + @Test(expected = IllegalArgumentException.class) + public void should_throw_IllegalArgumentException_if_instantiate_with_connection_provider_not_null_and_table_name_null() { + new Table.Builder(connectionProvider, null).build(); } /** @@ -105,7 +54,7 @@ public void should_throw_NullPointerException_if_get_request_with_setting_dataso */ @Test(expected = AssertJDBException.class) 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 table = AssertDbConnectionFactory.of("jdbc:h2:mem:test", "", "").create().table("test").build(); table.getRowsList(); } @@ -114,7 +63,7 @@ public void should_throw_AssertJDBException_if_get_list_of_rows_with_setting_con */ @Test(expected = NullPointerException.class) public void should_throw_NullPointerException_if_one_of_the_columns_to_check_is_null() { - new Table(jdbcConnectionProvider, "movie", new String[]{"id", null, "birth"}, null); + assertDbConnection.table("movie").columnsToCheck(new String[]{"id", null, "birth"}).build(); } /** @@ -122,6 +71,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(jdbcConnectionProvider, "movie", new String[]{"id", "name", "birth"}, new String[]{null}); + assertDbConnection.table("movie").columnsToExclude(new String[]{null}).build(); } } 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 d093d9d9..7520e872 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 @@ -33,19 +33,8 @@ public class Table_PrimaryKeys_Name_Test extends AbstractTest { * This method test the primary keys got from a {@code ConnectionProvider}. */ @Test - 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"); - } - - /** - * This method test the primary keys got from a {@code DataSource}. - */ - @Test - public void test_pks_name_with_datasource_set() { - Table table = new Table(dsConnectionProvider, "movie"); + public void test_pks_name() { + Table table = assertDbConnection.table("movie").build(); assertThat(table.getPksNameList()).as("Primary Keys of MOVIE table").hasSize(1) .containsExactly("ID"); @@ -55,19 +44,8 @@ public void test_pks_name_with_datasource_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_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"); - } - - /** - * This method test the primary keys got from a {@code DataSource} when the columns to check are set. - */ - @Test - public void test_pks_name_to_check_with_datasource_set() { - Table table = new Table(dsConnectionProvider, "actor", new String[]{"id", "name", "birth"}, null); + public void test_pks_name_to_check() { + Table table = assertDbConnection.table("actor").columnsToCheck(new String[]{"id", "name", "birth"}).build(); assertThat(table.getPksNameList()).as("Primary Keys of ACTOR table").hasSize(1) .containsExactly("ID"); @@ -77,18 +55,8 @@ public void test_pks_name_to_check_with_datasource_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_jdbc_set() { - Table table = new Table(jdbcConnectionProvider, "interpretation", null, new String[]{"ID"}); - - assertThat(table.getPksNameList()).as("Primary Keys of INTERPRETATION table").hasSize(0); - } - - /** - * This method test the primary keys got from a {@code DataSource} when the columns to exclude are set. - */ - @Test - public void test_pks_name_to_exclude_with_datasource_set() { - Table table = new Table(dsConnectionProvider, "interpretation", null, new String[]{"id"}); + public void test_pks_name_to_exclude() { + Table table = assertDbConnection.table("interpretation").columnsToExclude(new String[]{"ID"}).build(); assertThat(table.getPksNameList()).as("Primary Keys of INTERPRETATION table").hasSize(0); } @@ -99,7 +67,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(dsConnectionProvider, "interpret"); + Table table = assertDbConnection.table("interpret").build(); 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 1b8f8f0a..dbd63076 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 @@ -36,8 +36,8 @@ public class Table_Rows_Test extends AbstractTest { * This method test the rows got from a {@code ConnectionProvider}. */ @Test - public void test_rows_with_jdbc_set() { - Table table = new Table(jdbcConnectionProvider, "movie"); + public void test_rows() { + Table table = assertDbConnection.table("movie").build(); assertThat(table.getRowsList()).as("Values of MOVIE table").hasSize(3); @@ -73,42 +73,8 @@ public void test_rows_with_jdbc_set() { * This method test the rows got from a {@code DataSource}. */ @Test - public void test_rows_with_datasource_set() { - Table table = new Table(dsConnectionProvider, "movie"); - - assertThat(table.getRowsList()).as("Values of MOVIE table").hasSize(3); - - assertThat(table.getRow(0).getValuesList().get(0).getValue()).as("Row 1 of MOVIE table").isEqualTo( - new BigDecimal(1)); - assertThat(table.getRow(0).getValuesList().get(1).getValue()).as("Row 1 of MOVIE table").isEqualTo("Alien"); - assertThat(table.getRow(0).getValuesList().get(2).getValue()).as("Row 1 of MOVIE table").isEqualTo( - new BigDecimal(1979)); - assertThat(table.getRow(0).getValuesList().get(3).getValue()).as("Row 1 of MOVIE table").isEqualTo( - UUID.fromString("30B443AE-C0C9-4790-9BEC-CE1380808435")); - assertThat(table.getRow(1).getValuesList().get(0).getValue()).as("Row 2 of MOVIE table").isEqualTo( - new BigDecimal(2)); - assertThat(table.getRow(1).getValuesList().get(1).getValue()).as("Row 2 of MOVIE table").isEqualTo("The Village"); - assertThat(table.getRow(1).getValuesList().get(2).getValue()).as("Row 2 of MOVIE table").isEqualTo( - new BigDecimal(2004)); - assertThat(table.getRow(1).getValuesList().get(3).getValue()).as("Row 2 of MOVIE table").isEqualTo( - UUID.fromString("16319617-AE95-4087-9264-D3D21BF611B6")); - assertThat(table.getRow(2).getValuesList().get(0).getValue()).as("Row 3 of MOVIE table") - .isEqualTo(new BigDecimal(3)); - assertThat(table.getRow(2).getValuesList().get(1).getValue()).as("Row 3 of MOVIE table") - .isEqualTo("Avatar"); - assertThat(table.getRow(2).getValuesList().get(2).getValue()).as("Row 3 of MOVIE table") - .isEqualTo(new BigDecimal(2009)); - assertThat(table.getRow(2).getValuesList().get(3).getValue()).as("Row 3 of MOVIE table") - .isEqualTo(UUID.fromString( - "D735221B-5DE5-4112-AA1E-49090CB75ADA")); - } - - /** - * This method test the rows got from a {@code DataSource}. - */ - @Test - public void test_rows_with_datasource_and_order_set() { - Table table = new Table(dsConnectionProvider, "movie", new Table.Order[]{asc("title")}); + public void test_rows_with_order_set() { + Table table = assertDbConnection.table("movie").columnsToOrder(new Table.Order[]{asc("title")}).build(); assertThat(table.getRowsList()).as("Values of MOVIE table").hasSize(3); @@ -142,7 +108,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(jdbcConnectionProvider, "movie"); + Table table = assertDbConnection.table("movie").build(); table.getRow(0).getColumnValue(null); } @@ -151,7 +117,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(jdbcConnectionProvider, "movie"); + Table table = assertDbConnection.table("movie").build(); assertThat(table.getRow(0).getColumnValue("not_exist")).isNull(); } diff --git a/src/test/java/org/assertj/db/type/TimeValue_Test.java b/src/test/java/org/assertj/db/type/TimeValue_Test.java index 8d8feeba..5287b306 100644 --- a/src/test/java/org/assertj/db/type/TimeValue_Test.java +++ b/src/test/java/org/assertj/db/type/TimeValue_Test.java @@ -413,7 +413,7 @@ public void test_of_with_two_values() throws ParseException { */ @Test public void test_toString() { - assertThat(TimeValue.of(9, 1, 6, 3).toString()).isEqualTo("09:01:06.000000003"); + assertThat(TimeValue.of(9, 1, 6, 3)).hasToString("09:01:06.000000003"); } /** diff --git a/src/test/java/org/assertj/db/util/Changes_Constructor_Test.java b/src/test/java/org/assertj/db/util/Changes_Constructor_Test.java index 1de5b826..b0ab5337 100644 --- a/src/test/java/org/assertj/db/util/Changes_Constructor_Test.java +++ b/src/test/java/org/assertj/db/util/Changes_Constructor_Test.java @@ -12,13 +12,13 @@ */ package org.assertj.db.util; -import static org.assertj.core.api.Assertions.assertThat; +import org.junit.Test; import java.lang.reflect.Constructor; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Modifier; -import org.junit.Test; +import static org.assertj.core.api.Assertions.assertThat; /** * Test on the utility class {@code Changes} : the private constructor. diff --git a/src/test/java/org/assertj/db/util/Changes_GetIndexesOfModifiedColumns_Test.java b/src/test/java/org/assertj/db/util/Changes_GetIndexesOfModifiedColumns_Test.java index 39236dc7..195a4ad4 100644 --- a/src/test/java/org/assertj/db/util/Changes_GetIndexesOfModifiedColumns_Test.java +++ b/src/test/java/org/assertj/db/util/Changes_GetIndexesOfModifiedColumns_Test.java @@ -12,8 +12,6 @@ */ package org.assertj.db.util; -import java.util.Arrays; - import org.assertj.core.api.Assertions; import org.assertj.db.common.AbstractTest; import org.assertj.db.type.Change; @@ -21,6 +19,8 @@ import org.assertj.db.type.DataType; import org.junit.Test; +import java.util.Arrays; + /** * Tests on {@code getIndexesOfModifiedColumns} method. * 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 3663334a..5db9f770 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 @@ -17,9 +17,12 @@ import org.assertj.core.api.WritableAssertionInfo; import org.assertj.db.common.AbstractTest; import org.assertj.db.common.NeedReload; +import org.assertj.db.type.AssertDbConnection; +import org.assertj.db.type.AssertDbConnectionFactory; import org.assertj.db.type.ChangeType; import org.assertj.db.type.Request; import org.assertj.db.type.Table; +import org.junit.Before; import org.junit.Test; /** @@ -30,13 +33,23 @@ */ public class Descriptions_GetDescription_Test extends AbstractTest { + AssertDbConnection assertDbConnectionFromDs; + + @Before + public void initAssertDbConnectionFromDs() { + if (assertDbConnectionFromDs != null) { + return; + } + assertDbConnectionFromDs = AssertDbConnectionFactory.of(this.dataSource).create(); + } + /** * This method tests the {@code getDescription} method for the {@code Table}s. */ @Test public void test_get_description_for_table() { - Table fromSource = new Table(jdbcConnectionProvider, "actor"); - Table fromDataSource = new Table(dsConnectionProvider, "actor"); + Table fromSource = assertDbConnection.table("actor").build(); + Table fromDataSource = assertDbConnectionFromDs.table("actor").build(); String descriptionFromSource = Descriptions.getDescription(fromSource); String descriptionFromDataSource = Descriptions.getDescription(fromDataSource); @@ -50,10 +63,10 @@ public void test_get_description_for_table() { */ @Test public void test_get_description_for_request() { - 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"); + Request fromSource = assertDbConnection.request("select * from actor").build(); + Request fromDataSource = assertDbConnectionFromDs.request("select * from actor").build(); + Request fromSourceLong = assertDbConnection.request("select id, name, firstname, birth, actor_imdb from actor").build(); + Request fromDataSourceLong = assertDbConnectionFromDs.request("select id, name, firstname, birth, actor_imdb from actor").build(); String descriptionFromSource = Descriptions.getDescription(fromSource); String descriptionFromDataSource = Descriptions.getDescription(fromDataSource); @@ -72,8 +85,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(jdbcConnectionProvider).setStartPointNow(); - org.assertj.db.type.Changes fromDataSource = new org.assertj.db.type.Changes(dsConnectionProvider).setStartPointNow(); + org.assertj.db.type.Changes fromSource = assertDbConnection.changes().build().setStartPointNow(); + org.assertj.db.type.Changes fromDataSource = assertDbConnectionFromDs.changes().build().setStartPointNow(); updateChangesForTests(); fromSource.setEndPointNow(); fromDataSource.setEndPointNow(); @@ -91,9 +104,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(jdbcConnectionProvider, "actor")) + org.assertj.db.type.Changes fromSource = assertDbConnection.changes().tables(assertDbConnection.table("actor").build()).build() .setStartPointNow(); - org.assertj.db.type.Changes fromDataSource = new org.assertj.db.type.Changes(new Table(dsConnectionProvider, "actor")) + org.assertj.db.type.Changes fromDataSource = assertDbConnectionFromDs.changes().tables(assertDbConnectionFromDs.table("actor").build()).build() .setStartPointNow(); updateChangesForTests(); fromSource.setEndPointNow(); @@ -112,14 +125,19 @@ 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(jdbcConnectionProvider, "select * from actor")) + org.assertj.db.type.Changes fromSource = assertDbConnection.changes().request( + assertDbConnection.request("select * from actor").build()).build() + .setStartPointNow(); + org.assertj.db.type.Changes fromDataSource = assertDbConnectionFromDs.changes().request( + assertDbConnectionFromDs.request("select * from actor").build()).build() + .setStartPointNow(); + org.assertj.db.type.Changes fromSourceLong = assertDbConnection.changes().request( + assertDbConnection.request("select id, name, firstname, birth, actor_imdb from actor").build()).build() + .setStartPointNow(); + org.assertj.db.type.Changes fromDataSourceLong = assertDbConnectionFromDs.changes().request( + assertDbConnectionFromDs.request("select id, name, firstname, birth, actor_imdb from actor").build()) + .build() .setStartPointNow(); - org.assertj.db.type.Changes fromDataSource = new org.assertj.db.type.Changes( - new Request(dsConnectionProvider, "select * from actor")).setStartPointNow(); - org.assertj.db.type.Changes fromSourceLong = new org.assertj.db.type.Changes( - 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(dsConnectionProvider, "select id, name, firstname, birth, actor_imdb from actor")).setStartPointNow(); updateChangesForTests(); fromSource.setEndPointNow(); fromDataSource.setEndPointNow(); @@ -261,9 +279,11 @@ 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(jdbcConnectionProvider, "actor")) + org.assertj.db.type.Changes fromSource = assertDbConnection.changes().tables(assertDbConnection.table("actor").build()) + .build() .setStartPointNow(); - org.assertj.db.type.Changes fromDataSource = new org.assertj.db.type.Changes(new Table(dsConnectionProvider, "actor")) + org.assertj.db.type.Changes fromDataSource = assertDbConnectionFromDs.changes().tables(assertDbConnectionFromDs.table("actor").build()) + .build() .setStartPointNow(); updateChangesForTests(); fromSource.setEndPointNow(); @@ -297,14 +317,22 @@ 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(jdbcConnectionProvider, "select * from actor")) + org.assertj.db.type.Changes fromSource = assertDbConnection.changes().request( + assertDbConnection.request("select * from actor").build()) + .build() + .setStartPointNow(); + org.assertj.db.type.Changes fromDataSource = assertDbConnectionFromDs.changes().request( + assertDbConnectionFromDs.request("select * from actor").build()) + .build() + .setStartPointNow(); + org.assertj.db.type.Changes fromSourceLong = assertDbConnection.changes().request( + assertDbConnection.request("select id, name, firstname, birth, actor_imdb from actor").build()) + .build() + .setStartPointNow(); + org.assertj.db.type.Changes fromDataSourceLong = assertDbConnectionFromDs.changes().request( + assertDbConnectionFromDs.request("select id, name, firstname, birth, actor_imdb from actor").build()) + .build() .setStartPointNow(); - org.assertj.db.type.Changes fromDataSource = new org.assertj.db.type.Changes( - new Request(dsConnectionProvider, "select * from actor")).setStartPointNow(); - org.assertj.db.type.Changes fromSourceLong = new org.assertj.db.type.Changes( - 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(dsConnectionProvider, "select id, name, firstname, birth, actor_imdb from actor")).setStartPointNow(); updateChangesForTests(); fromSource.setEndPointNow(); fromDataSource.setEndPointNow();