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/Assertions.java b/src/main/java/org/assertj/db/api/Assertions.java index aa1cccd8..994e0f59 100644 --- a/src/main/java/org/assertj/db/api/Assertions.java +++ b/src/main/java/org/assertj/db/api/Assertions.java @@ -22,8 +22,8 @@ import org.assertj.db.exception.AssertJDBException; import org.assertj.db.type.Changes; +import org.assertj.db.type.ConnectionProvider; import org.assertj.db.type.Request; -import org.assertj.db.type.Source; import org.assertj.db.type.Table; /** @@ -33,14 +33,14 @@ * The assertion methods are defined in assertions package. *

*

- * Example with a {@link Source} and a {@link Table} with test on the content on the first row of the {@code movie} + * Example with a {@link ConnectionProvider} and a {@link Table} with test on the content on the first row of the {@code movie} * table that the {@code title} column contains "Alien" like text and the next column contains 1979 like number : *

* *
  * 
- * Source source = new Source("jdbc:h2:mem:test", "sa", "");
- * Table table = new Table(source, "movie");
+ * ConnectionProvider connectionProvider = ConnectionProviderFactory.of("jdbc:h2:mem:test", "sa", "").create();
+ * Table table = new Table(connectionProvider, "movie");
  * assertThat(table)
  *     .row()
  *        .value("title")
@@ -71,8 +71,8 @@
  *
  * 
  * 
- * Source source = new Source("jdbc:h2:mem:test", "sa", "");
- * Table table = new Table(source, "movie");
+ * ConnectionProvider connectionProvider = ConnectionProviderFactory.of("jdbc:h2:mem:test", "sa", "").create();
+ * Table table = new Table(connectionProvider, "movie");
  * assertThat(table)
  *     .row()
  *        .value("title")
diff --git a/src/main/java/org/assertj/db/api/BDDAssertions.java b/src/main/java/org/assertj/db/api/BDDAssertions.java
index 7cb7e902..175f605e 100644
--- a/src/main/java/org/assertj/db/api/BDDAssertions.java
+++ b/src/main/java/org/assertj/db/api/BDDAssertions.java
@@ -19,8 +19,8 @@
 
 import org.assertj.db.exception.AssertJDBException;
 import org.assertj.db.type.Changes;
+import org.assertj.db.type.ConnectionProvider;
 import org.assertj.db.type.Request;
-import org.assertj.db.type.Source;
 import org.assertj.db.type.Table;
 
 /**
@@ -33,14 +33,14 @@
  * The assertion methods are defined in assertions package.
  * 

*

- * Example with a {@link Source} and a {@link Table} with test on the content on the first row of the {@code movie} + * Example with a {@link ConnectionProvider} and a {@link Table} with test on the content on the first row of the {@code movie} * table that the {@code title} column contains "Alien" as text and the next column contains 1979 as a number : *

* *
  * 
- * Source source = new Source("jdbc:h2:mem:test", "sa", "");
- * Table table = new Table(source, "movie");
+ * ConnectionProvider connectionProvider = ConnectionProviderFactory.of("jdbc:h2:mem:test", "sa", "").create();
+ * Table table = new Table(connectionProvider, "movie");
  * then(table)
  *     .row()
  *        .value("title")
@@ -71,8 +71,8 @@
  *
  * 
  * 
- * Source source = new Source("jdbc:h2:mem:test", "sa", "");
- * Table table = new Table(source, "movie");
+ * ConnectionProvider connectionProvider = ConnectionProviderFactory.of("jdbc:h2:mem:test", "sa", "").create();
+ * Table table = new Table(connectionProvider, "movie");
  * then(table)
  *     .row()
  *        .value("title")
diff --git a/src/main/java/org/assertj/db/api/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/api/TableAssert.java b/src/main/java/org/assertj/db/api/TableAssert.java
index b9f6bb8e..89251021 100644
--- a/src/main/java/org/assertj/db/api/TableAssert.java
+++ b/src/main/java/org/assertj/db/api/TableAssert.java
@@ -48,7 +48,7 @@ public TableAssert(Table table) {
    */
   @Override
   public TableAssert exists() {
-    return AssertionsOnTableExistence.exists(this, info, actual.getName(), actual.getSource(), actual.getDataSource());
+    return AssertionsOnTableExistence.exists(this, info, actual.getName(), actual.getConnectionProvider());
   }
 
   /**
@@ -65,6 +65,6 @@ public TableAssert exists() {
    */
   @Override
   public TableAssert doesNotExist() {
-    return AssertionsOnTableExistence.doesNotExists(this, info, actual.getName(), actual.getSource(), actual.getDataSource());
+    return AssertionsOnTableExistence.doesNotExists(this, info, actual.getName(), actual.getConnectionProvider());
   }
 }
diff --git a/src/main/java/org/assertj/db/api/assertions/impl/AssertionsOnTableExistence.java b/src/main/java/org/assertj/db/api/assertions/impl/AssertionsOnTableExistence.java
index 770cf4c6..78d41951 100644
--- a/src/main/java/org/assertj/db/api/assertions/impl/AssertionsOnTableExistence.java
+++ b/src/main/java/org/assertj/db/api/assertions/impl/AssertionsOnTableExistence.java
@@ -17,16 +17,14 @@
 
 import java.sql.Connection;
 import java.sql.DatabaseMetaData;
-import java.sql.DriverManager;
 import java.sql.ResultSet;
 import java.sql.SQLException;
-import javax.sql.DataSource;
 
 import org.assertj.core.api.WritableAssertionInfo;
 import org.assertj.core.internal.Failures;
 import org.assertj.db.api.AbstractDbAssert;
 import org.assertj.db.exception.AssertJDBException;
-import org.assertj.db.type.Source;
+import org.assertj.db.type.ConnectionProvider;
 
 /**
  * Implements the assertion method on the existence of a table.
@@ -47,18 +45,20 @@ private AssertionsOnTableExistence() {
   /**
    * Verifies that the table exists.
    *
-   * @param         The type of the assertion which call this method.
-   * @param assertion  The assertion which call this method.
-   * @param info       Writable information about an assertion.
-   * @param table      The table name to search in DB.
-   * @param source     The source to connect to DB.
-   * @param dataSource The source to connect to DB.
+   * @param                 The type of the assertion which call this method.
+   * @param assertion          The assertion which call this method.
+   * @param info               Writable information about an assertion.
+   * @param table              The table name to search in DB.
+   * @param connectionProvider The provider to connect to DB.
    * @return {@code this} assertion object.
    * @throws AssertionError If the table does not exist.
    */
   public static > A exists(A assertion, WritableAssertionInfo info,
-                                                                        String table, Source source, DataSource dataSource) {
-    try (Connection connection = getConnection(source, dataSource)) {
+                                                                        String table, ConnectionProvider connectionProvider) {
+    if (connectionProvider == null) {
+      throw new NullPointerException("connectionProvider must be not null");
+    }
+    try (Connection connection = connectionProvider.getConnection()) {
       DatabaseMetaData metaData = connection.getMetaData();
       ResultSet result = metaData.getTables(null, null, table, null);
       if (!result.next()) {
@@ -75,18 +75,20 @@ private AssertionsOnTableExistence() {
   /**
    * Verifies that the database not contains the table.
    *
-   * @param         The type of the assertion which call this method.
-   * @param assertion  The assertion which call this method.
-   * @param info       Writable information about an assertion.
-   * @param table      The table name to search in DB.
-   * @param source     The source to connect to DB.
-   * @param dataSource The source to connect to DB.
+   * @param                 The type of the assertion which call this method.
+   * @param assertion          The assertion which call this method.
+   * @param info               Writable information about an assertion.
+   * @param table              The table name to search in DB.
+   * @param connectionProvider The provider to connect to DB.
    * @return {@code this} assertion object.
    * @throws AssertionError If the table does not exist.
    */
   public static > A doesNotExists(A assertion, WritableAssertionInfo info,
-                                                                               String table, Source source, DataSource dataSource) {
-    try (Connection connection = getConnection(source, dataSource)) {
+                                                                               String table, ConnectionProvider connectionProvider) {
+    if (connectionProvider == null) {
+      throw new NullPointerException("connectionProvider must be not null");
+    }
+    try (Connection connection = connectionProvider.getConnection()) {
       DatabaseMetaData metaData = connection.getMetaData();
       ResultSet result = metaData.getTables(null, null, table, null);
       if (result.next()) {
@@ -98,14 +100,4 @@ private AssertionsOnTableExistence() {
     }
     return assertion;
   }
-
-  private static Connection getConnection(Source source, DataSource dataSource) throws SQLException {
-    if (source == null && dataSource == null) {
-      throw new NullPointerException("connection or dataSource must be not null");
-    }
-    if (dataSource != null) {
-      return dataSource.getConnection();
-    }
-    return DriverManager.getConnection(source.getUrl(), source.getUser(), source.getPassword());
-  }
 }
diff --git a/src/main/java/org/assertj/db/type/SourceWithLetterCase.java b/src/main/java/org/assertj/db/type/AbstractConnectionProvider.java
similarity index 53%
rename from src/main/java/org/assertj/db/type/SourceWithLetterCase.java
rename to src/main/java/org/assertj/db/type/AbstractConnectionProvider.java
index 573a089a..caf322a9 100644
--- a/src/main/java/org/assertj/db/type/SourceWithLetterCase.java
+++ b/src/main/java/org/assertj/db/type/AbstractConnectionProvider.java
@@ -12,70 +12,56 @@
  */
 package org.assertj.db.type;
 
+import java.lang.reflect.InvocationTargetException;
+
 import org.assertj.db.type.lettercase.LetterCase;
-import org.assertj.db.type.lettercase.WithLetterCase;
 
 /**
- * A source to indicates the information to connect to the database with letter case.
+ * Base implementation for ConnectionProvider that handle letter case and schema metadata management.
  *
- * @author Régis Pouiller
- * @since 1.1.0
+ * @author Julien Roy
+ * @since 3.0.0
  */
-public class SourceWithLetterCase extends Source implements WithLetterCase {
+abstract class AbstractConnectionProvider implements ConnectionProvider {
+
+  private final SchemaMetadata schemaMetadata;
 
-  /**
-   * Letter case of the tables.
-   */
   private final LetterCase tableLetterCase;
-  /**
-   * Letter case of the columns.
-   */
   private final LetterCase columnLetterCase;
-  /**
-   * Letter case of the primary keys.
-   */
   private final LetterCase primaryKeyLetterCase;
 
-  /**
-   * Constructor with the information.
-   *
-   * @param url                  URL to the database.
-   * @param user                 User to connect.
-   * @param password             Password to connect.
-   * @param tableLetterCase      Letter case of the tables.
-   * @param columnLetterCase     Letter case of the columns.
-   * @param primaryKeyLetterCase Letter case of the primary keys.
-   */
-  public SourceWithLetterCase(String url, String user, String password,
-                              LetterCase tableLetterCase, LetterCase columnLetterCase, LetterCase primaryKeyLetterCase) {
-
-    super(url, user, password);
+  protected AbstractConnectionProvider(Class schemaMetadataType, LetterCase tableLetterCase, LetterCase columnLetterCase, LetterCase primaryKeyLetterCase) {
+    this.schemaMetadata = instantiateSchemaMetadata(schemaMetadataType);
     this.tableLetterCase = tableLetterCase;
     this.columnLetterCase = columnLetterCase;
     this.primaryKeyLetterCase = primaryKeyLetterCase;
   }
 
-  /**
-   * {@inheritDoc}
-   */
+  private SchemaMetadata instantiateSchemaMetadata(Class schemaMetadataType) {
+    try {
+      return schemaMetadataType.getConstructor(ConnectionProvider.class).newInstance(this);
+    } catch (InstantiationException | IllegalAccessException | InvocationTargetException | NoSuchMethodException e) {
+      throw new IllegalArgumentException("Schema metadata instantiation failure", e);
+    }
+  }
+
+  @Override
+  public LetterCase getTableLetterCase() {
+    return tableLetterCase;
+  }
+
   @Override
   public LetterCase getColumnLetterCase() {
     return columnLetterCase;
   }
 
-  /**
-   * {@inheritDoc}
-   */
   @Override
   public LetterCase getPrimaryKeyLetterCase() {
     return primaryKeyLetterCase;
   }
 
-  /**
-   * {@inheritDoc}
-   */
   @Override
-  public LetterCase getTableLetterCase() {
-    return tableLetterCase;
+  public SchemaMetadata getMetaData() {
+    return this.schemaMetadata;
   }
 }
diff --git a/src/main/java/org/assertj/db/type/AbstractDbData.java b/src/main/java/org/assertj/db/type/AbstractDbData.java
index b52a8657..27240ffb 100644
--- a/src/main/java/org/assertj/db/type/AbstractDbData.java
+++ b/src/main/java/org/assertj/db/type/AbstractDbData.java
@@ -12,16 +12,19 @@
  */
 package org.assertj.db.type;
 
+import java.sql.Connection;
+import java.sql.ResultSet;
+import java.sql.ResultSetMetaData;
+import java.sql.SQLException;
+import java.sql.Types;
+import java.util.ArrayList;
+import java.util.List;
+
 import org.assertj.db.exception.AssertJDBException;
 import org.assertj.db.type.lettercase.LetterCase;
 import org.assertj.db.util.NameComparator;
 import org.assertj.db.util.RowComparator;
 
-import javax.sql.DataSource;
-import java.sql.*;
-import java.util.ArrayList;
-import java.util.List;
-
 /**
  * This class represents data from the database (either a {@link Table} or a {@link Request}).
  * 

@@ -35,6 +38,7 @@ * @param Class of the subclass (an implementation of {@link AbstractDbData}) : useful for the fluent methods * (setters). * @author Régis Pouiller + * @author Julien Roy */ public abstract class AbstractDbData> extends AbstractDbElement { @@ -60,39 +64,26 @@ 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 sub-class of {@code AbstractDbData}. - */ - AbstractDbData(Class selfType, DataType dataType) { - super(selfType); - this.dataType = dataType; - } - - /** - * Constructor with a {@link Source}. + * Constructor with a {@link JdbcUrlConnectionProvider}. * - * @param dataType The type of the data on which is the change. - * @param selfType Class of this element : a sub-class of {@code AbstractDbData}. - * @param source The {@link Source} to connect to the database (must be not {@code null}). - * @throws NullPointerException If {@code source} is {@code null}. + * @param dataType The type of the data on which is the change. + * @param selfType Class of this element : a subclass of {@code AbstractDbData}. + * @param connectionProvider The {@link JdbcUrlConnectionProvider} to connect to the database (must be not {@code null}). + * @throws NullPointerException If {@code connectionProvider} is {@code null}. */ - AbstractDbData(Class selfType, DataType dataType, Source source) { - super(selfType, source); + protected AbstractDbData(Class selfType, DataType dataType, ConnectionProvider connectionProvider) { + super(selfType, connectionProvider); this.dataType = dataType; } /** - * Constructor with a {@link DataSource}. + * Only used for tests. * - * @param dataType The type of the data on which is the change. - * @param selfType Class of this element : a sub-class of {@code AbstractDbData}. - * @param dataSource The {@link DataSource} (must be not {@code null}). - * @throws NullPointerException If {@code dataSource} is {@code null}. + * @param selfType Class of DbElement. + * @param dataType Type of DbData. */ - AbstractDbData(Class selfType, DataType dataType, DataSource dataSource) { - super(selfType, dataSource); + protected AbstractDbData(Class selfType, DataType dataType) { + super(selfType); this.dataType = dataType; } @@ -121,12 +112,12 @@ public DataType getDataType() { * depending of being a {@link Table} or a {@link Request}. *

* - * @throws NullPointerException If the {@link #dataSource} and {@link #source} fields are {@code null}. + * @throws NullPointerException If the {@code connectionProvider} fields are {@code null}. * @throws AssertJDBException If triggered, this exception wrap a possible {@link SQLException} during the loading. */ private void load() { try (Connection connection = getConnection()) { - // Call the specific loading depending of Table or Request. + // Call the specific loading depending on Table or Request. loadImpl(connection); if (pksNameList == null) { pksNameList = new ArrayList<>(); @@ -219,7 +210,7 @@ protected void collectRowsFromResultSet(ResultSet resultSet) throws SQLException *

* * @return The list of the columns name. - * @throws NullPointerException If the {@link #dataSource} and {@link #source} fields are {@code null}. + * @throws NullPointerException If the {@code connectionProvider} fields are {@code null}. * @throws AssertJDBException If triggered, this exception wrap a possible {@link SQLException} during the loading. */ public List getColumnsNameList() { @@ -246,7 +237,7 @@ protected void setColumnsNameList(List columnsNameList) { *

* * @return The list of the primary key name. - * @throws NullPointerException If the {@link #dataSource} and {@link #source} fields are {@code null}. + * @throws NullPointerException If the {@link #getConnectionProvider()} fields are {@code null}. * @throws AssertJDBException If triggered, this exception wrap a possible {@link SQLException} during the loading. */ public List getPksNameList() { @@ -296,7 +287,7 @@ protected void controlIfAllThePksNameExistInTheColumns() { *

* * @return The list of the values. - * @throws NullPointerException If the {@link #dataSource} and {@link #source} fields are {@code null}. + * @throws NullPointerException If the {@code connectionProvider} fields are {@code null}. * @throws AssertJDBException If triggered, this exception wrap a possible {@link SQLException} during the loading. */ public List getRowsList() { @@ -316,7 +307,7 @@ public List getRowsList() { *

* * @return The list of the values in columns. - * @throws NullPointerException If the {@link #dataSource} and {@link #source} fields are {@code null}. + * @throws NullPointerException If the {@code connectionProvider} fields are {@code null}. * @throws AssertJDBException If triggered, this exception wrap a possible {@link SQLException} during the loading. */ public List getColumnsList() { @@ -345,7 +336,7 @@ public List getColumnsList() { * * @param index The column index. * @return The column and the values - * @throws NullPointerException If the {@link #dataSource} and {@link #source} fields are {@code null}. + * @throws NullPointerException If the {@code connectionProvider} fields are {@code null}. * @throws AssertJDBException If triggered, this exception wrap a possible {@link SQLException} during the loading. */ public Column getColumn(int index) { @@ -362,7 +353,7 @@ public Column getColumn(int index) { * * @param index The index * @return The {@link Row} - * @throws NullPointerException If the {@link #dataSource} and {@link #source} fields are {@code null}. + * @throws NullPointerException If the {@code connectionProvider} fields are {@code null}. * @throws AssertJDBException If triggered, this exception wrap a possible {@link SQLException} during the loading. */ public Row getRow(int index) { @@ -379,7 +370,7 @@ public Row getRow(int index) { * * @param index The column index * @return The values - * @throws NullPointerException If the {@link #dataSource} and {@link #source} fields are {@code null}. + * @throws NullPointerException If the {@code connectionProvider} fields are {@code null}. * @throws AssertJDBException If triggered, this exception wrap a possible {@link SQLException} during the loading. */ private List getValuesList(int index) { diff --git a/src/main/java/org/assertj/db/type/AbstractDbElement.java b/src/main/java/org/assertj/db/type/AbstractDbElement.java index dc4e46ad..c1b498d1 100644 --- a/src/main/java/org/assertj/db/type/AbstractDbElement.java +++ b/src/main/java/org/assertj/db/type/AbstractDbElement.java @@ -12,22 +12,20 @@ */ package org.assertj.db.type; -import org.assertj.db.type.lettercase.LetterCase; -import org.assertj.db.type.lettercase.WithLetterCase; - -import javax.sql.DataSource; import java.sql.Connection; -import java.sql.DriverManager; import java.sql.SQLException; +import org.assertj.db.type.lettercase.LetterCase; +import org.assertj.db.type.lettercase.WithLetterCase; + /** * This class represents element from the database (either a {@link AbstractDbData} or a {@link Change}). - * So this class contains : the way to access the database with {@link #getSource()} and {@link #getDataSource()} (one - * of them need to be set before loading the data).
+ * So this class contains : the way to access the database with {@link #getConnectionProvider()}.
* * @param Class of the subclass (an implementation of {@link AbstractDbElement}) : useful for the fluent methods * (setters). * @author Régis Pouiller + * @author Julien Roy */ public abstract class AbstractDbElement> implements DbElement, WithLetterCase { @@ -36,136 +34,33 @@ public abstract class AbstractDbElement> implemen */ protected final D myself; /** - * Source of the data. - */ - private Source source; - /** - * Data source. - */ - private DataSource dataSource; - /** - * Letter case of the tables. - * - * @since 1.1.0 - */ - private LetterCase tableLetterCase; - /** - * Letter case of the columns. - * - * @since 1.1.0 - */ - private LetterCase columnLetterCase; - /** - * Letter case of the primary keys. - * - * @since 1.1.0 - */ - private LetterCase primaryKeyLetterCase; - - /** - * Default constructor. - * - * @param selfType Class of this element : a sub-class of {@code AbstractDbElement}. + * Database connection provider. */ - AbstractDbElement(Class selfType) { - myself = selfType.cast(this); - setLetterCases(); - } + private final ConnectionProvider connectionProvider; /** * Constructor. * - * @param selfType Class of this element : a sub-class of {@code AbstractDbElement}. - * @param source The {@link Source} to connect to the database (must be not {@code null}). - * @throws NullPointerException If {@code source} is {@code null}. - */ - AbstractDbElement(Class selfType, Source source) { - this(selfType); - this.source = source; - setLetterCases(); - } - - /** - * Constructor. - * - * @param selfType Class of this element : a sub-class of {@code AbstractDbElement}. - * @param dataSource The {@link DataSource} (must be not {@code null}). - * @throws NullPointerException If {@code dataSource} is {@code null}. - */ - AbstractDbElement(Class selfType, DataSource dataSource) { - this(selfType); - this.dataSource = dataSource; - setLetterCases(); - } - - /** - * Returns the catalog from a connection. - * - * @param connection The connection with the catalog - * @return The catalog from a connection. - * @throws SQLException SQL Exception - */ - protected static String getCatalog(Connection connection) throws SQLException { - try { - return connection.getCatalog(); - } catch (SQLException exception) { - throw exception; - } catch (Exception throwable) { - return null; + * @param selfType Class of this element : a subclass of {@code AbstractDbElement}. + * @param connectionProvider The {@link ConnectionProvider} to connect to the database (must be not {@code null}). + * @throws NullPointerException If {@code connectionProvider} is {@code null}. + */ + 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; } /** - * Returns the schema from a connection. + * Only used for tests. * - * @param connection The connection with the catalog - * @return The schema from a connection. - * @throws SQLException SQL Exception + * @param selfType Class of DbElement. */ - protected static String getSchema(Connection connection) throws SQLException { - try { - return connection.getSchema(); - } catch (SQLException exception) { - throw exception; - } catch (Exception throwable) { - return null; - } - } - - /** - * Sets the letter cases from information in parameters. - * - * @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. - */ - 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 dataSource} and {@code source}. - */ - private void setLetterCases() { - if (dataSource instanceof WithLetterCase) { - WithLetterCase withLetterCase = (WithLetterCase) dataSource; - tableLetterCase = withLetterCase.getTableLetterCase(); - columnLetterCase = withLetterCase.getColumnLetterCase(); - primaryKeyLetterCase = withLetterCase.getPrimaryKeyLetterCase(); - } else if (source instanceof WithLetterCase) { - WithLetterCase withLetterCase = (WithLetterCase) source; - tableLetterCase = withLetterCase.getTableLetterCase(); - columnLetterCase = withLetterCase.getColumnLetterCase(); - primaryKeyLetterCase = withLetterCase.getPrimaryKeyLetterCase(); - } else { - tableLetterCase = LetterCase.TABLE_DEFAULT; - columnLetterCase = LetterCase.COLUMN_DEFAULT; - primaryKeyLetterCase = LetterCase.PRIMARY_KEY_DEFAULT; - } + protected AbstractDbElement(Class selfType) { + this.myself = selfType.cast(this); + this.connectionProvider = null; } /** @@ -173,7 +68,7 @@ private void setLetterCases() { */ @Override public LetterCase getColumnLetterCase() { - return columnLetterCase; + return this.connectionProvider.getColumnLetterCase(); } /** @@ -181,7 +76,7 @@ public LetterCase getColumnLetterCase() { */ @Override public LetterCase getPrimaryKeyLetterCase() { - return primaryKeyLetterCase; + return this.connectionProvider.getPrimaryKeyLetterCase(); } /** @@ -189,81 +84,42 @@ public LetterCase getPrimaryKeyLetterCase() { */ @Override public LetterCase getTableLetterCase() { - return tableLetterCase; + return this.connectionProvider.getTableLetterCase(); } /** - * Return the source. + * Return the connectionProvider. * - * @return The {@link Source} to connect. - * @see #setSource(Source) + * @return The {@link ConnectionProvider} to connect. */ - public Source getSource() { - return source; + public ConnectionProvider getConnectionProvider() { + return connectionProvider; } /** - * Sets the source. + * Returns a {@link Connection} from the {@link ConnectionProvider} * - * @param source {@link Source} to connect to the database (must be not {@code null}). - * @return The actual instance. - * @throws NullPointerException If {@code source} is {@code null}. - * @see #getSource() + * @return A {@link Connection} from connectionProvider + * @throws SQLException SQL Exception + * @throws NullPointerException this connection provider is null */ - public D setSource(Source source) { - if (source == null) { - throw new NullPointerException("source must be not null"); - } - this.source = source; - this.dataSource = null; - setLetterCases(); - return myself; - } - - /** - * Return the data source. - * - * @return The data source. - * @see #setDataSource(DataSource) - */ - public DataSource getDataSource() { - return dataSource; - } - - /** - * Sets the data source. - * - * @param dataSource The {@link DataSource} (must be not {@code null}). - * @return The actual instance. - * @throws NullPointerException If {@code dataSource} is {@code null}. - * @see #getDataSource() - */ - public D setDataSource(DataSource dataSource) { - if (dataSource == null) { - throw new NullPointerException("dataSource must be not null"); + protected Connection getConnection() throws SQLException { + if (connectionProvider == null) { + throw new NullPointerException("connectionProvider must be not null"); } - this.source = null; - this.dataSource = dataSource; - setLetterCases(); - return myself; + return connectionProvider.getConnection(); } /** - * Returns a {@link Connection} from a {@link DataSource} or from a {@link Source}. + * Returns a {@link SchemaMetadata} from the {@link ConnectionProvider} * - * @return A {@link Connection} differently, depending if it is a {@link DataSource} or a {@link Source}. - * @throws SQLException SQL Exception + * @return A {@link SchemaMetadata} from connectionProvider + * @throws NullPointerException this connection provider is null */ - protected Connection getConnection() throws SQLException { - if (dataSource == null && source == null) { - throw new NullPointerException("connection or dataSource must be not null"); - } - - // Get a Connection differently, depending if it is a DataSource or a Source. - if (dataSource != null) { - return dataSource.getConnection(); - } else { - return DriverManager.getConnection(source.getUrl(), source.getUser(), source.getPassword()); + protected SchemaMetadata getMetaData() { + if (connectionProvider == null) { + throw new NullPointerException("connectionProvider must be not null"); } + return connectionProvider.getMetaData(); } } diff --git a/src/main/java/org/assertj/db/type/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/AssertDbConnectionFactory.java b/src/main/java/org/assertj/db/type/AssertDbConnectionFactory.java new file mode 100644 index 00000000..3aa65b51 --- /dev/null +++ b/src/main/java/org/assertj/db/type/AssertDbConnectionFactory.java @@ -0,0 +1,184 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + * + * Copyright 2015-2024 the original author or authors. + */ +package org.assertj.db.type; + +import javax.sql.DataSource; + +import org.assertj.db.type.lettercase.LetterCase; + +/** + * 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 : + *

+ *
+ * 
+ * AssertDbConnection connection = AssertDbConnectionFactory.of("jdbc:h2:mem:test", "sa", "").create();
+ * Table table = connection.table("movie").build();
+ * 
+ * 
+ * For create with JDBC URL : + *
+ * 
+ * DataSource dataSource = ...;
+ * 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 AssertDbConnectionFactory { + + private AssertDbConnectionFactory() { + throw new UnsupportedOperationException(); + } + + /** + * Initiate factory with Java.sql.DataSource + * + * @param dataSource Datasource to retrieve data from database. + * @return Factory of ConnectionProvider + */ + public static DataSourceConnectionProviderFactory of(DataSource dataSource) { + return new DataSourceConnectionProviderFactory(dataSource); + } + + /** + * Initiate factory with JDBC connection information + * + * @param url JDBC url of database. + * @param user Connection username. + * @param password Connection password. + * @return Factory of ConnectionProvider + */ + public static JdbcUrlConnectionProviderFactory of(String url, String user, String password) { + return new JdbcUrlConnectionProviderFactory(url, user, password); + } + + /** + * DataSource variant of ConnectionProviderFactory + */ + public static class DataSourceConnectionProviderFactory extends AbstractConnectionProviderFactory { + private final DataSource dataSource; + + private DataSourceConnectionProviderFactory(DataSource dataSource) { + super(); + this.dataSource = dataSource; + } + + /** + * {@inheritDoc} + */ + @Override + public ConnectionProvider createConnectionProvider() { + return new DataSourceConnectionProvider(dataSource, this.schemaMetaDataMode.getType(), this.tableLetterCase, this.columnLetterCase, this.primaryKeyLetterCase); + } + } + + /** + * Jdbc url variant of ConnectionProviderFactory + */ + public static class JdbcUrlConnectionProviderFactory extends AbstractConnectionProviderFactory { + private final String url; + private final String user; + private final String password; + + private JdbcUrlConnectionProviderFactory(String url, String user, String password) { + super(); + + this.url = url; + this.user = user; + this.password = password; + } + + /** + * {@inheritDoc} + */ + @Override + public ConnectionProvider createConnectionProvider() { + return new JdbcUrlConnectionProvider(url, user, password, this.schemaMetaDataMode.getType(), this.tableLetterCase, this.columnLetterCase, this.primaryKeyLetterCase); + } + } + + @SuppressWarnings("unchecked") + private abstract static class AbstractConnectionProviderFactory { + + /** + * Schema metadata retrieval mode. + */ + protected SchemaMetaDataMode schemaMetaDataMode = SchemaMetaDataMode.DYNAMIC; + /** + * Tables letter case. + */ + protected LetterCase tableLetterCase = LetterCase.TABLE_DEFAULT; + /** + * Columns letter case. + */ + protected LetterCase columnLetterCase = LetterCase.COLUMN_DEFAULT; + /** + * PKs letter case. + */ + protected LetterCase primaryKeyLetterCase = LetterCase.PRIMARY_KEY_DEFAULT; + + private AbstractConnectionProviderFactory() { + } + + /** + * Modify the default letter case mode for connection provider. + * + * @param tableLetterCase Tables letter case. + * @param columnLetterCase Columns letter case. + * @param primaryKeyLetterCase PKs letter case. + * @return the current instance of factory. + */ + public T letterCase(LetterCase tableLetterCase, LetterCase columnLetterCase, LetterCase primaryKeyLetterCase) { + this.tableLetterCase = tableLetterCase; + this.columnLetterCase = columnLetterCase; + this.primaryKeyLetterCase = primaryKeyLetterCase; + return (T) this; + } + + /** + * Modify the current mode for schema metadata retrieval. + * + * @param mode The selected mode + * @return the current instance of factory. + */ + public T schemaMetaDataMode(SchemaMetaDataMode mode) { + if (mode == null) { + throw new IllegalArgumentException("SchemaMetaDataMode cannot be null"); + } + this.schemaMetaDataMode = mode; + return (T) this; + } + + /** + * Build the Connection Provider + * + * @return Connection provider to use for Table, Request or Changes + */ + 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/CachedSchemaMetaData.java b/src/main/java/org/assertj/db/type/CachedSchemaMetaData.java new file mode 100644 index 00000000..6b594733 --- /dev/null +++ b/src/main/java/org/assertj/db/type/CachedSchemaMetaData.java @@ -0,0 +1,57 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + * + * Copyright 2015-2024 the original author or authors. + */ +package org.assertj.db.type; + +import java.util.Collection; +import java.util.Map; +import java.util.concurrent.ConcurrentHashMap; + +/** + * Implementation of SchemaMetadata that cache the metadata of the first request without any expiration. + * + * @author Julien Roy + * @since 3.0.0 + */ +class CachedSchemaMetaData implements SchemaMetadata { + + private final FromConnectionSchemaMetadata metadata; + private final Map> cache = new ConcurrentHashMap<>(); + + public CachedSchemaMetaData(ConnectionProvider connectionProvider) { + this.metadata = new FromConnectionSchemaMetadata(connectionProvider); + } + + /** + * {@inheritDoc} + */ + @Override + public Collection getTablesName() { + return cache.computeIfAbsent("TABLES", key -> this.metadata.getTablesName()); + } + + /** + * {@inheritDoc} + */ + @Override + public Collection getColumnsName(String tableName) { + return cache.computeIfAbsent("COLUMNS#" + tableName, key -> this.metadata.getColumnsName(tableName)); + } + + /** + * {@inheritDoc} + */ + @Override + public Collection getPrimaryKeys(String tableName) { + return cache.computeIfAbsent("PKS#" + tableName, key -> this.metadata.getPrimaryKeys(tableName)); + } +} diff --git a/src/main/java/org/assertj/db/type/Changes.java b/src/main/java/org/assertj/db/type/Changes.java index 3af50b2c..acd07ee9 100644 --- a/src/main/java/org/assertj/db/type/Changes.java +++ b/src/main/java/org/assertj/db/type/Changes.java @@ -16,23 +16,74 @@ import static org.assertj.db.type.Change.createDeletionChange; import static org.assertj.db.type.Change.createModificationChange; -import java.sql.Connection; -import java.sql.DatabaseMetaData; -import java.sql.ResultSet; -import java.sql.SQLException; import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; import java.util.Iterator; import java.util.LinkedList; import java.util.List; -import javax.sql.DataSource; +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 */ public class Changes extends AbstractDbElement { @@ -65,31 +116,15 @@ public class Changes extends AbstractDbElement { */ private List changesList; - /** - * Constructor. - */ - public Changes() { - super(Changes.class); - } - - /** - * Constructor. - * - * @param source The {@link Source} to connect to the database (must be not {@code null}). - * @throws NullPointerException If {@code source} is {@code null}. - */ - public Changes(Source source) { - super(Changes.class, source); - } - /** * Constructor. * - * @param dataSource The {@link DataSource} (must be not {@code null}). - * @throws NullPointerException If {@code dataSource} is {@code null}. + * @param connectionProvider The {@link ConnectionProvider} to connect to the database (must be not {@code null}). + * @throws NullPointerException If {@code connectionProvider} is {@code null}. + * @since 3.0.0 */ - public Changes(DataSource dataSource) { - super(Changes.class, dataSource); + private Changes(ConnectionProvider connectionProvider) { + super(Changes.class, connectionProvider); } /** @@ -97,8 +132,8 @@ public Changes(DataSource dataSource) { * * @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); } @@ -107,24 +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.getSource() != null) { - element.setSource(elementToCopy.getSource()); - } - if (elementToCopy.getDataSource() != null) { - element.setDataSource(elementToCopy.getDataSource()); - } + private Changes() { + super(Changes.class); } /** @@ -133,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(); } /** @@ -150,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; @@ -185,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; } /** @@ -213,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"); } @@ -223,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; } /** @@ -277,20 +287,9 @@ public Request getRequestAtEndPoint() { */ public Changes setStartPointNow() { if (request == null && tablesList == null) { - try (Connection connection = getConnection()) { - tablesList = new LinkedList<>(); - DatabaseMetaData metaData = connection.getMetaData(); - ResultSet resultSet = metaData.getTables(getCatalog(connection), getSchema(connection), null, - new String[]{"TABLE"}); - while (resultSet.next()) { - String tableName = resultSet.getString("TABLE_NAME"); - Table t = new Table().setLetterCases(getTableLetterCase(), getColumnLetterCase(), getPrimaryKeyLetterCase()) - .setName(getTableLetterCase().convert(tableName)); - copyElement(this, t); - tablesList.add(t); - } - } catch (SQLException e) { - throw new AssertJDBException(e); + tablesList = new LinkedList<>(); + for (String tableName : getMetaData().getTablesName()) { + tablesList.add(new Table.Builder(this.getConnectionProvider(), getTableLetterCase().convert(tableName)).build()); } } @@ -538,7 +537,7 @@ public Changes getChangesOfType(ChangeType changeType) { * @return The new instance. */ private Changes createChangesFromThis() { - Changes changes = new Changes(); + Changes changes = new Changes(this.getConnectionProvider()); if (request != null) { changes.request = getDuplicatedRequest(request); } @@ -551,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/ConnectionProvider.java b/src/main/java/org/assertj/db/type/ConnectionProvider.java new file mode 100644 index 00000000..de61548a --- /dev/null +++ b/src/main/java/org/assertj/db/type/ConnectionProvider.java @@ -0,0 +1,43 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + * + * Copyright 2015-2024 the original author or authors. + */ +package org.assertj.db.type; + +import java.sql.Connection; +import java.sql.SQLException; + +import org.assertj.db.type.lettercase.WithLetterCase; + +/** + * Represent access to a database with capacity to return schema metadata and settings for letter case management. + * + * @author Julien Roy + * @since 3.0.0 + */ +public interface ConnectionProvider extends WithLetterCase { + + /** + * Return SQL connection to database. + * + * @return An active {@link Connection} to database. + * @throws SQLException When access to database fail. + */ + Connection getConnection() throws SQLException; + + /** + * Return a accessor to retrieve database schema metadata. + * + * @return An {@link SchemaMetadata} to access to database schema metadata. + */ + SchemaMetadata getMetaData(); + +} diff --git a/src/main/java/org/assertj/db/type/DataSourceConnectionProvider.java b/src/main/java/org/assertj/db/type/DataSourceConnectionProvider.java new file mode 100644 index 00000000..c254848b --- /dev/null +++ b/src/main/java/org/assertj/db/type/DataSourceConnectionProvider.java @@ -0,0 +1,55 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + * + * Copyright 2015-2024 the original author or authors. + */ +package org.assertj.db.type; + +import java.sql.Connection; +import java.sql.SQLException; +import javax.sql.DataSource; + +import org.assertj.db.type.lettercase.LetterCase; + +/** + * The implementation of {@link ConnectionProvider} based on java.sql.DataSource. + * Use {@link AssertDbConnectionFactory} for instantiate. + * + * @author Julien Roy + * @since 3.0.0 + */ +public class DataSourceConnectionProvider extends AbstractConnectionProvider { + + private final DataSource dataSource; + + DataSourceConnectionProvider(DataSource dataSource, + Class schemaMetadataType, + LetterCase tableLetterCase, LetterCase columnLetterCase, LetterCase primaryKeyLetterCase) { + + super(schemaMetadataType, tableLetterCase, columnLetterCase, primaryKeyLetterCase); + this.dataSource = dataSource; + } + + /** + * {@inheritDoc} + */ + @Override + public Connection getConnection() throws SQLException { + return dataSource.getConnection(); + } + + /** + * {@inheritDoc} + */ + @Override + public String toString() { + return "data source"; + } +} diff --git a/src/main/java/org/assertj/db/type/DataSourceWithLetterCase.java b/src/main/java/org/assertj/db/type/DataSourceWithLetterCase.java deleted file mode 100644 index d39f43fb..00000000 --- a/src/main/java/org/assertj/db/type/DataSourceWithLetterCase.java +++ /dev/null @@ -1,162 +0,0 @@ -/* - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - * - * Copyright 2015-2024 the original author or authors. - */ -package org.assertj.db.type; - -import java.io.PrintWriter; -import java.sql.Connection; -import java.sql.SQLException; -import java.sql.SQLFeatureNotSupportedException; -import java.util.logging.Logger; -import javax.sql.DataSource; - -import org.assertj.db.type.lettercase.LetterCase; -import org.assertj.db.type.lettercase.WithLetterCase; - -/** - * A data source to connect to the database with letter case. - * - * @author Régis Pouiller - * @since 1.1.0 - */ -public class DataSourceWithLetterCase implements DataSource, WithLetterCase { - - /** - * The data source. - */ - private final DataSource dataSource; - /** - * Letter case of the tables. - */ - private final LetterCase tableLetterCase; - /** - * Letter case of the columns. - */ - private final LetterCase columnLetterCase; - /** - * Letter case of the primary keys. - */ - private final LetterCase primaryKeyLetterCase; - - /** - * Constructor. - * - * @param dataSource The data source. - * @param tableLetterCase Letter case of the tables. - * @param columnLetterCase Letter case of the columns. - * @param primaryKeyLetterCase Letter case of the primary keys. - */ - public DataSourceWithLetterCase(DataSource dataSource, LetterCase tableLetterCase, - LetterCase columnLetterCase, LetterCase primaryKeyLetterCase) { - - this.dataSource = dataSource; - this.tableLetterCase = tableLetterCase; - this.columnLetterCase = columnLetterCase; - this.primaryKeyLetterCase = primaryKeyLetterCase; - } - - /** - * {@inheritDoc} - */ - @Override - public LetterCase getColumnLetterCase() { - return columnLetterCase; - } - - /** - * {@inheritDoc} - */ - @Override - public LetterCase getPrimaryKeyLetterCase() { - return primaryKeyLetterCase; - } - - /** - * {@inheritDoc} - */ - @Override - public LetterCase getTableLetterCase() { - return tableLetterCase; - } - - /** - * {@inheritDoc} - */ - @Override - public Connection getConnection() throws SQLException { - return dataSource.getConnection(); - } - - /** - * {@inheritDoc} - */ - @Override - public Connection getConnection(String username, String password) throws SQLException { - return dataSource.getConnection(username, password); - } - - /** - * {@inheritDoc} - */ - @Override - public PrintWriter getLogWriter() throws SQLException { - return dataSource.getLogWriter(); - } - - /** - * {@inheritDoc} - */ - @Override - public void setLogWriter(PrintWriter out) throws SQLException { - dataSource.setLogWriter(out); - } - - /** - * {@inheritDoc} - */ - @Override - public int getLoginTimeout() throws SQLException { - return dataSource.getLoginTimeout(); - } - - /** - * {@inheritDoc} - */ - @Override - public void setLoginTimeout(int seconds) throws SQLException { - dataSource.setLoginTimeout(seconds); - } - - /** - * {@inheritDoc} - */ - @Override - public Logger getParentLogger() throws SQLFeatureNotSupportedException { - return dataSource.getParentLogger(); - } - - /** - * {@inheritDoc} - */ - @Override - public T unwrap(Class iface) throws SQLException { - return dataSource.unwrap(iface); - } - - /** - * {@inheritDoc} - */ - @Override - public boolean isWrapperFor(Class iface) throws SQLException { - return dataSource.isWrapperFor(iface); - } -} diff --git a/src/main/java/org/assertj/db/type/FromConnectionSchemaMetadata.java b/src/main/java/org/assertj/db/type/FromConnectionSchemaMetadata.java new file mode 100644 index 00000000..1dd81208 --- /dev/null +++ b/src/main/java/org/assertj/db/type/FromConnectionSchemaMetadata.java @@ -0,0 +1,119 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + * + * Copyright 2015-2024 the original author or authors. + */ +package org.assertj.db.type; + +import java.sql.Connection; +import java.sql.DatabaseMetaData; +import java.sql.ResultSet; +import java.sql.SQLException; +import java.util.ArrayList; +import java.util.Collection; +import java.util.List; + +import org.assertj.db.exception.AssertJDBException; + +/** + * @author Julien Roy + * @since 3.0.0 + */ +class FromConnectionSchemaMetadata implements SchemaMetadata { + + private final ConnectionProvider connectionProvider; + + public FromConnectionSchemaMetadata(ConnectionProvider connectionProvider) { + this.connectionProvider = connectionProvider; + } + + /** + * Returns the catalog from a connection. + * + * @param connection The connection with the catalog + * @return The catalog from a connection. + * @throws SQLException SQL Exception + */ + private static String getCatalog(Connection connection) throws SQLException { + try { + return connection.getCatalog(); + } catch (SQLException exception) { + throw exception; + } catch (Exception throwable) { + return null; + } + } + + /** + * Returns the schema from a connection. + * + * @param connection The connection with the catalog + * @return The schema from a connection. + * @throws SQLException SQL Exception + */ + private static String getSchema(Connection connection) throws SQLException { + try { + return connection.getSchema(); + } catch (SQLException exception) { + throw exception; + } catch (Exception throwable) { + return null; + } + } + + @Override + public Collection getTablesName() { + try (Connection connection = connectionProvider.getConnection()) { + List tables = new ArrayList<>(); + DatabaseMetaData metaData = connection.getMetaData(); + try (ResultSet tableResultSet = metaData.getTables(getCatalog(connection), getSchema(connection), null, new String[]{"TABLE"})) { + while (tableResultSet.next()) { + String tableName = tableResultSet.getString("TABLE_NAME"); + tables.add(tableName); + } + } + return tables; + } catch (SQLException e) { + throw new AssertJDBException(e); + } + } + + @Override + public Collection getColumnsName(String tableName) { + try (Connection connection = connectionProvider.getConnection()) { + List columnsList = new ArrayList<>(); + try (ResultSet columnsResultSet = connection.getMetaData().getColumns(getCatalog(connection), getSchema(connection), tableName, null)) { + while (columnsResultSet.next()) { + String column = columnsResultSet.getString("COLUMN_NAME"); + columnsList.add(column); + } + } + return columnsList; + } catch (SQLException e) { + throw new AssertJDBException(e); + } + } + + @Override + public Collection getPrimaryKeys(String tableName) { + try (Connection connection = connectionProvider.getConnection()) { + List pksNameList = new ArrayList<>(); + try (ResultSet resultSet = connection.getMetaData().getPrimaryKeys(getCatalog(connection), getSchema(connection), tableName)) { + while (resultSet.next()) { + String pkName = resultSet.getString("COLUMN_NAME"); + pksNameList.add(pkName); + } + } + return pksNameList; + } catch (SQLException e) { + throw new AssertJDBException(e); + } + } +} diff --git a/src/main/java/org/assertj/db/type/JdbcUrlConnectionProvider.java b/src/main/java/org/assertj/db/type/JdbcUrlConnectionProvider.java new file mode 100644 index 00000000..a757e9f9 --- /dev/null +++ b/src/main/java/org/assertj/db/type/JdbcUrlConnectionProvider.java @@ -0,0 +1,59 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + * + * Copyright 2015-2024 the original author or authors. + */ +package org.assertj.db.type; + +import java.sql.Connection; +import java.sql.DriverManager; +import java.sql.SQLException; + +import org.assertj.db.type.lettercase.LetterCase; + +/** + * The implementation of {@link ConnectionProvider} from JDBC url connection info. + * Use {@link AssertDbConnectionFactory} for instantiate. + * + * @author Julien Roy + * @since 3.0.0 + */ +public class JdbcUrlConnectionProvider extends AbstractConnectionProvider { + + private final String url; + private final String user; + private final String password; + + JdbcUrlConnectionProvider(String url, String user, String password, + Class schemaMetadataType, + LetterCase tableLetterCase, LetterCase columnLetterCase, LetterCase primaryKeyLetterCase) { + + super(schemaMetadataType, tableLetterCase, columnLetterCase, primaryKeyLetterCase); + this.url = url; + this.user = user; + this.password = password; + } + + /** + * {@inheritDoc} + */ + @Override + public Connection getConnection() throws SQLException { + return DriverManager.getConnection(this.url, this.user, this.password); + } + + /** + * {@inheritDoc} + */ + @Override + public String toString() { + return this.user + "/" + this.url; + } +} diff --git a/src/main/java/org/assertj/db/type/Request.java b/src/main/java/org/assertj/db/type/Request.java index e4793557..90cd5e02 100644 --- a/src/main/java/org/assertj/db/type/Request.java +++ b/src/main/java/org/assertj/db/type/Request.java @@ -20,15 +20,14 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.List; -import javax.sql.DataSource; import org.assertj.db.type.lettercase.LetterCase; /** * A request in the database to get values. *

- * The different information of the request are connection or data source, the SQL request and optionally the parameters - * 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 : @@ -36,74 +35,71 @@ *

    *
  • *

    - * This {@link Request} point to a request without parameter in a H2 database in memory like indicated in the - * {@link Source}. + * This {@link Request} point to a request without parameter in a H2 database in memory. *

    * *
    
    - * Source source = new Source("jdbc:h2:mem:test", "sa", "");
    - * Request request = new Request(source, "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} instead of a {@link Source} like above. + * The {@link AssertDbConnection} use a {@code DataSource} instead of a JDBC url like above. *

    * *
    
      * DataSource dataSource = ...;
    - * Request request = new Request(dataSource, "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();
      * 
    * *
  • *
* * @author Régis Pouiller + * @author Julien Roy */ 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. * - * @param source Source to connect to the database. - * @param request SQL Request to get the values. - * @param parameters Parameters of the SQL request. + * @param connectionProvider Connection provider to connect to the database. + * @param request SQL Request to get the values. + * @param parameters Parameters of the SQL request. + * @since 3.0.0 */ - public Request(Source source, String request, Object... parameters) { - super(Request.class, DataType.REQUEST, source); - setRequest(request); + private Request(ConnectionProvider connectionProvider, String request, Object[] parameters, String[] pksName) { + super(Request.class, DataType.REQUEST, connectionProvider); + 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; } /** - * Constructor with a data source. - * - * @param dataSource Data source. - * @param request SQL Request to get the values. - * @param parameters Parameters of the SQL request. + * Only used for tests. */ - public Request(DataSource dataSource, String request, Object... parameters) { - super(Request.class, DataType.REQUEST, dataSource); - setRequest(request); - this.parameters = parameters; + private Request() { + super(Request.class, DataType.REQUEST); + this.request = null; + this.parameters = null; } /** @@ -115,22 +111,6 @@ public String getRequest() { return request; } - /** - * Sets 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; - } - /** * The parameters of the SQL request. * @@ -138,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. *

@@ -212,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/SchemaMetaDataMode.java b/src/main/java/org/assertj/db/type/SchemaMetaDataMode.java new file mode 100644 index 00000000..2f43930a --- /dev/null +++ b/src/main/java/org/assertj/db/type/SchemaMetaDataMode.java @@ -0,0 +1,48 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + * + * Copyright 2015-2024 the original author or authors. + */ +package org.assertj.db.type; + +/** + * Define existing schema metadata retrieval mode. + * + * @author Julien Roy + * @since 3.0.0 + */ +public enum SchemaMetaDataMode { + /** + * Retrieve schema metadata only once and keep in memory for all duration of connection provider. + * To use when database schema is not modified during tests. + */ + STATIC(CachedSchemaMetaData.class), + /** + * Retrieve schema metadata each time is required. + * To use when database schema is modified during tests. + */ + DYNAMIC(FromConnectionSchemaMetadata.class); + + + private final Class type; + + SchemaMetaDataMode(Class type) { + this.type = type; + } + + /** + * Return the underline java type that implement the strategy. + * + * @return Class to use for instantiate the schema retriever. + */ + Class getType() { + return type; + } +} diff --git a/src/main/java/org/assertj/db/type/SchemaMetadata.java b/src/main/java/org/assertj/db/type/SchemaMetadata.java new file mode 100644 index 00000000..f3190327 --- /dev/null +++ b/src/main/java/org/assertj/db/type/SchemaMetadata.java @@ -0,0 +1,48 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + * + * Copyright 2015-2024 the original author or authors. + */ +package org.assertj.db.type; + +import java.util.Collection; + +/** + * 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/Source.java b/src/main/java/org/assertj/db/type/Source.java deleted file mode 100644 index afee685e..00000000 --- a/src/main/java/org/assertj/db/type/Source.java +++ /dev/null @@ -1,80 +0,0 @@ -/* - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - * - * Copyright 2015-2024 the original author or authors. - */ -package org.assertj.db.type; - -/** - * A source to indicates the information to connect to the database. It contains the url, user and password to the - * database. A source is used by a {@link Table} or a {@link Request}. - *

Example of instantiation :

- *

- * Source source = new Source("jdbc:h2:mem:test", "sa", "");
- * 
- *

That creates a source to a H2 database in memory.

- * - * @author Régis Pouiller - */ -public class Source { - - /** - * URL to the database. - */ - private final String url; - /** - * User to connect. - */ - private final String user; - /** - * Password to connect. - */ - private final String password; - - /** - * Constructor with the information. - * - * @param url URL to the database. - * @param user User to connect. - * @param password Password to connect. - */ - public Source(String url, String user, String password) { - this.url = url; - this.user = user; - this.password = password; - } - - /** - * Returns the URL to the database. - * - * @return The URL to the database. - */ - public String getUrl() { - return url; - } - - /** - * Returns the user to connect. - * - * @return The user to connect. - */ - public String getUser() { - return user; - } - - /** - * Returns the password to connect. - * - * @return The password to connect. - */ - public String getPassword() { - return password; - } -} diff --git a/src/main/java/org/assertj/db/type/Table.java b/src/main/java/org/assertj/db/type/Table.java index 8228ea68..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 Source} 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 Source}. + * This {@link Table} point to a table called {@code movie} in a H2 database in memory. *

    * *
      * 
    - * Source source = new Source("jdbc:h2:mem:test", "sa", "");
    - * Table table = new Table(source, "movie");
    + * AssertDbConnection connection = AssertDbConnectionFactory.of("jdbc:h2:mem:test", "sa", "").create();
    + * Table table = connection.table("movie").build();
      * 
      * 
    * @@ -57,14 +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 Source} like above. + * The {@link AssertDbConnection} use a {@code DataSource} instead of a JDBC url like above. *

    * *
      * 
      * DataSource dataSource = ...;
    - * Table table1 = new Table(dataSource, "song", new String[] { "number", "title" }, null);
    - * Table table2 = new Table(dataSource, "musician", null, new String[] { "birthday" });
    + * 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();
      * 
      * 
    * @@ -72,6 +71,7 @@ *
* * @author Régis Pouiller + * @author Julien Roy */ public class Table extends AbstractDbData
{ @@ -110,210 +110,24 @@ public class Table extends AbstractDbData
{ */ private Character endDelimiter = null; - /** - * Default constructor. - */ - public Table() { - super(Table.class, DataType.TABLE); - } - - /** - * Constructor with a {@link Source} and the name of the table. - * - * @param source {@link Source} to connect to the database. - * @param name Name of the table. - */ - public Table(Source source, String name) { - this(source, name, null, (String[]) null); - } - - /** - * Constructor with a {@link Source}, the name of the table and the columns to check and to exclude. - * - * @param source {@link Source} to connect to the database. - * @param name Name of the table. - * @param columnsToCheck Array of the name of the columns to check. If {@code null} that means to check all the - * columns. - * @param columnsToExclude Array of the name of the columns to exclude. If {@code null} that means to exclude no - * column. - */ - public Table(Source source, String name, String[] columnsToCheck, String[] columnsToExclude) { - this(source, name, null, columnsToCheck, columnsToExclude); - } - - /** - * Constructor with a dataSource and the name of the table. - * - * @param dataSource DataSource of the database. - * @param name Name of the table. - */ - public Table(DataSource dataSource, String name) { - this(dataSource, name, null, (String[]) null); - } - - /** - * Constructor with a connection, the name of the table and the columns to check and to exclude. - * - * @param dataSource DataSource of the database. - * @param name Name of the table. - * @param columnsToCheck Array of the name of the columns to check. If {@code null} that means to check all the - * columns. - * @param columnsToExclude Array of the name of the columns to exclude. If {@code null} that means to exclude no - * column. - */ - public Table(DataSource dataSource, String name, String[] columnsToCheck, String[] columnsToExclude) { - this(dataSource, name, null, columnsToCheck, columnsToExclude); - } - - /** - * Constructor with a {@link Source} and the name of the table. - * - * @param source {@link Source} to connect to the database. - * @param name Name of the table. - * @param columnsToOrder List of column to use as ORDER BY - * @since 1.2.0 - */ - public Table(Source source, String name, Order[] columnsToOrder) { - this(source, name, columnsToOrder, null, null); - } - - /** - * Constructor with a {@link Source}, the name of the table and the columns to check and to exclude. - * - * @param source {@link Source} to connect to the database. - * @param name Name of the table. - * @param columnsToOrder List of column to use as ORDER BY - * @param columnsToCheck Array of the name of the columns to check. If {@code null} that means to check all the - * columns. - * @param columnsToExclude Array of the name of the columns to exclude. If {@code null} that means to exclude no - * column. - * @since 1.2.0 - */ - public Table(Source source, String name, Order[] columnsToOrder, String[] columnsToCheck, String[] columnsToExclude) { - this(source, name, null, null, columnsToOrder, columnsToCheck, columnsToExclude); - } - - /** - * Constructor with a dataSource and the name of the table. - * - * @param dataSource DataSource of the database. - * @param name Name of the table. - * @param columnsToOrder List of column to use as ORDER BY - * @since 1.2.0 - */ - public Table(DataSource dataSource, String name, Order[] columnsToOrder) { - this(dataSource, name, columnsToOrder, null, null); - } - - /** - * Constructor with a connection, the name of the table and the columns to check and to exclude. - * - * @param dataSource DataSource of the database. - * @param name Name of the table. - * @param columnsToOrder List of column to use as ORDER BY - * @param columnsToCheck Array of the name of the columns to check. If {@code null} that means to check all the - * columns. - * @param columnsToExclude Array of the name of the columns to exclude. If {@code null} that means to exclude no - * column. - * @since 1.2.0 - */ - public Table(DataSource dataSource, String name, Order[] columnsToOrder, String[] columnsToCheck, String[] columnsToExclude) { - this(dataSource, name, null, null, columnsToOrder, columnsToCheck, columnsToExclude); - } - - /** - * Constructor with a {@link Source} and the name of the table. - * - * @param source {@link Source} to connect to the database. - * @param name Name of the table. - * @param startDelimiter Start delimiter for column name and table name. - * @param endDelimiter End delimiter for column name and table name. - * @since 1.2.0 - */ - public Table(Source source, String name, Character startDelimiter, Character endDelimiter) { - this(source, name, startDelimiter, endDelimiter, null, null, null); - } - - /** - * Constructor with a {@link Source}, the name of the table and the columns to check and to exclude. - * - * @param source {@link Source} to connect to the database. - * @param name Name of the table. - * @param startDelimiter Start delimiter for column name and table name. - * @param endDelimiter End delimiter for column name and table name. - * @param columnsToCheck Array of the name of the columns to check. If {@code null} that means to check all the - * columns. - * @param columnsToExclude Array of the name of the columns to exclude. If {@code null} that means to exclude no - * column. - * @since 1.2.0 - */ - public Table(Source source, String name, Character startDelimiter, Character endDelimiter, String[] columnsToCheck, - String[] columnsToExclude) { - this(source, name, startDelimiter, endDelimiter, null, columnsToCheck, columnsToExclude); - } - - /** - * Constructor with a dataSource and the name of the table. - * - * @param dataSource DataSource of the database. - * @param name Name of the table. - * @param startDelimiter Start delimiter for column name and table name. - * @param endDelimiter End delimiter for column name and table name. - * @since 1.2.0 - */ - public Table(DataSource dataSource, String name, Character startDelimiter, Character endDelimiter) { - this(dataSource, name, startDelimiter, endDelimiter, null, null, null); - } /** - * Constructor with a connection, the name of the table and the columns to check and to exclude. + * Constructor with a {@link ConnectionProvider}, the name of the table and the columns to check and to exclude. * - * @param dataSource DataSource of the database. - * @param name Name of the table. - * @param startDelimiter Start delimiter for column name and table name. - * @param endDelimiter End delimiter for column name and table name. - * @param columnsToCheck Array of the name of the columns to check. If {@code null} that means to check all the - * columns. - * @param columnsToExclude Array of the name of the columns to exclude. If {@code null} that means to exclude no - * column. - * @since 1.2.0 + * @param connectionProvider {@link ConnectionProvider} to connect to the database. + * @param name Name of the table. + * @param startDelimiter Start delimiter for column name and table name. + * @param endDelimiter End delimiter for column name and table name. + * @param columnsToOrder List of column to use as ORDER BY + * @param columnsToCheck Array of the name of the columns to check. If {@code null} that means to check all the + * columns. + * @param columnsToExclude Array of the name of the columns to exclude. If {@code null} that means to exclude no + * column. + * @since 3.0.0 */ - public Table(DataSource dataSource, String name, Character startDelimiter, Character endDelimiter, String[] columnsToCheck, - String[] columnsToExclude) { - this(dataSource, name, startDelimiter, endDelimiter, null, columnsToCheck, columnsToExclude); - } - - /** - * Constructor with a {@link Source} and the name of the table. - * - * @param source {@link Source} to connect to the database. - * @param name Name of the table. - * @param startDelimiter Start delimiter for column name and table name. - * @param endDelimiter End delimiter for column name and table name. - * @param columnsToOrder List of column to use as ORDER BY - * @since 1.2.0 - */ - public Table(Source source, String name, Character startDelimiter, Character endDelimiter, Order[] columnsToOrder) { - this(source, name, startDelimiter, endDelimiter, columnsToOrder, null, null); - } - - /** - * Constructor with a {@link Source}, the name of the table and the columns to check and to exclude. - * - * @param source {@link Source} to connect to the database. - * @param name Name of the table. - * @param startDelimiter Start delimiter for column name and table name. - * @param endDelimiter End delimiter for column name and table name. - * @param columnsToOrder List of column to use as ORDER BY - * @param columnsToCheck Array of the name of the columns to check. If {@code null} that means to check all the - * columns. - * @param columnsToExclude Array of the name of the columns to exclude. If {@code null} that means to exclude no - * column. - * @since 1.2.0 - */ - public Table(Source source, String name, Character startDelimiter, Character endDelimiter, Order[] columnsToOrder, - String[] columnsToCheck, String[] columnsToExclude) { - super(Table.class, DataType.TABLE, source); + 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); setEndDelimiter(endDelimiter); @@ -323,42 +137,10 @@ public Table(Source source, String name, Character startDelimiter, Character end } /** - * Constructor with a dataSource and the name of the table. - * - * @param dataSource DataSource of the database. - * @param name Name of the table. - * @param startDelimiter Start delimiter for column name and table name. - * @param endDelimiter End delimiter for column name and table name. - * @param columnsToOrder List of column to use as ORDER BY - * @since 1.2.0 + * Only used for tests. */ - public Table(DataSource dataSource, String name, Character startDelimiter, Character endDelimiter, Order[] columnsToOrder) { - this(dataSource, name, startDelimiter, endDelimiter, columnsToOrder, null, null); - } - - /** - * Constructor with a connection, the name of the table and the columns to check and to exclude. - * - * @param dataSource DataSource of the database. - * @param name Name of the table. - * @param startDelimiter Start delimiter for column name and table name. - * @param endDelimiter End delimiter for column name and table name. - * @param columnsToOrder List of column to use as ORDER BY - * @param columnsToCheck Array of the name of the columns to check. If {@code null} that means to check all the - * columns. - * @param columnsToExclude Array of the name of the columns to exclude. If {@code null} that means to exclude no - * column. - * @since 1.2.0 - */ - public Table(DataSource dataSource, String name, Character startDelimiter, Character endDelimiter, Order[] columnsToOrder, - String[] columnsToCheck, String[] columnsToExclude) { - super(Table.class, DataType.TABLE, dataSource); - setName(name); - setStartDelimiter(startDelimiter); - setEndDelimiter(endDelimiter); - setColumnsToOrder(columnsToOrder); - setColumnsToCheck(columnsToCheck); - setColumnsToExclude(columnsToExclude); + private Table() { + super(Table.class, DataType.TABLE); } /** @@ -378,65 +160,34 @@ 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 setDataSource(DataSource dataSource) { - Table table = super.setDataSource(dataSource); - setNameFromDb(); - return table; - } - - /** - * {@inheritDoc} - */ - @Override - public Table setSource(Source source) { - Table table = super.setSource(source); - setNameFromDb(); - return table; - } - /** * Set the name from the corresponding name in the database. */ private void setNameFromDb() { - if (name != null && (getSource() != null || getDataSource() != null)) { - try (Connection connection = getConnection()) { - LetterCase tableLetterCase = getTableLetterCase(); - LetterCase columnLetterCase = getColumnLetterCase(); - - DatabaseMetaData metaData = connection.getMetaData(); - try (ResultSet tableResultSet = metaData.getTables(getCatalog(connection), getSchema(connection), null, - new String[]{"TABLE"})) { - while (tableResultSet.next()) { - String tableName = tableResultSet.getString("TABLE_NAME"); - if (tableLetterCase.isEqual(tableName, name)) { - name = tableLetterCase.convert(tableName); - break; - } - } + if (name != null && this.getConnectionProvider() != null) { + + LetterCase tableLetterCase = getTableLetterCase(); + LetterCase columnLetterCase = getColumnLetterCase(); + SchemaMetadata metaData = getMetaData(); + for (String tableName : metaData.getTablesName()) { + if (tableLetterCase.isEqual(tableName, name)) { + name = tableLetterCase.convert(tableName); + break; } + } - columnsList = new ArrayList<>(); - try (ResultSet columnsResultSet = metaData.getColumns(getCatalog(connection), getSchema(connection), name, null)) { - while (columnsResultSet.next()) { - String column = columnsResultSet.getString("COLUMN_NAME"); - columnsList.add(columnLetterCase.convert(column)); - } - } - } catch (SQLException e) { - throw new AssertJDBException(e); + columnsList = new ArrayList<>(); + for (String column : metaData.getColumnsName(name)) { + columnsList.add(columnLetterCase.convert(column)); } } } @@ -463,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 source or datasource must be set first"); + throw new AssertJDBException("The table name and the connectionProvider must be set first"); } - if (columnsToCheck != null) { - LetterCase letterCase = getColumnLetterCase(); - // 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; } @@ -508,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 source or datasource must be set first"); + throw new AssertJDBException("The table name and the connectionProvider must be set first"); } - if (columnsToExclude != null) { - LetterCase letterCase = getColumnLetterCase(); - 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; } @@ -552,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 source or datasource must be set first"); + throw new AssertJDBException("The table name and the connectionProvider must be set first"); } - if (columnsToOrder != null) { - LetterCase letterCase = getColumnLetterCase(); - 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; } @@ -600,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; } @@ -624,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; } @@ -725,38 +482,28 @@ private void collectColumnsNameFromResultSet(ResultSet resultSet) throws SQLExce * This method use the {@link DatabaseMetaData} from the {@code Connection} parameter to list the primary keys of the * table. *

- * - * @param connection The {@code Connection} to the database. - * @throws SQLException SQL Exception. */ - private void collectPrimaryKeyName(Connection connection) throws SQLException { - String catalog = getCatalog(connection); - String schema = getSchema(connection); + private void collectPrimaryKeyName() { List pksNameList = new ArrayList<>(); - DatabaseMetaData metaData = connection.getMetaData(); + SchemaMetadata metaData = getMetaData(); String tableName = name; - try (ResultSet resultSet = metaData.getTables(catalog, schema, null, new String[]{"TABLE"})) { - LetterCase letterCase = getTableLetterCase(); - while (resultSet.next()) { - String tableResult = resultSet.getString("TABLE_NAME"); - if (letterCase.isEqual(tableName, tableResult)) { - tableName = tableResult; - break; - } + LetterCase letterCase = getTableLetterCase(); + for (String tableResult : metaData.getTablesName()) { + if (letterCase.isEqual(tableName, tableResult)) { + tableName = tableResult; + break; } } - try (ResultSet resultSet = metaData.getPrimaryKeys(catalog, schema, tableName)) { - LetterCase letterCase = getPrimaryKeyLetterCase(); - while (resultSet.next()) { - String columnName = resultSet.getString("COLUMN_NAME"); - if (NameComparator.INSTANCE.contains(getColumnsNameList(), columnName, letterCase)) { - String pkName = letterCase.convert(columnName); - pksNameList.add(pkName); - } + LetterCase pkLetterCase = getPrimaryKeyLetterCase(); + for (String primaryKey : metaData.getPrimaryKeys(tableName)) { + if (NameComparator.INSTANCE.contains(getColumnsNameList(), primaryKey, pkLetterCase)) { + String pkName = pkLetterCase.convert(primaryKey); + pksNameList.add(pkName); } } + setPksNameList(pksNameList); } @@ -780,12 +527,96 @@ protected void loadImpl(Connection connection) throws SQLException { collectRowsFromResultSet(resultSet); } } - collectPrimaryKeyName(connection); + collectPrimaryKeyName(); if (columnsToOrder == null) { sortRows(); } } + /** + * 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/java/org/assertj/db/util/Descriptions.java b/src/main/java/org/assertj/db/util/Descriptions.java index 07a0ae04..e69f9d0e 100644 --- a/src/main/java/org/assertj/db/util/Descriptions.java +++ b/src/main/java/org/assertj/db/util/Descriptions.java @@ -20,7 +20,6 @@ import org.assertj.db.type.ChangeType; import org.assertj.db.type.Changes; import org.assertj.db.type.Request; -import org.assertj.db.type.Source; import org.assertj.db.type.Table; import org.assertj.db.type.Value; @@ -91,12 +90,7 @@ public static String getDescription(Changes changes) { stringBuilder.append("Changes"); } } - if (changes.getSource() != null) { - Source source = changes.getSource(); - stringBuilder.append(" of '").append(source.getUser()).append("/").append(source.getUrl()).append("' source"); - } else { - stringBuilder.append(" of a data source"); - } + stringBuilder.append(" of '").append(changes.getConnectionProvider().toString()).append("'"); return stringBuilder.toString(); } diff --git a/src/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 1fb23ebd..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 @@ -26,6 +26,7 @@ * {@link org.assertj.db.api.assertions.AssertOnColumnOfChangeEquality#hasValues(Character)} method. * * @author Régis Pouiller + * @author Julien Roy */ public class AssertOnColumnOfChangeEquality_HasValues_One_Character_Test extends AbstractTest { @@ -35,7 +36,7 @@ public class AssertOnColumnOfChangeEquality_HasValues_One_Character_Test extends @Test @NeedReload public void test_have_values_equal_to() { - Changes changes = new Changes(source).setStartPointNow(); + Changes changes = assertDbConnection.changes().build().setStartPointNow(); update("update test set var14 = 1 where var1 = 1"); changes.setEndPointNow(); @@ -51,7 +52,7 @@ public void test_have_values_equal_to() { @Test @NeedReload public void should_fail_because_value_at_start_point_is_different() { - Changes changes = new Changes(source).setStartPointNow(); + Changes changes = assertDbConnection.changes().build().setStartPointNow(); update("insert into test(var1, var16) values(5, 'X')"); changes.setEndPointNow(); @@ -59,7 +60,7 @@ public void should_fail_because_value_at_start_point_is_different() { assertThat(changes).change().column("var16").hasValues('X'); fail("An exception must be raised"); } catch (AssertionError e) { - Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Column at index 15 (column name : VAR16) of Change at index 0 (on table : TEST and with primary key : [5]) of Changes on tables of 'sa/jdbc:h2:mem:test' source] %n" + Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Column at index 15 (column name : VAR16) of Change at index 0 (on table : TEST and with primary key : [5]) of Changes on tables of 'sa/jdbc:h2:mem:test'] %n" + "Expecting that start point:%n" + " %n" + "to be equal to: %n" @@ -73,7 +74,7 @@ public void should_fail_because_value_at_start_point_is_different() { @Test @NeedReload public void should_fail_because_value_at_end_point_is_different() { - Changes changes = new Changes(source).setStartPointNow(); + Changes changes = assertDbConnection.changes().build().setStartPointNow(); update("delete from test where var1 = 1"); changes.setEndPointNow(); @@ -81,7 +82,7 @@ public void should_fail_because_value_at_end_point_is_different() { assertThat(changes).change().column("var16").hasValues('T'); fail("An exception must be raised"); } catch (AssertionError e) { - Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Column at index 15 (column name : VAR16) of Change at index 0 (on table : TEST and with primary key : [1]) of Changes on tables of 'sa/jdbc:h2:mem:test' source] %n" + Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Column at index 15 (column name : VAR16) of Change at index 0 (on table : TEST and with primary key : [1]) of Changes on tables of 'sa/jdbc:h2:mem:test'] %n" + "Expecting that end point:%n" + " %n" + "to be equal to: %n" diff --git a/src/test/java/org/assertj/db/api/DefaultDescription_Test.java b/src/test/java/org/assertj/db/api/DefaultDescription_Test.java index 7aab2386..7e379320 100644 --- a/src/test/java/org/assertj/db/api/DefaultDescription_Test.java +++ b/src/test/java/org/assertj/db/api/DefaultDescription_Test.java @@ -12,27 +12,41 @@ */ package org.assertj.db.api; +import static org.assertj.core.api.Assertions.assertThat; +import static org.assertj.db.api.Assertions.assertThat; + +import java.lang.reflect.Field; + import org.assertj.core.api.WritableAssertionInfo; import org.assertj.db.common.AbstractTest; import org.assertj.db.common.NeedReload; 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; -import java.lang.reflect.Field; - -import static org.assertj.core.api.Assertions.assertThat; -import static org.assertj.db.api.Assertions.assertThat; - /** * Test on default descriptions. * * @author Régis Pouiller + * @author Julien Roy */ public class DefaultDescription_Test extends AbstractTest { + 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. */ @@ -43,11 +57,11 @@ public void test_default_description_for_change_with_different_information() thr field.setAccessible(true); - Table actorTable = new Table(dataSource, "actor"); - Request request = new Request(dataSource, "select * from actor"); - Changes changes = new Changes(dataSource).setStartPointNow(); - 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(); @@ -59,10 +73,10 @@ public void test_default_description_for_change_with_different_information() thr WritableAssertionInfo infoOnActorTable = (WritableAssertionInfo) field.get(assertThat(changesOnActorTable).change()); WritableAssertionInfo infoOnTestTable = (WritableAssertionInfo) field.get(assertThat(changes).change(8)); WritableAssertionInfo infoOnRequest = (WritableAssertionInfo) field.get(assertThat(changesOnRequest).change()); - assertThat(info.descriptionText()).isEqualTo("Change at index 0 (on table : ACTOR and with primary key : [4]) of Changes on tables of a data source"); - assertThat(infoOnActorTable.descriptionText()).isEqualTo("Change at index 0 (with primary key : [4]) of Changes on ACTOR table of a data source"); - assertThat(infoOnTestTable.descriptionText()).isEqualTo("Change at index 8 (on table : TEST2) of Changes on tables of a data source"); - assertThat(infoOnRequest.descriptionText()).isEqualTo("Change at index 0 of Changes on 'select * from actor' request of a data source"); + assertThat(info.descriptionText()).isEqualTo("Change at index 0 (on table : ACTOR and with primary key : [4]) of Changes on tables of 'data source'"); + assertThat(infoOnActorTable.descriptionText()).isEqualTo("Change at index 0 (with primary key : [4]) of Changes on ACTOR table of 'data source'"); + assertThat(infoOnTestTable.descriptionText()).isEqualTo("Change at index 8 (on table : TEST2) of Changes on tables of 'data source'"); + assertThat(infoOnRequest.descriptionText()).isEqualTo("Change at index 0 of Changes on 'select * from actor' request of 'data source'"); } /** @@ -75,8 +89,8 @@ public void test_default_description_of_changes() throws Exception { field.setAccessible(true); - Changes changesFromSource = new Changes(source).setStartPointNow(); - Changes changesFromDataSource = new Changes(dataSource).setStartPointNow(); + Changes changesFromSource = assertDbConnection.changes().build().setStartPointNow(); + Changes changesFromDataSource = assertDbConnectionFromDs.changes().build().setStartPointNow(); updateChangesForTests(); changesFromSource.setEndPointNow(); changesFromDataSource.setEndPointNow(); @@ -87,10 +101,10 @@ public void test_default_description_of_changes() throws Exception { WritableAssertionInfo infoFromSource = (WritableAssertionInfo) field.get(assertionFromSource); - assertThat(infoFromSource.descriptionText()).isEqualTo("Changes on tables of 'sa/jdbc:h2:mem:test' source"); + assertThat(infoFromSource.descriptionText()).isEqualTo("Changes on tables of 'sa/jdbc:h2:mem:test'"); WritableAssertionInfo infoFromDataSource = (WritableAssertionInfo) field.get(assertionFromDataSource); - assertThat(infoFromDataSource.descriptionText()).isEqualTo("Changes on tables of a data source"); + assertThat(infoFromDataSource.descriptionText()).isEqualTo("Changes on tables of 'data source'"); } /** @@ -103,8 +117,8 @@ public void test_default_description_of_all_changes() throws Exception { field.setAccessible(true); - Changes changesFromSource = new Changes(source).setStartPointNow(); - Changes changesFromDataSource = new Changes(dataSource).setStartPointNow(); + Changes changesFromSource = assertDbConnection.changes().build().setStartPointNow(); + Changes changesFromDataSource = assertDbConnectionFromDs.changes().build().setStartPointNow(); updateChangesForTests(); changesFromSource.setEndPointNow(); changesFromDataSource.setEndPointNow(); @@ -115,10 +129,10 @@ public void test_default_description_of_all_changes() throws Exception { WritableAssertionInfo infoFromSource = (WritableAssertionInfo) field.get(assertionFromSource); - assertThat(infoFromSource.descriptionText()).isEqualTo("Changes on tables of 'sa/jdbc:h2:mem:test' source"); + assertThat(infoFromSource.descriptionText()).isEqualTo("Changes on tables of 'sa/jdbc:h2:mem:test'"); WritableAssertionInfo infoFromDataSource = (WritableAssertionInfo) field.get(assertionFromDataSource); - assertThat(infoFromDataSource.descriptionText()).isEqualTo("Changes on tables of a data source"); + assertThat(infoFromDataSource.descriptionText()).isEqualTo("Changes on tables of 'data source'"); } /** @@ -131,8 +145,8 @@ public void test_default_description_of_creation_changes() throws Exception { field.setAccessible(true); - Changes changesFromSource = new Changes(source).setStartPointNow(); - Changes changesFromDataSource = new Changes(dataSource).setStartPointNow(); + Changes changesFromSource = assertDbConnection.changes().build().setStartPointNow(); + Changes changesFromDataSource = assertDbConnectionFromDs.changes().build().setStartPointNow(); updateChangesForTests(); changesFromSource.setEndPointNow(); changesFromDataSource.setEndPointNow(); @@ -143,10 +157,10 @@ public void test_default_description_of_creation_changes() throws Exception { WritableAssertionInfo infoFromSource = (WritableAssertionInfo) field.get(assertionFromSource); - assertThat(infoFromSource.descriptionText()).isEqualTo("Changes on tables of 'sa/jdbc:h2:mem:test' source (only creation changes)"); + assertThat(infoFromSource.descriptionText()).isEqualTo("Changes on tables of 'sa/jdbc:h2:mem:test' (only creation changes)"); WritableAssertionInfo infoFromDataSource = (WritableAssertionInfo) field.get(assertionFromDataSource); - assertThat(infoFromDataSource.descriptionText()).isEqualTo("Changes on tables of a data source (only creation changes)"); + assertThat(infoFromDataSource.descriptionText()).isEqualTo("Changes on tables of 'data source' (only creation changes)"); } /** @@ -159,8 +173,8 @@ public void test_default_description_of_modification_changes() throws Exception field.setAccessible(true); - Changes changesFromSource = new Changes(source).setStartPointNow(); - Changes changesFromDataSource = new Changes(dataSource).setStartPointNow(); + Changes changesFromSource = assertDbConnection.changes().build().setStartPointNow(); + Changes changesFromDataSource = assertDbConnectionFromDs.changes().build().setStartPointNow(); updateChangesForTests(); changesFromSource.setEndPointNow(); changesFromDataSource.setEndPointNow(); @@ -171,10 +185,10 @@ public void test_default_description_of_modification_changes() throws Exception WritableAssertionInfo infoFromSource = (WritableAssertionInfo) field.get(assertionFromSource); - assertThat(infoFromSource.descriptionText()).isEqualTo("Changes on tables of 'sa/jdbc:h2:mem:test' source (only modification changes)"); + assertThat(infoFromSource.descriptionText()).isEqualTo("Changes on tables of 'sa/jdbc:h2:mem:test' (only modification changes)"); WritableAssertionInfo infoFromDataSource = (WritableAssertionInfo) field.get(assertionFromDataSource); - assertThat(infoFromDataSource.descriptionText()).isEqualTo("Changes on tables of a data source (only modification changes)"); + assertThat(infoFromDataSource.descriptionText()).isEqualTo("Changes on tables of 'data source' (only modification changes)"); } /** @@ -187,8 +201,8 @@ public void test_default_description_of_deletion_changes() throws Exception { field.setAccessible(true); - Changes changesFromSource = new Changes(source).setStartPointNow(); - Changes changesFromDataSource = new Changes(dataSource).setStartPointNow(); + Changes changesFromSource = assertDbConnection.changes().build().setStartPointNow(); + Changes changesFromDataSource = assertDbConnectionFromDs.changes().build().setStartPointNow(); updateChangesForTests(); changesFromSource.setEndPointNow(); changesFromDataSource.setEndPointNow(); @@ -199,10 +213,10 @@ public void test_default_description_of_deletion_changes() throws Exception { WritableAssertionInfo infoFromSource = (WritableAssertionInfo) field.get(assertionFromSource); - assertThat(infoFromSource.descriptionText()).isEqualTo("Changes on tables of 'sa/jdbc:h2:mem:test' source (only deletion changes)"); + assertThat(infoFromSource.descriptionText()).isEqualTo("Changes on tables of 'sa/jdbc:h2:mem:test' (only deletion changes)"); WritableAssertionInfo infoFromDataSource = (WritableAssertionInfo) field.get(assertionFromDataSource); - assertThat(infoFromDataSource.descriptionText()).isEqualTo("Changes on tables of a data source (only deletion changes)"); + assertThat(infoFromDataSource.descriptionText()).isEqualTo("Changes on tables of 'data source' (only deletion changes)"); } /** @@ -215,8 +229,8 @@ public void test_default_description_of_creation_on_table_changes() throws Excep field.setAccessible(true); - Changes changesFromSource = new Changes(source).setStartPointNow(); - Changes changesFromDataSource = new Changes(dataSource).setStartPointNow(); + Changes changesFromSource = assertDbConnection.changes().build().setStartPointNow(); + Changes changesFromDataSource = assertDbConnectionFromDs.changes().build().setStartPointNow(); updateChangesForTests(); changesFromSource.setEndPointNow(); changesFromDataSource.setEndPointNow(); @@ -227,10 +241,10 @@ public void test_default_description_of_creation_on_table_changes() throws Excep WritableAssertionInfo infoFromSource = (WritableAssertionInfo) field.get(assertionFromSource); - assertThat(infoFromSource.descriptionText()).isEqualTo("Changes on tables of 'sa/jdbc:h2:mem:test' source (only creation changes on actor table)"); + assertThat(infoFromSource.descriptionText()).isEqualTo("Changes on tables of 'sa/jdbc:h2:mem:test' (only creation changes on actor table)"); WritableAssertionInfo infoFromDataSource = (WritableAssertionInfo) field.get(assertionFromDataSource); - assertThat(infoFromDataSource.descriptionText()).isEqualTo("Changes on tables of a data source (only creation changes on actor table)"); + assertThat(infoFromDataSource.descriptionText()).isEqualTo("Changes on tables of 'data source' (only creation changes on actor table)"); } /** @@ -243,8 +257,8 @@ public void test_default_description_of_modification_on_table_changes() throws E field.setAccessible(true); - Changes changesFromSource = new Changes(source).setStartPointNow(); - Changes changesFromDataSource = new Changes(dataSource).setStartPointNow(); + Changes changesFromSource = assertDbConnection.changes().build().setStartPointNow(); + Changes changesFromDataSource = assertDbConnectionFromDs.changes().build().setStartPointNow(); updateChangesForTests(); changesFromSource.setEndPointNow(); changesFromDataSource.setEndPointNow(); @@ -255,10 +269,10 @@ public void test_default_description_of_modification_on_table_changes() throws E WritableAssertionInfo infoFromSource = (WritableAssertionInfo) field.get(assertionFromSource); - assertThat(infoFromSource.descriptionText()).isEqualTo("Changes on tables of 'sa/jdbc:h2:mem:test' source (only modification changes on actor table)"); + assertThat(infoFromSource.descriptionText()).isEqualTo("Changes on tables of 'sa/jdbc:h2:mem:test' (only modification changes on actor table)"); WritableAssertionInfo infoFromDataSource = (WritableAssertionInfo) field.get(assertionFromDataSource); - assertThat(infoFromDataSource.descriptionText()).isEqualTo("Changes on tables of a data source (only modification changes on actor table)"); + assertThat(infoFromDataSource.descriptionText()).isEqualTo("Changes on tables of 'data source' (only modification changes on actor table)"); } /** @@ -271,8 +285,8 @@ public void test_default_description_of_deletion_on_table_changes() throws Excep field.setAccessible(true); - Changes changesFromSource = new Changes(source).setStartPointNow(); - Changes changesFromDataSource = new Changes(dataSource).setStartPointNow(); + Changes changesFromSource = assertDbConnection.changes().build().setStartPointNow(); + Changes changesFromDataSource = assertDbConnectionFromDs.changes().build().setStartPointNow(); updateChangesForTests(); changesFromSource.setEndPointNow(); changesFromDataSource.setEndPointNow(); @@ -283,10 +297,10 @@ public void test_default_description_of_deletion_on_table_changes() throws Excep WritableAssertionInfo infoFromSource = (WritableAssertionInfo) field.get(assertionFromSource); - assertThat(infoFromSource.descriptionText()).isEqualTo("Changes on tables of 'sa/jdbc:h2:mem:test' source (only deletion changes on actor table)"); + assertThat(infoFromSource.descriptionText()).isEqualTo("Changes on tables of 'sa/jdbc:h2:mem:test' (only deletion changes on actor table)"); WritableAssertionInfo infoFromDataSource = (WritableAssertionInfo) field.get(assertionFromDataSource); - assertThat(infoFromDataSource.descriptionText()).isEqualTo("Changes on tables of a data source (only deletion changes on actor table)"); + assertThat(infoFromDataSource.descriptionText()).isEqualTo("Changes on tables of 'data source' (only deletion changes on actor table)"); } /** @@ -299,8 +313,8 @@ public void test_default_description_on_table_changes() throws Exception { field.setAccessible(true); - Changes changesFromSource = new Changes(source).setStartPointNow(); - Changes changesFromDataSource = new Changes(dataSource).setStartPointNow(); + Changes changesFromSource = assertDbConnection.changes().build().setStartPointNow(); + Changes changesFromDataSource = assertDbConnectionFromDs.changes().build().setStartPointNow(); updateChangesForTests(); changesFromSource.setEndPointNow(); changesFromDataSource.setEndPointNow(); @@ -311,10 +325,10 @@ public void test_default_description_on_table_changes() throws Exception { WritableAssertionInfo infoFromSource = (WritableAssertionInfo) field.get(assertionFromSource); - assertThat(infoFromSource.descriptionText()).isEqualTo("Changes on tables of 'sa/jdbc:h2:mem:test' source (only changes on actor table)"); + assertThat(infoFromSource.descriptionText()).isEqualTo("Changes on tables of 'sa/jdbc:h2:mem:test' (only changes on actor table)"); WritableAssertionInfo infoFromDataSource = (WritableAssertionInfo) field.get(assertionFromDataSource); - assertThat(infoFromDataSource.descriptionText()).isEqualTo("Changes on tables of a data source (only changes on actor table)"); + assertThat(infoFromDataSource.descriptionText()).isEqualTo("Changes on tables of 'data source' (only changes on actor table)"); } /** @@ -327,10 +341,10 @@ public void test_default_description_of_changes_on_table() throws Exception { field.setAccessible(true); - Table tableFromSource = new Table(source, "actor"); - Table tableFromDataSource = new Table(dataSource, "actor"); - 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(); @@ -341,10 +355,10 @@ public void test_default_description_of_changes_on_table() throws Exception { WritableAssertionInfo infoFromSource = (WritableAssertionInfo) field.get(assertionFromSource); - assertThat(infoFromSource.descriptionText()).isEqualTo("Changes on ACTOR table of 'sa/jdbc:h2:mem:test' source"); + assertThat(infoFromSource.descriptionText()).isEqualTo("Changes on ACTOR table of 'sa/jdbc:h2:mem:test'"); WritableAssertionInfo infoFromDataSource = (WritableAssertionInfo) field.get(assertionFromDataSource); - assertThat(infoFromDataSource.descriptionText()).isEqualTo("Changes on ACTOR table of a data source"); + assertThat(infoFromDataSource.descriptionText()).isEqualTo("Changes on ACTOR table of 'data source'"); } /** @@ -357,10 +371,10 @@ public void test_default_description_of_changes_on_request() throws Exception { field.setAccessible(true); - Request requestFromSource = new Request(source, "select * from actor").setPksName("ID"); - Request requestFromDataSource = new Request(dataSource, "select * from actor").setPksName("ID"); - 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(); @@ -371,10 +385,10 @@ public void test_default_description_of_changes_on_request() throws Exception { WritableAssertionInfo infoFromSource = (WritableAssertionInfo) field.get(assertionFromSource); - assertThat(infoFromSource.descriptionText()).isEqualTo("Changes on 'select * from actor' request of 'sa/jdbc:h2:mem:test' source"); + assertThat(infoFromSource.descriptionText()).isEqualTo("Changes on 'select * from actor' request of 'sa/jdbc:h2:mem:test'"); WritableAssertionInfo infoFromDataSource = (WritableAssertionInfo) field.get(assertionFromDataSource); - assertThat(infoFromDataSource.descriptionText()).isEqualTo("Changes on 'select * from actor' request of a data source"); + assertThat(infoFromDataSource.descriptionText()).isEqualTo("Changes on 'select * from actor' request of 'data source'"); } /** @@ -387,8 +401,8 @@ public void test_default_description_of_change_of_changes() throws Exception { field.setAccessible(true); - Changes changesFromSource = new Changes(source).setStartPointNow(); - Changes changesFromDataSource = new Changes(dataSource).setStartPointNow(); + Changes changesFromSource = assertDbConnection.changes().build().setStartPointNow(); + Changes changesFromDataSource = assertDbConnectionFromDs.changes().build().setStartPointNow(); updateChangesForTests(); changesFromSource.setEndPointNow(); changesFromDataSource.setEndPointNow(); @@ -399,10 +413,10 @@ public void test_default_description_of_change_of_changes() throws Exception { WritableAssertionInfo infoFromSource = (WritableAssertionInfo) field.get(assertionFromSource); - assertThat(infoFromSource.descriptionText()).isEqualTo("Change at index 0 (on table : ACTOR and with primary key : [4]) of Changes on tables of 'sa/jdbc:h2:mem:test' source"); + assertThat(infoFromSource.descriptionText()).isEqualTo("Change at index 0 (on table : ACTOR and with primary key : [4]) of Changes on tables of 'sa/jdbc:h2:mem:test'"); WritableAssertionInfo infoFromDataSource = (WritableAssertionInfo) field.get(assertionFromDataSource); - assertThat(infoFromDataSource.descriptionText()).isEqualTo("Change at index 1 (on table : INTERPRETATION and with primary key : [6]) of Changes on tables of a data source"); + assertThat(infoFromDataSource.descriptionText()).isEqualTo("Change at index 1 (on table : INTERPRETATION and with primary key : [6]) of Changes on tables of 'data source'"); } /** @@ -415,10 +429,10 @@ public void test_default_description_of_change_of_changes_on_table() throws Exce field.setAccessible(true); - Table tableFromSource = new Table(source, "actor"); - Table tableFromDataSource = new Table(dataSource, "actor"); - 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(); @@ -428,10 +442,10 @@ public void test_default_description_of_change_of_changes_on_table() throws Exce ChangeAssert assertionFromDataSource = assertThat(changesFromDataSource).change(2); WritableAssertionInfo infoFromSource = (WritableAssertionInfo) field.get(assertionFromSource); - assertThat(infoFromSource.descriptionText()).isEqualTo("Change at index 0 (with primary key : [4]) of Changes on ACTOR table of 'sa/jdbc:h2:mem:test' source"); + assertThat(infoFromSource.descriptionText()).isEqualTo("Change at index 0 (with primary key : [4]) of Changes on ACTOR table of 'sa/jdbc:h2:mem:test'"); WritableAssertionInfo infoFromDataSource = (WritableAssertionInfo) field.get(assertionFromDataSource); - assertThat(infoFromDataSource.descriptionText()).isEqualTo("Change at index 2 (with primary key : [3]) of Changes on ACTOR table of a data source"); + assertThat(infoFromDataSource.descriptionText()).isEqualTo("Change at index 2 (with primary key : [3]) of Changes on ACTOR table of 'data source'"); } /** @@ -444,10 +458,10 @@ public void test_default_description_of_change_of_changes_on_request() throws Ex field.setAccessible(true); - Request requestFromSource = new Request(source, "select id, name, firstname, birth from actor where id = 1").setPksName("ID"); - Request requestFromDataSource = new Request(dataSource, "select * from actor").setPksName("ID"); - 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(); @@ -458,10 +472,10 @@ public void test_default_description_of_change_of_changes_on_request() throws Ex WritableAssertionInfo infoFromSource = (WritableAssertionInfo) field.get(assertionFromSource); - assertThat(infoFromSource.descriptionText()).isEqualTo("Change at index 0 (with primary key : [1]) of Changes on 'select id, name, firstname, bi...' request of 'sa/jdbc:h2:mem:test' source"); + assertThat(infoFromSource.descriptionText()).isEqualTo("Change at index 0 (with primary key : [1]) of Changes on 'select id, name, firstname, bi...' request of 'sa/jdbc:h2:mem:test'"); WritableAssertionInfo infoFromDataSource = (WritableAssertionInfo) field.get(assertionFromDataSource); - assertThat(infoFromDataSource.descriptionText()).isEqualTo("Change at index 2 (with primary key : [3]) of Changes on 'select * from actor' request of a data source"); + assertThat(infoFromDataSource.descriptionText()).isEqualTo("Change at index 2 (with primary key : [3]) of Changes on 'select * from actor' request of 'data source'"); } /** @@ -474,8 +488,8 @@ public void test_default_description_of_creation_change_of_changes() throws Exce field.setAccessible(true); - Changes changesFromSource = new Changes(source).setStartPointNow(); - Changes changesFromDataSource = new Changes(dataSource).setStartPointNow(); + Changes changesFromSource = assertDbConnection.changes().build().setStartPointNow(); + Changes changesFromDataSource = assertDbConnectionFromDs.changes().build().setStartPointNow(); updateChangesForTests(); changesFromSource.setEndPointNow(); changesFromDataSource.setEndPointNow(); @@ -486,10 +500,10 @@ public void test_default_description_of_creation_change_of_changes() throws Exce WritableAssertionInfo infoFromSource = (WritableAssertionInfo) field.get(assertionFromSource); - assertThat(infoFromSource.descriptionText()).isEqualTo("Change at index 0 (on table : ACTOR and with primary key : [4]) of Changes on tables of 'sa/jdbc:h2:mem:test' source (only creation changes)"); + assertThat(infoFromSource.descriptionText()).isEqualTo("Change at index 0 (on table : ACTOR and with primary key : [4]) of Changes on tables of 'sa/jdbc:h2:mem:test' (only creation changes)"); WritableAssertionInfo infoFromDataSource = (WritableAssertionInfo) field.get(assertionFromDataSource); - assertThat(infoFromDataSource.descriptionText()).isEqualTo("Change at index 0 (on table : ACTOR and with primary key : [4]) of Changes on tables of a data source (only creation changes)"); + assertThat(infoFromDataSource.descriptionText()).isEqualTo("Change at index 0 (on table : ACTOR and with primary key : [4]) of Changes on tables of 'data source' (only creation changes)"); } /** @@ -502,10 +516,10 @@ public void test_default_description_of_creation_change_of_changes_on_table() th field.setAccessible(true); - Table tableFromSource = new Table(source, "actor"); - Table tableFromDataSource = new Table(dataSource, "actor"); - 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(); @@ -516,10 +530,10 @@ public void test_default_description_of_creation_change_of_changes_on_table() th WritableAssertionInfo infoFromSource = (WritableAssertionInfo) field.get(assertionFromSource); - assertThat(infoFromSource.descriptionText()).isEqualTo("Change at index 0 (with primary key : [4]) of Changes on ACTOR table of 'sa/jdbc:h2:mem:test' source (only creation changes)"); + assertThat(infoFromSource.descriptionText()).isEqualTo("Change at index 0 (with primary key : [4]) of Changes on ACTOR table of 'sa/jdbc:h2:mem:test' (only creation changes)"); WritableAssertionInfo infoFromDataSource = (WritableAssertionInfo) field.get(assertionFromDataSource); - assertThat(infoFromDataSource.descriptionText()).isEqualTo("Change at index 0 (with primary key : [4]) of Changes on ACTOR table of a data source (only creation changes)"); + assertThat(infoFromDataSource.descriptionText()).isEqualTo("Change at index 0 (with primary key : [4]) of Changes on ACTOR table of 'data source' (only creation changes)"); } /** @@ -532,10 +546,10 @@ public void test_default_description_of_creation_change_of_changes_on_request() field.setAccessible(true); - Request requestFromSource = new Request(source, "select * from actor").setPksName("ID"); - Request requestFromDataSource = new Request(dataSource, "select * from actor").setPksName("ID"); - 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(); @@ -546,10 +560,10 @@ public void test_default_description_of_creation_change_of_changes_on_request() WritableAssertionInfo infoFromSource = (WritableAssertionInfo) field.get(assertionFromSource); - assertThat(infoFromSource.descriptionText()).isEqualTo("Change at index 0 (with primary key : [4]) of Changes on 'select * from actor' request of 'sa/jdbc:h2:mem:test' source (only creation changes)"); + assertThat(infoFromSource.descriptionText()).isEqualTo("Change at index 0 (with primary key : [4]) of Changes on 'select * from actor' request of 'sa/jdbc:h2:mem:test' (only creation changes)"); WritableAssertionInfo infoFromDataSource = (WritableAssertionInfo) field.get(assertionFromDataSource); - assertThat(infoFromDataSource.descriptionText()).isEqualTo("Change at index 0 (with primary key : [4]) of Changes on 'select * from actor' request of a data source (only creation changes)"); + assertThat(infoFromDataSource.descriptionText()).isEqualTo("Change at index 0 (with primary key : [4]) of Changes on 'select * from actor' request of 'data source' (only creation changes)"); } /** @@ -562,8 +576,8 @@ public void test_default_description_of_modification_change_of_changes() throws field.setAccessible(true); - Changes changesFromSource = new Changes(source).setStartPointNow(); - Changes changesFromDataSource = new Changes(dataSource).setStartPointNow(); + Changes changesFromSource = assertDbConnection.changes().build().setStartPointNow(); + Changes changesFromDataSource = assertDbConnectionFromDs.changes().build().setStartPointNow(); updateChangesForTests(); changesFromSource.setEndPointNow(); changesFromDataSource.setEndPointNow(); @@ -574,10 +588,10 @@ public void test_default_description_of_modification_change_of_changes() throws WritableAssertionInfo infoFromSource = (WritableAssertionInfo) field.get(assertionFromSource); - assertThat(infoFromSource.descriptionText()).isEqualTo("Change at index 0 (on table : ACTOR and with primary key : [1]) of Changes on tables of 'sa/jdbc:h2:mem:test' source (only modification changes)"); + assertThat(infoFromSource.descriptionText()).isEqualTo("Change at index 0 (on table : ACTOR and with primary key : [1]) of Changes on tables of 'sa/jdbc:h2:mem:test' (only modification changes)"); WritableAssertionInfo infoFromDataSource = (WritableAssertionInfo) field.get(assertionFromDataSource); - assertThat(infoFromDataSource.descriptionText()).isEqualTo("Change at index 0 (on table : ACTOR and with primary key : [1]) of Changes on tables of a data source (only modification changes)"); + assertThat(infoFromDataSource.descriptionText()).isEqualTo("Change at index 0 (on table : ACTOR and with primary key : [1]) of Changes on tables of 'data source' (only modification changes)"); } /** @@ -590,10 +604,10 @@ public void test_default_description_of_modification_change_of_changes_on_table( field.setAccessible(true); - Table tableFromSource = new Table(source, "actor"); - Table tableFromDataSource = new Table(dataSource, "actor"); - 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(); @@ -604,10 +618,10 @@ public void test_default_description_of_modification_change_of_changes_on_table( WritableAssertionInfo infoFromSource = (WritableAssertionInfo) field.get(assertionFromSource); - assertThat(infoFromSource.descriptionText()).isEqualTo("Change at index 0 (with primary key : [1]) of Changes on ACTOR table of 'sa/jdbc:h2:mem:test' source (only modification changes)"); + assertThat(infoFromSource.descriptionText()).isEqualTo("Change at index 0 (with primary key : [1]) of Changes on ACTOR table of 'sa/jdbc:h2:mem:test' (only modification changes)"); WritableAssertionInfo infoFromDataSource = (WritableAssertionInfo) field.get(assertionFromDataSource); - assertThat(infoFromDataSource.descriptionText()).isEqualTo("Change at index 0 (with primary key : [1]) of Changes on ACTOR table of a data source (only modification changes)"); + assertThat(infoFromDataSource.descriptionText()).isEqualTo("Change at index 0 (with primary key : [1]) of Changes on ACTOR table of 'data source' (only modification changes)"); } /** @@ -620,10 +634,10 @@ public void test_default_description_of_modification_change_of_changes_on_reques field.setAccessible(true); - Request requestFromSource = new Request(source, "select * from actor").setPksName("ID"); - Request requestFromDataSource = new Request(dataSource, "select * from actor").setPksName("ID"); - 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(); @@ -633,10 +647,10 @@ public void test_default_description_of_modification_change_of_changes_on_reques WritableAssertionInfo infoFromSource = (WritableAssertionInfo) field.get(assertionFromSource); - assertThat(infoFromSource.descriptionText()).isEqualTo("Change at index 0 (with primary key : [1]) of Changes on 'select * from actor' request of 'sa/jdbc:h2:mem:test' source (only modification changes)"); + assertThat(infoFromSource.descriptionText()).isEqualTo("Change at index 0 (with primary key : [1]) of Changes on 'select * from actor' request of 'sa/jdbc:h2:mem:test' (only modification changes)"); WritableAssertionInfo infoFromDataSource = (WritableAssertionInfo) field.get(assertionFromDataSource); - assertThat(infoFromDataSource.descriptionText()).isEqualTo("Change at index 0 (with primary key : [1]) of Changes on 'select * from actor' request of a data source (only modification changes)"); + assertThat(infoFromDataSource.descriptionText()).isEqualTo("Change at index 0 (with primary key : [1]) of Changes on 'select * from actor' request of 'data source' (only modification changes)"); } /** @@ -649,8 +663,8 @@ public void test_default_description_of_deletion_change_of_changes() throws Exce field.setAccessible(true); - Changes changesFromSource = new Changes(source).setStartPointNow(); - Changes changesFromDataSource = new Changes(dataSource).setStartPointNow(); + Changes changesFromSource = assertDbConnection.changes().build().setStartPointNow(); + Changes changesFromDataSource = assertDbConnectionFromDs.changes().build().setStartPointNow(); updateChangesForTests(); changesFromSource.setEndPointNow(); changesFromDataSource.setEndPointNow(); @@ -661,10 +675,10 @@ public void test_default_description_of_deletion_change_of_changes() throws Exce WritableAssertionInfo infoFromSource = (WritableAssertionInfo) field.get(assertionFromSource); - assertThat(infoFromSource.descriptionText()).isEqualTo("Change at index 0 (on table : ACTOR and with primary key : [3]) of Changes on tables of 'sa/jdbc:h2:mem:test' source (only deletion changes)"); + assertThat(infoFromSource.descriptionText()).isEqualTo("Change at index 0 (on table : ACTOR and with primary key : [3]) of Changes on tables of 'sa/jdbc:h2:mem:test' (only deletion changes)"); WritableAssertionInfo infoFromDataSource = (WritableAssertionInfo) field.get(assertionFromDataSource); - assertThat(infoFromDataSource.descriptionText()).isEqualTo("Change at index 0 (on table : ACTOR and with primary key : [3]) of Changes on tables of a data source (only deletion changes)"); + assertThat(infoFromDataSource.descriptionText()).isEqualTo("Change at index 0 (on table : ACTOR and with primary key : [3]) of Changes on tables of 'data source' (only deletion changes)"); } /** @@ -677,10 +691,10 @@ public void test_default_description_of_deletion_change_of_changes_on_table() th field.setAccessible(true); - Table tableFromSource = new Table(source, "actor"); - Table tableFromDataSource = new Table(dataSource, "actor"); - 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(); @@ -691,10 +705,10 @@ public void test_default_description_of_deletion_change_of_changes_on_table() th WritableAssertionInfo infoFromSource = (WritableAssertionInfo) field.get(assertionFromSource); - assertThat(infoFromSource.descriptionText()).isEqualTo("Change at index 0 (with primary key : [3]) of Changes on ACTOR table of 'sa/jdbc:h2:mem:test' source (only deletion changes)"); + assertThat(infoFromSource.descriptionText()).isEqualTo("Change at index 0 (with primary key : [3]) of Changes on ACTOR table of 'sa/jdbc:h2:mem:test' (only deletion changes)"); WritableAssertionInfo infoFromDataSource = (WritableAssertionInfo) field.get(assertionFromDataSource); - assertThat(infoFromDataSource.descriptionText()).isEqualTo("Change at index 0 (with primary key : [3]) of Changes on ACTOR table of a data source (only deletion changes)"); + assertThat(infoFromDataSource.descriptionText()).isEqualTo("Change at index 0 (with primary key : [3]) of Changes on ACTOR table of 'data source' (only deletion changes)"); } /** @@ -707,10 +721,10 @@ public void test_default_description_of_deletion_change_of_changes_on_request() field.setAccessible(true); - Request requestFromSource = new Request(source, "select * from actor").setPksName("ID"); - Request requestFromDataSource = new Request(dataSource, "select * from actor").setPksName("ID"); - 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(); @@ -721,10 +735,10 @@ public void test_default_description_of_deletion_change_of_changes_on_request() WritableAssertionInfo infoFromSource = (WritableAssertionInfo) field.get(assertionFromSource); - assertThat(infoFromSource.descriptionText()).isEqualTo("Change at index 0 (with primary key : [3]) of Changes on 'select * from actor' request of 'sa/jdbc:h2:mem:test' source (only deletion changes)"); + assertThat(infoFromSource.descriptionText()).isEqualTo("Change at index 0 (with primary key : [3]) of Changes on 'select * from actor' request of 'sa/jdbc:h2:mem:test' (only deletion changes)"); WritableAssertionInfo infoFromDataSource = (WritableAssertionInfo) field.get(assertionFromDataSource); - assertThat(infoFromDataSource.descriptionText()).isEqualTo("Change at index 0 (with primary key : [3]) of Changes on 'select * from actor' request of a data source (only deletion changes)"); + assertThat(infoFromDataSource.descriptionText()).isEqualTo("Change at index 0 (with primary key : [3]) of Changes on 'select * from actor' request of 'data source' (only deletion changes)"); } /** @@ -737,8 +751,8 @@ public void test_default_description_of_creation_change_on_table_of_changes() th field.setAccessible(true); - Changes changesFromSource = new Changes(source).setStartPointNow(); - Changes changesFromDataSource = new Changes(dataSource).setStartPointNow(); + Changes changesFromSource = assertDbConnection.changes().build().setStartPointNow(); + Changes changesFromDataSource = assertDbConnectionFromDs.changes().build().setStartPointNow(); updateChangesForTests(); changesFromSource.setEndPointNow(); changesFromDataSource.setEndPointNow(); @@ -749,10 +763,10 @@ public void test_default_description_of_creation_change_on_table_of_changes() th WritableAssertionInfo infoFromSource = (WritableAssertionInfo) field.get(assertionFromSource); - assertThat(infoFromSource.descriptionText()).isEqualTo("Change at index 0 (on table : ACTOR and with primary key : [4]) of Changes on tables of 'sa/jdbc:h2:mem:test' source (only creation changes on actor table)"); + assertThat(infoFromSource.descriptionText()).isEqualTo("Change at index 0 (on table : ACTOR and with primary key : [4]) of Changes on tables of 'sa/jdbc:h2:mem:test' (only creation changes on actor table)"); WritableAssertionInfo infoFromDataSource = (WritableAssertionInfo) field.get(assertionFromDataSource); - assertThat(infoFromDataSource.descriptionText()).isEqualTo("Change at index 0 (on table : ACTOR and with primary key : [4]) of Changes on tables of a data source (only creation changes on actor table)"); + assertThat(infoFromDataSource.descriptionText()).isEqualTo("Change at index 0 (on table : ACTOR and with primary key : [4]) of Changes on tables of 'data source' (only creation changes on actor table)"); } /** @@ -765,10 +779,10 @@ public void test_default_description_of_creation_change_on_table_of_changes_on_t field.setAccessible(true); - Table tableFromSource = new Table(source, "actor"); - Table tableFromDataSource = new Table(dataSource, "actor"); - 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(); @@ -779,10 +793,10 @@ public void test_default_description_of_creation_change_on_table_of_changes_on_t WritableAssertionInfo infoFromSource = (WritableAssertionInfo) field.get(assertionFromSource); - assertThat(infoFromSource.descriptionText()).isEqualTo("Change at index 0 (with primary key : [4]) of Changes on ACTOR table of 'sa/jdbc:h2:mem:test' source (only creation changes on actor table)"); + assertThat(infoFromSource.descriptionText()).isEqualTo("Change at index 0 (with primary key : [4]) of Changes on ACTOR table of 'sa/jdbc:h2:mem:test' (only creation changes on actor table)"); WritableAssertionInfo infoFromDataSource = (WritableAssertionInfo) field.get(assertionFromDataSource); - assertThat(infoFromDataSource.descriptionText()).isEqualTo("Change at index 0 (with primary key : [4]) of Changes on ACTOR table of a data source (only creation changes on actor table)"); + assertThat(infoFromDataSource.descriptionText()).isEqualTo("Change at index 0 (with primary key : [4]) of Changes on ACTOR table of 'data source' (only creation changes on actor table)"); } /** @@ -795,8 +809,8 @@ public void test_default_description_of_modification_change_on_table_of_changes( field.setAccessible(true); - Changes changesFromSource = new Changes(source).setStartPointNow(); - Changes changesFromDataSource = new Changes(dataSource).setStartPointNow(); + Changes changesFromSource = assertDbConnection.changes().build().setStartPointNow(); + Changes changesFromDataSource = assertDbConnectionFromDs.changes().build().setStartPointNow(); updateChangesForTests(); changesFromSource.setEndPointNow(); changesFromDataSource.setEndPointNow(); @@ -807,10 +821,10 @@ public void test_default_description_of_modification_change_on_table_of_changes( WritableAssertionInfo infoFromSource = (WritableAssertionInfo) field.get(assertionFromSource); - assertThat(infoFromSource.descriptionText()).isEqualTo("Change at index 0 (on table : ACTOR and with primary key : [1]) of Changes on tables of 'sa/jdbc:h2:mem:test' source (only modification changes on actor table)"); + assertThat(infoFromSource.descriptionText()).isEqualTo("Change at index 0 (on table : ACTOR and with primary key : [1]) of Changes on tables of 'sa/jdbc:h2:mem:test' (only modification changes on actor table)"); WritableAssertionInfo infoFromDataSource = (WritableAssertionInfo) field.get(assertionFromDataSource); - assertThat(infoFromDataSource.descriptionText()).isEqualTo("Change at index 0 (on table : ACTOR and with primary key : [1]) of Changes on tables of a data source (only modification changes on actor table)"); + assertThat(infoFromDataSource.descriptionText()).isEqualTo("Change at index 0 (on table : ACTOR and with primary key : [1]) of Changes on tables of 'data source' (only modification changes on actor table)"); } /** @@ -823,10 +837,10 @@ public void test_default_description_of_modification_change_on_table_of_changes_ field.setAccessible(true); - Table tableFromSource = new Table(source, "actor"); - Table tableFromDataSource = new Table(dataSource, "actor"); - 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(); @@ -837,10 +851,10 @@ public void test_default_description_of_modification_change_on_table_of_changes_ WritableAssertionInfo infoFromSource = (WritableAssertionInfo) field.get(assertionFromSource); - assertThat(infoFromSource.descriptionText()).isEqualTo("Change at index 0 (with primary key : [1]) of Changes on ACTOR table of 'sa/jdbc:h2:mem:test' source (only modification changes on actor table)"); + assertThat(infoFromSource.descriptionText()).isEqualTo("Change at index 0 (with primary key : [1]) of Changes on ACTOR table of 'sa/jdbc:h2:mem:test' (only modification changes on actor table)"); WritableAssertionInfo infoFromDataSource = (WritableAssertionInfo) field.get(assertionFromDataSource); - assertThat(infoFromDataSource.descriptionText()).isEqualTo("Change at index 0 (with primary key : [1]) of Changes on ACTOR table of a data source (only modification changes on actor table)"); + assertThat(infoFromDataSource.descriptionText()).isEqualTo("Change at index 0 (with primary key : [1]) of Changes on ACTOR table of 'data source' (only modification changes on actor table)"); } /** @@ -853,8 +867,8 @@ public void test_default_description_of_deletion_change_on_table_of_changes() th field.setAccessible(true); - Changes changesFromSource = new Changes(source).setStartPointNow(); - Changes changesFromDataSource = new Changes(dataSource).setStartPointNow(); + Changes changesFromSource = assertDbConnection.changes().build().setStartPointNow(); + Changes changesFromDataSource = assertDbConnectionFromDs.changes().build().setStartPointNow(); updateChangesForTests(); changesFromSource.setEndPointNow(); changesFromDataSource.setEndPointNow(); @@ -865,10 +879,10 @@ public void test_default_description_of_deletion_change_on_table_of_changes() th WritableAssertionInfo infoFromSource = (WritableAssertionInfo) field.get(assertionFromSource); - assertThat(infoFromSource.descriptionText()).isEqualTo("Change at index 0 (on table : ACTOR and with primary key : [3]) of Changes on tables of 'sa/jdbc:h2:mem:test' source (only deletion changes on actor table)"); + assertThat(infoFromSource.descriptionText()).isEqualTo("Change at index 0 (on table : ACTOR and with primary key : [3]) of Changes on tables of 'sa/jdbc:h2:mem:test' (only deletion changes on actor table)"); WritableAssertionInfo infoFromDataSource = (WritableAssertionInfo) field.get(assertionFromDataSource); - assertThat(infoFromDataSource.descriptionText()).isEqualTo("Change at index 0 (on table : ACTOR and with primary key : [3]) of Changes on tables of a data source (only deletion changes on actor table)"); + assertThat(infoFromDataSource.descriptionText()).isEqualTo("Change at index 0 (on table : ACTOR and with primary key : [3]) of Changes on tables of 'data source' (only deletion changes on actor table)"); } /** @@ -881,10 +895,10 @@ public void test_default_description_of_deletion_change_on_table_of_changes_on_t field.setAccessible(true); - Table tableFromSource = new Table(source, "actor"); - Table tableFromDataSource = new Table(dataSource, "actor"); - 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(); @@ -895,10 +909,10 @@ public void test_default_description_of_deletion_change_on_table_of_changes_on_t WritableAssertionInfo infoFromSource = (WritableAssertionInfo) field.get(assertionFromSource); - assertThat(infoFromSource.descriptionText()).isEqualTo("Change at index 0 (with primary key : [3]) of Changes on ACTOR table of 'sa/jdbc:h2:mem:test' source (only deletion changes on actor table)"); + assertThat(infoFromSource.descriptionText()).isEqualTo("Change at index 0 (with primary key : [3]) of Changes on ACTOR table of 'sa/jdbc:h2:mem:test' (only deletion changes on actor table)"); WritableAssertionInfo infoFromDataSource = (WritableAssertionInfo) field.get(assertionFromDataSource); - assertThat(infoFromDataSource.descriptionText()).isEqualTo("Change at index 0 (with primary key : [3]) of Changes on ACTOR table of a data source (only deletion changes on actor table)"); + assertThat(infoFromDataSource.descriptionText()).isEqualTo("Change at index 0 (with primary key : [3]) of Changes on ACTOR table of 'data source' (only deletion changes on actor table)"); } /** @@ -911,8 +925,8 @@ public void test_default_description_of_change_on_table_of_changes() throws Exce field.setAccessible(true); - Changes changesFromSource = new Changes(source).setStartPointNow(); - Changes changesFromDataSource = new Changes(dataSource).setStartPointNow(); + Changes changesFromSource = assertDbConnection.changes().build().setStartPointNow(); + Changes changesFromDataSource = assertDbConnectionFromDs.changes().build().setStartPointNow(); updateChangesForTests(); changesFromSource.setEndPointNow(); changesFromDataSource.setEndPointNow(); @@ -922,10 +936,10 @@ public void test_default_description_of_change_on_table_of_changes() throws Exce ChangeAssert assertionFromDataSource = assertThat(changesFromDataSource).changeOnTable("actor", 0); WritableAssertionInfo infoFromSource = (WritableAssertionInfo) field.get(assertionFromSource); - assertThat(infoFromSource.descriptionText()).isEqualTo("Change at index 0 (on table : ACTOR and with primary key : [4]) of Changes on tables of 'sa/jdbc:h2:mem:test' source (only changes on actor table)"); + assertThat(infoFromSource.descriptionText()).isEqualTo("Change at index 0 (on table : ACTOR and with primary key : [4]) of Changes on tables of 'sa/jdbc:h2:mem:test' (only changes on actor table)"); WritableAssertionInfo infoFromDataSource = (WritableAssertionInfo) field.get(assertionFromDataSource); - assertThat(infoFromDataSource.descriptionText()).isEqualTo("Change at index 0 (on table : ACTOR and with primary key : [4]) of Changes on tables of a data source (only changes on actor table)"); + assertThat(infoFromDataSource.descriptionText()).isEqualTo("Change at index 0 (on table : ACTOR and with primary key : [4]) of Changes on tables of 'data source' (only changes on actor table)"); } /** @@ -938,10 +952,10 @@ public void test_default_description_of_change_on_table_of_changes_on_table() th field.setAccessible(true); - Table tableFromSource = new Table(source, "actor"); - Table tableFromDataSource = new Table(dataSource, "actor"); - 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(); @@ -952,10 +966,10 @@ public void test_default_description_of_change_on_table_of_changes_on_table() th WritableAssertionInfo infoFromSource = (WritableAssertionInfo) field.get(assertionFromSource); - assertThat(infoFromSource.descriptionText()).isEqualTo("Change at index 0 (with primary key : [4]) of Changes on ACTOR table of 'sa/jdbc:h2:mem:test' source (only changes on actor table)"); + assertThat(infoFromSource.descriptionText()).isEqualTo("Change at index 0 (with primary key : [4]) of Changes on ACTOR table of 'sa/jdbc:h2:mem:test' (only changes on actor table)"); WritableAssertionInfo infoFromDataSource = (WritableAssertionInfo) field.get(assertionFromDataSource); - assertThat(infoFromDataSource.descriptionText()).isEqualTo("Change at index 0 (with primary key : [4]) of Changes on ACTOR table of a data source (only changes on actor table)"); + assertThat(infoFromDataSource.descriptionText()).isEqualTo("Change at index 0 (with primary key : [4]) of Changes on ACTOR table of 'data source' (only changes on actor table)"); } /** @@ -968,8 +982,8 @@ public void test_default_description_of_change_on_table_with_pks_of_changes() th field.setAccessible(true); - Changes changesFromSource = new Changes(source).setStartPointNow(); - Changes changesFromDataSource = new Changes(dataSource).setStartPointNow(); + Changes changesFromSource = assertDbConnection.changes().build().setStartPointNow(); + Changes changesFromDataSource = assertDbConnectionFromDs.changes().build().setStartPointNow(); updateChangesForTests(); changesFromSource.setEndPointNow(); changesFromDataSource.setEndPointNow(); @@ -980,10 +994,10 @@ public void test_default_description_of_change_on_table_with_pks_of_changes() th WritableAssertionInfo infoFromSource = (WritableAssertionInfo) field.get(assertionFromSource); - assertThat(infoFromSource.descriptionText()).isEqualTo("Change at index 1 (on table : ACTOR and with primary key : [1]) of Changes on tables of 'sa/jdbc:h2:mem:test' source (only changes on actor table)"); + assertThat(infoFromSource.descriptionText()).isEqualTo("Change at index 1 (on table : ACTOR and with primary key : [1]) of Changes on tables of 'sa/jdbc:h2:mem:test' (only changes on actor table)"); WritableAssertionInfo infoFromDataSource = (WritableAssertionInfo) field.get(assertionFromDataSource); - assertThat(infoFromDataSource.descriptionText()).isEqualTo("Change at index 1 (on table : ACTOR and with primary key : [1]) of Changes on tables of a data source (only changes on actor table)"); + assertThat(infoFromDataSource.descriptionText()).isEqualTo("Change at index 1 (on table : ACTOR and with primary key : [1]) of Changes on tables of 'data source' (only changes on actor table)"); } /** @@ -996,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(source, "actor"); - Table tableFromDataSource = new Table(dataSource, "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(); @@ -1010,10 +1024,10 @@ public void test_default_description_of_change_on_table_with_pks_of_changes_on_t WritableAssertionInfo infoFromSource = (WritableAssertionInfo) field.get(assertionFromSource); - assertThat(infoFromSource.descriptionText()).isEqualTo("Change at index 1 (with primary key : [1]) of Changes on ACTOR table of 'sa/jdbc:h2:mem:test' source (only changes on actor table)"); + assertThat(infoFromSource.descriptionText()).isEqualTo("Change at index 1 (with primary key : [1]) of Changes on ACTOR table of 'sa/jdbc:h2:mem:test' (only changes on actor table)"); WritableAssertionInfo infoFromDataSource = (WritableAssertionInfo) field.get(assertionFromDataSource); - assertThat(infoFromDataSource.descriptionText()).isEqualTo("Change at index 1 (with primary key : [1]) of Changes on ACTOR table of a data source (only changes on actor table)"); + assertThat(infoFromDataSource.descriptionText()).isEqualTo("Change at index 1 (with primary key : [1]) of Changes on ACTOR table of 'data source' (only changes on actor table)"); } /** @@ -1026,8 +1040,8 @@ public void test_default_description_column_of_change_of_changes() throws Except field.setAccessible(true); - Changes changesFromSource = new Changes(source).setStartPointNow(); - Changes changesFromDataSource = new Changes(dataSource).setStartPointNow(); + Changes changesFromSource = assertDbConnection.changes().build().setStartPointNow(); + Changes changesFromDataSource = assertDbConnectionFromDs.changes().build().setStartPointNow(); updateChangesForTests(); changesFromSource.setEndPointNow(); changesFromDataSource.setEndPointNow(); @@ -1038,10 +1052,10 @@ public void test_default_description_column_of_change_of_changes() throws Except WritableAssertionInfo infoFromSource = (WritableAssertionInfo) field.get(assertionFromSource); - assertThat(infoFromSource.descriptionText()).isEqualTo("Column at index 0 (column name : ID) of Change at index 0 (on table : ACTOR and with primary key : [4]) of Changes on tables of 'sa/jdbc:h2:mem:test' source"); + assertThat(infoFromSource.descriptionText()).isEqualTo("Column at index 0 (column name : ID) of Change at index 0 (on table : ACTOR and with primary key : [4]) of Changes on tables of 'sa/jdbc:h2:mem:test'"); WritableAssertionInfo infoFromDataSource = (WritableAssertionInfo) field.get(assertionFromDataSource); - assertThat(infoFromDataSource.descriptionText()).isEqualTo("Column at index 0 (column name : ID) of Change at index 1 (on table : INTERPRETATION and with primary key : [6]) of Changes on tables of a data source"); + assertThat(infoFromDataSource.descriptionText()).isEqualTo("Column at index 0 (column name : ID) of Change at index 1 (on table : INTERPRETATION and with primary key : [6]) of Changes on tables of 'data source'"); } /** @@ -1054,8 +1068,8 @@ public void test_default_description_row_at_start_point_of_change_of_changes() t field.setAccessible(true); - Changes changesFromSource = new Changes(source).setStartPointNow(); - Changes changesFromDataSource = new Changes(dataSource).setStartPointNow(); + Changes changesFromSource = assertDbConnection.changes().build().setStartPointNow(); + Changes changesFromDataSource = assertDbConnectionFromDs.changes().build().setStartPointNow(); updateChangesForTests(); changesFromSource.setEndPointNow(); changesFromDataSource.setEndPointNow(); @@ -1066,10 +1080,10 @@ public void test_default_description_row_at_start_point_of_change_of_changes() t WritableAssertionInfo infoFromSource = (WritableAssertionInfo) field.get(assertionFromSource); - assertThat(infoFromSource.descriptionText()).isEqualTo("Row at start point of Change at index 0 (on table : ACTOR and with primary key : [4]) of Changes on tables of 'sa/jdbc:h2:mem:test' source"); + assertThat(infoFromSource.descriptionText()).isEqualTo("Row at start point of Change at index 0 (on table : ACTOR and with primary key : [4]) of Changes on tables of 'sa/jdbc:h2:mem:test'"); WritableAssertionInfo infoFromDataSource = (WritableAssertionInfo) field.get(assertionFromDataSource); - assertThat(infoFromDataSource.descriptionText()).isEqualTo("Row at start point of Change at index 1 (on table : INTERPRETATION and with primary key : [6]) of Changes on tables of a data source"); + assertThat(infoFromDataSource.descriptionText()).isEqualTo("Row at start point of Change at index 1 (on table : INTERPRETATION and with primary key : [6]) of Changes on tables of 'data source'"); } /** @@ -1082,8 +1096,8 @@ public void test_default_description_row_at_end_point_of_change_of_changes() thr field.setAccessible(true); - Changes changesFromSource = new Changes(source).setStartPointNow(); - Changes changesFromDataSource = new Changes(dataSource).setStartPointNow(); + Changes changesFromSource = assertDbConnection.changes().build().setStartPointNow(); + Changes changesFromDataSource = assertDbConnectionFromDs.changes().build().setStartPointNow(); updateChangesForTests(); changesFromSource.setEndPointNow(); changesFromDataSource.setEndPointNow(); @@ -1094,10 +1108,10 @@ public void test_default_description_row_at_end_point_of_change_of_changes() thr WritableAssertionInfo infoFromSource = (WritableAssertionInfo) field.get(assertionFromSource); - assertThat(infoFromSource.descriptionText()).isEqualTo("Row at end point of Change at index 0 (on table : ACTOR and with primary key : [4]) of Changes on tables of 'sa/jdbc:h2:mem:test' source"); + assertThat(infoFromSource.descriptionText()).isEqualTo("Row at end point of Change at index 0 (on table : ACTOR and with primary key : [4]) of Changes on tables of 'sa/jdbc:h2:mem:test'"); WritableAssertionInfo infoFromDataSource = (WritableAssertionInfo) field.get(assertionFromDataSource); - assertThat(infoFromDataSource.descriptionText()).isEqualTo("Row at end point of Change at index 1 (on table : INTERPRETATION and with primary key : [6]) of Changes on tables of a data source"); + assertThat(infoFromDataSource.descriptionText()).isEqualTo("Row at end point of Change at index 1 (on table : INTERPRETATION and with primary key : [6]) of Changes on tables of 'data source'"); } /** @@ -1110,8 +1124,8 @@ public void test_default_description_value_at_start_point_of_column_of_change_of field.setAccessible(true); - Changes changesFromSource = new Changes(source).setStartPointNow(); - Changes changesFromDataSource = new Changes(dataSource).setStartPointNow(); + Changes changesFromSource = assertDbConnection.changes().build().setStartPointNow(); + Changes changesFromDataSource = assertDbConnectionFromDs.changes().build().setStartPointNow(); updateChangesForTests(); changesFromSource.setEndPointNow(); changesFromDataSource.setEndPointNow(); @@ -1123,10 +1137,10 @@ public void test_default_description_value_at_start_point_of_column_of_change_of WritableAssertionInfo infoFromSource = (WritableAssertionInfo) field.get(assertionFromSource); - assertThat(infoFromSource.descriptionText()).isEqualTo("Value at start point of Column at index 0 (column name : ID) of Change at index 0 (on table : ACTOR and with primary key : [4]) of Changes on tables of 'sa/jdbc:h2:mem:test' source"); + assertThat(infoFromSource.descriptionText()).isEqualTo("Value at start point of Column at index 0 (column name : ID) of Change at index 0 (on table : ACTOR and with primary key : [4]) of Changes on tables of 'sa/jdbc:h2:mem:test'"); WritableAssertionInfo infoFromDataSource = (WritableAssertionInfo) field.get(assertionFromDataSource); - assertThat(infoFromDataSource.descriptionText()).isEqualTo("Value at start point of Column at index 0 (column name : ID) of Change at index 1 (on table : INTERPRETATION and with primary key : [6]) of Changes on tables of a data source"); + assertThat(infoFromDataSource.descriptionText()).isEqualTo("Value at start point of Column at index 0 (column name : ID) of Change at index 1 (on table : INTERPRETATION and with primary key : [6]) of Changes on tables of 'data source'"); } /** @@ -1139,8 +1153,8 @@ public void test_default_description_value_at_end_point_of_column_of_change_of_c field.setAccessible(true); - Changes changesFromSource = new Changes(source).setStartPointNow(); - Changes changesFromDataSource = new Changes(dataSource).setStartPointNow(); + Changes changesFromSource = assertDbConnection.changes().build().setStartPointNow(); + Changes changesFromDataSource = assertDbConnectionFromDs.changes().build().setStartPointNow(); updateChangesForTests(); changesFromSource.setEndPointNow(); changesFromDataSource.setEndPointNow(); @@ -1152,10 +1166,10 @@ public void test_default_description_value_at_end_point_of_column_of_change_of_c WritableAssertionInfo infoFromSource = (WritableAssertionInfo) field.get(assertionFromSource); - assertThat(infoFromSource.descriptionText()).isEqualTo("Value at end point of Column at index 0 (column name : ID) of Change at index 0 (on table : ACTOR and with primary key : [4]) of Changes on tables of 'sa/jdbc:h2:mem:test' source"); + assertThat(infoFromSource.descriptionText()).isEqualTo("Value at end point of Column at index 0 (column name : ID) of Change at index 0 (on table : ACTOR and with primary key : [4]) of Changes on tables of 'sa/jdbc:h2:mem:test'"); WritableAssertionInfo infoFromDataSource = (WritableAssertionInfo) field.get(assertionFromDataSource); - assertThat(infoFromDataSource.descriptionText()).isEqualTo("Value at end point of Column at index 0 (column name : ID) of Change at index 1 (on table : INTERPRETATION and with primary key : [6]) of Changes on tables of a data source"); + assertThat(infoFromDataSource.descriptionText()).isEqualTo("Value at end point of Column at index 0 (column name : ID) of Change at index 1 (on table : INTERPRETATION and with primary key : [6]) of Changes on tables of 'data source'"); } /** @@ -1168,8 +1182,8 @@ public void test_default_description_value_of_row_at_start_point_of_change_of_ch field.setAccessible(true); - Changes changesFromSource = new Changes(source).setStartPointNow(); - Changes changesFromDataSource = new Changes(dataSource).setStartPointNow(); + Changes changesFromSource = assertDbConnection.changes().build().setStartPointNow(); + Changes changesFromDataSource = assertDbConnectionFromDs.changes().build().setStartPointNow(); updateChangesForTests(); changesFromSource.setEndPointNow(); changesFromDataSource.setEndPointNow(); @@ -1180,10 +1194,10 @@ public void test_default_description_value_of_row_at_start_point_of_change_of_ch WritableAssertionInfo infoFromSource = (WritableAssertionInfo) field.get(assertionFromSource); - assertThat(infoFromSource.descriptionText()).isEqualTo("Value at index 0 (column name : ID) of Row at start point of Change at index 3 (on table : ACTOR and with primary key : [1]) of Changes on tables of 'sa/jdbc:h2:mem:test' source"); + assertThat(infoFromSource.descriptionText()).isEqualTo("Value at index 0 (column name : ID) of Row at start point of Change at index 3 (on table : ACTOR and with primary key : [1]) of Changes on tables of 'sa/jdbc:h2:mem:test'"); WritableAssertionInfo infoFromDataSource = (WritableAssertionInfo) field.get(assertionFromDataSource); - assertThat(infoFromDataSource.descriptionText()).isEqualTo("Value at index 0 (column name : ID) of Row at start point of Change at index 3 (on table : ACTOR and with primary key : [1]) of Changes on tables of a data source"); + assertThat(infoFromDataSource.descriptionText()).isEqualTo("Value at index 0 (column name : ID) of Row at start point of Change at index 3 (on table : ACTOR and with primary key : [1]) of Changes on tables of 'data source'"); } /** @@ -1196,8 +1210,8 @@ public void test_default_description_value_of_row_at_end_point_of_change_of_chan field.setAccessible(true); - Changes changesFromSource = new Changes(source).setStartPointNow(); - Changes changesFromDataSource = new Changes(dataSource).setStartPointNow(); + Changes changesFromSource = assertDbConnection.changes().build().setStartPointNow(); + Changes changesFromDataSource = assertDbConnectionFromDs.changes().build().setStartPointNow(); updateChangesForTests(); changesFromSource.setEndPointNow(); changesFromDataSource.setEndPointNow(); @@ -1208,10 +1222,10 @@ public void test_default_description_value_of_row_at_end_point_of_change_of_chan WritableAssertionInfo infoFromSource = (WritableAssertionInfo) field.get(assertionFromSource); - assertThat(infoFromSource.descriptionText()).isEqualTo("Value at index 0 (column name : ID) of Row at end point of Change at index 0 (on table : ACTOR and with primary key : [4]) of Changes on tables of 'sa/jdbc:h2:mem:test' source"); + assertThat(infoFromSource.descriptionText()).isEqualTo("Value at index 0 (column name : ID) of Row at end point of Change at index 0 (on table : ACTOR and with primary key : [4]) of Changes on tables of 'sa/jdbc:h2:mem:test'"); WritableAssertionInfo infoFromDataSource = (WritableAssertionInfo) field.get(assertionFromDataSource); - assertThat(infoFromDataSource.descriptionText()).isEqualTo("Value at index 0 (column name : ID) of Row at end point of Change at index 1 (on table : INTERPRETATION and with primary key : [6]) of Changes on tables of a data source"); + assertThat(infoFromDataSource.descriptionText()).isEqualTo("Value at index 0 (column name : ID) of Row at end point of Change at index 1 (on table : INTERPRETATION and with primary key : [6]) of Changes on tables of 'data source'"); } /** @@ -1223,8 +1237,8 @@ public void test_default_description_of_table() throws Exception { field.setAccessible(true); - Table tableFromSource = new Table(source, "actor"); - Table tableFromDataSource = new Table(dataSource, "actor"); + Table tableFromSource = assertDbConnection.table("actor").build(); + Table tableFromDataSource = assertDbConnectionFromDs.table("actor").build(); TableAssert assertionFromSource = assertThat(tableFromSource); @@ -1247,8 +1261,8 @@ public void test_default_description_of_request() throws Exception { field.setAccessible(true); - Request requestFromSource = new Request(source, "select id, name, firstname, birth from actor where id = 1").setPksName("ID"); - Request requestFromDataSource = new Request(dataSource, "select * from actor").setPksName("ID"); + Request requestFromSource = 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); @@ -1271,8 +1285,8 @@ public void test_default_description_of_column_of_table() throws Exception { field.setAccessible(true); - Table tableFromSource = new Table(source, "actor"); - Table tableFromDataSource = new Table(dataSource, "actor"); + Table tableFromSource = assertDbConnection.table("actor").build(); + Table tableFromDataSource = assertDbConnectionFromDs.table("actor").build(); TableColumnAssert assertionFromSource = assertThat(tableFromSource).column(); @@ -1295,8 +1309,8 @@ public void test_default_description_of_row_of_table() throws Exception { field.setAccessible(true); - Table tableFromSource = new Table(source, "actor"); - Table tableFromDataSource = new Table(dataSource, "actor"); + Table tableFromSource = assertDbConnection.table("actor").build(); + Table tableFromDataSource = assertDbConnectionFromDs.table("actor").build(); TableRowAssert assertionFromSource = assertThat(tableFromSource).row(); @@ -1319,8 +1333,8 @@ public void test_default_description_of_column_of_request() throws Exception { field.setAccessible(true); - Request requestFromSource = new Request(source, "select * from actor").setPksName("ID"); - Request requestFromDataSource = new Request(dataSource, "select * from actor").setPksName("ID"); + Request requestFromSource = assertDbConnection.request("select * from actor").pksName("ID").build(); + Request requestFromDataSource = assertDbConnectionFromDs.request("select * from actor").pksName("ID").build(); RequestColumnAssert assertionFromSource = assertThat(requestFromSource).column(); @@ -1343,8 +1357,8 @@ public void test_default_description_of_row_of_request() throws Exception { field.setAccessible(true); - Request requestFromSource = new Request(source, "select * from actor").setPksName("ID"); - Request requestFromDataSource = new Request(dataSource, "select * from actor").setPksName("ID"); + Request requestFromSource = assertDbConnection.request("select * from actor").pksName("ID").build(); + Request requestFromDataSource = assertDbConnectionFromDs.request("select * from actor").pksName("ID").build(); RequestRowAssert assertionFromSource = assertThat(requestFromSource).row(); @@ -1367,8 +1381,8 @@ public void test_default_description_of_value_of_column_of_table() throws Except field.setAccessible(true); - Table tableFromSource = new Table(source, "actor"); - Table tableFromDataSource = new Table(dataSource, "actor"); + Table tableFromSource = assertDbConnection.table("actor").build(); + Table tableFromDataSource = assertDbConnectionFromDs.table("actor").build(); TableColumnValueAssert assertionFromSource = assertThat(tableFromSource).column().value(); @@ -1391,8 +1405,8 @@ public void test_default_description_of_value_of_row_of_table() throws Exception field.setAccessible(true); - Table tableFromSource = new Table(source, "actor"); - Table tableFromDataSource = new Table(dataSource, "actor"); + Table tableFromSource = assertDbConnection.table("actor").build(); + Table tableFromDataSource = assertDbConnectionFromDs.table("actor").build(); TableRowValueAssert assertionFromSource = assertThat(tableFromSource).row().value(); @@ -1415,8 +1429,8 @@ public void test_default_description_of_value_of_column_of_request() throws Exce field.setAccessible(true); - Request requestFromSource = new Request(source, "select * from actor").setPksName("ID"); - Request requestFromDataSource = new Request(dataSource, "select * from actor").setPksName("ID"); + Request requestFromSource = assertDbConnection.request("select * from actor").pksName("ID").build(); + Request requestFromDataSource = assertDbConnectionFromDs.request("select * from actor").pksName("ID").build(); RequestColumnValueAssert assertionFromSource = assertThat(requestFromSource).column().value(); @@ -1439,8 +1453,8 @@ public void test_default_description_of_value_of_row_of_request() throws Excepti field.setAccessible(true); - Request requestFromSource = new Request(source, "select * from actor").setPksName("ID"); - Request requestFromDataSource = new Request(dataSource, "select * from actor").setPksName("ID"); + Request requestFromSource = 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 b0484cfd..522fe6b0 100644 --- a/src/test/java/org/assertj/db/api/Descriptable_Test.java +++ b/src/test/java/org/assertj/db/api/Descriptable_Test.java @@ -29,6 +29,7 @@ * Test on {@code Descriptable} interface methods. * * @author Régis Pouiller + * @author Julien Roy */ public class Descriptable_Test extends AbstractTest { @@ -39,7 +40,7 @@ public class Descriptable_Test extends AbstractTest { public void test_as() throws Exception { Field field = AbstractElement.class.getDeclaredField("info"); field.setAccessible(true); - Table table = new Table(source, "actor"); + Table table = 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 5c64be6d..499e4e49 100644 --- a/src/test/java/org/assertj/db/api/SoftAssertions_Test.java +++ b/src/test/java/org/assertj/db/api/SoftAssertions_Test.java @@ -12,6 +12,9 @@ */ package org.assertj.db.api; +import static org.assertj.core.api.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThatThrownBy; + import org.assertj.core.api.SoftAssertionError; import org.assertj.core.api.ThrowableAssert; import org.assertj.db.common.AbstractTest; @@ -21,9 +24,6 @@ import org.assertj.db.type.Table; import org.junit.Test; -import static org.assertj.core.api.Assertions.assertThat; -import static org.assertj.core.api.Assertions.assertThatThrownBy; - /** * Test on the utility class {@code SoftAssertions}. * @@ -37,7 +37,7 @@ public class SoftAssertions_Test extends AbstractTest { @Test @NeedReload public void test_soft_assert_table() { - Table table = new Table(source, "test"); + Table table = 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(source, "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(source); + 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 b75fc10e..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 @@ -27,6 +27,7 @@ * {@link AssertOnChangeType#isCreation()}} method. * * @author Régis Pouiller + * @author Julien Roy */ public class AssertOnChangeType_IsCreation_Test extends AbstractTest { @@ -35,8 +36,8 @@ public class AssertOnChangeType_IsCreation_Test extends AbstractTest { */ @Test @NeedReload - public void test_is_creation() throws Exception { - Changes changes = new Changes(source).setStartPointNow(); + public void test_is_creation() { + Changes changes = assertDbConnection.changes().build().setStartPointNow(); updateChangesForTests(); changes.setEndPointNow(); @@ -50,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(source).setStartPointNow(); + public void should_fail_because_type_of_change_is_different() { + Changes changes = assertDbConnection.changes().build().setStartPointNow(); updateChangesForTests(); changes.setEndPointNow(); @@ -59,7 +60,7 @@ public void should_fail_because_type_of_change_is_different() throws Exception { assertThat(changes).change(3).isCreation(); fail("An exception must be raised"); } catch (AssertionError e) { - Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Change at index 3 (on table : ACTOR and with primary key : [1]) of Changes on tables of 'sa/jdbc:h2:mem:test' source] %n" + Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Change at index 3 (on table : ACTOR and with primary key : [1]) of Changes on tables of 'sa/jdbc:h2:mem:test'] %n" + "Expecting:%n" + "to be of type%n" + " %n" diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnChangeType_IsDeletion_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnChangeType_IsDeletion_Test.java index 7af6e086..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 @@ -27,6 +27,7 @@ * {@link AssertOnChangeType#isDeletion()}} method. * * @author Régis Pouiller + * @author Julien Roy */ public class AssertOnChangeType_IsDeletion_Test extends AbstractTest { @@ -35,8 +36,8 @@ public class AssertOnChangeType_IsDeletion_Test extends AbstractTest { */ @Test @NeedReload - public void test_is_deletion() throws Exception { - Changes changes = new Changes(source).setStartPointNow(); + public void test_is_deletion() { + Changes changes = assertDbConnection.changes().build().setStartPointNow(); updateChangesForTests(); changes.setEndPointNow(); @@ -50,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(source).setStartPointNow(); + public void should_fail_because_type_of_change_is_different() { + Changes changes = assertDbConnection.changes().build().setStartPointNow(); updateChangesForTests(); changes.setEndPointNow(); @@ -59,7 +60,7 @@ public void should_fail_because_type_of_change_is_different() throws Exception { assertThat(changes).change(3).isDeletion(); fail("An exception must be raised"); } catch (AssertionError e) { - Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Change at index 3 (on table : ACTOR and with primary key : [1]) of Changes on tables of 'sa/jdbc:h2:mem:test' source] %n" + Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Change at index 3 (on table : ACTOR and with primary key : [1]) of Changes on tables of 'sa/jdbc:h2:mem:test'] %n" + "Expecting:%n" + "to be of type%n" + " %n" diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnChangeType_IsModification_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnChangeType_IsModification_Test.java index c5bd83fb..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 @@ -27,6 +27,7 @@ * {@link AssertOnChangeType#isModification()}} method. * * @author Régis Pouiller + * @author Julien Roy */ public class AssertOnChangeType_IsModification_Test extends AbstractTest { @@ -35,8 +36,8 @@ public class AssertOnChangeType_IsModification_Test extends AbstractTest { */ @Test @NeedReload - public void test_is_modification() throws Exception { - Changes changes = new Changes(source).setStartPointNow(); + public void test_is_modification() { + Changes changes = assertDbConnection.changes().build().setStartPointNow(); updateChangesForTests(); changes.setEndPointNow(); @@ -50,8 +51,8 @@ public void test_is_modification() throws Exception { */ @Test @NeedReload - public void should_fail_because_type_of_change_is_different() throws Exception { - Changes changes = new Changes(source).setStartPointNow(); + public void should_fail_because_type_of_change_is_different() { + Changes changes = assertDbConnection.changes().build().setStartPointNow(); updateChangesForTests(); changes.setEndPointNow(); @@ -59,7 +60,7 @@ public void should_fail_because_type_of_change_is_different() throws Exception { assertThat(changes).change().isModification(); fail("An exception must be raised"); } catch (AssertionError e) { - Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Change at index 0 (on table : ACTOR and with primary key : [4]) of Changes on tables of 'sa/jdbc:h2:mem:test' source] %n" + 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" diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnChangeType_IsOfType_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnChangeType_IsOfType_Test.java index 4dce3796..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 @@ -28,6 +28,7 @@ * {@link AssertOnChangeType#isOfType(org.assertj.db.type.ChangeType)} method. * * @author Régis Pouiller + * @author Julien Roy */ public class AssertOnChangeType_IsOfType_Test extends AbstractTest { @@ -36,8 +37,8 @@ public class AssertOnChangeType_IsOfType_Test extends AbstractTest { */ @Test @NeedReload - public void test_is_of_type() throws Exception { - Changes changes = new Changes(source).setStartPointNow(); + public void test_is_of_type() { + Changes changes = assertDbConnection.changes().build().setStartPointNow(); updateChangesForTests(); changes.setEndPointNow(); @@ -51,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(source).setStartPointNow(); + public void should_fail_because_type_of_change_is_different() { + Changes changes = assertDbConnection.changes().build().setStartPointNow(); updateChangesForTests(); changes.setEndPointNow(); @@ -60,7 +61,7 @@ public void should_fail_because_type_of_change_is_different() throws Exception { assertThat(changes).change(3).isOfType(ChangeType.CREATION); fail("An exception must be raised"); } catch (AssertionError e) { - Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Change at index 3 (on table : ACTOR and with primary key : [1]) of Changes on tables of 'sa/jdbc:h2:mem:test' source] %n" + Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Change at index 3 (on table : ACTOR and with primary key : [1]) of Changes on tables of 'sa/jdbc:h2:mem:test'] %n" + "Expecting:%n" + "to be of type%n" + " %n" diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnColumnClass_IsOfClass_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnColumnClass_IsOfClass_Test.java index 0c9f1d90..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 @@ -29,6 +29,7 @@ * {@link AssertOnColumnClass#isOfClass(Class, boolean)} method. * * @author Régis Pouiller + * @author Julien Roy */ public class AssertOnColumnClass_IsOfClass_Test extends AbstractTest { @@ -38,12 +39,12 @@ public class AssertOnColumnClass_IsOfClass_Test extends AbstractTest { @Test @NeedReload public void test_is_of_type() { - Changes changes = new Changes(source).setStartPointNow(); + Changes changes = 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(source, "test"); - Table table2 = new Table(source, "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); @@ -65,18 +66,18 @@ public void test_is_of_type() { @Test @NeedReload public void should_fail_because_value_have_different_type() { - Changes changes = new Changes(source).setStartPointNow(); + Changes changes = 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(source, "test"); - Table table2 = new Table(source, "test2"); + Table table = assertDbConnection.table("test").build(); + Table table2 = assertDbConnection.table("test2").build(); try { assertThat(changes).change().column("var2").isOfClass(Boolean.class, false); fail("An exception must be raised"); } catch (AssertionError e) { - Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Column at index 1 (column name : VAR2) of Change at index 0 (on table : TEST and with primary key : [5]) of Changes on tables of 'sa/jdbc:h2:mem:test' source] %n" + Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Column at index 1 (column name : VAR2) of Change at index 0 (on table : TEST and with primary key : [5]) of Changes on tables of 'sa/jdbc:h2:mem:test'] %n" + "Expecting that the value at start point:%n" + " %n" + "to be of class%n" @@ -86,7 +87,7 @@ public void should_fail_because_value_have_different_type() { assertThat(changes).change(1).column("var1").isOfClass(Boolean.class, true); fail("An exception must be raised"); } catch (AssertionError e) { - Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Column at index 0 (column name : VAR1) of Change at index 1 (on table : TEST and with primary key : [1]) of Changes on tables of 'sa/jdbc:h2:mem:test' source] %n" + Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Column at index 0 (column name : VAR1) of Change at index 1 (on table : TEST and with primary key : [1]) of Changes on tables of 'sa/jdbc:h2:mem:test'] %n" + "Expecting that the value at start point:%n" + " <1>%n" + "to be of class%n" diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnColumnContent_ContainsValues_Boolean_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnColumnContent_ContainsValues_Boolean_Test.java index 9382938a..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 @@ -26,6 +26,7 @@ * {@link AssertOnColumnContent#containsValues(Boolean...)} method. * * @author Régis Pouiller + * @author Julien Roy */ public class AssertOnColumnContent_ContainsValues_Boolean_Test extends AbstractTest { @@ -33,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(source, "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(source, "test2"); + Table table2 = assertDbConnection.table("test2").build(); TableColumnAssert tableColumnAssert2 = assertThat(table2).column("var2"); TableColumnAssert tableColumnAssertReturn2 = tableColumnAssert2.containsValues(true, null); Assertions.assertThat(tableColumnAssert2).isSameAs(tableColumnAssertReturn2); @@ -49,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(source, "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); @@ -63,7 +64,7 @@ public void should_fail_because_values_are_different() throws Exception { + " <[true, false, true, false]>%n" + " (parameter at index 2 is not found)")); } - Table table2 = new Table(source, "test2"); + Table table2 = 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 ce578d1f..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 @@ -27,6 +27,7 @@ * {@link AssertOnColumnContent#containsValues(byte[]...)} method. * * @author Régis Pouiller + * @author Julien Roy */ public class AssertOnColumnContent_ContainsValues_Bytes_Test extends AbstractTest { @@ -34,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(source, "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(source, "test2"); + Table table2 = assertDbConnection.table("test2").build(); TableColumnAssert tableColumnAssert2 = assertThat(table2).column("var11"); TableColumnAssert tableColumnAssertReturn2 = tableColumnAssert2.containsValues(bytesH2, null); Assertions.assertThat(tableColumnAssert2).isSameAs(tableColumnAssertReturn2); @@ -53,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(source, "test"); + Table table = assertDbConnection.table("test").build(); TableColumnAssert tableColumnAssert = assertThat(table).column("var11"); try { tableColumnAssert.containsValues(bytesH2, bytesH2, bytesH2, bytesH2); @@ -67,7 +68,7 @@ public void should_fail_because_values_are_different() throws Exception { + " (parameter at index 1 is not found)")); } - Table table2 = new Table(source, "test2"); + Table table2 = 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 7144dfd4..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 @@ -26,6 +26,7 @@ * {@link AssertOnColumnContent#containsValues(Character...)} method. * * @author Régis Pouiller + * @author Julien Roy */ public class AssertOnColumnContent_ContainsValues_Character_Test extends AbstractTest { @@ -33,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(source, "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(source, "test2"); + Table table2 = assertDbConnection.table("test2").build(); TableColumnAssert tableColumnAssert2 = assertThat(table2).column("var17"); TableColumnAssert tableColumnAssertReturn2 = tableColumnAssert2.containsValues(null, 'T'); Assertions.assertThat(tableColumnAssert2).isSameAs(tableColumnAssertReturn2); @@ -49,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(source, "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'); @@ -63,7 +64,7 @@ public void should_fail_because_values_are_different() throws Exception { + " <['t', 'e', 's', 't']>%n" + " (parameter <'t'> at index 3 is not found)")); } - Table table2 = new Table(source, "test2"); + Table table2 = 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 d0cd0dc5..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 @@ -29,6 +29,7 @@ * {@link AssertOnColumnContent#containsValues(org.assertj.db.type.DateTimeValue...)} method. * * @author Régis Pouiller + * @author Julien Roy */ public class AssertOnColumnContent_ContainsValues_DateTimeValue_Test extends AbstractTest { @@ -36,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(source, "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)), @@ -46,7 +47,7 @@ public void test_has_values() throws Exception { DateTimeValue.of(DateValue.of(2014, 5, 30))); Assertions.assertThat(tableColumnAssert).isSameAs(tableColumnAssertReturn); - Table table2 = new Table(source, "test2"); + Table table2 = 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)), @@ -72,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(source, "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)), @@ -95,7 +96,7 @@ public void should_fail_because_values_are_different() throws Exception { + " 2014-05-30T00:00:00.000000000]>%n" + " (parameter <2014-05-30T13:29:49.000000000> at index 1 is not found)")); } - Table table2 = new Table(source, "test2"); + Table table2 = 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 b75ecddd..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 @@ -28,6 +28,7 @@ * {@link AssertOnColumnContent#containsValues(org.assertj.db.type.DateValue...)} method. * * @author Régis Pouiller + * @author Julien Roy */ public class AssertOnColumnContent_ContainsValues_DateValue_Test extends AbstractTest { @@ -36,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(source, "test"); + Table table = assertDbConnection.table("test").build(); TableColumnAssert tableColumnAssert = assertThat(table).column("var9"); TableColumnAssert tableColumnAssertReturn = tableColumnAssert.containsValues( DateValue.of(2014, 5, 24), @@ -47,7 +48,7 @@ public void test_has_values() throws Exception { DateValue.of(2014, 5, 30)); Assertions.assertThat(tableColumnAssert).isSameAs(tableColumnAssertReturn); - Table table2 = new Table(source, "test2"); + Table table2 = assertDbConnection.table("test2").build(); TableColumnAssert tableColumnAssert2 = assertThat(table2).column("var9"); TableColumnAssert tableColumnAssertReturn2 = tableColumnAssert2.containsValues(DateValue.of(2014, 5, 24), null); @@ -62,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(source, "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), @@ -82,7 +83,7 @@ public void should_fail_because_values_are_different() throws Exception { + " <[2014-05-24, 2014-05-29, 2014-05-30, 2014-05-30]>%n" + " (parameter <2014-05-29> at index 1 is not found)")); } - Table table2 = new Table(source, "test2"); + Table table2 = 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 e3b6d3cb..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 @@ -26,6 +26,7 @@ * {@link AssertOnColumnContent#containsValues(Number...)} method. * * @author Régis Pouiller + * @author Julien Roy */ public class AssertOnColumnContent_ContainsValues_Number_Test extends AbstractTest { @@ -33,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(source, "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(source, "test2"); + Table table2 = assertDbConnection.table("test2").build(); TableColumnAssert tableColumnAssert2 = assertThat(table2).column("var3"); TableColumnAssert tableColumnAssertReturn2 = tableColumnAssert2.containsValues(2, null); Assertions.assertThat(tableColumnAssert2).isSameAs(tableColumnAssertReturn2); @@ -97,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(source, "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); @@ -111,7 +112,7 @@ public void should_fail_because_values_are_different() throws Exception { + " <[2, 20, 35, 0]>%n" + " (parameter <35> at index 2 is not found)")); } - Table table2 = new Table(source, "test2"); + Table table2 = 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 3ac469c7..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 @@ -27,6 +27,7 @@ * {@link AssertOnColumnContent#containsValues(String...)} method. * * @author Régis Pouiller + * @author Julien Roy */ public class AssertOnColumnContent_ContainsValues_String_Test extends AbstractTest { @@ -35,13 +36,13 @@ public class AssertOnColumnContent_ContainsValues_String_Test extends AbstractTe */ @Test @NeedReload - public void test_has_values() throws Exception { - Table table = new Table(source, "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(source, "test2"); + Table table2 = assertDbConnection.table("test2").build(); TableColumnAssert tableColumnAssert2 = assertThat(table2).column("var3"); TableColumnAssert tableColumnAssertReturn2 = tableColumnAssert2.containsValues("2", null); Assertions.assertThat(tableColumnAssert2).isSameAs(tableColumnAssertReturn2); @@ -154,7 +155,7 @@ public void test_has_values() throws Exception { Assertions.assertThat(tableColumnAssert18).isSameAs(tableColumnAssertReturn18); update("update test2 set var10 = '2014-05-24' where var1 = 1"); - table2 = new Table(source, "test2"); + table2 = assertDbConnection.table("test2").build(); TableColumnAssert tableColumnAssert19 = assertThat(table2).column("var10"); TableColumnAssert tableColumnAssertReturn19 = tableColumnAssert19.containsValues("2014-05-24", null); @@ -171,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(source, "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"); @@ -185,7 +186,7 @@ public void should_fail_because_values_are_different() throws Exception { + " <[\"2\", \"20\", \"35\", \"0\"]>%n" + " (parameter <\"35\"> at index 2 is not found)")); } - Table table2 = new Table(source, "test2"); + Table table2 = 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 99f7336a..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 @@ -27,6 +27,7 @@ * {@link AssertOnColumnContent#containsValues(org.assertj.db.type.TimeValue...)} method. * * @author Régis Pouiller + * @author Julien Roy */ public class AssertOnColumnContent_HasValues_TimeValue_Test extends AbstractTest { @@ -34,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(source, "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), @@ -43,7 +44,7 @@ public void test_has_values() throws Exception { TimeValue.of(12, 29, 49)); Assertions.assertThat(tableColumnAssert).isSameAs(tableColumnAssertReturn); - Table table2 = new Table(source, "test2"); + Table table2 = 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); @@ -53,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(source, "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), @@ -76,7 +77,7 @@ public void should_fail_because_values_are_different() throws Exception { + "12:29:49.000000000]>%n" + " (parameter <12:29:49.000000000> at index 3 is not found)")); } - Table table2 = new Table(source, "test2"); + Table table2 = 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 b1d87aeb..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(source, "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(source, "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(source, "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(source, "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 ee0a4c2b..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 @@ -26,6 +26,7 @@ * {@link org.assertj.db.api.assertions.AssertOnColumnEquality#hasValues(Boolean...)} method. * * @author Régis Pouiller + * @author Julien Roy */ public class AssertOnColumnEquality_HasValues_Boolean_Test extends AbstractTest { @@ -33,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(source, "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(source, "test2"); + Table table2 = assertDbConnection.table("test2").build(); TableColumnAssert tableColumnAssert2 = assertThat(table2).column("var2"); TableColumnAssert tableColumnAssertReturn2 = tableColumnAssert2.hasValues(true, null); Assertions.assertThat(tableColumnAssert2).isSameAs(tableColumnAssertReturn2); @@ -49,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(source, "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); @@ -62,7 +63,7 @@ public void should_fail_because_values_are_different() throws Exception { + "to be equal to: %n" + " ")); } - Table table2 = new Table(source, "test2"); + Table table2 = 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 dbc74e51..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 @@ -27,6 +27,7 @@ * {@link org.assertj.db.api.assertions.AssertOnColumnEquality#hasValues(byte[]...)} method. * * @author Régis Pouiller + * @author Julien Roy */ public class AssertOnColumnEquality_HasValues_Bytes_Test extends AbstractTest { @@ -34,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(source, "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(source, "test2"); + Table table2 = assertDbConnection.table("test2").build(); TableColumnAssert tableColumnAssert2 = assertThat(table2).column("var11"); TableColumnAssert tableColumnAssertReturn2 = tableColumnAssert2.hasValues(bytesH2, null); Assertions.assertThat(tableColumnAssert2).isSameAs(tableColumnAssertReturn2); @@ -53,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(source, "test"); + Table table = assertDbConnection.table("test").build(); TableColumnAssert tableColumnAssert = assertThat(table).column("var11"); try { tableColumnAssert.hasValues(bytesH2, bytesH2, bytesH2, bytesH2); @@ -66,7 +67,7 @@ public void should_fail_because_values_are_different() throws Exception { + "Expecting that the value at index 1 to be equal to the expected value but was not equal")); } - Table table2 = new Table(source, "test2"); + Table table2 = 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 5e0ddc2d..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 @@ -26,6 +26,7 @@ * {@link org.assertj.db.api.assertions.AssertOnColumnEquality#hasValues(Character...)} method. * * @author Régis Pouiller + * @author Julien Roy */ public class AssertOnColumnEquality_HasValues_Character_Test extends AbstractTest { @@ -33,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(source, "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(source, "test2"); + Table table2 = assertDbConnection.table("test2").build(); TableColumnAssert tableColumnAssert2 = assertThat(table2).column("var17"); TableColumnAssert tableColumnAssertReturn2 = tableColumnAssert2.hasValues('T', null); Assertions.assertThat(tableColumnAssert2).isSameAs(tableColumnAssertReturn2); @@ -49,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(source, "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'); @@ -62,7 +63,7 @@ public void should_fail_because_values_are_different() throws Exception { + "to be equal to: %n" + " <'t'>")); } - Table table2 = new Table(source, "test2"); + Table table2 = 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 5b5d454e..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 @@ -29,6 +29,7 @@ * {@link org.assertj.db.api.assertions.AssertOnColumnEquality#hasValues(org.assertj.db.type.DateTimeValue...)} method. * * @author Régis Pouiller + * @author Julien Roy */ public class AssertOnColumnEquality_HasValues_DateTimeValue_Test extends AbstractTest { @@ -36,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(source, "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)), @@ -46,7 +47,7 @@ public void test_has_values() throws Exception { DateTimeValue.of(DateValue.of(2014, 5, 30))); Assertions.assertThat(tableColumnAssert).isSameAs(tableColumnAssertReturn); - Table table2 = new Table(source, "test2"); + Table table2 = 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)), @@ -72,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(source, "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)), @@ -88,7 +89,7 @@ public void should_fail_because_values_are_different() throws Exception { + "to be equal to: %n" + " <2014-05-30T13:29:49.000000000>")); } - Table table2 = new Table(source, "test2"); + Table table2 = 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 a25c480c..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 @@ -28,6 +28,7 @@ * {@link org.assertj.db.api.assertions.AssertOnColumnEquality#hasValues(org.assertj.db.type.DateValue...)} method. * * @author Régis Pouiller + * @author Julien Roy */ public class AssertOnColumnEquality_HasValues_DateValue_Test extends AbstractTest { @@ -36,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(source, "test"); + Table table = assertDbConnection.table("test").build(); TableColumnAssert tableColumnAssert = assertThat(table).column("var9"); TableColumnAssert tableColumnAssertReturn = tableColumnAssert.hasValues( DateValue.of(2014, 5, 24), @@ -47,7 +48,7 @@ public void test_has_values() throws Exception { DateValue.of(2014, 5, 30)); Assertions.assertThat(tableColumnAssert).isSameAs(tableColumnAssertReturn); - Table table2 = new Table(source, "test2"); + Table table2 = assertDbConnection.table("test2").build(); TableColumnAssert tableColumnAssert2 = assertThat(table2).column("var9"); TableColumnAssert tableColumnAssertReturn2 = tableColumnAssert2.hasValues(DateValue.of(2014, 5, 24), null); @@ -62,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(source, "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), @@ -78,7 +79,7 @@ public void should_fail_because_values_are_different() throws Exception { + "to be equal to: %n" + " <2014-05-29>")); } - Table table2 = new Table(source, "test2"); + Table table2 = 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 ca13e0f5..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 @@ -26,6 +26,7 @@ * {@link org.assertj.db.api.assertions.AssertOnColumnEquality#hasValues(Number...)} method. * * @author Régis Pouiller + * @author Julien Roy */ public class AssertOnColumnEquality_HasValues_Number_Test extends AbstractTest { @@ -33,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(source, "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(source, "test2"); + Table table2 = assertDbConnection.table("test2").build(); TableColumnAssert tableColumnAssert2 = assertThat(table2).column("var3"); TableColumnAssert tableColumnAssertReturn2 = tableColumnAssert2.hasValues(2, null); Assertions.assertThat(tableColumnAssert2).isSameAs(tableColumnAssertReturn2); @@ -97,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(source, "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); @@ -110,7 +111,7 @@ public void should_fail_because_values_are_different() throws Exception { + "to be equal to: %n" + " <35>")); } - Table table2 = new Table(source, "test2"); + Table table2 = 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 2829f3ba..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 @@ -27,6 +27,7 @@ * {@link org.assertj.db.api.assertions.AssertOnColumnEquality#hasValues(String...)} method. * * @author Régis Pouiller + * @author Julien Roy */ public class AssertOnColumnEquality_HasValues_String_Test extends AbstractTest { @@ -35,13 +36,13 @@ public class AssertOnColumnEquality_HasValues_String_Test extends AbstractTest { */ @Test @NeedReload - public void test_has_values() throws Exception { - Table table = new Table(source, "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(source, "test2"); + Table table2 = assertDbConnection.table("test2").build(); TableColumnAssert tableColumnAssert2 = assertThat(table2).column("var3"); TableColumnAssert tableColumnAssertReturn2 = tableColumnAssert2.hasValues("2", null); Assertions.assertThat(tableColumnAssert2).isSameAs(tableColumnAssertReturn2); @@ -154,7 +155,7 @@ public void test_has_values() throws Exception { Assertions.assertThat(tableColumnAssert18).isSameAs(tableColumnAssertReturn18); update("update test2 set var10 = '2014-05-24' where var1 = 1"); - table2 = new Table(source, "test2"); + table2 = assertDbConnection.table("test2").build(); TableColumnAssert tableColumnAssert19 = assertThat(table2).column("var10"); TableColumnAssert tableColumnAssertReturn19 = tableColumnAssert19.hasValues("2014-05-24", null); @@ -170,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(source, "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"); @@ -183,7 +184,7 @@ public void should_fail_because_values_are_different() throws Exception { + "to be equal to: %n" + " <\"35\">")); } - Table table2 = new Table(source, "test2"); + Table table2 = 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 16bdbf15..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 @@ -27,6 +27,7 @@ * {@link org.assertj.db.api.assertions.AssertOnColumnEquality#hasValues(org.assertj.db.type.TimeValue...)} method. * * @author Régis Pouiller + * @author Julien Roy */ public class AssertOnColumnEquality_HasValues_TimeValue_Test extends AbstractTest { @@ -34,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(source, "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), @@ -43,7 +44,7 @@ public void test_has_values() throws Exception { TimeValue.of(12, 29, 49)); Assertions.assertThat(tableColumnAssert).isSameAs(tableColumnAssertReturn); - Table table2 = new Table(source, "test2"); + Table table2 = 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); @@ -53,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(source, "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), @@ -69,7 +70,7 @@ public void should_fail_because_values_are_different() throws Exception { + "to be equal to: %n" + " <12:29:49.000000000>")); } - Table table2 = new Table(source, "test2"); + Table table2 = 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 d69796ff..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(source, "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(source, "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(source, "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(source, "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 4ca2e35b..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 @@ -33,6 +33,7 @@ * {@link AssertOnColumnName#hasColumnName(String)} method. * * @author Régis Pouiller + * @author Julien Roy */ public class AssertOnColumnName_HasColumnName_Test extends AbstractTest { @@ -41,8 +42,8 @@ public class AssertOnColumnName_HasColumnName_Test extends AbstractTest { */ @Test @NeedReload - public void test_has_column_name() throws Exception { - Changes changes = new Changes(source).setStartPointNow(); + public void test_has_column_name() { + Changes changes = assertDbConnection.changes().build().setStartPointNow(); updateChangesForTests(); changes.setEndPointNow(); @@ -54,7 +55,7 @@ public void test_has_column_name() throws Exception { ChangeRowValueAssert changeRowValueAssert2 = changeRowValueAssert.hasColumnName("id"); Assertions.assertThat(changeRowValueAssert).isSameAs(changeRowValueAssert2); - Table table = new Table(source, "actor"); + Table table = assertDbConnection.table("actor").build(); TableAssert tableAssert = assertThat(table); TableColumnAssert tableColumnAssert = tableAssert.column(); TableColumnAssert tableColumnAssert2 = tableColumnAssert.hasColumnName("id"); @@ -69,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(source).setStartPointNow(); + public void should_fail_because_column_name_is_different() { + Changes changes = assertDbConnection.changes().build().setStartPointNow(); updateChangesForTests(); changes.setEndPointNow(); @@ -79,7 +80,7 @@ public void should_fail_because_column_name_is_different() throws Exception { changeAssert.column().hasColumnName("ID2"); fail("An exception must be raised"); } catch (AssertionError e) { - Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Column at index 0 (column name : ID) of Change at index 0 (on table : ACTOR and with primary key : [4]) of Changes on tables of 'sa/jdbc:h2:mem:test' source] %n" + Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Column at index 0 (column name : ID) of Change at index 0 (on table : ACTOR and with primary key : [4]) of Changes on tables of 'sa/jdbc:h2:mem:test'] %n" + "Expecting :%n" + " \"ID2\"%n" + "to be the name of the column but was:%n" @@ -89,14 +90,14 @@ public void should_fail_because_column_name_is_different() throws Exception { changeAssert.rowAtEndPoint().value().hasColumnName("ID2"); fail("An exception must be raised"); } catch (AssertionError e) { - Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Value at index 0 (column name : ID) of Row at end point of Change at index 0 (on table : ACTOR and with primary key : [4]) of Changes on tables of 'sa/jdbc:h2:mem:test' source] %n" + Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Value at index 0 (column name : ID) of Row at end point of Change at index 0 (on table : ACTOR and with primary key : [4]) of Changes on tables of 'sa/jdbc:h2:mem:test'] %n" + "Expecting :%n" + " \"ID2\"%n" + "to be the name of the column but was:%n" + " \"ID\"")); } - Table table = new Table(source, "actor"); + Table table = 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 b56dc5bb..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 @@ -26,6 +26,7 @@ * {@link org.assertj.db.api.assertions.AssertOnColumnNullity#hasOnlyNotNullValues()} method. * * @author Régis Pouiller + * @author Julien Roy */ public class AssertOnColumnNullity_HasOnlyNotNullValues_Test extends AbstractTest { @@ -34,7 +35,7 @@ public class AssertOnColumnNullity_HasOnlyNotNullValues_Test extends AbstractTes */ @Test public void test_has_only_not_null_values() { - Table table = new Table(source, "test"); + Table table = assertDbConnection.table("test").build(); TableColumnAssert tableColumnAssert = assertThat(table).column("var14"); TableColumnAssert tableColumnAssert2 = tableColumnAssert.hasOnlyNotNullValues(); Assertions.assertThat(tableColumnAssert).isSameAs(tableColumnAssert2); @@ -44,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(source, "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 a5df95af..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 @@ -26,6 +26,7 @@ * {@link org.assertj.db.api.assertions.AssertOnColumnNullity#hasOnlyNullValues()} method. * * @author Régis Pouiller + * @author Julien Roy */ public class AssertOnColumnNullity_HasOnlyNullValues_Test extends AbstractTest { @@ -34,7 +35,7 @@ public class AssertOnColumnNullity_HasOnlyNullValues_Test extends AbstractTest { */ @Test public void test_has_only_null_values() { - Table table = new Table(source, "test2"); + Table table = assertDbConnection.table("test2").build(); TableColumnAssert tableColumnAssert = assertThat(table).column("var15"); TableColumnAssert tableColumnAssert2 = tableColumnAssert.hasOnlyNullValues(); Assertions.assertThat(tableColumnAssert).isSameAs(tableColumnAssert2); @@ -44,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(source, "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 e501d5e3..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 @@ -28,6 +28,7 @@ * {@link org.assertj.db.api.assertions.AssertOnColumnOfChangeEquality#hasValues(Boolean)} method. * * @author Régis Pouiller + * @author Julien Roy */ public class AssertOnColumnOfChangeEquality_HasValues_One_Boolean_Test extends AbstractTest { @@ -37,7 +38,7 @@ public class AssertOnColumnOfChangeEquality_HasValues_One_Boolean_Test extends A @Test @NeedReload public void test_have_values_equal_to() { - Changes changes = new Changes(source).setStartPointNow(); + Changes changes = assertDbConnection.changes().build().setStartPointNow(); update("update test set var14 = 1 where var1 = 1"); changes.setEndPointNow(); @@ -53,7 +54,7 @@ public void test_have_values_equal_to() { @Test @NeedReload public void should_fail_because_value_at_start_point_is_different() { - Changes changes = new Changes(source).setStartPointNow(); + Changes changes = assertDbConnection.changes().build().setStartPointNow(); update("insert into test(var1, var2) values(5, true)"); changes.setEndPointNow(); @@ -61,7 +62,7 @@ public void should_fail_because_value_at_start_point_is_different() { assertThat(changes).change().column("var2").hasValues(true); fail("An exception must be raised"); } catch (AssertionError e) { - Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Column at index 1 (column name : VAR2) of Change at index 0 (on table : TEST and with primary key : [5]) of Changes on tables of 'sa/jdbc:h2:mem:test' source] %n" + Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Column at index 1 (column name : VAR2) of Change at index 0 (on table : TEST and with primary key : [5]) of Changes on tables of 'sa/jdbc:h2:mem:test'] %n" + "Expecting that start point:%n" + " %n" + "to be equal to: %n" @@ -75,7 +76,7 @@ public void should_fail_because_value_at_start_point_is_different() { @Test @NeedReload public void should_fail_because_value_at_end_point_is_different() { - Changes changes = new Changes(source).setStartPointNow(); + Changes changes = assertDbConnection.changes().build().setStartPointNow(); update("delete from test where var1 = 1"); changes.setEndPointNow(); @@ -83,7 +84,7 @@ public void should_fail_because_value_at_end_point_is_different() { assertThat(changes).change().column("var2").hasValues(true); fail("An exception must be raised"); } catch (AssertionError e) { - Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Column at index 1 (column name : VAR2) of Change at index 0 (on table : TEST and with primary key : [1]) of Changes on tables of 'sa/jdbc:h2:mem:test' source] %n" + Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Column at index 1 (column name : VAR2) of Change at index 0 (on table : TEST and with primary key : [1]) of Changes on tables of 'sa/jdbc:h2:mem:test'] %n" + "Expecting that end point:%n" + " %n" + "to be equal to: %n" diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnColumnOfChangeEquality_HasValues_One_Bytes_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnColumnOfChangeEquality_HasValues_One_Bytes_Test.java index d8d8ea74..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 @@ -29,6 +29,7 @@ * {@link org.assertj.db.api.assertions.AssertOnColumnOfChangeEquality#hasValues(byte[])} method. * * @author Régis Pouiller + * @author Julien Roy */ public class AssertOnColumnOfChangeEquality_HasValues_One_Bytes_Test extends AbstractTest { @@ -40,7 +41,7 @@ public class AssertOnColumnOfChangeEquality_HasValues_One_Bytes_Test extends Abs public void test_have_values_equal_to() { byte[] bytesH2 = bytesContentFromClassPathOf("h2-logo-2.png"); - Changes changes = new Changes(source).setStartPointNow(); + Changes changes = assertDbConnection.changes().build().setStartPointNow(); update("update test set var14 = 1 where var1 = 1"); changes.setEndPointNow(); @@ -58,7 +59,7 @@ public void test_have_values_equal_to() { public void should_fail_because_value_at_start_point_is_different() { byte[] bytesH2 = bytesContentFromClassPathOf("h2-logo-2.png"); - Changes changes = new Changes(source).setStartPointNow(); + Changes changes = assertDbConnection.changes().build().setStartPointNow(); update("insert into test(var1, var11) values(5, FILE_READ('classpath:h2-logo-2.png'))"); changes.setEndPointNow(); @@ -66,7 +67,7 @@ public void should_fail_because_value_at_start_point_is_different() { assertThat(changes).change().column("var11").hasValues(bytesH2); fail("An exception must be raised"); } catch (AssertionError e) { - Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Column at index 10 (column name : VAR11) of Change at index 0 (on table : TEST and with primary key : [5]) of Changes on tables of 'sa/jdbc:h2:mem:test' source] %n" + Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Column at index 10 (column name : VAR11) of Change at index 0 (on table : TEST and with primary key : [5]) of Changes on tables of 'sa/jdbc:h2:mem:test'] %n" + "Expecting that start point to be equal to the expected value but was not equal")); } } @@ -79,7 +80,7 @@ public void should_fail_because_value_at_start_point_is_different() { public void should_fail_because_value_at_end_point_is_different() { byte[] bytesH2 = bytesContentFromClassPathOf("h2-logo-2.png"); - Changes changes = new Changes(source).setStartPointNow(); + Changes changes = assertDbConnection.changes().build().setStartPointNow(); update("delete from test where var1 = 1"); changes.setEndPointNow(); @@ -87,7 +88,7 @@ public void should_fail_because_value_at_end_point_is_different() { assertThat(changes).change().column("var11").hasValues(bytesH2); fail("An exception must be raised"); } catch (AssertionError e) { - Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Column at index 10 (column name : VAR11) of Change at index 0 (on table : TEST and with primary key : [1]) of Changes on tables of 'sa/jdbc:h2:mem:test' source] %n" + Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Column at index 10 (column name : VAR11) of Change at index 0 (on table : TEST and with primary key : [1]) of Changes on tables of 'sa/jdbc:h2:mem:test'] %n" + "Expecting that end point to be equal to the expected value but was not equal")); } } diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnColumnOfChangeEquality_HasValues_One_DateTimeValue_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnColumnOfChangeEquality_HasValues_One_DateTimeValue_Test.java index dc0b14c9..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 @@ -31,6 +31,7 @@ * {@link org.assertj.db.api.assertions.AssertOnColumnOfChangeEquality#hasValues(org.assertj.db.type.DateTimeValue)} method. * * @author Régis Pouiller + * @author Julien Roy */ public class AssertOnColumnOfChangeEquality_HasValues_One_DateTimeValue_Test extends AbstractTest { @@ -40,7 +41,7 @@ public class AssertOnColumnOfChangeEquality_HasValues_One_DateTimeValue_Test ext @Test @NeedReload public void test_have_values_equal_to() { - Changes changes = new Changes(source).setStartPointNow(); + Changes changes = assertDbConnection.changes().build().setStartPointNow(); update("update test set var14 = 1 where var1 = 1"); changes.setEndPointNow(); @@ -57,7 +58,7 @@ public void test_have_values_equal_to() { @Test @NeedReload public void should_fail_because_value_at_start_point_is_different() { - Changes changes = new Changes(source).setStartPointNow(); + Changes changes = assertDbConnection.changes().build().setStartPointNow(); update("insert into test(var1, var10) values(5, '2014-05-24 09:46:30')"); changes.setEndPointNow(); @@ -66,7 +67,7 @@ public void should_fail_because_value_at_start_point_is_different() { DateValue.of(2014, 5, 24), TimeValue.of(9, 46, 30))); fail("An exception must be raised"); } catch (AssertionError e) { - Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Column at index 9 (column name : VAR10) of Change at index 0 (on table : TEST and with primary key : [5]) of Changes on tables of 'sa/jdbc:h2:mem:test' source] %n" + Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Column at index 9 (column name : VAR10) of Change at index 0 (on table : TEST and with primary key : [5]) of Changes on tables of 'sa/jdbc:h2:mem:test'] %n" + "Expecting that start point:%n" + " %n" + "to be equal to: %n" @@ -80,7 +81,7 @@ public void should_fail_because_value_at_start_point_is_different() { @Test @NeedReload public void should_fail_because_value_at_end_point_is_different() { - Changes changes = new Changes(source).setStartPointNow(); + Changes changes = assertDbConnection.changes().build().setStartPointNow(); update("delete from test where var1 = 1"); changes.setEndPointNow(); @@ -89,7 +90,7 @@ public void should_fail_because_value_at_end_point_is_different() { DateValue.of(2014, 5, 24), TimeValue.of(9, 46, 30))); fail("An exception must be raised"); } catch (AssertionError e) { - Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Column at index 9 (column name : VAR10) of Change at index 0 (on table : TEST and with primary key : [1]) of Changes on tables of 'sa/jdbc:h2:mem:test' source] %n" + Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Column at index 9 (column name : VAR10) of Change at index 0 (on table : TEST and with primary key : [1]) of Changes on tables of 'sa/jdbc:h2:mem:test'] %n" + "Expecting that end point:%n" + " %n" + "to be equal to: %n" diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnColumnOfChangeEquality_HasValues_One_DateValue_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnColumnOfChangeEquality_HasValues_One_DateValue_Test.java index b8e868db..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 @@ -29,6 +29,7 @@ * {@link org.assertj.db.api.assertions.AssertOnColumnOfChangeEquality#hasValues(org.assertj.db.type.DateValue)} method. * * @author Régis Pouiller + * @author Julien Roy */ public class AssertOnColumnOfChangeEquality_HasValues_One_DateValue_Test extends AbstractTest { @@ -38,7 +39,7 @@ public class AssertOnColumnOfChangeEquality_HasValues_One_DateValue_Test extends @Test @NeedReload public void test_have_values_equal_to() { - Changes changes = new Changes(source).setStartPointNow(); + Changes changes = assertDbConnection.changes().build().setStartPointNow(); update("update test set var14 = 1 where var1 = 1"); changes.setEndPointNow(); @@ -54,7 +55,7 @@ public void test_have_values_equal_to() { @Test @NeedReload public void should_fail_because_value_at_start_point_is_different() { - Changes changes = new Changes(source).setStartPointNow(); + Changes changes = assertDbConnection.changes().build().setStartPointNow(); update("insert into test(var1, var9) values(5, '2014-05-24')"); changes.setEndPointNow(); @@ -62,7 +63,7 @@ public void should_fail_because_value_at_start_point_is_different() { assertThat(changes).change().column("var9").hasValues(DateValue.of(2014, 5, 24)); fail("An exception must be raised"); } catch (AssertionError e) { - Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Column at index 8 (column name : VAR9) of Change at index 0 (on table : TEST and with primary key : [5]) of Changes on tables of 'sa/jdbc:h2:mem:test' source] %n" + Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Column at index 8 (column name : VAR9) of Change at index 0 (on table : TEST and with primary key : [5]) of Changes on tables of 'sa/jdbc:h2:mem:test'] %n" + "Expecting that start point:%n" + " %n" + "to be equal to: %n" @@ -76,7 +77,7 @@ public void should_fail_because_value_at_start_point_is_different() { @Test @NeedReload public void should_fail_because_value_at_end_point_is_different() { - Changes changes = new Changes(source).setStartPointNow(); + Changes changes = assertDbConnection.changes().build().setStartPointNow(); update("delete from test where var1 = 1"); changes.setEndPointNow(); @@ -84,7 +85,7 @@ public void should_fail_because_value_at_end_point_is_different() { assertThat(changes).change().column("var9").hasValues(DateValue.of(2014, 5, 24)); fail("An exception must be raised"); } catch (AssertionError e) { - Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Column at index 8 (column name : VAR9) of Change at index 0 (on table : TEST and with primary key : [1]) of Changes on tables of 'sa/jdbc:h2:mem:test' source] %n" + Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Column at index 8 (column name : VAR9) of Change at index 0 (on table : TEST and with primary key : [1]) of Changes on tables of 'sa/jdbc:h2:mem:test'] %n" + "Expecting that end point:%n" + " %n" + "to be equal to: %n" diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnColumnOfChangeEquality_HasValues_One_Number_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnColumnOfChangeEquality_HasValues_One_Number_Test.java index 30dd2f4d..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 @@ -28,6 +28,7 @@ * {@link org.assertj.db.api.assertions.AssertOnColumnOfChangeEquality#hasValues(Number)} method. * * @author Régis Pouiller + * @author Julien Roy */ public class AssertOnColumnOfChangeEquality_HasValues_One_Number_Test extends AbstractTest { @@ -37,7 +38,7 @@ public class AssertOnColumnOfChangeEquality_HasValues_One_Number_Test extends Ab @Test @NeedReload public void test_has_values() { - Changes changes = new Changes(source).setStartPointNow(); + Changes changes = assertDbConnection.changes().build().setStartPointNow(); update("update test set var14 = 1 where var1 = 1"); changes.setEndPointNow(); @@ -53,7 +54,7 @@ public void test_has_values() { @Test @NeedReload public void should_fail_because_value_at_start_point_is_different() { - Changes changes = new Changes(source).setStartPointNow(); + Changes changes = assertDbConnection.changes().build().setStartPointNow(); update("insert into test(var1, var3) values(5, 3)"); changes.setEndPointNow(); @@ -61,7 +62,7 @@ public void should_fail_because_value_at_start_point_is_different() { assertThat(changes).change().column("var3").hasValues(3); fail("An exception must be raised"); } catch (AssertionError e) { - Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Column at index 2 (column name : VAR3) of Change at index 0 (on table : TEST and with primary key : [5]) of Changes on tables of 'sa/jdbc:h2:mem:test' source] %n" + Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Column at index 2 (column name : VAR3) of Change at index 0 (on table : TEST and with primary key : [5]) of Changes on tables of 'sa/jdbc:h2:mem:test'] %n" + "Expecting that start point:%n" + " %n" + "to be equal to: %n" @@ -75,7 +76,7 @@ public void should_fail_because_value_at_start_point_is_different() { @Test @NeedReload public void should_fail_because_value_at_end_point_is_different() { - Changes changes = new Changes(source).setStartPointNow(); + Changes changes = assertDbConnection.changes().build().setStartPointNow(); update("delete from test where var1 = 1"); changes.setEndPointNow(); @@ -83,7 +84,7 @@ public void should_fail_because_value_at_end_point_is_different() { assertThat(changes).change().column("var3").hasValues(2); fail("An exception must be raised"); } catch (AssertionError e) { - Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Column at index 2 (column name : VAR3) of Change at index 0 (on table : TEST and with primary key : [1]) of Changes on tables of 'sa/jdbc:h2:mem:test' source] %n" + Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Column at index 2 (column name : VAR3) of Change at index 0 (on table : TEST and with primary key : [1]) of Changes on tables of 'sa/jdbc:h2:mem:test'] %n" + "Expecting that end point:%n" + " %n" + "to be equal to: %n" diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnColumnOfChangeEquality_HasValues_One_String_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnColumnOfChangeEquality_HasValues_One_String_Test.java index 8a559f5d..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 @@ -28,6 +28,7 @@ * {@link org.assertj.db.api.assertions.AssertOnColumnOfChangeEquality#hasValues(String)} method. * * @author Régis Pouiller + * @author Julien Roy */ public class AssertOnColumnOfChangeEquality_HasValues_One_String_Test extends AbstractTest { @@ -37,7 +38,7 @@ public class AssertOnColumnOfChangeEquality_HasValues_One_String_Test extends Ab @Test @NeedReload public void test_has_values() { - Changes changes = new Changes(source).setStartPointNow(); + Changes changes = assertDbConnection.changes().build().setStartPointNow(); update("update test set var14 = 1 where var1 = 1"); changes.setEndPointNow(); @@ -56,7 +57,7 @@ public void test_has_values() { @Test @NeedReload public void should_fail_because_value_at_start_point_is_different() { - Changes changes = new Changes(source).setStartPointNow(); + Changes changes = assertDbConnection.changes().build().setStartPointNow(); update("insert into test(var1, var12, var15) values(5, 'test', '88838129-291E-40A9-A94C-A15BE36CF7C3')"); changes.setEndPointNow(); @@ -64,7 +65,7 @@ public void should_fail_because_value_at_start_point_is_different() { assertThat(changes).change().column("var12").hasValues("test"); fail("An exception must be raised"); } catch (AssertionError e) { - Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Column at index 11 (column name : VAR12) of Change at index 0 (on table : TEST and with primary key : [5]) of Changes on tables of 'sa/jdbc:h2:mem:test' source] %n" + Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Column at index 11 (column name : VAR12) of Change at index 0 (on table : TEST and with primary key : [5]) of Changes on tables of 'sa/jdbc:h2:mem:test'] %n" + "Expecting that start point:%n" + " %n" + "to be equal to: %n" @@ -74,7 +75,7 @@ public void should_fail_because_value_at_start_point_is_different() { assertThat(changes).change().column("var15").hasValues("88838129-291E-40A9-A94C-A15BE36CF7C3"); fail("An exception must be raised"); } catch (AssertionError e) { - Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Column at index 14 (column name : VAR15) of Change at index 0 (on table : TEST and with primary key : [5]) of Changes on tables of 'sa/jdbc:h2:mem:test' source] %n" + Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Column at index 14 (column name : VAR15) of Change at index 0 (on table : TEST and with primary key : [5]) of Changes on tables of 'sa/jdbc:h2:mem:test'] %n" + "Expecting that start point:%n" + " %n" + "to be equal to: %n" @@ -88,7 +89,7 @@ public void should_fail_because_value_at_start_point_is_different() { @Test @NeedReload public void should_fail_because_value_at_end_point_is_different() { - Changes changes = new Changes(source).setStartPointNow(); + Changes changes = assertDbConnection.changes().build().setStartPointNow(); update("delete from test where var1 = 1"); changes.setEndPointNow(); @@ -96,7 +97,7 @@ public void should_fail_because_value_at_end_point_is_different() { assertThat(changes).change().column("var12").hasValues("text"); fail("An exception must be raised"); } catch (AssertionError e) { - Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Column at index 11 (column name : VAR12) of Change at index 0 (on table : TEST and with primary key : [1]) of Changes on tables of 'sa/jdbc:h2:mem:test' source] %n" + Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Column at index 11 (column name : VAR12) of Change at index 0 (on table : TEST and with primary key : [1]) of Changes on tables of 'sa/jdbc:h2:mem:test'] %n" + "Expecting that end point:%n" + " %n" + "to be equal to: %n" @@ -106,7 +107,7 @@ public void should_fail_because_value_at_end_point_is_different() { assertThat(changes).change().column("var15").hasValues("30B443AE-C0C9-4790-9BEC-CE1380808435"); fail("An exception must be raised"); } catch (AssertionError e) { - Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Column at index 14 (column name : VAR15) of Change at index 0 (on table : TEST and with primary key : [1]) of Changes on tables of 'sa/jdbc:h2:mem:test' source] %n" + Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Column at index 14 (column name : VAR15) of Change at index 0 (on table : TEST and with primary key : [1]) of Changes on tables of 'sa/jdbc:h2:mem:test'] %n" + "Expecting that end point:%n" + " %n" + "to be equal to: %n" diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnColumnOfChangeEquality_HasValues_One_TimeValue_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnColumnOfChangeEquality_HasValues_One_TimeValue_Test.java index 9a9410f4..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 @@ -29,6 +29,7 @@ * {@link org.assertj.db.api.assertions.AssertOnColumnOfChangeEquality#hasValues(org.assertj.db.type.TimeValue)} method. * * @author Régis Pouiller + * @author Julien Roy */ public class AssertOnColumnOfChangeEquality_HasValues_One_TimeValue_Test extends AbstractTest { @@ -38,7 +39,7 @@ public class AssertOnColumnOfChangeEquality_HasValues_One_TimeValue_Test extends @Test @NeedReload public void test_has_values() { - Changes changes = new Changes(source).setStartPointNow(); + Changes changes = assertDbConnection.changes().build().setStartPointNow(); update("update test set var14 = 1 where var1 = 1"); changes.setEndPointNow(); @@ -54,7 +55,7 @@ public void test_has_values() { @Test @NeedReload public void should_fail_because_value_at_start_point_is_different() { - Changes changes = new Changes(source).setStartPointNow(); + Changes changes = assertDbConnection.changes().build().setStartPointNow(); update("insert into test(var1, var8) values(5, '09:46:30')"); changes.setEndPointNow(); @@ -62,7 +63,7 @@ public void should_fail_because_value_at_start_point_is_different() { assertThat(changes).change().column("var8").hasValues(TimeValue.of(9, 46, 30)); fail("An exception must be raised"); } catch (AssertionError e) { - Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Column at index 7 (column name : VAR8) of Change at index 0 (on table : TEST and with primary key : [5]) of Changes on tables of 'sa/jdbc:h2:mem:test' source] %n" + Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Column at index 7 (column name : VAR8) of Change at index 0 (on table : TEST and with primary key : [5]) of Changes on tables of 'sa/jdbc:h2:mem:test'] %n" + "Expecting that start point:%n" + " %n" + "to be equal to: %n" @@ -76,7 +77,7 @@ public void should_fail_because_value_at_start_point_is_different() { @Test @NeedReload public void should_fail_because_value_at_end_point_is_different() { - Changes changes = new Changes(source).setStartPointNow(); + Changes changes = assertDbConnection.changes().build().setStartPointNow(); update("delete from test where var1 = 1"); changes.setEndPointNow(); @@ -84,7 +85,7 @@ public void should_fail_because_value_at_end_point_is_different() { assertThat(changes).change().column("var8").hasValues(TimeValue.of(9, 46, 30)); fail("An exception must be raised"); } catch (AssertionError e) { - Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Column at index 7 (column name : VAR8) of Change at index 0 (on table : TEST and with primary key : [1]) of Changes on tables of 'sa/jdbc:h2:mem:test' source] %n" + Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Column at index 7 (column name : VAR8) of Change at index 0 (on table : TEST and with primary key : [1]) of Changes on tables of 'sa/jdbc:h2:mem:test'] %n" + "Expecting that end point:%n" + " %n" + "to be equal to: %n" diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnColumnOfChangeEquality_HasValues_One_UUID_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnColumnOfChangeEquality_HasValues_One_UUID_Test.java index f032a2c9..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(source).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(source).setStartPointNow(); + Changes changes = assertDbConnection.changes().build().setStartPointNow(); update("insert into test(var1, var15) values(5, 'F96EC595-CE91-47CC-9152-CCC8AC48AAD6')"); changes.setEndPointNow(); @@ -65,7 +65,7 @@ public void should_fail_because_value_at_start_point_is_different() { fail("An exception must be raised"); } catch (AssertionError e) { Assertions.assertThat(e.getMessage()).isEqualTo(String.format( - "[Column at index 14 (column name : VAR15) of Change at index 0 (on table : TEST and with primary key : [5]) of Changes on tables of 'sa/jdbc:h2:mem:test' source] %n" + "[Column at index 14 (column name : VAR15) of Change at index 0 (on table : TEST and with primary key : [5]) of Changes on tables of 'sa/jdbc:h2:mem:test'] %n" + "Expecting that start point:%n" + " %n" + "to be equal to: %n" @@ -79,7 +79,7 @@ public void should_fail_because_value_at_start_point_is_different() { @Test @NeedReload public void should_fail_because_value_at_end_point_is_different() { - Changes changes = new Changes(source).setStartPointNow(); + Changes changes = assertDbConnection.changes().build().setStartPointNow(); update("delete from test where var1 = 1"); changes.setEndPointNow(); @@ -88,7 +88,7 @@ public void should_fail_because_value_at_end_point_is_different() { fail("An exception must be raised"); } catch (AssertionError e) { Assertions.assertThat(e.getMessage()).isEqualTo(String.format( - "[Column at index 14 (column name : VAR15) of Change at index 0 (on table : TEST and with primary key : [1]) of Changes on tables of 'sa/jdbc:h2:mem:test' source] %n" + "[Column at index 14 (column name : VAR15) of Change at index 0 (on table : TEST and with primary key : [1]) of Changes on tables of 'sa/jdbc:h2:mem:test'] %n" + "Expecting that end point:%n" + " %n" + "to be equal to: %n" diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnColumnOfChangeEquality_HasValues_Two_Boolean_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnColumnOfChangeEquality_HasValues_Two_Boolean_Test.java index 5842676e..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 @@ -28,6 +28,7 @@ * {@link org.assertj.db.api.assertions.AssertOnColumnOfChangeEquality#hasValues(Boolean, Boolean)} method. * * @author Régis Pouiller + * @author Julien Roy */ public class AssertOnColumnOfChangeEquality_HasValues_Two_Boolean_Test extends AbstractTest { @@ -37,7 +38,7 @@ public class AssertOnColumnOfChangeEquality_HasValues_Two_Boolean_Test extends A @Test @NeedReload public void test_has_values() { - Changes changes = new Changes(source).setStartPointNow(); + Changes changes = assertDbConnection.changes().build().setStartPointNow(); update("update test set var14 = 1 where var1 = 1"); changes.setEndPointNow(); @@ -53,7 +54,7 @@ public void test_has_values() { @Test @NeedReload public void should_fail_because_value_at_start_point_is_different() { - Changes changes = new Changes(source).setStartPointNow(); + Changes changes = assertDbConnection.changes().build().setStartPointNow(); update("insert into test(var1, var2) values(5, true)"); changes.setEndPointNow(); @@ -61,7 +62,7 @@ public void should_fail_because_value_at_start_point_is_different() { assertThat(changes).change().column("var2").hasValues(true, true); fail("An exception must be raised"); } catch (AssertionError e) { - Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Column at index 1 (column name : VAR2) of Change at index 0 (on table : TEST and with primary key : [5]) of Changes on tables of 'sa/jdbc:h2:mem:test' source] %n" + Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Column at index 1 (column name : VAR2) of Change at index 0 (on table : TEST and with primary key : [5]) of Changes on tables of 'sa/jdbc:h2:mem:test'] %n" + "Expecting that start point:%n" + " %n" + "to be equal to: %n" @@ -75,7 +76,7 @@ public void should_fail_because_value_at_start_point_is_different() { @Test @NeedReload public void should_fail_because_value_at_end_point_is_different() { - Changes changes = new Changes(source).setStartPointNow(); + Changes changes = assertDbConnection.changes().build().setStartPointNow(); update("delete from test where var1 = 1"); changes.setEndPointNow(); @@ -83,7 +84,7 @@ public void should_fail_because_value_at_end_point_is_different() { assertThat(changes).change().column("var2").hasValues(true, true); fail("An exception must be raised"); } catch (AssertionError e) { - Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Column at index 1 (column name : VAR2) of Change at index 0 (on table : TEST and with primary key : [1]) of Changes on tables of 'sa/jdbc:h2:mem:test' source] %n" + Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Column at index 1 (column name : VAR2) of Change at index 0 (on table : TEST and with primary key : [1]) of Changes on tables of 'sa/jdbc:h2:mem:test'] %n" + "Expecting that end point:%n" + " %n" + "to be equal to: %n" diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnColumnOfChangeEquality_HasValues_Two_Bytes_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnColumnOfChangeEquality_HasValues_Two_Bytes_Test.java index 6c94a8fa..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 @@ -29,6 +29,7 @@ * {@link org.assertj.db.api.assertions.AssertOnColumnOfChangeEquality#hasValues(byte[], byte[])} method. * * @author Régis Pouiller + * @author Julien Roy */ public class AssertOnColumnOfChangeEquality_HasValues_Two_Bytes_Test extends AbstractTest { @@ -40,7 +41,7 @@ public class AssertOnColumnOfChangeEquality_HasValues_Two_Bytes_Test extends Abs public void test_has_values() { byte[] bytesH2 = bytesContentFromClassPathOf("h2-logo-2.png"); - Changes changes = new Changes(source).setStartPointNow(); + Changes changes = assertDbConnection.changes().build().setStartPointNow(); update("update test set var14 = 1 where var1 = 1"); changes.setEndPointNow(); @@ -58,7 +59,7 @@ public void test_has_values() { public void should_fail_because_value_at_start_point_is_different() { byte[] bytesH2 = bytesContentFromClassPathOf("h2-logo-2.png"); - Changes changes = new Changes(source).setStartPointNow(); + Changes changes = assertDbConnection.changes().build().setStartPointNow(); update("insert into test(var1, var11) values(5, FILE_READ('classpath:h2-logo-2.png'))"); changes.setEndPointNow(); @@ -66,7 +67,7 @@ public void should_fail_because_value_at_start_point_is_different() { assertThat(changes).change().column("var11").hasValues(bytesH2, bytesH2); fail("An exception must be raised"); } catch (AssertionError e) { - Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Column at index 10 (column name : VAR11) of Change at index 0 (on table : TEST and with primary key : [5]) of Changes on tables of 'sa/jdbc:h2:mem:test' source] %n" + Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Column at index 10 (column name : VAR11) of Change at index 0 (on table : TEST and with primary key : [5]) of Changes on tables of 'sa/jdbc:h2:mem:test'] %n" + "Expecting that start point to be equal to the expected value but was not equal")); } } @@ -79,7 +80,7 @@ public void should_fail_because_value_at_start_point_is_different() { public void should_fail_because_value_at_end_point_is_different() { byte[] bytesH2 = bytesContentFromClassPathOf("h2-logo-2.png"); - Changes changes = new Changes(source).setStartPointNow(); + Changes changes = assertDbConnection.changes().build().setStartPointNow(); update("delete from test where var1 = 1"); changes.setEndPointNow(); @@ -87,7 +88,7 @@ public void should_fail_because_value_at_end_point_is_different() { assertThat(changes).change().column("var11").hasValues(bytesH2, bytesH2); fail("An exception must be raised"); } catch (AssertionError e) { - Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Column at index 10 (column name : VAR11) of Change at index 0 (on table : TEST and with primary key : [1]) of Changes on tables of 'sa/jdbc:h2:mem:test' source] %n" + Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Column at index 10 (column name : VAR11) of Change at index 0 (on table : TEST and with primary key : [1]) of Changes on tables of 'sa/jdbc:h2:mem:test'] %n" + "Expecting that end point to be equal to the expected value but was not equal")); } } diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnColumnOfChangeEquality_HasValues_Two_Character_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnColumnOfChangeEquality_HasValues_Two_Character_Test.java index 85e1623e..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 @@ -28,6 +28,7 @@ * {@link org.assertj.db.api.assertions.AssertOnColumnOfChangeEquality#hasValues(Character, Character)} method. * * @author Régis Pouiller + * @author Julien Roy */ public class AssertOnColumnOfChangeEquality_HasValues_Two_Character_Test extends AbstractTest { @@ -37,7 +38,7 @@ public class AssertOnColumnOfChangeEquality_HasValues_Two_Character_Test extends @Test @NeedReload public void test_has_values() { - Changes changes = new Changes(source).setStartPointNow(); + Changes changes = assertDbConnection.changes().build().setStartPointNow(); update("update test set var14 = 1 where var1 = 1"); changes.setEndPointNow(); @@ -53,7 +54,7 @@ public void test_has_values() { @Test @NeedReload public void should_fail_because_value_at_start_point_is_different() { - Changes changes = new Changes(source).setStartPointNow(); + Changes changes = assertDbConnection.changes().build().setStartPointNow(); update("insert into test(var1, var2) values(5, true)"); changes.setEndPointNow(); @@ -61,7 +62,7 @@ public void should_fail_because_value_at_start_point_is_different() { assertThat(changes).change().column("var16").hasValues('T', 'T'); fail("An exception must be raised"); } catch (AssertionError e) { - Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Column at index 15 (column name : VAR16) of Change at index 0 (on table : TEST and with primary key : [5]) of Changes on tables of 'sa/jdbc:h2:mem:test' source] %n" + Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Column at index 15 (column name : VAR16) of Change at index 0 (on table : TEST and with primary key : [5]) of Changes on tables of 'sa/jdbc:h2:mem:test'] %n" + "Expecting that start point:%n" + " %n" + "to be equal to: %n" @@ -75,7 +76,7 @@ public void should_fail_because_value_at_start_point_is_different() { @Test @NeedReload public void should_fail_because_value_at_end_point_is_different() { - Changes changes = new Changes(source).setStartPointNow(); + Changes changes = assertDbConnection.changes().build().setStartPointNow(); update("delete from test where var1 = 1"); changes.setEndPointNow(); @@ -83,7 +84,7 @@ public void should_fail_because_value_at_end_point_is_different() { assertThat(changes).change().column("var16").hasValues('T', 'T'); fail("An exception must be raised"); } catch (AssertionError e) { - Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Column at index 15 (column name : VAR16) of Change at index 0 (on table : TEST and with primary key : [1]) of Changes on tables of 'sa/jdbc:h2:mem:test' source] %n" + Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Column at index 15 (column name : VAR16) of Change at index 0 (on table : TEST and with primary key : [1]) of Changes on tables of 'sa/jdbc:h2:mem:test'] %n" + "Expecting that end point:%n" + " %n" + "to be equal to: %n" diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnColumnOfChangeEquality_HasValues_Two_DateTimeValue_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnColumnOfChangeEquality_HasValues_Two_DateTimeValue_Test.java index 224914e0..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 @@ -31,6 +31,7 @@ * {@link org.assertj.db.api.assertions.AssertOnColumnOfChangeEquality#hasValues(org.assertj.db.type.DateTimeValue, org.assertj.db.type.DateTimeValue)} method. * * @author Régis Pouiller + * @author Julien Roy */ public class AssertOnColumnOfChangeEquality_HasValues_Two_DateTimeValue_Test extends AbstractTest { @@ -40,7 +41,7 @@ public class AssertOnColumnOfChangeEquality_HasValues_Two_DateTimeValue_Test ext @Test @NeedReload public void test_has_values() { - Changes changes = new Changes(source).setStartPointNow(); + Changes changes = assertDbConnection.changes().build().setStartPointNow(); update("update test set var14 = 1 where var1 = 1"); changes.setEndPointNow(); @@ -58,7 +59,7 @@ public void test_has_values() { @Test @NeedReload public void should_fail_because_value_at_start_point_is_different() { - Changes changes = new Changes(source).setStartPointNow(); + Changes changes = assertDbConnection.changes().build().setStartPointNow(); update("insert into test(var1, var10) values(5, '2014-05-24 09:46:30')"); changes.setEndPointNow(); @@ -68,7 +69,7 @@ public void should_fail_because_value_at_start_point_is_different() { DateValue.of(2014, 5, 24), TimeValue.of(9, 46, 30))); fail("An exception must be raised"); } catch (AssertionError e) { - Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Column at index 9 (column name : VAR10) of Change at index 0 (on table : TEST and with primary key : [5]) of Changes on tables of 'sa/jdbc:h2:mem:test' source] %n" + Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Column at index 9 (column name : VAR10) of Change at index 0 (on table : TEST and with primary key : [5]) of Changes on tables of 'sa/jdbc:h2:mem:test'] %n" + "Expecting that start point:%n" + " %n" + "to be equal to: %n" @@ -82,7 +83,7 @@ public void should_fail_because_value_at_start_point_is_different() { @Test @NeedReload public void should_fail_because_value_at_end_point_is_different() { - Changes changes = new Changes(source).setStartPointNow(); + Changes changes = assertDbConnection.changes().build().setStartPointNow(); update("delete from test where var1 = 1"); changes.setEndPointNow(); @@ -92,7 +93,7 @@ public void should_fail_because_value_at_end_point_is_different() { DateValue.of(2014, 5, 24), TimeValue.of(9, 46, 30))); fail("An exception must be raised"); } catch (AssertionError e) { - Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Column at index 9 (column name : VAR10) of Change at index 0 (on table : TEST and with primary key : [1]) of Changes on tables of 'sa/jdbc:h2:mem:test' source] %n" + Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Column at index 9 (column name : VAR10) of Change at index 0 (on table : TEST and with primary key : [1]) of Changes on tables of 'sa/jdbc:h2:mem:test'] %n" + "Expecting that end point:%n" + " %n" + "to be equal to: %n" diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnColumnOfChangeEquality_HasValues_Two_DateValue_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnColumnOfChangeEquality_HasValues_Two_DateValue_Test.java index 985a407b..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 @@ -29,6 +29,7 @@ * {@link org.assertj.db.api.assertions.AssertOnColumnOfChangeEquality#hasValues(org.assertj.db.type.DateValue, org.assertj.db.type.DateValue)} method. * * @author Régis Pouiller + * @author Julien Roy */ public class AssertOnColumnOfChangeEquality_HasValues_Two_DateValue_Test extends AbstractTest { @@ -38,7 +39,7 @@ public class AssertOnColumnOfChangeEquality_HasValues_Two_DateValue_Test extends @Test @NeedReload public void test_has_values() { - Changes changes = new Changes(source).setStartPointNow(); + Changes changes = assertDbConnection.changes().build().setStartPointNow(); update("update test set var14 = 1 where var1 = 1"); changes.setEndPointNow(); @@ -55,7 +56,7 @@ public void test_has_values() { @Test @NeedReload public void should_fail_because_value_at_start_point_is_different() { - Changes changes = new Changes(source).setStartPointNow(); + Changes changes = assertDbConnection.changes().build().setStartPointNow(); update("insert into test(var1, var9) values(5, '2014-05-24')"); changes.setEndPointNow(); @@ -63,7 +64,7 @@ public void should_fail_because_value_at_start_point_is_different() { assertThat(changes).change().column("var9").hasValues(DateValue.of(2014, 5, 24), DateValue.of(2014, 5, 24)); fail("An exception must be raised"); } catch (AssertionError e) { - Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Column at index 8 (column name : VAR9) of Change at index 0 (on table : TEST and with primary key : [5]) of Changes on tables of 'sa/jdbc:h2:mem:test' source] %n" + Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Column at index 8 (column name : VAR9) of Change at index 0 (on table : TEST and with primary key : [5]) of Changes on tables of 'sa/jdbc:h2:mem:test'] %n" + "Expecting that start point:%n" + " %n" + "to be equal to: %n" @@ -77,7 +78,7 @@ public void should_fail_because_value_at_start_point_is_different() { @Test @NeedReload public void should_fail_because_value_at_end_point_is_different() { - Changes changes = new Changes(source).setStartPointNow(); + Changes changes = assertDbConnection.changes().build().setStartPointNow(); update("delete from test where var1 = 1"); changes.setEndPointNow(); @@ -85,7 +86,7 @@ public void should_fail_because_value_at_end_point_is_different() { assertThat(changes).change().column("var9").hasValues(DateValue.of(2014, 5, 24), DateValue.of(2014, 5, 24)); fail("An exception must be raised"); } catch (AssertionError e) { - Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Column at index 8 (column name : VAR9) of Change at index 0 (on table : TEST and with primary key : [1]) of Changes on tables of 'sa/jdbc:h2:mem:test' source] %n" + Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Column at index 8 (column name : VAR9) of Change at index 0 (on table : TEST and with primary key : [1]) of Changes on tables of 'sa/jdbc:h2:mem:test'] %n" + "Expecting that end point:%n" + " %n" + "to be equal to: %n" diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnColumnOfChangeEquality_HasValues_Two_Number_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnColumnOfChangeEquality_HasValues_Two_Number_Test.java index 599e8c80..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 @@ -28,6 +28,7 @@ * {@link org.assertj.db.api.assertions.AssertOnColumnOfChangeEquality#hasValues(Number, Number)} method. * * @author Régis Pouiller + * @author Julien Roy */ public class AssertOnColumnOfChangeEquality_HasValues_Two_Number_Test extends AbstractTest { @@ -37,7 +38,7 @@ public class AssertOnColumnOfChangeEquality_HasValues_Two_Number_Test extends Ab @Test @NeedReload public void test_has_values() { - Changes changes = new Changes(source).setStartPointNow(); + Changes changes = assertDbConnection.changes().build().setStartPointNow(); update("update test set var14 = 1 where var1 = 1"); changes.setEndPointNow(); @@ -53,7 +54,7 @@ public void test_has_values() { @Test @NeedReload public void should_fail_because_value_at_start_point_is_different() { - Changes changes = new Changes(source).setStartPointNow(); + Changes changes = assertDbConnection.changes().build().setStartPointNow(); update("insert into test(var1, var3) values(5, 3)"); changes.setEndPointNow(); @@ -61,7 +62,7 @@ public void should_fail_because_value_at_start_point_is_different() { assertThat(changes).change().column("var3").hasValues(3, 3); fail("An exception must be raised"); } catch (AssertionError e) { - Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Column at index 2 (column name : VAR3) of Change at index 0 (on table : TEST and with primary key : [5]) of Changes on tables of 'sa/jdbc:h2:mem:test' source] %n" + Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Column at index 2 (column name : VAR3) of Change at index 0 (on table : TEST and with primary key : [5]) of Changes on tables of 'sa/jdbc:h2:mem:test'] %n" + "Expecting that start point:%n" + " %n" + "to be equal to: %n" @@ -75,7 +76,7 @@ public void should_fail_because_value_at_start_point_is_different() { @Test @NeedReload public void should_fail_because_value_at_end_point_is_different() { - Changes changes = new Changes(source).setStartPointNow(); + Changes changes = assertDbConnection.changes().build().setStartPointNow(); update("delete from test where var1 = 1"); changes.setEndPointNow(); @@ -83,7 +84,7 @@ public void should_fail_because_value_at_end_point_is_different() { assertThat(changes).change().column("var3").hasValues(2, 2); fail("An exception must be raised"); } catch (AssertionError e) { - Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Column at index 2 (column name : VAR3) of Change at index 0 (on table : TEST and with primary key : [1]) of Changes on tables of 'sa/jdbc:h2:mem:test' source] %n" + Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Column at index 2 (column name : VAR3) of Change at index 0 (on table : TEST and with primary key : [1]) of Changes on tables of 'sa/jdbc:h2:mem:test'] %n" + "Expecting that end point:%n" + " %n" + "to be equal to: %n" diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnColumnOfChangeEquality_HasValues_Two_String_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnColumnOfChangeEquality_HasValues_Two_String_Test.java index 1718cc24..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 @@ -28,6 +28,7 @@ * {@link org.assertj.db.api.assertions.AssertOnColumnOfChangeEquality#hasValues(String, String)} method. * * @author Régis Pouiller + * @author Julien Roy */ public class AssertOnColumnOfChangeEquality_HasValues_Two_String_Test extends AbstractTest { @@ -37,7 +38,7 @@ public class AssertOnColumnOfChangeEquality_HasValues_Two_String_Test extends Ab @Test @NeedReload public void test_has_values() { - Changes changes = new Changes(source).setStartPointNow(); + Changes changes = assertDbConnection.changes().build().setStartPointNow(); update("update test set var14 = 1 where var1 = 1"); changes.setEndPointNow(); @@ -56,7 +57,7 @@ public void test_has_values() { @Test @NeedReload public void should_fail_because_value_at_start_point_is_different() { - Changes changes = new Changes(source).setStartPointNow(); + Changes changes = assertDbConnection.changes().build().setStartPointNow(); update("insert into test(var1, var12, var15) values(5, 'test', '88838129-291E-40A9-A94C-A15BE36CF7C3')"); changes.setEndPointNow(); @@ -64,7 +65,7 @@ public void should_fail_because_value_at_start_point_is_different() { assertThat(changes).change().column("var12").hasValues("test", "test"); fail("An exception must be raised"); } catch (AssertionError e) { - Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Column at index 11 (column name : VAR12) of Change at index 0 (on table : TEST and with primary key : [5]) of Changes on tables of 'sa/jdbc:h2:mem:test' source] %n" + Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Column at index 11 (column name : VAR12) of Change at index 0 (on table : TEST and with primary key : [5]) of Changes on tables of 'sa/jdbc:h2:mem:test'] %n" + "Expecting that start point:%n" + " %n" + "to be equal to: %n" @@ -74,7 +75,7 @@ public void should_fail_because_value_at_start_point_is_different() { assertThat(changes).change().column("var15").hasValues("88838129-291E-40A9-A94C-A15BE36CF7C3", "88838129-291E-40A9-A94C-A15BE36CF7C3"); fail("An exception must be raised"); } catch (AssertionError e) { - Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Column at index 14 (column name : VAR15) of Change at index 0 (on table : TEST and with primary key : [5]) of Changes on tables of 'sa/jdbc:h2:mem:test' source] %n" + Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Column at index 14 (column name : VAR15) of Change at index 0 (on table : TEST and with primary key : [5]) of Changes on tables of 'sa/jdbc:h2:mem:test'] %n" + "Expecting that start point:%n" + " %n" + "to be equal to: %n" @@ -88,7 +89,7 @@ public void should_fail_because_value_at_start_point_is_different() { @Test @NeedReload public void should_fail_because_value_at_end_point_is_different() { - Changes changes = new Changes(source).setStartPointNow(); + Changes changes = assertDbConnection.changes().build().setStartPointNow(); update("delete from test where var1 = 1"); changes.setEndPointNow(); @@ -96,7 +97,7 @@ public void should_fail_because_value_at_end_point_is_different() { assertThat(changes).change().column("var12").hasValues("text", "text"); fail("An exception must be raised"); } catch (AssertionError e) { - Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Column at index 11 (column name : VAR12) of Change at index 0 (on table : TEST and with primary key : [1]) of Changes on tables of 'sa/jdbc:h2:mem:test' source] %n" + Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Column at index 11 (column name : VAR12) of Change at index 0 (on table : TEST and with primary key : [1]) of Changes on tables of 'sa/jdbc:h2:mem:test'] %n" + "Expecting that end point:%n" + " %n" + "to be equal to: %n" @@ -106,7 +107,7 @@ public void should_fail_because_value_at_end_point_is_different() { assertThat(changes).change().column("var15").hasValues("30B443AE-C0C9-4790-9BEC-CE1380808435", "30B443AE-C0C9-4790-9BEC-CE1380808435"); fail("An exception must be raised"); } catch (AssertionError e) { - Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Column at index 14 (column name : VAR15) of Change at index 0 (on table : TEST and with primary key : [1]) of Changes on tables of 'sa/jdbc:h2:mem:test' source] %n" + Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Column at index 14 (column name : VAR15) of Change at index 0 (on table : TEST and with primary key : [1]) of Changes on tables of 'sa/jdbc:h2:mem:test'] %n" + "Expecting that end point:%n" + " %n" + "to be equal to: %n" diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnColumnOfChangeEquality_HasValues_Two_TimeValue_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnColumnOfChangeEquality_HasValues_Two_TimeValue_Test.java index aa8f046b..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 @@ -29,6 +29,7 @@ * {@link org.assertj.db.api.assertions.AssertOnColumnOfChangeEquality#hasValues(org.assertj.db.type.TimeValue, org.assertj.db.type.TimeValue)} method. * * @author Régis Pouiller + * @author Julien Roy */ public class AssertOnColumnOfChangeEquality_HasValues_Two_TimeValue_Test extends AbstractTest { @@ -38,7 +39,7 @@ public class AssertOnColumnOfChangeEquality_HasValues_Two_TimeValue_Test extends @Test @NeedReload public void test_has_values() { - Changes changes = new Changes(source).setStartPointNow(); + Changes changes = assertDbConnection.changes().build().setStartPointNow(); update("update test set var14 = 1 where var1 = 1"); changes.setEndPointNow(); @@ -55,7 +56,7 @@ public void test_has_values() { @Test @NeedReload public void should_fail_because_value_at_start_point_is_different() { - Changes changes = new Changes(source).setStartPointNow(); + Changes changes = assertDbConnection.changes().build().setStartPointNow(); update("insert into test(var1, var8) values(5, '09:46:30')"); changes.setEndPointNow(); @@ -63,7 +64,7 @@ public void should_fail_because_value_at_start_point_is_different() { assertThat(changes).change().column("var8").hasValues(TimeValue.of(9, 46, 30), TimeValue.of(9, 46, 30)); fail("An exception must be raised"); } catch (AssertionError e) { - Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Column at index 7 (column name : VAR8) of Change at index 0 (on table : TEST and with primary key : [5]) of Changes on tables of 'sa/jdbc:h2:mem:test' source] %n" + Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Column at index 7 (column name : VAR8) of Change at index 0 (on table : TEST and with primary key : [5]) of Changes on tables of 'sa/jdbc:h2:mem:test'] %n" + "Expecting that start point:%n" + " %n" + "to be equal to: %n" @@ -77,7 +78,7 @@ public void should_fail_because_value_at_start_point_is_different() { @Test @NeedReload public void should_fail_because_value_at_end_point_is_different() { - Changes changes = new Changes(source).setStartPointNow(); + Changes changes = assertDbConnection.changes().build().setStartPointNow(); update("delete from test where var1 = 1"); changes.setEndPointNow(); @@ -85,7 +86,7 @@ public void should_fail_because_value_at_end_point_is_different() { assertThat(changes).change().column("var8").hasValues(TimeValue.of(9, 46, 30), TimeValue.of(9, 46, 30)); fail("An exception must be raised"); } catch (AssertionError e) { - Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Column at index 7 (column name : VAR8) of Change at index 0 (on table : TEST and with primary key : [1]) of Changes on tables of 'sa/jdbc:h2:mem:test' source] %n" + Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Column at index 7 (column name : VAR8) of Change at index 0 (on table : TEST and with primary key : [1]) of Changes on tables of 'sa/jdbc:h2:mem:test'] %n" + "Expecting that end point:%n" + " %n" + "to be equal to: %n" diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnColumnOfChangeEquality_HasValues_Two_UUID_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnColumnOfChangeEquality_HasValues_Two_UUID_Test.java index 50ff516e..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(source).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(source).setStartPointNow(); + Changes changes = assertDbConnection.changes().build().setStartPointNow(); update("insert into test(var1, var15) values(5, '0E2A1269-EFF0-4233-B87B-B53E8B6F164D')"); changes.setEndPointNow(); @@ -67,7 +67,7 @@ public void should_fail_because_value_at_start_point_is_different() { fail("An exception must be raised"); } catch (AssertionError e) { Assertions.assertThat(e.getMessage()).isEqualTo(String.format( - "[Column at index 14 (column name : VAR15) of Change at index 0 (on table : TEST and with primary key : [5]) of Changes on tables of 'sa/jdbc:h2:mem:test' source] %n" + "[Column at index 14 (column name : VAR15) of Change at index 0 (on table : TEST and with primary key : [5]) of Changes on tables of 'sa/jdbc:h2:mem:test'] %n" + "Expecting that start point:%n" + " %n" + "to be equal to: %n" @@ -81,7 +81,7 @@ public void should_fail_because_value_at_start_point_is_different() { @Test @NeedReload public void should_fail_because_value_at_end_point_is_different() { - Changes changes = new Changes(source).setStartPointNow(); + Changes changes = assertDbConnection.changes().build().setStartPointNow(); update("delete from test where var1 = 1"); changes.setEndPointNow(); @@ -91,7 +91,7 @@ public void should_fail_because_value_at_end_point_is_different() { fail("An exception must be raised"); } catch (AssertionError e) { Assertions.assertThat(e.getMessage()).isEqualTo(String.format( - "[Column at index 14 (column name : VAR15) of Change at index 0 (on table : TEST and with primary key : [1]) of Changes on tables of 'sa/jdbc:h2:mem:test' source] %n" + "[Column at index 14 (column name : VAR15) of Change at index 0 (on table : TEST and with primary key : [1]) of Changes on tables of 'sa/jdbc:h2:mem:test'] %n" + "Expecting that end point:%n" + " %n" + "to be equal to: %n" diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnColumnType_IsBoolean_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnColumnType_IsBoolean_Test.java index 39d2555e..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 @@ -29,6 +29,7 @@ * {@link org.assertj.db.api.assertions.AssertOnColumnType#isBoolean(boolean)} method. * * @author Régis Pouiller + * @author Julien Roy */ public class AssertOnColumnType_IsBoolean_Test extends AbstractTest { @@ -38,12 +39,12 @@ public class AssertOnColumnType_IsBoolean_Test extends AbstractTest { @Test @NeedReload public void test_is_boolean() { - Changes changes = new Changes(source).setStartPointNow(); + Changes changes = 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(source, "test"); - Table table2 = new Table(source, "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); @@ -65,18 +66,18 @@ public void test_is_boolean() { @Test @NeedReload public void should_fail_because_value_have_different_type() { - Changes changes = new Changes(source).setStartPointNow(); + Changes changes = 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(source, "test"); - Table table2 = new Table(source, "test2"); + Table table = assertDbConnection.table("test").build(); + Table table2 = assertDbConnection.table("test2").build(); try { assertThat(changes).change().column("var2").isBoolean(false); fail("An exception must be raised"); } catch (AssertionError e) { - Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Column at index 1 (column name : VAR2) of Change at index 0 (on table : TEST and with primary key : [5]) of Changes on tables of 'sa/jdbc:h2:mem:test' source] %n" + Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Column at index 1 (column name : VAR2) of Change at index 0 (on table : TEST and with primary key : [5]) of Changes on tables of 'sa/jdbc:h2:mem:test'] %n" + "Expecting that the value at start point:%n" + " %n" + "to be of type%n" @@ -88,7 +89,7 @@ public void should_fail_because_value_have_different_type() { assertThat(changes).change(1).column("var1").isBoolean(true); fail("An exception must be raised"); } catch (AssertionError e) { - Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Column at index 0 (column name : VAR1) of Change at index 1 (on table : TEST and with primary key : [1]) of Changes on tables of 'sa/jdbc:h2:mem:test' source] %n" + Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Column at index 0 (column name : VAR1) of Change at index 1 (on table : TEST and with primary key : [1]) of Changes on tables of 'sa/jdbc:h2:mem:test'] %n" + "Expecting that the value at start point:%n" + " <1>%n" + "to be of type%n" diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnColumnType_IsBytes_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnColumnType_IsBytes_Test.java index 28386c6f..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 @@ -29,6 +29,7 @@ * {@link org.assertj.db.api.assertions.AssertOnColumnType#isBytes(boolean)} method. * * @author Régis Pouiller + * @author Julien Roy */ public class AssertOnColumnType_IsBytes_Test extends AbstractTest { @@ -38,12 +39,12 @@ public class AssertOnColumnType_IsBytes_Test extends AbstractTest { @Test @NeedReload public void test_is_bytes() { - Changes changes = new Changes(source).setStartPointNow(); + Changes changes = 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(source, "test"); - Table table2 = new Table(source, "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); @@ -65,18 +66,18 @@ public void test_is_bytes() { @Test @NeedReload public void should_fail_because_value_have_different_type() { - Changes changes = new Changes(source).setStartPointNow(); + Changes changes = 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(source, "test"); - Table table2 = new Table(source, "test2"); + Table table = assertDbConnection.table("test").build(); + Table table2 = assertDbConnection.table("test2").build(); try { assertThat(changes).change().column("var11").isBytes(false); fail("An exception must be raised"); } catch (AssertionError e) { - Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Column at index 10 (column name : VAR11) of Change at index 0 (on table : TEST and with primary key : [5]) of Changes on tables of 'sa/jdbc:h2:mem:test' source] %n" + Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Column at index 10 (column name : VAR11) of Change at index 0 (on table : TEST and with primary key : [5]) of Changes on tables of 'sa/jdbc:h2:mem:test'] %n" + "Expecting that the value at start point:%n" + " %n" + "to be of type%n" @@ -88,7 +89,7 @@ public void should_fail_because_value_have_different_type() { assertThat(changes).change(1).column("var1").isBytes(true); fail("An exception must be raised"); } catch (AssertionError e) { - Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Column at index 0 (column name : VAR1) of Change at index 1 (on table : TEST and with primary key : [1]) of Changes on tables of 'sa/jdbc:h2:mem:test' source] %n" + Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Column at index 0 (column name : VAR1) of Change at index 1 (on table : TEST and with primary key : [1]) of Changes on tables of 'sa/jdbc:h2:mem:test'] %n" + "Expecting that the value at start point:%n" + " <1>%n" + "to be of type%n" diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnColumnType_IsDateTime_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnColumnType_IsDateTime_Test.java index e3e5d0ac..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 @@ -29,6 +29,7 @@ * {@link org.assertj.db.api.assertions.AssertOnColumnType#isDateTime(boolean)} method. * * @author Régis Pouiller + * @author Julien Roy */ public class AssertOnColumnType_IsDateTime_Test extends AbstractTest { @@ -38,12 +39,12 @@ public class AssertOnColumnType_IsDateTime_Test extends AbstractTest { @Test @NeedReload public void test_is_date_time() { - Changes changes = new Changes(source).setStartPointNow(); + Changes changes = 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(source, "test"); - Table table2 = new Table(source, "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); @@ -65,18 +66,18 @@ public void test_is_date_time() { @Test @NeedReload public void should_fail_because_value_have_different_type() { - Changes changes = new Changes(source).setStartPointNow(); + Changes changes = 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(source, "test"); - Table table2 = new Table(source, "test2"); + Table table = assertDbConnection.table("test").build(); + Table table2 = assertDbConnection.table("test2").build(); try { assertThat(changes).change().column("var10").isDateTime(false); fail("An exception must be raised"); } catch (AssertionError e) { - Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Column at index 9 (column name : VAR10) of Change at index 0 (on table : TEST and with primary key : [5]) of Changes on tables of 'sa/jdbc:h2:mem:test' source] %n" + Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Column at index 9 (column name : VAR10) of Change at index 0 (on table : TEST and with primary key : [5]) of Changes on tables of 'sa/jdbc:h2:mem:test'] %n" + "Expecting that the value at start point:%n" + " %n" + "to be of type%n" @@ -88,7 +89,7 @@ public void should_fail_because_value_have_different_type() { assertThat(changes).change(1).column("var1").isDateTime(true); fail("An exception must be raised"); } catch (AssertionError e) { - Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Column at index 0 (column name : VAR1) of Change at index 1 (on table : TEST and with primary key : [1]) of Changes on tables of 'sa/jdbc:h2:mem:test' source] %n" + Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Column at index 0 (column name : VAR1) of Change at index 1 (on table : TEST and with primary key : [1]) of Changes on tables of 'sa/jdbc:h2:mem:test'] %n" + "Expecting that the value at start point:%n" + " <1>%n" + "to be of type%n" diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnColumnType_IsDate_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnColumnType_IsDate_Test.java index cbcf2687..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 @@ -29,6 +29,7 @@ * {@link org.assertj.db.api.assertions.AssertOnColumnType#isDate(boolean)} method. * * @author Régis Pouiller + * @author Julien Roy */ public class AssertOnColumnType_IsDate_Test extends AbstractTest { @@ -38,12 +39,12 @@ public class AssertOnColumnType_IsDate_Test extends AbstractTest { @Test @NeedReload public void test_is_date() { - Changes changes = new Changes(source).setStartPointNow(); + Changes changes = 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(source, "test"); - Table table2 = new Table(source, "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); @@ -65,18 +66,18 @@ public void test_is_date() { @Test @NeedReload public void should_fail_because_value_have_different_type() { - Changes changes = new Changes(source).setStartPointNow(); + Changes changes = 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(source, "test"); - Table table2 = new Table(source, "test2"); + Table table = assertDbConnection.table("test").build(); + Table table2 = assertDbConnection.table("test2").build(); try { assertThat(changes).change().column("var9").isDate(false); fail("An exception must be raised"); } catch (AssertionError e) { - Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Column at index 8 (column name : VAR9) of Change at index 0 (on table : TEST and with primary key : [5]) of Changes on tables of 'sa/jdbc:h2:mem:test' source] %n" + Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Column at index 8 (column name : VAR9) of Change at index 0 (on table : TEST and with primary key : [5]) of Changes on tables of 'sa/jdbc:h2:mem:test'] %n" + "Expecting that the value at start point:%n" + " %n" + "to be of type%n" @@ -88,7 +89,7 @@ public void should_fail_because_value_have_different_type() { assertThat(changes).change(1).column("var1").isDate(true); fail("An exception must be raised"); } catch (AssertionError e) { - Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Column at index 0 (column name : VAR1) of Change at index 1 (on table : TEST and with primary key : [1]) of Changes on tables of 'sa/jdbc:h2:mem:test' source] %n" + Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Column at index 0 (column name : VAR1) of Change at index 1 (on table : TEST and with primary key : [1]) of Changes on tables of 'sa/jdbc:h2:mem:test'] %n" + "Expecting that the value at start point:%n" + " <1>%n" + "to be of type%n" diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnColumnType_IsNumber_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnColumnType_IsNumber_Test.java index 477754fd..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 @@ -29,6 +29,7 @@ * {@link org.assertj.db.api.assertions.AssertOnColumnType#isNumber(boolean)} method. * * @author Régis Pouiller + * @author Julien Roy */ public class AssertOnColumnType_IsNumber_Test extends AbstractTest { @@ -38,12 +39,12 @@ public class AssertOnColumnType_IsNumber_Test extends AbstractTest { @Test @NeedReload public void test_is_number() { - Changes changes = new Changes(source).setStartPointNow(); + Changes changes = 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(source, "test"); - Table table2 = new Table(source, "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); @@ -65,18 +66,18 @@ public void test_is_number() { @Test @NeedReload public void should_fail_because_value_have_different_type() { - Changes changes = new Changes(source).setStartPointNow(); + Changes changes = 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(source, "test"); - Table table2 = new Table(source, "test2"); + Table table = assertDbConnection.table("test").build(); + Table table2 = assertDbConnection.table("test2").build(); try { assertThat(changes).change().column("var3").isNumber(false); fail("An exception must be raised"); } catch (AssertionError e) { - Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Column at index 2 (column name : VAR3) of Change at index 0 (on table : TEST and with primary key : [5]) of Changes on tables of 'sa/jdbc:h2:mem:test' source] %n" + Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Column at index 2 (column name : VAR3) of Change at index 0 (on table : TEST and with primary key : [5]) of Changes on tables of 'sa/jdbc:h2:mem:test'] %n" + "Expecting that the value at start point:%n" + " %n" + "to be of type%n" @@ -88,7 +89,7 @@ public void should_fail_because_value_have_different_type() { assertThat(changes).change(1).column("var2").isNumber(true); fail("An exception must be raised"); } catch (AssertionError e) { - Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Column at index 1 (column name : VAR2) of Change at index 1 (on table : TEST and with primary key : [1]) of Changes on tables of 'sa/jdbc:h2:mem:test' source] %n" + Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Column at index 1 (column name : VAR2) of Change at index 1 (on table : TEST and with primary key : [1]) of Changes on tables of 'sa/jdbc:h2:mem:test'] %n" + "Expecting that the value at start point:%n" + " %n" + "to be of type%n" diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnColumnType_IsOfAnyTypeIn_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnColumnType_IsOfAnyTypeIn_Test.java index ea1e7432..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 @@ -30,6 +30,7 @@ * {@link org.assertj.db.api.assertions.AssertOnColumnType#isOfAnyTypeIn(org.assertj.db.type.ValueType...)} method. * * @author Régis Pouiller + * @author Julien Roy */ public class AssertOnColumnType_IsOfAnyTypeIn_Test extends AbstractTest { @@ -39,12 +40,12 @@ public class AssertOnColumnType_IsOfAnyTypeIn_Test extends AbstractTest { @Test @NeedReload public void test_is_of_any_of_types() { - Changes changes = new Changes(source).setStartPointNow(); + Changes changes = 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(source, "test"); - Table table2 = new Table(source, "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, @@ -68,18 +69,18 @@ public void test_is_of_any_of_types() { @Test @NeedReload public void should_fail_because_value_have_different_type() { - Changes changes = new Changes(source).setStartPointNow(); + Changes changes = 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(source, "test"); - Table table2 = new Table(source, "test2"); + Table table = assertDbConnection.table("test").build(); + Table table2 = assertDbConnection.table("test2").build(); try { assertThat(changes).change().column("var2").isOfAnyTypeIn(ValueType.BOOLEAN, ValueType.TEXT); fail("An exception must be raised"); } catch (AssertionError e) { - Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Column at index 1 (column name : VAR2) of Change at index 0 (on table : TEST and with primary key : [5]) of Changes on tables of 'sa/jdbc:h2:mem:test' source] %n" + Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Column at index 1 (column name : VAR2) of Change at index 0 (on table : TEST and with primary key : [5]) of Changes on tables of 'sa/jdbc:h2:mem:test'] %n" + "Expecting that the value at start point:%n" + " %n" + "to be of type%n" @@ -92,7 +93,7 @@ public void should_fail_because_value_have_different_type() { ValueType.NOT_IDENTIFIED); fail("An exception must be raised"); } catch (AssertionError e) { - Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Column at index 0 (column name : VAR1) of Change at index 1 (on table : TEST and with primary key : [1]) of Changes on tables of 'sa/jdbc:h2:mem:test' source] %n" + Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Column at index 0 (column name : VAR1) of Change at index 1 (on table : TEST and with primary key : [1]) of Changes on tables of 'sa/jdbc:h2:mem:test'] %n" + "Expecting that the value at start point:%n" + " <1>%n" + "to be of type%n" diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnColumnType_IsOfType_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnColumnType_IsOfType_Test.java index df82c6f9..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 @@ -30,6 +30,7 @@ * {@link org.assertj.db.api.assertions.AssertOnColumnType#isOfType(org.assertj.db.type.ValueType, boolean)} method. * * @author Régis Pouiller + * @author Julien Roy */ public class AssertOnColumnType_IsOfType_Test extends AbstractTest { @@ -39,12 +40,12 @@ public class AssertOnColumnType_IsOfType_Test extends AbstractTest { @Test @NeedReload public void test_is_of_type() { - Changes changes = new Changes(source).setStartPointNow(); + Changes changes = 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(source, "test"); - Table table2 = new Table(source, "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); @@ -66,18 +67,18 @@ public void test_is_of_type() { @Test @NeedReload public void should_fail_because_value_have_different_type() { - Changes changes = new Changes(source).setStartPointNow(); + Changes changes = 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(source, "test"); - Table table2 = new Table(source, "test2"); + Table table = assertDbConnection.table("test").build(); + Table table2 = assertDbConnection.table("test2").build(); try { assertThat(changes).change().column("var2").isOfType(ValueType.BOOLEAN, false); fail("An exception must be raised"); } catch (AssertionError e) { - Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Column at index 1 (column name : VAR2) of Change at index 0 (on table : TEST and with primary key : [5]) of Changes on tables of 'sa/jdbc:h2:mem:test' source] %n" + Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Column at index 1 (column name : VAR2) of Change at index 0 (on table : TEST and with primary key : [5]) of Changes on tables of 'sa/jdbc:h2:mem:test'] %n" + "Expecting that the value at start point:%n" + " %n" + "to be of type%n" @@ -89,7 +90,7 @@ public void should_fail_because_value_have_different_type() { assertThat(changes).change(1).column("var1").isOfType(ValueType.BOOLEAN, true); fail("An exception must be raised"); } catch (AssertionError e) { - Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Column at index 0 (column name : VAR1) of Change at index 1 (on table : TEST and with primary key : [1]) of Changes on tables of 'sa/jdbc:h2:mem:test' source] %n" + Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Column at index 0 (column name : VAR1) of Change at index 1 (on table : TEST and with primary key : [1]) of Changes on tables of 'sa/jdbc:h2:mem:test'] %n" + "Expecting that the value at start point:%n" + " <1>%n" + "to be of type%n" diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnColumnType_IsText_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnColumnType_IsText_Test.java index 78456154..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 @@ -29,6 +29,7 @@ * {@link org.assertj.db.api.assertions.AssertOnColumnType#isText(boolean)} method. * * @author Régis Pouiller + * @author Julien Roy */ public class AssertOnColumnType_IsText_Test extends AbstractTest { @@ -38,12 +39,12 @@ public class AssertOnColumnType_IsText_Test extends AbstractTest { @Test @NeedReload public void test_is_text() { - Changes changes = new Changes(source).setStartPointNow(); + Changes changes = 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(source, "test"); - Table table2 = new Table(source, "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); @@ -65,18 +66,18 @@ public void test_is_text() { @Test @NeedReload public void should_fail_because_value_have_different_type() { - Changes changes = new Changes(source).setStartPointNow(); + Changes changes = 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(source, "test"); - Table table2 = new Table(source, "test2"); + Table table = assertDbConnection.table("test").build(); + Table table2 = assertDbConnection.table("test2").build(); try { assertThat(changes).change().column("var12").isText(false); fail("An exception must be raised"); } catch (AssertionError e) { - Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Column at index 11 (column name : VAR12) of Change at index 0 (on table : TEST and with primary key : [5]) of Changes on tables of 'sa/jdbc:h2:mem:test' source] %n" + Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Column at index 11 (column name : VAR12) of Change at index 0 (on table : TEST and with primary key : [5]) of Changes on tables of 'sa/jdbc:h2:mem:test'] %n" + "Expecting that the value at start point:%n" + " %n" + "to be of type%n" @@ -88,7 +89,7 @@ public void should_fail_because_value_have_different_type() { assertThat(changes).change(1).column("var1").isText(true); fail("An exception must be raised"); } catch (AssertionError e) { - Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Column at index 0 (column name : VAR1) of Change at index 1 (on table : TEST and with primary key : [1]) of Changes on tables of 'sa/jdbc:h2:mem:test' source] %n" + Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Column at index 0 (column name : VAR1) of Change at index 1 (on table : TEST and with primary key : [1]) of Changes on tables of 'sa/jdbc:h2:mem:test'] %n" + "Expecting that the value at start point:%n" + " <1>%n" + "to be of type%n" diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnColumnType_IsTime_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnColumnType_IsTime_Test.java index ae9d13d5..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 @@ -29,6 +29,7 @@ * {@link org.assertj.db.api.assertions.AssertOnColumnType#isTime(boolean)} method. * * @author Régis Pouiller + * @author Julien Roy */ public class AssertOnColumnType_IsTime_Test extends AbstractTest { @@ -38,12 +39,12 @@ public class AssertOnColumnType_IsTime_Test extends AbstractTest { @Test @NeedReload public void test_is_time() { - Changes changes = new Changes(source).setStartPointNow(); + Changes changes = 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(source, "test"); - Table table2 = new Table(source, "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); @@ -65,18 +66,18 @@ public void test_is_time() { @Test @NeedReload public void should_fail_because_value_have_different_type() { - Changes changes = new Changes(source).setStartPointNow(); + Changes changes = 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(source, "test"); - Table table2 = new Table(source, "test2"); + Table table = assertDbConnection.table("test").build(); + Table table2 = assertDbConnection.table("test2").build(); try { assertThat(changes).change().column("var8").isTime(false); fail("An exception must be raised"); } catch (AssertionError e) { - Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Column at index 7 (column name : VAR8) of Change at index 0 (on table : TEST and with primary key : [5]) of Changes on tables of 'sa/jdbc:h2:mem:test' source] %n" + Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Column at index 7 (column name : VAR8) of Change at index 0 (on table : TEST and with primary key : [5]) of Changes on tables of 'sa/jdbc:h2:mem:test'] %n" + "Expecting that the value at start point:%n" + " %n" + "to be of type%n" @@ -88,7 +89,7 @@ public void should_fail_because_value_have_different_type() { assertThat(changes).change(1).column("var1").isTime(true); fail("An exception must be raised"); } catch (AssertionError e) { - Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Column at index 0 (column name : VAR1) of Change at index 1 (on table : TEST and with primary key : [1]) of Changes on tables of 'sa/jdbc:h2:mem:test' source] %n" + Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Column at index 0 (column name : VAR1) of Change at index 1 (on table : TEST and with primary key : [1]) of Changes on tables of 'sa/jdbc:h2:mem:test'] %n" + "Expecting that the value at start point:%n" + " <1>%n" + "to be of type%n" diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnColumnType_IsUUID_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnColumnType_IsUUID_Test.java index 57876eff..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(source).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(source, "test"); - Table table2 = new Table(source, "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,20 +66,20 @@ public void test_is_UUID() { @Test @NeedReload public void should_fail_because_value_have_different_type() { - Changes changes = new Changes(source).setStartPointNow(); + Changes changes = 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(source, "test"); - Table table2 = new Table(source, "test2"); + Table table = assertDbConnection.table("test").build(); + Table table2 = assertDbConnection.table("test2").build(); try { assertThat(changes).change().column("var15").isUUID(false); fail("An exception must be raised"); } catch (AssertionError e) { Assertions.assertThat(e.getMessage()).isEqualTo(String.format( - "[Column at index 14 (column name : VAR15) of Change at index 0 (on table : TEST and with primary key : [5]) of Changes on tables of 'sa/jdbc:h2:mem:test' source] %n" + "[Column at index 14 (column name : VAR15) of Change at index 0 (on table : TEST and with primary key : [5]) of Changes on tables of 'sa/jdbc:h2:mem:test'] %n" + "Expecting that the value at start point:%n" + " %n" + "to be of type%n" @@ -92,7 +92,7 @@ public void should_fail_because_value_have_different_type() { fail("An exception must be raised"); } catch (AssertionError e) { Assertions.assertThat(e.getMessage()).isEqualTo(String.format( - "[Column at index 0 (column name : VAR1) of Change at index 1 (on table : TEST and with primary key : [1]) of Changes on tables of 'sa/jdbc:h2:mem:test' source] %n" + "[Column at index 0 (column name : VAR1) of Change at index 1 (on table : TEST and with primary key : [1]) of Changes on tables of 'sa/jdbc:h2:mem:test'] %n" + "Expecting that the value at start point:%n" + " <1>%n" + "to be of type%n" diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnDataType_IsOnDataType_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnDataType_IsOnDataType_Test.java index 300b4bcb..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 @@ -30,6 +30,7 @@ * {@link org.assertj.db.api.assertions.AssertOnDataType#isOnDataType(org.assertj.db.type.DataType)} method. * * @author Régis Pouiller + * @author Julien Roy */ public class AssertOnDataType_IsOnDataType_Test extends AbstractTest { @@ -38,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(source, "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(); @@ -54,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(source, "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(); @@ -64,7 +65,7 @@ public void should_fail_because_data_type_is_different() throws Exception { assertThat(changes).change().isOnDataType(DataType.TABLE); fail("An exception must be raised"); } catch (AssertionError e) { - Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Change at index 0 of Changes on 'select * from actor' request of 'sa/jdbc:h2:mem:test' source] %n" + Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Change at index 0 of Changes on 'select * from actor' request of 'sa/jdbc:h2:mem:test'] %n" + "Expecting:%n" + "to be on data type%n" + "
%n" diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnDataType_IsOnRequest_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnDataType_IsOnRequest_Test.java index ae68b6e2..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 @@ -29,6 +29,7 @@ * {@link org.assertj.db.api.assertions.AssertOnDataType#isOnRequest()} method. * * @author Régis Pouiller + * @author Julien Roy */ public class AssertOnDataType_IsOnRequest_Test extends AbstractTest { @@ -37,9 +38,9 @@ public class AssertOnDataType_IsOnRequest_Test extends AbstractTest { */ @Test @NeedReload - public void test_is_on_request() throws Exception { - Request request = new Request(source, "select * from actor"); - 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(); @@ -53,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(source, "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(); @@ -63,7 +64,7 @@ public void should_fail_because_data_type_is_different() throws Exception { assertThat(changes).change().isOnRequest(); fail("An exception must be raised"); } catch (AssertionError e) { - Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Change at index 0 (with primary key : [4]) of Changes on ACTOR table of 'sa/jdbc:h2:mem:test' source] %n" + Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Change at index 0 (with primary key : [4]) of Changes on ACTOR table of 'sa/jdbc:h2:mem:test'] %n" + "Expecting:%n" + "to be on data type%n" + " %n" diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnDataType_IsOnTable_Name_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnDataType_IsOnTable_Name_Test.java index 5cb2a755..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 @@ -29,6 +29,7 @@ * {@link org.assertj.db.api.assertions.AssertOnDataType#isOnTable(String)} method. * * @author Régis Pouiller + * @author Julien Roy */ public class AssertOnDataType_IsOnTable_Name_Test extends AbstractTest { @@ -37,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(source, "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(); @@ -53,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(source, "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(); @@ -63,7 +64,7 @@ public void should_fail_because_data_type_is_different() throws Exception { assertThat(changes).change().isOnTable("actor"); fail("An exception must be raised"); } catch (AssertionError e) { - Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Change at index 0 of Changes on 'select * from actor' request of 'sa/jdbc:h2:mem:test' source] %n" + Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Change at index 0 of Changes on 'select * from actor' request of 'sa/jdbc:h2:mem:test'] %n" + "Expecting:%n" + "to be on data type%n" + "
%n" @@ -77,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(source, "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(); @@ -87,7 +88,7 @@ public void should_fail_because_table_name_is_different() throws Exception { assertThat(changes).change().isOnTable("movie"); fail("An exception must be raised"); } catch (AssertionError e) { - Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Change at index 0 (with primary key : [4]) of Changes on ACTOR table of 'sa/jdbc:h2:mem:test' source] %n" + Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Change at index 0 (with primary key : [4]) of Changes on ACTOR table of 'sa/jdbc:h2:mem:test'] %n" + "Expecting to be on the table:%n" + " <\"movie\">%n" + "but was on the table:%n" diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnDataType_IsOnTable_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnDataType_IsOnTable_Test.java index b42898c0..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 @@ -29,6 +29,7 @@ * {@link org.assertj.db.api.assertions.AssertOnDataType#isOnTable()} method. * * @author Régis Pouiller + * @author Julien Roy */ public class AssertOnDataType_IsOnTable_Test extends AbstractTest { @@ -37,9 +38,9 @@ public class AssertOnDataType_IsOnTable_Test extends AbstractTest { */ @Test @NeedReload - public void test_is_on_table() throws Exception { - Table table = new Table(source, "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(); @@ -53,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(source, "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(); @@ -63,7 +64,7 @@ public void should_fail_because_data_type_is_different() throws Exception { assertThat(changes).change().isOnTable(); fail("An exception must be raised"); } catch (AssertionError e) { - Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Change at index 0 of Changes on 'select * from actor' request of 'sa/jdbc:h2:mem:test' source] %n" + Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Change at index 0 of Changes on 'select * from actor' request of 'sa/jdbc:h2:mem:test'] %n" + "Expecting:%n" + "to be on data type%n" + "
%n" diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnExistence_DoesNotExist_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnExistence_DoesNotExist_Test.java index 2b8b1c98..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(source, "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(source, "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 42fa7ead..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(source, "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(source, "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 d9dd743c..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 @@ -27,6 +27,7 @@ * {@link org.assertj.db.api.assertions.AssertOnModifiedColumn#isModified()} method. * * @author Régis Pouiller + * @author Julien Roy */ public class AssertOnModifiedColumn_IsModified_Test extends AbstractTest { @@ -36,7 +37,7 @@ public class AssertOnModifiedColumn_IsModified_Test extends AbstractTest { @Test @NeedReload public void test_is_modified() { - Changes changes = new Changes(source).setStartPointNow(); + Changes changes = assertDbConnection.changes().build().setStartPointNow(); updateChangesForTests(); changes.setEndPointNow(); @@ -51,7 +52,7 @@ public void test_is_modified() { @Test @NeedReload public void should_fail_because_column_is_not_modified() { - Changes changes = new Changes(source).setStartPointNow(); + Changes changes = assertDbConnection.changes().build().setStartPointNow(); updateChangesForTests(); changes.setEndPointNow(); @@ -59,7 +60,7 @@ public void should_fail_because_column_is_not_modified() { assertThat(changes).change(3).column().isModified(); fail("An exception must be raised"); } catch (AssertionError e) { - Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Column at index 0 (column name : ID) of Change at index 3 (on table : ACTOR and with primary key : [1]) of Changes on tables of 'sa/jdbc:h2:mem:test' source] %n" + Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Column at index 0 (column name : ID) of Change at index 3 (on table : ACTOR and with primary key : [1]) of Changes on tables of 'sa/jdbc:h2:mem:test'] %n" + "Expecting :%n" + " <1>%n" + "is modified but is still:%n" diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnModifiedColumn_IsNotModified_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnModifiedColumn_IsNotModified_Test.java index 6883bb31..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 @@ -27,6 +27,7 @@ * {@link org.assertj.db.api.assertions.AssertOnModifiedColumn#isNotModified()} method. * * @author Régis Pouiller + * @author Julien Roy */ public class AssertOnModifiedColumn_IsNotModified_Test extends AbstractTest { @@ -36,7 +37,7 @@ public class AssertOnModifiedColumn_IsNotModified_Test extends AbstractTest { @Test @NeedReload public void test_is_not_modified() { - Changes changes = new Changes(source).setStartPointNow(); + Changes changes = assertDbConnection.changes().build().setStartPointNow(); updateChangesForTests(); changes.setEndPointNow(); @@ -51,7 +52,7 @@ public void test_is_not_modified() { @Test @NeedReload public void should_fail_because_column_is_modified() { - Changes changes = new Changes(source).setStartPointNow(); + Changes changes = assertDbConnection.changes().build().setStartPointNow(); updateChangesForTests(); changes.setEndPointNow(); @@ -59,7 +60,7 @@ public void should_fail_because_column_is_modified() { assertThat(changes).change().column().isNotModified(); fail("An exception must be raised"); } catch (AssertionError e) { - Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Column at index 0 (column name : ID) of Change at index 0 (on table : ACTOR and with primary key : [4]) of Changes on tables of 'sa/jdbc:h2:mem:test' source] %n" + Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Column at index 0 (column name : ID) of Change at index 0 (on table : ACTOR and with primary key : [4]) of Changes on tables of 'sa/jdbc:h2:mem:test'] %n" + "Expecting :%n" + " %n" + "is not modified but is :%n" diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnModifiedColumns_HasModifiedColumns_Integer_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnModifiedColumns_HasModifiedColumns_Integer_Test.java index 6b91bc06..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 @@ -27,6 +27,7 @@ * {@link org.assertj.db.api.assertions.AssertOnModifiedColumns#hasModifiedColumns(Integer...)} method. * * @author Régis Pouiller + * @author Julien Roy */ public class AssertOnModifiedColumns_HasModifiedColumns_Integer_Test extends AbstractTest { @@ -35,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(source).setStartPointNow(); + public void test_has_modified_columns() { + Changes changes = assertDbConnection.changes().build().setStartPointNow(); updateChangesForTests(); changes.setEndPointNow(); @@ -50,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(source).setStartPointNow(); + public void should_fail_because_modified_columns_are_different() { + Changes changes = assertDbConnection.changes().build().setStartPointNow(); updateChangesForTests(); changes.setEndPointNow(); @@ -59,7 +60,7 @@ public void should_fail_because_modified_columns_are_different() throws Exceptio assertThat(changes).change(3).hasModifiedColumns(1); fail("An exception must be raised"); } catch (AssertionError e) { - Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Change at index 3 (on table : ACTOR and with primary key : [1]) of Changes on tables of 'sa/jdbc:h2:mem:test' source] %n" + Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Change at index 3 (on table : ACTOR and with primary key : [1]) of Changes on tables of 'sa/jdbc:h2:mem:test'] %n" + "Expecting :%n" + " [1]%n" + "as indexes of modified columns but was:%n" diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnModifiedColumns_HasModifiedColumns_String_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnModifiedColumns_HasModifiedColumns_String_Test.java index 697039f7..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 @@ -27,6 +27,7 @@ * {@link org.assertj.db.api.assertions.AssertOnModifiedColumns(String...)} method. * * @author Régis Pouiller + * @author Julien Roy */ public class AssertOnModifiedColumns_HasModifiedColumns_String_Test extends AbstractTest { @@ -35,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(source).setStartPointNow(); + public void test_has_modified_columns() { + Changes changes = assertDbConnection.changes().build().setStartPointNow(); updateChangesForTests(); changes.setEndPointNow(); @@ -50,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(source).setStartPointNow(); + public void should_fail_because_modified_columns_are_different() { + Changes changes = assertDbConnection.changes().build().setStartPointNow(); updateChangesForTests(); changes.setEndPointNow(); @@ -59,7 +60,7 @@ public void should_fail_because_modified_columns_are_different() throws Exceptio assertThat(changes).change(3).hasModifiedColumns("ID"); fail("An exception must be raised"); } catch (AssertionError e) { - Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Change at index 3 (on table : ACTOR and with primary key : [1]) of Changes on tables of 'sa/jdbc:h2:mem:test' source] %n" + Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Change at index 3 (on table : ACTOR and with primary key : [1]) of Changes on tables of 'sa/jdbc:h2:mem:test'] %n" + "Expecting :%n" + " [\"ID\"]%n" + "as modified columns but was:%n" diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnModifiedColumns_HasNumberOfModifiedColumnsGreaterThanOrEqualTo_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnModifiedColumns_HasNumberOfModifiedColumnsGreaterThanOrEqualTo_Test.java index 065c1f0d..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 @@ -27,6 +27,7 @@ * {@link org.assertj.db.api.assertions.AssertOnModifiedColumns#hasNumberOfModifiedColumnsGreaterThanOrEqualTo(int)} method. * * @author Régis Pouiller + * @author Julien Roy */ public class AssertOnModifiedColumns_HasNumberOfModifiedColumnsGreaterThanOrEqualTo_Test extends AbstractTest { @@ -35,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(source).setStartPointNow(); + public void test_has_number_of_modified_columns_greater_than_or_equal_to() { + Changes changes = assertDbConnection.changes().build().setStartPointNow(); updateChangesForTests(); changes.setEndPointNow(); @@ -50,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(source).setStartPointNow(); + public void should_fail_because_number_of_modified_columns_is_less() { + Changes changes = assertDbConnection.changes().build().setStartPointNow(); updateChangesForTests(); changes.setEndPointNow(); @@ -59,7 +60,7 @@ public void should_fail_because_number_of_modified_columns_is_less() throws Exce assertThat(changes).change(3).hasNumberOfModifiedColumnsGreaterThanOrEqualTo(2); fail("An exception must be raised"); } catch (AssertionError e) { - Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Change at index 3 (on table : ACTOR and with primary key : [1]) of Changes on tables of 'sa/jdbc:h2:mem:test' source] %n" + Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Change at index 3 (on table : ACTOR and with primary key : [1]) of Changes on tables of 'sa/jdbc:h2:mem:test'] %n" + "Expecting :%n" + " number of modifications is greater than or equal to 2%n" + "but was:%n" diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnModifiedColumns_HasNumberOfModifiedColumnsGreaterThan_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnModifiedColumns_HasNumberOfModifiedColumnsGreaterThan_Test.java index 660899b0..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 @@ -27,6 +27,7 @@ * {@link org.assertj.db.api.assertions.AssertOnModifiedColumns#hasNumberOfModifiedColumnsGreaterThan(int)} method. * * @author Régis Pouiller + * @author Julien Roy */ public class AssertOnModifiedColumns_HasNumberOfModifiedColumnsGreaterThan_Test extends AbstractTest { @@ -35,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(source).setStartPointNow(); + public void test_has_number_of_modified_columns_greater_than() { + Changes changes = assertDbConnection.changes().build().setStartPointNow(); updateChangesForTests(); changes.setEndPointNow(); @@ -50,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(source).setStartPointNow(); + public void should_fail_because_number_of_modified_columns_is_less_or_equal() { + Changes changes = assertDbConnection.changes().build().setStartPointNow(); updateChangesForTests(); changes.setEndPointNow(); @@ -59,7 +60,7 @@ public void should_fail_because_number_of_modified_columns_is_less_or_equal() th assertThat(changes).change(3).hasNumberOfModifiedColumnsGreaterThan(1); fail("An exception must be raised"); } catch (AssertionError e) { - Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Change at index 3 (on table : ACTOR and with primary key : [1]) of Changes on tables of 'sa/jdbc:h2:mem:test' source] %n" + Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Change at index 3 (on table : ACTOR and with primary key : [1]) of Changes on tables of 'sa/jdbc:h2:mem:test'] %n" + "Expecting :%n" + " number of modifications is greater than 1%n" + "but was:%n" diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnModifiedColumns_HasNumberOfModifiedColumnsLessThanOrEqualTo_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnModifiedColumns_HasNumberOfModifiedColumnsLessThanOrEqualTo_Test.java index 0086442c..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 @@ -27,6 +27,7 @@ * {@link org.assertj.db.api.assertions.AssertOnModifiedColumns#hasNumberOfModifiedColumnsLessThanOrEqualTo(int)} method. * * @author Régis Pouiller + * @author Julien Roy */ public class AssertOnModifiedColumns_HasNumberOfModifiedColumnsLessThanOrEqualTo_Test extends AbstractTest { @@ -35,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(source).setStartPointNow(); + public void test_has_number_of_modified_columns_less_than_or_equal_to() { + Changes changes = assertDbConnection.changes().build().setStartPointNow(); updateChangesForTests(); changes.setEndPointNow(); @@ -50,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(source).setStartPointNow(); + public void should_fail_because_number_of_modified_columns_is_greater() { + Changes changes = assertDbConnection.changes().build().setStartPointNow(); updateChangesForTests(); changes.setEndPointNow(); @@ -59,7 +60,7 @@ public void should_fail_because_number_of_modified_columns_is_greater() throws E assertThat(changes).change(3).hasNumberOfModifiedColumnsLessThanOrEqualTo(0); fail("An exception must be raised"); } catch (AssertionError e) { - Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Change at index 3 (on table : ACTOR and with primary key : [1]) of Changes on tables of 'sa/jdbc:h2:mem:test' source] %n" + Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Change at index 3 (on table : ACTOR and with primary key : [1]) of Changes on tables of 'sa/jdbc:h2:mem:test'] %n" + "Expecting :%n" + " number of modifications is less than or equal to 0%n" + "but was:%n" diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnModifiedColumns_HasNumberOfModifiedColumnsLessThan_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnModifiedColumns_HasNumberOfModifiedColumnsLessThan_Test.java index a285a6ef..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 @@ -27,6 +27,7 @@ * {@link org.assertj.db.api.assertions.AssertOnModifiedColumns#hasNumberOfModifiedColumnsLessThan(int)} method. * * @author Régis Pouiller + * @author Julien Roy */ public class AssertOnModifiedColumns_HasNumberOfModifiedColumnsLessThan_Test extends AbstractTest { @@ -35,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(source).setStartPointNow(); + public void test_has_number_of_modified_columns_less_than() { + Changes changes = assertDbConnection.changes().build().setStartPointNow(); updateChangesForTests(); changes.setEndPointNow(); @@ -50,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(source).setStartPointNow(); + public void should_fail_because_number_of_modified_columns_is_greater_or_equal() { + Changes changes = assertDbConnection.changes().build().setStartPointNow(); updateChangesForTests(); changes.setEndPointNow(); @@ -59,7 +60,7 @@ public void should_fail_because_number_of_modified_columns_is_greater_or_equal() assertThat(changes).change(3).hasNumberOfModifiedColumnsLessThan(1); fail("An exception must be raised"); } catch (AssertionError e) { - Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Change at index 3 (on table : ACTOR and with primary key : [1]) of Changes on tables of 'sa/jdbc:h2:mem:test' source] %n" + Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Change at index 3 (on table : ACTOR and with primary key : [1]) of Changes on tables of 'sa/jdbc:h2:mem:test'] %n" + "Expecting :%n" + " number of modifications is less than 1%n" + "but was:%n" diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnModifiedColumns_HasNumberOfModifiedColumns_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnModifiedColumns_HasNumberOfModifiedColumns_Test.java index f902b90f..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 @@ -27,6 +27,7 @@ * {@link org.assertj.db.api.assertions.AssertOnModifiedColumns#hasNumberOfModifiedColumns(int)} method. * * @author Régis Pouiller + * @author Julien Roy */ public class AssertOnModifiedColumns_HasNumberOfModifiedColumns_Test extends AbstractTest { @@ -35,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(source).setStartPointNow(); + public void test_has_number_of_modified_columns() { + Changes changes = assertDbConnection.changes().build().setStartPointNow(); updateChangesForTests(); changes.setEndPointNow(); @@ -50,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(source).setStartPointNow(); + public void should_fail_because_number_of_modified_columns_is_different() { + Changes changes = assertDbConnection.changes().build().setStartPointNow(); updateChangesForTests(); changes.setEndPointNow(); @@ -59,7 +60,7 @@ public void should_fail_because_number_of_modified_columns_is_different() throws assertThat(changes).change(3).hasNumberOfModifiedColumns(2); fail("An exception must be raised"); } catch (AssertionError e) { - Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Change at index 3 (on table : ACTOR and with primary key : [1]) of Changes on tables of 'sa/jdbc:h2:mem:test' source] %n" + Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Change at index 3 (on table : ACTOR and with primary key : [1]) of Changes on tables of 'sa/jdbc:h2:mem:test'] %n" + "Expecting :%n" + " 2 modifications%n" + "but was:%n" diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnNumberOfChanges_HasNumberOfChangesGreaterThanOrEqualTo_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnNumberOfChanges_HasNumberOfChangesGreaterThanOrEqualTo_Test.java index 78c3e623..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 @@ -29,6 +29,7 @@ * {@link org.assertj.db.api.assertions.AssertOnNumberOfChanges#hasNumberOfChangesGreaterThanOrEqualTo(int)} method. * * @author Régis Pouiller + * @author Julien Roy */ public class AssertOnNumberOfChanges_HasNumberOfChangesGreaterThanOrEqualTo_Test extends AbstractTest { @@ -37,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(source, "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(); @@ -53,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(source, "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(); @@ -63,7 +64,7 @@ public void should_fail_because_number_of_changes_is_less() throws Exception { assertThat(changes).hasNumberOfChangesGreaterThanOrEqualTo(9); fail("An exception must be raised"); } catch (AssertionError e) { - Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Changes on 'select * from actor' request of 'sa/jdbc:h2:mem:test' source] %n" + Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Changes on 'select * from actor' request of 'sa/jdbc:h2:mem:test'] %n" + "Expecting size (number of changes) to be greater than or equal to :%n" + " <9>%n" + "but was:%n" diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnNumberOfChanges_HasNumberOfChangesGreaterThan_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnNumberOfChanges_HasNumberOfChangesGreaterThan_Test.java index f66b834c..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 @@ -29,6 +29,7 @@ * {@link org.assertj.db.api.assertions.AssertOnNumberOfChanges#hasNumberOfChangesGreaterThan(int)} method. * * @author Régis Pouiller + * @author Julien Roy */ public class AssertOnNumberOfChanges_HasNumberOfChangesGreaterThan_Test extends AbstractTest { @@ -37,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(source, "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(); @@ -53,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(source, "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(); @@ -63,7 +64,7 @@ public void should_fail_because_number_of_changes_is_less_or_equal() throws Exce assertThat(changes).hasNumberOfChangesGreaterThan(4); fail("An exception must be raised"); } catch (AssertionError e) { - Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Changes on 'select * from actor' request of 'sa/jdbc:h2:mem:test' source] %n" + Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Changes on 'select * from actor' request of 'sa/jdbc:h2:mem:test'] %n" + "Expecting size (number of changes) to be greater than :%n" + " <4>%n" + "but was:%n" diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnNumberOfChanges_HasNumberOfChangesLessThanOrEqualTo_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnNumberOfChanges_HasNumberOfChangesLessThanOrEqualTo_Test.java index 7e72be01..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; @@ -29,6 +28,7 @@ * {@link org.assertj.db.api.assertions.AssertOnNumberOfChanges#hasNumberOfChangesLessThanOrEqualTo(int)} method. * * @author Régis Pouiller + * @author Julien Roy */ public class AssertOnNumberOfChanges_HasNumberOfChangesLessThanOrEqualTo_Test extends AbstractTest { @@ -37,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(source, "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(); @@ -53,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(source, "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(); @@ -63,7 +62,7 @@ public void should_fail_because_number_of_changes_is_greater() throws Exception assertThat(changes).hasNumberOfChangesLessThanOrEqualTo(2); fail("An exception must be raised"); } catch (AssertionError e) { - Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Changes on 'select * from actor' request of 'sa/jdbc:h2:mem:test' source] %n" + Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Changes on 'select * from actor' request of 'sa/jdbc:h2:mem:test'] %n" + "Expecting size (number of changes) to be less than or equal to :%n" + " <2>%n" + "but was:%n" diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnNumberOfChanges_HasNumberOfChangesLessThan_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnNumberOfChanges_HasNumberOfChangesLessThan_Test.java index ca8bfef4..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 @@ -29,6 +29,7 @@ * {@link org.assertj.db.api.assertions.AssertOnNumberOfChanges#hasNumberOfChangesLessThan(int)} method. * * @author Régis Pouiller + * @author Julien Roy */ public class AssertOnNumberOfChanges_HasNumberOfChangesLessThan_Test extends AbstractTest { @@ -37,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(source, "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(); @@ -53,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(source, "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(); @@ -63,7 +64,7 @@ public void should_fail_because_number_of_changes_is_greater_or_equal() throws E assertThat(changes).hasNumberOfChangesLessThan(2); fail("An exception must be raised"); } catch (AssertionError e) { - Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Changes on 'select * from actor' request of 'sa/jdbc:h2:mem:test' source] %n" + Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Changes on 'select * from actor' request of 'sa/jdbc:h2:mem:test'] %n" + "Expecting size (number of changes) to be less than :%n" + " <2>%n" + "but was:%n" diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnNumberOfChanges_HasNumberOfChanges_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnNumberOfChanges_HasNumberOfChanges_Test.java index def35ac6..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 @@ -29,6 +29,7 @@ * {@link org.assertj.db.api.assertions.AssertOnNumberOfChanges#hasNumberOfChanges(int)} method. * * @author Régis Pouiller + * @author Julien Roy */ public class AssertOnNumberOfChanges_HasNumberOfChanges_Test extends AbstractTest { @@ -37,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(source, "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(); @@ -47,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); } /** @@ -55,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(source, "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(); @@ -65,7 +66,7 @@ public void should_fail_because_number_of_changes_is_different() throws Exceptio assertThat(changes).hasNumberOfChanges(9); fail("An exception must be raised"); } catch (AssertionError e) { - Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Changes on 'select * from actor' request of 'sa/jdbc:h2:mem:test' source] %n" + Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Changes on 'select * from actor' request of 'sa/jdbc:h2:mem:test'] %n" + "Expecting size (number of changes) to be equal to :%n" + " <9>%n" + "but was:%n" diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnNumberOfColumns_HasNumberOfColumnsGreaterThanOrEqualTo_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnNumberOfColumns_HasNumberOfColumnsGreaterThanOrEqualTo_Test.java index d2d495d2..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 @@ -32,6 +32,7 @@ * {@link org.assertj.db.api.assertions.AssertOnNumberOfColumns#hasNumberOfColumnsGreaterThanOrEqualTo(int)} method. * * @author Régis Pouiller + * @author Julien Roy */ public class AssertOnNumberOfColumns_HasNumberOfColumnsGreaterThanOrEqualTo_Test extends AbstractTest { @@ -41,8 +42,8 @@ public class AssertOnNumberOfColumns_HasNumberOfColumnsGreaterThanOrEqualTo_Test @Test @NeedReload public void test_has_number_of_columns() { - Table table = new Table(source, "actor"); - Changes changes = new Changes(table).setStartPointNow(); + Table table = assertDbConnection.table("actor").build(); + Changes changes = assertDbConnection.changes().tables(table).build().setStartPointNow(); updateChangesForTests(); changes.setEndPointNow(); @@ -69,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(source, "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(); @@ -78,7 +79,7 @@ public void should_fail_because_number_of_columns_is_greater() { assertThat(changes).change().hasNumberOfColumnsGreaterThanOrEqualTo(6); fail("An exception must be raised"); } catch (AssertionError e) { - Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Change at index 0 of Changes on 'select * from actor' request of 'sa/jdbc:h2:mem:test' source] %n" + Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Change at index 0 of Changes on 'select * from actor' request of 'sa/jdbc:h2:mem:test'] %n" + "Expecting size (number of columns) to be greater than or equal to :%n" + " <6>%n" + "but was:%n" @@ -88,7 +89,7 @@ public void should_fail_because_number_of_columns_is_greater() { assertThat(changes).change().rowAtEndPoint().hasNumberOfColumnsGreaterThanOrEqualTo(6); fail("An exception must be raised"); } catch (AssertionError e) { - Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Row at end point of Change at index 0 of Changes on 'select * from actor' request of 'sa/jdbc:h2:mem:test' source] %n" + Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Row at end point of Change at index 0 of Changes on 'select * from actor' request of 'sa/jdbc:h2:mem:test'] %n" + "Expecting size (number of columns) to be greater than or equal to :%n" + " <6>%n" + "but was:%n" diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnNumberOfColumns_HasNumberOfColumnsGreaterThan_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnNumberOfColumns_HasNumberOfColumnsGreaterThan_Test.java index d93b8201..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 @@ -32,6 +32,7 @@ * {@link org.assertj.db.api.assertions.AssertOnNumberOfColumns#hasNumberOfColumnsGreaterThan(int)} method. * * @author Régis Pouiller + * @author Julien Roy */ public class AssertOnNumberOfColumns_HasNumberOfColumnsGreaterThan_Test extends AbstractTest { @@ -41,8 +42,8 @@ public class AssertOnNumberOfColumns_HasNumberOfColumnsGreaterThan_Test extends @Test @NeedReload public void test_has_number_of_columns() { - Table table = new Table(source, "actor"); - Changes changes = new Changes(table).setStartPointNow(); + Table table = assertDbConnection.table("actor").build(); + Changes changes = assertDbConnection.changes().tables(table).build().setStartPointNow(); updateChangesForTests(); changes.setEndPointNow(); @@ -69,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(source, "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(); @@ -78,7 +79,7 @@ public void should_fail_because_number_of_columns_is_different() { assertThat(changes).change().hasNumberOfColumnsGreaterThan(9); fail("An exception must be raised"); } catch (AssertionError e) { - Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Change at index 0 of Changes on 'select * from actor' request of 'sa/jdbc:h2:mem:test' source] %n" + Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Change at index 0 of Changes on 'select * from actor' request of 'sa/jdbc:h2:mem:test'] %n" + "Expecting size (number of columns) to be greater than :%n" + " <9>%n" + "but was:%n" @@ -88,7 +89,7 @@ public void should_fail_because_number_of_columns_is_different() { assertThat(changes).change().rowAtEndPoint().hasNumberOfColumnsGreaterThan(9); fail("An exception must be raised"); } catch (AssertionError e) { - Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Row at end point of Change at index 0 of Changes on 'select * from actor' request of 'sa/jdbc:h2:mem:test' source] %n" + Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Row at end point of Change at index 0 of Changes on 'select * from actor' request of 'sa/jdbc:h2:mem:test'] %n" + "Expecting size (number of columns) to be greater than :%n" + " <9>%n" + "but was:%n" diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnNumberOfColumns_HasNumberOfColumnsLessThanOrEqualTo_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnNumberOfColumns_HasNumberOfColumnsLessThanOrEqualTo_Test.java index df96b2ea..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 @@ -32,6 +32,7 @@ * {@link org.assertj.db.api.assertions.AssertOnNumberOfColumns#hasNumberOfColumnsLessThanOrEqualTo(int)} method. * * @author Régis Pouiller + * @author Julien Roy */ public class AssertOnNumberOfColumns_HasNumberOfColumnsLessThanOrEqualTo_Test extends AbstractTest { @@ -41,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(source, "actor"); - Changes changes = new Changes(table).setStartPointNow(); + Table table = assertDbConnection.table("actor").build(); + Changes changes = assertDbConnection.changes().tables(table).build().setStartPointNow(); updateChangesForTests(); changes.setEndPointNow(); @@ -69,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(source, "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(); @@ -78,7 +79,7 @@ public void should_fail_because_number_of_columns_is_less() { assertThat(changes).change().hasNumberOfColumnsLessThanOrEqualTo(4); fail("An exception must be raised"); } catch (AssertionError e) { - Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Change at index 0 of Changes on 'select * from actor' request of 'sa/jdbc:h2:mem:test' source] %n" + Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Change at index 0 of Changes on 'select * from actor' request of 'sa/jdbc:h2:mem:test'] %n" + "Expecting size (number of columns) to be less than or equal to :%n" + " <4>%n" + "but was:%n" @@ -88,7 +89,7 @@ public void should_fail_because_number_of_columns_is_less() { assertThat(changes).change().rowAtEndPoint().hasNumberOfColumnsLessThanOrEqualTo(4); fail("An exception must be raised"); } catch (AssertionError e) { - Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Row at end point of Change at index 0 of Changes on 'select * from actor' request of 'sa/jdbc:h2:mem:test' source] %n" + Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Row at end point of Change at index 0 of Changes on 'select * from actor' request of 'sa/jdbc:h2:mem:test'] %n" + "Expecting size (number of columns) to be less than or equal to :%n" + " <4>%n" + "but was:%n" diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnNumberOfColumns_HasNumberOfColumnsLessThan_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnNumberOfColumns_HasNumberOfColumnsLessThan_Test.java index ace13f09..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 @@ -32,6 +32,7 @@ * {@link org.assertj.db.api.assertions.AssertOnNumberOfColumns#hasNumberOfColumnsLessThan(int)} method. * * @author Régis Pouiller + * @author Julien Roy */ public class AssertOnNumberOfColumns_HasNumberOfColumnsLessThan_Test extends AbstractTest { @@ -41,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(source, "actor"); - Changes changes = new Changes(table).setStartPointNow(); + Table table = assertDbConnection.table("actor").build(); + Changes changes = assertDbConnection.changes().tables(table).build().setStartPointNow(); updateChangesForTests(); changes.setEndPointNow(); @@ -69,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(source, "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(); @@ -78,7 +79,7 @@ public void should_fail_because_number_of_columns_is_greater_or_equal() { assertThat(changes).change().hasNumberOfColumnsLessThan(5); fail("An exception must be raised"); } catch (AssertionError e) { - Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Change at index 0 of Changes on 'select * from actor' request of 'sa/jdbc:h2:mem:test' source] %n" + Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Change at index 0 of Changes on 'select * from actor' request of 'sa/jdbc:h2:mem:test'] %n" + "Expecting size (number of columns) to be less than :%n" + " <5>%n" + "but was:%n" @@ -88,7 +89,7 @@ public void should_fail_because_number_of_columns_is_greater_or_equal() { assertThat(changes).change().rowAtEndPoint().hasNumberOfColumnsLessThan(4); fail("An exception must be raised"); } catch (AssertionError e) { - Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Row at end point of Change at index 0 of Changes on 'select * from actor' request of 'sa/jdbc:h2:mem:test' source] %n" + Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Row at end point of Change at index 0 of Changes on 'select * from actor' request of 'sa/jdbc:h2:mem:test'] %n" + "Expecting size (number of columns) to be less than :%n" + " <4>%n" + "but was:%n" diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnNumberOfColumns_HasNumberOfColumns_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnNumberOfColumns_HasNumberOfColumns_Test.java index 2ce8c180..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 @@ -32,6 +32,7 @@ * {@link org.assertj.db.api.assertions.AssertOnNumberOfColumns#hasNumberOfColumns(int)} method. * * @author Régis Pouiller + * @author Julien Roy */ public class AssertOnNumberOfColumns_HasNumberOfColumns_Test extends AbstractTest { @@ -41,8 +42,8 @@ public class AssertOnNumberOfColumns_HasNumberOfColumns_Test extends AbstractTes @Test @NeedReload public void test_has_number_of_columns() { - Table table = new Table(source, "actor"); - Changes changes = new Changes(table).setStartPointNow(); + Table table = assertDbConnection.table("actor").build(); + Changes changes = assertDbConnection.changes().tables(table).build().setStartPointNow(); updateChangesForTests(); changes.setEndPointNow(); @@ -69,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(source, "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(); @@ -78,7 +79,7 @@ public void should_fail_because_number_of_columns_is_different() { assertThat(changes).change().hasNumberOfColumns(9); fail("An exception must be raised"); } catch (AssertionError e) { - Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Change at index 0 of Changes on 'select * from actor' request of 'sa/jdbc:h2:mem:test' source] %n" + Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Change at index 0 of Changes on 'select * from actor' request of 'sa/jdbc:h2:mem:test'] %n" + "Expecting size (number of columns) to be equal to :%n" + " <9>%n" + "but was:%n" @@ -88,7 +89,7 @@ public void should_fail_because_number_of_columns_is_different() { assertThat(changes).change().rowAtEndPoint().hasNumberOfColumns(9); fail("An exception must be raised"); } catch (AssertionError e) { - Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Row at end point of Change at index 0 of Changes on 'select * from actor' request of 'sa/jdbc:h2:mem:test' source] %n" + Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Row at end point of Change at index 0 of Changes on 'select * from actor' request of 'sa/jdbc:h2:mem:test'] %n" + "Expecting size (number of columns) to be equal to :%n" + " <9>%n" + "but was:%n" diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnNumberOfRows_HasNumberOfRowsGreaterThanOrEqualTo_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnNumberOfRows_HasNumberOfRowsGreaterThanOrEqualTo_Test.java index a4fd5c97..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 @@ -28,6 +28,7 @@ * {@link org.assertj.db.api.assertions.AssertOnNumberOfRows#hasNumberOfRowsGreaterThanOrEqualTo(int)} method. * * @author Régis Pouiller + * @author Julien Roy */ public class AssertOnNumberOfRows_HasNumberOfRowsGreaterThanOrEqualTo_Test extends AbstractTest { @@ -36,7 +37,7 @@ public class AssertOnNumberOfRows_HasNumberOfRowsGreaterThanOrEqualTo_Test exten */ @Test public void test_has_number_of_rows_greater_than_or_equal_to() { - Table table = new Table(source, "actor"); + Table table = assertDbConnection.table("actor").build(); TableAssert tableAssert = assertThat(table); TableAssert tableAssert2 = tableAssert.hasNumberOfRowsGreaterThanOrEqualTo(3); Assertions.assertThat(tableAssert).isSameAs(tableAssert2); @@ -50,7 +51,7 @@ public void test_has_number_of_rows_greater_than_or_equal_to() { */ @Test public void should_fail_because_number_of_rows_is_less() { - Request request = new Request(source, "select * from actor"); + Request request = 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 fb6b4563..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 @@ -28,6 +28,7 @@ * {@link org.assertj.db.api.assertions.AssertOnNumberOfRows#hasNumberOfRowsGreaterThan(int)} method. * * @author Régis Pouiller + * @author Julien Roy */ public class AssertOnNumberOfRows_HasNumberOfRowsGreaterThan_Test extends AbstractTest { @@ -36,7 +37,7 @@ public class AssertOnNumberOfRows_HasNumberOfRowsGreaterThan_Test extends Abstra */ @Test public void test_has_number_of_rows_greater_than() { - Table table = new Table(source, "actor"); + Table table = assertDbConnection.table("actor").build(); TableAssert tableAssert = assertThat(table); TableAssert tableAssert2 = tableAssert.hasNumberOfRowsGreaterThan(2); Assertions.assertThat(tableAssert).isSameAs(tableAssert2); @@ -50,7 +51,7 @@ public void test_has_number_of_rows_greater_than() { */ @Test public void should_fail_because_number_of_rows_is_less_or_equal() { - Request request = new Request(source, "select * from actor"); + Request request = 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 29c51993..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 @@ -28,6 +28,7 @@ * {@link org.assertj.db.api.assertions.AssertOnNumberOfRows#hasNumberOfRowsLessThanOrEqualTo(int)} method. * * @author Régis Pouiller + * @author Julien Roy */ public class AssertOnNumberOfRows_HasNumberOfRowsLessThanOrEqualTo_Test extends AbstractTest { @@ -36,7 +37,7 @@ public class AssertOnNumberOfRows_HasNumberOfRowsLessThanOrEqualTo_Test extends */ @Test public void test_has_number_of_rows_less_than_or_equal_to() { - Table table = new Table(source, "actor"); + Table table = assertDbConnection.table("actor").build(); TableAssert tableAssert = assertThat(table); TableAssert tableAssert2 = tableAssert.hasNumberOfRowsLessThanOrEqualTo(3); Assertions.assertThat(tableAssert).isSameAs(tableAssert2); @@ -50,7 +51,7 @@ public void test_has_number_of_rows_less_than_or_equal_to() { */ @Test public void should_fail_because_number_of_rows_is_greater() { - Request request = new Request(source, "select * from actor"); + Request request = 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 aae43606..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 @@ -28,6 +28,7 @@ * {@link org.assertj.db.api.assertions.AssertOnNumberOfRows#hasNumberOfRowsLessThan(int)} method. * * @author Régis Pouiller + * @author Julien Roy */ public class AssertOnNumberOfRows_HasNumberOfRowsLessThan_Test extends AbstractTest { @@ -36,7 +37,7 @@ public class AssertOnNumberOfRows_HasNumberOfRowsLessThan_Test extends AbstractT */ @Test public void test_has_number_of_rows_less_than() { - Table table = new Table(source, "actor"); + Table table = assertDbConnection.table("actor").build(); TableAssert tableAssert = assertThat(table); TableAssert tableAssert2 = tableAssert.hasNumberOfRowsLessThan(4); Assertions.assertThat(tableAssert).isSameAs(tableAssert2); @@ -50,7 +51,7 @@ public void test_has_number_of_rows_less_than() { */ @Test public void should_fail_because_number_of_rows_is_greater_or_equal() { - Request request = new Request(source, "select * from actor"); + Request request = 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 aec45441..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 @@ -28,6 +28,7 @@ * {@link org.assertj.db.api.assertions.AssertOnNumberOfRows#hasNumberOfRows(int)} method. * * @author Régis Pouiller + * @author Julien Roy */ public class AssertOnNumberOfRows_HasNumberOfRows_Test extends AbstractTest { @@ -36,7 +37,7 @@ public class AssertOnNumberOfRows_HasNumberOfRows_Test extends AbstractTest { */ @Test public void test_has_number_of_rows() { - Table table = new Table(source, "actor"); + Table table = assertDbConnection.table("actor").build(); TableAssert tableAssert = assertThat(table); TableAssert tableAssert2 = tableAssert.hasNumberOfRows(3); Assertions.assertThat(tableAssert).isSameAs(tableAssert2); @@ -50,7 +51,7 @@ public void test_has_number_of_rows() { */ @Test public void should_fail_because_number_of_rows_is_different() { - Request request = new Request(source, "select * from actor"); + Request request = 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 f9752ca0..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(source, "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(source, "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 06e8a4b2..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 @@ -27,6 +27,7 @@ * {@link org.assertj.db.api.assertions.AssertOnPrimaryKey#hasPksNames(String...)} method. * * @author Régis Pouiller + * @author Julien Roy */ public class AssertOnPrimaryKey_HasPksNames_Test extends AbstractTest { @@ -35,8 +36,8 @@ public class AssertOnPrimaryKey_HasPksNames_Test extends AbstractTest { */ @Test @NeedReload - public void test_has_pks_names() throws Exception { - Changes changes = new Changes(source).setStartPointNow(); + public void test_has_pks_names() { + Changes changes = assertDbConnection.changes().build().setStartPointNow(); updateChangesForTests(); changes.setEndPointNow(); @@ -50,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(source).setStartPointNow(); + public void should_fail_because_pks_names_are_different() { + Changes changes = assertDbConnection.changes().build().setStartPointNow(); updateChangesForTests(); changes.setEndPointNow(); @@ -59,7 +60,7 @@ public void should_fail_because_pks_names_are_different() throws Exception { assertThat(changes).change().hasPksNames("ID2"); fail("An exception must be raised"); } catch (AssertionError e) { - Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Change at index 0 (on table : ACTOR and with primary key : [4]) of Changes on tables of 'sa/jdbc:h2:mem:test' source] %n" + Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Change at index 0 (on table : ACTOR and with primary key : [4]) of Changes on tables of 'sa/jdbc:h2:mem:test'] %n" + "Expecting :%n" + " [\"ID2\"]%n" + "to be the name of the columns of the primary keys but was:%n" @@ -72,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(source).setStartPointNow(); + public void should_fail_because_number_of_pks_names_are_different() { + Changes changes = assertDbConnection.changes().build().setStartPointNow(); updateChangesForTests(); changes.setEndPointNow(); @@ -81,7 +82,7 @@ public void should_fail_because_number_of_pks_names_are_different() throws Excep assertThat(changes).change().hasPksNames("ID", "ID2"); fail("An exception must be raised"); } catch (AssertionError e) { - Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Change at index 0 (on table : ACTOR and with primary key : [4]) of Changes on tables of 'sa/jdbc:h2:mem:test' source] %n" + Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Change at index 0 (on table : ACTOR and with primary key : [4]) of Changes on tables of 'sa/jdbc:h2:mem:test'] %n" + "Expecting :%n" + " [\"ID\", \"ID2\"]%n" + "to be the name of the columns of the primary keys but was:%n" diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnPrimaryKey_HasPksValues_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnPrimaryKey_HasPksValues_Test.java index c3b19419..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 @@ -27,6 +27,7 @@ * {@link org.assertj.db.api.assertions.AssertOnPrimaryKey#hasPksValues(Object...)} method. * * @author Régis Pouiller + * @author Julien Roy */ public class AssertOnPrimaryKey_HasPksValues_Test extends AbstractTest { @@ -35,8 +36,8 @@ public class AssertOnPrimaryKey_HasPksValues_Test extends AbstractTest { */ @Test @NeedReload - public void test_has_pks_values() throws Exception { - Changes changes = new Changes(source).setStartPointNow(); + public void test_has_pks_values() { + Changes changes = assertDbConnection.changes().build().setStartPointNow(); updateChangesForTests(); changes.setEndPointNow(); @@ -50,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(source).setStartPointNow(); + public void should_fail_because_pks_values_are_different() { + Changes changes = assertDbConnection.changes().build().setStartPointNow(); updateChangesForTests(); changes.setEndPointNow(); @@ -59,7 +60,7 @@ public void should_fail_because_pks_values_are_different() throws Exception { assertThat(changes).change().hasPksValues(5); fail("An exception must be raised"); } catch (AssertionError e) { - Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Change at index 0 (on table : ACTOR and with primary key : [4]) of Changes on tables of 'sa/jdbc:h2:mem:test' source] %n" + Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Change at index 0 (on table : ACTOR and with primary key : [4]) of Changes on tables of 'sa/jdbc:h2:mem:test'] %n" + "Expecting :%n" + " [5]%n" + "to be the values of the columns of the primary keys but was:%n" @@ -72,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(source).setStartPointNow(); + public void should_fail_because_number_of_pks_values_are_different() { + Changes changes = assertDbConnection.changes().build().setStartPointNow(); updateChangesForTests(); changes.setEndPointNow(); @@ -81,7 +82,7 @@ public void should_fail_because_number_of_pks_values_are_different() throws Exce assertThat(changes).change().hasPksValues(4, "ID2"); fail("An exception must be raised"); } catch (AssertionError e) { - Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Change at index 0 (on table : ACTOR and with primary key : [4]) of Changes on tables of 'sa/jdbc:h2:mem:test' source] %n" + Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Change at index 0 (on table : ACTOR and with primary key : [4]) of Changes on tables of 'sa/jdbc:h2:mem:test'] %n" + "Expecting :%n" + " [4, \"ID2\"]%n" + "to be the values of the columns of the primary keys but was:%n" diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnRowCondition_HasValuesSatisfying_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnRowCondition_HasValuesSatisfying_Test.java index 5dc3b4a9..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(source, "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(source, "actor"); - Changes changes = new Changes(table).setStartPointNow(); + Table table = assertDbConnection.table("actor").build(); + Changes changes = assertDbConnection.changes().tables(table).build().setStartPointNow(); updateChangesForTests(); changes.setEndPointNow(); @@ -106,7 +106,7 @@ public void should_fail_because_values_are_different() { ); } catch (AssertionError e) { Assertions.assertThat(e.getMessage()).isEqualTo(String.format( - "[Row at end point of Change at index 0 (with primary key : [4]) of Changes on ACTOR table of 'sa/jdbc:h2:mem:test' source] %n" + "[Row at end point of Change at index 0 (with primary key : [4]) of Changes on ACTOR table of 'sa/jdbc:h2:mem:test'] %n" + "Expecting that the value at index 2:%n" + " \"Bill\"%n" + "to satisfy: %n" diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnRowEquality_HasValues_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnRowEquality_HasValues_Test.java index dc37ea4f..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 @@ -30,6 +30,7 @@ * {@link org.assertj.db.api.assertions.AssertOnRowEquality#hasValues(Object...)} method. * * @author Régis Pouiller + * @author Julien Roy */ public class AssertOnRowEquality_HasValues_Test extends AbstractTest { @@ -39,8 +40,8 @@ public class AssertOnRowEquality_HasValues_Test extends AbstractTest { @Test @NeedReload public void test_has_values() { - Table table = new Table(source, "actor"); - Changes changes = new Changes(table).setStartPointNow(); + Table table = assertDbConnection.table("actor").build(); + Changes changes = assertDbConnection.changes().tables(table).build().setStartPointNow(); updateChangesForTests(); changes.setEndPointNow(); @@ -62,15 +63,15 @@ public void test_has_values() { @Test @NeedReload public void should_fail_because_values_are_different() { - Table table = new Table(source, "actor"); - Changes changes = new Changes(table).setStartPointNow(); + Table table = assertDbConnection.table("actor").build(); + Changes changes = assertDbConnection.changes().tables(table).build().setStartPointNow(); updateChangesForTests(); changes.setEndPointNow(); try { assertThat(changes).change().rowAtEndPoint().hasValues(4, "Murray", "Billy", "1950-09-21", UUID.fromString("30B443AE-C0C9-4790-9BEC-CE1380808435")); } catch (AssertionError e) { - Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Row at end point of Change at index 0 (with primary key : [4]) of Changes on ACTOR table of 'sa/jdbc:h2:mem:test' source] %n" + Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Row at end point of Change at index 0 (with primary key : [4]) of Changes on ACTOR table of 'sa/jdbc:h2:mem:test'] %n" + "Expecting that the value at index 2:%n" + " <\"Bill\">%n" + "to be equal to: %n" diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnRowNullity_HasOnlyNotNullValues_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnRowNullity_HasOnlyNotNullValues_Test.java index 8d9418be..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(source, "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(source, "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 341399db..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 @@ -26,6 +26,7 @@ * {@link org.assertj.db.api.assertions.AssertOnRowOfChangeExistence#doesNotExist()} method. * * @author Régis Pouiller + * @author Julien Roy */ public class AssertOnRowOfChangeExistence_DoesNotExist_Test extends AbstractTest { @@ -34,8 +35,8 @@ public class AssertOnRowOfChangeExistence_DoesNotExist_Test extends AbstractTest */ @Test @NeedReload - public void test_does_not_exists() throws Exception { - Changes changes = new Changes(source).setStartPointNow(); + public void test_does_not_exists() { + Changes changes = assertDbConnection.changes().build().setStartPointNow(); updateChangesForTests(); changes.setEndPointNow(); @@ -49,15 +50,15 @@ public void test_does_not_exists() throws Exception { */ @Test @NeedReload - public void should_fail_because_row_exists() throws Exception { - Changes changes = new Changes(source).setStartPointNow(); + public void should_fail_because_row_exists() { + Changes changes = assertDbConnection.changes().build().setStartPointNow(); updateChangesForTests(); changes.setEndPointNow(); try { assertThat(changes).change().rowAtEndPoint().doesNotExist(); } catch (AssertionError e) { - Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Row at end point of Change at index 0 (on table : ACTOR and with primary key : [4]) of Changes on tables of 'sa/jdbc:h2:mem:test' source] %n" + Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Row at end point of Change at index 0 (on table : ACTOR and with primary key : [4]) of Changes on tables of 'sa/jdbc:h2:mem:test'] %n" + "Expecting not exist but exists")); } } diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnRowOfChangeExistence_Exists_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnRowOfChangeExistence_Exists_Test.java index f14aad04..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 @@ -26,6 +26,7 @@ * {@link org.assertj.db.api.assertions.AssertOnRowOfChangeExistence#exists()} method. * * @author Régis Pouiller + * @author Julien Roy */ public class AssertOnRowOfChangeExistence_Exists_Test extends AbstractTest { @@ -34,8 +35,8 @@ public class AssertOnRowOfChangeExistence_Exists_Test extends AbstractTest { */ @Test @NeedReload - public void test_exists() throws Exception { - Changes changes = new Changes(source).setStartPointNow(); + public void test_exists() { + Changes changes = assertDbConnection.changes().build().setStartPointNow(); updateChangesForTests(); changes.setEndPointNow(); @@ -49,15 +50,15 @@ public void test_exists() throws Exception { */ @Test @NeedReload - public void should_fail_because_row_does_not_exist() throws Exception { - Changes changes = new Changes(source).setStartPointNow(); + public void should_fail_because_row_does_not_exist() { + Changes changes = assertDbConnection.changes().build().setStartPointNow(); updateChangesForTests(); changes.setEndPointNow(); try { assertThat(changes).change().rowAtStartPoint().exists(); } catch (AssertionError e) { - Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Row at start point of Change at index 0 (on table : ACTOR and with primary key : [4]) of Changes on tables of 'sa/jdbc:h2:mem:test' source] %n" + Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Row at start point of Change at index 0 (on table : ACTOR and with primary key : [4]) of Changes on tables of 'sa/jdbc:h2:mem:test'] %n" + "Expecting exist but do not exist")); } } diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnValueChronology_IsAfterOrEqualTo_DateTimeValue_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnValueChronology_IsAfterOrEqualTo_DateTimeValue_Test.java index d6320924..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 @@ -32,6 +32,7 @@ * {@link org.assertj.db.api.assertions.AssertOnValueChronology#isAfterOrEqualTo(org.assertj.db.type.DateTimeValue)} method. * * @author Régis Pouiller + * @author Julien Roy */ public class AssertOnValueChronology_IsAfterOrEqualTo_DateTimeValue_Test extends AbstractTest { @@ -41,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(source, "test"); - Changes changes = new Changes(table).setStartPointNow(); + Table 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 +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(source, "test"); - Changes changes = new Changes(table).setStartPointNow(); + Table table = assertDbConnection.table("test").build(); + Changes changes = assertDbConnection.changes().tables(table).build().setStartPointNow(); update("update test set var14 = 1 where var1 = 1"); changes.setEndPointNow(); @@ -73,7 +74,7 @@ public void should_fail_because_value_is_before() throws ParseException { DateTimeValue.parse("2014-05-24T09:46:31")); fail("An exception must be raised"); } catch (AssertionError e) { - Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Value at end point of Column at index 9 (column name : VAR10) of Change at index 0 (with primary key : [1]) of Changes on TEST table of 'sa/jdbc:h2:mem:test' source] %n" + Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Value at end point of Column at index 9 (column name : VAR10) of Change at index 0 (with primary key : [1]) of Changes on TEST table of 'sa/jdbc:h2:mem:test'] %n" + "Expecting:%n" + " <2014-05-24T09:46:30.000000000>%n" + "to be after or equal to %n" diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnValueChronology_IsAfterOrEqualTo_DateValue_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnValueChronology_IsAfterOrEqualTo_DateValue_Test.java index 41cb9189..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 @@ -32,6 +32,7 @@ * {@link org.assertj.db.api.assertions.AssertOnValueChronology#isAfterOrEqualTo(org.assertj.db.type.DateValue)} method. * * @author Régis Pouiller + * @author Julien Roy */ public class AssertOnValueChronology_IsAfterOrEqualTo_DateValue_Test extends AbstractTest { @@ -41,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(source, "test"); - Changes changes = new Changes(table).setStartPointNow(); + Table 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 +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(source, "test"); - Changes changes = new Changes(table).setStartPointNow(); + Table table = assertDbConnection.table("test").build(); + Changes changes = assertDbConnection.changes().tables(table).build().setStartPointNow(); update("update test set var14 = 1 where var1 = 1"); changes.setEndPointNow(); @@ -72,7 +73,7 @@ public void should_fail_because_value_is_before() throws ParseException { assertThat(changes).change().column("var10").valueAtEndPoint().isAfterOrEqualTo(DateValue.parse("2014-05-25")); fail("An exception must be raised"); } catch (AssertionError e) { - Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Value at end point of Column at index 9 (column name : VAR10) of Change at index 0 (with primary key : [1]) of Changes on TEST table of 'sa/jdbc:h2:mem:test' source] %n" + Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Value at end point of Column at index 9 (column name : VAR10) of Change at index 0 (with primary key : [1]) of Changes on TEST table of 'sa/jdbc:h2:mem:test'] %n" + "Expecting:%n" + " <2014-05-24T09:46:30.000000000>%n" + "to be after or equal to %n" diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnValueChronology_IsAfterOrEqualTo_LocalDateTime_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnValueChronology_IsAfterOrEqualTo_LocalDateTime_Test.java index c9ccb311..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(source, "test"); - Changes changes = new Changes(table).setStartPointNow(); + Table 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(source, "test"); - Changes changes = new Changes(table).setStartPointNow(); + Table table = assertDbConnection.table("test").build(); + Changes changes = assertDbConnection.changes().tables(table).build().setStartPointNow(); update("update test set var14 = 1 where var1 = 1"); changes.setEndPointNow(); @@ -69,7 +69,7 @@ public void should_fail_because_value_is_before() { assertThat(changes).change().column("var10").valueAtEndPoint().isAfterOrEqualTo(LocalDateTime.of(2014, 5, 24, 9, 46, 31)); fail("An exception must be raised"); } catch (AssertionError e) { - Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Value at end point of Column at index 9 (column name : VAR10) of Change at index 0 (with primary key : [1]) of Changes on TEST table of 'sa/jdbc:h2:mem:test' source] %n" + Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Value at end point of Column at index 9 (column name : VAR10) of Change at index 0 (with primary key : [1]) of Changes on TEST table of 'sa/jdbc:h2:mem:test'] %n" + "Expecting:%n" + " <2014-05-24T09:46:30.000000000>%n" + "to be after or equal to %n" diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnValueChronology_IsAfterOrEqualTo_LocalDate_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnValueChronology_IsAfterOrEqualTo_LocalDate_Test.java index b4068fe9..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(source, "test"); - Changes changes = new Changes(table).setStartPointNow(); + Table 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(source, "test"); - Changes changes = new Changes(table).setStartPointNow(); + Table table = assertDbConnection.table("test").build(); + Changes changes = assertDbConnection.changes().tables(table).build().setStartPointNow(); update("update test set var14 = 1 where var1 = 1"); changes.setEndPointNow(); @@ -69,7 +69,7 @@ public void should_fail_because_value_is_before() { assertThat(changes).change().column("var10").valueAtEndPoint().isAfterOrEqualTo(LocalDate.of(2014, 5, 25)); fail("An exception must be raised"); } catch (AssertionError e) { - Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Value at end point of Column at index 9 (column name : VAR10) of Change at index 0 (with primary key : [1]) of Changes on TEST table of 'sa/jdbc:h2:mem:test' source] %n" + Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Value at end point of Column at index 9 (column name : VAR10) of Change at index 0 (with primary key : [1]) of Changes on TEST table of 'sa/jdbc:h2:mem:test'] %n" + "Expecting:%n" + " <2014-05-24T09:46:30.000000000>%n" + "to be after or equal to %n" diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnValueChronology_IsAfterOrEqualTo_LocalTime_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnValueChronology_IsAfterOrEqualTo_LocalTime_Test.java index 9e27a4fe..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(source, "test"); - Changes changes = new Changes(table).setStartPointNow(); + Table 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(source, "test"); - Changes changes = new Changes(table).setStartPointNow(); + Table table = assertDbConnection.table("test").build(); + Changes changes = assertDbConnection.changes().tables(table).build().setStartPointNow(); update("update test set var14 = 1 where var1 = 1"); changes.setEndPointNow(); @@ -69,7 +69,7 @@ public void should_fail_because_value_is_before() { assertThat(changes).change().column("var8").valueAtEndPoint().isAfterOrEqualTo(LocalTime.of(9, 46, 31)); fail("An exception must be raised"); } catch (AssertionError e) { - Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Value at end point of Column at index 7 (column name : VAR8) of Change at index 0 (with primary key : [1]) of Changes on TEST table of 'sa/jdbc:h2:mem:test' source] %n" + Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Value at end point of Column at index 7 (column name : VAR8) of Change at index 0 (with primary key : [1]) of Changes on TEST table of 'sa/jdbc:h2:mem:test'] %n" + "Expecting:%n" + " <09:46:30.000000000>%n" + "to be after or equal to %n" diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnValueChronology_IsAfterOrEqualTo_String_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnValueChronology_IsAfterOrEqualTo_String_Test.java index 508ebe6c..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 @@ -29,6 +29,7 @@ * {@link org.assertj.db.api.assertions.AssertOnValueChronology#isAfterOrEqualTo(org.assertj.db.type.DateTimeValue)} method. * * @author Régis Pouiller + * @author Julien Roy */ public class AssertOnValueChronology_IsAfterOrEqualTo_String_Test extends AbstractTest { @@ -38,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(source, "test"); - Changes changes = new Changes(table).setStartPointNow(); + Table table = assertDbConnection.table("test").build(); + Changes changes = assertDbConnection.changes().tables(table).build().setStartPointNow(); update("update test set var14 = 1 where var1 = 1"); changes.setEndPointNow(); @@ -58,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(source, "test"); - Changes changes = new Changes(table).setStartPointNow(); + Table table = assertDbConnection.table("test").build(); + Changes changes = assertDbConnection.changes().tables(table).build().setStartPointNow(); update("update test set var14 = 1 where var1 = 1"); changes.setEndPointNow(); @@ -67,7 +68,7 @@ public void should_fail_because_value_is_before() { assertThat(changes).change().column("var10").valueAtEndPoint().isAfterOrEqualTo("2014-05-25"); fail("An exception must be raised"); } catch (AssertionError e) { - Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Value at end point of Column at index 9 (column name : VAR10) of Change at index 0 (with primary key : [1]) of Changes on TEST table of 'sa/jdbc:h2:mem:test' source] %n" + Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Value at end point of Column at index 9 (column name : VAR10) of Change at index 0 (with primary key : [1]) of Changes on TEST table of 'sa/jdbc:h2:mem:test'] %n" + "Expecting:%n" + " <2014-05-24T09:46:30.000000000>%n" + "to be after or equal to %n" diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnValueChronology_IsAfterOrEqualTo_TimeValue_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnValueChronology_IsAfterOrEqualTo_TimeValue_Test.java index 9c754458..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 @@ -32,6 +32,7 @@ * {@link org.assertj.db.api.assertions.AssertOnValueChronology#isAfterOrEqualTo(org.assertj.db.type.TimeValue)} method. * * @author Régis Pouiller + * @author Julien Roy */ public class AssertOnValueChronology_IsAfterOrEqualTo_TimeValue_Test extends AbstractTest { @@ -41,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(source, "test"); - Changes changes = new Changes(table).setStartPointNow(); + Table 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 +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(source, "test"); - Changes changes = new Changes(table).setStartPointNow(); + Table table = assertDbConnection.table("test").build(); + Changes changes = assertDbConnection.changes().tables(table).build().setStartPointNow(); update("update test set var14 = 1 where var1 = 1"); changes.setEndPointNow(); @@ -72,7 +73,7 @@ public void should_fail_because_value_is_before() throws ParseException { assertThat(changes).change().column("var8").valueAtEndPoint().isAfterOrEqualTo(TimeValue.parse("09:46:31")); fail("An exception must be raised"); } catch (AssertionError e) { - Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Value at end point of Column at index 7 (column name : VAR8) of Change at index 0 (with primary key : [1]) of Changes on TEST table of 'sa/jdbc:h2:mem:test' source] %n" + Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Value at end point of Column at index 7 (column name : VAR8) of Change at index 0 (with primary key : [1]) of Changes on TEST table of 'sa/jdbc:h2:mem:test'] %n" + "Expecting:%n" + " <09:46:30.000000000>%n" + "to be after or equal to %n" diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnValueChronology_IsAfter_DateTimeValue_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnValueChronology_IsAfter_DateTimeValue_Test.java index fc7dc21b..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 @@ -32,6 +32,7 @@ * {@link org.assertj.db.api.assertions.AssertOnValueChronology#isAfter(org.assertj.db.type.DateTimeValue)} method. * * @author Régis Pouiller + * @author Julien Roy */ public class AssertOnValueChronology_IsAfter_DateTimeValue_Test extends AbstractTest { @@ -41,8 +42,8 @@ public class AssertOnValueChronology_IsAfter_DateTimeValue_Test extends Abstract @Test @NeedReload public void test_is_after() throws ParseException { - Table table = new Table(source, "test"); - Changes changes = new Changes(table).setStartPointNow(); + Table 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 +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(source, "test"); - Changes changes = new Changes(table).setStartPointNow(); + Table table = assertDbConnection.table("test").build(); + Changes changes = assertDbConnection.changes().tables(table).build().setStartPointNow(); update("update test set var14 = 1 where var1 = 1"); changes.setEndPointNow(); @@ -70,7 +71,7 @@ public void should_fail_because_value_is_before_or_equal_to() throws ParseExcept assertThat(changes).change().column("var10").valueAtEndPoint().isAfter(DateTimeValue.parse("2014-05-24T09:46:30")); fail("An exception must be raised"); } catch (AssertionError e) { - Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Value at end point of Column at index 9 (column name : VAR10) of Change at index 0 (with primary key : [1]) of Changes on TEST table of 'sa/jdbc:h2:mem:test' source] %n" + Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Value at end point of Column at index 9 (column name : VAR10) of Change at index 0 (with primary key : [1]) of Changes on TEST table of 'sa/jdbc:h2:mem:test'] %n" + "Expecting:%n" + " <2014-05-24T09:46:30.000000000>%n" + "to be after %n" diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnValueChronology_IsAfter_DateValue_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnValueChronology_IsAfter_DateValue_Test.java index f7e3d1ba..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 @@ -32,6 +32,7 @@ * {@link org.assertj.db.api.assertions.AssertOnValueChronology#isAfter(org.assertj.db.type.DateValue)} method. * * @author Régis Pouiller + * @author Julien Roy */ public class AssertOnValueChronology_IsAfter_DateValue_Test extends AbstractTest { @@ -41,8 +42,8 @@ public class AssertOnValueChronology_IsAfter_DateValue_Test extends AbstractTest @Test @NeedReload public void test_is_after() throws ParseException { - Table table = new Table(source, "test"); - Changes changes = new Changes(table).setStartPointNow(); + Table 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 +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(source, "test"); - Changes changes = new Changes(table).setStartPointNow(); + Table table = assertDbConnection.table("test").build(); + Changes changes = assertDbConnection.changes().tables(table).build().setStartPointNow(); update("update test set var14 = 1 where var1 = 1"); changes.setEndPointNow(); @@ -71,7 +72,7 @@ public void should_fail_because_value_is_before_or_equal_to() throws ParseExcept assertThat(changes).change().column("var10").valueAtEndPoint().isAfter(DateValue.parse("2014-05-25")); fail("An exception must be raised"); } catch (AssertionError e) { - Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Value at end point of Column at index 9 (column name : VAR10) of Change at index 0 (with primary key : [1]) of Changes on TEST table of 'sa/jdbc:h2:mem:test' source] %n" + Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Value at end point of Column at index 9 (column name : VAR10) of Change at index 0 (with primary key : [1]) of Changes on TEST table of 'sa/jdbc:h2:mem:test'] %n" + "Expecting:%n" + " <2014-05-24T09:46:30.000000000>%n" + "to be after %n" diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnValueChronology_IsAfter_LocalDateTime_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnValueChronology_IsAfter_LocalDateTime_Test.java index 1d73a65d..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(source, "test"); - Changes changes = new Changes(table).setStartPointNow(); + Table 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(source, "test"); - Changes changes = new Changes(table).setStartPointNow(); + Table table = assertDbConnection.table("test").build(); + Changes changes = assertDbConnection.changes().tables(table).build().setStartPointNow(); update("update test set var14 = 1 where var1 = 1"); changes.setEndPointNow(); @@ -69,7 +69,7 @@ public void should_fail_because_value_is_before_or_equal_to() { assertThat(changes).change().column("var10").valueAtEndPoint().isAfter(LocalDateTime.of(2014, 5, 24, 9, 46, 30)); fail("An exception must be raised"); } catch (AssertionError e) { - Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Value at end point of Column at index 9 (column name : VAR10) of Change at index 0 (with primary key : [1]) of Changes on TEST table of 'sa/jdbc:h2:mem:test' source] %n" + Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Value at end point of Column at index 9 (column name : VAR10) of Change at index 0 (with primary key : [1]) of Changes on TEST table of 'sa/jdbc:h2:mem:test'] %n" + "Expecting:%n" + " <2014-05-24T09:46:30.000000000>%n" + "to be after %n" diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnValueChronology_IsAfter_LocalDate_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnValueChronology_IsAfter_LocalDate_Test.java index 09e9a9f3..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(source, "test"); - Changes changes = new Changes(table).setStartPointNow(); + Table 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(source, "test"); - Changes changes = new Changes(table).setStartPointNow(); + Table table = assertDbConnection.table("test").build(); + Changes changes = assertDbConnection.changes().tables(table).build().setStartPointNow(); update("update test set var14 = 1 where var1 = 1"); changes.setEndPointNow(); @@ -69,7 +69,7 @@ public void should_fail_because_value_is_before_or_equal_to() { assertThat(changes).change().column("var10").valueAtEndPoint().isAfter(LocalDate.of(2014, 5, 25)); fail("An exception must be raised"); } catch (AssertionError e) { - Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Value at end point of Column at index 9 (column name : VAR10) of Change at index 0 (with primary key : [1]) of Changes on TEST table of 'sa/jdbc:h2:mem:test' source] %n" + Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Value at end point of Column at index 9 (column name : VAR10) of Change at index 0 (with primary key : [1]) of Changes on TEST table of 'sa/jdbc:h2:mem:test'] %n" + "Expecting:%n" + " <2014-05-24T09:46:30.000000000>%n" + "to be after %n" diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnValueChronology_IsAfter_LocalTime_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnValueChronology_IsAfter_LocalTime_Test.java index 54f60a52..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(source, "test"); - Changes changes = new Changes(table).setStartPointNow(); + Table 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(source, "test"); - Changes changes = new Changes(table).setStartPointNow(); + Table table = assertDbConnection.table("test").build(); + Changes changes = assertDbConnection.changes().tables(table).build().setStartPointNow(); update("update test set var14 = 1 where var1 = 1"); changes.setEndPointNow(); @@ -69,7 +69,7 @@ public void should_fail_because_value_is_before_or_equal_to() { assertThat(changes).change().column("var8").valueAtEndPoint().isAfter(LocalTime.of(9, 46, 30)); fail("An exception must be raised"); } catch (AssertionError e) { - Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Value at end point of Column at index 7 (column name : VAR8) of Change at index 0 (with primary key : [1]) of Changes on TEST table of 'sa/jdbc:h2:mem:test' source] %n" + Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Value at end point of Column at index 7 (column name : VAR8) of Change at index 0 (with primary key : [1]) of Changes on TEST table of 'sa/jdbc:h2:mem:test'] %n" + "Expecting:%n" + " <09:46:30.000000000>%n" + "to be after %n" diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnValueChronology_IsAfter_String_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnValueChronology_IsAfter_String_Test.java index 7160cb78..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 @@ -29,6 +29,7 @@ * {@link org.assertj.db.api.assertions.AssertOnValueChronology#isAfter(org.assertj.db.type.DateTimeValue)} method. * * @author Régis Pouiller + * @author Julien Roy */ public class AssertOnValueChronology_IsAfter_String_Test extends AbstractTest { @@ -38,8 +39,8 @@ public class AssertOnValueChronology_IsAfter_String_Test extends AbstractTest { @Test @NeedReload public void test_is_after() { - Table table = new Table(source, "test"); - Changes changes = new Changes(table).setStartPointNow(); + Table table = assertDbConnection.table("test").build(); + Changes changes = assertDbConnection.changes().tables(table).build().setStartPointNow(); update("update test set var14 = 1 where var1 = 1"); changes.setEndPointNow(); @@ -58,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(source, "test"); - Changes changes = new Changes(table).setStartPointNow(); + Table table = assertDbConnection.table("test").build(); + Changes changes = assertDbConnection.changes().tables(table).build().setStartPointNow(); update("update test set var14 = 1 where var1 = 1"); changes.setEndPointNow(); @@ -67,7 +68,7 @@ public void should_fail_because_value_is_before_or_equal_to() { assertThat(changes).change().column("var10").valueAtEndPoint().isAfter("2014-05-25"); fail("An exception must be raised"); } catch (AssertionError e) { - Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Value at end point of Column at index 9 (column name : VAR10) of Change at index 0 (with primary key : [1]) of Changes on TEST table of 'sa/jdbc:h2:mem:test' source] %n" + Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Value at end point of Column at index 9 (column name : VAR10) of Change at index 0 (with primary key : [1]) of Changes on TEST table of 'sa/jdbc:h2:mem:test'] %n" + "Expecting:%n" + " <2014-05-24T09:46:30.000000000>%n" + "to be after %n" diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnValueChronology_IsAfter_TimeValue_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnValueChronology_IsAfter_TimeValue_Test.java index aa3498fe..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 @@ -32,6 +32,7 @@ * {@link org.assertj.db.api.assertions.AssertOnValueChronology#isAfter(org.assertj.db.type.TimeValue)} method. * * @author Régis Pouiller + * @author Julien Roy */ public class AssertOnValueChronology_IsAfter_TimeValue_Test extends AbstractTest { @@ -41,8 +42,8 @@ public class AssertOnValueChronology_IsAfter_TimeValue_Test extends AbstractTest @Test @NeedReload public void test_is_after() throws ParseException { - Table table = new Table(source, "test"); - Changes changes = new Changes(table).setStartPointNow(); + Table 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 +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(source, "test"); - Changes changes = new Changes(table).setStartPointNow(); + Table table = assertDbConnection.table("test").build(); + Changes changes = assertDbConnection.changes().tables(table).build().setStartPointNow(); update("update test set var14 = 1 where var1 = 1"); changes.setEndPointNow(); @@ -70,7 +71,7 @@ public void should_fail_because_value_is_before_or_equal_to() throws ParseExcept assertThat(changes).change().column("var8").valueAtEndPoint().isAfter(TimeValue.parse("09:46:30")); fail("An exception must be raised"); } catch (AssertionError e) { - Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Value at end point of Column at index 7 (column name : VAR8) of Change at index 0 (with primary key : [1]) of Changes on TEST table of 'sa/jdbc:h2:mem:test' source] %n" + Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Value at end point of Column at index 7 (column name : VAR8) of Change at index 0 (with primary key : [1]) of Changes on TEST table of 'sa/jdbc:h2:mem:test'] %n" + "Expecting:%n" + " <09:46:30.000000000>%n" + "to be after %n" diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnValueChronology_IsBeforeOrEqualTo_DateTimeValue_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnValueChronology_IsBeforeOrEqualTo_DateTimeValue_Test.java index a2751337..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 @@ -32,6 +32,7 @@ * {@link org.assertj.db.api.assertions.AssertOnValueChronology#isBeforeOrEqualTo(org.assertj.db.type.DateTimeValue)} method. * * @author Régis Pouiller + * @author Julien Roy */ public class AssertOnValueChronology_IsBeforeOrEqualTo_DateTimeValue_Test extends AbstractTest { @@ -41,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(source, "test"); - Changes changes = new Changes(table).setStartPointNow(); + Table 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 +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(source, "test"); - Changes changes = new Changes(table).setStartPointNow(); + Table table = assertDbConnection.table("test").build(); + Changes changes = assertDbConnection.changes().tables(table).build().setStartPointNow(); update("update test set var14 = 1 where var1 = 1"); changes.setEndPointNow(); @@ -71,7 +72,7 @@ public void should_fail_because_value_is_after() throws ParseException { assertThat(changes).change().column("var10").valueAtEndPoint().isBeforeOrEqualTo(DateTimeValue.parse("2014-05-24T09:46:29")); fail("An exception must be raised"); } catch (AssertionError e) { - Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Value at end point of Column at index 9 (column name : VAR10) of Change at index 0 (with primary key : [1]) of Changes on TEST table of 'sa/jdbc:h2:mem:test' source] %n" + Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Value at end point of Column at index 9 (column name : VAR10) of Change at index 0 (with primary key : [1]) of Changes on TEST table of 'sa/jdbc:h2:mem:test'] %n" + "Expecting:%n" + " <2014-05-24T09:46:30.000000000>%n" + "to be before or equal to %n" diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnValueChronology_IsBeforeOrEqualTo_DateValue_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnValueChronology_IsBeforeOrEqualTo_DateValue_Test.java index aedf5558..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 @@ -32,6 +32,7 @@ * {@link org.assertj.db.api.assertions.AssertOnValueChronology#isBeforeOrEqualTo(org.assertj.db.type.DateValue)} method. * * @author Régis Pouiller + * @author Julien Roy */ public class AssertOnValueChronology_IsBeforeOrEqualTo_DateValue_Test extends AbstractTest { @@ -41,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(source, "test"); - Changes changes = new Changes(table).setStartPointNow(); + Table 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 +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(source, "test"); - Changes changes = new Changes(table).setStartPointNow(); + Table table = assertDbConnection.table("test").build(); + Changes changes = assertDbConnection.changes().tables(table).build().setStartPointNow(); update("update test set var14 = 1 where var1 = 1"); changes.setEndPointNow(); @@ -72,7 +73,7 @@ public void should_fail_because_value_is_after() throws ParseException { assertThat(changes).change().column("var10").valueAtEndPoint().isBeforeOrEqualTo(DateValue.parse("2014-05-24")); fail("An exception must be raised"); } catch (AssertionError e) { - Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Value at end point of Column at index 9 (column name : VAR10) of Change at index 0 (with primary key : [1]) of Changes on TEST table of 'sa/jdbc:h2:mem:test' source] %n" + Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Value at end point of Column at index 9 (column name : VAR10) of Change at index 0 (with primary key : [1]) of Changes on TEST table of 'sa/jdbc:h2:mem:test'] %n" + "Expecting:%n" + " <2014-05-24T09:46:30.000000000>%n" + "to be before or equal to %n" diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnValueChronology_IsBeforeOrEqualTo_LocalDateTime_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnValueChronology_IsBeforeOrEqualTo_LocalDateTime_Test.java index 271d1783..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(source, "test"); - Changes changes = new Changes(table).setStartPointNow(); + Table 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(source, "test"); - Changes changes = new Changes(table).setStartPointNow(); + Table table = assertDbConnection.table("test").build(); + Changes changes = assertDbConnection.changes().tables(table).build().setStartPointNow(); update("update test set var14 = 1 where var1 = 1"); changes.setEndPointNow(); @@ -69,7 +69,7 @@ public void should_fail_because_value_is_after() { assertThat(changes).change().column("var10").valueAtEndPoint().isBeforeOrEqualTo(LocalDateTime.of(2014, 5, 24, 9, 46, 29)); fail("An exception must be raised"); } catch (AssertionError e) { - Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Value at end point of Column at index 9 (column name : VAR10) of Change at index 0 (with primary key : [1]) of Changes on TEST table of 'sa/jdbc:h2:mem:test' source] %n" + Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Value at end point of Column at index 9 (column name : VAR10) of Change at index 0 (with primary key : [1]) of Changes on TEST table of 'sa/jdbc:h2:mem:test'] %n" + "Expecting:%n" + " <2014-05-24T09:46:30.000000000>%n" + "to be before or equal to %n" diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnValueChronology_IsBeforeOrEqualTo_LocalDate_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnValueChronology_IsBeforeOrEqualTo_LocalDate_Test.java index fe45307f..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(source, "test"); - Changes changes = new Changes(table).setStartPointNow(); + Table 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(source, "test"); - Changes changes = new Changes(table).setStartPointNow(); + Table table = assertDbConnection.table("test").build(); + Changes changes = assertDbConnection.changes().tables(table).build().setStartPointNow(); update("update test set var14 = 1 where var1 = 1"); changes.setEndPointNow(); @@ -69,7 +69,7 @@ public void should_fail_because_value_is_after() { assertThat(changes).change().column("var10").valueAtEndPoint().isBeforeOrEqualTo(LocalDate.of(2014, 5, 24)); fail("An exception must be raised"); } catch (AssertionError e) { - Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Value at end point of Column at index 9 (column name : VAR10) of Change at index 0 (with primary key : [1]) of Changes on TEST table of 'sa/jdbc:h2:mem:test' source] %n" + Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Value at end point of Column at index 9 (column name : VAR10) of Change at index 0 (with primary key : [1]) of Changes on TEST table of 'sa/jdbc:h2:mem:test'] %n" + "Expecting:%n" + " <2014-05-24T09:46:30.000000000>%n" + "to be before or equal to %n" diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnValueChronology_IsBeforeOrEqualTo_LocalTime_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnValueChronology_IsBeforeOrEqualTo_LocalTime_Test.java index 3b5f9e22..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(source, "test"); - Changes changes = new Changes(table).setStartPointNow(); + Table 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(source, "test"); - Changes changes = new Changes(table).setStartPointNow(); + Table table = assertDbConnection.table("test").build(); + Changes changes = assertDbConnection.changes().tables(table).build().setStartPointNow(); update("update test set var14 = 1 where var1 = 1"); changes.setEndPointNow(); @@ -69,7 +69,7 @@ public void should_fail_because_value_is_after() { assertThat(changes).change().column("var8").valueAtEndPoint().isBeforeOrEqualTo(LocalTime.of(9, 46, 29)); fail("An exception must be raised"); } catch (AssertionError e) { - Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Value at end point of Column at index 7 (column name : VAR8) of Change at index 0 (with primary key : [1]) of Changes on TEST table of 'sa/jdbc:h2:mem:test' source] %n" + Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Value at end point of Column at index 7 (column name : VAR8) of Change at index 0 (with primary key : [1]) of Changes on TEST table of 'sa/jdbc:h2:mem:test'] %n" + "Expecting:%n" + " <09:46:30.000000000>%n" + "to be before or equal to %n" diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnValueChronology_IsBeforeOrEqualTo_String_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnValueChronology_IsBeforeOrEqualTo_String_Test.java index c8492dc6..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 @@ -29,6 +29,7 @@ * {@link org.assertj.db.api.assertions.AssertOnValueChronology#isBeforeOrEqualTo(org.assertj.db.type.DateTimeValue)} method. * * @author Régis Pouiller + * @author Julien Roy */ public class AssertOnValueChronology_IsBeforeOrEqualTo_String_Test extends AbstractTest { @@ -38,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(source, "test"); - Changes changes = new Changes(table).setStartPointNow(); + Table table = assertDbConnection.table("test").build(); + Changes changes = assertDbConnection.changes().tables(table).build().setStartPointNow(); update("update test set var14 = 1 where var1 = 1"); changes.setEndPointNow(); @@ -58,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(source, "test"); - Changes changes = new Changes(table).setStartPointNow(); + Table table = assertDbConnection.table("test").build(); + Changes changes = assertDbConnection.changes().tables(table).build().setStartPointNow(); update("update test set var14 = 1 where var1 = 1"); changes.setEndPointNow(); @@ -67,7 +68,7 @@ public void should_fail_because_value_is_after() { assertThat(changes).change().column("var10").valueAtEndPoint().isBeforeOrEqualTo("2014-05-24"); fail("An exception must be raised"); } catch (AssertionError e) { - Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Value at end point of Column at index 9 (column name : VAR10) of Change at index 0 (with primary key : [1]) of Changes on TEST table of 'sa/jdbc:h2:mem:test' source] %n" + Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Value at end point of Column at index 9 (column name : VAR10) of Change at index 0 (with primary key : [1]) of Changes on TEST table of 'sa/jdbc:h2:mem:test'] %n" + "Expecting:%n" + " <2014-05-24T09:46:30.000000000>%n" + "to be before or equal to %n" diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnValueChronology_IsBeforeOrEqualTo_TimeValue_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnValueChronology_IsBeforeOrEqualTo_TimeValue_Test.java index 1d3e2d44..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 @@ -32,6 +32,7 @@ * {@link org.assertj.db.api.assertions.AssertOnValueChronology#isBeforeOrEqualTo(org.assertj.db.type.TimeValue)} method. * * @author Régis Pouiller + * @author Julien Roy */ public class AssertOnValueChronology_IsBeforeOrEqualTo_TimeValue_Test extends AbstractTest { @@ -41,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(source, "test"); - Changes changes = new Changes(table).setStartPointNow(); + Table 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 +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(source, "test"); - Changes changes = new Changes(table).setStartPointNow(); + Table table = assertDbConnection.table("test").build(); + Changes changes = assertDbConnection.changes().tables(table).build().setStartPointNow(); update("update test set var14 = 1 where var1 = 1"); changes.setEndPointNow(); @@ -72,7 +73,7 @@ public void should_fail_because_value_is_after() throws ParseException { assertThat(changes).change().column("var8").valueAtEndPoint().isBeforeOrEqualTo(TimeValue.parse("09:46:29")); fail("An exception must be raised"); } catch (AssertionError e) { - Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Value at end point of Column at index 7 (column name : VAR8) of Change at index 0 (with primary key : [1]) of Changes on TEST table of 'sa/jdbc:h2:mem:test' source] %n" + Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Value at end point of Column at index 7 (column name : VAR8) of Change at index 0 (with primary key : [1]) of Changes on TEST table of 'sa/jdbc:h2:mem:test'] %n" + "Expecting:%n" + " <09:46:30.000000000>%n" + "to be before or equal to %n" diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnValueChronology_IsBefore_DateTimeValue_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnValueChronology_IsBefore_DateTimeValue_Test.java index 840d67a3..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 @@ -32,6 +32,7 @@ * {@link org.assertj.db.api.assertions.AssertOnValueChronology#isBefore(org.assertj.db.type.DateTimeValue)} method. * * @author Régis Pouiller + * @author Julien Roy */ public class AssertOnValueChronology_IsBefore_DateTimeValue_Test extends AbstractTest { @@ -41,8 +42,8 @@ public class AssertOnValueChronology_IsBefore_DateTimeValue_Test extends Abstrac @Test @NeedReload public void test_is_before() throws ParseException { - Table table = new Table(source, "test"); - Changes changes = new Changes(table).setStartPointNow(); + Table 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 +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(source, "test"); - Changes changes = new Changes(table).setStartPointNow(); + Table table = assertDbConnection.table("test").build(); + Changes changes = assertDbConnection.changes().tables(table).build().setStartPointNow(); update("update test set var14 = 1 where var1 = 1"); changes.setEndPointNow(); @@ -73,7 +74,7 @@ public void should_fail_because_value_is_after_or_equal_to() throws ParseExcepti DateTimeValue.parse("2014-05-24T09:46:30")); fail("An exception must be raised"); } catch (AssertionError e) { - Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Value at end point of Column at index 9 (column name : VAR10) of Change at index 0 (with primary key : [1]) of Changes on TEST table of 'sa/jdbc:h2:mem:test' source] %n" + Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Value at end point of Column at index 9 (column name : VAR10) of Change at index 0 (with primary key : [1]) of Changes on TEST table of 'sa/jdbc:h2:mem:test'] %n" + "Expecting:%n" + " <2014-05-24T09:46:30.000000000>%n" + "to be before %n" diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnValueChronology_IsBefore_DateValue_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnValueChronology_IsBefore_DateValue_Test.java index 57812d72..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 @@ -32,6 +32,7 @@ * {@link org.assertj.db.api.assertions.AssertOnValueChronology#isBefore(org.assertj.db.type.DateValue)} method. * * @author Régis Pouiller + * @author Julien Roy */ public class AssertOnValueChronology_IsBefore_DateValue_Test extends AbstractTest { @@ -41,8 +42,8 @@ public class AssertOnValueChronology_IsBefore_DateValue_Test extends AbstractTes @Test @NeedReload public void test_is_before() throws ParseException { - Table table = new Table(source, "test"); - Changes changes = new Changes(table).setStartPointNow(); + Table 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 +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(source, "test"); - Changes changes = new Changes(table).setStartPointNow(); + Table table = assertDbConnection.table("test").build(); + Changes changes = assertDbConnection.changes().tables(table).build().setStartPointNow(); update("update test set var14 = 1 where var1 = 1"); changes.setEndPointNow(); @@ -71,7 +72,7 @@ public void should_fail_because_value_is_after_or_equal_to() throws ParseExcepti assertThat(changes).change().column("var10").valueAtEndPoint().isBefore(DateValue.parse("2014-05-24")); fail("An exception must be raised"); } catch (AssertionError e) { - Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Value at end point of Column at index 9 (column name : VAR10) of Change at index 0 (with primary key : [1]) of Changes on TEST table of 'sa/jdbc:h2:mem:test' source] %n" + Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Value at end point of Column at index 9 (column name : VAR10) of Change at index 0 (with primary key : [1]) of Changes on TEST table of 'sa/jdbc:h2:mem:test'] %n" + "Expecting:%n" + " <2014-05-24T09:46:30.000000000>%n" + "to be before %n" diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnValueChronology_IsBefore_LocalDateTime_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnValueChronology_IsBefore_LocalDateTime_Test.java index ee80bc61..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(source, "test"); - Changes changes = new Changes(table).setStartPointNow(); + Table 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(source, "test"); - Changes changes = new Changes(table).setStartPointNow(); + Table table = assertDbConnection.table("test").build(); + Changes changes = assertDbConnection.changes().tables(table).build().setStartPointNow(); update("update test set var14 = 1 where var1 = 1"); changes.setEndPointNow(); @@ -69,7 +69,7 @@ public void should_fail_because_value_is_after_or_equal_to() { assertThat(changes).change().column("var10").valueAtEndPoint().isBefore(LocalDateTime.of(2014, 5, 24, 9, 46, 30)); fail("An exception must be raised"); } catch (AssertionError e) { - Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Value at end point of Column at index 9 (column name : VAR10) of Change at index 0 (with primary key : [1]) of Changes on TEST table of 'sa/jdbc:h2:mem:test' source] %n" + Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Value at end point of Column at index 9 (column name : VAR10) of Change at index 0 (with primary key : [1]) of Changes on TEST table of 'sa/jdbc:h2:mem:test'] %n" + "Expecting:%n" + " <2014-05-24T09:46:30.000000000>%n" + "to be before %n" diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnValueChronology_IsBefore_LocalDate_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnValueChronology_IsBefore_LocalDate_Test.java index fcc5fd82..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(source, "test"); - Changes changes = new Changes(table).setStartPointNow(); + Table 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(source, "test"); - Changes changes = new Changes(table).setStartPointNow(); + Table table = assertDbConnection.table("test").build(); + Changes changes = assertDbConnection.changes().tables(table).build().setStartPointNow(); update("update test set var14 = 1 where var1 = 1"); changes.setEndPointNow(); @@ -69,7 +69,7 @@ public void should_fail_because_value_is_after_or_equal_to() { assertThat(changes).change().column("var10").valueAtEndPoint().isBefore(LocalDate.of(2014, 5, 24)); fail("An exception must be raised"); } catch (AssertionError e) { - Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Value at end point of Column at index 9 (column name : VAR10) of Change at index 0 (with primary key : [1]) of Changes on TEST table of 'sa/jdbc:h2:mem:test' source] %n" + Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Value at end point of Column at index 9 (column name : VAR10) of Change at index 0 (with primary key : [1]) of Changes on TEST table of 'sa/jdbc:h2:mem:test'] %n" + "Expecting:%n" + " <2014-05-24T09:46:30.000000000>%n" + "to be before %n" diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnValueChronology_IsBefore_LocalTime_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnValueChronology_IsBefore_LocalTime_Test.java index 5f4bfa40..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(source, "test"); - Changes changes = new Changes(table).setStartPointNow(); + Table 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(source, "test"); - Changes changes = new Changes(table).setStartPointNow(); + Table table = assertDbConnection.table("test").build(); + Changes changes = assertDbConnection.changes().tables(table).build().setStartPointNow(); update("update test set var14 = 1 where var1 = 1"); changes.setEndPointNow(); @@ -69,7 +69,7 @@ public void should_fail_because_value_is_after_or_equal_to() { assertThat(changes).change().column("var8").valueAtEndPoint().isBefore(LocalTime.of(9, 46, 30)); fail("An exception must be raised"); } catch (AssertionError e) { - Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Value at end point of Column at index 7 (column name : VAR8) of Change at index 0 (with primary key : [1]) of Changes on TEST table of 'sa/jdbc:h2:mem:test' source] %n" + Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Value at end point of Column at index 7 (column name : VAR8) of Change at index 0 (with primary key : [1]) of Changes on TEST table of 'sa/jdbc:h2:mem:test'] %n" + "Expecting:%n" + " <09:46:30.000000000>%n" + "to be before %n" diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnValueChronology_IsBefore_String_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnValueChronology_IsBefore_String_Test.java index 70e34457..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 @@ -29,6 +29,7 @@ * {@link org.assertj.db.api.assertions.AssertOnValueChronology#isBefore(org.assertj.db.type.DateTimeValue)} method. * * @author Régis Pouiller + * @author Julien Roy */ public class AssertOnValueChronology_IsBefore_String_Test extends AbstractTest { @@ -38,8 +39,8 @@ public class AssertOnValueChronology_IsBefore_String_Test extends AbstractTest { @Test @NeedReload public void test_is_before() { - Table table = new Table(source, "test"); - Changes changes = new Changes(table).setStartPointNow(); + Table table = assertDbConnection.table("test").build(); + Changes changes = assertDbConnection.changes().tables(table).build().setStartPointNow(); update("update test set var14 = 1 where var1 = 1"); changes.setEndPointNow(); @@ -58,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(source, "test"); - Changes changes = new Changes(table).setStartPointNow(); + Table table = assertDbConnection.table("test").build(); + Changes changes = assertDbConnection.changes().tables(table).build().setStartPointNow(); update("update test set var14 = 1 where var1 = 1"); changes.setEndPointNow(); @@ -67,7 +68,7 @@ public void should_fail_because_value_is_after_or_equal_to() { assertThat(changes).change().column("var10").valueAtEndPoint().isBefore("2014-05-24"); fail("An exception must be raised"); } catch (AssertionError e) { - Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Value at end point of Column at index 9 (column name : VAR10) of Change at index 0 (with primary key : [1]) of Changes on TEST table of 'sa/jdbc:h2:mem:test' source] %n" + Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Value at end point of Column at index 9 (column name : VAR10) of Change at index 0 (with primary key : [1]) of Changes on TEST table of 'sa/jdbc:h2:mem:test'] %n" + "Expecting:%n" + " <2014-05-24T09:46:30.000000000>%n" + "to be before %n" diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnValueChronology_IsBefore_TimeValue_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnValueChronology_IsBefore_TimeValue_Test.java index 1a00d7d5..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 @@ -32,6 +32,7 @@ * {@link org.assertj.db.api.assertions.AssertOnValueChronology#isBefore(org.assertj.db.type.TimeValue)} method. * * @author Régis Pouiller + * @author Julien Roy */ public class AssertOnValueChronology_IsBefore_TimeValue_Test extends AbstractTest { @@ -41,8 +42,8 @@ public class AssertOnValueChronology_IsBefore_TimeValue_Test extends AbstractTes @Test @NeedReload public void test_is_before() throws ParseException { - Table table = new Table(source, "test"); - Changes changes = new Changes(table).setStartPointNow(); + Table 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 +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(source, "test"); - Changes changes = new Changes(table).setStartPointNow(); + Table table = assertDbConnection.table("test").build(); + Changes changes = assertDbConnection.changes().tables(table).build().setStartPointNow(); update("update test set var14 = 1 where var1 = 1"); changes.setEndPointNow(); @@ -70,7 +71,7 @@ public void should_fail_because_value_is_after_or_equal_to() throws ParseExcepti assertThat(changes).change().column("var8").valueAtEndPoint().isBefore(TimeValue.parse("09:46:30")); fail("An exception must be raised"); } catch (AssertionError e) { - Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Value at end point of Column at index 7 (column name : VAR8) of Change at index 0 (with primary key : [1]) of Changes on TEST table of 'sa/jdbc:h2:mem:test' source] %n" + Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Value at end point of Column at index 7 (column name : VAR8) of Change at index 0 (with primary key : [1]) of Changes on TEST table of 'sa/jdbc:h2:mem:test'] %n" + "Expecting:%n" + " <09:46:30.000000000>%n" + "to be before %n" diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnValueClass_IsOfClass_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnValueClass_IsOfClass_Test.java index f5d61c90..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 @@ -29,6 +29,7 @@ * {@link org.assertj.db.api.assertions.AssertOnValueClass#isOfClass(Class)} method. * * @author Régis Pouiller + * @author Julien Roy */ public class AssertOnValueClass_IsOfClass_Test extends AbstractTest { @@ -38,8 +39,8 @@ public class AssertOnValueClass_IsOfClass_Test extends AbstractTest { @Test @NeedReload public void test_is_of_type() { - Table table = new Table(source, "test"); - Changes changes = new Changes(table).setStartPointNow(); + Table table = assertDbConnection.table("test").build(); + Changes changes = assertDbConnection.changes().tables(table).build().setStartPointNow(); update("update test set var14 = 1 where var1 = 1"); changes.setEndPointNow(); @@ -58,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(source, "test"); - Changes changes = new Changes(table).setStartPointNow(); + Table table = assertDbConnection.table("test").build(); + Changes changes = assertDbConnection.changes().tables(table).build().setStartPointNow(); update("update test set var14 = 1 where var1 = 1"); changes.setEndPointNow(); @@ -67,7 +68,7 @@ public void should_fail_because_value_is_not_of_type() { assertThat(changes).change().column("var1").valueAtEndPoint().isOfClass(Boolean.class); fail("An exception must be raised"); } catch (AssertionError e) { - Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Value at end point of Column at index 0 (column name : VAR1) of Change at index 0 (with primary key : [1]) of Changes on TEST table of 'sa/jdbc:h2:mem:test' source] %n" + Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Value at end point of Column at index 0 (column name : VAR1) of Change at index 0 (with primary key : [1]) of Changes on TEST table of 'sa/jdbc:h2:mem:test'] %n" + "Expecting:%n" + " <1>%n" + "to be of class%n" diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnValueCloseness_IsCloseTo_DateTimeValue_DateTimeValue_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnValueCloseness_IsCloseTo_DateTimeValue_DateTimeValue_Test.java index c1e89d53..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 @@ -32,6 +32,7 @@ * {@link org.assertj.db.api.assertions.AssertOnValueCloseness#isCloseTo(org.assertj.db.type.DateTimeValue, org.assertj.db.type.DateTimeValue)} method. * * @author Régis Pouiller + * @author Julien Roy */ public class AssertOnValueCloseness_IsCloseTo_DateTimeValue_DateTimeValue_Test extends AbstractTest { @@ -41,8 +42,8 @@ public class AssertOnValueCloseness_IsCloseTo_DateTimeValue_DateTimeValue_Test e @Test @NeedReload public void test_is_close_to() { - Table table = new Table(source, "test"); - Changes changes = new Changes(table).setStartPointNow(); + Table 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 +65,8 @@ public void test_is_close_to() { @Test @NeedReload public void should_fail_because_value_is_not_close_to() { - Table table = new Table(source, "test"); - Changes changes = new Changes(table).setStartPointNow(); + Table table = assertDbConnection.table("test").build(); + Changes changes = assertDbConnection.changes().tables(table).build().setStartPointNow(); update("update test set var14 = 1 where var1 = 1"); changes.setEndPointNow(); @@ -74,7 +75,7 @@ public void should_fail_because_value_is_not_close_to() { DateTimeValue.of(DateValue.of(2014, 5, 24), TimeValue.of(9, 46, 31)), DateTimeValue.of(DateValue.of(0, 0, 0))); fail("An exception must be raised"); } catch (AssertionError e) { - Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Value at end point of Column at index 9 (column name : VAR10) of Change at index 0 (with primary key : [1]) of Changes on TEST table of 'sa/jdbc:h2:mem:test' source] %n" + Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Value at end point of Column at index 9 (column name : VAR10) of Change at index 0 (with primary key : [1]) of Changes on TEST table of 'sa/jdbc:h2:mem:test'] %n" + "Expecting:%n" + " <2014-05-24T09:46:30.000000000>%n" + "to be close to: %n" diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnValueCloseness_IsCloseTo_DateTimeValue_DateValue_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnValueCloseness_IsCloseTo_DateTimeValue_DateValue_Test.java index dd91b910..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 @@ -32,6 +32,7 @@ * {@link org.assertj.db.api.assertions.AssertOnValueCloseness#isCloseTo(org.assertj.db.type.DateTimeValue, org.assertj.db.type.DateValue)} method. * * @author Régis Pouiller + * @author Julien Roy */ public class AssertOnValueCloseness_IsCloseTo_DateTimeValue_DateValue_Test extends AbstractTest { @@ -41,8 +42,8 @@ public class AssertOnValueCloseness_IsCloseTo_DateTimeValue_DateValue_Test exten @Test @NeedReload public void test_is_close_to() { - Table table = new Table(source, "test"); - Changes changes = new Changes(table).setStartPointNow(); + Table 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 +65,8 @@ public void test_is_close_to() { @Test @NeedReload public void should_fail_because_value_is_not_close_to() { - Table table = new Table(source, "test"); - Changes changes = new Changes(table).setStartPointNow(); + Table table = assertDbConnection.table("test").build(); + Changes changes = assertDbConnection.changes().tables(table).build().setStartPointNow(); update("update test set var14 = 1 where var1 = 1"); changes.setEndPointNow(); @@ -74,7 +75,7 @@ public void should_fail_because_value_is_not_close_to() { DateTimeValue.of(DateValue.of(2014, 5, 24), TimeValue.of(9, 46, 31)), DateValue.of(0, 0, 0)); fail("An exception must be raised"); } catch (AssertionError e) { - Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Value at end point of Column at index 9 (column name : VAR10) of Change at index 0 (with primary key : [1]) of Changes on TEST table of 'sa/jdbc:h2:mem:test' source] %n" + Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Value at end point of Column at index 9 (column name : VAR10) of Change at index 0 (with primary key : [1]) of Changes on TEST table of 'sa/jdbc:h2:mem:test'] %n" + "Expecting:%n" + " <2014-05-24T09:46:30.000000000>%n" + "to be close to: %n" diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnValueCloseness_IsCloseTo_DateTimeValue_TimeValue_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnValueCloseness_IsCloseTo_DateTimeValue_TimeValue_Test.java index 6a12db9d..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 @@ -32,6 +32,7 @@ * {@link org.assertj.db.api.assertions.AssertOnValueCloseness#isCloseTo(org.assertj.db.type.DateTimeValue, org.assertj.db.type.TimeValue)} method. * * @author Régis Pouiller + * @author Julien Roy */ public class AssertOnValueCloseness_IsCloseTo_DateTimeValue_TimeValue_Test extends AbstractTest { @@ -41,8 +42,8 @@ public class AssertOnValueCloseness_IsCloseTo_DateTimeValue_TimeValue_Test exten @Test @NeedReload public void test_is_close_to() { - Table table = new Table(source, "test"); - Changes changes = new Changes(table).setStartPointNow(); + Table 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 +65,8 @@ public void test_is_close_to() { @Test @NeedReload public void should_fail_because_value_is_not_close_to() { - Table table = new Table(source, "test"); - Changes changes = new Changes(table).setStartPointNow(); + Table table = assertDbConnection.table("test").build(); + Changes changes = assertDbConnection.changes().tables(table).build().setStartPointNow(); update("update test set var14 = 1 where var1 = 1"); changes.setEndPointNow(); @@ -74,7 +75,7 @@ public void should_fail_because_value_is_not_close_to() { DateTimeValue.of(DateValue.of(2014, 5, 24), TimeValue.of(9, 46, 31)), TimeValue.of(0, 0, 0, 1)); fail("An exception must be raised"); } catch (AssertionError e) { - Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Value at end point of Column at index 9 (column name : VAR10) of Change at index 0 (with primary key : [1]) of Changes on TEST table of 'sa/jdbc:h2:mem:test' source] %n" + Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Value at end point of Column at index 9 (column name : VAR10) of Change at index 0 (with primary key : [1]) of Changes on TEST table of 'sa/jdbc:h2:mem:test'] %n" + "Expecting:%n" + " <2014-05-24T09:46:30.000000000>%n" + "to be close to: %n" diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnValueCloseness_IsCloseTo_DateValue_DateTimeValue_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnValueCloseness_IsCloseTo_DateValue_DateTimeValue_Test.java index eab13dea..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 @@ -31,6 +31,7 @@ * {@link org.assertj.db.api.assertions.AssertOnValueCloseness#isCloseTo(org.assertj.db.type.DateValue, org.assertj.db.type.DateTimeValue)} method. * * @author Régis Pouiller + * @author Julien Roy */ public class AssertOnValueCloseness_IsCloseTo_DateValue_DateTimeValue_Test extends AbstractTest { @@ -40,8 +41,8 @@ public class AssertOnValueCloseness_IsCloseTo_DateValue_DateTimeValue_Test exten @Test @NeedReload public void test_is_close_to() { - Table table = new Table(source, "test"); - Changes changes = new Changes(table).setStartPointNow(); + Table 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 +62,8 @@ public void test_is_close_to() { @Test @NeedReload public void should_fail_because_value_is_not_close_to() { - Table table = new Table(source, "test"); - Changes changes = new Changes(table).setStartPointNow(); + Table table = assertDbConnection.table("test").build(); + Changes changes = assertDbConnection.changes().tables(table).build().setStartPointNow(); update("update test set var14 = 1 where var1 = 1"); changes.setEndPointNow(); @@ -70,7 +71,7 @@ public void should_fail_because_value_is_not_close_to() { assertThat(changes).change().column("var9").valueAtEndPoint().isCloseTo(DateValue.of(2014, 5, 23), DateTimeValue.of(DateValue.of(0, 0, 0))); fail("An exception must be raised"); } catch (AssertionError e) { - Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Value at end point of Column at index 8 (column name : VAR9) of Change at index 0 (with primary key : [1]) of Changes on TEST table of 'sa/jdbc:h2:mem:test' source] %n" + Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Value at end point of Column at index 8 (column name : VAR9) of Change at index 0 (with primary key : [1]) of Changes on TEST table of 'sa/jdbc:h2:mem:test'] %n" + "Expecting:%n" + " <2014-05-24>%n" + "to be close to: %n" diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnValueCloseness_IsCloseTo_DateValue_DateValue_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnValueCloseness_IsCloseTo_DateValue_DateValue_Test.java index f7c95a9d..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 @@ -30,6 +30,7 @@ * {@link org.assertj.db.api.assertions.AssertOnValueCloseness#isCloseTo(org.assertj.db.type.DateValue, org.assertj.db.type.DateValue)} method. * * @author Régis Pouiller + * @author Julien Roy */ public class AssertOnValueCloseness_IsCloseTo_DateValue_DateValue_Test extends AbstractTest { @@ -39,8 +40,8 @@ public class AssertOnValueCloseness_IsCloseTo_DateValue_DateValue_Test extends A @Test @NeedReload public void test_is_close_to() { - Table table = new Table(source, "test"); - Changes changes = new Changes(table).setStartPointNow(); + Table 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 +60,8 @@ public void test_is_close_to() { @Test @NeedReload public void should_fail_because_value_is_not_close_to() { - Table table = new Table(source, "test"); - Changes changes = new Changes(table).setStartPointNow(); + Table 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,7 +69,7 @@ public void should_fail_because_value_is_not_close_to() { assertThat(changes).change().column("var9").valueAtEndPoint().isCloseTo(DateValue.of(2014, 5, 23), DateValue.of(0, 0, 0)); fail("An exception must be raised"); } catch (AssertionError e) { - Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Value at end point of Column at index 8 (column name : VAR9) of Change at index 0 (with primary key : [1]) of Changes on TEST table of 'sa/jdbc:h2:mem:test' source] %n" + Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Value at end point of Column at index 8 (column name : VAR9) of Change at index 0 (with primary key : [1]) of Changes on TEST table of 'sa/jdbc:h2:mem:test'] %n" + "Expecting:%n" + " <2014-05-24>%n" + "to be close to: %n" diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnValueCloseness_IsCloseTo_DateValue_TimeValue_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnValueCloseness_IsCloseTo_DateValue_TimeValue_Test.java index 12fadb2b..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 @@ -31,6 +31,7 @@ * {@link org.assertj.db.api.assertions.AssertOnValueCloseness#isCloseTo(org.assertj.db.type.DateValue, org.assertj.db.type.TimeValue)} method. * * @author Régis Pouiller + * @author Julien Roy */ public class AssertOnValueCloseness_IsCloseTo_DateValue_TimeValue_Test extends AbstractTest { @@ -40,8 +41,8 @@ public class AssertOnValueCloseness_IsCloseTo_DateValue_TimeValue_Test extends A @Test @NeedReload public void test_is_close_to() { - Table table = new Table(source, "test"); - Changes changes = new Changes(table).setStartPointNow(); + Table 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 +61,8 @@ public void test_is_close_to() { @Test @NeedReload public void should_fail_because_value_is_not_close_to() { - Table table = new Table(source, "test"); - Changes changes = new Changes(table).setStartPointNow(); + Table table = assertDbConnection.table("test").build(); + Changes changes = assertDbConnection.changes().tables(table).build().setStartPointNow(); update("update test set var14 = 1 where var1 = 1"); changes.setEndPointNow(); @@ -70,7 +71,7 @@ public void should_fail_because_value_is_not_close_to() { .of(0, 1, 0)); fail("An exception must be raised"); } catch (AssertionError e) { - Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Value at end point of Column at index 8 (column name : VAR9) of Change at index 0 (with primary key : [1]) of Changes on TEST table of 'sa/jdbc:h2:mem:test' source] %n" + Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Value at end point of Column at index 8 (column name : VAR9) of Change at index 0 (with primary key : [1]) of Changes on TEST table of 'sa/jdbc:h2:mem:test'] %n" + "Expecting:%n" + " <2014-05-24>%n" + "to be close to: %n" diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnValueCloseness_IsCloseTo_Number_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnValueCloseness_IsCloseTo_Number_Test.java index 03f64d2e..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 @@ -29,6 +29,7 @@ * {@link org.assertj.db.api.assertions.AssertOnValueCloseness#isCloseTo(Number, Number)} method. * * @author Régis Pouiller + * @author Julien Roy */ public class AssertOnValueCloseness_IsCloseTo_Number_Test extends AbstractTest { @@ -38,8 +39,8 @@ public class AssertOnValueCloseness_IsCloseTo_Number_Test extends AbstractTest { @Test @NeedReload public void test_is_close_to() { - Table table = new Table(source, "test"); - Changes changes = new Changes(table).setStartPointNow(); + Table table = assertDbConnection.table("test").build(); + Changes changes = assertDbConnection.changes().tables(table).build().setStartPointNow(); update("update test set var14 = 1 where var1 = 1"); changes.setEndPointNow(); @@ -58,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(source, "test"); - Changes changes = new Changes(table).setStartPointNow(); + Table table = assertDbConnection.table("test").build(); + Changes changes = assertDbConnection.changes().tables(table).build().setStartPointNow(); update("update test set var14 = 1 where var1 = 1"); changes.setEndPointNow(); @@ -67,7 +68,7 @@ public void should_fail_because_value_is_not_close_to() { assertThat(changes).change().column("var3").valueAtEndPoint().isCloseTo(3, 0.5); fail("An exception must be raised"); } catch (AssertionError e) { - Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Value at end point of Column at index 2 (column name : VAR3) of Change at index 0 (with primary key : [1]) of Changes on TEST table of 'sa/jdbc:h2:mem:test' source] %n" + Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Value at end point of Column at index 2 (column name : VAR3) of Change at index 0 (with primary key : [1]) of Changes on TEST table of 'sa/jdbc:h2:mem:test'] %n" + "Expecting:%n" + " <2>%n" + "to be close to: %n" diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnValueCloseness_IsCloseTo_TimeValue_TimeValue_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnValueCloseness_IsCloseTo_TimeValue_TimeValue_Test.java index a0b5a6f9..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 @@ -30,6 +30,7 @@ * {@link org.assertj.db.api.assertions.AssertOnValueCloseness#isCloseTo(org.assertj.db.type.TimeValue, org.assertj.db.type.TimeValue)} method. * * @author Régis Pouiller + * @author Julien Roy */ public class AssertOnValueCloseness_IsCloseTo_TimeValue_TimeValue_Test extends AbstractTest { @@ -39,8 +40,8 @@ public class AssertOnValueCloseness_IsCloseTo_TimeValue_TimeValue_Test extends A @Test @NeedReload public void test_is_close_to() { - Table table = new Table(source, "test"); - Changes changes = new Changes(table).setStartPointNow(); + Table 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 +60,8 @@ public void test_is_close_to() { @Test @NeedReload public void should_fail_because_value_is_not_close_to() { - Table table = new Table(source, "test"); - Changes changes = new Changes(table).setStartPointNow(); + Table table = assertDbConnection.table("test").build(); + Changes changes = assertDbConnection.changes().tables(table).build().setStartPointNow(); update("update test set var14 = 1 where var1 = 1"); changes.setEndPointNow(); @@ -69,7 +70,7 @@ public void should_fail_because_value_is_not_close_to() { fail("An exception must be raised"); } catch (AssertionError e) { Assertions.assertThat(e.getMessage()).isEqualTo(String.format( - "[Value at end point of Column at index 7 (column name : VAR8) of Change at index 0 (with primary key : [1]) of Changes on TEST table of 'sa/jdbc:h2:mem:test' source] %n" + "[Value at end point of Column at index 7 (column name : VAR8) of Change at index 0 (with primary key : [1]) of Changes on TEST table of 'sa/jdbc:h2:mem:test'] %n" + "Expecting:%n" + " <09:46:30.000000000>%n" + "to be close to: %n" diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnValueComparison_IsGreaterThanOrEqualTo_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnValueComparison_IsGreaterThanOrEqualTo_Test.java index 89a284ed..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 @@ -29,6 +29,7 @@ * {@link org.assertj.db.api.assertions.AssertOnValueComparison#isGreaterThanOrEqualTo(Number)} method. * * @author Régis Pouiller + * @author Julien Roy */ public class AssertOnValueComparison_IsGreaterThanOrEqualTo_Test extends AbstractTest { @@ -39,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(source, "test"); - Changes changes = new Changes(table).setStartPointNow(); + Table 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 +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(source, "test"); - Changes changes = new Changes(table).setStartPointNow(); + Table 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,7 +69,7 @@ public void should_fail_because_value_is_less_than() { assertThat(changes).change().column("var3").valueAtEndPoint().isGreaterThanOrEqualTo(3); fail("An exception must be raised"); } catch (AssertionError e) { - Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Value at end point of Column at index 2 (column name : VAR3) of Change at index 0 (with primary key : [1]) of Changes on TEST table of 'sa/jdbc:h2:mem:test' source] %n" + Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Value at end point of Column at index 2 (column name : VAR3) of Change at index 0 (with primary key : [1]) of Changes on TEST table of 'sa/jdbc:h2:mem:test'] %n" + "Expecting:%n" + " <2>%n" + "to be greater than or equal to %n" diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnValueComparison_IsGreaterThan_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnValueComparison_IsGreaterThan_Test.java index 6e6812d8..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 @@ -29,6 +29,7 @@ * {@link org.assertj.db.api.assertions.AssertOnValueComparison#isGreaterThan(Number)} method. * * @author Régis Pouiller + * @author Julien Roy */ public class AssertOnValueComparison_IsGreaterThan_Test extends AbstractTest { @@ -39,8 +40,8 @@ public class AssertOnValueComparison_IsGreaterThan_Test extends AbstractTest { @Test @NeedReload public void test_is_less_than() { - Table table = new Table(source, "test"); - Changes changes = new Changes(table).setStartPointNow(); + Table 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 +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(source, "test"); - Changes changes = new Changes(table).setStartPointNow(); + Table 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,7 +69,7 @@ public void should_fail_because_value_is_greater_than_or_equal_to() { assertThat(changes).change().column("var3").valueAtEndPoint().isGreaterThan(2); fail("An exception must be raised"); } catch (AssertionError e) { - Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Value at end point of Column at index 2 (column name : VAR3) of Change at index 0 (with primary key : [1]) of Changes on TEST table of 'sa/jdbc:h2:mem:test' source] %n" + Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Value at end point of Column at index 2 (column name : VAR3) of Change at index 0 (with primary key : [1]) of Changes on TEST table of 'sa/jdbc:h2:mem:test'] %n" + "Expecting:%n" + " <2>%n" + "to be greater than %n" diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnValueComparison_IsLessThanOrEqualTo_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnValueComparison_IsLessThanOrEqualTo_Test.java index 0f67f5e8..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 @@ -29,6 +29,7 @@ * {@link org.assertj.db.api.assertions.AssertOnValueComparison#isLessThanOrEqualTo(Number)} method. * * @author Régis Pouiller + * @author Julien Roy */ public class AssertOnValueComparison_IsLessThanOrEqualTo_Test extends AbstractTest { @@ -39,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(source, "test"); - Changes changes = new Changes(table).setStartPointNow(); + Table 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 +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(source, "test"); - Changes changes = new Changes(table).setStartPointNow(); + Table 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,7 +69,7 @@ public void should_fail_because_value_is_greater_than() { assertThat(changes).change().column("var3").valueAtEndPoint().isLessThanOrEqualTo(1); fail("An exception must be raised"); } catch (AssertionError e) { - Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Value at end point of Column at index 2 (column name : VAR3) of Change at index 0 (with primary key : [1]) of Changes on TEST table of 'sa/jdbc:h2:mem:test' source] %n" + Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Value at end point of Column at index 2 (column name : VAR3) of Change at index 0 (with primary key : [1]) of Changes on TEST table of 'sa/jdbc:h2:mem:test'] %n" + "Expecting:%n" + " <2>%n" + "to be less than or equal to %n" diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnValueComparison_IsLessThan_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnValueComparison_IsLessThan_Test.java index de5bff08..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 @@ -29,6 +29,7 @@ * {@link org.assertj.db.api.assertions.AssertOnValueComparison#isLessThan(Number)} method. * * @author Régis Pouiller + * @author Julien Roy */ public class AssertOnValueComparison_IsLessThan_Test extends AbstractTest { @@ -39,8 +40,8 @@ public class AssertOnValueComparison_IsLessThan_Test extends AbstractTest { @Test @NeedReload public void test_is_less_than() { - Table table = new Table(source, "test"); - Changes changes = new Changes(table).setStartPointNow(); + Table 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 +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(source, "test"); - Changes changes = new Changes(table).setStartPointNow(); + Table 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,7 +69,7 @@ public void should_fail_because_value_is_greater_than_or_equal_to() { assertThat(changes).change().column("var3").valueAtEndPoint().isLessThan(2); fail("An exception must be raised"); } catch (AssertionError e) { - Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Value at end point of Column at index 2 (column name : VAR3) of Change at index 0 (with primary key : [1]) of Changes on TEST table of 'sa/jdbc:h2:mem:test' source] %n" + Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Value at end point of Column at index 2 (column name : VAR3) of Change at index 0 (with primary key : [1]) of Changes on TEST table of 'sa/jdbc:h2:mem:test'] %n" + "Expecting:%n" + " <2>%n" + "to be less than %n" diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnValueCondition_DoesNotHave_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnValueCondition_DoesNotHave_Test.java index 031300dd..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(source, "test"); - Changes changes = new Changes(table).setStartPointNow(); + Table 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(source, "test"); - Changes changes = new Changes(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(); @@ -77,7 +77,7 @@ public void should_fail_because_value_not_match_with_condition() { } catch (AssertionError e) { Assertions.assertThat(e.getMessage()).isEqualTo(String.format( "[Value at end point of Column at index 2 (column name : VAR3) of Change at index 0 (with primary key : [1000]) of " - + "Changes on TEST table of 'sa/jdbc:h2:mem:test' source] %n" + + "Changes on TEST table of 'sa/jdbc:h2:mem:test'] %n" + "Expecting actual:%n" + " 0%n" + "not to be isZero")); diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnValueCondition_Has_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnValueCondition_Has_Test.java index 12e4e905..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(source, "test"); - Changes changes = new Changes(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(source, "test"); - Changes changes = new Changes(table).setStartPointNow(); + Table table = assertDbConnection.table("test").build(); + Changes changes = assertDbConnection.changes().tables(table).build().setStartPointNow(); update("update test set var14 = 1 where var1 = 1"); changes.setEndPointNow(); @@ -77,7 +77,7 @@ public void should_fail_because_value_not_match_with_condition() { } catch (AssertionError e) { Assertions.assertThat(e.getMessage()).isEqualTo(String.format( "[Value at end point of Column at index 2 (column name : VAR3) of Change at index 0 (with primary key : [1]) of " - + "Changes on TEST table of 'sa/jdbc:h2:mem:test' source] %n" + + "Changes on TEST table of 'sa/jdbc:h2:mem:test'] %n" + "Expecting actual:%n" + " 2%n" + "to be isZero")); diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnValueCondition_IsNot_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnValueCondition_IsNot_Test.java index 340eb1a3..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(source, "test"); - Changes changes = new Changes(table).setStartPointNow(); + Table 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(source, "test"); - Changes changes = new Changes(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(); @@ -77,7 +77,7 @@ public void should_fail_because_value_not_match_with_condition() { } catch (AssertionError e) { Assertions.assertThat(e.getMessage()).isEqualTo(String.format( "[Value at end point of Column at index 2 (column name : VAR3) of Change at index 0 (with primary key : [1000]) of " - + "Changes on TEST table of 'sa/jdbc:h2:mem:test' source] %n" + + "Changes on TEST table of 'sa/jdbc:h2:mem:test'] %n" + "Expecting actual:%n" + " 0%n" + "not to be isZero")); diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnValueCondition_Is_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnValueCondition_Is_Test.java index 2f4786e1..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(source, "test"); - Changes changes = new Changes(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(source, "test"); - Changes changes = new Changes(table).setStartPointNow(); + Table table = assertDbConnection.table("test").build(); + Changes changes = assertDbConnection.changes().tables(table).build().setStartPointNow(); update("update test set var14 = 1 where var1 = 1"); changes.setEndPointNow(); @@ -77,7 +77,7 @@ public void should_fail_because_value_not_match_with_condition() { } catch (AssertionError e) { Assertions.assertThat(e.getMessage()).isEqualTo(String.format( "[Value at end point of Column at index 2 (column name : VAR3) of Change at index 0 (with primary key : [1]) of " - + "Changes on TEST table of 'sa/jdbc:h2:mem:test' source] %n" + + "Changes on TEST table of 'sa/jdbc:h2:mem:test'] %n" + "Expecting actual:%n" + " 2%n" + "to be isZero")); diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnValueCondition_Satisfies_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnValueCondition_Satisfies_Test.java index b7a31cb5..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(source, "test"); - Changes changes = new Changes(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(source, "test"); - Changes changes = new Changes(table).setStartPointNow(); + Table table = assertDbConnection.table("test").build(); + Changes changes = assertDbConnection.changes().tables(table).build().setStartPointNow(); update("update test set var14 = 1 where var1 = 1"); changes.setEndPointNow(); @@ -77,7 +77,7 @@ public void should_fail_because_value_not_match_with_condition() { } catch (AssertionError e) { Assertions.assertThat(e.getMessage()).isEqualTo(String.format( "[Value at end point of Column at index 2 (column name : VAR3) of Change at index 0 (with primary key : [1]) of " - + "Changes on TEST table of 'sa/jdbc:h2:mem:test' source] %n" + + "Changes on TEST table of 'sa/jdbc:h2:mem:test'] %n" + "Expecting actual:%n" + " 2%n" + "to satisfy:%n" diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnValueEquality_IsEqualTo_Boolean_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnValueEquality_IsEqualTo_Boolean_Test.java index 7d1659c1..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 @@ -29,6 +29,7 @@ * {@link org.assertj.db.api.assertions.AssertOnValueEquality#isEqualTo(Boolean)} method. * * @author Régis Pouiller + * @author Julien Roy */ public class AssertOnValueEquality_IsEqualTo_Boolean_Test extends AbstractTest { @@ -38,8 +39,8 @@ public class AssertOnValueEquality_IsEqualTo_Boolean_Test extends AbstractTest { @Test @NeedReload public void test_is_equal_to() { - Table table = new Table(source, "test"); - Changes changes = new Changes(table).setStartPointNow(); + Table table = assertDbConnection.table("test").build(); + Changes changes = assertDbConnection.changes().tables(table).build().setStartPointNow(); update("update test set var14 = 1 where var1 = 1"); changes.setEndPointNow(); @@ -58,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(source, "test"); - Changes changes = new Changes(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(); @@ -67,7 +68,7 @@ public void should_fail_because_value_is_not_equal_to() { assertThat(changes).change().column("var2").valueAtEndPoint().isEqualTo(true); fail("An exception must be raised"); } catch (AssertionError e) { - Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Value at end point of Column at index 1 (column name : VAR2) of Change at index 0 (with primary key : [10]) of Changes on TEST table of 'sa/jdbc:h2:mem:test' source] %n" + Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Value at end point of Column at index 1 (column name : VAR2) of Change at index 0 (with primary key : [10]) of Changes on TEST table of 'sa/jdbc:h2:mem:test'] %n" + "Expecting:%n" + " %n" + "to be equal to: %n" diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnValueEquality_IsEqualTo_Bytes_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnValueEquality_IsEqualTo_Bytes_Test.java index 271edcd9..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 @@ -30,6 +30,7 @@ * {@link org.assertj.db.api.assertions.AssertOnValueEquality#isEqualTo(byte[])} method. * * @author Régis Pouiller + * @author Julien Roy */ public class AssertOnValueEquality_IsEqualTo_Bytes_Test extends AbstractTest { @@ -41,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(source, "test"); - Changes changes = new Changes(table).setStartPointNow(); + Table 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 +62,8 @@ public void test_is_equal_to() { @Test @NeedReload public void should_fail_because_value_is_not_equal_to() { - Table table = new Table(source, "test"); - Changes changes = new Changes(table).setStartPointNow(); + Table table = assertDbConnection.table("test").build(); + Changes changes = assertDbConnection.changes().tables(table).build().setStartPointNow(); update("update test set var14 = 1 where var1 = 1"); changes.setEndPointNow(); @@ -70,7 +71,7 @@ public void should_fail_because_value_is_not_equal_to() { assertThat(changes).change().column("var11").valueAtEndPoint().isEqualTo(new byte[0]); fail("An exception must be raised"); } catch (AssertionError e) { - Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Value at end point of Column at index 10 (column name : VAR11) of Change at index 0 (with primary key : [1]) of Changes on TEST table of 'sa/jdbc:h2:mem:test' source] %n" + Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Value at end point of Column at index 10 (column name : VAR11) of Change at index 0 (with primary key : [1]) of Changes on TEST table of 'sa/jdbc:h2:mem:test'] %n" + "Expecting to be equal to the expected value but was not equal")); } try { diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnValueEquality_IsEqualTo_Character_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnValueEquality_IsEqualTo_Character_Test.java index 11003d17..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 @@ -29,6 +29,7 @@ * {@link org.assertj.db.api.assertions.AssertOnValueEquality#isEqualTo(Character)} method. * * @author Régis Pouiller + * @author Julien Roy */ public class AssertOnValueEquality_IsEqualTo_Character_Test extends AbstractTest { @@ -38,8 +39,8 @@ public class AssertOnValueEquality_IsEqualTo_Character_Test extends AbstractTest @Test @NeedReload public void test_is_equal_to() { - Table table = new Table(source, "test"); - Changes changes = new Changes(table).setStartPointNow(); + Table table = assertDbConnection.table("test").build(); + Changes changes = assertDbConnection.changes().tables(table).build().setStartPointNow(); update("update test set var14 = 1 where var1 = 1"); changes.setEndPointNow(); @@ -58,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(source, "test"); - Changes changes = new Changes(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(); @@ -67,7 +68,7 @@ public void should_fail_because_value_is_not_equal_to() { assertThat(changes).change().column("var16").valueAtEndPoint().isEqualTo('t'); fail("An exception must be raised"); } catch (AssertionError e) { - Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Value at end point of Column at index 15 (column name : VAR16) of Change at index 0 (with primary key : [10]) of Changes on TEST table of 'sa/jdbc:h2:mem:test' source] %n" + Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Value at end point of Column at index 15 (column name : VAR16) of Change at index 0 (with primary key : [10]) of Changes on TEST table of 'sa/jdbc:h2:mem:test'] %n" + "Expecting:%n" + " <\"e\">%n" + "to be equal to: %n" diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnValueEquality_IsEqualTo_DateTimeValue_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnValueEquality_IsEqualTo_DateTimeValue_Test.java index 5c50f530..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 @@ -32,6 +32,7 @@ * {@link org.assertj.db.api.assertions.AssertOnValueEquality#isEqualTo(org.assertj.db.type.DateTimeValue)} method. * * @author Régis Pouiller + * @author Julien Roy */ public class AssertOnValueEquality_IsEqualTo_DateTimeValue_Test extends AbstractTest { @@ -41,8 +42,8 @@ public class AssertOnValueEquality_IsEqualTo_DateTimeValue_Test extends Abstract @Test @NeedReload public void test_is_equal_to() { - Table table = new Table(source, "test"); - Changes changes = new Changes(table).setStartPointNow(); + Table 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 +63,8 @@ public void test_is_equal_to() { @Test @NeedReload public void should_fail_because_value_is_not_equal_to() { - Table table = new Table(source, "test"); - Changes changes = new Changes(table).setStartPointNow(); + Table table = assertDbConnection.table("test").build(); + Changes changes = assertDbConnection.changes().tables(table).build().setStartPointNow(); update("update test set var14 = 1 where var1 = 1"); changes.setEndPointNow(); @@ -72,7 +73,7 @@ public void should_fail_because_value_is_not_equal_to() { DateTimeValue.of(DateValue.of(2014, 5, 24), TimeValue.of(9, 46, 31))); fail("An exception must be raised"); } catch (AssertionError e) { - Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Value at end point of Column at index 9 (column name : VAR10) of Change at index 0 (with primary key : [1]) of Changes on TEST table of 'sa/jdbc:h2:mem:test' source] %n" + Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Value at end point of Column at index 9 (column name : VAR10) of Change at index 0 (with primary key : [1]) of Changes on TEST table of 'sa/jdbc:h2:mem:test'] %n" + "Expecting:%n" + " <2014-05-24T09:46:30.000000000>%n" + "to be equal to: %n" diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnValueEquality_IsEqualTo_DateValue_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnValueEquality_IsEqualTo_DateValue_Test.java index 26636b2c..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 @@ -12,6 +12,9 @@ */ package org.assertj.db.api.assertions; +import static org.assertj.db.api.Assertions.assertThat; +import static org.junit.Assert.fail; + import org.assertj.core.api.Assertions; import org.assertj.db.api.ChangeColumnValueAssert; import org.assertj.db.api.TableColumnValueAssert; @@ -22,14 +25,12 @@ import org.assertj.db.type.Table; import org.junit.Test; -import static org.assertj.db.api.Assertions.assertThat; -import static org.junit.Assert.fail; - /** * Tests on {@link org.assertj.db.api.assertions.AssertOnValueEquality} class : * {@link org.assertj.db.api.assertions.AssertOnValueEquality#isEqualTo(org.assertj.db.type.DateValue)} method. * * @author Régis Pouiller + * @author Julien Roy */ public class AssertOnValueEquality_IsEqualTo_DateValue_Test extends AbstractTest { @@ -39,8 +40,8 @@ public class AssertOnValueEquality_IsEqualTo_DateValue_Test extends AbstractTest @Test @NeedReload public void test_is_equal_to() { - Table table = new Table(source, "test"); - Changes changes = new Changes(table).setStartPointNow(); + Table 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 +60,8 @@ public void test_is_equal_to() { @Test @NeedReload public void should_fail_because_value_is_not_equal_to() { - Table table = new Table(source, "test"); - Changes changes = new Changes(table).setStartPointNow(); + Table 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,7 +69,7 @@ public void should_fail_because_value_is_not_equal_to() { assertThat(changes).change().column("var9").valueAtEndPoint().isEqualTo(DateValue.of(2014, 5, 23)); fail("An exception must be raised"); } catch (AssertionError e) { - Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Value at end point of Column at index 8 (column name : VAR9) of Change at index 0 (with primary key : [1]) of Changes on TEST table of 'sa/jdbc:h2:mem:test' source] %n" + Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Value at end point of Column at index 8 (column name : VAR9) of Change at index 0 (with primary key : [1]) of Changes on TEST table of 'sa/jdbc:h2:mem:test'] %n" + "Expecting:%n" + " <2014-05-24>%n" + "to be equal to: %n" diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnValueEquality_IsEqualTo_LocalDateTime_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnValueEquality_IsEqualTo_LocalDateTime_Test.java index a9d99854..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(source, "test"); - Changes changes = new Changes(table).setStartPointNow(); + Table 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(source, "test"); - Changes changes = new Changes(table).setStartPointNow(); + Table table = assertDbConnection.table("test").build(); + Changes changes = assertDbConnection.changes().tables(table).build().setStartPointNow(); update("update test set var14 = 1 where var1 = 1"); changes.setEndPointNow(); @@ -69,7 +69,7 @@ public void should_fail_because_value_is_not_equal_to() { assertThat(changes).change().column("var10").valueAtEndPoint().isEqualTo(LocalDateTime.of(2014, 5, 24, 9, 46, 31)); fail("An exception must be raised"); } catch (AssertionError e) { - Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Value at end point of Column at index 9 (column name : VAR10) of Change at index 0 (with primary key : [1]) of Changes on TEST table of 'sa/jdbc:h2:mem:test' source] %n" + Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Value at end point of Column at index 9 (column name : VAR10) of Change at index 0 (with primary key : [1]) of Changes on TEST table of 'sa/jdbc:h2:mem:test'] %n" + "Expecting:%n" + " <2014-05-24T09:46:30.000000000>%n" + "to be equal to: %n" diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnValueEquality_IsEqualTo_LocalDate_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnValueEquality_IsEqualTo_LocalDate_Test.java index 9782936f..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 @@ -12,6 +12,11 @@ */ package org.assertj.db.api.assertions; +import static org.assertj.db.api.Assertions.assertThat; +import static org.junit.Assert.fail; + +import java.time.LocalDate; + import org.assertj.core.api.Assertions; import org.assertj.db.api.ChangeColumnValueAssert; import org.assertj.db.api.TableColumnValueAssert; @@ -21,11 +26,6 @@ import org.assertj.db.type.Table; import org.junit.Test; -import java.time.LocalDate; - -import static org.assertj.db.api.Assertions.assertThat; -import static org.junit.Assert.fail; - /** * Tests on {@link org.assertj.db.api.assertions.AssertOnValueEquality} class : * {@link org.assertj.db.api.assertions.AssertOnValueEquality#isEqualTo(java.time.LocalDate)} method. @@ -40,8 +40,8 @@ public class AssertOnValueEquality_IsEqualTo_LocalDate_Test extends AbstractTest @Test @NeedReload public void test_is_equal_to() { - Table table = new Table(source, "test"); - Changes changes = new Changes(table).setStartPointNow(); + Table 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(source, "test"); - Changes changes = new Changes(table).setStartPointNow(); + Table table = assertDbConnection.table("test").build(); + Changes changes = assertDbConnection.changes().tables(table).build().setStartPointNow(); update("update test set var14 = 1 where var1 = 1"); changes.setEndPointNow(); @@ -69,7 +69,7 @@ public void should_fail_because_value_is_not_equal_to() { assertThat(changes).change().column("var9").valueAtEndPoint().isEqualTo(LocalDate.of(2014, 5, 23)); fail("An exception must be raised"); } catch (AssertionError e) { - Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Value at end point of Column at index 8 (column name : VAR9) of Change at index 0 (with primary key : [1]) of Changes on TEST table of 'sa/jdbc:h2:mem:test' source] %n" + Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Value at end point of Column at index 8 (column name : VAR9) of Change at index 0 (with primary key : [1]) of Changes on TEST table of 'sa/jdbc:h2:mem:test'] %n" + "Expecting:%n" + " <2014-05-24>%n" + "to be equal to: %n" diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnValueEquality_IsEqualTo_LocalTime_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnValueEquality_IsEqualTo_LocalTime_Test.java index f5e6fff4..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(source, "test"); - Changes changes = new Changes(table).setStartPointNow(); + Table 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(source, "test"); - Changes changes = new Changes(table).setStartPointNow(); + Table table = assertDbConnection.table("test").build(); + Changes changes = assertDbConnection.changes().tables(table).build().setStartPointNow(); update("update test set var14 = 1 where var1 = 1"); changes.setEndPointNow(); @@ -69,7 +69,7 @@ public void should_fail_because_value_is_not_equal_to() { assertThat(changes).change().column("var8").valueAtEndPoint().isEqualTo(LocalTime.of(9, 46, 31)); fail("An exception must be raised"); } catch (AssertionError e) { - Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Value at end point of Column at index 7 (column name : VAR8) of Change at index 0 (with primary key : [1]) of Changes on TEST table of 'sa/jdbc:h2:mem:test' source] %n" + Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Value at end point of Column at index 7 (column name : VAR8) of Change at index 0 (with primary key : [1]) of Changes on TEST table of 'sa/jdbc:h2:mem:test'] %n" + "Expecting:%n" + " <09:46:30.000000000>%n" + "to be equal to: %n" diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnValueEquality_IsEqualTo_Number_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnValueEquality_IsEqualTo_Number_Test.java index 1c1c9a07..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 @@ -29,6 +29,7 @@ * {@link org.assertj.db.api.assertions.AssertOnValueEquality#isEqualTo(Number)} method. * * @author Régis Pouiller + * @author Julien Roy */ public class AssertOnValueEquality_IsEqualTo_Number_Test extends AbstractTest { @@ -38,8 +39,8 @@ public class AssertOnValueEquality_IsEqualTo_Number_Test extends AbstractTest { @Test @NeedReload public void test_is_equal_to() { - Table table = new Table(source, "test"); - Changes changes = new Changes(table).setStartPointNow(); + Table table = assertDbConnection.table("test").build(); + Changes changes = assertDbConnection.changes().tables(table).build().setStartPointNow(); update("update test set var14 = 1 where var1 = 1"); changes.setEndPointNow(); @@ -58,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(source, "test"); - Changes changes = new Changes(table).setStartPointNow(); + Table table = assertDbConnection.table("test").build(); + Changes changes = assertDbConnection.changes().tables(table).build().setStartPointNow(); update("update test set var14 = 1 where var1 = 1"); changes.setEndPointNow(); @@ -67,7 +68,7 @@ public void should_fail_because_value_is_not_equal_to() { assertThat(changes).change().column("var3").valueAtEndPoint().isEqualTo(3); fail("An exception must be raised"); } catch (AssertionError e) { - Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Value at end point of Column at index 2 (column name : VAR3) of Change at index 0 (with primary key : [1]) of Changes on TEST table of 'sa/jdbc:h2:mem:test' source] %n" + Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Value at end point of Column at index 2 (column name : VAR3) of Change at index 0 (with primary key : [1]) of Changes on TEST table of 'sa/jdbc:h2:mem:test'] %n" + "Expecting:%n" + " <2>%n" + "to be equal to: %n" diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnValueEquality_IsEqualTo_Object_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnValueEquality_IsEqualTo_Object_Test.java index e1f881cd..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 @@ -29,6 +29,7 @@ * {@link org.assertj.db.api.assertions.AssertOnValueEquality#isEqualTo(Object)} method. * * @author Régis Pouiller + * @author Julien Roy */ public class AssertOnValueEquality_IsEqualTo_Object_Test extends AbstractTest { @@ -38,8 +39,8 @@ public class AssertOnValueEquality_IsEqualTo_Object_Test extends AbstractTest { @Test @NeedReload public void test_is_null() { - Table table = new Table(source, "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(); @@ -58,8 +59,8 @@ public void test_is_null() { @Test @NeedReload public void should_fail_because_value_is_not_null() { - Table table = new Table(source, "test"); - Changes changes = new Changes(table).setStartPointNow(); + Table table = assertDbConnection.table("test").build(); + Changes changes = assertDbConnection.changes().tables(table).build().setStartPointNow(); update("update test set var14 = 1 where var1 = 1"); changes.setEndPointNow(); @@ -67,7 +68,7 @@ public void should_fail_because_value_is_not_null() { assertThat(changes).change().column("var3").valueAtEndPoint().isEqualTo((Object) null); fail("An exception must be raised"); } catch (AssertionError e) { - Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Value at end point of Column at index 2 (column name : VAR3) of Change at index 0 (with primary key : [1]) of Changes on TEST table of 'sa/jdbc:h2:mem:test' source] %n" + Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Value at end point of Column at index 2 (column name : VAR3) of Change at index 0 (with primary key : [1]) of Changes on TEST table of 'sa/jdbc:h2:mem:test'] %n" + "Expecting:%n" + " <2>%n" + "to be equal to: %n" diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnValueEquality_IsEqualTo_String_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnValueEquality_IsEqualTo_String_Test.java index 9ad380f7..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 @@ -29,6 +29,7 @@ * {@link org.assertj.db.api.assertions.AssertOnValueEquality#isEqualTo(String)} method. * * @author Régis Pouiller + * @author Julien Roy */ public class AssertOnValueEquality_IsEqualTo_String_Test extends AbstractTest { @@ -38,8 +39,8 @@ public class AssertOnValueEquality_IsEqualTo_String_Test extends AbstractTest { @Test @NeedReload public void test_is_equal_to() { - Table table = new Table(source, "test"); - Changes changes = new Changes(table).setStartPointNow(); + Table table = assertDbConnection.table("test").build(); + Changes changes = assertDbConnection.changes().tables(table).build().setStartPointNow(); update("update test set var14 = 1 where var1 = 1"); changes.setEndPointNow(); @@ -58,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(source, "test"); - Changes changes = new Changes(table).setStartPointNow(); + Table table = assertDbConnection.table("test").build(); + Changes changes = assertDbConnection.changes().tables(table).build().setStartPointNow(); update("update test set var14 = 1 where var1 = 1"); changes.setEndPointNow(); @@ -67,7 +68,7 @@ public void should_fail_because_value_is_not_equal_to() { assertThat(changes).change().column("var12").valueAtEndPoint().isEqualTo("-"); fail("An exception must be raised"); } catch (AssertionError e) { - Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Value at end point of Column at index 11 (column name : VAR12) of Change at index 0 (with primary key : [1]) of Changes on TEST table of 'sa/jdbc:h2:mem:test' source] %n" + Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Value at end point of Column at index 11 (column name : VAR12) of Change at index 0 (with primary key : [1]) of Changes on TEST table of 'sa/jdbc:h2:mem:test'] %n" + "Expecting:%n" + " <\"text\">%n" + "to be equal to: %n" diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnValueEquality_IsEqualTo_TimeValue_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnValueEquality_IsEqualTo_TimeValue_Test.java index 95ac1ff5..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 @@ -30,6 +30,7 @@ * {@link org.assertj.db.api.assertions.AssertOnValueEquality#isEqualTo(org.assertj.db.type.TimeValue)} method. * * @author Régis Pouiller + * @author Julien Roy */ public class AssertOnValueEquality_IsEqualTo_TimeValue_Test extends AbstractTest { @@ -39,8 +40,8 @@ public class AssertOnValueEquality_IsEqualTo_TimeValue_Test extends AbstractTest @Test @NeedReload public void test_is_equal_to() { - Table table = new Table(source, "test"); - Changes changes = new Changes(table).setStartPointNow(); + Table 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 +60,8 @@ public void test_is_equal_to() { @Test @NeedReload public void should_fail_because_value_is_not_equal_to() { - Table table = new Table(source, "test"); - Changes changes = new Changes(table).setStartPointNow(); + Table 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,7 +69,7 @@ public void should_fail_because_value_is_not_equal_to() { assertThat(changes).change().column("var8").valueAtEndPoint().isEqualTo(TimeValue.of(9, 46, 31)); fail("An exception must be raised"); } catch (AssertionError e) { - Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Value at end point of Column at index 7 (column name : VAR8) of Change at index 0 (with primary key : [1]) of Changes on TEST table of 'sa/jdbc:h2:mem:test' source] %n" + Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Value at end point of Column at index 7 (column name : VAR8) of Change at index 0 (with primary key : [1]) of Changes on TEST table of 'sa/jdbc:h2:mem:test'] %n" + "Expecting:%n" + " <09:46:30.000000000>%n" + "to be equal to: %n" diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnValueEquality_IsEqualTo_UUID_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnValueEquality_IsEqualTo_UUID_Test.java index 37b1b79d..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(source, "test"); - 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(source, "test"); - 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(); @@ -73,7 +73,7 @@ public void should_fail_because_value_is_not_equal_to() { fail("An exception must be raised"); } catch (AssertionError e) { Assertions.assertThat(e.getMessage()).isEqualTo(String.format( - "[Value at end point of Column at index 14 (column name : VAR15) of Change at index 0 (with primary key : [10]) of Changes on TEST table of 'sa/jdbc:h2:mem:test' source] %n" + "[Value at end point of Column at index 14 (column name : VAR15) of Change at index 0 (with primary key : [10]) of Changes on TEST table of 'sa/jdbc:h2:mem:test'] %n" + "Expecting:%n" + " <2b0d1bdd-909e-4362-ba10-c930ba82718d>%n" + "to be equal to: %n" diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnValueEquality_IsFalse_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnValueEquality_IsFalse_Test.java index 4141fadb..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 @@ -29,6 +29,7 @@ * {@link org.assertj.db.api.assertions.AssertOnValueEquality#isFalse()} method. * * @author Régis Pouiller + * @author Julien Roy */ public class AssertOnValueEquality_IsFalse_Test extends AbstractTest { @@ -38,8 +39,8 @@ public class AssertOnValueEquality_IsFalse_Test extends AbstractTest { @Test @NeedReload public void test_is_false() { - Table table = new Table(source, "test"); - Changes changes = new Changes(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(); @@ -58,8 +59,8 @@ public void test_is_false() { @Test @NeedReload public void should_fail_because_value_is_true() { - Table table = new Table(source, "test"); - Changes changes = new Changes(table).setStartPointNow(); + Table table = assertDbConnection.table("test").build(); + Changes changes = assertDbConnection.changes().tables(table).build().setStartPointNow(); update("update test set var14 = 1 where var1 = 1"); changes.setEndPointNow(); @@ -67,7 +68,7 @@ public void should_fail_because_value_is_true() { assertThat(changes).change().column("var2").valueAtEndPoint().isFalse(); fail("An exception must be raised"); } catch (AssertionError e) { - Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Value at end point of Column at index 1 (column name : VAR2) of Change at index 0 (with primary key : [1]) of Changes on TEST table of 'sa/jdbc:h2:mem:test' source] %n" + Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Value at end point of Column at index 1 (column name : VAR2) of Change at index 0 (with primary key : [1]) of Changes on TEST table of 'sa/jdbc:h2:mem:test'] %n" + "Expecting:%n" + " %n" + "to be equal to: %n" diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnValueEquality_IsTrue_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnValueEquality_IsTrue_Test.java index d3749bf5..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 @@ -29,6 +29,7 @@ * {@link org.assertj.db.api.assertions.AssertOnValueEquality#isTrue()} method. * * @author Régis Pouiller + * @author Julien Roy */ public class AssertOnValueEquality_IsTrue_Test extends AbstractTest { @@ -38,8 +39,8 @@ public class AssertOnValueEquality_IsTrue_Test extends AbstractTest { @Test @NeedReload public void test_is_true() { - Table table = new Table(source, "test"); - Changes changes = new Changes(table).setStartPointNow(); + Table table = assertDbConnection.table("test").build(); + Changes changes = assertDbConnection.changes().tables(table).build().setStartPointNow(); update("update test set var14 = 1 where var1 = 1"); changes.setEndPointNow(); @@ -58,8 +59,8 @@ public void test_is_true() { @Test @NeedReload public void should_fail_because_value_is_false() { - Table table = new Table(source, "test"); - Changes changes = new Changes(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(); @@ -67,7 +68,7 @@ public void should_fail_because_value_is_false() { assertThat(changes).change().column("var2").valueAtEndPoint().isTrue(); fail("An exception must be raised"); } catch (AssertionError e) { - Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Value at end point of Column at index 1 (column name : VAR2) of Change at index 0 (with primary key : [10]) of Changes on TEST table of 'sa/jdbc:h2:mem:test' source] %n" + Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Value at end point of Column at index 1 (column name : VAR2) of Change at index 0 (with primary key : [10]) of Changes on TEST table of 'sa/jdbc:h2:mem:test'] %n" + "Expecting:%n" + " %n" + "to be equal to: %n" diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnValueEquality_IsZero_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnValueEquality_IsZero_Test.java index cedb3d5e..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 @@ -29,6 +29,7 @@ * {@link org.assertj.db.api.assertions.AssertOnValueEquality#isZero()} method. * * @author Régis Pouiller + * @author Julien Roy */ public class AssertOnValueEquality_IsZero_Test extends AbstractTest { @@ -38,8 +39,8 @@ public class AssertOnValueEquality_IsZero_Test extends AbstractTest { @Test @NeedReload public void test_is_zero() { - Table table = new Table(source, "test"); - Changes changes = new Changes(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(); @@ -58,8 +59,8 @@ public void test_is_zero() { @Test @NeedReload public void should_fail_because_value_is_not_zero() { - Table table = new Table(source, "test"); - Changes changes = new Changes(table).setStartPointNow(); + Table table = assertDbConnection.table("test").build(); + Changes changes = assertDbConnection.changes().tables(table).build().setStartPointNow(); update("update test set var14 = 1 where var1 = 1"); changes.setEndPointNow(); @@ -67,7 +68,7 @@ public void should_fail_because_value_is_not_zero() { assertThat(changes).change().column("var3").valueAtEndPoint().isZero(); fail("An exception must be raised"); } catch (AssertionError e) { - Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Value at end point of Column at index 2 (column name : VAR3) of Change at index 0 (with primary key : [1]) of Changes on TEST table of 'sa/jdbc:h2:mem:test' source] %n" + Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Value at end point of Column at index 2 (column name : VAR3) of Change at index 0 (with primary key : [1]) of Changes on TEST table of 'sa/jdbc:h2:mem:test'] %n" + "Expecting:%n" + " <2>%n" + "to be equal to: %n" diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnValueInequality_IsNotEqualTo_Boolean_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnValueInequality_IsNotEqualTo_Boolean_Test.java index 9e944944..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 @@ -29,6 +29,7 @@ * {@link org.assertj.db.api.assertions.AssertOnValueInequality#isNotEqualTo(Boolean)} method. * * @author Régis Pouiller + * @author Julien Roy */ public class AssertOnValueInequality_IsNotEqualTo_Boolean_Test extends AbstractTest { @@ -38,8 +39,8 @@ public class AssertOnValueInequality_IsNotEqualTo_Boolean_Test extends AbstractT @Test @NeedReload public void test_is_not_equal_to() { - Table table = new Table(source, "test"); - Changes changes = new Changes(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(); @@ -58,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(source, "test"); - Changes changes = new Changes(table).setStartPointNow(); + Table table = assertDbConnection.table("test").build(); + Changes changes = assertDbConnection.changes().tables(table).build().setStartPointNow(); update("update test set var14 = 1 where var1 = 1"); changes.setEndPointNow(); @@ -67,7 +68,7 @@ public void should_fail_because_value_is_equal_to() { assertThat(changes).change().column("var2").valueAtEndPoint().isNotEqualTo(true); fail("An exception must be raised"); } catch (AssertionError e) { - Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Value at end point of Column at index 1 (column name : VAR2) of Change at index 0 (with primary key : [1]) of Changes on TEST table of 'sa/jdbc:h2:mem:test' source] %n" + Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Value at end point of Column at index 1 (column name : VAR2) of Change at index 0 (with primary key : [1]) of Changes on TEST table of 'sa/jdbc:h2:mem:test'] %n" + "Expecting:%n" + " %n" + "not to be equal to: %n" diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnValueInequality_IsNotEqualTo_Bytes_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnValueInequality_IsNotEqualTo_Bytes_Test.java index cc72a6d0..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 @@ -30,6 +30,7 @@ * {@link org.assertj.db.api.assertions.AssertOnValueInequality#isNotEqualTo(byte[])} method. * * @author Régis Pouiller + * @author Julien Roy */ public class AssertOnValueInequality_IsNotEqualTo_Bytes_Test extends AbstractTest { @@ -39,8 +40,8 @@ public class AssertOnValueInequality_IsNotEqualTo_Bytes_Test extends AbstractTes @Test @NeedReload public void test_is_not_equal_to() { - Table table = new Table(source, "test"); - Changes changes = new Changes(table).setStartPointNow(); + Table 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 +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(source, "test"); - Changes changes = new Changes(table).setStartPointNow(); + Table table = assertDbConnection.table("test").build(); + Changes changes = assertDbConnection.changes().tables(table).build().setStartPointNow(); update("update test set var14 = 1 where var1 = 1"); changes.setEndPointNow(); @@ -70,7 +71,7 @@ public void should_fail_because_value_is_equal_to() { assertThat(changes).change().column("var11").valueAtEndPoint().isNotEqualTo(bytesH2); fail("An exception must be raised"); } catch (AssertionError e) { - Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Value at end point of Column at index 10 (column name : VAR11) of Change at index 0 (with primary key : [1]) of Changes on TEST table of 'sa/jdbc:h2:mem:test' source] %n" + Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Value at end point of Column at index 10 (column name : VAR11) of Change at index 0 (with primary key : [1]) of Changes on TEST table of 'sa/jdbc:h2:mem:test'] %n" + "Expecting to be not equal to the value but was equal")); } try { diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnValueInequality_IsNotEqualTo_Character_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnValueInequality_IsNotEqualTo_Character_Test.java index 6f967c46..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 @@ -29,6 +29,7 @@ * {@link org.assertj.db.api.assertions.AssertOnValueInequality#isNotEqualTo(Character)} method. * * @author Régis Pouiller + * @author Julien Roy */ public class AssertOnValueInequality_IsNotEqualTo_Character_Test extends AbstractTest { @@ -38,8 +39,8 @@ public class AssertOnValueInequality_IsNotEqualTo_Character_Test extends Abstrac @Test @NeedReload public void test_is_not_equal_to() { - Table table = new Table(source, "test"); - Changes changes = new Changes(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(); @@ -58,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(source, "test"); - Changes changes = new Changes(table).setStartPointNow(); + Table table = assertDbConnection.table("test").build(); + Changes changes = assertDbConnection.changes().tables(table).build().setStartPointNow(); update("update test set var14 = 1 where var1 = 1"); changes.setEndPointNow(); @@ -67,7 +68,7 @@ public void should_fail_because_value_is_equal_to() { assertThat(changes).change().column("var16").valueAtEndPoint().isNotEqualTo('T'); fail("An exception must be raised"); } catch (AssertionError e) { - Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Value at end point of Column at index 15 (column name : VAR16) of Change at index 0 (with primary key : [1]) of Changes on TEST table of 'sa/jdbc:h2:mem:test' source] %n" + Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Value at end point of Column at index 15 (column name : VAR16) of Change at index 0 (with primary key : [1]) of Changes on TEST table of 'sa/jdbc:h2:mem:test'] %n" + "Expecting:%n" + " <\"T\">%n" + "not to be equal to: %n" diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnValueInequality_IsNotEqualTo_DateTimeValue_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnValueInequality_IsNotEqualTo_DateTimeValue_Test.java index abda9f4c..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 @@ -32,6 +32,7 @@ * {@link org.assertj.db.api.assertions.AssertOnValueInequality#isNotEqualTo(org.assertj.db.type.DateTimeValue)} method. * * @author Régis Pouiller + * @author Julien Roy */ public class AssertOnValueInequality_IsNotEqualTo_DateTimeValue_Test extends AbstractTest { @@ -41,8 +42,8 @@ public class AssertOnValueInequality_IsNotEqualTo_DateTimeValue_Test extends Abs @Test @NeedReload public void test_is_not_equal_to() { - Table table = new Table(source, "test"); - Changes changes = new Changes(table).setStartPointNow(); + Table 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 +64,8 @@ public void test_is_not_equal_to() { @Test @NeedReload public void should_fail_because_value_is_equal_to() { - Table table = new Table(source, "test"); - Changes changes = new Changes(table).setStartPointNow(); + Table table = assertDbConnection.table("test").build(); + Changes changes = assertDbConnection.changes().tables(table).build().setStartPointNow(); update("update test set var14 = 1 where var1 = 1"); changes.setEndPointNow(); @@ -73,7 +74,7 @@ public void should_fail_because_value_is_equal_to() { .of(9, 46, 30))); fail("An exception must be raised"); } catch (AssertionError e) { - Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Value at end point of Column at index 9 (column name : VAR10) of Change at index 0 (with primary key : [1]) of Changes on TEST table of 'sa/jdbc:h2:mem:test' source] %n" + Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Value at end point of Column at index 9 (column name : VAR10) of Change at index 0 (with primary key : [1]) of Changes on TEST table of 'sa/jdbc:h2:mem:test'] %n" + "Expecting:%n" + " <2014-05-24T09:46:30.000000000>%n" + "not to be equal to: %n" diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnValueInequality_IsNotEqualTo_DateValue_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnValueInequality_IsNotEqualTo_DateValue_Test.java index aee43532..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 @@ -30,6 +30,7 @@ * {@link org.assertj.db.api.assertions.AssertOnValueInequality#isNotEqualTo(org.assertj.db.type.DateValue)} method. * * @author Régis Pouiller + * @author Julien Roy */ public class AssertOnValueInequality_IsNotEqualTo_DateValue_Test extends AbstractTest { @@ -39,8 +40,8 @@ public class AssertOnValueInequality_IsNotEqualTo_DateValue_Test extends Abstrac @Test @NeedReload public void test_is_not_equal_to() { - Table table = new Table(source, "test"); - Changes changes = new Changes(table).setStartPointNow(); + Table 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 +60,8 @@ public void test_is_not_equal_to() { @Test @NeedReload public void should_fail_because_value_is_equal_to() { - Table table = new Table(source, "test"); - Changes changes = new Changes(table).setStartPointNow(); + Table 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,7 +69,7 @@ public void should_fail_because_value_is_equal_to() { assertThat(changes).change().column("var9").valueAtEndPoint().isNotEqualTo(DateValue.of(2014, 5, 24)); fail("An exception must be raised"); } catch (AssertionError e) { - Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Value at end point of Column at index 8 (column name : VAR9) of Change at index 0 (with primary key : [1]) of Changes on TEST table of 'sa/jdbc:h2:mem:test' source] %n" + Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Value at end point of Column at index 8 (column name : VAR9) of Change at index 0 (with primary key : [1]) of Changes on TEST table of 'sa/jdbc:h2:mem:test'] %n" + "Expecting:%n" + " <2014-05-24>%n" + "not to be equal to: %n" diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnValueInequality_IsNotEqualTo_LocalDateTime_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnValueInequality_IsNotEqualTo_LocalDateTime_Test.java index dd5f978a..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(source, "test"); - Changes changes = new Changes(table).setStartPointNow(); + Table 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(source, "test"); - Changes changes = new Changes(table).setStartPointNow(); + Table table = assertDbConnection.table("test").build(); + Changes changes = assertDbConnection.changes().tables(table).build().setStartPointNow(); update("update test set var14 = 1 where var1 = 1"); changes.setEndPointNow(); @@ -69,7 +69,7 @@ public void should_fail_because_value_is_equal_to() { assertThat(changes).change().column("var10").valueAtEndPoint().isNotEqualTo(LocalDateTime.of(2014, 5, 24, 9, 46, 30)); fail("An exception must be raised"); } catch (AssertionError e) { - Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Value at end point of Column at index 9 (column name : VAR10) of Change at index 0 (with primary key : [1]) of Changes on TEST table of 'sa/jdbc:h2:mem:test' source] %n" + Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Value at end point of Column at index 9 (column name : VAR10) of Change at index 0 (with primary key : [1]) of Changes on TEST table of 'sa/jdbc:h2:mem:test'] %n" + "Expecting:%n" + " <2014-05-24T09:46:30.000000000>%n" + "not to be equal to: %n" diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnValueInequality_IsNotEqualTo_LocalDate_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnValueInequality_IsNotEqualTo_LocalDate_Test.java index e8b2ad2b..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(source, "test"); - Changes changes = new Changes(table).setStartPointNow(); + Table 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(source, "test"); - Changes changes = new Changes(table).setStartPointNow(); + Table table = assertDbConnection.table("test").build(); + Changes changes = assertDbConnection.changes().tables(table).build().setStartPointNow(); update("update test set var14 = 1 where var1 = 1"); changes.setEndPointNow(); @@ -69,7 +69,7 @@ public void should_fail_because_value_is_equal_to() { assertThat(changes).change().column("var9").valueAtEndPoint().isNotEqualTo(LocalDate.of(2014, 5, 24)); fail("An exception must be raised"); } catch (AssertionError e) { - Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Value at end point of Column at index 8 (column name : VAR9) of Change at index 0 (with primary key : [1]) of Changes on TEST table of 'sa/jdbc:h2:mem:test' source] %n" + Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Value at end point of Column at index 8 (column name : VAR9) of Change at index 0 (with primary key : [1]) of Changes on TEST table of 'sa/jdbc:h2:mem:test'] %n" + "Expecting:%n" + " <2014-05-24>%n" + "not to be equal to: %n" diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnValueInequality_IsNotEqualTo_LocalTime_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnValueInequality_IsNotEqualTo_LocalTime_Test.java index 742cfbd4..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(source, "test"); - Changes changes = new Changes(table).setStartPointNow(); + Table 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(source, "test"); - Changes changes = new Changes(table).setStartPointNow(); + Table table = assertDbConnection.table("test").build(); + Changes changes = assertDbConnection.changes().tables(table).build().setStartPointNow(); update("update test set var14 = 1 where var1 = 1"); changes.setEndPointNow(); @@ -69,7 +69,7 @@ public void should_fail_because_value_is_equal_to() { assertThat(changes).change().column("var8").valueAtEndPoint().isNotEqualTo(LocalTime.of(9, 46, 30)); fail("An exception must be raised"); } catch (AssertionError e) { - Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Value at end point of Column at index 7 (column name : VAR8) of Change at index 0 (with primary key : [1]) of Changes on TEST table of 'sa/jdbc:h2:mem:test' source] %n" + Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Value at end point of Column at index 7 (column name : VAR8) of Change at index 0 (with primary key : [1]) of Changes on TEST table of 'sa/jdbc:h2:mem:test'] %n" + "Expecting:%n" + " <09:46:30.000000000>%n" + "not to be equal to: %n" diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnValueInequality_IsNotEqualTo_Number_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnValueInequality_IsNotEqualTo_Number_Test.java index 17c12660..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 @@ -29,6 +29,7 @@ * {@link org.assertj.db.api.assertions.AssertOnValueInequality#isNotEqualTo(Number)} method. * * @author Régis Pouiller + * @author Julien Roy */ public class AssertOnValueInequality_IsNotEqualTo_Number_Test extends AbstractTest { @@ -38,8 +39,8 @@ public class AssertOnValueInequality_IsNotEqualTo_Number_Test extends AbstractTe @Test @NeedReload public void test_is_not_equal_to() { - Table table = new Table(source, "test"); - Changes changes = new Changes(table).setStartPointNow(); + Table table = assertDbConnection.table("test").build(); + Changes changes = assertDbConnection.changes().tables(table).build().setStartPointNow(); update("update test set var14 = 1 where var1 = 1"); changes.setEndPointNow(); @@ -58,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(source, "test"); - Changes changes = new Changes(table).setStartPointNow(); + Table table = assertDbConnection.table("test").build(); + Changes changes = assertDbConnection.changes().tables(table).build().setStartPointNow(); update("update test set var14 = 1 where var1 = 1"); changes.setEndPointNow(); @@ -67,7 +68,7 @@ public void should_fail_because_value_is_equal_to() { assertThat(changes).change().column("var3").valueAtEndPoint().isNotEqualTo(2); fail("An exception must be raised"); } catch (AssertionError e) { - Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Value at end point of Column at index 2 (column name : VAR3) of Change at index 0 (with primary key : [1]) of Changes on TEST table of 'sa/jdbc:h2:mem:test' source] %n" + Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Value at end point of Column at index 2 (column name : VAR3) of Change at index 0 (with primary key : [1]) of Changes on TEST table of 'sa/jdbc:h2:mem:test'] %n" + "Expecting:%n" + " <2>%n" + "not to be equal to: %n" diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnValueInequality_IsNotEqualTo_Object_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnValueInequality_IsNotEqualTo_Object_Test.java index b925765c..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 @@ -29,6 +29,7 @@ * {@link org.assertj.db.api.assertions.AssertOnValueInequality#isNotEqualTo(Object)} method. * * @author Régis Pouiller + * @author Julien Roy */ public class AssertOnValueInequality_IsNotEqualTo_Object_Test extends AbstractTest { @@ -38,8 +39,8 @@ public class AssertOnValueInequality_IsNotEqualTo_Object_Test extends AbstractTe @Test @NeedReload public void test_is_not_equal_to() { - Table table = new Table(source, "test"); - Changes changes = new Changes(table).setStartPointNow(); + Table table = assertDbConnection.table("test").build(); + Changes changes = assertDbConnection.changes().tables(table).build().setStartPointNow(); update("update test set var14 = 1 where var1 = 1"); changes.setEndPointNow(); @@ -58,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(source, "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(); @@ -67,7 +68,7 @@ public void should_fail_because_value_is_equal_to() { assertThat(changes).change().column("var3").valueAtEndPoint().isNotEqualTo((Object) null); fail("An exception must be raised"); } catch (AssertionError e) { - Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Value at end point of Column at index 2 (column name : VAR3) of Change at index 0 of Changes on TEST2 table of 'sa/jdbc:h2:mem:test' source] %n" + Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Value at end point of Column at index 2 (column name : VAR3) of Change at index 0 of Changes on TEST2 table of 'sa/jdbc:h2:mem:test'] %n" + "Expecting:%n" + " %n" + "not to be equal to: %n" diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnValueInequality_IsNotEqualTo_String_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnValueInequality_IsNotEqualTo_String_Test.java index c491f36a..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 @@ -29,6 +29,7 @@ * {@link org.assertj.db.api.assertions.AssertOnValueInequality#isNotEqualTo(String)} method. * * @author Régis Pouiller + * @author Julien Roy */ public class AssertOnValueInequality_IsNotEqualTo_String_Test extends AbstractTest { @@ -38,8 +39,8 @@ public class AssertOnValueInequality_IsNotEqualTo_String_Test extends AbstractTe @Test @NeedReload public void test_is_not_equal_to() { - Table table = new Table(source, "test"); - Changes changes = new Changes(table).setStartPointNow(); + Table table = assertDbConnection.table("test").build(); + Changes changes = assertDbConnection.changes().tables(table).build().setStartPointNow(); update("update test set var14 = 1 where var1 = 1"); changes.setEndPointNow(); @@ -58,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(source, "test"); - Changes changes = new Changes(table).setStartPointNow(); + Table table = assertDbConnection.table("test").build(); + Changes changes = assertDbConnection.changes().tables(table).build().setStartPointNow(); update("update test set var14 = 1 where var1 = 1"); changes.setEndPointNow(); @@ -67,7 +68,7 @@ public void should_fail_because_value_is_equal_to() { assertThat(changes).change().column("var12").valueAtEndPoint().isNotEqualTo("text"); fail("An exception must be raised"); } catch (AssertionError e) { - Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Value at end point of Column at index 11 (column name : VAR12) of Change at index 0 (with primary key : [1]) of Changes on TEST table of 'sa/jdbc:h2:mem:test' source] %n" + Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Value at end point of Column at index 11 (column name : VAR12) of Change at index 0 (with primary key : [1]) of Changes on TEST table of 'sa/jdbc:h2:mem:test'] %n" + "Expecting:%n" + " <\"text\">%n" + "not to be equal to: %n" diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnValueInequality_IsNotEqualTo_TimeValue_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnValueInequality_IsNotEqualTo_TimeValue_Test.java index 7fdc6825..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 @@ -30,6 +30,7 @@ * {@link org.assertj.db.api.assertions.AssertOnValueInequality#isNotEqualTo(org.assertj.db.type.TimeValue)} method. * * @author Régis Pouiller + * @author Julien Roy */ public class AssertOnValueInequality_IsNotEqualTo_TimeValue_Test extends AbstractTest { @@ -39,8 +40,8 @@ public class AssertOnValueInequality_IsNotEqualTo_TimeValue_Test extends Abstrac @Test @NeedReload public void test_is_not_equal_to() { - Table table = new Table(source, "test"); - Changes changes = new Changes(table).setStartPointNow(); + Table 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 +60,8 @@ public void test_is_not_equal_to() { @Test @NeedReload public void should_fail_because_value_is_equal_to() { - Table table = new Table(source, "test"); - Changes changes = new Changes(table).setStartPointNow(); + Table 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,7 +69,7 @@ public void should_fail_because_value_is_equal_to() { assertThat(changes).change().column("var8").valueAtEndPoint().isNotEqualTo(TimeValue.of(9, 46, 30)); fail("An exception must be raised"); } catch (AssertionError e) { - Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Value at end point of Column at index 7 (column name : VAR8) of Change at index 0 (with primary key : [1]) of Changes on TEST table of 'sa/jdbc:h2:mem:test' source] %n" + Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Value at end point of Column at index 7 (column name : VAR8) of Change at index 0 (with primary key : [1]) of Changes on TEST table of 'sa/jdbc:h2:mem:test'] %n" + "Expecting:%n" + " <09:46:30.000000000>%n" + "not to be equal to: %n" diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnValueInequality_IsNotEqualTo_UUID_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnValueInequality_IsNotEqualTo_UUID_Test.java index 9774ce14..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(source, "test"); - 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(source, "test"); - 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(); @@ -73,7 +73,7 @@ public void should_fail_because_value_is_equal_to() { fail("An exception must be raised"); } catch (AssertionError e) { Assertions.assertThat(e.getMessage()).isEqualTo(String.format( - "[Value at end point of Column at index 14 (column name : VAR15) of Change at index 0 (with primary key : [1]) of Changes on TEST table of 'sa/jdbc:h2:mem:test' source] %n" + "[Value at end point of Column at index 14 (column name : VAR15) of Change at index 0 (with primary key : [1]) of Changes on TEST table of 'sa/jdbc:h2:mem:test'] %n" + "Expecting:%n" + " %n" + "not to be equal to: %n" diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnValueInequality_IsNotZero_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnValueInequality_IsNotZero_Test.java index 316670d0..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 @@ -29,6 +29,7 @@ * {@link org.assertj.db.api.assertions.AssertOnValueInequality#isNotZero()} method. * * @author Régis Pouiller + * @author Julien Roy */ public class AssertOnValueInequality_IsNotZero_Test extends AbstractTest { @@ -38,8 +39,8 @@ public class AssertOnValueInequality_IsNotZero_Test extends AbstractTest { @Test @NeedReload public void test_is_not_zero() { - Table table = new Table(source, "test"); - Changes changes = new Changes(table).setStartPointNow(); + Table table = assertDbConnection.table("test").build(); + Changes changes = assertDbConnection.changes().tables(table).build().setStartPointNow(); update("update test set var14 = 1 where var1 = 1"); changes.setEndPointNow(); @@ -58,8 +59,8 @@ public void test_is_not_zero() { @Test @NeedReload public void should_fail_because_value_is_zero() { - Table table = new Table(source, "test"); - Changes changes = new Changes(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(); @@ -67,7 +68,7 @@ public void should_fail_because_value_is_zero() { assertThat(changes).change().column("var3").valueAtEndPoint().isNotZero(); fail("An exception must be raised"); } catch (AssertionError e) { - Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Value at end point of Column at index 2 (column name : VAR3) of Change at index 0 (with primary key : [1000]) of Changes on TEST table of 'sa/jdbc:h2:mem:test' source] %n" + Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Value at end point of Column at index 2 (column name : VAR3) of Change at index 0 (with primary key : [1000]) of Changes on TEST table of 'sa/jdbc:h2:mem:test'] %n" + "Expecting:%n" + " <0>%n" + "not to be equal to: %n" diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnValueNullity_IsNotNull_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnValueNullity_IsNotNull_Test.java index 2d878b8f..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 @@ -29,6 +29,7 @@ * {@link org.assertj.db.api.assertions.AssertOnValueNullity#isNotNull()} method. * * @author Régis Pouiller + * @author Julien Roy */ public class AssertOnValueNullity_IsNotNull_Test extends AbstractTest { @@ -38,8 +39,8 @@ public class AssertOnValueNullity_IsNotNull_Test extends AbstractTest { @Test @NeedReload public void test_is_not_null() { - Table table = new Table(source, "test"); - Changes changes = new Changes(table).setStartPointNow(); + Table table = assertDbConnection.table("test").build(); + Changes changes = assertDbConnection.changes().tables(table).build().setStartPointNow(); update("update test set var14 = 1 where var1 = 1"); changes.setEndPointNow(); @@ -58,8 +59,8 @@ public void test_is_not_null() { @Test @NeedReload public void should_fail_because_value_is_null() { - Table table = new Table(source, "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(); @@ -67,7 +68,7 @@ public void should_fail_because_value_is_null() { assertThat(changes).change().column("var3").valueAtEndPoint().isNotNull(); fail("An exception must be raised"); } catch (AssertionError e) { - Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Value at end point of Column at index 2 (column name : VAR3) of Change at index 0 of Changes on TEST2 table of 'sa/jdbc:h2:mem:test' source] %n" + Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Value at end point of Column at index 2 (column name : VAR3) of Change at index 0 of Changes on TEST2 table of 'sa/jdbc:h2:mem:test'] %n" + "Expecting actual not to be null")); } try { diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnValueNullity_IsNull_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnValueNullity_IsNull_Test.java index b786ed8c..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 @@ -29,6 +29,7 @@ * {@link org.assertj.db.api.assertions.AssertOnValueNullity#isNull()} method. * * @author Régis Pouiller + * @author Julien Roy */ public class AssertOnValueNullity_IsNull_Test extends AbstractTest { @@ -38,8 +39,8 @@ public class AssertOnValueNullity_IsNull_Test extends AbstractTest { @Test @NeedReload public void test_is_null() { - Table table = new Table(source, "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(); @@ -58,8 +59,8 @@ public void test_is_null() { @Test @NeedReload public void should_fail_because_value_is_not_null() { - Table table = new Table(source, "test"); - Changes changes = new Changes(table).setStartPointNow(); + Table table = assertDbConnection.table("test").build(); + Changes changes = assertDbConnection.changes().tables(table).build().setStartPointNow(); update("update test set var14 = 1 where var1 = 1"); changes.setEndPointNow(); @@ -67,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' source] 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 4d583307..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 @@ -29,6 +29,7 @@ * {@link org.assertj.db.api.assertions.AssertOnValueType#isBoolean()} method. * * @author Régis Pouiller + * @author Julien Roy */ public class AssertOnValueType_IsBoolean_Test extends AbstractTest { @@ -38,8 +39,8 @@ public class AssertOnValueType_IsBoolean_Test extends AbstractTest { @Test @NeedReload public void test_is_boolean() { - Table table = new Table(source, "test"); - Changes changes = new Changes(table).setStartPointNow(); + Table table = assertDbConnection.table("test").build(); + Changes changes = assertDbConnection.changes().tables(table).build().setStartPointNow(); update("update test set var14 = 1 where var1 = 1"); changes.setEndPointNow(); @@ -58,8 +59,8 @@ public void test_is_boolean() { @Test @NeedReload public void should_fail_because_value_is_not_a_boolean() { - Table table = new Table(source, "test"); - Changes changes = new Changes(table).setStartPointNow(); + Table table = assertDbConnection.table("test").build(); + Changes changes = assertDbConnection.changes().tables(table).build().setStartPointNow(); update("update test set var14 = 1 where var1 = 1"); changes.setEndPointNow(); @@ -67,7 +68,7 @@ public void should_fail_because_value_is_not_a_boolean() { assertThat(changes).change().column("var1").valueAtEndPoint().isBoolean(); fail("An exception must be raised"); } catch (AssertionError e) { - Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Value at end point of Column at index 0 (column name : VAR1) of Change at index 0 (with primary key : [1]) of Changes on TEST table of 'sa/jdbc:h2:mem:test' source] %n" + Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Value at end point of Column at index 0 (column name : VAR1) of Change at index 0 (with primary key : [1]) of Changes on TEST table of 'sa/jdbc:h2:mem:test'] %n" + "Expecting:%n" + " <1>%n" + "to be of type%n" diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnValueType_IsBytes_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnValueType_IsBytes_Test.java index f1551b72..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 @@ -29,6 +29,7 @@ * {@link org.assertj.db.api.assertions.AssertOnValueType#isBytes()} method. * * @author Régis Pouiller + * @author Julien Roy */ public class AssertOnValueType_IsBytes_Test extends AbstractTest { @@ -38,8 +39,8 @@ public class AssertOnValueType_IsBytes_Test extends AbstractTest { @Test @NeedReload public void test_is_bytes() { - Table table = new Table(source, "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(); @@ -58,8 +59,8 @@ public void test_is_bytes() { @Test @NeedReload public void should_fail_because_value_is_not_bytes() { - Table table = new Table(source, "test"); - Changes changes = new Changes(table).setStartPointNow(); + Table table = assertDbConnection.table("test").build(); + Changes changes = assertDbConnection.changes().tables(table).build().setStartPointNow(); update("update test set var14 = 1 where var1 = 1"); changes.setEndPointNow(); @@ -67,7 +68,7 @@ public void should_fail_because_value_is_not_bytes() { assertThat(changes).change().column("var1").valueAtEndPoint().isBytes(); fail("An exception must be raised"); } catch (AssertionError e) { - Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Value at end point of Column at index 0 (column name : VAR1) of Change at index 0 (with primary key : [1]) of Changes on TEST table of 'sa/jdbc:h2:mem:test' source] %n" + Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Value at end point of Column at index 0 (column name : VAR1) of Change at index 0 (with primary key : [1]) of Changes on TEST table of 'sa/jdbc:h2:mem:test'] %n" + "Expecting:%n" + " <1>%n" + "to be of type%n" diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnValueType_IsDateTime_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnValueType_IsDateTime_Test.java index f9ddc273..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 @@ -29,6 +29,7 @@ * {@link org.assertj.db.api.assertions.AssertOnValueType#isDateTime()} method. * * @author Régis Pouiller + * @author Julien Roy */ public class AssertOnValueType_IsDateTime_Test extends AbstractTest { @@ -38,8 +39,8 @@ public class AssertOnValueType_IsDateTime_Test extends AbstractTest { @Test @NeedReload public void test_is_date_time() { - Table table = new Table(source, "test"); - Changes changes = new Changes(table).setStartPointNow(); + Table table = assertDbConnection.table("test").build(); + Changes changes = assertDbConnection.changes().tables(table).build().setStartPointNow(); update("update test set var14 = 1 where var1 = 1"); changes.setEndPointNow(); @@ -58,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(source, "test"); - Changes changes = new Changes(table).setStartPointNow(); + Table table = assertDbConnection.table("test").build(); + Changes changes = assertDbConnection.changes().tables(table).build().setStartPointNow(); update("update test set var14 = 1 where var1 = 1"); changes.setEndPointNow(); @@ -67,7 +68,7 @@ public void should_fail_because_value_is_not_a_date_time() { assertThat(changes).change().column("var1").valueAtEndPoint().isDateTime(); fail("An exception must be raised"); } catch (AssertionError e) { - Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Value at end point of Column at index 0 (column name : VAR1) of Change at index 0 (with primary key : [1]) of Changes on TEST table of 'sa/jdbc:h2:mem:test' source] %n" + Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Value at end point of Column at index 0 (column name : VAR1) of Change at index 0 (with primary key : [1]) of Changes on TEST table of 'sa/jdbc:h2:mem:test'] %n" + "Expecting:%n" + " <1>%n" + "to be of type%n" diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnValueType_IsDate_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnValueType_IsDate_Test.java index 84296047..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 @@ -29,6 +29,7 @@ * {@link org.assertj.db.api.assertions.AssertOnValueType#isDate()} method. * * @author Régis Pouiller + * @author Julien Roy */ public class AssertOnValueType_IsDate_Test extends AbstractTest { @@ -38,8 +39,8 @@ public class AssertOnValueType_IsDate_Test extends AbstractTest { @Test @NeedReload public void test_is_date() { - Table table = new Table(source, "test"); - Changes changes = new Changes(table).setStartPointNow(); + Table table = assertDbConnection.table("test").build(); + Changes changes = assertDbConnection.changes().tables(table).build().setStartPointNow(); update("update test set var14 = 1 where var1 = 1"); changes.setEndPointNow(); @@ -58,8 +59,8 @@ public void test_is_date() { @Test @NeedReload public void should_fail_because_value_is_not_a_date() { - Table table = new Table(source, "test"); - Changes changes = new Changes(table).setStartPointNow(); + Table table = assertDbConnection.table("test").build(); + Changes changes = assertDbConnection.changes().tables(table).build().setStartPointNow(); update("update test set var14 = 1 where var1 = 1"); changes.setEndPointNow(); @@ -67,7 +68,7 @@ public void should_fail_because_value_is_not_a_date() { assertThat(changes).change().column("var1").valueAtEndPoint().isDate(); fail("An exception must be raised"); } catch (AssertionError e) { - Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Value at end point of Column at index 0 (column name : VAR1) of Change at index 0 (with primary key : [1]) of Changes on TEST table of 'sa/jdbc:h2:mem:test' source] %n" + Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Value at end point of Column at index 0 (column name : VAR1) of Change at index 0 (with primary key : [1]) of Changes on TEST table of 'sa/jdbc:h2:mem:test'] %n" + "Expecting:%n" + " <1>%n" + "to be of type%n" diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnValueType_IsNumber_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnValueType_IsNumber_Test.java index 7f8789d9..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 @@ -29,6 +29,7 @@ * {@link org.assertj.db.api.assertions.AssertOnValueType#isNumber()} method. * * @author Régis Pouiller + * @author Julien Roy */ public class AssertOnValueType_IsNumber_Test extends AbstractTest { @@ -38,8 +39,8 @@ public class AssertOnValueType_IsNumber_Test extends AbstractTest { @Test @NeedReload public void test_is_number() { - Table table = new Table(source, "test"); - Changes changes = new Changes(table).setStartPointNow(); + Table table = assertDbConnection.table("test").build(); + Changes changes = assertDbConnection.changes().tables(table).build().setStartPointNow(); update("update test set var14 = 1 where var1 = 1"); changes.setEndPointNow(); @@ -58,8 +59,8 @@ public void test_is_number() { @Test @NeedReload public void should_fail_because_value_is_not_a_number() { - Table table = new Table(source, "test"); - Changes changes = new Changes(table).setStartPointNow(); + Table table = assertDbConnection.table("test").build(); + Changes changes = assertDbConnection.changes().tables(table).build().setStartPointNow(); update("update test set var14 = 1 where var1 = 1"); changes.setEndPointNow(); @@ -67,7 +68,7 @@ public void should_fail_because_value_is_not_a_number() { assertThat(changes).change().column("var2").valueAtEndPoint().isNumber(); fail("An exception must be raised"); } catch (AssertionError e) { - Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Value at end point of Column at index 1 (column name : VAR2) of Change at index 0 (with primary key : [1]) of Changes on TEST table of 'sa/jdbc:h2:mem:test' source] %n" + Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Value at end point of Column at index 1 (column name : VAR2) of Change at index 0 (with primary key : [1]) of Changes on TEST table of 'sa/jdbc:h2:mem:test'] %n" + "Expecting:%n" + " %n" + "to be of type%n" diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnValueType_IsOfAnyTypeIn_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnValueType_IsOfAnyTypeIn_Test.java index 1f67c697..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 @@ -30,6 +30,7 @@ * {@link org.assertj.db.api.assertions.AssertOnValueType#isOfAnyTypeIn(org.assertj.db.type.ValueType...)} method. * * @author Régis Pouiller + * @author Julien Roy */ public class AssertOnValueType_IsOfAnyTypeIn_Test extends AbstractTest { @@ -39,8 +40,8 @@ public class AssertOnValueType_IsOfAnyTypeIn_Test extends AbstractTest { @Test @NeedReload public void test_is_of_any_of_types() { - Table table = new Table(source, "test"); - Changes changes = new Changes(table).setStartPointNow(); + Table 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 +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(source, "test"); - Changes changes = new Changes(table).setStartPointNow(); + Table 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,7 +69,7 @@ public void should_fail_because_value_is_not_of_any_of_types() { assertThat(changes).change().column("var1").valueAtEndPoint().isOfAnyTypeIn(ValueType.BOOLEAN); fail("An exception must be raised"); } catch (AssertionError e) { - Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Value at end point of Column at index 0 (column name : VAR1) of Change at index 0 (with primary key : [1]) of Changes on TEST table of 'sa/jdbc:h2:mem:test' source] %n" + Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Value at end point of Column at index 0 (column name : VAR1) of Change at index 0 (with primary key : [1]) of Changes on TEST table of 'sa/jdbc:h2:mem:test'] %n" + "Expecting:%n" + " <1>%n" + "to be of type%n" diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnValueType_IsOfType_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnValueType_IsOfType_Test.java index d59e7677..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 @@ -30,6 +30,7 @@ * {@link org.assertj.db.api.assertions.AssertOnValueType#isOfType(org.assertj.db.type.ValueType)} method. * * @author Régis Pouiller + * @author Julien Roy */ public class AssertOnValueType_IsOfType_Test extends AbstractTest { @@ -39,8 +40,8 @@ public class AssertOnValueType_IsOfType_Test extends AbstractTest { @Test @NeedReload public void test_is_of_type() { - Table table = new Table(source, "test"); - Changes changes = new Changes(table).setStartPointNow(); + Table 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 +60,8 @@ public void test_is_of_type() { @Test @NeedReload public void should_fail_because_value_is_not_of_type() { - Table table = new Table(source, "test"); - Changes changes = new Changes(table).setStartPointNow(); + Table 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,7 +69,7 @@ public void should_fail_because_value_is_not_of_type() { assertThat(changes).change().column("var1").valueAtEndPoint().isOfType(ValueType.BOOLEAN); fail("An exception must be raised"); } catch (AssertionError e) { - Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Value at end point of Column at index 0 (column name : VAR1) of Change at index 0 (with primary key : [1]) of Changes on TEST table of 'sa/jdbc:h2:mem:test' source] %n" + Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Value at end point of Column at index 0 (column name : VAR1) of Change at index 0 (with primary key : [1]) of Changes on TEST table of 'sa/jdbc:h2:mem:test'] %n" + "Expecting:%n" + " <1>%n" + "to be of type%n" diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnValueType_IsText_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnValueType_IsText_Test.java index bd67720a..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 @@ -29,6 +29,7 @@ * {@link org.assertj.db.api.assertions.AssertOnValueType#isText()} method. * * @author Régis Pouiller + * @author Julien Roy */ public class AssertOnValueType_IsText_Test extends AbstractTest { @@ -38,8 +39,8 @@ public class AssertOnValueType_IsText_Test extends AbstractTest { @Test @NeedReload public void test_is_text() { - Table table = new Table(source, "test"); - Changes changes = new Changes(table).setStartPointNow(); + Table table = assertDbConnection.table("test").build(); + Changes changes = assertDbConnection.changes().tables(table).build().setStartPointNow(); update("update test set var14 = 1 where var1 = 1"); changes.setEndPointNow(); @@ -58,8 +59,8 @@ public void test_is_text() { @Test @NeedReload public void should_fail_because_value_is_not_a_text() { - Table table = new Table(source, "test"); - Changes changes = new Changes(table).setStartPointNow(); + Table table = assertDbConnection.table("test").build(); + Changes changes = assertDbConnection.changes().tables(table).build().setStartPointNow(); update("update test set var14 = 1 where var1 = 1"); changes.setEndPointNow(); @@ -67,7 +68,7 @@ public void should_fail_because_value_is_not_a_text() { assertThat(changes).change().column("var1").valueAtEndPoint().isText(); fail("An exception must be raised"); } catch (AssertionError e) { - Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Value at end point of Column at index 0 (column name : VAR1) of Change at index 0 (with primary key : [1]) of Changes on TEST table of 'sa/jdbc:h2:mem:test' source] %n" + Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Value at end point of Column at index 0 (column name : VAR1) of Change at index 0 (with primary key : [1]) of Changes on TEST table of 'sa/jdbc:h2:mem:test'] %n" + "Expecting:%n" + " <1>%n" + "to be of type%n" diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnValueType_IsTime_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnValueType_IsTime_Test.java index f2f09360..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 @@ -29,6 +29,7 @@ * {@link org.assertj.db.api.assertions.AssertOnValueType#isTime()} method. * * @author Régis Pouiller + * @author Julien Roy */ public class AssertOnValueType_IsTime_Test extends AbstractTest { @@ -38,8 +39,8 @@ public class AssertOnValueType_IsTime_Test extends AbstractTest { @Test @NeedReload public void test_is_time() { - Table table = new Table(source, "test"); - Changes changes = new Changes(table).setStartPointNow(); + Table table = assertDbConnection.table("test").build(); + Changes changes = assertDbConnection.changes().tables(table).build().setStartPointNow(); update("update test set var14 = 1 where var1 = 1"); changes.setEndPointNow(); @@ -58,8 +59,8 @@ public void test_is_time() { @Test @NeedReload public void should_fail_because_value_is_not_a_time() { - Table table = new Table(source, "test"); - Changes changes = new Changes(table).setStartPointNow(); + Table table = assertDbConnection.table("test").build(); + Changes changes = assertDbConnection.changes().tables(table).build().setStartPointNow(); update("update test set var14 = 1 where var1 = 1"); changes.setEndPointNow(); @@ -67,7 +68,7 @@ public void should_fail_because_value_is_not_a_time() { assertThat(changes).change().column("var1").valueAtEndPoint().isTime(); fail("An exception must be raised"); } catch (AssertionError e) { - Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Value at end point of Column at index 0 (column name : VAR1) of Change at index 0 (with primary key : [1]) of Changes on TEST table of 'sa/jdbc:h2:mem:test' source] %n" + Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Value at end point of Column at index 0 (column name : VAR1) of Change at index 0 (with primary key : [1]) of Changes on TEST table of 'sa/jdbc:h2:mem:test'] %n" + "Expecting:%n" + " <1>%n" + "to be of type%n" diff --git a/src/test/java/org/assertj/db/api/assertions/AssertOnValueType_IsUUID_Test.java b/src/test/java/org/assertj/db/api/assertions/AssertOnValueType_IsUUID_Test.java index 7ccc1627..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(source, "test"); - 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(source, "test"); - Changes changes = new Changes(table).setStartPointNow(); + Table 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,7 +68,7 @@ public void should_fail_because_value_is_not_a_UUID() { fail("An exception must be raised"); } catch (AssertionError e) { Assertions.assertThat(e.getMessage()).isEqualTo(String.format( - "[Value at end point of Column at index 0 (column name : VAR1) of Change at index 0 (with primary key : [1]) of Changes on TEST table of 'sa/jdbc:h2:mem:test' source] %n" + "[Value at end point of Column at index 0 (column name : VAR1) of Change at index 0 (with primary key : [1]) of Changes on TEST table of 'sa/jdbc:h2:mem:test'] %n" + "Expecting:%n" + " <1>%n" + "to be of type%n" diff --git a/src/test/java/org/assertj/db/api/assertions/BDDAssertions_Test.java b/src/test/java/org/assertj/db/api/assertions/BDDAssertions_Test.java index 1f5cb668..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 @@ -28,6 +28,7 @@ * Test on {@code BDDAssertions} methods. * * @author Régis Pouiller + * @author Julien Roy */ public class BDDAssertions_Test extends AbstractTest { @@ -35,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(source, "test"); + public void test_then_for_table() { + Table table = assertDbConnection.table("test").build(); Assertions.assertThat(then(table)).isInstanceOf(TableAssert.class); } @@ -44,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(source, "select * from test"); + public void test_then_for_request() { + Request request = assertDbConnection.request("select * from test").build(); Assertions.assertThat(then(request)).isInstanceOf(RequestAssert.class); } @@ -53,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(source); + 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 23f5f2f7..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,19 +12,17 @@ */ package org.assertj.db.api.assertions.impl; +import static org.junit.Assert.fail; + +import java.sql.Time; + import org.assertj.core.api.Assertions; import org.assertj.core.api.WritableAssertionInfo; import org.assertj.db.api.TableAssert; import org.assertj.db.common.AbstractTest; -import org.assertj.db.type.Table; import org.assertj.db.type.TimeValue; import org.junit.Test; -import java.sql.Time; - -import static org.assertj.db.api.Assertions.assertThat; -import static org.junit.Assert.fail; - /** * Tests on {@link org.assertj.db.api.assertions.impl.AssertionsOnColumnOfChangeEquality} class : * {@link org.assertj.db.api.assertions.impl.AssertionsOnColumnOfChangeEquality#hasValues(org.assertj.db.api.AbstractAssert, org.assertj.core.api.WritableAssertionInfo, org.assertj.db.type.Value, org.assertj.db.type.Value, TimeValue)} method. @@ -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 ff1291f1..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,16 +12,14 @@ */ package org.assertj.db.api.assertions.impl; +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; -import static org.assertj.db.api.Assertions.assertThat; -import static org.junit.Assert.fail; - /** * Tests on {@link AssertionsOnColumnOfChangeType} class : * {@link AssertionsOnColumnOfChangeType#isBoolean(org.assertj.db.api.AbstractAssert, org.assertj.core.api.WritableAssertionInfo, org.assertj.db.type.Value, org.assertj.db.type.Value, boolean)} method. @@ -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 6a315543..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,16 +12,14 @@ */ package org.assertj.db.api.assertions.impl; +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; -import static org.assertj.db.api.Assertions.assertThat; -import static org.junit.Assert.fail; - /** * Tests on {@link org.assertj.db.api.assertions.impl.AssertionsOnColumnOfChangeType} class : * {@link org.assertj.db.api.assertions.impl.AssertionsOnColumnOfChangeType#isNumber(org.assertj.db.api.AbstractAssert, org.assertj.core.api.WritableAssertionInfo, org.assertj.db.type.Value, org.assertj.db.type.Value, boolean)} method. @@ -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 08f60803..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,19 +12,17 @@ */ package org.assertj.db.api.assertions.impl; +import static org.junit.Assert.fail; + +import java.util.Locale; + import org.assertj.core.api.Assertions; import org.assertj.core.api.WritableAssertionInfo; import org.assertj.db.api.TableAssert; import org.assertj.db.common.AbstractTest; -import org.assertj.db.type.Table; import org.assertj.db.type.ValueType; import org.junit.Test; -import java.util.Locale; - -import static org.assertj.db.api.Assertions.assertThat; -import static org.junit.Assert.fail; - /** * Tests on {@link AssertionsOnColumnOfChangeType} class : * {@link AssertionsOnColumnOfChangeType#isOfType(org.assertj.db.api.AbstractAssert, org.assertj.core.api.WritableAssertionInfo, org.assertj.db.type.Value, org.assertj.db.type.Value, org.assertj.db.type.ValueType, boolean)} method. @@ -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 10404e16..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,20 +12,18 @@ */ package org.assertj.db.api.assertions.impl; +import static org.junit.Assert.fail; + +import java.sql.Date; +import java.util.Arrays; + import org.assertj.core.api.Assertions; import org.assertj.core.api.WritableAssertionInfo; import org.assertj.db.api.TableAssert; import org.assertj.db.common.AbstractTest; import org.assertj.db.type.Row; -import org.assertj.db.type.Table; import org.junit.Test; -import java.sql.Date; -import java.util.Arrays; - -import static org.assertj.db.api.Assertions.assertThat; -import static org.junit.Assert.fail; - /** * Tests on {@link AssertionsOnRowOfChangeExistence} class : * {@link AssertionsOnRowOfChangeExistence#exists(org.assertj.db.api.AbstractAssert, org.assertj.core.api.WritableAssertionInfo, org.assertj.db.type.Row)} method. @@ -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 f75c6b3c..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,23 +12,23 @@ */ package org.assertj.db.api.assertions.impl; +import static org.junit.Assert.fail; + +import java.sql.SQLException; +import javax.sql.DataSource; + import org.assertj.core.api.Assertions; import org.assertj.core.api.WritableAssertionInfo; import org.assertj.db.api.AbstractDbAssert; import org.assertj.db.api.TableAssert; import org.assertj.db.common.AbstractTest; -import org.assertj.db.type.Source; -import org.assertj.db.type.Table; +import org.assertj.db.common.DefaultConnectionProvider; +import org.assertj.db.type.JdbcUrlConnectionProvider; import org.junit.Test; -import javax.sql.DataSource; - -import static org.assertj.db.api.Assertions.assertThat; -import static org.junit.Assert.fail; - /** * Tests on {@link AssertionsOnTableExistence} class : - * {@link AssertionsOnTableExistence#doesNotExists(AbstractDbAssert, WritableAssertionInfo, String, Source, DataSource)} method. + * {@link AssertionsOnTableExistence#doesNotExists(AbstractDbAssert, WritableAssertionInfo, String, JdbcUrlConnectionProvider, DataSource)} method. * * @author Julien Roy */ @@ -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", source, null); + 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", null, dataSource); - 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); - try { - AssertionsOnTableExistence.doesNotExists(tableAssert, info, "TEST", source, null); - fail("An exception must be raised"); - } catch (AssertionError e) { - Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[description] %n" - + "Expecting not exist but exists")); - } - + TableAssert tableAssert = new TableAssert(null); try { - AssertionsOnTableExistence.doesNotExists(tableAssert, info, "TEST", null, dataSource); + 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 8f77159f..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.Source; -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, Source, 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", source, null); + 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", null, dataSource); - 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", source, null); - 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", null, dataSource); + 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 a28ceb67..33d75960 100644 --- a/src/test/java/org/assertj/db/common/AbstractTest.java +++ b/src/test/java/org/assertj/db/common/AbstractTest.java @@ -33,6 +33,8 @@ 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; @@ -40,7 +42,6 @@ import org.assertj.db.type.DataType; import org.assertj.db.type.Request; import org.assertj.db.type.Row; -import org.assertj.db.type.Source; import org.assertj.db.type.Table; import org.assertj.db.type.Value; import org.assertj.db.type.lettercase.LetterCase; @@ -60,9 +61,10 @@ import com.ninja_squad.dbsetup.operation.Operation; /** - * Parent for all the tests. It contains the variables like a {@code DataSource} and a {@code Source}. + * Parent for all the tests. It contains the variables like a {@code DataSource} and a {@code ConnectionProvider}. * * @author Régis Pouiller + * @author Julien Roy */ @RunWith(SpringJUnit4ClassRunner.class) @ContextConfiguration(classes = {TestsConfiguration.class}) @@ -129,12 +131,44 @@ public abstract class AbstractTest { private static final DbSetup DB_SETUP = new DbSetup(new DriverManagerDestination("jdbc:h2:mem:test", "SA", ""), OPERATIONS); private static final DbSetupTracker DB_SETUP_TRACKER = new DbSetupTracker(); - protected final Source source = new Source("jdbc:h2:mem:test", "sa", ""); + protected final AssertDbConnection assertDbConnection = AssertDbConnectionFactory.of("jdbc:h2:mem:test", "sa", "").create(); @Rule public TestName testNameRule = new TestName(); @Autowired protected DataSource dataSource; + /** + * Returns an instance of a {@code Value}. + * + * @param columnName The name of the column. + * @param object The object in the value. + * @return An instance. + * @throws Exception Exception + */ + protected static Value getValue(String columnName, Object object) throws Exception { + Constructor constructor = Value.class.getDeclaredConstructor(String.class, Object.class, LetterCase.class); + constructor.setAccessible(true); + Value value = constructor.newInstance(columnName, object, LetterCase.COLUMN_DEFAULT); + return value; + } + + /** + * Returns an instance of a {@code Changes}. + * + * @param changesList The list of changes. + * @return An instance. + * @throws Exception Exception + */ + protected static Changes getChanges(List changesList) throws Exception { + Constructor constructor = Changes.class.getDeclaredConstructor(); + constructor.setAccessible(true); + Changes changes = constructor.newInstance(); + Field field = Changes.class.getDeclaredField("changesList"); + field.setAccessible(true); + field.set(changes, changesList); + return changes; + } + /** * Returns an instance of a {@code Column}. * @@ -225,38 +259,6 @@ protected static Request getRequest(List columnsNameList, List p return request; } - /** - * Returns an instance of a {@code Value}. - * - * @param columnName The name of the column. - * @param object The object in the value. - * @return An instance. - * @throws Exception Exception - */ - protected static Value getValue(String columnName, Object object) throws Exception { - Constructor constructor = Value.class.getDeclaredConstructor(String.class, Object.class, LetterCase.class); - constructor.setAccessible(true); - Value value = constructor.newInstance(columnName, object, LetterCase.COLUMN_DEFAULT); - return value; - } - - /** - * Returns an instance of a {@code Changes}. - * - * @param changesList The list of changes. - * @return An instance. - * @throws Exception Exception - */ - protected static Changes getChanges(List changesList) throws Exception { - Constructor constructor = Changes.class.getDeclaredConstructor(); - constructor.setAccessible(true); - Changes changes = constructor.newInstance(); - Field field = Changes.class.getDeclaredField("changesList"); - field.setAccessible(true); - field.set(changes, changesList); - return changes; - } - /** * Returns an instance of a {@code Change}. * 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/common/NeedReload.java b/src/test/java/org/assertj/db/common/NeedReload.java index a895fb63..f3199008 100644 --- a/src/test/java/org/assertj/db/common/NeedReload.java +++ b/src/test/java/org/assertj/db/common/NeedReload.java @@ -19,7 +19,7 @@ import java.lang.annotation.Target; /** - * Indicates that after the tests it need to reload the data. + * Indicates that after the tests it needs to reload the data. * * @author Régis Pouiller */ diff --git a/src/test/java/org/assertj/db/database/h2/AbstractH2Test.java b/src/test/java/org/assertj/db/database/h2/AbstractH2Test.java index df53df8f..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.DataSourceWithLetterCase; -import org.assertj.db.type.SourceWithLetterCase; +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; @@ -39,6 +39,7 @@ * Parent for all the tests which are specific for H2 database. * * @author Régis Pouiller + * @author Julien Roy */ @ContextConfiguration(classes = {H2Configuration.class}) public abstract class AbstractH2Test extends AbstractDatabaseTest { @@ -77,22 +78,22 @@ public abstract class AbstractH2Test extends AbstractDatabaseTest { private static final Operation OPERATIONS = sequenceOf(DELETE_ALL, INSERT_TEST, SQL); private static final DbSetup DB_SETUP = new DbSetup(new DriverManagerDestination("jdbc:h2:mem:testH2", "SA", ""), OPERATIONS); private static final DbSetupTracker DB_SETUP_TRACKER = new DbSetupTracker(); - protected final SourceWithLetterCase sourceDDD = new SourceWithLetterCase("jdbc:h2:mem:testH2", "sa", "", + protected final AssertDbConnection jdbcConnectionDDD = AssertDbConnectionFactory.of("jdbc:h2:mem:testH2", "sa", "").letterCase( LetterCase.TABLE_DEFAULT, LetterCase.COLUMN_DEFAULT, - LetterCase.PRIMARY_KEY_DEFAULT); - protected final SourceWithLetterCase sourceUIUIUI = new SourceWithLetterCase("jdbc:h2:mem:testH2", "sa", "", + LetterCase.PRIMARY_KEY_DEFAULT).create(); + protected final AssertDbConnection jdbcConnectionUIUIUI = AssertDbConnectionFactory.of("jdbc:h2:mem:testH2", "sa", "").letterCase( letterCaseUI, letterCaseUI, - letterCaseUI); - protected final SourceWithLetterCase sourceNSNSNS = new SourceWithLetterCase("jdbc:h2:mem:testH2", "sa", "", + letterCaseUI).create(); + protected final AssertDbConnection jdbcConnectionNSNSNS = AssertDbConnectionFactory.of("jdbc:h2:mem:testH2", "sa", "").letterCase( letterCaseNS, letterCaseNS, - letterCaseNS); + letterCaseNS).create(); protected DataSource dataSource; - protected DataSourceWithLetterCase dataSourceDDD; - protected DataSourceWithLetterCase dataSourceUIUIUI; - protected DataSourceWithLetterCase dataSourceNSNSNS; + protected AssertDbConnection dsConnectionDDD; + protected AssertDbConnection dsConnectionUIUIUI; + protected AssertDbConnection dsConnectionNSNSNS; protected DbSetup getDbSetup() { return DB_SETUP; @@ -105,11 +106,9 @@ protected DbSetupTracker getDbSetupTracker() { @Autowired protected void setDataSource(DataSource dataSource) { this.dataSource = dataSource; - this.dataSourceDDD = new DataSourceWithLetterCase(dataSource, LetterCase.TABLE_DEFAULT, - LetterCase.COLUMN_DEFAULT, - LetterCase.PRIMARY_KEY_DEFAULT); - this.dataSourceUIUIUI = new DataSourceWithLetterCase(dataSource, letterCaseUI, letterCaseUI, letterCaseUI); - this.dataSourceNSNSNS = new DataSourceWithLetterCase(dataSource, letterCaseNS, letterCaseNS, letterCaseNS); + this.dsConnectionDDD = 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 f3a5a31b..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.DataSourceWithLetterCase; -import org.assertj.db.type.SourceWithLetterCase; +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; @@ -34,6 +34,7 @@ * Parent for all the tests which are specific for H2 database with reserved names in SQL structure. * * @author Régis Pouiller + * @author Julien Roy */ @ContextConfiguration(classes = {ReservedH2Configuration.class}) public abstract class AbstractReservedH2Test extends AbstractDatabaseTest { @@ -50,22 +51,22 @@ public abstract class AbstractReservedH2Test extends AbstractDatabaseTest { private static final DbSetup DB_SETUP = new DbSetup(new DriverManagerDestination("jdbc:h2:mem:testReservedH2", "SA", ""), OPERATIONS); private static final DbSetupTracker DB_SETUP_TRACKER = new DbSetupTracker(); - protected final SourceWithLetterCase sourceDDD = new SourceWithLetterCase("jdbc:h2:mem:testReservedH2", "sa", "", + protected final AssertDbConnection jdbcConnectionDDD = AssertDbConnectionFactory.of("jdbc:h2:mem:testReservedH2", "sa", "").letterCase( LetterCase.TABLE_DEFAULT, LetterCase.COLUMN_DEFAULT, - LetterCase.PRIMARY_KEY_DEFAULT); - protected final SourceWithLetterCase sourceUIUIUI = new SourceWithLetterCase("jdbc:h2:mem:testReservedH2", "sa", "", + LetterCase.PRIMARY_KEY_DEFAULT).create(); + protected final AssertDbConnection jdbcConnectionUIUIUI = AssertDbConnectionFactory.of("jdbc:h2:mem:testReservedH2", "sa", "").letterCase( letterCaseUI, letterCaseUI, - letterCaseUI); - protected final SourceWithLetterCase sourceNSNSNS = new SourceWithLetterCase("jdbc:h2:mem:testReservedH2", "sa", "", + letterCaseUI).create(); + protected final AssertDbConnection jdbcConnectionNSNSNS = AssertDbConnectionFactory.of("jdbc:h2:mem:testReservedH2", "sa", "").letterCase( letterCaseNS, letterCaseNS, - letterCaseNS); + letterCaseNS).create(); protected DataSource dataSource; - protected DataSourceWithLetterCase dataSourceDDD; - protected DataSourceWithLetterCase dataSourceUIUIUI; - protected DataSourceWithLetterCase dataSourceNSNSNS; + protected AssertDbConnection dsConnectionDDD; + protected AssertDbConnection dsConnectionUIUIUI; + protected AssertDbConnection dsConnectionNSNSNS; protected DbSetup getDbSetup() { return DB_SETUP; @@ -78,11 +79,9 @@ protected DbSetupTracker getDbSetupTracker() { @Autowired protected void setDataSource(DataSource dataSource) { this.dataSource = dataSource; - this.dataSourceDDD = new DataSourceWithLetterCase(dataSource, LetterCase.TABLE_DEFAULT, - LetterCase.COLUMN_DEFAULT, - LetterCase.PRIMARY_KEY_DEFAULT); - this.dataSourceUIUIUI = new DataSourceWithLetterCase(dataSource, letterCaseUI, letterCaseUI, letterCaseUI); - this.dataSourceNSNSNS = new DataSourceWithLetterCase(dataSource, letterCaseNS, letterCaseNS, letterCaseNS); + this.dsConnectionDDD = 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_Source_DDD_Test.java b/src/test/java/org/assertj/db/database/h2/H2DataBase_JdbcUrl_DDD_Test.java similarity index 95% rename from src/test/java/org/assertj/db/database/h2/H2DataBase_Source_DDD_Test.java rename to src/test/java/org/assertj/db/database/h2/H2DataBase_JdbcUrl_DDD_Test.java index e4febd3e..9abb2ef6 100644 --- a/src/test/java/org/assertj/db/database/h2/H2DataBase_Source_DDD_Test.java +++ b/src/test/java/org/assertj/db/database/h2/H2DataBase_JdbcUrl_DDD_Test.java @@ -27,6 +27,7 @@ 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; @@ -34,8 +35,6 @@ import org.assertj.db.type.DateValue; import org.assertj.db.type.Request; import org.assertj.db.type.Row; -import org.assertj.db.type.Source; -import org.assertj.db.type.SourceWithLetterCase; import org.assertj.db.type.Table; import org.assertj.db.type.TimeValue; import org.assertj.db.type.Value; @@ -48,21 +47,22 @@ * Test on the H2 database. * * @author Régis Pouiller + * @author Julien Roy */ -public class H2DataBase_Source_DDD_Test extends AbstractH2Test { +public class H2DataBase_JdbcUrl_DDD_Test extends AbstractH2Test { - private Source source; + private AssertDbConnection connection; @Before public void init() { - source = sourceDDD; + connection = jdbcConnectionDDD; } @Test @NeedReload public void test_Outputs_output() { - Table table = new Table(source, "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' source]%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' source]%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' 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 'sa/jdbc:h2:mem:testH2']%n" + "|---------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|--------------------|------------|-------------------------------|-------------------------------|-------------------------------|------------|------------|------------|------------|------------|-------------------------------------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|--------------------------------------|------------------|------------------|%n" + "| | * | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |%n" + "| PRIMARY | VAR1 | VAR2 | VAR3 | VAR4 | VAR5 | VAR6 | VAR7 | VAR8 | VAR9 | VAR10 | VAR11 | VAR12 | VAR13 | VAR14 | VAR15 | VAR16 | VAR17 | VAR18 | VAR19 | VAR20 | VAR21 | VAR22 | VAR23 | VAR24 | VAR25 | VAR26 | VAR27 | VAR28 | VAR29 | VAR30 | VAR31 | VAR32 | VAR33 | VAR34 | VAR35 | VAR36 | VAR37 | VAR38 | VAR39 | VAR40 | VAR41 | VAR42 | VAR43 | VAR44 | VAR45 | VAR46 | VAR47 | VAR48 | VAR49 | VAR50 | VAR51 | VAR52 | VAR53 | VAR54 | VAR55 | VAR56 | VAR57 | VAR58 | VAR59 | VAR60 | VAR61 |%n" @@ -160,14 +160,14 @@ public void test_Outputs_output() { + "|---------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|--------------------|------------|-------------------------------|-------------------------------|-------------------------------|------------|------------|------------|------------|------------|-------------------------------------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|--------------------------------------|------------------|------------------|%n" + "| 1 | 1 | 20 | 3 | 4 | 5 | 6 | true | false | true | 7 | 8 | 9 | 10 | 11 | 12 | 13.13 | 14.14 | 15.15 | 16.16 | 17.17 | 18.18 | 19.19 | 20.2 | 21.21 | 09:01:00.000000000 | 2007-12-23 | 2007-12-23T09:01:00.000000000 | 2007-12-23T09:01:00.000000000 | 2007-12-23T09:01:00.000000000 | ... | ... | ... | ... | ... | fr | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | ... | ... | ... | ... | ... | ... | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 30b443ae-c0c9-4790-9bec-ce1380808435 | null | null |%n" + "|---------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|--------------------|------------|-------------------------------|-------------------------------|-------------------------------|------------|------------|------------|------------|------------|-------------------------------------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|--------------------------------------|------------------|------------------|%n")); - Assertions.assertThat(byteArrayOutputStream8.toString()).isEqualTo(String.format("[Value at index 0 (column name : VAR1) of Row at end point of Change at index 0 (with primary key : [1]) of Changes on TEST table of 'sa/jdbc:h2:mem:testH2' source]%n" + Assertions.assertThat(byteArrayOutputStream8).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' 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 'sa/jdbc:h2:mem:testH2']%n" + "|----------------|----------|%n" + "| | VAR1 |%n" + "| | (NUMBER) |%n" @@ -176,7 +176,7 @@ public void test_Outputs_output() { + "|----------------|----------|%n" + "| At end point | 1 |%n" + "|----------------|----------|%n")); - Assertions.assertThat(byteArrayOutputStream10.toString()).isEqualTo(String.format("[Value at end point of Column at index 0 (column name : VAR1) of Change at index 0 (with primary key : [1]) of Changes on TEST table of 'sa/jdbc:h2:mem:testH2' source]%n" + Assertions.assertThat(byteArrayOutputStream10).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(source, "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(source, "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(source, "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(source, "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(source, "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(source, "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(source, "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(source, "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(source, "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(source, "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(source, "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(source, "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,20 +1655,16 @@ public void test_ValueType_isOfType() { @Test @NeedReload public void test_getTableLetterCase() { - SourceWithLetterCase sourceWithLetterCase = (SourceWithLetterCase) source; + Table table = connection.table("test").build(); - Table table = new Table(source, "test"); + Request request = connection.request("select * from test").build(); - Request request = new Request(source, "select * from test"); - - 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(sourceWithLetterCase.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()); @@ -1676,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(sourceWithLetterCase.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()); @@ -1690,21 +1683,19 @@ public void test_getTableLetterCase() { @Test @NeedReload public void test_getColumnLetterCase() { - SourceWithLetterCase sourceWithLetterCase = (SourceWithLetterCase) source; - - Table table = new Table(source, "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(source, "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); @@ -1713,9 +1704,6 @@ public void test_getColumnLetterCase() { Value valueAtStartPoint = rowAtStartPoint.getColumnValue(0); Value valueAtEndPoint = rowAtEndPoint.getColumnValue(0); - - Assertions.assertThat(sourceWithLetterCase.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()); @@ -1735,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(sourceWithLetterCase.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()); @@ -1761,15 +1746,13 @@ public void test_getColumnLetterCase() { @Test @NeedReload public void test_getPrimaryKeyLetterCase() { - SourceWithLetterCase sourceWithLetterCase = (SourceWithLetterCase) source; - - Table table = new Table(source, "test"); + Table table = connection.table("test").build(); Row tableRow = table.getRow(0); - Request request = new Request(source, "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); @@ -1777,8 +1760,6 @@ public void test_getPrimaryKeyLetterCase() { Row rowAtEndPoint = change.getRowAtEndPoint(); - Assertions.assertThat(sourceWithLetterCase.getPrimaryKeyLetterCase().getConversionName()).isSameAs(LetterCase.PRIMARY_KEY_DEFAULT.getConversionName()); - Assertions.assertThat(table.getPrimaryKeyLetterCase().getConversionName()).isSameAs(LetterCase.PRIMARY_KEY_DEFAULT.getConversionName()); Assertions.assertThat(tableRow.getPrimaryKeyLetterCase().getConversionName()).isSameAs(LetterCase.PRIMARY_KEY_DEFAULT.getConversionName()); @@ -1791,8 +1772,6 @@ public void test_getPrimaryKeyLetterCase() { Assertions.assertThat(rowAtEndPoint.getPrimaryKeyLetterCase().getConversionName()).isSameAs(LetterCase.PRIMARY_KEY_DEFAULT.getConversionName()); - Assertions.assertThat(sourceWithLetterCase.getPrimaryKeyLetterCase().getComparisonName()).isSameAs(LetterCase.PRIMARY_KEY_DEFAULT.getComparisonName()); - Assertions.assertThat(table.getPrimaryKeyLetterCase().getComparisonName()).isSameAs(LetterCase.PRIMARY_KEY_DEFAULT.getComparisonName()); Assertions.assertThat(tableRow.getPrimaryKeyLetterCase().getComparisonName()).isSameAs(LetterCase.PRIMARY_KEY_DEFAULT.getComparisonName()); diff --git a/src/test/java/org/assertj/db/database/h2/H2DataBase_Test.java b/src/test/java/org/assertj/db/database/h2/H2DataBase_Test.java index b0514fe7..ae8fc8ce 100644 --- a/src/test/java/org/assertj/db/database/h2/H2DataBase_Test.java +++ b/src/test/java/org/assertj/db/database/h2/H2DataBase_Test.java @@ -44,7 +44,7 @@ public void test_catalog_for_data_source() throws SQLException { } @Test - public void test_catalog_for_source() throws SQLException { + public void test_catalogfor_jdbc_connection() throws SQLException { try (Connection connection = DriverManager.getConnection(URL, USER, PASSWORD)) { String catalog = connection.getCatalog(); assertThat(catalog).isEqualTo("TESTH2"); @@ -60,7 +60,7 @@ public void test_schema_for_data_source() throws SQLException { } @Test - public void test_schema_for_source() throws SQLException { + public void test_schemafor_jdbc_connection() throws SQLException { try (Connection connection = DriverManager.getConnection(URL, USER, PASSWORD)) { String schema = connection.getSchema(); assertThat(schema).isEqualTo("PUBLIC"); @@ -79,7 +79,7 @@ public void test_tables_for_data_source() throws SQLException { } @Test - public void test_tables_for_source() throws SQLException { + public void test_tablesfor_jdbc_connection() throws SQLException { try (Connection connection = DriverManager.getConnection(URL, USER, PASSWORD)) { DatabaseMetaData databaseMetaData = connection.getMetaData(); ResultSet resultSet = databaseMetaData.getTables("TESTH2", null, null, new String[]{"TABLE"}); @@ -107,7 +107,7 @@ public void test_table_primary_keys_for_data_source() throws SQLException { } @Test - public void test_table_primary_keys_for_source() throws SQLException { + public void test_table_primary_keysfor_jdbc_connection() throws SQLException { try (Connection connection = DriverManager.getConnection(URL, USER, PASSWORD)) { DatabaseMetaData databaseMetaData = connection.getMetaData(); { @@ -261,7 +261,7 @@ public void test_table_columns_for_data_source() throws SQLException { } @Test - public void test_table_columns_for_source() throws SQLException { + public void test_table_columnsfor_jdbc_connection() throws SQLException { try (Connection connection = DriverManager.getConnection(URL, USER, PASSWORD)) { DatabaseMetaData databaseMetaData = connection.getMetaData(); { @@ -471,7 +471,7 @@ public void test_request_columns_for_data_source() throws SQLException { } @Test - public void test_request_columns_for_source() throws SQLException { + public void test_request_columnsfor_jdbc_connection() throws SQLException { try (Connection connection = DriverManager.getConnection(URL, USER, PASSWORD)) { try (Statement statement = connection.createStatement()) { try (ResultSet resultSet1 = statement.executeQuery("select * from test")) { diff --git a/src/test/java/org/assertj/db/database/h2/H2Database_DataSource_DDD_Test.java b/src/test/java/org/assertj/db/database/h2/H2Database_DataSource_DDD_Test.java index f8babf80..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 @@ -23,15 +23,14 @@ import java.sql.Timestamp; import java.util.Locale; import java.util.UUID; -import javax.sql.DataSource; import org.assertj.core.api.Assertions; import org.assertj.db.common.NeedReload; import org.assertj.db.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.DataSourceWithLetterCase; import org.assertj.db.type.DateTimeValue; import org.assertj.db.type.DateValue; import org.assertj.db.type.Request; @@ -48,21 +47,22 @@ * Test on the H2 database. * * @author Régis Pouiller + * @author Julien Roy */ public class H2Database_DataSource_DDD_Test extends AbstractH2Test { - private DataSource dataSource; + private AssertDbConnection connection; @Before public void init() { - dataSource = dataSourceDDD; + connection = dsConnectionDDD; } @Test @NeedReload public void test_Outputs_output() { - Table table = new Table(dataSource, "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 a 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 a 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 a 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 a 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 a 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 a 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(dataSource, "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(dataSource, "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(dataSource, "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(dataSource, "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(dataSource, "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(dataSource, "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(dataSource, "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(dataSource, "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(dataSource, "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(dataSource, "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(dataSource, "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(dataSource, "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,20 +1655,16 @@ public void test_ValueType_isOfType() { @Test @NeedReload public void test_getTableLetterCase() { - DataSourceWithLetterCase datasourceWithLetterCase = (DataSourceWithLetterCase) dataSource; + Table table = connection.table("test").build(); - Table table = new Table(dataSource, "test"); + Request request = connection.request("select * from test").build(); - Request request = new Request(dataSource, "select * from test"); - - 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(datasourceWithLetterCase.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()); @@ -1676,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(datasourceWithLetterCase.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()); @@ -1690,21 +1683,19 @@ public void test_getTableLetterCase() { @Test @NeedReload public void test_getColumnLetterCase() { - DataSourceWithLetterCase datasourceWithLetterCase = (DataSourceWithLetterCase) dataSource; - - Table table = new Table(dataSource, "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(dataSource, "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); @@ -1713,9 +1704,6 @@ public void test_getColumnLetterCase() { Value valueAtStartPoint = rowAtStartPoint.getColumnValue(0); Value valueAtEndPoint = rowAtEndPoint.getColumnValue(0); - - Assertions.assertThat(datasourceWithLetterCase.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()); @@ -1735,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(datasourceWithLetterCase.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()); @@ -1761,24 +1746,19 @@ public void test_getColumnLetterCase() { @Test @NeedReload public void test_getPrimaryKeyLetterCase() { - DataSourceWithLetterCase datasourceWithLetterCase = (DataSourceWithLetterCase) dataSource; - - Table table = new Table(dataSource, "test"); + Table table = connection.table("test").build(); Row tableRow = table.getRow(0); - Request request = new Request(dataSource, "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(datasourceWithLetterCase.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()); @@ -1790,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(datasourceWithLetterCase.getPrimaryKeyLetterCase().getComparisonName()).isSameAs(LetterCase.PRIMARY_KEY_DEFAULT.getComparisonName()); - Assertions.assertThat(table.getPrimaryKeyLetterCase().getComparisonName()).isSameAs(LetterCase.PRIMARY_KEY_DEFAULT.getComparisonName()); Assertions.assertThat(tableRow.getPrimaryKeyLetterCase().getComparisonName()).isSameAs(LetterCase.PRIMARY_KEY_DEFAULT.getComparisonName()); diff --git a/src/test/java/org/assertj/db/database/h2/H2Database_DataSource_NSNSNS_Test.java b/src/test/java/org/assertj/db/database/h2/H2Database_DataSource_NSNSNS_Test.java index 3076c32d..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 @@ -17,17 +17,16 @@ import static org.junit.Assert.fail; import java.io.ByteArrayOutputStream; -import javax.sql.DataSource; import org.assertj.core.api.Assertions; import org.assertj.db.common.NeedReload; import org.assertj.db.exception.AssertJDBException; import org.assertj.db.output.Outputs; +import org.assertj.db.type.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.DataSourceWithLetterCase; import org.assertj.db.type.Request; import org.assertj.db.type.Row; import org.assertj.db.type.Table; @@ -41,23 +40,24 @@ * Test on the H2 database. * * @author Régis Pouiller + * @author Julien Roy */ public class H2Database_DataSource_NSNSNS_Test extends AbstractH2Test { - private DataSource dataSource; + private AssertDbConnection connection; @Before public void init() { - dataSource = dataSourceNSNSNS; + connection = dsConnectionNSNSNS; } @Test @NeedReload public void test_Outputs_output() { - Table table = new Table(dataSource, "test"); - Changes changes = new Changes(table).setStartPointNow(); - Changes changes2 = new Changes(dataSource).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(); @@ -136,7 +136,7 @@ public void test_Outputs_output() { + "|----------|%n" + "| 1 |%n" + "|----------|%n")); - Assertions.assertThat(byteArrayOutputStream5.toString()).as("display6").isEqualTo(String.format("[Changes on test table of a data source]%n" + Assertions.assertThat(byteArrayOutputStream5.toString()).as("display6").isEqualTo(String.format("[Changes on test table of 'data source']%n" + "|-----------|----------|-------|---------|----------------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|--------------------|------------|-------------------------------|-------------------------------|-------------------------------|------------|------------|------------|------------|------------|-------------------------------------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|--------------------------------------|------------------|------------------|%n" + "| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |%n" + "| | TYPE | TABLE | PRIMARY | | VAR1 | VAR2 | VAR3 | VAR4 | VAR5 | VAR6 | VAR7 | VAR8 | VAR9 | VAR10 | VAR11 | VAR12 | VAR13 | VAR14 | VAR15 | VAR16 | VAR17 | VAR18 | VAR19 | VAR20 | VAR21 | VAR22 | VAR23 | VAR24 | VAR25 | VAR26 | VAR27 | VAR28 | VAR29 | VAR30 | VAR31 | VAR32 | VAR33 | VAR34 | VAR35 | VAR36 | VAR37 | VAR38 | VAR39 | VAR40 | VAR41 | VAR42 | VAR43 | VAR44 | VAR45 | VAR46 | VAR47 | VAR48 | VAR49 | VAR50 | VAR51 | VAR52 | VAR53 | VAR54 | VAR55 | VAR56 | VAR57 | VAR58 | VAR59 | VAR60 | VAR61 |%n" @@ -157,7 +157,7 @@ public void test_Outputs_output() { + "| Index : 1 | DELETION | test | |----------------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|--------------------|------------|-------------------------------|-------------------------------|-------------------------------|------------|------------|------------|------------|------------|-------------------------------------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|--------------------------------------|------------------|------------------|%n" + "| | | | | At end point | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |%n" + "|-----------|----------|-------|---------|----------------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|--------------------|------------|-------------------------------|-------------------------------|-------------------------------|------------|------------|------------|------------|------------|-------------------------------------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|--------------------------------------|------------------|------------------|%n")); - Assertions.assertThat(byteArrayOutputStream6.toString()).as("display7").isEqualTo(String.format("[Change at index 0 of Changes on test table of a data source]%n" + Assertions.assertThat(byteArrayOutputStream6.toString()).as("display7").isEqualTo(String.format("[Change at index 0 of Changes on test table of 'data source']%n" + "|----------|-------|---------|----------------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|--------------------|------------|-------------------------------|-------------------------------|-------------------------------|------------|------------|------------|------------|------------|-------------------------------------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|--------------------------------------|------------------|------------------|%n" + "| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |%n" + "| TYPE | TABLE | PRIMARY | | VAR1 | VAR2 | VAR3 | VAR4 | VAR5 | VAR6 | VAR7 | VAR8 | VAR9 | VAR10 | VAR11 | VAR12 | VAR13 | VAR14 | VAR15 | VAR16 | VAR17 | VAR18 | VAR19 | VAR20 | VAR21 | VAR22 | VAR23 | VAR24 | VAR25 | VAR26 | VAR27 | VAR28 | VAR29 | VAR30 | VAR31 | VAR32 | VAR33 | VAR34 | VAR35 | VAR36 | VAR37 | VAR38 | VAR39 | VAR40 | VAR41 | VAR42 | VAR43 | VAR44 | VAR45 | VAR46 | VAR47 | VAR48 | VAR49 | VAR50 | VAR51 | VAR52 | VAR53 | VAR54 | VAR55 | VAR56 | VAR57 | VAR58 | VAR59 | VAR60 | VAR61 |%n" @@ -168,7 +168,7 @@ public void test_Outputs_output() { + "| CREATION | test | |----------------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|--------------------|------------|-------------------------------|-------------------------------|-------------------------------|------------|------------|------------|------------|------------|-------------------------------------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|--------------------------------------|------------------|------------------|%n" + "| | | | At end point | 1 | 20 | 3 | 4 | 5 | 6 | true | false | true | 7 | 8 | 9 | 10 | 11 | 12 | 13.13 | 14.14 | 15.15 | 16.16 | 17.17 | 18.18 | 19.19 | 20.2 | 21.21 | 09:01:00.000000000 | 2007-12-23 | 2007-12-23T09:01:00.000000000 | 2007-12-23T09:01:00.000000000 | 2007-12-23T09:01:00.000000000 | ... | ... | ... | ... | ... | fr | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | ... | ... | ... | ... | ... | ... | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 30b443ae-c0c9-4790-9bec-ce1380808435 | null | null |%n" + "|----------|-------|---------|----------------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|--------------------|------------|-------------------------------|-------------------------------|-------------------------------|------------|------------|------------|------------|------------|-------------------------------------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|--------------------------------------|------------------|------------------|%n")); - Assertions.assertThat(byteArrayOutputStream7.toString()).as("display8").isEqualTo(String.format("[Row at end point of Change at index 0 of Changes on test table of a data source]%n" + Assertions.assertThat(byteArrayOutputStream7.toString()).as("display8").isEqualTo(String.format("[Row at end point of Change at index 0 of Changes on test table of 'data source']%n" + "|---------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|--------------------|------------|-------------------------------|-------------------------------|-------------------------------|------------|------------|------------|------------|------------|-------------------------------------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|--------------------------------------|------------------|------------------|%n" + "| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |%n" + "| PRIMARY | VAR1 | VAR2 | VAR3 | VAR4 | VAR5 | VAR6 | VAR7 | VAR8 | VAR9 | VAR10 | VAR11 | VAR12 | VAR13 | VAR14 | VAR15 | VAR16 | VAR17 | VAR18 | VAR19 | VAR20 | VAR21 | VAR22 | VAR23 | VAR24 | VAR25 | VAR26 | VAR27 | VAR28 | VAR29 | VAR30 | VAR31 | VAR32 | VAR33 | VAR34 | VAR35 | VAR36 | VAR37 | VAR38 | VAR39 | VAR40 | VAR41 | VAR42 | VAR43 | VAR44 | VAR45 | VAR46 | VAR47 | VAR48 | VAR49 | VAR50 | VAR51 | VAR52 | VAR53 | VAR54 | VAR55 | VAR56 | VAR57 | VAR58 | VAR59 | VAR60 | VAR61 |%n" @@ -177,14 +177,14 @@ public void test_Outputs_output() { + "|---------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|--------------------|------------|-------------------------------|-------------------------------|-------------------------------|------------|------------|------------|------------|------------|-------------------------------------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|--------------------------------------|------------------|------------------|%n" + "| | 1 | 20 | 3 | 4 | 5 | 6 | true | false | true | 7 | 8 | 9 | 10 | 11 | 12 | 13.13 | 14.14 | 15.15 | 16.16 | 17.17 | 18.18 | 19.19 | 20.2 | 21.21 | 09:01:00.000000000 | 2007-12-23 | 2007-12-23T09:01:00.000000000 | 2007-12-23T09:01:00.000000000 | 2007-12-23T09:01:00.000000000 | ... | ... | ... | ... | ... | fr | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | ... | ... | ... | ... | ... | ... | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 30b443ae-c0c9-4790-9bec-ce1380808435 | null | null |%n" + "|---------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|--------------------|------------|-------------------------------|-------------------------------|-------------------------------|------------|------------|------------|------------|------------|-------------------------------------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|--------------------------------------|------------------|------------------|%n")); - Assertions.assertThat(byteArrayOutputStream8.toString()).as("display9").isEqualTo(String.format("[Value at index 0 (column name : VAR1) of Row at end point of Change at index 0 of Changes on test table of a data source]%n" + Assertions.assertThat(byteArrayOutputStream8.toString()).as("display9").isEqualTo(String.format("[Value at index 0 (column name : VAR1) of Row at end point of Change at index 0 of Changes on test table of 'data source']%n" + "|----------|%n" + "| VAR1 |%n" + "| (NUMBER) |%n" + "|----------|%n" + "| 1 |%n" + "|----------|%n")); - Assertions.assertThat(byteArrayOutputStream9.toString()).as("display10").isEqualTo(String.format("[Column at index 0 (column name : VAR1) of Change at index 0 of Changes on test table of a data source]%n" + Assertions.assertThat(byteArrayOutputStream9.toString()).as("display10").isEqualTo(String.format("[Column at index 0 (column name : VAR1) of Change at index 0 of Changes on test table of 'data source']%n" + "|----------------|----------|%n" + "| | VAR1 |%n" + "| | (NUMBER) |%n" @@ -193,14 +193,14 @@ public void test_Outputs_output() { + "|----------------|----------|%n" + "| At end point | 1 |%n" + "|----------------|----------|%n")); - Assertions.assertThat(byteArrayOutputStream10.toString()).as("display11").isEqualTo(String.format("[Value at end point of Column at index 0 (column name : VAR1) of Change at index 0 of Changes on test table of a data source]%n" + Assertions.assertThat(byteArrayOutputStream10.toString()).as("display11").isEqualTo(String.format("[Value at end point of Column at index 0 (column name : VAR1) of Change at index 0 of Changes on test table of 'data source']%n" + "|----------|%n" + "| VAR1 |%n" + "| (NUMBER) |%n" + "|----------|%n" + "| 1 |%n" + "|----------|%n")); - Assertions.assertThat(byteArrayOutputStream11.toString()).as("display12").isEqualTo(String.format("[Changes on TEST table of a data source]%n" + Assertions.assertThat(byteArrayOutputStream11.toString()).as("display12").isEqualTo(String.format("[Changes on TEST table of 'data source']%n" + "|-----------|--------------|-------|---------|----------------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|--------------------|------------|-------------------------------|-------------------------------|-------------------------------|------------|------------|------------|------------|------------|-------------------------------------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|--------------------------------------|------------------|------------------|%n" + "| | | | | | * | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |%n" + "| | TYPE | TABLE | PRIMARY | | VAR1 | VAR2 | VAR3 | VAR4 | VAR5 | VAR6 | VAR7 | VAR8 | VAR9 | VAR10 | VAR11 | VAR12 | VAR13 | VAR14 | VAR15 | VAR16 | VAR17 | VAR18 | VAR19 | VAR20 | VAR21 | VAR22 | VAR23 | VAR24 | VAR25 | VAR26 | VAR27 | VAR28 | VAR29 | VAR30 | VAR31 | VAR32 | VAR33 | VAR34 | VAR35 | VAR36 | VAR37 | VAR38 | VAR39 | VAR40 | VAR41 | VAR42 | VAR43 | VAR44 | VAR45 | VAR46 | VAR47 | VAR48 | VAR49 | VAR50 | VAR51 | VAR52 | VAR53 | VAR54 | VAR55 | VAR56 | VAR57 | VAR58 | VAR59 | VAR60 | VAR61 |%n" @@ -211,7 +211,7 @@ public void test_Outputs_output() { + "| Index : 0 | MODIFICATION | TEST | 1 |----------------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|--------------------|------------|-------------------------------|-------------------------------|-------------------------------|------------|------------|------------|------------|------------|-------------------------------------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|--------------------------------------|------------------|------------------|%n" + "| | | | | At end point | 1 | 20 | 3 | 4 | 5 | 6 | true | false | true | 7 | 8 | 9 | 10 | 11 | 12 | 13.13 | 14.14 | 15.15 | 16.16 | 17.17 | 18.18 | 19.19 | 20.2 | 21.21 | 09:01:00.000000000 | 2007-12-23 | 2007-12-23T09:01:00.000000000 | 2007-12-23T09:01:00.000000000 | 2007-12-23T09:01:00.000000000 | ... | ... | ... | ... | ... | fr | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | ... | ... | ... | ... | ... | ... | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 30b443ae-c0c9-4790-9bec-ce1380808435 | null | null |%n" + "|-----------|--------------|-------|---------|----------------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|--------------------|------------|-------------------------------|-------------------------------|-------------------------------|------------|------------|------------|------------|------------|-------------------------------------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|--------------------------------------|------------------|------------------|%n")); - Assertions.assertThat(byteArrayOutputStream12.toString()).as("display13").isEqualTo(String.format("[Change at index 0 (with primary key : [1]) of Changes on TEST table of a data source]%n" + Assertions.assertThat(byteArrayOutputStream12.toString()).as("display13").isEqualTo(String.format("[Change at index 0 (with primary key : [1]) of Changes on TEST table of 'data source']%n" + "|--------------|-------|---------|----------------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|--------------------|------------|-------------------------------|-------------------------------|-------------------------------|------------|------------|------------|------------|------------|-------------------------------------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|--------------------------------------|------------------|------------------|%n" + "| | | | | * | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |%n" + "| TYPE | TABLE | PRIMARY | | VAR1 | VAR2 | VAR3 | VAR4 | VAR5 | VAR6 | VAR7 | VAR8 | VAR9 | VAR10 | VAR11 | VAR12 | VAR13 | VAR14 | VAR15 | VAR16 | VAR17 | VAR18 | VAR19 | VAR20 | VAR21 | VAR22 | VAR23 | VAR24 | VAR25 | VAR26 | VAR27 | VAR28 | VAR29 | VAR30 | VAR31 | VAR32 | VAR33 | VAR34 | VAR35 | VAR36 | VAR37 | VAR38 | VAR39 | VAR40 | VAR41 | VAR42 | VAR43 | VAR44 | VAR45 | VAR46 | VAR47 | VAR48 | VAR49 | VAR50 | VAR51 | VAR52 | VAR53 | VAR54 | VAR55 | VAR56 | VAR57 | VAR58 | VAR59 | VAR60 | VAR61 |%n" @@ -222,7 +222,7 @@ public void test_Outputs_output() { + "| MODIFICATION | TEST | 1 |----------------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|--------------------|------------|-------------------------------|-------------------------------|-------------------------------|------------|------------|------------|------------|------------|-------------------------------------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|--------------------------------------|------------------|------------------|%n" + "| | | | At end point | 1 | 20 | 3 | 4 | 5 | 6 | true | false | true | 7 | 8 | 9 | 10 | 11 | 12 | 13.13 | 14.14 | 15.15 | 16.16 | 17.17 | 18.18 | 19.19 | 20.2 | 21.21 | 09:01:00.000000000 | 2007-12-23 | 2007-12-23T09:01:00.000000000 | 2007-12-23T09:01:00.000000000 | 2007-12-23T09:01:00.000000000 | ... | ... | ... | ... | ... | fr | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | ... | ... | ... | ... | ... | ... | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 30b443ae-c0c9-4790-9bec-ce1380808435 | null | null |%n" + "|--------------|-------|---------|----------------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|--------------------|------------|-------------------------------|-------------------------------|-------------------------------|------------|------------|------------|------------|------------|-------------------------------------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|--------------------------------------|------------------|------------------|%n")); - Assertions.assertThat(byteArrayOutputStream13.toString()).as("display14").isEqualTo(String.format("[Row at end point of Change at index 0 (with primary key : [1]) of Changes on TEST table of a data source]%n" + Assertions.assertThat(byteArrayOutputStream13.toString()).as("display14").isEqualTo(String.format("[Row at end point of Change at index 0 (with primary key : [1]) of Changes on TEST table of 'data source']%n" + "|---------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|--------------------|------------|-------------------------------|-------------------------------|-------------------------------|------------|------------|------------|------------|------------|-------------------------------------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|--------------------------------------|------------------|------------------|%n" + "| | * | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |%n" + "| PRIMARY | VAR1 | VAR2 | VAR3 | VAR4 | VAR5 | VAR6 | VAR7 | VAR8 | VAR9 | VAR10 | VAR11 | VAR12 | VAR13 | VAR14 | VAR15 | VAR16 | VAR17 | VAR18 | VAR19 | VAR20 | VAR21 | VAR22 | VAR23 | VAR24 | VAR25 | VAR26 | VAR27 | VAR28 | VAR29 | VAR30 | VAR31 | VAR32 | VAR33 | VAR34 | VAR35 | VAR36 | VAR37 | VAR38 | VAR39 | VAR40 | VAR41 | VAR42 | VAR43 | VAR44 | VAR45 | VAR46 | VAR47 | VAR48 | VAR49 | VAR50 | VAR51 | VAR52 | VAR53 | VAR54 | VAR55 | VAR56 | VAR57 | VAR58 | VAR59 | VAR60 | VAR61 |%n" @@ -231,14 +231,14 @@ public void test_Outputs_output() { + "|---------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|--------------------|------------|-------------------------------|-------------------------------|-------------------------------|------------|------------|------------|------------|------------|-------------------------------------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|--------------------------------------|------------------|------------------|%n" + "| 1 | 1 | 20 | 3 | 4 | 5 | 6 | true | false | true | 7 | 8 | 9 | 10 | 11 | 12 | 13.13 | 14.14 | 15.15 | 16.16 | 17.17 | 18.18 | 19.19 | 20.2 | 21.21 | 09:01:00.000000000 | 2007-12-23 | 2007-12-23T09:01:00.000000000 | 2007-12-23T09:01:00.000000000 | 2007-12-23T09:01:00.000000000 | ... | ... | ... | ... | ... | fr | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | ... | ... | ... | ... | ... | ... | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 30b443ae-c0c9-4790-9bec-ce1380808435 | null | null |%n" + "|---------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|--------------------|------------|-------------------------------|-------------------------------|-------------------------------|------------|------------|------------|------------|------------|-------------------------------------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|--------------------------------------|------------------|------------------|%n")); - Assertions.assertThat(byteArrayOutputStream14.toString()).as("display15").isEqualTo(String.format("[Value at index 0 (column name : VAR1) of Row at end point of Change at index 0 (with primary key : [1]) of Changes on TEST table of a data source]%n" + Assertions.assertThat(byteArrayOutputStream14.toString()).as("display15").isEqualTo(String.format("[Value at index 0 (column name : VAR1) of Row at end point of Change at index 0 (with primary key : [1]) of Changes on TEST table of 'data source']%n" + "|----------|%n" + "| VAR1 |%n" + "| (NUMBER) |%n" + "|----------|%n" + "| 1 |%n" + "|----------|%n")); - Assertions.assertThat(byteArrayOutputStream15.toString()).as("display16").isEqualTo(String.format("[Column at index 0 (column name : VAR1) of Change at index 0 (with primary key : [1]) of Changes on TEST table of a data source]%n" + Assertions.assertThat(byteArrayOutputStream15.toString()).as("display16").isEqualTo(String.format("[Column at index 0 (column name : VAR1) of Change at index 0 (with primary key : [1]) of Changes on TEST table of 'data source']%n" + "|----------------|----------|%n" + "| | VAR1 |%n" + "| | (NUMBER) |%n" @@ -247,7 +247,7 @@ public void test_Outputs_output() { + "|----------------|----------|%n" + "| At end point | 1 |%n" + "|----------------|----------|%n")); - Assertions.assertThat(byteArrayOutputStream16.toString()).as("display17").isEqualTo(String.format("[Value at end point of Column at index 0 (column name : VAR1) of Change at index 0 (with primary key : [1]) of Changes on TEST table of a data source]%n" + Assertions.assertThat(byteArrayOutputStream16.toString()).as("display17").isEqualTo(String.format("[Value at end point of Column at index 0 (column name : VAR1) of Change at index 0 (with primary key : [1]) of Changes on TEST table of 'data source']%n" + "|----------|%n" + "| VAR1 |%n" + "| (NUMBER) |%n" @@ -259,9 +259,9 @@ public void test_Outputs_output() { @Test @NeedReload public void should_fail_because_primary_key_is_different() { - Table table = new Table(dataSource, "test"); - Changes changes = new Changes(table).setStartPointNow(); - Changes changes2 = new Changes(dataSource).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(); @@ -270,7 +270,7 @@ public void should_fail_because_primary_key_is_different() { assertThat(changes).change().hasPksNames("var1"); fail("An exception must be raised"); } catch (AssertionError e) { - Assertions.assertThat(e.getMessage()).as("message1").isEqualTo(String.format("[Change at index 0 of Changes on test table of a data source] %n" + Assertions.assertThat(e.getMessage()).as("message1").isEqualTo(String.format("[Change at index 0 of Changes on test table of 'data source'] %n" + "Expecting :%n" + " [\"var1\"]%n" + "to be the name of the columns of the primary keys but was:%n" @@ -281,7 +281,7 @@ public void should_fail_because_primary_key_is_different() { assertThat(changes2).change().hasPksNames("var1"); fail("An exception must be raised"); } catch (AssertionError e) { - Assertions.assertThat(e.getMessage()).as("message2").isEqualTo(String.format("[Change at index 0 (with primary key : [1]) of Changes on TEST table of a data source] %n" + Assertions.assertThat(e.getMessage()).as("message2").isEqualTo(String.format("[Change at index 0 (with primary key : [1]) of Changes on TEST table of 'data source'] %n" + "Expecting :%n" + " [\"var1\"]%n" + "to be the name of the columns of the primary keys but was:%n" @@ -292,9 +292,9 @@ public void should_fail_because_primary_key_is_different() { @Test @NeedReload public void should_fail_because_column_name_is_different() { - Table table = new Table(dataSource, "test"); - Changes changes = new Changes(table).setStartPointNow(); - Changes changes2 = new Changes(dataSource).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(); @@ -324,7 +324,7 @@ public void should_fail_because_column_name_is_different() { assertThat(changes).change().column().hasColumnName("Var1"); fail("An exception must be raised"); } catch (AssertionError e) { - Assertions.assertThat(e.getMessage()).as("message3").isEqualTo(String.format("[Column at index 0 (column name : VAR1) of Change at index 0 of Changes on test table of a data source] %n" + Assertions.assertThat(e.getMessage()).as("message3").isEqualTo(String.format("[Column at index 0 (column name : VAR1) of Change at index 0 of Changes on test table of 'data source'] %n" + "Expecting :%n" + " \"Var1\"%n" + "to be the name of the column but was:%n" @@ -334,7 +334,7 @@ public void should_fail_because_column_name_is_different() { assertThat(changes).change().rowAtEndPoint().value().hasColumnName("Var1"); fail("An exception must be raised"); } catch (AssertionError e) { - Assertions.assertThat(e.getMessage()).as("message4").isEqualTo(String.format("[Value at index 0 (column name : VAR1) of Row at end point of Change at index 0 of Changes on test table of a data source] %n" + Assertions.assertThat(e.getMessage()).as("message4").isEqualTo(String.format("[Value at index 0 (column name : VAR1) of Row at end point of Change at index 0 of Changes on test table of 'data source'] %n" + "Expecting :%n" + " \"Var1\"%n" + "to be the name of the column but was:%n" @@ -345,7 +345,7 @@ public void should_fail_because_column_name_is_different() { assertThat(changes2).change().column().hasColumnName("Var1"); fail("An exception must be raised"); } catch (AssertionError e) { - Assertions.assertThat(e.getMessage()).as("message5").isEqualTo(String.format("[Column at index 0 (column name : VAR1) of Change at index 0 (with primary key : [1]) of Changes on TEST table of a data source] %n" + Assertions.assertThat(e.getMessage()).as("message5").isEqualTo(String.format("[Column at index 0 (column name : VAR1) of Change at index 0 (with primary key : [1]) of Changes on TEST table of 'data source'] %n" + "Expecting :%n" + " \"Var1\"%n" + "to be the name of the column but was:%n" @@ -355,7 +355,7 @@ public void should_fail_because_column_name_is_different() { assertThat(changes2).change().rowAtEndPoint().value().hasColumnName("Var1"); fail("An exception must be raised"); } catch (AssertionError e) { - Assertions.assertThat(e.getMessage()).as("message6").isEqualTo(String.format("[Value at index 0 (column name : VAR1) of Row at end point of Change at index 0 (with primary key : [1]) of Changes on TEST table of a data source] %n" + Assertions.assertThat(e.getMessage()).as("message6").isEqualTo(String.format("[Value at index 0 (column name : VAR1) of Row at end point of Change at index 0 (with primary key : [1]) of Changes on TEST table of 'data source'] %n" + "Expecting :%n" + " \"Var1\"%n" + "to be the name of the column but was:%n" @@ -366,9 +366,9 @@ public void should_fail_because_column_name_is_different() { @Test @NeedReload public void should_fail_because_column_name_is_wrong_to_navigate() { - Table table = new Table(dataSource, "test"); - Changes changes = new Changes(table).setStartPointNow(); - Changes changes2 = new Changes(dataSource).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(dataSource, "test"); - Changes changes = new Changes(table).setStartPointNow(); - Changes changes2 = new Changes(dataSource).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(); @@ -439,7 +439,7 @@ public void should_fail_because_table_name_is_different() { assertThat(changes).change().isOnTable("teSt"); fail("An exception must be raised"); } catch (AssertionError e) { - Assertions.assertThat(e.getMessage()).as("message1").isEqualTo(String.format("[Change at index 0 of Changes on test table of a data source] %n" + Assertions.assertThat(e.getMessage()).as("message1").isEqualTo(String.format("[Change at index 0 of Changes on test table of 'data source'] %n" + "Expecting to be on the table:%n" + " <\"teSt\">%n" + "but was on the table:%n" @@ -449,7 +449,7 @@ public void should_fail_because_table_name_is_different() { assertThat(changes2).change().isOnTable("teSt"); fail("An exception must be raised"); } catch (AssertionError e) { - Assertions.assertThat(e.getMessage()).as("message2").isEqualTo(String.format("[Change at index 0 (with primary key : [1]) of Changes on TEST table of a data source] %n" + Assertions.assertThat(e.getMessage()).as("message2").isEqualTo(String.format("[Change at index 0 (with primary key : [1]) of Changes on TEST table of 'data source'] %n" + "Expecting to be on the table:%n" + " <\"teSt\">%n" + "but was on the table:%n" @@ -460,9 +460,9 @@ public void should_fail_because_table_name_is_different() { @Test @NeedReload public void should_fail_because_table_name_is_wrong_to_navigate() { - Table table = new Table(dataSource, "test"); - Changes changes = new Changes(table).setStartPointNow(); - Changes changes2 = new Changes(dataSource).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(dataSource, "test"); - Changes changes = new Changes(table).setStartPointNow(); - Changes changes2 = new Changes(dataSource).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(dataSource, "test"); - Changes changes = new Changes(table).setStartPointNow(); - Changes changes2 = new Changes(dataSource).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,20 +541,16 @@ public void test_ColumnClass_isOfClass() { @Test @NeedReload public void test_getTableLetterCase() { - DataSourceWithLetterCase datasourceWithLetterCase = (DataSourceWithLetterCase) dataSource; + Table table = connection.table("test").build(); - Table table = new Table(dataSource, "test"); + Request request = connection.request("select * from test").build(); - Request request = new Request(dataSource, "select * from test"); - - 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(datasourceWithLetterCase.getTableLetterCase().getConversionName()).isSameAs(CaseConversions.NO.getConversionName()); - Assertions.assertThat(table.getTableLetterCase().getConversionName()).isSameAs(CaseConversions.NO.getConversionName()); Assertions.assertThat(request.getTableLetterCase().getConversionName()).isSameAs(CaseConversions.NO.getConversionName()); @@ -563,8 +559,6 @@ public void test_getTableLetterCase() { Assertions.assertThat(change.getTableLetterCase().getConversionName()).isSameAs(CaseConversions.NO.getConversionName()); - Assertions.assertThat(datasourceWithLetterCase.getTableLetterCase().getComparisonName()).isSameAs(CaseComparisons.STRICT.getComparisonName()); - Assertions.assertThat(table.getTableLetterCase().getComparisonName()).isSameAs(CaseComparisons.STRICT.getComparisonName()); Assertions.assertThat(request.getTableLetterCase().getComparisonName()).isSameAs(CaseComparisons.STRICT.getComparisonName()); @@ -576,21 +570,19 @@ public void test_getTableLetterCase() { @Test @NeedReload public void test_getColumnLetterCase() { - DataSourceWithLetterCase datasourceWithLetterCase = (DataSourceWithLetterCase) dataSource; - - Table table = new Table(dataSource, "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(dataSource, "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); @@ -599,9 +591,6 @@ public void test_getColumnLetterCase() { Value valueAtStartPoint = rowAtStartPoint.getColumnValue(0); Value valueAtEndPoint = rowAtEndPoint.getColumnValue(0); - - Assertions.assertThat(datasourceWithLetterCase.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()); @@ -621,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(datasourceWithLetterCase.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()); @@ -647,24 +633,19 @@ public void test_getColumnLetterCase() { @Test @NeedReload public void test_getPrimaryKeyLetterCase() { - DataSourceWithLetterCase datasourceWithLetterCase = (DataSourceWithLetterCase) dataSource; - - Table table = new Table(dataSource, "test"); + Table table = connection.table("test").build(); Row tableRow = table.getRow(0); - Request request = new Request(dataSource, "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(datasourceWithLetterCase.getPrimaryKeyLetterCase().getConversionName()).isSameAs(CaseConversions.NO.getConversionName()); - Assertions.assertThat(table.getPrimaryKeyLetterCase().getConversionName()).isSameAs(CaseConversions.NO.getConversionName()); Assertions.assertThat(tableRow.getPrimaryKeyLetterCase().getConversionName()).isSameAs(CaseConversions.NO.getConversionName()); @@ -676,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(datasourceWithLetterCase.getPrimaryKeyLetterCase().getComparisonName()).isSameAs(CaseComparisons.STRICT.getComparisonName()); - Assertions.assertThat(table.getPrimaryKeyLetterCase().getComparisonName()).isSameAs(CaseComparisons.STRICT.getComparisonName()); Assertions.assertThat(tableRow.getPrimaryKeyLetterCase().getComparisonName()).isSameAs(CaseComparisons.STRICT.getComparisonName()); diff --git a/src/test/java/org/assertj/db/database/h2/H2Database_DataSource_UIUIUI_Test.java b/src/test/java/org/assertj/db/database/h2/H2Database_DataSource_UIUIUI_Test.java index cbfb1c6d..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 @@ -21,14 +21,13 @@ import java.sql.Timestamp; import java.util.Locale; import java.util.UUID; -import javax.sql.DataSource; import org.assertj.core.api.Assertions; import org.assertj.db.common.NeedReload; +import org.assertj.db.type.AssertDbConnection; import org.assertj.db.type.Change; import org.assertj.db.type.Changes; import org.assertj.db.type.Column; -import org.assertj.db.type.DataSourceWithLetterCase; import org.assertj.db.type.DateTimeValue; import org.assertj.db.type.DateValue; import org.assertj.db.type.Request; @@ -46,21 +45,22 @@ * Test on the H2 database. * * @author Régis Pouiller + * @author Julien Roy */ public class H2Database_DataSource_UIUIUI_Test extends AbstractH2Test { - private DataSource dataSource; + private AssertDbConnection connection; @Before public void init() { - dataSource = dataSourceUIUIUI; + connection = dsConnectionUIUIUI; } @Test @NeedReload public void test_PrimaryKey_hasPksNames() { - Table table = new Table(dataSource, "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(dataSource, "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(dataSource, "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(dataSource, "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(dataSource, "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(dataSource, "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(dataSource, "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(dataSource, "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(dataSource, "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(dataSource, "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(dataSource, "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(dataSource, "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,20 +1526,16 @@ public void test_ValueType_isOfType() { @Test @NeedReload public void test_getTableLetterCase() { - DataSourceWithLetterCase datasourceWithLetterCase = (DataSourceWithLetterCase) dataSource; + Table table = connection.table("test").build(); - Table table = new Table(dataSource, "test"); + Request request = connection.request("select * from test").build(); - Request request = new Request(dataSource, "select * from test"); - - 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(datasourceWithLetterCase.getTableLetterCase().getConversionName()).isSameAs(CaseConversions.UPPER.getConversionName()); - Assertions.assertThat(table.getTableLetterCase().getConversionName()).isSameAs(CaseConversions.UPPER.getConversionName()); Assertions.assertThat(request.getTableLetterCase().getConversionName()).isSameAs(CaseConversions.UPPER.getConversionName()); @@ -1548,8 +1544,6 @@ public void test_getTableLetterCase() { Assertions.assertThat(change.getTableLetterCase().getConversionName()).isSameAs(CaseConversions.UPPER.getConversionName()); - Assertions.assertThat(datasourceWithLetterCase.getTableLetterCase().getComparisonName()).isSameAs(CaseComparisons.IGNORE.getComparisonName()); - Assertions.assertThat(table.getTableLetterCase().getComparisonName()).isSameAs(CaseComparisons.IGNORE.getComparisonName()); Assertions.assertThat(request.getTableLetterCase().getComparisonName()).isSameAs(CaseComparisons.IGNORE.getComparisonName()); @@ -1561,21 +1555,19 @@ public void test_getTableLetterCase() { @Test @NeedReload public void test_getColumnLetterCase() { - DataSourceWithLetterCase datasourceWithLetterCase = (DataSourceWithLetterCase) dataSource; - - Table table = new Table(dataSource, "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(dataSource, "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); @@ -1584,9 +1576,6 @@ public void test_getColumnLetterCase() { Value valueAtStartPoint = rowAtStartPoint.getColumnValue(0); Value valueAtEndPoint = rowAtEndPoint.getColumnValue(0); - - Assertions.assertThat(datasourceWithLetterCase.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()); @@ -1606,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(datasourceWithLetterCase.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()); @@ -1632,15 +1618,13 @@ public void test_getColumnLetterCase() { @Test @NeedReload public void test_getPrimaryKeyLetterCase() { - DataSourceWithLetterCase datasourceWithLetterCase = (DataSourceWithLetterCase) dataSource; - - Table table = new Table(dataSource, "test"); + Table table = connection.table("test").build(); Row tableRow = table.getRow(0); - Request request = new Request(dataSource, "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); @@ -1648,8 +1632,6 @@ public void test_getPrimaryKeyLetterCase() { Row rowAtEndPoint = change.getRowAtEndPoint(); - Assertions.assertThat(datasourceWithLetterCase.getPrimaryKeyLetterCase().getConversionName()).isSameAs(CaseConversions.UPPER.getConversionName()); - Assertions.assertThat(table.getPrimaryKeyLetterCase().getConversionName()).isSameAs(CaseConversions.UPPER.getConversionName()); Assertions.assertThat(tableRow.getPrimaryKeyLetterCase().getConversionName()).isSameAs(CaseConversions.UPPER.getConversionName()); @@ -1662,8 +1644,6 @@ public void test_getPrimaryKeyLetterCase() { Assertions.assertThat(rowAtEndPoint.getPrimaryKeyLetterCase().getConversionName()).isSameAs(CaseConversions.UPPER.getConversionName()); - Assertions.assertThat(datasourceWithLetterCase.getPrimaryKeyLetterCase().getComparisonName()).isSameAs(CaseComparisons.IGNORE.getComparisonName()); - Assertions.assertThat(table.getPrimaryKeyLetterCase().getComparisonName()).isSameAs(CaseComparisons.IGNORE.getComparisonName()); Assertions.assertThat(tableRow.getPrimaryKeyLetterCase().getComparisonName()).isSameAs(CaseComparisons.IGNORE.getComparisonName()); diff --git a/src/test/java/org/assertj/db/database/h2/H2Database_Source_NSNSNS_Test.java b/src/test/java/org/assertj/db/database/h2/H2Database_JdbcUrl_NSNSNS_Test.java similarity index 94% rename from src/test/java/org/assertj/db/database/h2/H2Database_Source_NSNSNS_Test.java rename to src/test/java/org/assertj/db/database/h2/H2Database_JdbcUrl_NSNSNS_Test.java index ade7a6d8..0da63285 100644 --- a/src/test/java/org/assertj/db/database/h2/H2Database_Source_NSNSNS_Test.java +++ b/src/test/java/org/assertj/db/database/h2/H2Database_JdbcUrl_NSNSNS_Test.java @@ -22,14 +22,13 @@ 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.Request; import org.assertj.db.type.Row; -import org.assertj.db.type.Source; -import org.assertj.db.type.SourceWithLetterCase; import org.assertj.db.type.Table; import org.assertj.db.type.Value; import org.assertj.db.type.lettercase.CaseComparisons; @@ -41,21 +40,22 @@ * Test on the H2 database. * * @author Régis Pouiller + * @author Julien Roy */ -public class H2Database_Source_NSNSNS_Test extends AbstractH2Test { +public class H2Database_JdbcUrl_NSNSNS_Test extends AbstractH2Test { - private Source source; + private AssertDbConnection connection; @Before public void init() { - source = sourceNSNSNS; + connection = jdbcConnectionNSNSNS; } @NeedReload public void test_Outputs_output() { - Table table = new Table(source, "test"); - Changes changes = new Changes(table).setStartPointNow(); - Changes changes2 = new Changes(source).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 a 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 a 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 a 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 a 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 a 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 a 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 a 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 a 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 a 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 a 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 a 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 a 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(source, "test"); - Changes changes = new Changes(table).setStartPointNow(); - Changes changes2 = new Changes(source).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(); @@ -278,7 +278,7 @@ public void should_fail_because_primary_key_is_different() { assertThat(changes).change().hasPksNames("var1"); fail("An exception must be raised"); } catch (AssertionError e) { - Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Change at index 0 of Changes on test table of 'sa/jdbc:h2:mem:testH2' source] %n" + Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Change at index 0 of Changes on test table of 'sa/jdbc:h2:mem:testH2'] %n" + "Expecting :%n" + " [\"var1\"]%n" + "to be the name of the columns of the primary keys but was:%n" @@ -289,7 +289,7 @@ public void should_fail_because_primary_key_is_different() { assertThat(changes2).change().hasPksNames("var1"); fail("An exception must be raised"); } catch (AssertionError e) { - Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Change at index 0 (with primary key : [1]) of Changes on TEST table of 'sa/jdbc:h2:mem:testH2' source] %n" + Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Change at index 0 (with primary key : [1]) of Changes on TEST table of 'sa/jdbc:h2:mem:testH2'] %n" + "Expecting :%n" + " [\"var1\"]%n" + "to be the name of the columns of the primary keys but was:%n" @@ -300,9 +300,9 @@ public void should_fail_because_primary_key_is_different() { @Test @NeedReload public void should_fail_because_column_name_is_different() { - Table table = new Table(source, "test"); - Changes changes = new Changes(table).setStartPointNow(); - Changes changes2 = new Changes(source).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(); @@ -333,7 +333,7 @@ public void should_fail_because_column_name_is_different() { assertThat(changes).change().column().hasColumnName("Var1"); fail("An exception must be raised"); } catch (AssertionError e) { - Assertions.assertThat(e.getMessage()).as("message3").isEqualTo(String.format("[Column at index 0 (column name : VAR1) of Change at index 0 of Changes on test table of 'sa/jdbc:h2:mem:testH2' source] %n" + Assertions.assertThat(e.getMessage()).as("message3").isEqualTo(String.format("[Column at index 0 (column name : VAR1) of Change at index 0 of Changes on test table of 'sa/jdbc:h2:mem:testH2'] %n" + "Expecting :%n" + " \"Var1\"%n" + "to be the name of the column but was:%n" @@ -343,7 +343,7 @@ public void should_fail_because_column_name_is_different() { assertThat(changes).change().rowAtEndPoint().value().hasColumnName("Var1"); fail("An exception must be raised"); } catch (AssertionError e) { - Assertions.assertThat(e.getMessage()).as("message4").isEqualTo(String.format("[Value at index 0 (column name : VAR1) of Row at end point of Change at index 0 of Changes on test table of 'sa/jdbc:h2:mem:testH2' source] %n" + Assertions.assertThat(e.getMessage()).as("message4").isEqualTo(String.format("[Value at index 0 (column name : VAR1) of Row at end point of Change at index 0 of Changes on test table of 'sa/jdbc:h2:mem:testH2'] %n" + "Expecting :%n" + " \"Var1\"%n" + "to be the name of the column but was:%n" @@ -354,7 +354,7 @@ public void should_fail_because_column_name_is_different() { assertThat(changes2).change().column().hasColumnName("Var1"); fail("An exception must be raised"); } catch (AssertionError e) { - Assertions.assertThat(e.getMessage()).as("message5").isEqualTo(String.format("[Column at index 0 (column name : VAR1) of Change at index 0 (with primary key : [1]) of Changes on TEST table of 'sa/jdbc:h2:mem:testH2' source] %n" + Assertions.assertThat(e.getMessage()).as("message5").isEqualTo(String.format("[Column at index 0 (column name : VAR1) of Change at index 0 (with primary key : [1]) of Changes on TEST table of 'sa/jdbc:h2:mem:testH2'] %n" + "Expecting :%n" + " \"Var1\"%n" + "to be the name of the column but was:%n" @@ -364,7 +364,7 @@ public void should_fail_because_column_name_is_different() { assertThat(changes2).change().rowAtEndPoint().value().hasColumnName("Var1"); fail("An exception must be raised"); } catch (AssertionError e) { - Assertions.assertThat(e.getMessage()).as("message6").isEqualTo(String.format("[Value at index 0 (column name : VAR1) of Row at end point of Change at index 0 (with primary key : [1]) of Changes on TEST table of 'sa/jdbc:h2:mem:testH2' source] %n" + Assertions.assertThat(e.getMessage()).as("message6").isEqualTo(String.format("[Value at index 0 (column name : VAR1) of Row at end point of Change at index 0 (with primary key : [1]) of Changes on TEST table of 'sa/jdbc:h2:mem:testH2'] %n" + "Expecting :%n" + " \"Var1\"%n" + "to be the name of the column but was:%n" @@ -375,9 +375,9 @@ public void should_fail_because_column_name_is_different() { @Test @NeedReload public void should_fail_because_column_name_is_wrong_to_navigate() { - Table table = new Table(source, "test"); - Changes changes = new Changes(table).setStartPointNow(); - Changes changes2 = new Changes(source).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(source, "test"); - Changes changes = new Changes(table).setStartPointNow(); - Changes changes2 = new Changes(source).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(); @@ -448,7 +448,7 @@ public void should_fail_because_table_name_is_different() { assertThat(changes).change().isOnTable("teSt"); fail("An exception must be raised"); } catch (AssertionError e) { - Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Change at index 0 of Changes on test table of 'sa/jdbc:h2:mem:testH2' source] %n" + Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Change at index 0 of Changes on test table of 'sa/jdbc:h2:mem:testH2'] %n" + "Expecting to be on the table:%n" + " <\"teSt\">%n" + "but was on the table:%n" @@ -458,7 +458,7 @@ public void should_fail_because_table_name_is_different() { assertThat(changes2).change().isOnTable("teSt"); fail("An exception must be raised"); } catch (AssertionError e) { - Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Change at index 0 (with primary key : [1]) of Changes on TEST table of 'sa/jdbc:h2:mem:testH2' source] %n" + Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Change at index 0 (with primary key : [1]) of Changes on TEST table of 'sa/jdbc:h2:mem:testH2'] %n" + "Expecting to be on the table:%n" + " <\"teSt\">%n" + "but was on the table:%n" @@ -469,9 +469,9 @@ public void should_fail_because_table_name_is_different() { @Test @NeedReload public void should_fail_because_table_name_is_wrong_to_navigate() { - Table table = new Table(source, "test"); - Changes changes = new Changes(table).setStartPointNow(); - Changes changes2 = new Changes(source).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(source, "test"); - Changes changes = new Changes(table).setStartPointNow(); - Changes changes2 = new Changes(source).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(source, "test"); - Changes changes = new Changes(table).setStartPointNow(); - Changes changes2 = new Changes(source).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,20 +550,15 @@ public void test_ColumnClass_isOfClass() { @Test @NeedReload public void test_getTableLetterCase() { - SourceWithLetterCase sourceWithLetterCase = (SourceWithLetterCase) source; + Table table = connection.table("test").build(); - Table table = new Table(source, "test"); + Request request = connection.request("select * from test").build(); - Request request = new Request(source, "select * from test"); - - 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(sourceWithLetterCase.getTableLetterCase().getConversionName()).isSameAs(CaseConversions.NO.getConversionName()); - Assertions.assertThat(table.getTableLetterCase().getConversionName()).isSameAs(CaseConversions.NO.getConversionName()); Assertions.assertThat(request.getTableLetterCase().getConversionName()).isSameAs(CaseConversions.NO.getConversionName()); @@ -571,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(sourceWithLetterCase.getTableLetterCase().getComparisonName()).isSameAs(CaseComparisons.STRICT.getComparisonName()); - Assertions.assertThat(table.getTableLetterCase().getComparisonName()).isSameAs(CaseComparisons.STRICT.getComparisonName()); Assertions.assertThat(request.getTableLetterCase().getComparisonName()).isSameAs(CaseComparisons.STRICT.getComparisonName()); @@ -585,21 +577,19 @@ public void test_getTableLetterCase() { @Test @NeedReload public void test_getColumnLetterCase() { - SourceWithLetterCase sourceWithLetterCase = (SourceWithLetterCase) source; - - Table table = new Table(source, "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(source, "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); @@ -608,9 +598,6 @@ public void test_getColumnLetterCase() { Value valueAtStartPoint = rowAtStartPoint.getColumnValue(0); Value valueAtEndPoint = rowAtEndPoint.getColumnValue(0); - - Assertions.assertThat(sourceWithLetterCase.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()); @@ -630,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(sourceWithLetterCase.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()); @@ -656,24 +640,19 @@ public void test_getColumnLetterCase() { @Test @NeedReload public void test_getPrimaryKeyLetterCase() { - SourceWithLetterCase sourceWithLetterCase = (SourceWithLetterCase) source; - - Table table = new Table(source, "test"); + Table table = connection.table("test").build(); Row tableRow = table.getRow(0); - Request request = new Request(source, "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(sourceWithLetterCase.getPrimaryKeyLetterCase().getConversionName()).isSameAs(CaseConversions.NO.getConversionName()); - Assertions.assertThat(table.getPrimaryKeyLetterCase().getConversionName()).isSameAs(CaseConversions.NO.getConversionName()); Assertions.assertThat(tableRow.getPrimaryKeyLetterCase().getConversionName()).isSameAs(CaseConversions.NO.getConversionName()); @@ -685,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(sourceWithLetterCase.getPrimaryKeyLetterCase().getComparisonName()).isSameAs(CaseComparisons.STRICT.getComparisonName()); - Assertions.assertThat(table.getPrimaryKeyLetterCase().getComparisonName()).isSameAs(CaseComparisons.STRICT.getComparisonName()); Assertions.assertThat(tableRow.getPrimaryKeyLetterCase().getComparisonName()).isSameAs(CaseComparisons.STRICT.getComparisonName()); diff --git a/src/test/java/org/assertj/db/database/h2/H2Database_Source_UIUIUI_Test.java b/src/test/java/org/assertj/db/database/h2/H2Database_JdbcUrl_UIUIUI_Test.java similarity index 96% rename from src/test/java/org/assertj/db/database/h2/H2Database_Source_UIUIUI_Test.java rename to src/test/java/org/assertj/db/database/h2/H2Database_JdbcUrl_UIUIUI_Test.java index 3efd9fb5..29454d7a 100644 --- a/src/test/java/org/assertj/db/database/h2/H2Database_Source_UIUIUI_Test.java +++ b/src/test/java/org/assertj/db/database/h2/H2Database_JdbcUrl_UIUIUI_Test.java @@ -24,6 +24,7 @@ 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; @@ -31,8 +32,6 @@ import org.assertj.db.type.DateValue; import org.assertj.db.type.Request; import org.assertj.db.type.Row; -import org.assertj.db.type.Source; -import org.assertj.db.type.SourceWithLetterCase; import org.assertj.db.type.Table; import org.assertj.db.type.TimeValue; import org.assertj.db.type.Value; @@ -46,21 +45,22 @@ * Test on the H2 database. * * @author Régis Pouiller + * @author Julien Roy */ -public class H2Database_Source_UIUIUI_Test extends AbstractH2Test { +public class H2Database_JdbcUrl_UIUIUI_Test extends AbstractH2Test { - private Source source; + private AssertDbConnection connection; @Before public void init() { - source = sourceUIUIUI; + connection = jdbcConnectionUIUIUI; } @Test @NeedReload public void test_PrimaryKey_hasPksNames() { - Table table = new Table(source, "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(source, "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(source, "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(source, "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(source, "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(source, "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(source, "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(source, "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(source, "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(source, "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(source, "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(source, "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,20 +1526,15 @@ public void test_ValueType_isOfType() { @Test @NeedReload public void test_getTableLetterCase() { - SourceWithLetterCase sourceWithLetterCase = (SourceWithLetterCase) source; + Table table = connection.table("test").build(); - Table table = new Table(source, "test"); + Request request = connection.request("select * from test").build(); - Request request = new Request(source, "select * from test"); - - 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(sourceWithLetterCase.getTableLetterCase().getConversionName()).isSameAs(CaseConversions.UPPER.getConversionName()); - Assertions.assertThat(table.getTableLetterCase().getConversionName()).isSameAs(CaseConversions.UPPER.getConversionName()); Assertions.assertThat(request.getTableLetterCase().getConversionName()).isSameAs(CaseConversions.UPPER.getConversionName()); @@ -1547,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(sourceWithLetterCase.getTableLetterCase().getComparisonName()).isSameAs(CaseComparisons.IGNORE.getComparisonName()); - Assertions.assertThat(table.getTableLetterCase().getComparisonName()).isSameAs(CaseComparisons.IGNORE.getComparisonName()); Assertions.assertThat(request.getTableLetterCase().getComparisonName()).isSameAs(CaseComparisons.IGNORE.getComparisonName()); @@ -1561,21 +1553,19 @@ public void test_getTableLetterCase() { @Test @NeedReload public void test_getColumnLetterCase() { - SourceWithLetterCase sourceWithLetterCase = (SourceWithLetterCase) source; - - Table table = new Table(source, "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(source, "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); @@ -1584,9 +1574,6 @@ public void test_getColumnLetterCase() { Value valueAtStartPoint = rowAtStartPoint.getColumnValue(0); Value valueAtEndPoint = rowAtEndPoint.getColumnValue(0); - - Assertions.assertThat(sourceWithLetterCase.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()); @@ -1606,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(sourceWithLetterCase.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()); @@ -1632,24 +1616,19 @@ public void test_getColumnLetterCase() { @Test @NeedReload public void test_getPrimaryKeyLetterCase() { - SourceWithLetterCase sourceWithLetterCase = (SourceWithLetterCase) source; - - Table table = new Table(source, "test"); + Table table = connection.table("test").build(); Row tableRow = table.getRow(0); - Request request = new Request(source, "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(sourceWithLetterCase.getPrimaryKeyLetterCase().getConversionName()).isSameAs(CaseConversions.UPPER.getConversionName()); - Assertions.assertThat(table.getPrimaryKeyLetterCase().getConversionName()).isSameAs(CaseConversions.UPPER.getConversionName()); Assertions.assertThat(tableRow.getPrimaryKeyLetterCase().getConversionName()).isSameAs(CaseConversions.UPPER.getConversionName()); @@ -1661,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(sourceWithLetterCase.getPrimaryKeyLetterCase().getComparisonName()).isSameAs(CaseComparisons.IGNORE.getComparisonName()); - Assertions.assertThat(table.getPrimaryKeyLetterCase().getComparisonName()).isSameAs(CaseComparisons.IGNORE.getComparisonName()); Assertions.assertThat(tableRow.getPrimaryKeyLetterCase().getComparisonName()).isSameAs(CaseComparisons.IGNORE.getComparisonName()); diff --git a/src/test/java/org/assertj/db/database/h2/ReservedH2DataBase_Test.java b/src/test/java/org/assertj/db/database/h2/ReservedH2DataBase_Test.java index 4006dbec..d35c3c23 100644 --- a/src/test/java/org/assertj/db/database/h2/ReservedH2DataBase_Test.java +++ b/src/test/java/org/assertj/db/database/h2/ReservedH2DataBase_Test.java @@ -44,7 +44,7 @@ public void test_catalog_for_data_source() throws SQLException { } @Test - public void test_catalog_for_source() throws SQLException { + public void test_catalogfor_jdbc_connection() throws SQLException { try (Connection connection = DriverManager.getConnection(URL, USER, PASSWORD)) { String catalog = connection.getCatalog(); assertThat(catalog).isEqualTo("TESTRESERVEDH2"); @@ -60,7 +60,7 @@ public void test_schema_for_data_source() throws SQLException { } @Test - public void test_schema_for_source() throws SQLException { + public void test_schemafor_jdbc_connection() throws SQLException { try (Connection connection = DriverManager.getConnection(URL, USER, PASSWORD)) { String schema = connection.getSchema(); assertThat(schema).isEqualTo("PUBLIC"); @@ -81,7 +81,7 @@ public void test_tables_for_data_source() throws SQLException { } @Test - public void test_tables_for_source() throws SQLException { + public void test_tablesfor_jdbc_connection() throws SQLException { try (Connection connection = DriverManager.getConnection(URL, USER, PASSWORD)) { DatabaseMetaData databaseMetaData = connection.getMetaData(); ResultSet resultSet = databaseMetaData.getTables("TESTRESERVEDH2", null, null, new String[]{"TABLE"}); @@ -117,7 +117,7 @@ public void test_table_primary_keys_for_data_source() throws SQLException { } @Test - public void test_table_primary_keys_for_source() throws SQLException { + public void test_table_primary_keysfor_jdbc_connection() throws SQLException { try (Connection connection = DriverManager.getConnection(URL, USER, PASSWORD)) { DatabaseMetaData databaseMetaData = connection.getMetaData(); { @@ -177,7 +177,7 @@ public void test_table_columns_for_data_source() throws SQLException { } @Test - public void test_table_columns_for_source() throws SQLException { + public void test_table_columnsfor_jdbc_connection() throws SQLException { try (Connection connection = DriverManager.getConnection(URL, USER, PASSWORD)) { DatabaseMetaData databaseMetaData = connection.getMetaData(); { @@ -239,7 +239,7 @@ public void test_request_columns_for_data_source() throws SQLException { } @Test - public void test_request_columns_for_source() throws SQLException { + public void test_request_columnsfor_jdbc_connection() throws SQLException { try (Connection connection = DriverManager.getConnection(URL, USER, PASSWORD)) { try (Statement statement = connection.createStatement()) { try (ResultSet resultSet1 = statement.executeQuery("select * from `group`")) { diff --git a/src/test/java/org/assertj/db/database/h2/ReservedH2Database_DataSource_DDD_Test.java b/src/test/java/org/assertj/db/database/h2/ReservedH2Database_DataSource_DDD_Test.java index 16f93ae6..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 @@ -14,9 +14,8 @@ import static org.assertj.db.api.Assertions.assertThat; -import javax.sql.DataSource; - import org.assertj.db.common.NeedReload; +import org.assertj.db.type.AssertDbConnection; import org.assertj.db.type.Changes; import org.assertj.db.type.Table; import org.assertj.db.type.Table.Order; @@ -27,23 +26,22 @@ * Test on the H2 database with reserved names in SQL structure. * * @author Régis Pouiller + * @author Julien Roy */ public class ReservedH2Database_DataSource_DDD_Test extends AbstractReservedH2Test { - private DataSource dataSource; + private AssertDbConnection connection; @Before public void init() { - dataSource = dataSourceDDD; + connection = dsConnectionDDD; } @Test @NeedReload public void test_PrimaryKey_hasPksNames() { - Table table1 = new Table(dataSource, "group", '`', '`'); - Table table2 = new Table(dataSource, "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(dataSource, "group", '`', '`'); - Table table2 = new Table(dataSource, "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(dataSource, "group", '`', '`') - .setColumnsToCheck(new String[]{ + Table table1 = connection.table("group") + .delimiters('`', '`') + .columnsToCheck(new String[]{ "read", "by", "select", "from" - }); - Table table2 = new Table(dataSource, "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(dataSource, "group", '`', '`') - .setColumnsToExclude(new String[]{ + Table table1 = connection.table("group") + .delimiters('`', '`') + .columnsToExclude(new String[]{ "read", "by", "from" - }); - Table table2 = new Table(dataSource, "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(dataSource, "group", '`', '`') - .setColumnsToOrder(new Order[]{ + Table table1 = connection.table("group") + .delimiters('`', '`') + .columnsToOrder(new Order[]{ Order.asc("where") - }); - Table table2 = new Table(dataSource, "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 3723d07d..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 @@ -14,9 +14,8 @@ import static org.assertj.db.api.Assertions.assertThat; -import javax.sql.DataSource; - import org.assertj.db.common.NeedReload; +import org.assertj.db.type.AssertDbConnection; import org.assertj.db.type.Changes; import org.assertj.db.type.Table; import org.assertj.db.type.Table.Order; @@ -27,23 +26,24 @@ * Test on the H2 database with reserved names in SQL structure. * * @author Régis Pouiller + * @author Julien Roy */ public class ReservedH2Database_DataSource_NSNSNS_Test extends AbstractReservedH2Test { - private DataSource dataSource; + private AssertDbConnection connection; @Before public void init() { - dataSource = dataSourceNSNSNS; + connection = dsConnectionNSNSNS; } @Test @NeedReload public void test_PrimaryKey_hasPksNames() { - Table table1 = new Table(dataSource, "GROUP", '`', '`'); - Table table2 = new Table(dataSource, "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(dataSource, "GROUP", '`', '`'); - Table table2 = new Table(dataSource, "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(dataSource, "GROUP", '`', '`') - .setColumnsToCheck(new String[]{ + Table table1 = connection.table("GROUP") + .delimiters('`', '`') + .columnsToCheck(new String[]{ "READ", "BY", "SELECT", "FROM" - }); - Table table2 = new Table(dataSource, "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(dataSource, "GROUP", '`', '`') - .setColumnsToExclude(new String[]{ + Table table1 = connection.table("GROUP") + .delimiters('`', '`') + .columnsToExclude(new String[]{ "READ", "BY", "FROM" - }); - Table table2 = new Table(dataSource, "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(dataSource, "GROUP", '`', '`') - .setColumnsToOrder(new Order[]{ + Table table1 = connection.table("GROUP") + .delimiters('`', '`') + .columnsToOrder(new Order[]{ Order.asc("WHERE") - }); - Table table2 = new Table(dataSource, "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 84395bdb..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 @@ -14,9 +14,8 @@ import static org.assertj.db.api.Assertions.assertThat; -import javax.sql.DataSource; - import org.assertj.db.common.NeedReload; +import org.assertj.db.type.AssertDbConnection; import org.assertj.db.type.Changes; import org.assertj.db.type.Table; import org.assertj.db.type.Table.Order; @@ -27,23 +26,25 @@ * Test on the H2 database with reserved names in SQL structure. * * @author Régis Pouiller + * @author Julien Roy */ public class ReservedH2Database_DataSource_UIUIUI_Test extends AbstractReservedH2Test { - private DataSource dataSource; + private AssertDbConnection connection; @Before public void init() { - dataSource = dataSourceUIUIUI; + connection = dsConnectionUIUIUI; } @Test @NeedReload public void test_PrimaryKey_hasPksNames() { - Table table1 = new Table(dataSource, "group", '`', '`'); - Table table2 = new Table(dataSource, "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(dataSource, "group", '`', '`'); - Table table2 = new Table(dataSource, "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(dataSource, "group", '`', '`') - .setColumnsToCheck(new String[]{ + Table table1 = connection.table("group") + .delimiters('`', '`') + .columnsToCheck(new String[]{ "read", "by", "select", "from" - }); - Table table2 = new Table(dataSource, "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(dataSource, "group", '`', '`') - .setColumnsToExclude(new String[]{ + Table table1 = connection.table("group") + .delimiters('`', '`') + .columnsToExclude(new String[]{ "read", "by", "from" - }); - Table table2 = new Table(dataSource, "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(dataSource, "group", '`', '`') - .setColumnsToOrder(new Order[]{ + Table table1 = connection.table("group") + .delimiters('`', '`') + .columnsToOrder(new Order[]{ Order.asc("where") - }); - Table table2 = new Table(dataSource, "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_Source_DDD_Test.java b/src/test/java/org/assertj/db/database/h2/ReservedH2Database_JdbcUrl_DDD_Test.java similarity index 70% rename from src/test/java/org/assertj/db/database/h2/ReservedH2Database_Source_DDD_Test.java rename to src/test/java/org/assertj/db/database/h2/ReservedH2Database_JdbcUrl_DDD_Test.java index 5b1088dd..d5bb24cf 100644 --- a/src/test/java/org/assertj/db/database/h2/ReservedH2Database_Source_DDD_Test.java +++ b/src/test/java/org/assertj/db/database/h2/ReservedH2Database_JdbcUrl_DDD_Test.java @@ -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.Source; import org.assertj.db.type.Table; import org.assertj.db.type.Table.Order; import org.junit.Before; @@ -26,23 +26,24 @@ * Test on the H2 database with reserved names in SQL structure. * * @author Régis Pouiller + * @author Julien Roy */ -public class ReservedH2Database_Source_DDD_Test extends AbstractReservedH2Test { +public class ReservedH2Database_JdbcUrl_DDD_Test extends AbstractReservedH2Test { - private Source source; + private AssertDbConnection connection; @Before public void init() { - source = sourceDDD; + connection = jdbcConnectionDDD; } @Test @NeedReload public void test_PrimaryKey_hasPksNames() { - Table table1 = new Table(source, "group", '`', '`'); - Table table2 = new Table(source, "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(); @@ -56,10 +57,10 @@ public void test_PrimaryKey_hasPksNames() { @Test @NeedReload public void test_ColumnName_hasColumnName() { - Table table1 = new Table(source, "group", '`', '`'); - Table table2 = new Table(source, "two words", '`', '`'); - 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(); @@ -98,16 +99,18 @@ public void test_ColumnName_hasColumnName() { @Test @NeedReload public void test_ColumnName_hasColumnName_with_columns_to_check() { - Table table1 = new Table(source, "group", '`', '`') - .setColumnsToCheck(new String[]{ + Table table1 = connection.table("group") + .delimiters('`', '`') + .columnsToCheck(new String[]{ "read", "by", "select", "from" - }); - Table table2 = new Table(source, "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(); @@ -142,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(source, "group", '`', '`') - .setColumnsToExclude(new String[]{ + Table table1 = connection.table("group") + .delimiters('`', '`') + .columnsToExclude(new String[]{ "read", "by", "from" - }); - Table table2 = new Table(source, "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(); @@ -182,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(source, "group", '`', '`') - .setColumnsToOrder(new Order[]{ + Table table1 = connection.table("group") + .delimiters('`', '`') + .columnsToOrder(new Order[]{ Order.asc("where") - }); - Table table2 = new Table(source, "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(); @@ -226,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_Source_NSNSNS_Test.java b/src/test/java/org/assertj/db/database/h2/ReservedH2Database_JdbcUrl_NSNSNS_Test.java similarity index 71% rename from src/test/java/org/assertj/db/database/h2/ReservedH2Database_Source_NSNSNS_Test.java rename to src/test/java/org/assertj/db/database/h2/ReservedH2Database_JdbcUrl_NSNSNS_Test.java index 1a204299..d27bbc09 100644 --- a/src/test/java/org/assertj/db/database/h2/ReservedH2Database_Source_NSNSNS_Test.java +++ b/src/test/java/org/assertj/db/database/h2/ReservedH2Database_JdbcUrl_NSNSNS_Test.java @@ -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.Source; import org.assertj.db.type.Table; import org.assertj.db.type.Table.Order; import org.junit.Before; @@ -26,23 +26,24 @@ * Test on the H2 database with reserved names in SQL structure. * * @author Régis Pouiller + * @author Julien Roy */ -public class ReservedH2Database_Source_NSNSNS_Test extends AbstractReservedH2Test { +public class ReservedH2Database_JdbcUrl_NSNSNS_Test extends AbstractReservedH2Test { - private Source source; + private AssertDbConnection connection; @Before public void init() { - source = sourceNSNSNS; + connection = jdbcConnectionNSNSNS; } @Test @NeedReload public void test_PrimaryKey_hasPksNames() { - Table table1 = new Table(source, "GROUP", '`', '`'); - Table table2 = new Table(source, "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(); @@ -56,10 +57,10 @@ public void test_PrimaryKey_hasPksNames() { @Test @NeedReload public void test_ColumnName_hasColumnName() { - Table table1 = new Table(source, "GROUP", '`', '`'); - Table table2 = new Table(source, "TWO WORDS", '`', '`'); - 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(); @@ -98,16 +99,18 @@ public void test_ColumnName_hasColumnName() { @Test @NeedReload public void test_ColumnName_hasColumnName_with_columns_to_check() { - Table table1 = new Table(source, "GROUP", '`', '`') - .setColumnsToCheck(new String[]{ + Table table1 = connection.table("GROUP") + .delimiters('`', '`') + .columnsToCheck(new String[]{ "READ", "BY", "SELECT", "FROM" - }); - Table table2 = new Table(source, "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(); @@ -142,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(source, "GROUP", '`', '`') - .setColumnsToExclude(new String[]{ + Table table1 = connection.table("GROUP") + .delimiters('`', '`') + .columnsToExclude(new String[]{ "READ", "BY", "FROM" - }); - Table table2 = new Table(source, "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(); @@ -182,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(source, "GROUP", '`', '`') - .setColumnsToOrder(new Order[]{ + Table table1 = connection.table("GROUP") + .delimiters('`', '`') + .columnsToOrder(new Order[]{ Order.asc("WHERE") - }); - Table table2 = new Table(source, "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_Source_UIUIUI_Test.java b/src/test/java/org/assertj/db/database/h2/ReservedH2Database_JdbcUrl_UIUIUI_Test.java similarity index 70% rename from src/test/java/org/assertj/db/database/h2/ReservedH2Database_Source_UIUIUI_Test.java rename to src/test/java/org/assertj/db/database/h2/ReservedH2Database_JdbcUrl_UIUIUI_Test.java index fae85ba9..1f6141fb 100644 --- a/src/test/java/org/assertj/db/database/h2/ReservedH2Database_Source_UIUIUI_Test.java +++ b/src/test/java/org/assertj/db/database/h2/ReservedH2Database_JdbcUrl_UIUIUI_Test.java @@ -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.Source; import org.assertj.db.type.Table; import org.assertj.db.type.Table.Order; import org.junit.Before; @@ -26,23 +26,24 @@ * Test on the H2 database with reserved names in SQL structure. * * @author Régis Pouiller + * @author Julien Roy */ -public class ReservedH2Database_Source_UIUIUI_Test extends AbstractReservedH2Test { +public class ReservedH2Database_JdbcUrl_UIUIUI_Test extends AbstractReservedH2Test { - private Source source; + private AssertDbConnection connection; @Before public void init() { - source = sourceUIUIUI; + connection = jdbcConnectionUIUIUI; } @Test @NeedReload public void test_PrimaryKey_hasPksNames() { - Table table1 = new Table(source, "group", '`', '`'); - Table table2 = new Table(source, "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 +58,10 @@ public void test_PrimaryKey_hasPksNames() { @Test @NeedReload public void test_ColumnName_hasColumnName() { - Table table1 = new Table(source, "group", '`', '`'); - Table table2 = new Table(source, "two words", '`', '`'); - 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 +100,18 @@ public void test_ColumnName_hasColumnName() { @Test @NeedReload public void test_ColumnName_hasColumnName_with_columns_to_check() { - Table table1 = new Table(source, "group", '`', '`') - .setColumnsToCheck(new String[]{ + Table table1 = connection.table("group") + .delimiters('`', '`') + .columnsToCheck(new String[]{ "read", "by", "select", "from" - }); - Table table2 = new Table(source, "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 +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(source, "group", '`', '`') - .setColumnsToExclude(new String[]{ + Table table1 = connection.table("group") + .delimiters('`', '`') + .columnsToExclude(new String[]{ "read", "by", "from" - }); - Table table2 = new Table(source, "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 +188,18 @@ public void test_ColumnName_hasColumnName_with_columns_to_exclude() { @Test @NeedReload public void test_ColumnName_hasColumnName_with_order() { - Table table1 = new Table(source, "group", '`', '`') - .setColumnsToOrder(new Order[]{ + Table table1 = connection.table("group") + .delimiters('`', '`') + .columnsToOrder(new Order[]{ Order.asc("where") - }); - Table table2 = new Table(source, "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 6d5594e5..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.DataSourceWithLetterCase; -import org.assertj.db.type.SourceWithLetterCase; +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; @@ -40,6 +40,7 @@ * Parent for all the tests which are specific for HSQLDB database. * * @author Régis Pouiller + * @author Julien Roy */ @ContextConfiguration(classes = {HsqldbConfiguration.class}) public abstract class AbstractHsqldbTest extends AbstractDatabaseTest { @@ -77,12 +78,12 @@ public abstract class AbstractHsqldbTest extends AbstractDatabaseTest { private static final DbSetup DB_SETUP = new DbSetup(new DriverManagerDestination("jdbc:hsqldb:mem:testHsqldb", "SA", ""), OPERATIONS); - protected final SourceWithLetterCase sourceUIUIUI = new SourceWithLetterCase("jdbc:hsqldb:mem:testHsqldb", "SA", "", + protected final AssertDbConnection jdbcConnectionUIUIUI = AssertDbConnectionFactory.of("jdbc:hsqldb:mem:testHsqldb", "SA", "").letterCase( letterCaseUI, letterCaseUI, - letterCaseUI); - protected DataSourceWithLetterCase dataSourceUIUIUI; - protected DataSourceWithLetterCase dataSourceNSNSNS; + letterCaseUI).create(); + protected AssertDbConnection dsConnectionUIUIUI; + protected AssertDbConnection dsConnectionNSNSNS; protected DbSetup getDbSetup() { return DB_SETUP; @@ -94,8 +95,8 @@ protected DbSetupTracker getDbSetupTracker() { @Autowired protected void setDataSource(DataSource dataSource) { - this.dataSourceUIUIUI = new DataSourceWithLetterCase(dataSource, letterCaseUI, letterCaseUI, letterCaseUI); - this.dataSourceNSNSNS = new DataSourceWithLetterCase(dataSource, letterCaseNS, letterCaseNS, letterCaseNS); + this.dsConnectionUIUIUI = 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_Test.java b/src/test/java/org/assertj/db/database/hsqldb/HsqldbDataBase_Test.java index 62bb0e02..8eb7bb83 100644 --- a/src/test/java/org/assertj/db/database/hsqldb/HsqldbDataBase_Test.java +++ b/src/test/java/org/assertj/db/database/hsqldb/HsqldbDataBase_Test.java @@ -44,7 +44,7 @@ public void test_catalog_for_data_source() throws SQLException { } @Test - public void test_catalog_for_source() throws SQLException { + public void test_catalogfor_jdbc_connection() throws SQLException { try (Connection connection = DriverManager.getConnection(URL, USER, PASSWORD)) { String catalog = connection.getCatalog(); assertThat(catalog).isEqualTo("PUBLIC"); @@ -60,7 +60,7 @@ public void test_schema_for_data_source() throws SQLException { } @Test - public void test_schema_for_source() throws SQLException { + public void test_schemafor_jdbc_connection() throws SQLException { try (Connection connection = DriverManager.getConnection(URL, USER, PASSWORD)) { String schema = connection.getSchema(); assertThat(schema).isEqualTo("PUBLIC"); @@ -79,7 +79,7 @@ public void test_tables_for_data_source() throws SQLException { } @Test - public void test_tables_for_source() throws SQLException { + public void test_tablesfor_jdbc_connection() throws SQLException { try (Connection connection = DriverManager.getConnection(URL, USER, PASSWORD)) { DatabaseMetaData databaseMetaData = connection.getMetaData(); ResultSet resultSet = databaseMetaData.getTables("PUBLIC", "PUBLIC", null, new String[]{"TABLE"}); @@ -107,7 +107,7 @@ public void test_table_primary_keys_for_data_source() throws SQLException { } @Test - public void test_table_primary_keys_for_source() throws SQLException { + public void test_table_primary_keysfor_jdbc_connection() throws SQLException { try (Connection connection = DriverManager.getConnection(URL, USER, PASSWORD)) { DatabaseMetaData databaseMetaData = connection.getMetaData(); { @@ -191,7 +191,7 @@ public void test_table_columns_for_data_source() throws SQLException { } @Test - public void test_table_columns_for_source() throws SQLException { + public void test_table_columnsfor_jdbc_connection() throws SQLException { try (Connection connection = DriverManager.getConnection(URL, USER, PASSWORD)) { DatabaseMetaData databaseMetaData = connection.getMetaData(); { @@ -296,7 +296,7 @@ public void test_request_columns_for_data_source() throws SQLException { } @Test - public void test_request_columns_for_source() throws SQLException { + public void test_request_columnsfor_jdbc_connection() throws SQLException { try (Connection connection = DriverManager.getConnection(URL, USER, PASSWORD)) { try (Statement statement = connection.createStatement()) { try (ResultSet resultSet1 = statement.executeQuery("select * from test")) { diff --git a/src/test/java/org/assertj/db/database/hsqldb/HsqldbDatabase_Source_UIUIUI_Test.java b/src/test/java/org/assertj/db/database/hsqldb/HsqldbDatabase_JdbcUrl_UIUIUI_Test.java similarity index 94% rename from src/test/java/org/assertj/db/database/hsqldb/HsqldbDatabase_Source_UIUIUI_Test.java rename to src/test/java/org/assertj/db/database/hsqldb/HsqldbDatabase_JdbcUrl_UIUIUI_Test.java index d41772f1..cf5a3be5 100644 --- a/src/test/java/org/assertj/db/database/hsqldb/HsqldbDatabase_Source_UIUIUI_Test.java +++ b/src/test/java/org/assertj/db/database/hsqldb/HsqldbDatabase_JdbcUrl_UIUIUI_Test.java @@ -22,10 +22,10 @@ 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.DateTimeValue; import org.assertj.db.type.DateValue; -import org.assertj.db.type.Source; import org.assertj.db.type.Table; import org.assertj.db.type.TimeValue; import org.assertj.db.type.ValueType; @@ -36,21 +36,22 @@ * Test on the HSQLDB database. * * @author Régis Pouiller + * @author Julien Roy */ -public class HsqldbDatabase_Source_UIUIUI_Test extends AbstractHsqldbTest { +public class HsqldbDatabase_JdbcUrl_UIUIUI_Test extends AbstractHsqldbTest { - private Source source = sourceUIUIUI; + private AssertDbConnection connection = jdbcConnectionUIUIUI; @Before public void init() { - source = sourceUIUIUI; + connection = jdbcConnectionUIUIUI; } @Test @NeedReload public void test_PrimaryKey_hasPksNames() { - Table table = new Table(source, "test"); - Changes changes = new Changes(table).setStartPointNow(); + Table table = connection.table("test").build(); + Changes changes = connection.changes().tables(table).build().setStartPointNow(); update(); changes.setEndPointNow(); @@ -61,8 +62,8 @@ public void test_PrimaryKey_hasPksNames() { @Test @NeedReload public void test_ColumnName_hasColumnName() { - Table table = new Table(source, "test"); - Changes changes = new Changes(table).setStartPointNow(); + Table table = connection.table("test").build(); + Changes changes = connection.changes().tables(table).build().setStartPointNow(); update(); changes.setEndPointNow(); @@ -128,8 +129,8 @@ public void test_ColumnName_hasColumnName() { @Test @NeedReload public void test_ColumnClass_isOfClass() { - Table table = new Table(source, "test"); - Changes changes = new Changes(table).setStartPointNow(); + Table table = connection.table("test").build(); + Changes changes = connection.changes().tables(table).build().setStartPointNow(); update(); changes.setEndPointNow(); @@ -195,8 +196,8 @@ public void test_ColumnClass_isOfClass() { @Test @NeedReload public void test_ColumnEquality_hasValues() { - Table table = new Table(source, "test"); - Changes changes = new Changes(table).setStartPointNow(); + Table table = connection.table("test").build(); + Changes changes = connection.changes().tables(table).build().setStartPointNow(); update(); changes.setEndPointNow(); @@ -262,8 +263,8 @@ public void test_ColumnEquality_hasValues() { @Test @NeedReload public void test_ColumnEquality_containsValues() { - Table table = new Table(source, "test"); - Changes changes = new Changes(table).setStartPointNow(); + Table table = connection.table("test").build(); + Changes changes = connection.changes().tables(table).build().setStartPointNow(); update(); changes.setEndPointNow(); @@ -300,8 +301,8 @@ public void test_ColumnEquality_containsValues() { @Test @NeedReload public void test_ColumnType_isOfType() { - Table table = new Table(source, "test"); - Changes changes = new Changes(table).setStartPointNow(); + Table table = connection.table("test").build(); + Changes changes = connection.changes().tables(table).build().setStartPointNow(); update(); changes.setEndPointNow(); @@ -367,8 +368,8 @@ public void test_ColumnType_isOfType() { @Test @NeedReload public void test_ColumnOfChangeEquality_hasValues() { - Table table = new Table(source, "test"); - Changes changes = new Changes(table).setStartPointNow(); + Table table = connection.table("test").build(); + Changes changes = connection.changes().tables(table).build().setStartPointNow(); update(); changes.setEndPointNow(); @@ -441,8 +442,8 @@ public void test_ColumnOfChangeEquality_hasValues() { @Test @NeedReload public void test_RowEquality_hasValues() { - Table table = new Table(source, "test"); - Changes changes = new Changes(table).setStartPointNow(); + Table table = connection.table("test").build(); + Changes changes = connection.changes().tables(table).build().setStartPointNow(); update(); changes.setEndPointNow(); @@ -508,8 +509,8 @@ public void test_RowEquality_hasValues() { @Test @NeedReload public void test_ValueClass_isOfClass() { - Table table = new Table(source, "test"); - Changes changes = new Changes(table).setStartPointNow(); + Table table = connection.table("test").build(); + Changes changes = connection.changes().tables(table).build().setStartPointNow(); update(); changes.setEndPointNow(); @@ -575,8 +576,8 @@ public void test_ValueClass_isOfClass() { @Test @NeedReload public void test_ValueEquality_isEqualTo() { - Table table = new Table(source, "test"); - Changes changes = new Changes(table).setStartPointNow(); + Table table = connection.table("test").build(); + Changes changes = connection.changes().tables(table).build().setStartPointNow(); update(); changes.setEndPointNow(); @@ -642,8 +643,8 @@ public void test_ValueEquality_isEqualTo() { @Test @NeedReload public void test_ValueNonEquality_isNotEqualTo() { - Table table = new Table(source, "test"); - Changes changes = new Changes(table).setStartPointNow(); + Table table = connection.table("test").build(); + Changes changes = connection.changes().tables(table).build().setStartPointNow(); update(); changes.setEndPointNow(); @@ -709,8 +710,8 @@ public void test_ValueNonEquality_isNotEqualTo() { @Test @NeedReload public void test_ValueType_isOfType() { - Table table = new Table(source, "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 d46c3484..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.DataSourceWithLetterCase; -import org.assertj.db.type.SourceWithLetterCase; +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; @@ -39,6 +39,7 @@ * Parent for all the tests which are specific for Derby database. * * @author Régis Pouiller + * @author Julien Roy */ @ContextConfiguration(classes = {SqliteConfiguration.class}) public abstract class AbstractSqliteTest extends AbstractDatabaseTest { @@ -75,22 +76,22 @@ public abstract class AbstractSqliteTest extends AbstractDatabaseTest { private static final DbSetup DB_SETUP = new DbSetup(new DriverManagerDestination("jdbc:sqlite:target/testDerby.db", "", ""), OPERATIONS); - protected final SourceWithLetterCase sourceDDD = new SourceWithLetterCase("jdbc:sqlite:target/testDerby.db", "", "", + protected final AssertDbConnection jdbcConnectionDDD = AssertDbConnectionFactory.of("jdbc:sqlite:target/testDerby.db", "", "").letterCase( LetterCase.TABLE_DEFAULT, LetterCase.COLUMN_DEFAULT, - LetterCase.PRIMARY_KEY_DEFAULT); - protected final SourceWithLetterCase sourceUIUIUI = new SourceWithLetterCase("jdbc:sqlite:target/testDerby.db", "", "", + LetterCase.PRIMARY_KEY_DEFAULT).create(); + protected final AssertDbConnection jdbcConnectionUIUIUI = AssertDbConnectionFactory.of("jdbc:sqlite:target/testDerby.db", "", "").letterCase( letterCaseUI, letterCaseUI, - letterCaseUI); - protected final SourceWithLetterCase sourceNSNSNS = new SourceWithLetterCase("jdbc:sqlite:target/testDerby.db", "", "", + letterCaseUI).create(); + protected final AssertDbConnection jdbcConnectionNSNSNS = AssertDbConnectionFactory.of("jdbc:sqlite:target/testDerby.db", "", "").letterCase( letterCaseNS, letterCaseNS, - letterCaseNS); + letterCaseNS).create(); protected DataSource dataSource; - protected DataSourceWithLetterCase dataSourceDDD; - protected DataSourceWithLetterCase dataSourceUIUIUI; - protected DataSourceWithLetterCase dataSourceNSNSNS; + protected AssertDbConnection dsConnectionDDD; + protected AssertDbConnection dsConnectionUIUIUI; + protected AssertDbConnection dsConnectionNSNSNS; protected DbSetup getDbSetup() { return DB_SETUP; @@ -103,11 +104,9 @@ protected DbSetupTracker getDbSetupTracker() { @Autowired protected void setDataSource(DataSource dataSource) { this.dataSource = dataSource; - this.dataSourceDDD = new DataSourceWithLetterCase(dataSource, LetterCase.TABLE_DEFAULT, - LetterCase.COLUMN_DEFAULT, - LetterCase.PRIMARY_KEY_DEFAULT); - this.dataSourceUIUIUI = new DataSourceWithLetterCase(dataSource, letterCaseUI, letterCaseUI, letterCaseUI); - this.dataSourceNSNSNS = new DataSourceWithLetterCase(dataSource, letterCaseNS, letterCaseNS, letterCaseNS); + this.dsConnectionDDD = 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_Test.java b/src/test/java/org/assertj/db/database/sqlite/SqliteDataBase_Test.java index 2d568606..a89ef462 100644 --- a/src/test/java/org/assertj/db/database/sqlite/SqliteDataBase_Test.java +++ b/src/test/java/org/assertj/db/database/sqlite/SqliteDataBase_Test.java @@ -44,7 +44,7 @@ public void test_catalog_for_data_source() throws SQLException { } @Test - public void test_catalog_for_source() throws SQLException { + public void test_catalog_for_jdbc_connection() throws SQLException { try (Connection connection = DriverManager.getConnection(URL, USER, PASSWORD)) { String catalog = connection.getCatalog(); assertThat(catalog).isNull(); @@ -60,7 +60,7 @@ public void test_schema_for_data_source() throws SQLException { } @Test - public void test_schema_for_source() throws SQLException { + public void test_schema_for_jdbc_connection() throws SQLException { try (Connection connection = DriverManager.getConnection(URL, USER, PASSWORD)) { String schema = connection.getSchema(); assertThat(schema).isNull(); @@ -79,7 +79,7 @@ public void test_tables_for_data_source() throws SQLException { } @Test - public void test_tables_for_source() throws SQLException { + public void test_tables_for_jdbc_connection() throws SQLException { try (Connection connection = DriverManager.getConnection(URL, USER, PASSWORD)) { DatabaseMetaData databaseMetaData = connection.getMetaData(); ResultSet resultSet = databaseMetaData.getTables(null, null, null, new String[]{"TABLE"}); @@ -109,7 +109,7 @@ public void test_table_primary_keys_for_data_source() throws SQLException { } @Test - public void test_table_primary_keys_for_source() throws SQLException { + public void test_table_primary_keys_for_jdbc_connection() throws SQLException { try (Connection connection = DriverManager.getConnection(URL, USER, PASSWORD)) { DatabaseMetaData databaseMetaData = connection.getMetaData(); { @@ -223,7 +223,7 @@ public void test_table_columns_for_data_source() throws SQLException { } @Test - public void test_table_columns_for_source() throws SQLException { + public void test_table_columnsfor_jdbc_connection() throws SQLException { try (Connection connection = DriverManager.getConnection(URL, USER, PASSWORD)) { DatabaseMetaData databaseMetaData = connection.getMetaData(); { @@ -350,7 +350,7 @@ public void test_request_columns_for_data_source() throws SQLException { } @Test - public void test_request_columns_for_source() throws SQLException { + public void test_request_columnsfor_jdbc_connection() throws SQLException { try (Connection connection = DriverManager.getConnection(URL, USER, PASSWORD)) { try (Statement statement = connection.createStatement()) { try (ResultSet resultSet1 = statement.executeQuery("select * from test")) { diff --git a/src/test/java/org/assertj/db/database/sqlite/SqliteDatabase_DataSource_DDD_Test.java b/src/test/java/org/assertj/db/database/sqlite/SqliteDatabase_DataSource_DDD_Test.java index fdca12f4..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 @@ -17,11 +17,11 @@ import java.io.ByteArrayOutputStream; import java.sql.Date; -import javax.sql.DataSource; import org.assertj.core.api.Assertions; import org.assertj.db.common.NeedReload; import org.assertj.db.output.Outputs; +import org.assertj.db.type.AssertDbConnection; import org.assertj.db.type.Changes; import org.assertj.db.type.DateValue; import org.assertj.db.type.Table; @@ -33,21 +33,22 @@ * Test on the Sqlite database. * * @author Régis Pouiller + * @author Julien Roy */ public class SqliteDatabase_DataSource_DDD_Test extends AbstractSqliteTest { - private DataSource dataSource; + private AssertDbConnection connection; @Before public void init() { - dataSource = dataSourceDDD; + connection = dsConnectionDDD; } @Test @NeedReload public void test_Outputs_output() { - Table table = new Table(dataSource, "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(); @@ -75,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" @@ -84,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" @@ -107,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 a 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" @@ -125,7 +126,7 @@ public void test_Outputs_output() { + "| Index : 0 | MODIFICATION | teSt | 1 |----------------|-----------|-----------|-----------|-----------|-----------|------------|-----------|-----------|-----------|-----------|------------|------------|------------|------------|------------|------------|------------|-----------------------|------------|%n" + "| | | | | At end point | 1 | 13 | 2 | 14 | 15 | 2007-12-23 | 3.3 | 4.4 | 5.5 | 6.6 | 20 | 8 | 16 | 9 | 10.1 | 11 | 09:01:00 | 2007-12-23 09:01:00.0 | 12 |%n" + "|-----------|--------------|-------|---------|----------------|-----------|-----------|-----------|-----------|-----------|------------|-----------|-----------|-----------|-----------|------------|------------|------------|------------|------------|------------|------------|-----------------------|------------|%n")); - Assertions.assertThat(byteArrayOutputStream6.toString()).isEqualTo(String.format("[Change at index 0 (with primary key : [1]) of Changes on teSt table of a data source]%n" + Assertions.assertThat(byteArrayOutputStream6).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" @@ -136,7 +137,7 @@ public void test_Outputs_output() { + "| MODIFICATION | teSt | 1 |----------------|-----------|-----------|-----------|-----------|-----------|------------|-----------|-----------|-----------|-----------|------------|------------|------------|------------|------------|------------|------------|-----------------------|------------|%n" + "| | | | At end point | 1 | 13 | 2 | 14 | 15 | 2007-12-23 | 3.3 | 4.4 | 5.5 | 6.6 | 20 | 8 | 16 | 9 | 10.1 | 11 | 09:01:00 | 2007-12-23 09:01:00.0 | 12 |%n" + "|--------------|-------|---------|----------------|-----------|-----------|-----------|-----------|-----------|------------|-----------|-----------|-----------|-----------|------------|------------|------------|------------|------------|------------|------------|-----------------------|------------|%n")); - Assertions.assertThat(byteArrayOutputStream7.toString()).isEqualTo(String.format("[Row at end point of Change at index 0 (with primary key : [1]) of Changes on teSt table of a data source]%n" + Assertions.assertThat(byteArrayOutputStream7).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" @@ -145,14 +146,14 @@ public void test_Outputs_output() { + "|---------|-----------|-----------|-----------|-----------|-----------|------------|-----------|-----------|-----------|-----------|------------|------------|------------|------------|------------|------------|------------|-----------------------|------------|%n" + "| 1 | 1 | 13 | 2 | 14 | 15 | 2007-12-23 | 3.3 | 4.4 | 5.5 | 6.6 | 20 | 8 | 16 | 9 | 10.1 | 11 | 09:01:00 | 2007-12-23 09:01:00.0 | 12 |%n" + "|---------|-----------|-----------|-----------|-----------|-----------|------------|-----------|-----------|-----------|-----------|------------|------------|------------|------------|------------|------------|------------|-----------------------|------------|%n")); - Assertions.assertThat(byteArrayOutputStream8.toString()).isEqualTo(String.format("[Value at index 0 (column name : VAR1) of Row at end point of Change at index 0 (with primary key : [1]) of Changes on teSt table of a data source]%n" + Assertions.assertThat(byteArrayOutputStream8).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 a 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" @@ -161,7 +162,7 @@ public void test_Outputs_output() { + "|----------------|----------|%n" + "| At end point | 1 |%n" + "|----------------|----------|%n")); - Assertions.assertThat(byteArrayOutputStream10.toString()).isEqualTo(String.format("[Value at end point of Column at index 0 (column name : VAR1) of Change at index 0 (with primary key : [1]) of Changes on teSt table of a data source]%n" + Assertions.assertThat(byteArrayOutputStream10).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" @@ -173,8 +174,8 @@ public void test_Outputs_output() { @Test @NeedReload public void test_PrimaryKey_hasPksNames() { - Table table = new Table(dataSource, "test"); - Changes changes = new Changes(table).setStartPointNow(); + Table table = connection.table("test").build(); + Changes changes = connection.changes().tables(table).build().setStartPointNow(); update(); changes.setEndPointNow(); @@ -185,8 +186,8 @@ public void test_PrimaryKey_hasPksNames() { @Test @NeedReload public void test_ColumnName_hasColumnName() { - Table table = new Table(dataSource, "test"); - Changes changes = new Changes(table).setStartPointNow(); + Table table = connection.table("test").build(); + Changes changes = connection.changes().tables(table).build().setStartPointNow(); update(); changes.setEndPointNow(); @@ -240,8 +241,8 @@ public void test_ColumnName_hasColumnName() { @Test @NeedReload public void test_ColumnClass_isOfClass() { - Table table = new Table(dataSource, "test"); - Changes changes = new Changes(table).setStartPointNow(); + Table table = connection.table("test").build(); + Changes changes = connection.changes().tables(table).build().setStartPointNow(); update(); changes.setEndPointNow(); @@ -295,8 +296,8 @@ public void test_ColumnClass_isOfClass() { @Test @NeedReload public void test_ColumnEquality_hasValues() { - Table table = new Table(dataSource, "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(); @@ -347,8 +348,8 @@ public void test_ColumnEquality_hasValues() { @Test @NeedReload public void test_ColumnEquality_containsValues() { - Table table = new Table(dataSource, "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(); @@ -377,8 +378,8 @@ public void test_ColumnEquality_containsValues() { @Test @NeedReload public void test_ColumnType_isOfType() { - Table table = new Table(dataSource, "test"); - Changes changes = new Changes(table).setStartPointNow(); + Table table = connection.table("test").build(); + Changes changes = connection.changes().tables(table).build().setStartPointNow(); update(); changes.setEndPointNow(); @@ -431,8 +432,8 @@ public void test_ColumnType_isOfType() { @Test @NeedReload public void test_ColumnOfChangeEquality_hasValues() { - Table table = new Table(dataSource, "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(); @@ -484,8 +485,8 @@ public void test_ColumnOfChangeEquality_hasValues() { @Test @NeedReload public void test_RowEquality_hasValues() { - Table table = new Table(dataSource, "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(); @@ -507,8 +508,8 @@ public void test_RowEquality_hasValues() { @Test @NeedReload public void test_ValueClass_isOfClass() { - Table table = new Table(dataSource, "test"); - Changes changes = new Changes(table).setStartPointNow(); + Table table = connection.table("test").build(); + Changes changes = connection.changes().tables(table).build().setStartPointNow(); update(); changes.setEndPointNow(); @@ -562,8 +563,8 @@ public void test_ValueClass_isOfClass() { @Test @NeedReload public void test_ValueEquality_isEqualTo() { - Table table = new Table(dataSource, "test"); - Changes changes = new Changes(table).setStartPointNow(); + Table table = connection.table("test").build(); + Changes changes = connection.changes().tables(table).build().setStartPointNow(); update(); changes.setEndPointNow(); @@ -615,8 +616,8 @@ public void test_ValueEquality_isEqualTo() { @Test @NeedReload public void test_ValueNonEquality_isNotEqualTo() { - Table table = new Table(dataSource, "test"); - Changes changes = new Changes(table).setStartPointNow(); + Table table = connection.table("test").build(); + Changes changes = connection.changes().tables(table).build().setStartPointNow(); update(); changes.setEndPointNow(); @@ -668,8 +669,8 @@ public void test_ValueNonEquality_isNotEqualTo() { @Test @NeedReload public void test_ValueType_isOfType() { - Table table = new Table(dataSource, "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 94c606dd..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 @@ -17,12 +17,12 @@ import static org.junit.Assert.fail; import java.io.ByteArrayOutputStream; -import javax.sql.DataSource; import org.assertj.core.api.Assertions; import org.assertj.db.common.NeedReload; import org.assertj.db.exception.AssertJDBException; import org.assertj.db.output.Outputs; +import org.assertj.db.type.AssertDbConnection; import org.assertj.db.type.Changes; import org.assertj.db.type.Table; import org.junit.Before; @@ -32,21 +32,22 @@ * Test on the Sqlite database. * * @author Régis Pouiller + * @author Julien Roy */ public class SqliteDatabase_DataSource_NSNSNS_Test extends AbstractSqliteTest { - private DataSource dataSource; + private AssertDbConnection connection; @Before public void init() { - dataSource = dataSourceNSNSNS; + connection = dsConnectionNSNSNS; } @Test @NeedReload public void test_Outputs_output() { - Table table = new Table(dataSource, "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(); @@ -73,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" @@ -82,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" @@ -105,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 a 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" @@ -123,7 +124,7 @@ public void test_Outputs_output() { + "| Index : 0 | MODIFICATION | test | 1 |----------------|-----------|-----------|-----------|-----------|-----------|------------|-----------|-----------|-----------|-----------|------------|------------|------------|------------|------------|------------|------------|-----------------------|------------|%n" + "| | | | | At end point | 1 | 13 | 2 | 14 | 15 | 2007-12-23 | 3.3 | 4.4 | 5.5 | 6.6 | 20 | 8 | 16 | 9 | 10.1 | 11 | 09:01:00 | 2007-12-23 09:01:00.0 | 12 |%n" + "|-----------|--------------|-------|---------|----------------|-----------|-----------|-----------|-----------|-----------|------------|-----------|-----------|-----------|-----------|------------|------------|------------|------------|------------|------------|------------|-----------------------|------------|%n")); - Assertions.assertThat(byteArrayOutputStream6.toString()).isEqualTo(String.format("[Change at index 0 (with primary key : [1]) of Changes on test table of a data source]%n" + Assertions.assertThat(byteArrayOutputStream6).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" @@ -134,7 +135,7 @@ public void test_Outputs_output() { + "| MODIFICATION | test | 1 |----------------|-----------|-----------|-----------|-----------|-----------|------------|-----------|-----------|-----------|-----------|------------|------------|------------|------------|------------|------------|------------|-----------------------|------------|%n" + "| | | | At end point | 1 | 13 | 2 | 14 | 15 | 2007-12-23 | 3.3 | 4.4 | 5.5 | 6.6 | 20 | 8 | 16 | 9 | 10.1 | 11 | 09:01:00 | 2007-12-23 09:01:00.0 | 12 |%n" + "|--------------|-------|---------|----------------|-----------|-----------|-----------|-----------|-----------|------------|-----------|-----------|-----------|-----------|------------|------------|------------|------------|------------|------------|------------|-----------------------|------------|%n")); - Assertions.assertThat(byteArrayOutputStream7.toString()).isEqualTo(String.format("[Row at end point of Change at index 0 (with primary key : [1]) of Changes on test table of a data source]%n" + Assertions.assertThat(byteArrayOutputStream7).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" @@ -143,14 +144,14 @@ public void test_Outputs_output() { + "|---------|-----------|-----------|-----------|-----------|-----------|------------|-----------|-----------|-----------|-----------|------------|------------|------------|------------|------------|------------|------------|-----------------------|------------|%n" + "| 1 | 1 | 13 | 2 | 14 | 15 | 2007-12-23 | 3.3 | 4.4 | 5.5 | 6.6 | 20 | 8 | 16 | 9 | 10.1 | 11 | 09:01:00 | 2007-12-23 09:01:00.0 | 12 |%n" + "|---------|-----------|-----------|-----------|-----------|-----------|------------|-----------|-----------|-----------|-----------|------------|------------|------------|------------|------------|------------|------------|-----------------------|------------|%n")); - Assertions.assertThat(byteArrayOutputStream8.toString()).isEqualTo(String.format("[Value at index 0 (column name : Var1) of Row at end point of Change at index 0 (with primary key : [1]) of Changes on test table of a data source]%n" + Assertions.assertThat(byteArrayOutputStream8).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 a 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" @@ -159,7 +160,7 @@ public void test_Outputs_output() { + "|----------------|----------|%n" + "| At end point | 1 |%n" + "|----------------|----------|%n")); - Assertions.assertThat(byteArrayOutputStream10.toString()).isEqualTo(String.format("[Value at end point of Column at index 0 (column name : Var1) of Change at index 0 (with primary key : [1]) of Changes on test table of a data source]%n" + Assertions.assertThat(byteArrayOutputStream10).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" @@ -171,9 +172,9 @@ public void test_Outputs_output() { @Test @NeedReload public void should_fail_because_primary_key_is_different() { - Table table = new Table(dataSource, "test"); - Changes changes = new Changes(table).setStartPointNow(); - Changes changes2 = new Changes(dataSource).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(); @@ -182,7 +183,7 @@ public void should_fail_because_primary_key_is_different() { assertThat(changes).change().hasPksNames("var1"); fail("An exception must be raised"); } catch (AssertionError e) { - Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Change at index 0 (with primary key : [1]) of Changes on test table of a data source] %n" + Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Change at index 0 (with primary key : [1]) of Changes on test table of 'data source'] %n" + "Expecting :%n" + " [\"var1\"]%n" + "to be the name of the columns of the primary keys but was:%n" @@ -193,7 +194,7 @@ public void should_fail_because_primary_key_is_different() { assertThat(changes2).change().hasPksNames("var1"); fail("An exception must be raised"); } catch (AssertionError e) { - Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Change at index 0 (with primary key : [1]) of Changes on teSt table of a data source] %n" + Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Change at index 0 (with primary key : [1]) of Changes on teSt table of 'data source'] %n" + "Expecting :%n" + " [\"var1\"]%n" + "to be the name of the columns of the primary keys but was:%n" @@ -204,9 +205,9 @@ public void should_fail_because_primary_key_is_different() { @Test @NeedReload public void should_fail_because_column_name_is_different() { - Table table = new Table(dataSource, "test"); - Changes changes = new Changes(table).setStartPointNow(); - Changes changes2 = new Changes(dataSource).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(); @@ -236,7 +237,7 @@ public void should_fail_because_column_name_is_different() { assertThat(changes).change().column().hasColumnName("var1"); fail("An exception must be raised"); } catch (AssertionError e) { - Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Column at index 0 (column name : Var1) of Change at index 0 (with primary key : [1]) of Changes on test table of a data source] %n" + Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Column at index 0 (column name : Var1) of Change at index 0 (with primary key : [1]) of Changes on test table of 'data source'] %n" + "Expecting :%n" + " \"var1\"%n" + "to be the name of the column but was:%n" @@ -246,7 +247,7 @@ public void should_fail_because_column_name_is_different() { assertThat(changes).change().rowAtEndPoint().value().hasColumnName("var1"); fail("An exception must be raised"); } catch (AssertionError e) { - Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Value at index 0 (column name : Var1) of Row at end point of Change at index 0 (with primary key : [1]) of Changes on test table of a data source] %n" + Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Value at index 0 (column name : Var1) of Row at end point of Change at index 0 (with primary key : [1]) of Changes on test table of 'data source'] %n" + "Expecting :%n" + " \"var1\"%n" + "to be the name of the column but was:%n" @@ -257,7 +258,7 @@ public void should_fail_because_column_name_is_different() { assertThat(changes2).change().column().hasColumnName("var1"); fail("An exception must be raised"); } catch (AssertionError e) { - Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Column at index 0 (column name : Var1) of Change at index 0 (with primary key : [1]) of Changes on teSt table of a data source] %n" + Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Column at index 0 (column name : Var1) of Change at index 0 (with primary key : [1]) of Changes on teSt table of 'data source'] %n" + "Expecting :%n" + " \"var1\"%n" + "to be the name of the column but was:%n" @@ -267,7 +268,7 @@ public void should_fail_because_column_name_is_different() { assertThat(changes2).change().rowAtEndPoint().value().hasColumnName("var1"); fail("An exception must be raised"); } catch (AssertionError e) { - Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Value at index 0 (column name : Var1) of Row at end point of Change at index 0 (with primary key : [1]) of Changes on teSt table of a data source] %n" + Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Value at index 0 (column name : Var1) of Row at end point of Change at index 0 (with primary key : [1]) of Changes on teSt table of 'data source'] %n" + "Expecting :%n" + " \"var1\"%n" + "to be the name of the column but was:%n" @@ -278,9 +279,9 @@ public void should_fail_because_column_name_is_different() { @Test @NeedReload public void should_fail_because_column_name_is_wrong_to_navigate() { - Table table = new Table(dataSource, "test"); - Changes changes = new Changes(table).setStartPointNow(); - Changes changes2 = new Changes(dataSource).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(); @@ -340,9 +341,9 @@ public void should_fail_because_column_name_is_wrong_to_navigate() { @Test @NeedReload public void should_fail_because_table_name_is_different() { - Table table = new Table(dataSource, "test"); - Changes changes = new Changes(table).setStartPointNow(); - Changes changes2 = new Changes(dataSource).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(); @@ -351,7 +352,7 @@ public void should_fail_because_table_name_is_different() { assertThat(changes).change().isOnTable("teSt"); fail("An exception must be raised"); } catch (AssertionError e) { - Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Change at index 0 (with primary key : [1]) of Changes on test table of a data source] %n" + Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Change at index 0 (with primary key : [1]) of Changes on test table of 'data source'] %n" + "Expecting to be on the table:%n" + " <\"teSt\">%n" + "but was on the table:%n" @@ -361,7 +362,7 @@ public void should_fail_because_table_name_is_different() { assertThat(changes2).change().isOnTable("test"); fail("An exception must be raised"); } catch (AssertionError e) { - Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Change at index 0 (with primary key : [1]) of Changes on teSt table of a data source] %n" + Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Change at index 0 (with primary key : [1]) of Changes on teSt table of 'data source'] %n" + "Expecting to be on the table:%n" + " <\"test\">%n" + "but was on the table:%n" @@ -372,9 +373,9 @@ public void should_fail_because_table_name_is_different() { @Test @NeedReload public void should_fail_because_table_name_is_wrong_to_navigate() { - Table table = new Table(dataSource, "test"); - Changes changes = new Changes(table).setStartPointNow(); - Changes changes2 = new Changes(dataSource).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(); @@ -421,9 +422,9 @@ public void should_fail_because_table_name_is_wrong_to_navigate() { @Test @NeedReload public void test_ColumnName_hasColumnName() { - Table table = new Table(dataSource, "test"); - Changes changes = new Changes(table).setStartPointNow(); - Changes changes2 = new Changes(dataSource).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 +438,9 @@ public void test_ColumnName_hasColumnName() { @Test @NeedReload public void test_ColumnClass_isOfClass() { - Table table = new Table(dataSource, "test"); - Changes changes = new Changes(table).setStartPointNow(); - Changes changes2 = new Changes(dataSource).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 19c58d63..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 @@ -17,11 +17,11 @@ import java.io.ByteArrayOutputStream; import java.sql.Date; -import javax.sql.DataSource; import org.assertj.core.api.Assertions; import org.assertj.db.common.NeedReload; import org.assertj.db.output.Outputs; +import org.assertj.db.type.AssertDbConnection; import org.assertj.db.type.Changes; import org.assertj.db.type.DateValue; import org.assertj.db.type.Table; @@ -33,21 +33,22 @@ * Test on the Sqlite database. * * @author Régis Pouiller + * @author Julien Roy */ public class SqliteDatabase_DataSource_UIUIUI_Test extends AbstractSqliteTest { - private DataSource dataSource; + private AssertDbConnection connection; @Before public void init() { - dataSource = dataSourceUIUIUI; + connection = dsConnectionUIUIUI; } @Test @NeedReload public void test_Outputs_output() { - Table table = new Table(dataSource, "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(); @@ -75,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" @@ -84,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" @@ -107,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 a 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" @@ -125,7 +126,7 @@ public void test_Outputs_output() { + "| Index : 0 | MODIFICATION | TEST | 1 |----------------|-----------|-----------|-----------|-----------|-----------|------------|-----------|-----------|-----------|-----------|------------|------------|------------|------------|------------|------------|------------|-----------------------|------------|%n" + "| | | | | At end point | 1 | 13 | 2 | 14 | 15 | 2007-12-23 | 3.3 | 4.4 | 5.5 | 6.6 | 20 | 8 | 16 | 9 | 10.1 | 11 | 09:01:00 | 2007-12-23 09:01:00.0 | 12 |%n" + "|-----------|--------------|-------|---------|----------------|-----------|-----------|-----------|-----------|-----------|------------|-----------|-----------|-----------|-----------|------------|------------|------------|------------|------------|------------|------------|-----------------------|------------|%n")); - Assertions.assertThat(byteArrayOutputStream6.toString()).isEqualTo(String.format("[Change at index 0 (with primary key : [1]) of Changes on TEST table of a data source]%n" + Assertions.assertThat(byteArrayOutputStream6).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" @@ -136,7 +137,7 @@ public void test_Outputs_output() { + "| MODIFICATION | TEST | 1 |----------------|-----------|-----------|-----------|-----------|-----------|------------|-----------|-----------|-----------|-----------|------------|------------|------------|------------|------------|------------|------------|-----------------------|------------|%n" + "| | | | At end point | 1 | 13 | 2 | 14 | 15 | 2007-12-23 | 3.3 | 4.4 | 5.5 | 6.6 | 20 | 8 | 16 | 9 | 10.1 | 11 | 09:01:00 | 2007-12-23 09:01:00.0 | 12 |%n" + "|--------------|-------|---------|----------------|-----------|-----------|-----------|-----------|-----------|------------|-----------|-----------|-----------|-----------|------------|------------|------------|------------|------------|------------|------------|-----------------------|------------|%n")); - Assertions.assertThat(byteArrayOutputStream7.toString()).isEqualTo(String.format("[Row at end point of Change at index 0 (with primary key : [1]) of Changes on TEST table of a data source]%n" + Assertions.assertThat(byteArrayOutputStream7).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" @@ -145,14 +146,14 @@ public void test_Outputs_output() { + "|---------|-----------|-----------|-----------|-----------|-----------|------------|-----------|-----------|-----------|-----------|------------|------------|------------|------------|------------|------------|------------|-----------------------|------------|%n" + "| 1 | 1 | 13 | 2 | 14 | 15 | 2007-12-23 | 3.3 | 4.4 | 5.5 | 6.6 | 20 | 8 | 16 | 9 | 10.1 | 11 | 09:01:00 | 2007-12-23 09:01:00.0 | 12 |%n" + "|---------|-----------|-----------|-----------|-----------|-----------|------------|-----------|-----------|-----------|-----------|------------|------------|------------|------------|------------|------------|------------|-----------------------|------------|%n")); - Assertions.assertThat(byteArrayOutputStream8.toString()).isEqualTo(String.format("[Value at index 0 (column name : VAR1) of Row at end point of Change at index 0 (with primary key : [1]) of Changes on TEST table of a data source]%n" + Assertions.assertThat(byteArrayOutputStream8).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 a 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" @@ -161,7 +162,7 @@ public void test_Outputs_output() { + "|----------------|----------|%n" + "| At end point | 1 |%n" + "|----------------|----------|%n")); - Assertions.assertThat(byteArrayOutputStream10.toString()).isEqualTo(String.format("[Value at end point of Column at index 0 (column name : VAR1) of Change at index 0 (with primary key : [1]) of Changes on TEST table of a data source]%n" + Assertions.assertThat(byteArrayOutputStream10).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" @@ -173,8 +174,8 @@ public void test_Outputs_output() { @Test @NeedReload public void test_PrimaryKey_hasPksNames() { - Table table = new Table(dataSource, "test"); - Changes changes = new Changes(table).setStartPointNow(); + Table table = connection.table("test").build(); + Changes changes = connection.changes().tables(table).build().setStartPointNow(); update(); changes.setEndPointNow(); @@ -185,8 +186,8 @@ public void test_PrimaryKey_hasPksNames() { @Test @NeedReload public void test_ColumnName_hasColumnName() { - Table table = new Table(dataSource, "test"); - Changes changes = new Changes(table).setStartPointNow(); + Table table = connection.table("test").build(); + Changes changes = connection.changes().tables(table).build().setStartPointNow(); update(); changes.setEndPointNow(); @@ -240,8 +241,8 @@ public void test_ColumnName_hasColumnName() { @Test @NeedReload public void test_ColumnClass_isOfClass() { - Table table = new Table(dataSource, "test"); - Changes changes = new Changes(table).setStartPointNow(); + Table table = connection.table("test").build(); + Changes changes = connection.changes().tables(table).build().setStartPointNow(); update(); changes.setEndPointNow(); @@ -295,8 +296,8 @@ public void test_ColumnClass_isOfClass() { @Test @NeedReload public void test_ColumnEquality_hasValues() { - Table table = new Table(dataSource, "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(); @@ -347,8 +348,8 @@ public void test_ColumnEquality_hasValues() { @Test @NeedReload public void test_ColumnEquality_containsValues() { - Table table = new Table(dataSource, "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(); @@ -377,8 +378,8 @@ public void test_ColumnEquality_containsValues() { @Test @NeedReload public void test_ColumnType_isOfType() { - Table table = new Table(dataSource, "test"); - Changes changes = new Changes(table).setStartPointNow(); + Table table = connection.table("test").build(); + Changes changes = connection.changes().tables(table).build().setStartPointNow(); update(); changes.setEndPointNow(); @@ -431,8 +432,8 @@ public void test_ColumnType_isOfType() { @Test @NeedReload public void test_ColumnOfChangeEquality_hasValues() { - Table table = new Table(dataSource, "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(); @@ -484,8 +485,8 @@ public void test_ColumnOfChangeEquality_hasValues() { @Test @NeedReload public void test_RowEquality_hasValues() { - Table table = new Table(dataSource, "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(); @@ -507,8 +508,8 @@ public void test_RowEquality_hasValues() { @Test @NeedReload public void test_ValueClass_isOfClass() { - Table table = new Table(dataSource, "test"); - Changes changes = new Changes(table).setStartPointNow(); + Table table = connection.table("test").build(); + Changes changes = connection.changes().tables(table).build().setStartPointNow(); update(); changes.setEndPointNow(); @@ -562,8 +563,8 @@ public void test_ValueClass_isOfClass() { @Test @NeedReload public void test_ValueEquality_isEqualTo() { - Table table = new Table(dataSource, "test"); - Changes changes = new Changes(table).setStartPointNow(); + Table table = connection.table("test").build(); + Changes changes = connection.changes().tables(table).build().setStartPointNow(); update(); changes.setEndPointNow(); @@ -615,8 +616,8 @@ public void test_ValueEquality_isEqualTo() { @Test @NeedReload public void test_ValueNonEquality_isNotEqualTo() { - Table table = new Table(dataSource, "test"); - Changes changes = new Changes(table).setStartPointNow(); + Table table = connection.table("test").build(); + Changes changes = connection.changes().tables(table).build().setStartPointNow(); update(); changes.setEndPointNow(); @@ -668,8 +669,8 @@ public void test_ValueNonEquality_isNotEqualTo() { @Test @NeedReload public void test_ValueType_isOfType() { - Table table = new Table(dataSource, "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_Source_DDD_Test.java b/src/test/java/org/assertj/db/database/sqlite/SqliteDatabase_JdbcUrl_DDD_Test.java similarity index 90% rename from src/test/java/org/assertj/db/database/sqlite/SqliteDatabase_Source_DDD_Test.java rename to src/test/java/org/assertj/db/database/sqlite/SqliteDatabase_JdbcUrl_DDD_Test.java index 4b4c21fd..3496222a 100644 --- a/src/test/java/org/assertj/db/database/sqlite/SqliteDatabase_Source_DDD_Test.java +++ b/src/test/java/org/assertj/db/database/sqlite/SqliteDatabase_JdbcUrl_DDD_Test.java @@ -21,9 +21,9 @@ 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.DateValue; -import org.assertj.db.type.Source; import org.assertj.db.type.Table; import org.assertj.db.type.ValueType; import org.junit.Before; @@ -33,21 +33,22 @@ * Test on the Sqlite database. * * @author Régis Pouiller + * @author Julien Roy */ -public class SqliteDatabase_Source_DDD_Test extends AbstractSqliteTest { +public class SqliteDatabase_JdbcUrl_DDD_Test extends AbstractSqliteTest { - private Source source; + private AssertDbConnection connection; @Before public void init() { - source = sourceDDD; + connection = jdbcConnectionDDD; } @Test @NeedReload public void test_Outputs_output() { - Table table = new Table(source, "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(); @@ -75,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" @@ -84,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" @@ -107,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' source]%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" @@ -125,7 +126,7 @@ public void test_Outputs_output() { + "| Index : 0 | MODIFICATION | teSt | 1 |----------------|-----------|-----------|-----------|-----------|-----------|------------|-----------|-----------|-----------|-----------|------------|------------|------------|------------|------------|------------|------------|-----------------------|------------|%n" + "| | | | | At end point | 1 | 13 | 2 | 14 | 15 | 2007-12-23 | 3.3 | 4.4 | 5.5 | 6.6 | 20 | 8 | 16 | 9 | 10.1 | 11 | 09:01:00 | 2007-12-23 09:01:00.0 | 12 |%n" + "|-----------|--------------|-------|---------|----------------|-----------|-----------|-----------|-----------|-----------|------------|-----------|-----------|-----------|-----------|------------|------------|------------|------------|------------|------------|------------|-----------------------|------------|%n")); - Assertions.assertThat(byteArrayOutputStream6.toString()).isEqualTo(String.format("[Change at index 0 (with primary key : [1]) of Changes on teSt table of '/jdbc:sqlite:target/testDerby.db' source]%n" + Assertions.assertThat(byteArrayOutputStream6).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" @@ -136,7 +137,7 @@ public void test_Outputs_output() { + "| MODIFICATION | teSt | 1 |----------------|-----------|-----------|-----------|-----------|-----------|------------|-----------|-----------|-----------|-----------|------------|------------|------------|------------|------------|------------|------------|-----------------------|------------|%n" + "| | | | At end point | 1 | 13 | 2 | 14 | 15 | 2007-12-23 | 3.3 | 4.4 | 5.5 | 6.6 | 20 | 8 | 16 | 9 | 10.1 | 11 | 09:01:00 | 2007-12-23 09:01:00.0 | 12 |%n" + "|--------------|-------|---------|----------------|-----------|-----------|-----------|-----------|-----------|------------|-----------|-----------|-----------|-----------|------------|------------|------------|------------|------------|------------|------------|-----------------------|------------|%n")); - Assertions.assertThat(byteArrayOutputStream7.toString()).isEqualTo(String.format("[Row at end point of Change at index 0 (with primary key : [1]) of Changes on teSt table of '/jdbc:sqlite:target/testDerby.db' source]%n" + Assertions.assertThat(byteArrayOutputStream7).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" @@ -145,14 +146,14 @@ public void test_Outputs_output() { + "|---------|-----------|-----------|-----------|-----------|-----------|------------|-----------|-----------|-----------|-----------|------------|------------|------------|------------|------------|------------|------------|-----------------------|------------|%n" + "| 1 | 1 | 13 | 2 | 14 | 15 | 2007-12-23 | 3.3 | 4.4 | 5.5 | 6.6 | 20 | 8 | 16 | 9 | 10.1 | 11 | 09:01:00 | 2007-12-23 09:01:00.0 | 12 |%n" + "|---------|-----------|-----------|-----------|-----------|-----------|------------|-----------|-----------|-----------|-----------|------------|------------|------------|------------|------------|------------|------------|-----------------------|------------|%n")); - Assertions.assertThat(byteArrayOutputStream8.toString()).isEqualTo(String.format("[Value at index 0 (column name : VAR1) of Row at end point of Change at index 0 (with primary key : [1]) of Changes on teSt table of '/jdbc:sqlite:target/testDerby.db' source]%n" + Assertions.assertThat(byteArrayOutputStream8).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' 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 '/jdbc:sqlite:target/testDerby.db']%n" + "|----------------|----------|%n" + "| | VAR1 |%n" + "| | (NUMBER) |%n" @@ -161,7 +162,7 @@ public void test_Outputs_output() { + "|----------------|----------|%n" + "| At end point | 1 |%n" + "|----------------|----------|%n")); - Assertions.assertThat(byteArrayOutputStream10.toString()).isEqualTo(String.format("[Value at end point of Column at index 0 (column name : VAR1) of Change at index 0 (with primary key : [1]) of Changes on teSt table of '/jdbc:sqlite:target/testDerby.db' source]%n" + Assertions.assertThat(byteArrayOutputStream10).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" @@ -173,8 +174,8 @@ public void test_Outputs_output() { @Test @NeedReload public void test_PrimaryKey_hasPksNames() { - Table table = new Table(source, "test"); - Changes changes = new Changes(table).setStartPointNow(); + Table table = connection.table("test").build(); + Changes changes = connection.changes().tables(table).build().setStartPointNow(); update(); changes.setEndPointNow(); @@ -185,8 +186,8 @@ public void test_PrimaryKey_hasPksNames() { @Test @NeedReload public void test_ColumnName_hasColumnName() { - Table table = new Table(source, "test"); - Changes changes = new Changes(table).setStartPointNow(); + Table table = connection.table("test").build(); + Changes changes = connection.changes().tables(table).build().setStartPointNow(); update(); changes.setEndPointNow(); @@ -240,8 +241,8 @@ public void test_ColumnName_hasColumnName() { @Test @NeedReload public void test_ColumnClass_isOfClass() { - Table table = new Table(source, "test"); - Changes changes = new Changes(table).setStartPointNow(); + Table table = connection.table("test").build(); + Changes changes = connection.changes().tables(table).build().setStartPointNow(); update(); changes.setEndPointNow(); @@ -295,8 +296,8 @@ public void test_ColumnClass_isOfClass() { @Test @NeedReload public void test_ColumnEquality_hasValues() { - Table table = new Table(source, "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(); @@ -347,8 +348,8 @@ public void test_ColumnEquality_hasValues() { @Test @NeedReload public void test_ColumnEquality_containsValues() { - Table table = new Table(source, "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(); @@ -377,8 +378,8 @@ public void test_ColumnEquality_containsValues() { @Test @NeedReload public void test_ColumnType_isOfType() { - Table table = new Table(source, "test"); - Changes changes = new Changes(table).setStartPointNow(); + Table table = connection.table("test").build(); + Changes changes = connection.changes().tables(table).build().setStartPointNow(); update(); changes.setEndPointNow(); @@ -431,8 +432,8 @@ public void test_ColumnType_isOfType() { @Test @NeedReload public void test_ColumnOfChangeEquality_hasValues() { - Table table = new Table(source, "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(); @@ -484,8 +485,8 @@ public void test_ColumnOfChangeEquality_hasValues() { @Test @NeedReload public void test_RowEquality_hasValues() { - Table table = new Table(source, "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(); @@ -507,8 +508,8 @@ public void test_RowEquality_hasValues() { @Test @NeedReload public void test_ValueClass_isOfClass() { - Table table = new Table(source, "test"); - Changes changes = new Changes(table).setStartPointNow(); + Table table = connection.table("test").build(); + Changes changes = connection.changes().tables(table).build().setStartPointNow(); update(); changes.setEndPointNow(); @@ -562,8 +563,8 @@ public void test_ValueClass_isOfClass() { @Test @NeedReload public void test_ValueEquality_isEqualTo() { - Table table = new Table(source, "test"); - Changes changes = new Changes(table).setStartPointNow(); + Table table = connection.table("test").build(); + Changes changes = connection.changes().tables(table).build().setStartPointNow(); update(); changes.setEndPointNow(); @@ -615,8 +616,8 @@ public void test_ValueEquality_isEqualTo() { @Test @NeedReload public void test_ValueNonEquality_isNotEqualTo() { - Table table = new Table(source, "test"); - Changes changes = new Changes(table).setStartPointNow(); + Table table = connection.table("test").build(); + Changes changes = connection.changes().tables(table).build().setStartPointNow(); update(); changes.setEndPointNow(); @@ -668,8 +669,8 @@ public void test_ValueNonEquality_isNotEqualTo() { @Test @NeedReload public void test_ValueType_isOfType() { - Table table = new Table(source, "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_Source_NSNSNS_Test.java b/src/test/java/org/assertj/db/database/sqlite/SqliteDatabase_JdbcUrl_NSNSNS_Test.java similarity index 84% rename from src/test/java/org/assertj/db/database/sqlite/SqliteDatabase_Source_NSNSNS_Test.java rename to src/test/java/org/assertj/db/database/sqlite/SqliteDatabase_JdbcUrl_NSNSNS_Test.java index 23f21978..d45201dd 100644 --- a/src/test/java/org/assertj/db/database/sqlite/SqliteDatabase_Source_NSNSNS_Test.java +++ b/src/test/java/org/assertj/db/database/sqlite/SqliteDatabase_JdbcUrl_NSNSNS_Test.java @@ -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.Source; import org.assertj.db.type.Table; import org.junit.Before; import org.junit.Test; @@ -32,21 +32,22 @@ * Test on the Sqlite database. * * @author Régis Pouiller + * @author Julien Roy */ -public class SqliteDatabase_Source_NSNSNS_Test extends AbstractSqliteTest { +public class SqliteDatabase_JdbcUrl_NSNSNS_Test extends AbstractSqliteTest { - private Source source; + private AssertDbConnection connection; @Before public void init() { - source = sourceNSNSNS; + connection = jdbcConnectionNSNSNS; } @Test @NeedReload public void test_Outputs_output() { - Table table = new Table(source, "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(); @@ -73,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" @@ -82,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" @@ -105,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' source]%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" @@ -123,7 +124,7 @@ public void test_Outputs_output() { + "| Index : 0 | MODIFICATION | test | 1 |----------------|-----------|-----------|-----------|-----------|-----------|------------|-----------|-----------|-----------|-----------|------------|------------|------------|------------|------------|------------|------------|-----------------------|------------|%n" + "| | | | | At end point | 1 | 13 | 2 | 14 | 15 | 2007-12-23 | 3.3 | 4.4 | 5.5 | 6.6 | 20 | 8 | 16 | 9 | 10.1 | 11 | 09:01:00 | 2007-12-23 09:01:00.0 | 12 |%n" + "|-----------|--------------|-------|---------|----------------|-----------|-----------|-----------|-----------|-----------|------------|-----------|-----------|-----------|-----------|------------|------------|------------|------------|------------|------------|------------|-----------------------|------------|%n")); - Assertions.assertThat(byteArrayOutputStream6.toString()).isEqualTo(String.format("[Change at index 0 (with primary key : [1]) of Changes on test table of '/jdbc:sqlite:target/testDerby.db' source]%n" + Assertions.assertThat(byteArrayOutputStream6).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" @@ -134,7 +135,7 @@ public void test_Outputs_output() { + "| MODIFICATION | test | 1 |----------------|-----------|-----------|-----------|-----------|-----------|------------|-----------|-----------|-----------|-----------|------------|------------|------------|------------|------------|------------|------------|-----------------------|------------|%n" + "| | | | At end point | 1 | 13 | 2 | 14 | 15 | 2007-12-23 | 3.3 | 4.4 | 5.5 | 6.6 | 20 | 8 | 16 | 9 | 10.1 | 11 | 09:01:00 | 2007-12-23 09:01:00.0 | 12 |%n" + "|--------------|-------|---------|----------------|-----------|-----------|-----------|-----------|-----------|------------|-----------|-----------|-----------|-----------|------------|------------|------------|------------|------------|------------|------------|-----------------------|------------|%n")); - Assertions.assertThat(byteArrayOutputStream7.toString()).isEqualTo(String.format("[Row at end point of Change at index 0 (with primary key : [1]) of Changes on test table of '/jdbc:sqlite:target/testDerby.db' source]%n" + Assertions.assertThat(byteArrayOutputStream7).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" @@ -143,14 +144,14 @@ public void test_Outputs_output() { + "|---------|-----------|-----------|-----------|-----------|-----------|------------|-----------|-----------|-----------|-----------|------------|------------|------------|------------|------------|------------|------------|-----------------------|------------|%n" + "| 1 | 1 | 13 | 2 | 14 | 15 | 2007-12-23 | 3.3 | 4.4 | 5.5 | 6.6 | 20 | 8 | 16 | 9 | 10.1 | 11 | 09:01:00 | 2007-12-23 09:01:00.0 | 12 |%n" + "|---------|-----------|-----------|-----------|-----------|-----------|------------|-----------|-----------|-----------|-----------|------------|------------|------------|------------|------------|------------|------------|-----------------------|------------|%n")); - Assertions.assertThat(byteArrayOutputStream8.toString()).isEqualTo(String.format("[Value at index 0 (column name : Var1) of Row at end point of Change at index 0 (with primary key : [1]) of Changes on test table of '/jdbc:sqlite:target/testDerby.db' source]%n" + Assertions.assertThat(byteArrayOutputStream8).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' 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 '/jdbc:sqlite:target/testDerby.db']%n" + "|----------------|----------|%n" + "| | Var1 |%n" + "| | (NUMBER) |%n" @@ -159,7 +160,7 @@ public void test_Outputs_output() { + "|----------------|----------|%n" + "| At end point | 1 |%n" + "|----------------|----------|%n")); - Assertions.assertThat(byteArrayOutputStream10.toString()).isEqualTo(String.format("[Value at end point of Column at index 0 (column name : Var1) of Change at index 0 (with primary key : [1]) of Changes on test table of '/jdbc:sqlite:target/testDerby.db' source]%n" + Assertions.assertThat(byteArrayOutputStream10).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" @@ -171,9 +172,9 @@ public void test_Outputs_output() { @Test @NeedReload public void should_fail_because_primary_key_is_different() { - Table table = new Table(source, "test"); - Changes changes = new Changes(table).setStartPointNow(); - Changes changes2 = new Changes(source).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(); @@ -182,7 +183,7 @@ public void should_fail_because_primary_key_is_different() { assertThat(changes).change().hasPksNames("var1"); fail("An exception must be raised"); } catch (AssertionError e) { - Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Change at index 0 (with primary key : [1]) of Changes on test table of '/jdbc:sqlite:target/testDerby.db' source] %n" + Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Change at index 0 (with primary key : [1]) of Changes on test table of '/jdbc:sqlite:target/testDerby.db'] %n" + "Expecting :%n" + " [\"var1\"]%n" + "to be the name of the columns of the primary keys but was:%n" @@ -193,7 +194,7 @@ public void should_fail_because_primary_key_is_different() { assertThat(changes2).change().hasPksNames("var1"); fail("An exception must be raised"); } catch (AssertionError e) { - Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Change at index 0 (with primary key : [1]) of Changes on teSt table of '/jdbc:sqlite:target/testDerby.db' source] %n" + Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Change at index 0 (with primary key : [1]) of Changes on teSt table of '/jdbc:sqlite:target/testDerby.db'] %n" + "Expecting :%n" + " [\"var1\"]%n" + "to be the name of the columns of the primary keys but was:%n" @@ -204,9 +205,9 @@ public void should_fail_because_primary_key_is_different() { @Test @NeedReload public void should_fail_because_column_name_is_different() { - Table table = new Table(source, "test"); - Changes changes = new Changes(table).setStartPointNow(); - Changes changes2 = new Changes(source).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(); @@ -236,7 +237,7 @@ public void should_fail_because_column_name_is_different() { assertThat(changes).change().column().hasColumnName("var1"); fail("An exception must be raised"); } catch (AssertionError e) { - Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Column at index 0 (column name : Var1) of Change at index 0 (with primary key : [1]) of Changes on test table of '/jdbc:sqlite:target/testDerby.db' source] %n" + Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Column at index 0 (column name : Var1) of Change at index 0 (with primary key : [1]) of Changes on test table of '/jdbc:sqlite:target/testDerby.db'] %n" + "Expecting :%n" + " \"var1\"%n" + "to be the name of the column but was:%n" @@ -246,7 +247,7 @@ public void should_fail_because_column_name_is_different() { assertThat(changes).change().rowAtEndPoint().value().hasColumnName("var1"); fail("An exception must be raised"); } catch (AssertionError e) { - Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Value at index 0 (column name : Var1) of Row at end point of Change at index 0 (with primary key : [1]) of Changes on test table of '/jdbc:sqlite:target/testDerby.db' source] %n" + Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Value at index 0 (column name : Var1) of Row at end point of Change at index 0 (with primary key : [1]) of Changes on test table of '/jdbc:sqlite:target/testDerby.db'] %n" + "Expecting :%n" + " \"var1\"%n" + "to be the name of the column but was:%n" @@ -257,7 +258,7 @@ public void should_fail_because_column_name_is_different() { assertThat(changes2).change().column().hasColumnName("var1"); fail("An exception must be raised"); } catch (AssertionError e) { - Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Column at index 0 (column name : Var1) of Change at index 0 (with primary key : [1]) of Changes on teSt table of '/jdbc:sqlite:target/testDerby.db' source] %n" + Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Column at index 0 (column name : Var1) of Change at index 0 (with primary key : [1]) of Changes on teSt table of '/jdbc:sqlite:target/testDerby.db'] %n" + "Expecting :%n" + " \"var1\"%n" + "to be the name of the column but was:%n" @@ -267,7 +268,7 @@ public void should_fail_because_column_name_is_different() { assertThat(changes2).change().rowAtEndPoint().value().hasColumnName("var1"); fail("An exception must be raised"); } catch (AssertionError e) { - Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Value at index 0 (column name : Var1) of Row at end point of Change at index 0 (with primary key : [1]) of Changes on teSt table of '/jdbc:sqlite:target/testDerby.db' source] %n" + Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Value at index 0 (column name : Var1) of Row at end point of Change at index 0 (with primary key : [1]) of Changes on teSt table of '/jdbc:sqlite:target/testDerby.db'] %n" + "Expecting :%n" + " \"var1\"%n" + "to be the name of the column but was:%n" @@ -278,9 +279,9 @@ public void should_fail_because_column_name_is_different() { @Test @NeedReload public void should_fail_because_column_name_is_wrong_to_navigate() { - Table table = new Table(source, "test"); - Changes changes = new Changes(table).setStartPointNow(); - Changes changes2 = new Changes(source).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(); @@ -340,9 +341,9 @@ public void should_fail_because_column_name_is_wrong_to_navigate() { @Test @NeedReload public void should_fail_because_table_name_is_different() { - Table table = new Table(source, "test"); - Changes changes = new Changes(table).setStartPointNow(); - Changes changes2 = new Changes(source).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(); @@ -351,7 +352,7 @@ public void should_fail_because_table_name_is_different() { assertThat(changes).change().isOnTable("teSt"); fail("An exception must be raised"); } catch (AssertionError e) { - Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Change at index 0 (with primary key : [1]) of Changes on test table of '/jdbc:sqlite:target/testDerby.db' source] %n" + Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Change at index 0 (with primary key : [1]) of Changes on test table of '/jdbc:sqlite:target/testDerby.db'] %n" + "Expecting to be on the table:%n" + " <\"teSt\">%n" + "but was on the table:%n" @@ -361,7 +362,7 @@ public void should_fail_because_table_name_is_different() { assertThat(changes2).change().isOnTable("test"); fail("An exception must be raised"); } catch (AssertionError e) { - Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Change at index 0 (with primary key : [1]) of Changes on teSt table of '/jdbc:sqlite:target/testDerby.db' source] %n" + Assertions.assertThat(e.getMessage()).isEqualTo(String.format("[Change at index 0 (with primary key : [1]) of Changes on teSt table of '/jdbc:sqlite:target/testDerby.db'] %n" + "Expecting to be on the table:%n" + " <\"test\">%n" + "but was on the table:%n" @@ -372,9 +373,9 @@ public void should_fail_because_table_name_is_different() { @Test @NeedReload public void should_fail_because_table_name_is_wrong_to_navigate() { - Table table = new Table(source, "test"); - Changes changes = new Changes(table).setStartPointNow(); - Changes changes2 = new Changes(source).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(); @@ -383,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(source, "test"); - Changes changes = new Changes(table).setStartPointNow(); - Changes changes2 = new Changes(source).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 +438,9 @@ public void test_ColumnName_hasColumnName() { @Test @NeedReload public void test_ColumnClass_isOfClass() { - Table table = new Table(source, "test"); - Changes changes = new Changes(table).setStartPointNow(); - Changes changes2 = new Changes(source).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_Source_UIUIUI_Test.java b/src/test/java/org/assertj/db/database/sqlite/SqliteDatabase_JdbcUrl_UIUIUI_Test.java similarity index 90% rename from src/test/java/org/assertj/db/database/sqlite/SqliteDatabase_Source_UIUIUI_Test.java rename to src/test/java/org/assertj/db/database/sqlite/SqliteDatabase_JdbcUrl_UIUIUI_Test.java index a39fc0f7..7de6a071 100644 --- a/src/test/java/org/assertj/db/database/sqlite/SqliteDatabase_Source_UIUIUI_Test.java +++ b/src/test/java/org/assertj/db/database/sqlite/SqliteDatabase_JdbcUrl_UIUIUI_Test.java @@ -21,9 +21,9 @@ 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.DateValue; -import org.assertj.db.type.Source; import org.assertj.db.type.Table; import org.assertj.db.type.ValueType; import org.junit.Before; @@ -33,21 +33,22 @@ * Test on the Sqlite database. * * @author Régis Pouiller + * @author Julien Roy */ -public class SqliteDatabase_Source_UIUIUI_Test extends AbstractSqliteTest { +public class SqliteDatabase_JdbcUrl_UIUIUI_Test extends AbstractSqliteTest { - private Source source; + private AssertDbConnection connection; @Before public void init() { - source = sourceUIUIUI; + connection = jdbcConnectionUIUIUI; } @Test @NeedReload public void test_Outputs_output() { - Table table = new Table(source, "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(); @@ -75,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" @@ -84,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" @@ -107,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' source]%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" @@ -125,7 +126,7 @@ public void test_Outputs_output() { + "| Index : 0 | MODIFICATION | TEST | 1 |----------------|-----------|-----------|-----------|-----------|-----------|------------|-----------|-----------|-----------|-----------|------------|------------|------------|------------|------------|------------|------------|-----------------------|------------|%n" + "| | | | | At end point | 1 | 13 | 2 | 14 | 15 | 2007-12-23 | 3.3 | 4.4 | 5.5 | 6.6 | 20 | 8 | 16 | 9 | 10.1 | 11 | 09:01:00 | 2007-12-23 09:01:00.0 | 12 |%n" + "|-----------|--------------|-------|---------|----------------|-----------|-----------|-----------|-----------|-----------|------------|-----------|-----------|-----------|-----------|------------|------------|------------|------------|------------|------------|------------|-----------------------|------------|%n")); - Assertions.assertThat(byteArrayOutputStream6.toString()).isEqualTo(String.format("[Change at index 0 (with primary key : [1]) of Changes on TEST table of '/jdbc:sqlite:target/testDerby.db' source]%n" + Assertions.assertThat(byteArrayOutputStream6).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" @@ -136,7 +137,7 @@ public void test_Outputs_output() { + "| MODIFICATION | TEST | 1 |----------------|-----------|-----------|-----------|-----------|-----------|------------|-----------|-----------|-----------|-----------|------------|------------|------------|------------|------------|------------|------------|-----------------------|------------|%n" + "| | | | At end point | 1 | 13 | 2 | 14 | 15 | 2007-12-23 | 3.3 | 4.4 | 5.5 | 6.6 | 20 | 8 | 16 | 9 | 10.1 | 11 | 09:01:00 | 2007-12-23 09:01:00.0 | 12 |%n" + "|--------------|-------|---------|----------------|-----------|-----------|-----------|-----------|-----------|------------|-----------|-----------|-----------|-----------|------------|------------|------------|------------|------------|------------|------------|-----------------------|------------|%n")); - Assertions.assertThat(byteArrayOutputStream7.toString()).isEqualTo(String.format("[Row at end point of Change at index 0 (with primary key : [1]) of Changes on TEST table of '/jdbc:sqlite:target/testDerby.db' source]%n" + Assertions.assertThat(byteArrayOutputStream7).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" @@ -145,14 +146,14 @@ public void test_Outputs_output() { + "|---------|-----------|-----------|-----------|-----------|-----------|------------|-----------|-----------|-----------|-----------|------------|------------|------------|------------|------------|------------|------------|-----------------------|------------|%n" + "| 1 | 1 | 13 | 2 | 14 | 15 | 2007-12-23 | 3.3 | 4.4 | 5.5 | 6.6 | 20 | 8 | 16 | 9 | 10.1 | 11 | 09:01:00 | 2007-12-23 09:01:00.0 | 12 |%n" + "|---------|-----------|-----------|-----------|-----------|-----------|------------|-----------|-----------|-----------|-----------|------------|------------|------------|------------|------------|------------|------------|-----------------------|------------|%n")); - Assertions.assertThat(byteArrayOutputStream8.toString()).isEqualTo(String.format("[Value at index 0 (column name : VAR1) of Row at end point of Change at index 0 (with primary key : [1]) of Changes on TEST table of '/jdbc:sqlite:target/testDerby.db' source]%n" + Assertions.assertThat(byteArrayOutputStream8).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' 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 '/jdbc:sqlite:target/testDerby.db']%n" + "|----------------|----------|%n" + "| | VAR1 |%n" + "| | (NUMBER) |%n" @@ -161,7 +162,7 @@ public void test_Outputs_output() { + "|----------------|----------|%n" + "| At end point | 1 |%n" + "|----------------|----------|%n")); - Assertions.assertThat(byteArrayOutputStream10.toString()).isEqualTo(String.format("[Value at end point of Column at index 0 (column name : VAR1) of Change at index 0 (with primary key : [1]) of Changes on TEST table of '/jdbc:sqlite:target/testDerby.db' source]%n" + Assertions.assertThat(byteArrayOutputStream10).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" @@ -173,8 +174,8 @@ public void test_Outputs_output() { @Test @NeedReload public void test_PrimaryKey_hasPksNames() { - Table table = new Table(source, "test"); - Changes changes = new Changes(table).setStartPointNow(); + Table table = connection.table("test").build(); + Changes changes = connection.changes().tables(table).build().setStartPointNow(); update(); changes.setEndPointNow(); @@ -185,8 +186,8 @@ public void test_PrimaryKey_hasPksNames() { @Test @NeedReload public void test_ColumnName_hasColumnName() { - Table table = new Table(source, "test"); - Changes changes = new Changes(table).setStartPointNow(); + Table table = connection.table("test").build(); + Changes changes = connection.changes().tables(table).build().setStartPointNow(); update(); changes.setEndPointNow(); @@ -240,8 +241,8 @@ public void test_ColumnName_hasColumnName() { @Test @NeedReload public void test_ColumnClass_isOfClass() { - Table table = new Table(source, "test"); - Changes changes = new Changes(table).setStartPointNow(); + Table table = connection.table("test").build(); + Changes changes = connection.changes().tables(table).build().setStartPointNow(); update(); changes.setEndPointNow(); @@ -295,8 +296,8 @@ public void test_ColumnClass_isOfClass() { @Test @NeedReload public void test_ColumnEquality_hasValues() { - Table table = new Table(source, "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(); @@ -347,8 +348,8 @@ public void test_ColumnEquality_hasValues() { @Test @NeedReload public void test_ColumnEquality_containsValues() { - Table table = new Table(source, "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(); @@ -377,8 +378,8 @@ public void test_ColumnEquality_containsValues() { @Test @NeedReload public void test_ColumnType_isOfType() { - Table table = new Table(source, "test"); - Changes changes = new Changes(table).setStartPointNow(); + Table table = connection.table("test").build(); + Changes changes = connection.changes().tables(table).build().setStartPointNow(); update(); changes.setEndPointNow(); @@ -431,8 +432,8 @@ public void test_ColumnType_isOfType() { @Test @NeedReload public void test_ColumnOfChangeEquality_hasValues() { - Table table = new Table(source, "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(); @@ -484,8 +485,8 @@ public void test_ColumnOfChangeEquality_hasValues() { @Test @NeedReload public void test_RowEquality_hasValues() { - Table table = new Table(source, "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(); @@ -507,8 +508,8 @@ public void test_RowEquality_hasValues() { @Test @NeedReload public void test_ValueClass_isOfClass() { - Table table = new Table(source, "test"); - Changes changes = new Changes(table).setStartPointNow(); + Table table = connection.table("test").build(); + Changes changes = connection.changes().tables(table).build().setStartPointNow(); update(); changes.setEndPointNow(); @@ -562,8 +563,8 @@ public void test_ValueClass_isOfClass() { @Test @NeedReload public void test_ValueEquality_isEqualTo() { - Table table = new Table(source, "test"); - Changes changes = new Changes(table).setStartPointNow(); + Table table = connection.table("test").build(); + Changes changes = connection.changes().tables(table).build().setStartPointNow(); update(); changes.setEndPointNow(); @@ -615,8 +616,8 @@ public void test_ValueEquality_isEqualTo() { @Test @NeedReload public void test_ValueNonEquality_isNotEqualTo() { - Table table = new Table(source, "test"); - Changes changes = new Changes(table).setStartPointNow(); + Table table = connection.table("test").build(); + Changes changes = connection.changes().tables(table).build().setStartPointNow(); update(); changes.setEndPointNow(); @@ -668,8 +669,8 @@ public void test_ValueNonEquality_isNotEqualTo() { @Test @NeedReload public void test_ValueType_isOfType() { - Table table = new Table(source, "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 1f8549c4..2143e08f 100644 --- a/src/test/java/org/assertj/db/navigation/InstantiationError_Test.java +++ b/src/test/java/org/assertj/db/navigation/InstantiationError_Test.java @@ -35,6 +35,7 @@ * Tests on instantiation errors. * * @author Régis Pouiller + * @author Julien Roy */ public class InstantiationError_Test extends AbstractTest { @@ -43,7 +44,7 @@ public class InstantiationError_Test extends AbstractTest { */ @Test public void should_fail_because_mistake_in_instantiation_of_column() throws Exception { - Table table = new Table(source, "actor"); + Table table = assertDbConnection.table("actor").build(); TableAssert tableAssert = assertThat(table); Field field = AbstractDbAssert.class.getDeclaredField("columnPosition"); @@ -70,7 +71,7 @@ public void should_fail_because_mistake_in_instantiation_of_column() throws Exce */ @Test public void should_fail_because_mistake_in_instantiation_of_row() throws Exception { - Table table = new Table(source, "actor"); + Table table = assertDbConnection.table("actor").build(); TableAssert tableAssert = assertThat(table); Field field = AbstractDbAssert.class.getDeclaredField("rowPosition"); @@ -97,7 +98,7 @@ public void should_fail_because_mistake_in_instantiation_of_row() throws Excepti */ @Test public void should_fail_because_mistake_in_instantiation_of_value() throws Exception { - Table table = new Table(source, "actor"); + Table table = assertDbConnection.table("actor").build(); TableColumnAssert tableColumnAssert = assertThat(table).column(); Field field = AbstractColumnAssert.class.getDeclaredField("valuePosition"); @@ -125,7 +126,7 @@ public void should_fail_because_mistake_in_instantiation_of_value() throws Excep @Test @NeedReload public void should_fail_because_mistake_in_instantiation_of_changes() throws Exception { - Changes changes = new Changes(source).setStartPointNow(); + Changes changes = assertDbConnection.changes().build().setStartPointNow(); updateChangesForTests(); changes.setEndPointNow(); ChangesAssert changesAssert = assertThat(changes); @@ -155,7 +156,7 @@ public void should_fail_because_mistake_in_instantiation_of_changes() throws Exc @Test @NeedReload public void should_fail_because_mistake_in_instantiation_of_change() throws Exception { - Changes changes = new Changes(source).setStartPointNow(); + Changes changes = assertDbConnection.changes().build().setStartPointNow(); updateChangesForTests(); changes.setEndPointNow(); ChangesAssert changesAssert = assertThat(changes); @@ -185,7 +186,7 @@ public void should_fail_because_mistake_in_instantiation_of_change() throws Exce @Test @NeedReload public void should_fail_because_mistake_in_instantiation_of_columnchange() throws Exception { - Changes changes = new Changes(source).setStartPointNow(); + Changes changes = assertDbConnection.changes().build().setStartPointNow(); updateChangesForTests(); changes.setEndPointNow(); ChangeAssert changeAssert = assertThat(changes).change(); @@ -215,7 +216,7 @@ public void should_fail_because_mistake_in_instantiation_of_columnchange() throw @Test @NeedReload public void should_fail_because_mistake_in_instantiation_of_rowAtStartPoint() throws Exception { - Changes changes = new Changes(source).setStartPointNow(); + Changes changes = 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 863d1bb6..3bfb9a38 100644 --- a/src/test/java/org/assertj/db/navigation/ReturnToOrigin_Test.java +++ b/src/test/java/org/assertj/db/navigation/ReturnToOrigin_Test.java @@ -60,6 +60,7 @@ * Tests on the different methods linked on the {@code returnToOrigin()} method. * * @author Régis Pouiller + * @author Julien Roy */ public class ReturnToOrigin_Test extends AbstractTest { @@ -68,7 +69,7 @@ public class ReturnToOrigin_Test extends AbstractTest { */ @Test public void test_return_to_table_from_column_with_assertions() throws Exception { - Table table = new Table(source, "actor"); + Table table = assertDbConnection.table("actor").build(); TableAssert tableAssert = assertThat(table); TableColumnAssert tableColumnAssert = tableAssert.column(); TableAssert tableAssertBis = tableColumnAssert.returnToTable(); @@ -81,7 +82,7 @@ public void test_return_to_table_from_column_with_assertions() throws Exception */ @Test public void test_return_to_table_from_row_with_assertions() throws Exception { - Table table = new Table(source, "actor"); + Table table = assertDbConnection.table("actor").build(); TableAssert tableAssert = assertThat(table); TableRowAssert tableRowAssert = tableAssert.row(); TableAssert tableAssertBis = tableRowAssert.returnToTable(); @@ -94,7 +95,7 @@ public void test_return_to_table_from_row_with_assertions() throws Exception { */ @Test public void test_return_to_request_from_column_with_assertions() throws Exception { - Request request = new Request(source, "select * from actor"); + Request request = assertDbConnection.request("select * from actor").build(); RequestAssert requestAssert = assertThat(request); RequestColumnAssert requestColumnAssert = requestAssert.column(); RequestAssert requestAssertBis = requestColumnAssert.returnToRequest(); @@ -107,7 +108,7 @@ public void test_return_to_request_from_column_with_assertions() throws Exceptio */ @Test public void test_return_to_request_from_row_with_assertions() throws Exception { - Request request = new Request(source, "select * from actor"); + Request request = assertDbConnection.request("select * from actor").build(); RequestAssert requestAssert = assertThat(request); RequestRowAssert requestRowAssert = requestAssert.row(); RequestAssert requestAssertBis = requestRowAssert.returnToRequest(); @@ -120,7 +121,7 @@ public void test_return_to_request_from_row_with_assertions() throws Exception { */ @Test public void test_return_to_column_from_value_for_table_with_assertions() throws Exception { - Table table = new Table(source, "actor"); + Table table = assertDbConnection.table("actor").build(); TableAssert tableAssert = assertThat(table); TableColumnAssert tableColumnAssert = tableAssert.column(); TableColumnValueAssert tableColumnValueAssert = tableColumnAssert.value(); @@ -134,7 +135,7 @@ public void test_return_to_column_from_value_for_table_with_assertions() throws */ @Test public void test_return_to_row_from_value_for_table_with_assertions() throws Exception { - Table table = new Table(source, "actor"); + Table table = assertDbConnection.table("actor").build(); TableAssert tableAssert = assertThat(table); TableRowAssert tableRowAssert = tableAssert.row(); TableRowValueAssert tableRowValueAssert = tableRowAssert.value(); @@ -148,7 +149,7 @@ public void test_return_to_row_from_value_for_table_with_assertions() throws Exc */ @Test public void test_return_to_column_from_value_for_request_with_assertions() throws Exception { - Request request = new Request(source, "select * from actor"); + Request request = assertDbConnection.request("select * from actor").build(); RequestAssert requestAssert = assertThat(request); RequestColumnAssert requestColumnAssert = requestAssert.column(); RequestColumnValueAssert requestColumnValueAssert = requestColumnAssert.value(); @@ -162,7 +163,7 @@ public void test_return_to_column_from_value_for_request_with_assertions() throw */ @Test public void test_return_to_row_from_value_for_request_with_assertions() throws Exception { - Request request = new Request(source, "select * from actor"); + Request request = assertDbConnection.request("select * from actor").build(); RequestAssert requestAssert = assertThat(request); RequestRowAssert requestRowAssert = requestAssert.row(); RequestRowValueAssert requestRowValueAssert = requestRowAssert.value(); @@ -177,7 +178,7 @@ public void test_return_to_row_from_value_for_request_with_assertions() throws E @Test @NeedReload public void test_return_to_changes_from_change_with_assertions() throws Exception { - Changes changes = new Changes(source).setStartPointNow(); + Changes changes = assertDbConnection.changes().build().setStartPointNow(); updateChangesForTests(); changes.setEndPointNow(); @@ -194,7 +195,7 @@ public void test_return_to_changes_from_change_with_assertions() throws Exceptio @Test @NeedReload public void test_return_to_change_from_column_with_assertions() throws Exception { - Changes changes = new Changes(source).setStartPointNow(); + Changes changes = assertDbConnection.changes().build().setStartPointNow(); updateChangesForTests(); changes.setEndPointNow(); @@ -211,7 +212,7 @@ public void test_return_to_change_from_column_with_assertions() throws Exception @Test @NeedReload public void test_return_to_change_from_row_with_assertions() throws Exception { - Changes changes = new Changes(source).setStartPointNow(); + Changes changes = assertDbConnection.changes().build().setStartPointNow(); updateChangesForTests(); changes.setEndPointNow(); @@ -228,7 +229,7 @@ public void test_return_to_change_from_row_with_assertions() throws Exception { @Test @NeedReload public void test_return_to_column_from_value_with_assertions() throws Exception { - Changes changes = new Changes(source).setStartPointNow(); + Changes changes = assertDbConnection.changes().build().setStartPointNow(); updateChangesForTests(); changes.setEndPointNow(); @@ -245,7 +246,7 @@ public void test_return_to_column_from_value_with_assertions() throws Exception @Test @NeedReload public void test_return_to_row_from_value_with_assertions() throws Exception { - Changes changes = new Changes(source).setStartPointNow(); + Changes changes = assertDbConnection.changes().build().setStartPointNow(); updateChangesForTests(); changes.setEndPointNow(); @@ -261,7 +262,7 @@ public void test_return_to_row_from_value_with_assertions() throws Exception { */ @Test public void test_return_to_table_from_column_with_displays() throws Exception { - Table table = new Table(source, "actor"); + Table table = assertDbConnection.table("actor").build(); TableOutputter tableOutputter = Outputs.output(table); TableColumnOutputter tableColumnOutputter = tableOutputter.column(); TableOutputter tableOutputterBis = tableColumnOutputter.returnToTable(); @@ -274,7 +275,7 @@ public void test_return_to_table_from_column_with_displays() throws Exception { */ @Test public void test_return_to_table_from_row_with_displays() throws Exception { - Table table = new Table(source, "actor"); + Table table = assertDbConnection.table("actor").build(); TableOutputter tableOutputter = Outputs.output(table); TableRowOutputter tableRowOutputter = tableOutputter.row(); TableOutputter tableOutputterBis = tableRowOutputter.returnToTable(); @@ -287,7 +288,7 @@ public void test_return_to_table_from_row_with_displays() throws Exception { */ @Test public void test_return_to_request_from_column_with_displays() throws Exception { - Request request = new Request(source, "select * from actor"); + Request request = assertDbConnection.request("select * from actor").build(); RequestOutputter requestOutputter = Outputs.output(request); RequestColumnOutputter requestColumnOutputter = requestOutputter.column(); RequestOutputter requestOutputterBis = requestColumnOutputter.returnToRequest(); @@ -300,7 +301,7 @@ public void test_return_to_request_from_column_with_displays() throws Exception */ @Test public void test_return_to_request_from_row_with_displays() throws Exception { - Request request = new Request(source, "select * from actor"); + Request request = assertDbConnection.request("select * from actor").build(); RequestOutputter requestOutputter = Outputs.output(request); RequestRowOutputter requestRowOutputter = requestOutputter.row(); RequestOutputter requestOutputterBis = requestRowOutputter.returnToRequest(); @@ -313,7 +314,7 @@ public void test_return_to_request_from_row_with_displays() throws Exception { */ @Test public void test_return_to_column_from_value_for_table_with_displays() throws Exception { - Table table = new Table(source, "actor"); + Table table = assertDbConnection.table("actor").build(); TableOutputter tableOutputter = Outputs.output(table); TableColumnOutputter tableColumnOutputter = tableOutputter.column(); TableColumnValueOutputter tableColumnValueOutputter = tableColumnOutputter.value(); @@ -327,7 +328,7 @@ public void test_return_to_column_from_value_for_table_with_displays() throws Ex */ @Test public void test_return_to_row_from_value_for_table_with_displays() throws Exception { - Table table = new Table(source, "actor"); + Table table = assertDbConnection.table("actor").build(); TableOutputter tableOutputter = Outputs.output(table); TableRowOutputter tableRowOutputter = tableOutputter.row(); TableRowValueOutputter tableRowValueOutputter = tableRowOutputter.value(); @@ -341,7 +342,7 @@ public void test_return_to_row_from_value_for_table_with_displays() throws Excep */ @Test public void test_return_to_column_from_value_for_request_with_displays() throws Exception { - Request request = new Request(source, "select * from actor"); + Request request = assertDbConnection.request("select * from actor").build(); RequestOutputter requestOutputter = Outputs.output(request); RequestColumnOutputter requestColumnOutputter = requestOutputter.column(); RequestColumnValueOutputter requestColumnValueOutputter = requestColumnOutputter.value(); @@ -355,7 +356,7 @@ public void test_return_to_column_from_value_for_request_with_displays() throws */ @Test public void test_return_to_row_from_value_for_request_with_displays() throws Exception { - Request request = new Request(source, "select * from actor"); + Request request = assertDbConnection.request("select * from actor").build(); RequestOutputter requestOutputter = Outputs.output(request); RequestRowOutputter requestRowOutputter = requestOutputter.row(); RequestRowValueOutputter requestRowValueOutputter = requestRowOutputter.value(); @@ -370,7 +371,7 @@ public void test_return_to_row_from_value_for_request_with_displays() throws Exc @Test @NeedReload public void test_return_to_changes_from_change_with_displays() throws Exception { - Changes changes = new Changes(source).setStartPointNow(); + Changes changes = assertDbConnection.changes().build().setStartPointNow(); updateChangesForTests(); changes.setEndPointNow(); @@ -387,7 +388,7 @@ public void test_return_to_changes_from_change_with_displays() throws Exception @Test @NeedReload public void test_return_to_change_from_column_with_displays() throws Exception { - Changes changes = new Changes(source).setStartPointNow(); + Changes changes = assertDbConnection.changes().build().setStartPointNow(); updateChangesForTests(); changes.setEndPointNow(); @@ -404,7 +405,7 @@ public void test_return_to_change_from_column_with_displays() throws Exception { @Test @NeedReload public void test_return_to_change_from_row_with_displays() throws Exception { - Changes changes = new Changes(source).setStartPointNow(); + Changes changes = assertDbConnection.changes().build().setStartPointNow(); updateChangesForTests(); changes.setEndPointNow(); @@ -421,7 +422,7 @@ public void test_return_to_change_from_row_with_displays() throws Exception { @Test @NeedReload public void test_return_to_column_from_value_with_displays() throws Exception { - Changes changes = new Changes(source).setStartPointNow(); + Changes changes = assertDbConnection.changes().build().setStartPointNow(); updateChangesForTests(); changes.setEndPointNow(); @@ -438,7 +439,7 @@ public void test_return_to_column_from_value_with_displays() throws Exception { @Test @NeedReload public void test_return_to_row_from_value_with_displays() throws Exception { - Changes changes = new Changes(source).setStartPointNow(); + Changes changes = 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 ed389516..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 @@ -38,6 +38,7 @@ * {@link org.assertj.db.navigation.ToChange#changeOfCreationOnTable(String, int)} method. * * @author Régis Pouiller + * @author Julien Roy */ public class ToChange_ChangeOfCreationOnTable_Integer_Test extends AbstractTest { @@ -47,7 +48,7 @@ public class ToChange_ChangeOfCreationOnTable_Integer_Test extends AbstractTest @Test @NeedReload public void test_change_of_creation_on_table_with_index_with_assertions() throws Exception { - Changes changes = new Changes(source).setStartPointNow(); + Changes changes = assertDbConnection.changes().build().setStartPointNow(); updateChangesForTests(); changes.setEndPointNow(); @@ -144,7 +145,7 @@ public void test_change_of_creation_on_table_with_index_with_assertions() throws @Test @NeedReload public void test_change_of_creation_on_table_with_index_with_displays() throws Exception { - Changes changes = new Changes(source).setStartPointNow(); + Changes changes = 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 16fbe055..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 @@ -38,6 +38,7 @@ * {@link ToChange#changeOfCreationOnTable(String)} method. * * @author Régis Pouiller + * @author Julien Roy */ public class ToChange_ChangeOfCreationOnTable_Test extends AbstractTest { @@ -47,7 +48,7 @@ public class ToChange_ChangeOfCreationOnTable_Test extends AbstractTest { @Test @NeedReload public void test_change_of_creation_on_table_with_assertions() throws Exception { - Changes changes = new Changes(source).setStartPointNow(); + Changes changes = assertDbConnection.changes().build().setStartPointNow(); updateChangesForTests(); changes.setEndPointNow(); @@ -128,7 +129,7 @@ public void test_change_of_creation_on_table_with_assertions() throws Exception @Test @NeedReload public void test_change_of_creation_on_table_with_displays() throws Exception { - Changes changes = new Changes(source).setStartPointNow(); + Changes changes = 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 b0bf5fd0..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 @@ -38,6 +38,7 @@ * {@link ToChange#changeOfCreation(int)} method. * * @author Régis Pouiller + * @author Julien Roy */ public class ToChange_ChangeOfCreation_Integer_Test extends AbstractTest { @@ -47,7 +48,7 @@ public class ToChange_ChangeOfCreation_Integer_Test extends AbstractTest { @Test @NeedReload public void test_change_of_creation_with_index_with_assertions() throws Exception { - Changes changes = new Changes(source).setStartPointNow(); + Changes changes = assertDbConnection.changes().build().setStartPointNow(); updateChangesForTests(); changes.setEndPointNow(); @@ -144,7 +145,7 @@ public void test_change_of_creation_with_index_with_assertions() throws Exceptio @Test @NeedReload public void test_change_of_creation_with_index_with_displays() throws Exception { - Changes changes = new Changes(source).setStartPointNow(); + Changes changes = 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 536ecbe5..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 @@ -38,6 +38,7 @@ * {@link org.assertj.db.navigation.ToChange#changeOfCreation()} method. * * @author Régis Pouiller + * @author Julien Roy */ public class ToChange_ChangeOfCreation_Test extends AbstractTest { @@ -47,7 +48,7 @@ public class ToChange_ChangeOfCreation_Test extends AbstractTest { @Test @NeedReload public void test_change_of_creation_with_assertions() throws Exception { - Changes changes = new Changes(source).setStartPointNow(); + Changes changes = assertDbConnection.changes().build().setStartPointNow(); updateChangesForTests(); changes.setEndPointNow(); @@ -128,7 +129,7 @@ public void test_change_of_creation_with_assertions() throws Exception { @Test @NeedReload public void test_change_of_creation_with_displays() throws Exception { - Changes changes = new Changes(source).setStartPointNow(); + Changes changes = 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 ba86c2ec..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 @@ -38,6 +38,7 @@ * {@link ToChange#changeOfDeletionOnTable(String, int)} method. * * @author Régis Pouiller + * @author Julien Roy */ public class ToChange_ChangeOfDeletionOnTable_Integer_Test extends AbstractTest { @@ -47,7 +48,7 @@ public class ToChange_ChangeOfDeletionOnTable_Integer_Test extends AbstractTest @Test @NeedReload public void test_change_of_deletion_on_table_with_index_with_assertions() throws Exception { - Changes changes = new Changes(source).setStartPointNow(); + Changes changes = assertDbConnection.changes().build().setStartPointNow(); updateChangesForTests(); changes.setEndPointNow(); @@ -133,7 +134,7 @@ public void test_change_of_deletion_on_table_with_index_with_assertions() throws @Test @NeedReload public void test_change_of_deletion_on_table_with_index_with_displays() throws Exception { - Changes changes = new Changes(source).setStartPointNow(); + Changes changes = 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 ef8f07d2..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 @@ -38,6 +38,7 @@ * {@link org.assertj.db.navigation.ToChange#changeOfDeletionOnTable(String)} method. * * @author Régis Pouiller + * @author Julien Roy */ public class ToChange_ChangeOfDeletionOnTable_Test extends AbstractTest { @@ -47,7 +48,7 @@ public class ToChange_ChangeOfDeletionOnTable_Test extends AbstractTest { @Test @NeedReload public void test_change_of_deletion_on_table_with_assertions() throws Exception { - Changes changes = new Changes(source).setStartPointNow(); + Changes changes = assertDbConnection.changes().build().setStartPointNow(); updateChangesForTests(); changes.setEndPointNow(); @@ -117,7 +118,7 @@ public void test_change_of_deletion_on_table_with_assertions() throws Exception @Test @NeedReload public void test_change_of_deletion_on_table_with_displays() throws Exception { - Changes changes = new Changes(source).setStartPointNow(); + Changes changes = 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 4472e644..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 @@ -38,6 +38,7 @@ * {@link org.assertj.db.navigation.ToChange#changeOfDeletion(int)} method. * * @author Régis Pouiller + * @author Julien Roy */ public class ToChange_ChangeOfDeletion_Integer_Test extends AbstractTest { @@ -47,7 +48,7 @@ public class ToChange_ChangeOfDeletion_Integer_Test extends AbstractTest { @Test @NeedReload public void test_change_of_deletion_with_index_with_assertions() throws Exception { - Changes changes = new Changes(source).setStartPointNow(); + Changes changes = assertDbConnection.changes().build().setStartPointNow(); updateChangesForTests(); changes.setEndPointNow(); @@ -133,7 +134,7 @@ public void test_change_of_deletion_with_index_with_assertions() throws Exceptio @Test @NeedReload public void test_change_of_deletion_with_index_with_displays() throws Exception { - Changes changes = new Changes(source).setStartPointNow(); + Changes changes = 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 24e785a1..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 @@ -38,6 +38,7 @@ * {@link ToChange#changeOfDeletion()} method. * * @author Régis Pouiller + * @author Julien Roy */ public class ToChange_ChangeOfDeletion_Test extends AbstractTest { @@ -47,7 +48,7 @@ public class ToChange_ChangeOfDeletion_Test extends AbstractTest { @Test @NeedReload public void test_change_of_deletion_with_assertions() throws Exception { - Changes changes = new Changes(source).setStartPointNow(); + Changes changes = assertDbConnection.changes().build().setStartPointNow(); updateChangesForTests(); changes.setEndPointNow(); @@ -117,7 +118,7 @@ public void test_change_of_deletion_with_assertions() throws Exception { @Test @NeedReload public void test_change_of_deletion_with_displays() throws Exception { - Changes changes = new Changes(source).setStartPointNow(); + Changes changes = 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 528721c7..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 @@ -38,6 +38,7 @@ * {@link org.assertj.db.navigation.ToChange#changeOfModificationOnTable(String, int)} method. * * @author Régis Pouiller + * @author Julien Roy */ public class ToChange_ChangeOfModificationOnTable_Integer_Test extends AbstractTest { @@ -47,7 +48,7 @@ public class ToChange_ChangeOfModificationOnTable_Integer_Test extends AbstractT @Test @NeedReload public void test_change_of_modification_on_table_with_index_with_assertions() throws Exception { - Changes changes = new Changes(source).setStartPointNow(); + Changes changes = assertDbConnection.changes().build().setStartPointNow(); updateChangesForTests(); changes.setEndPointNow(); @@ -144,7 +145,7 @@ public void test_change_of_modification_on_table_with_index_with_assertions() th @Test @NeedReload public void test_change_of_modification_on_table_with_index_with_displays() throws Exception { - Changes changes = new Changes(source).setStartPointNow(); + Changes changes = 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 df93151a..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 @@ -38,6 +38,7 @@ * {@link ToChange#changeOfModificationOnTable(String)} method. * * @author Régis Pouiller + * @author Julien Roy */ public class ToChange_ChangeOfModificationOnTable_Test extends AbstractTest { @@ -47,7 +48,7 @@ public class ToChange_ChangeOfModificationOnTable_Test extends AbstractTest { @Test @NeedReload public void test_change_of_modification_on_table_with_assertions() throws Exception { - Changes changes = new Changes(source).setStartPointNow(); + Changes changes = assertDbConnection.changes().build().setStartPointNow(); updateChangesForTests(); changes.setEndPointNow(); @@ -128,7 +129,7 @@ public void test_change_of_modification_on_table_with_assertions() throws Except @Test @NeedReload public void test_change_of_modification_on_table_with_displays() throws Exception { - Changes changes = new Changes(source).setStartPointNow(); + Changes changes = 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 0b0e8dcf..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 @@ -38,6 +38,7 @@ * {@link ToChange#changeOfModification(int)} method. * * @author Régis Pouiller + * @author Julien Roy */ public class ToChange_ChangeOfModification_Integer_Test extends AbstractTest { @@ -47,7 +48,7 @@ public class ToChange_ChangeOfModification_Integer_Test extends AbstractTest { @Test @NeedReload public void test_change_of_modification_with_index_with_assertions() throws Exception { - Changes changes = new Changes(source).setStartPointNow(); + Changes changes = assertDbConnection.changes().build().setStartPointNow(); updateChangesForTests(); changes.setEndPointNow(); @@ -144,7 +145,7 @@ public void test_change_of_modification_with_index_with_assertions() throws Exce @Test @NeedReload public void test_change_of_modification_with_index_with_displays() throws Exception { - Changes changes = new Changes(source).setStartPointNow(); + Changes changes = 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 a82b1dd7..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 @@ -38,6 +38,7 @@ * {@link org.assertj.db.navigation.ToChange#changeOfModification()} method. * * @author Régis Pouiller + * @author Julien Roy */ public class ToChange_ChangeOfModification_Test extends AbstractTest { @@ -47,7 +48,7 @@ public class ToChange_ChangeOfModification_Test extends AbstractTest { @Test @NeedReload public void test_change_of_modification_with_assertions() throws Exception { - Changes changes = new Changes(source).setStartPointNow(); + Changes changes = assertDbConnection.changes().build().setStartPointNow(); updateChangesForTests(); changes.setEndPointNow(); @@ -128,7 +129,7 @@ public void test_change_of_modification_with_assertions() throws Exception { @Test @NeedReload public void test_change_of_modification_with_displays() throws Exception { - Changes changes = new Changes(source).setStartPointNow(); + Changes changes = 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 5e10fe96..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 @@ -37,6 +37,7 @@ * {@link ToChange#changeOnTableWithPks(String, Object...)} method. * * @author Régis Pouiller + * @author Julien Roy */ public class ToChange_ChangeOnTableWithPks_Test extends AbstractTest { @@ -46,7 +47,7 @@ public class ToChange_ChangeOnTableWithPks_Test extends AbstractTest { @Test @NeedReload public void test_change_on_table_with_pks_with_assertions() throws Exception { - Changes changes = new Changes(source).setStartPointNow(); + Changes changes = assertDbConnection.changes().build().setStartPointNow(); updateChangesForTests(); changes.setEndPointNow(); @@ -127,7 +128,7 @@ public void test_change_on_table_with_pks_with_assertions() throws Exception { @Test @NeedReload public void test_change_on_table_with_pks_with_displays() throws Exception { - Changes changes = new Changes(source).setStartPointNow(); + Changes changes = 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 054f6594..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 @@ -38,6 +38,7 @@ * {@link ToChange#changeOnTable(String, int)} method. * * @author Régis Pouiller + * @author Julien Roy */ public class ToChange_ChangeOnTable_Integer_Test extends AbstractTest { @@ -47,7 +48,7 @@ public class ToChange_ChangeOnTable_Integer_Test extends AbstractTest { @Test @NeedReload public void test_change_on_table_with_index_with_assertions() throws Exception { - Changes changes = new Changes(source).setStartPointNow(); + Changes changes = assertDbConnection.changes().build().setStartPointNow(); updateChangesForTests(); changes.setEndPointNow(); @@ -138,7 +139,7 @@ public void test_change_on_table_with_index_with_assertions() throws Exception { @Test @NeedReload public void test_change_on_table_with_index_with_displays() throws Exception { - Changes changes = new Changes(source).setStartPointNow(); + Changes changes = 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 7b1a4a04..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 @@ -38,6 +38,7 @@ * {@link org.assertj.db.navigation.ToChange#changeOnTable(String)} method. * * @author Régis Pouiller + * @author Julien Roy */ public class ToChange_ChangeOnTable_Test extends AbstractTest { @@ -47,7 +48,7 @@ public class ToChange_ChangeOnTable_Test extends AbstractTest { @Test @NeedReload public void test_change_on_table_with_assertions() throws Exception { - Changes changes = new Changes(source).setStartPointNow(); + Changes changes = assertDbConnection.changes().build().setStartPointNow(); updateChangesForTests(); changes.setEndPointNow(); @@ -122,7 +123,7 @@ public void test_change_on_table_with_assertions() throws Exception { @Test @NeedReload public void test_change_on_table_with_displays() throws Exception { - Changes changes = new Changes(source).setStartPointNow(); + Changes changes = 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 0a303075..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 @@ -38,6 +38,7 @@ * {@link org.assertj.db.navigation.ToChange#change(int)} method. * * @author Régis Pouiller + * @author Julien Roy */ public class ToChange_Change_Integer_Test extends AbstractTest { @@ -48,7 +49,7 @@ public class ToChange_Change_Integer_Test extends AbstractTest { @Test @NeedReload public void test_change_with_index_with_assertions() throws Exception { - Changes changes = new Changes(source).setStartPointNow(); + Changes changes = assertDbConnection.changes().build().setStartPointNow(); updateChangesForTests(); changes.setEndPointNow(); @@ -185,7 +186,7 @@ public void test_change_with_index_with_assertions() throws Exception { @Test @NeedReload public void test_change_with_index_with_displays() throws Exception { - Changes changes = new Changes(source).setStartPointNow(); + Changes changes = 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 825a7b2c..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 @@ -38,6 +38,7 @@ * {@link ToChange#change()} method. * * @author Régis Pouiller + * @author Julien Roy */ public class ToChange_Change_Test extends AbstractTest { @@ -47,7 +48,7 @@ public class ToChange_Change_Test extends AbstractTest { @Test @NeedReload public void test_change_with_assertions() throws Exception { - Changes changes = new Changes(source).setStartPointNow(); + Changes changes = assertDbConnection.changes().build().setStartPointNow(); updateChangesForTests(); changes.setEndPointNow(); @@ -167,7 +168,7 @@ public void test_change_with_assertions() throws Exception { @Test @NeedReload public void test_change_with_displays() throws Exception { - Changes changes = new Changes(source).setStartPointNow(); + Changes changes = 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 a2e79c6d..065ce1a9 100644 --- a/src/test/java/org/assertj/db/navigation/ToChange_Test.java +++ b/src/test/java/org/assertj/db/navigation/ToChange_Test.java @@ -31,6 +31,7 @@ * Tests on {@link ToChange} interface. * * @author Régis Pouiller + * @author Julien Roy */ public class ToChange_Test extends AbstractTest { @@ -40,7 +41,7 @@ public class ToChange_Test extends AbstractTest { @Test @NeedReload public void test_to_change_navigation_with_assertions() throws Exception { - Changes changes = new Changes(source).setStartPointNow(); + Changes changes = assertDbConnection.changes().build().setStartPointNow(); updateChangesForTests(); changes.setEndPointNow(); @@ -124,7 +125,7 @@ public void test_to_change_navigation_with_assertions() throws Exception { @Test @NeedReload public void test_to_change_navigation_with_displays() throws Exception { - Changes changes = new Changes(source).setStartPointNow(); + Changes changes = 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 83e37055..0335663e 100644 --- a/src/test/java/org/assertj/db/navigation/ToChanges_Test.java +++ b/src/test/java/org/assertj/db/navigation/ToChanges_Test.java @@ -33,6 +33,7 @@ * Tests on {@link org.assertj.db.navigation.ToChanges} interface. * * @author Régis Pouiller + * @author Julien Roy */ public class ToChanges_Test extends AbstractTest { @@ -42,7 +43,7 @@ public class ToChanges_Test extends AbstractTest { @Test @NeedReload public void test_to_changes_navigation_with_assertions() throws Exception { - Changes changes = new Changes(source).setStartPointNow(); + Changes changes = assertDbConnection.changes().build().setStartPointNow(); updateChangesForTests(); changes.setEndPointNow(); @@ -121,7 +122,7 @@ public void test_to_changes_navigation_with_assertions() throws Exception { @Test @NeedReload public void test_to_changes_navigation_with_displays() throws Exception { - Changes changes = new Changes(source).setStartPointNow(); + Changes changes = 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 7ec87724..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 @@ -40,6 +40,7 @@ * {@link org.assertj.db.navigation.ToColumnFromChange#columnAmongTheModifiedOnes()} method. * * @author Régis Pouiller + * @author Julien Roy */ public class ToColumnFromChange_ColumnAmongTheModifiedOnes_Integer_Test extends AbstractTest { @@ -49,7 +50,7 @@ public class ToColumnFromChange_ColumnAmongTheModifiedOnes_Integer_Test extends @Test @NeedReload public void test_column_among_the_modified_ones_with_index_with_assertions() throws Exception { - Changes changes = new Changes(source).setStartPointNow(); + Changes changes = assertDbConnection.changes().build().setStartPointNow(); updateChangesForTests(); changes.setEndPointNow(); @@ -185,7 +186,7 @@ public void test_column_among_the_modified_ones_with_index_with_assertions() thr @Test @NeedReload public void test_column_among_the_modified_ones_with_index_with_displays() throws Exception { - Changes changes = new Changes(source).setStartPointNow(); + Changes changes = 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 5e49c2c2..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 @@ -39,6 +39,7 @@ * {@link org.assertj.db.navigation.ToColumnFromChange#columnAmongTheModifiedOnes()} method. * * @author Régis Pouiller + * @author Julien Roy */ public class ToColumnFromChange_ColumnAmongTheModifiedOnes_String_Test extends AbstractTest { @@ -48,7 +49,7 @@ public class ToColumnFromChange_ColumnAmongTheModifiedOnes_String_Test extends A @Test @NeedReload public void test_column_among_the_modified_ones_with_column_name_with_assertions() throws Exception { - Changes changes = new Changes(source).setStartPointNow(); + Changes changes = assertDbConnection.changes().build().setStartPointNow(); updateChangesForTests(); changes.setEndPointNow(); @@ -171,7 +172,7 @@ public void test_column_among_the_modified_ones_with_column_name_with_assertions @Test @NeedReload public void test_column_among_the_modified_ones_with_column_name_with_displays() throws Exception { - Changes changes = new Changes(source).setStartPointNow(); + Changes changes = 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 dbeda675..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 @@ -40,6 +40,7 @@ * {@link org.assertj.db.navigation.ToColumnFromChange#columnAmongTheModifiedOnes()} method. * * @author Régis Pouiller + * @author Julien Roy */ public class ToColumnFromChange_ColumnAmongTheModifiedOnes_Test extends AbstractTest { @@ -49,7 +50,7 @@ public class ToColumnFromChange_ColumnAmongTheModifiedOnes_Test extends Abstract @Test @NeedReload public void test_column_among_the_modified_ones_with_assertions() throws Exception { - Changes changes = new Changes(source).setStartPointNow(); + Changes changes = assertDbConnection.changes().build().setStartPointNow(); updateChangesForTests(); changes.setEndPointNow(); @@ -165,7 +166,7 @@ public void test_column_among_the_modified_ones_with_assertions() throws Excepti @Test @NeedReload public void test_column_among_the_modified_ones_with_displays() throws Exception { - Changes changes = new Changes(source).setStartPointNow(); + Changes changes = 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 4f1d4150..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 @@ -56,6 +56,7 @@ * {@link org.assertj.db.navigation.ToColumn#column(int)} method. * * @author Régis Pouiller + * @author Julien Roy */ public class ToColumn_Column_Integer_Test extends AbstractTest { @@ -65,7 +66,7 @@ public class ToColumn_Column_Integer_Test extends AbstractTest { @Test @NeedReload public void test_column_with_index_from_change_with_assertions() throws Exception { - Changes changes = new Changes(source).setStartPointNow(); + Changes changes = assertDbConnection.changes().build().setStartPointNow(); updateChangesForTests(); changes.setEndPointNow(); @@ -193,7 +194,7 @@ public void test_column_with_index_from_table_with_assertions() throws Exception Field fieldIndex = Position.class.getDeclaredField("nextIndex"); fieldIndex.setAccessible(true); - Table table = new Table(source, "actor"); + Table table = assertDbConnection.table("actor").build(); TableAssert tableAssert = assertThat(table); Position position = (Position) fieldPosition.get(tableAssert); @@ -297,7 +298,7 @@ public void test_column_with_index_from_request_with_assertions() throws Excepti Field fieldIndex = Position.class.getDeclaredField("nextIndex"); fieldIndex.setAccessible(true); - Request request = new Request(source, "select * from actor"); + Request request = assertDbConnection.request("select * from actor").build(); RequestAssert requestAssert = assertThat(request); Position position = (Position) fieldPosition.get(requestAssert); Assertions.assertThat(fieldIndex.get(position)).isEqualTo(0); @@ -400,7 +401,7 @@ public void test_column_with_index_from_request_with_assertions() throws Excepti @Test @NeedReload public void test_column_with_index_from_change_with_displays() throws Exception { - Changes changes = new Changes(source).setStartPointNow(); + Changes changes = assertDbConnection.changes().build().setStartPointNow(); updateChangesForTests(); changes.setEndPointNow(); @@ -528,7 +529,7 @@ public void test_column_with_index_from_table_with_displays() throws Exception { Field fieldIndex = Position.class.getDeclaredField("nextIndex"); fieldIndex.setAccessible(true); - Table table = new Table(source, "actor"); + Table table = assertDbConnection.table("actor").build(); TableOutputter tableOutputter = Outputs.output(table); Position position = (Position) fieldPosition.get(tableOutputter); Assertions.assertThat(fieldIndex.get(position)).isEqualTo(0); @@ -631,7 +632,7 @@ public void test_column_with_index_from_request_with_displays() throws Exception Field fieldIndex = Position.class.getDeclaredField("nextIndex"); fieldIndex.setAccessible(true); - Request request = new Request(source, "select * from actor"); + Request request = 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 c5e85acb..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 @@ -55,6 +55,7 @@ * {@link org.assertj.db.navigation.ToColumn#column(String)} method. * * @author Régis Pouiller + * @author Julien Roy */ public class ToColumn_Column_String_Test extends AbstractTest { @@ -64,7 +65,7 @@ public class ToColumn_Column_String_Test extends AbstractTest { @Test @NeedReload public void test_column_with_column_name_from_change_with_assertions() throws Exception { - Changes changes = new Changes(source).setStartPointNow(); + Changes changes = assertDbConnection.changes().build().setStartPointNow(); updateChangesForTests(); changes.setEndPointNow(); @@ -179,7 +180,7 @@ public void test_column_with_column_name_from_table_with_assertions() throws Exc Field fieldIndex = Position.class.getDeclaredField("nextIndex"); fieldIndex.setAccessible(true); - Table table = new Table(source, "actor"); + Table table = assertDbConnection.table("actor").build(); TableAssert tableAssert = assertThat(table); Position position = (Position) fieldPosition.get(tableAssert); Assertions.assertThat(fieldIndex.get(position)).isEqualTo(0); @@ -275,7 +276,7 @@ public void test_column_with_column_name_from_request_with_assertions() throws E Field fieldIndex = Position.class.getDeclaredField("nextIndex"); fieldIndex.setAccessible(true); - Request request = new Request(source, "select * from actor"); + Request request = assertDbConnection.request("select * from actor").build(); RequestAssert requestAssert = assertThat(request); Position position = (Position) fieldPosition.get(requestAssert); Assertions.assertThat(fieldIndex.get(position)).isEqualTo(0); @@ -365,7 +366,7 @@ public void test_column_with_column_name_from_request_with_assertions() throws E @Test @NeedReload public void test_column_with_column_name_from_change_with_displays() throws Exception { - Changes changes = new Changes(source).setStartPointNow(); + Changes changes = assertDbConnection.changes().build().setStartPointNow(); updateChangesForTests(); changes.setEndPointNow(); @@ -480,7 +481,7 @@ public void test_column_with_column_name_from_table_with_displays() throws Excep Field fieldIndex = Position.class.getDeclaredField("nextIndex"); fieldIndex.setAccessible(true); - Table table = new Table(source, "actor"); + Table table = assertDbConnection.table("actor").build(); TableOutputter tableOutputter = Outputs.output(table); Position position = (Position) fieldPosition.get(tableOutputter); @@ -578,7 +579,7 @@ public void test_column_with_column_name_from_request_with_displays() throws Exc Field fieldIndex = Position.class.getDeclaredField("nextIndex"); fieldIndex.setAccessible(true); - Request request = new Request(source, "select * from actor"); + Request request = 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 c949f594..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 @@ -56,6 +56,7 @@ * {@link org.assertj.db.navigation.ToColumn#column()} method. * * @author Régis Pouiller + * @author Julien Roy */ public class ToColumn_Column_Test extends AbstractTest { @@ -65,7 +66,7 @@ public class ToColumn_Column_Test extends AbstractTest { @Test @NeedReload public void test_column_from_change_with_assertions() throws Exception { - Changes changes = new Changes(source).setStartPointNow(); + Changes changes = assertDbConnection.changes().build().setStartPointNow(); updateChangesForTests(); changes.setEndPointNow(); @@ -172,7 +173,7 @@ public void test_column_from_table_with_assertions() throws Exception { Field fieldIndex = Position.class.getDeclaredField("nextIndex"); fieldIndex.setAccessible(true); - Table table = new Table(source, "actor"); + Table table = assertDbConnection.table("actor").build(); TableAssert tableAssert = assertThat(table); Position position = (Position) fieldPosition.get(tableAssert); assertThat(fieldIndex.get(position)).isEqualTo(0); @@ -259,7 +260,7 @@ public void test_column_from_request_with_assertions() throws Exception { Field fieldIndex = Position.class.getDeclaredField("nextIndex"); fieldIndex.setAccessible(true); - Request request = new Request(source, "select * from actor"); + Request request = assertDbConnection.request("select * from actor").build(); RequestAssert requestAssert = assertThat(request); Position position = (Position) fieldPosition.get(requestAssert); assertThat(fieldIndex.get(position)).isEqualTo(0); @@ -342,7 +343,7 @@ public void test_column_from_request_with_assertions() throws Exception { @Test @NeedReload public void test_column_from_change_with_displays() throws Exception { - Changes changes = new Changes(source).setStartPointNow(); + Changes changes = assertDbConnection.changes().build().setStartPointNow(); updateChangesForTests(); changes.setEndPointNow(); @@ -449,7 +450,7 @@ public void test_column_from_table_with_displays() throws Exception { Field fieldIndex = Position.class.getDeclaredField("nextIndex"); fieldIndex.setAccessible(true); - Table table = new Table(source, "actor"); + Table table = assertDbConnection.table("actor").build(); TableOutputter tableOutputter = Outputs.output(table); Position position = (Position) fieldPosition.get(tableOutputter); @@ -538,7 +539,7 @@ public void test_column_from_request_with_displays() throws Exception { Field fieldIndex = Position.class.getDeclaredField("nextIndex"); fieldIndex.setAccessible(true); - Request request = new Request(source, "select * from actor"); + Request request = 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 c939f3c7..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 @@ -36,6 +36,7 @@ * {@link org.assertj.db.navigation.ToRowFromChange#rowAtEndPoint()} method. * * @author Régis Pouiller + * @author Julien Roy */ public class ToRowFromChange_RowAtEndPoint_Test extends AbstractTest { @@ -45,7 +46,7 @@ public class ToRowFromChange_RowAtEndPoint_Test extends AbstractTest { @Test @NeedReload public void test_row_at_end_point_with_assertions() throws Exception { - Changes changes = new Changes(source).setStartPointNow(); + Changes changes = assertDbConnection.changes().build().setStartPointNow(); updateChangesForTests(); changes.setEndPointNow(); @@ -99,7 +100,7 @@ public void test_row_at_end_point_with_assertions() throws Exception { @Test @NeedReload public void test_row_at_end_point_with_displays() throws Exception { - Changes changes = new Changes(source).setStartPointNow(); + Changes changes = 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 20495cad..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 @@ -36,6 +36,7 @@ * {@link org.assertj.db.navigation.ToRowFromChange#rowAtStartPoint()} method. * * @author Régis Pouiller + * @author Julien Roy */ public class ToRowFromChange_RowAtStartPoint_Test extends AbstractTest { @@ -45,7 +46,7 @@ public class ToRowFromChange_RowAtStartPoint_Test extends AbstractTest { @Test @NeedReload public void test_row_at_start_point_with_assertions() throws Exception { - Changes changes = new Changes(source).setStartPointNow(); + Changes changes = assertDbConnection.changes().build().setStartPointNow(); updateChangesForTests(); changes.setEndPointNow(); @@ -99,7 +100,7 @@ public void test_row_at_start_point_with_assertions() throws Exception { @Test @NeedReload public void test_row_at_start_point_with_displays() throws Exception { - Changes changes = new Changes(source).setStartPointNow(); + Changes changes = 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 97466aa5..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 @@ -46,6 +46,7 @@ * {@link org.assertj.db.navigation.ToRow#row(int)} method. * * @author Régis Pouiller + * @author Julien Roy */ public class ToRow_Row_Integer_Test extends AbstractTest { @@ -61,7 +62,7 @@ public void test_column_from_table_with_assertions() throws Exception { Field fieldIndex = Position.class.getDeclaredField("nextIndex"); fieldIndex.setAccessible(true); - Table table = new Table(source, "actor"); + Table table = assertDbConnection.table("actor").build(); TableAssert tableAssert = assertThat(table); Position position = (Position) fieldPosition.get(tableAssert); @@ -157,7 +158,7 @@ public void test_column_from_request_with_assertions() throws Exception { Field fieldIndex = Position.class.getDeclaredField("nextIndex"); fieldIndex.setAccessible(true); - Request request = new Request(source, "select * from actor"); + Request request = assertDbConnection.request("select * from actor").build(); RequestAssert requestAssert = assertThat(request); Position position = (Position) fieldPosition.get(requestAssert); @@ -259,7 +260,7 @@ public void test_column_from_table_with_displays() throws Exception { Field fieldIndex = Position.class.getDeclaredField("nextIndex"); fieldIndex.setAccessible(true); - Table table = new Table(source, "actor"); + Table table = assertDbConnection.table("actor").build(); TableOutputter tableOutputter = Outputs.output(table); Position position = (Position) fieldPosition.get(tableOutputter); @@ -355,7 +356,7 @@ public void test_column_from_request_with_displays() throws Exception { Field fieldIndex = Position.class.getDeclaredField("nextIndex"); fieldIndex.setAccessible(true); - Request request = new Request(source, "select * from actor"); + Request request = 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 63798128..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 @@ -46,6 +46,7 @@ * {@link org.assertj.db.navigation.ToRow#row()} method. * * @author Régis Pouiller + * @author Julien Roy */ public class ToRow_Row_Test extends AbstractTest { @@ -61,7 +62,7 @@ public void test_row_from_table_with_assertions() throws Exception { Field fieldIndex = Position.class.getDeclaredField("nextIndex"); fieldIndex.setAccessible(true); - Table table = new Table(source, "actor"); + Table table = assertDbConnection.table("actor").build(); TableAssert tableAssert = assertThat(table); Position position = (Position) fieldPosition.get(tableAssert); @@ -147,7 +148,7 @@ public void test_row_from_request_with_assertions() throws Exception { Field fieldIndex = Position.class.getDeclaredField("nextIndex"); fieldIndex.setAccessible(true); - Request request = new Request(source, "select * from actor"); + Request request = assertDbConnection.request("select * from actor").build(); RequestAssert requestAssert = assertThat(request); Position position = (Position) fieldPosition.get(requestAssert); @@ -233,7 +234,7 @@ public void test_row_from_table_with_displays() throws Exception { Field fieldIndex = Position.class.getDeclaredField("nextIndex"); fieldIndex.setAccessible(true); - Table table = new Table(source, "actor"); + Table table = assertDbConnection.table("actor").build(); TableOutputter tableOutputter = Outputs.output(table); Position position = (Position) fieldPosition.get(tableOutputter); @@ -319,7 +320,7 @@ public void test_row_from_request_with_displays() throws Exception { Field fieldIndex = Position.class.getDeclaredField("nextIndex"); fieldIndex.setAccessible(true); - Request request = new Request(source, "select * from actor"); + Request request = 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 732ed634..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 @@ -40,6 +40,7 @@ * {@link org.assertj.db.navigation.ToValueFromColumn#valueAtEndPoint()} method. * * @author Régis Pouiller + * @author Julien Roy */ public class ToValueFromColumn_ValueAtEndPoint_Test extends AbstractTest { @@ -49,7 +50,7 @@ public class ToValueFromColumn_ValueAtEndPoint_Test extends AbstractTest { @Test @NeedReload public void test_value_at_end_point_with_assertions() throws Exception { - Changes changes = new Changes(source).setStartPointNow(); + Changes changes = assertDbConnection.changes().build().setStartPointNow(); updateChangesForTests(); changes.setEndPointNow(); @@ -106,7 +107,7 @@ public void test_value_at_end_point_with_assertions() throws Exception { @Test @NeedReload public void test_value_at_end_point_with_displays() throws Exception { - Changes changes = new Changes(source).setStartPointNow(); + Changes changes = 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 86881417..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 @@ -40,6 +40,7 @@ * {@link org.assertj.db.navigation.ToValueFromColumn#valueAtStartPoint()} method. * * @author Régis Pouiller + * @author Julien Roy */ public class ToValueFromColumn_ValueAtStartPoint_Test extends AbstractTest { @@ -49,7 +50,7 @@ public class ToValueFromColumn_ValueAtStartPoint_Test extends AbstractTest { @Test @NeedReload public void test_value_at_start_point_with_assertions() throws Exception { - Changes changes = new Changes(source).setStartPointNow(); + Changes changes = assertDbConnection.changes().build().setStartPointNow(); updateChangesForTests(); changes.setEndPointNow(); @@ -107,7 +108,7 @@ public void test_value_at_start_point_with_assertions() throws Exception { @Test @NeedReload public void test_value_at_start_point_with_displays() throws Exception { - Changes changes = new Changes(source).setStartPointNow(); + Changes changes = 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 0804f38e..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 @@ -47,6 +47,7 @@ * {@link org.assertj.db.navigation.ToValueFromRow#value(String)} method. * * @author Régis Pouiller + * @author Julien Roy */ public class ToValueFromRow_Value_String_Test extends AbstractTest { @@ -57,7 +58,7 @@ public class ToValueFromRow_Value_String_Test extends AbstractTest { @Test @NeedReload public void should_fail_because_row_does_not_exist() { - Changes changes = new Changes(source).setStartPointNow(); + Changes changes = assertDbConnection.changes().build().setStartPointNow(); updateChangesForTests(); changes.setEndPointNow(); @@ -75,7 +76,7 @@ public void should_fail_because_row_does_not_exist() { @Test @NeedReload public void test_value_from_row_of_change_with_column_name() throws Exception { - Changes changes = new Changes(source).setStartPointNow(); + Changes changes = assertDbConnection.changes().build().setStartPointNow(); updateChangesForTests(); changes.setEndPointNow(); @@ -165,7 +166,7 @@ public void test_value_from_row_of_table() throws Exception { Field fieldIndex = Position.class.getDeclaredField("nextIndex"); fieldIndex.setAccessible(true); - Table table = new Table(source, "actor"); + Table table = assertDbConnection.table("actor").build(); TableAssert tableAssert = assertThat(table); TableRowAssert tableRowAssert = tableAssert.row(); Position position = (Position) fieldPosition.get(tableRowAssert); @@ -246,7 +247,7 @@ public void test_value_from_row_of_request() throws Exception { Field fieldIndex = Position.class.getDeclaredField("nextIndex"); fieldIndex.setAccessible(true); - Request request = new Request(source, "select * from actor"); + Request request = 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 e8a5eec4..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 @@ -73,6 +73,7 @@ * {@link org.assertj.db.navigation.ToValue#value(int)} method. * * @author Régis Pouiller + * @author Julien Roy */ public class ToValue_Value_Integer_Test extends AbstractTest { @@ -82,7 +83,7 @@ public class ToValue_Value_Integer_Test extends AbstractTest { @Test @NeedReload public void test_value_from_row_of_change_with_index_with_assertions() throws Exception { - Changes changes = new Changes(source).setStartPointNow(); + Changes changes = assertDbConnection.changes().build().setStartPointNow(); updateChangesForTests(); changes.setEndPointNow(); @@ -194,7 +195,7 @@ public void test_value_from_column_of_table_with_index_with_assertions() throws Field fieldIndex = Position.class.getDeclaredField("nextIndex"); fieldIndex.setAccessible(true); - Table table = new Table(source, "actor"); + Table table = assertDbConnection.table("actor").build(); TableAssert tableAssert = assertThat(table); TableColumnAssert tableColumnAssert = tableAssert.column(); Position position = @@ -270,7 +271,7 @@ public void test_value_from_row_of_table_with_index_with_assertions() throws Exc Field fieldIndex = Position.class.getDeclaredField("nextIndex"); fieldIndex.setAccessible(true); - Table table = new Table(source, "actor"); + Table table = assertDbConnection.table("actor").build(); TableAssert tableAssert = assertThat(table); TableRowAssert tableRowAssert = tableAssert.row(); Position position = @@ -360,7 +361,7 @@ public void test_value_from_column_of_request_with_index_with_assertions() throw Field fieldIndex = Position.class.getDeclaredField("nextIndex"); fieldIndex.setAccessible(true); - Request request = new Request(source, "select * from actor"); + Request request = assertDbConnection.request("select * from actor").build(); RequestAssert requestAssert = assertThat(request); RequestColumnAssert requestColumnAssert = requestAssert.column(); Position position = (Position) fieldPosition.get(requestColumnAssert); @@ -434,7 +435,7 @@ public void test_value_from_row_of_request_with_index_with_assertions() throws E Field fieldIndex = Position.class.getDeclaredField("nextIndex"); fieldIndex.setAccessible(true); - Request request = new Request(source, "select * from actor"); + Request request = assertDbConnection.request("select * from actor").build(); RequestAssert requestAssert = assertThat(request); RequestRowAssert requestRowAssert = requestAssert.row(); Position position = (Position) fieldPosition.get(requestRowAssert); @@ -516,7 +517,7 @@ public void test_value_from_row_of_request_with_index_with_assertions() throws E @Test @NeedReload public void test_value_from_row_of_change_with_index_with_displays() throws Exception { - Changes changes = new Changes(source).setStartPointNow(); + Changes changes = assertDbConnection.changes().build().setStartPointNow(); updateChangesForTests(); changes.setEndPointNow(); @@ -626,7 +627,7 @@ public void test_value_from_column_of_table_with_index_with_displays() throws Ex Field fieldIndex = Position.class.getDeclaredField("nextIndex"); fieldIndex.setAccessible(true); - Table table = new Table(source, "actor"); + Table table = assertDbConnection.table("actor").build(); TableOutputter tableOutputter = Outputs.output(table); TableColumnOutputter tableColumnOutputter = tableOutputter.column(); Position position = (Position) fieldPosition.get(tableColumnOutputter); @@ -700,7 +701,7 @@ public void test_value_from_row_of_table_with_index_with_displays() throws Excep Field fieldIndex = Position.class.getDeclaredField("nextIndex"); fieldIndex.setAccessible(true); - Table table = new Table(source, "actor"); + Table table = assertDbConnection.table("actor").build(); TableOutputter tableOutputter = Outputs.output(table); TableRowOutputter tableRowOutputter = tableOutputter.row(); Position position = (Position) fieldPosition.get(tableRowOutputter); @@ -788,7 +789,7 @@ public void test_value_from_column_of_request_with_index_with_displays() throws Field fieldIndex = Position.class.getDeclaredField("nextIndex"); fieldIndex.setAccessible(true); - Request request = new Request(source, "select * from actor"); + Request request = assertDbConnection.request("select * from actor").build(); RequestOutputter requestOutputter = Outputs.output(request); RequestColumnOutputter requestColumnOutputter = requestOutputter.column(); Position position = (Position) fieldPosition.get(requestColumnOutputter); @@ -862,7 +863,7 @@ public void test_value_from_row_of_request_with_index_with_displays() throws Exc Field fieldIndex = Position.class.getDeclaredField("nextIndex"); fieldIndex.setAccessible(true); - Request request = new Request(source, "select * from actor"); + Request request = 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 f5477e97..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 @@ -73,6 +73,7 @@ * {@link org.assertj.db.navigation.ToValue#value()} method. * * @author Régis Pouiller + * @author Julien Roy */ public class ToValue_Value_Test extends AbstractTest { @@ -82,7 +83,7 @@ public class ToValue_Value_Test extends AbstractTest { @Test @NeedReload public void test_value_from_row_of_change_with_assertions() throws Exception { - Changes changes = new Changes(source).setStartPointNow(); + Changes changes = assertDbConnection.changes().build().setStartPointNow(); updateChangesForTests(); changes.setEndPointNow(); @@ -176,7 +177,7 @@ public void test_value_from_column_of_table_with_assertions() throws Exception { Field fieldIndex = Position.class.getDeclaredField("nextIndex"); fieldIndex.setAccessible(true); - Table table = new Table(source, "actor"); + Table table = assertDbConnection.table("actor").build(); TableAssert tableAssert = assertThat(table); TableColumnAssert tableColumnAssert = tableAssert.column(); Position position = (Position) fieldPosition.get(tableColumnAssert); @@ -234,7 +235,7 @@ public void test_value_from_row_of_table_with_assertions() throws Exception { Field fieldIndex = Position.class.getDeclaredField("nextIndex"); fieldIndex.setAccessible(true); - Table table = new Table(source, "actor"); + Table table = assertDbConnection.table("actor").build(); TableAssert tableAssert = assertThat(table); TableRowAssert tableRowAssert = tableAssert.row(); Position position = (Position) fieldPosition.get(tableRowAssert); @@ -306,7 +307,7 @@ public void test_value_from_column_of_request_with_assertions() throws Exception Field fieldIndex = Position.class.getDeclaredField("nextIndex"); fieldIndex.setAccessible(true); - Request request = new Request(source, "select * from actor"); + Request request = assertDbConnection.request("select * from actor").build(); RequestAssert requestAssert = assertThat(request); RequestColumnAssert requestColumnAssert = requestAssert.column(); Position position = (Position) fieldPosition.get(requestColumnAssert); @@ -364,7 +365,7 @@ public void test_value_from_row_of_request_with_assertions() throws Exception { Field fieldIndex = Position.class.getDeclaredField("nextIndex"); fieldIndex.setAccessible(true); - Request request = new Request(source, "select * from actor"); + Request request = assertDbConnection.request("select * from actor").build(); RequestAssert requestAssert = assertThat(request); RequestRowAssert requestRowAssert = requestAssert.row(); Position position = (Position) fieldPosition.get(requestRowAssert); @@ -430,7 +431,7 @@ public void test_value_from_row_of_request_with_assertions() throws Exception { @Test @NeedReload public void test_value_from_row_of_change_with_displays() throws Exception { - Changes changes = new Changes(source).setStartPointNow(); + Changes changes = assertDbConnection.changes().build().setStartPointNow(); updateChangesForTests(); changes.setEndPointNow(); @@ -524,7 +525,7 @@ public void test_value_from_column_of_table_with_displays() throws Exception { Field fieldIndex = Position.class.getDeclaredField("nextIndex"); fieldIndex.setAccessible(true); - Table table = new Table(source, "actor"); + Table table = assertDbConnection.table("actor").build(); TableOutputter tableOutputter = Outputs.output(table); TableColumnOutputter tableColumnOutputter = tableOutputter.column(); Position position = (Position) fieldPosition.get(tableColumnOutputter); @@ -582,7 +583,7 @@ public void test_value_from_row_of_table_with_displays() throws Exception { Field fieldIndex = Position.class.getDeclaredField("nextIndex"); fieldIndex.setAccessible(true); - Table table = new Table(source, "actor"); + Table table = assertDbConnection.table("actor").build(); TableOutputter tableOutputter = Outputs.output(table); TableRowOutputter tableRowOutputter = tableOutputter.row(); Position position = (Position) fieldPosition.get(tableRowOutputter); @@ -654,7 +655,7 @@ public void test_value_from_column_of_request_with_displays() throws Exception { Field fieldIndex = Position.class.getDeclaredField("nextIndex"); fieldIndex.setAccessible(true); - Request request = new Request(source, "select * from actor"); + Request request = assertDbConnection.request("select * from actor").build(); RequestOutputter requestOutputter = Outputs.output(request); RequestColumnOutputter requestColumnOutputter = requestOutputter.column(); Position position = (Position) fieldPosition.get(requestColumnOutputter); @@ -712,7 +713,7 @@ public void test_value_from_row_of_request_with_displays() throws Exception { Field fieldIndex = Position.class.getDeclaredField("nextIndex"); fieldIndex.setAccessible(true); - Request request = new Request(source, "select * from actor"); + Request request = 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 f1b248c2..ae8c18e9 100644 --- a/src/test/java/org/assertj/db/output/OutputterChange_Test.java +++ b/src/test/java/org/assertj/db/output/OutputterChange_Test.java @@ -26,6 +26,7 @@ * Test the output of changes. * * @author Régis Pouiller + * @author Julien Roy */ public class OutputterChange_Test extends AbstractTest { @@ -35,7 +36,7 @@ public class OutputterChange_Test extends AbstractTest { @Test @NeedReload public void test_output() throws Exception { - Changes changes = new Changes(source).setStartPointNow(); + Changes changes = assertDbConnection.changes().build().setStartPointNow(); updateChangesForTests(); changes.setEndPointNow(); @@ -55,7 +56,7 @@ public void test_output() throws Exception { .change().toStream(byteArrayOutputStream5) .change().toStream(byteArrayOutputStream6) .change().toStream(byteArrayOutputStream7); - Assertions.assertThat(byteArrayOutputStream0.toString()).isEqualTo(String.format("[Change at index 0 (on table : ACTOR and with primary key : [4]) of Changes on tables of 'sa/jdbc:h2:mem:test' source]%n" + Assertions.assertThat(byteArrayOutputStream0).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" @@ -66,7 +67,7 @@ public void test_output() throws Exception { + "| CREATION | ACTOR | 4 |----------------|-----------|-----------|-----------|------------|--------------------------------------|%n" + "| | | | At end point | 4 | Murray | Bill | 1950-09-21 | 30b443ae-c0c9-4790-9bec-ce1380808435 |%n" + "|----------|-------|---------|----------------|-----------|-----------|-----------|------------|--------------------------------------|%n")); - Assertions.assertThat(byteArrayOutputStream1.toString()).isEqualTo(String.format("[Change at index 1 (on table : INTERPRETATION and with primary key : [6]) of Changes on tables of 'sa/jdbc:h2:mem:test' source]%n" + Assertions.assertThat(byteArrayOutputStream1).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" @@ -77,7 +78,7 @@ public void test_output() throws Exception { + "| CREATION | INTERPRETATION | 6 |----------------|-----------|-----------|-----------|------------------|%n" + "| | | | At end point | 6 | 4 | 4 | Dr Peter Venkman |%n" + "|----------|----------------|---------|----------------|-----------|-----------|-----------|------------------|%n")); - Assertions.assertThat(byteArrayOutputStream2.toString()).isEqualTo(String.format("[Change at index 2 (on table : MOVIE and with primary key : [4]) of Changes on tables of 'sa/jdbc:h2:mem:test' source]%n" + Assertions.assertThat(byteArrayOutputStream2).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" @@ -88,7 +89,7 @@ public void test_output() throws Exception { + "| CREATION | MOVIE | 4 |----------------|-----------|--------------|-----------|--------------------------------------|%n" + "| | | | At end point | 4 | Ghostbusters | 1984 | 30b443ae-c0c9-4790-9bec-ce1380808435 |%n" + "|----------|-------|---------|----------------|-----------|--------------|-----------|--------------------------------------|%n")); - Assertions.assertThat(byteArrayOutputStream3.toString()).isEqualTo(String.format("[Change at index 3 (on table : ACTOR and with primary key : [1]) of Changes on tables of 'sa/jdbc:h2:mem:test' source]%n" + Assertions.assertThat(byteArrayOutputStream3).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" @@ -99,7 +100,7 @@ public void test_output() throws Exception { + "| MODIFICATION | ACTOR | 1 |----------------|-----------|-----------|-----------------|------------|--------------------------------------|%n" + "| | | | At end point | 1 | Weaver | Susan Alexandra | 1949-10-08 | 30b443ae-c0c9-4790-9bec-ce1380808435 |%n" + "|--------------|-------|---------|----------------|-----------|-----------|-----------------|------------|--------------------------------------|%n")); - Assertions.assertThat(byteArrayOutputStream4.toString()).isEqualTo(String.format("[Change at index 4 (on table : INTERPRETATION and with primary key : [3]) of Changes on tables of 'sa/jdbc:h2:mem:test' source]%n" + Assertions.assertThat(byteArrayOutputStream4).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" @@ -110,7 +111,7 @@ public void test_output() throws Exception { + "| MODIFICATION | INTERPRETATION | 3 |----------------|-----------|-----------|-----------|------------------------|%n" + "| | | | At end point | 3 | 3 | 1 | Doctor Grace Augustine |%n" + "|--------------|----------------|---------|----------------|-----------|-----------|-----------|------------------------|%n")); - Assertions.assertThat(byteArrayOutputStream5.toString()).isEqualTo(String.format("[Change at index 5 (on table : MOVIE and with primary key : [3]) of Changes on tables of 'sa/jdbc:h2:mem:test' source]%n" + Assertions.assertThat(byteArrayOutputStream5).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" @@ -121,7 +122,7 @@ public void test_output() throws Exception { + "| MODIFICATION | MOVIE | 3 |----------------|-----------|------------|-----------|--------------------------------------|%n" + "| | | | At end point | 3 | The Avatar | 2009 | d735221b-5de5-4112-aa1e-49090cb75ada |%n" + "|--------------|-------|---------|----------------|-----------|------------|-----------|--------------------------------------|%n")); - Assertions.assertThat(byteArrayOutputStream6.toString()).isEqualTo(String.format("[Change at index 6 (on table : ACTOR and with primary key : [3]) of Changes on tables of 'sa/jdbc:h2:mem:test' source]%n" + Assertions.assertThat(byteArrayOutputStream6).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" @@ -132,7 +133,7 @@ public void test_output() throws Exception { + "| DELETION | ACTOR | 3 |----------------|-----------|-------------|-----------|------------|--------------------------------------|%n" + "| | | | At end point | | | | | |%n" + "|----------|-------|---------|----------------|-----------|-------------|-----------|------------|--------------------------------------|%n")); - Assertions.assertThat(byteArrayOutputStream7.toString()).isEqualTo(String.format("[Change at index 7 (on table : INTERPRETATION and with primary key : [5]) of Changes on tables of 'sa/jdbc:h2:mem:test' source]%n" + Assertions.assertThat(byteArrayOutputStream7).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 10138a02..787fb08a 100644 --- a/src/test/java/org/assertj/db/output/OutputterChanges_Test.java +++ b/src/test/java/org/assertj/db/output/OutputterChanges_Test.java @@ -26,6 +26,7 @@ * Test the output of changes. * * @author Régis Pouiller + * @author Julien Roy */ public class OutputterChanges_Test extends AbstractTest { @@ -35,13 +36,13 @@ public class OutputterChanges_Test extends AbstractTest { @Test @NeedReload public void test_output() throws Exception { - Changes changes = new Changes(source).setStartPointNow(); + Changes changes = 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' source]%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 4091979c..5f47b318 100644 --- a/src/test/java/org/assertj/db/output/OutputterColumn_Test.java +++ b/src/test/java/org/assertj/db/output/OutputterColumn_Test.java @@ -28,6 +28,7 @@ * Test the output of columns. * * @author Régis Pouiller + * @author Julien Roy */ public class OutputterColumn_Test extends AbstractTest { @@ -36,7 +37,7 @@ public class OutputterColumn_Test extends AbstractTest { */ @Test public void test_output_for_table() throws Exception { - Table table = new Table(source, "actor"); + Table table = assertDbConnection.table("actor").build(); ByteArrayOutputStream byteArrayOutputStream0 = new ByteArrayOutputStream(); ByteArrayOutputStream byteArrayOutputStream1 = new ByteArrayOutputStream(); @@ -44,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" @@ -53,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" @@ -62,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" @@ -78,7 +79,7 @@ public void test_output_for_table() throws Exception { */ @Test public void test_output_for_request() throws Exception { - Request request = new Request(source, "select * from actor"); + Request request = assertDbConnection.request("select * from actor").build(); ByteArrayOutputStream byteArrayOutputStream0 = new ByteArrayOutputStream(); ByteArrayOutputStream byteArrayOutputStream1 = new ByteArrayOutputStream(); @@ -86,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" @@ -95,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" @@ -104,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" @@ -121,7 +122,7 @@ public void test_output_for_request() throws Exception { @Test @NeedReload public void test_output_for_change() throws Exception { - Changes changes = new Changes(source).setStartPointNow(); + Changes changes = assertDbConnection.changes().build().setStartPointNow(); updateChangesForTests(); changes.setEndPointNow(); @@ -131,7 +132,7 @@ public void test_output_for_change() throws Exception { output(changes).change().column().toStream(byteArrayOutputStream0) .column().toStream(byteArrayOutputStream1) .column().toStream(byteArrayOutputStream2); - Assertions.assertThat(byteArrayOutputStream0.toString()).isEqualTo(String.format("[Column at index 0 (column name : ID) of Change at index 0 (on table : ACTOR and with primary key : [4]) of Changes on tables of 'sa/jdbc:h2:mem:test' source]%n" + Assertions.assertThat(byteArrayOutputStream0).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" @@ -140,7 +141,7 @@ public void test_output_for_change() throws Exception { + "|----------------|----------|%n" + "| At end point | 4 |%n" + "|----------------|----------|%n")); - Assertions.assertThat(byteArrayOutputStream1.toString()).isEqualTo(String.format("[Column at index 1 (column name : NAME) of Change at index 0 (on table : ACTOR and with primary key : [4]) of Changes on tables of 'sa/jdbc:h2:mem:test' source]%n" + Assertions.assertThat(byteArrayOutputStream1).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" @@ -149,7 +150,7 @@ public void test_output_for_change() throws Exception { + "|----------------|--------|%n" + "| At end point | Murray |%n" + "|----------------|--------|%n")); - Assertions.assertThat(byteArrayOutputStream2.toString()).isEqualTo(String.format("[Column at index 2 (column name : FIRSTNAME) of Change at index 0 (on table : ACTOR and with primary key : [4]) of Changes on tables of 'sa/jdbc:h2:mem:test' source]%n" + Assertions.assertThat(byteArrayOutputStream2).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 5b375dd7..93113aa2 100644 --- a/src/test/java/org/assertj/db/output/OutputterException_Test.java +++ b/src/test/java/org/assertj/db/output/OutputterException_Test.java @@ -29,6 +29,7 @@ * Test the exception of output. * * @author Régis Pouiller + * @author Julien Roy * @author Pascal Schumacher */ public class OutputterException_Test extends AbstractTest { @@ -38,7 +39,7 @@ public class OutputterException_Test extends AbstractTest { */ @Test public void test_display_from_column_for_table() throws Exception { - Table table = new Table(source, "actor"); + Table table = assertDbConnection.table("actor").build(); try { Outputs.output(table).column(null); @@ -62,7 +63,7 @@ public void test_display_from_column_for_table() throws Exception { */ @Test public void test_display_from_column_for_request() throws Exception { - Request request = new Request(source, "select * from actor"); + Request request = assertDbConnection.request("select * from actor").build(); try { Outputs.output(request).column(null); @@ -87,7 +88,7 @@ public void test_display_from_column_for_request() throws Exception { @Test @NeedReload public void test_output_for_row_from_change() throws Exception { - Changes changes = new Changes(source).setStartPointNow(); + Changes changes = assertDbConnection.changes().build().setStartPointNow(); updateChangesForTests(); changes.setEndPointNow(); @@ -118,7 +119,7 @@ public void test_output_for_row_from_change() throws Exception { */ @Test public void test_display_from_value_from_row_for_table() throws Exception { - Table table = new Table(source, "actor"); + Table table = assertDbConnection.table("actor").build(); try { Outputs.output(table).row().value(null); @@ -142,7 +143,7 @@ public void test_display_from_value_from_row_for_table() throws Exception { */ @Test public void test_display_from_value_from_row_for_request() throws Exception { - Request request = new Request(source, "select * from actor"); + Request request = assertDbConnection.request("select * from actor").build(); try { Outputs.output(request).row().value(null); @@ -163,7 +164,7 @@ public void test_display_from_value_from_row_for_request() throws Exception { @Test public void test_display_to_file() { - Request request = new Request(source, "select * from actor"); + Request request = 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 35fddfdd..00ac7afa 100644 --- a/src/test/java/org/assertj/db/output/OutputterRequest_Test.java +++ b/src/test/java/org/assertj/db/output/OutputterRequest_Test.java @@ -25,6 +25,7 @@ * Test the output of requests. * * @author Régis Pouiller + * @author Julien Roy */ public class OutputterRequest_Test extends AbstractTest { @@ -33,11 +34,11 @@ public class OutputterRequest_Test extends AbstractTest { */ @Test public void test_output() throws Exception { - Request request = new Request(source, "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" @@ -55,7 +56,7 @@ public void test_output() throws Exception { */ @Test public void test_navigation() throws Exception { - Request request = new Request(source, "select * from actor"); + Request request = 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 a6bc2001..85453164 100644 --- a/src/test/java/org/assertj/db/output/OutputterRow_Test.java +++ b/src/test/java/org/assertj/db/output/OutputterRow_Test.java @@ -28,6 +28,7 @@ * Test the output of rows. * * @author Régis Pouiller + * @author Julien Roy */ public class OutputterRow_Test extends AbstractTest { @@ -36,7 +37,7 @@ public class OutputterRow_Test extends AbstractTest { */ @Test public void test_output_for_table() throws Exception { - Table table = new Table(source, "actor"); + Table table = assertDbConnection.table("actor").build(); ByteArrayOutputStream byteArrayOutputStream0 = new ByteArrayOutputStream(); ByteArrayOutputStream byteArrayOutputStream1 = new ByteArrayOutputStream(); @@ -44,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" @@ -53,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" @@ -62,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" @@ -78,7 +79,7 @@ public void test_output_for_table() throws Exception { */ @Test public void test_output_for_request() throws Exception { - Request request = new Request(source, "select * from actor"); + Request request = assertDbConnection.request("select * from actor").build(); ByteArrayOutputStream byteArrayOutputStream0 = new ByteArrayOutputStream(); ByteArrayOutputStream byteArrayOutputStream1 = new ByteArrayOutputStream(); @@ -86,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" @@ -95,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" @@ -104,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" @@ -121,7 +122,7 @@ public void test_output_for_request() throws Exception { @Test @NeedReload public void test_output_for_change() throws Exception { - Changes changes = new Changes(source).setStartPointNow(); + Changes changes = assertDbConnection.changes().build().setStartPointNow(); updateChangesForTests(); changes.setEndPointNow(); @@ -131,9 +132,9 @@ public void test_output_for_change() throws Exception { output(changes).change().rowAtStartPoint().toStream(byteArrayOutputStream0) .rowAtEndPoint().toStream(byteArrayOutputStream1) .changeOfModification().rowAtStartPoint().toStream(byteArrayOutputStream2); - Assertions.assertThat(byteArrayOutputStream0.toString()).isEqualTo(String.format("[Row at start point of Change at index 0 (on table : ACTOR and with primary key : [4]) of Changes on tables of 'sa/jdbc:h2:mem:test' source]%n" + Assertions.assertThat(byteArrayOutputStream0).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' source]%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" @@ -142,7 +143,7 @@ public void test_output_for_change() throws Exception { + "|---------|-----------|-----------|-----------|------------|--------------------------------------|%n" + "| 4 | 4 | Murray | Bill | 1950-09-21 | 30b443ae-c0c9-4790-9bec-ce1380808435 |%n" + "|---------|-----------|-----------|-----------|------------|--------------------------------------|%n")); - Assertions.assertThat(byteArrayOutputStream2.toString()).isEqualTo(String.format("[Row at start point of Change at index 0 (on table : ACTOR and with primary key : [1]) of Changes on tables of 'sa/jdbc:h2:mem:test' source (only modification changes)]%n" + Assertions.assertThat(byteArrayOutputStream2).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 f0d19022..c61d0abf 100644 --- a/src/test/java/org/assertj/db/output/OutputterTable_Test.java +++ b/src/test/java/org/assertj/db/output/OutputterTable_Test.java @@ -25,6 +25,7 @@ * Test the output of tables. * * @author Régis Pouiller + * @author Julien Roy */ public class OutputterTable_Test extends AbstractTest { @@ -33,11 +34,11 @@ public class OutputterTable_Test extends AbstractTest { */ @Test public void test_output() throws Exception { - Table table = new Table(source, "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" @@ -55,7 +56,7 @@ public void test_output() throws Exception { */ @Test public void test_navigation() throws Exception { - Table table = new Table(source, "actor"); + Table table = 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 bc24c259..1f97b9d3 100644 --- a/src/test/java/org/assertj/db/output/OutputterToConsole_Test.java +++ b/src/test/java/org/assertj/db/output/OutputterToConsole_Test.java @@ -24,6 +24,7 @@ * Test the output to console. * * @author Régis Pouiller + * @author Julien Roy */ public class OutputterToConsole_Test extends AbstractTest { @@ -32,13 +33,13 @@ public class OutputterToConsole_Test extends AbstractTest { */ @Test public void test_output_to_console() throws Exception { - Table table = new Table(source, "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 0e654a53..957d11d4 100644 --- a/src/test/java/org/assertj/db/output/OutputterToFile_Test.java +++ b/src/test/java/org/assertj/db/output/OutputterToFile_Test.java @@ -25,6 +25,7 @@ * Test the output to File. * * @author Régis Pouiller + * @author Julien Roy */ public class OutputterToFile_Test extends AbstractTest { @@ -33,7 +34,7 @@ public class OutputterToFile_Test extends AbstractTest { */ @Test public void test_output_to_file() throws Exception { - Table table = new Table(source, "actor"); + Table table = 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 705a1dc9..9530f26f 100644 --- a/src/test/java/org/assertj/db/output/OutputterToStream_Test.java +++ b/src/test/java/org/assertj/db/output/OutputterToStream_Test.java @@ -23,6 +23,7 @@ * Test the output to Stream. * * @author Régis Pouiller + * @author Julien Roy */ public class OutputterToStream_Test extends AbstractTest { @@ -31,11 +32,11 @@ public class OutputterToStream_Test extends AbstractTest { */ @Test public void test_output_to_stream() throws Exception { - Table table = new Table(source, "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 35e0f7be..75888eda 100644 --- a/src/test/java/org/assertj/db/output/OutputterValue_Test.java +++ b/src/test/java/org/assertj/db/output/OutputterValue_Test.java @@ -28,6 +28,7 @@ * Test the output of values. * * @author Régis Pouiller + * @author Julien Roy */ public class OutputterValue_Test extends AbstractTest { @@ -36,7 +37,7 @@ public class OutputterValue_Test extends AbstractTest { */ @Test public void test_output_for_row_from_table() throws Exception { - Table table = new Table(source, "actor"); + Table table = assertDbConnection.table("actor").build(); ByteArrayOutputStream byteArrayOutputStream0 = new ByteArrayOutputStream(); ByteArrayOutputStream byteArrayOutputStream1 = new ByteArrayOutputStream(); @@ -46,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" @@ -81,7 +82,7 @@ public void test_output_for_row_from_table() throws Exception { */ @Test public void test_output_for_row_from_request() throws Exception { - Request request = new Request(source, "select * from actor"); + Request request = assertDbConnection.request("select * from actor").build(); ByteArrayOutputStream byteArrayOutputStream0 = new ByteArrayOutputStream(); ByteArrayOutputStream byteArrayOutputStream1 = new ByteArrayOutputStream(); @@ -91,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" @@ -127,7 +128,7 @@ public void test_output_for_row_from_request() throws Exception { @Test @NeedReload public void test_output_for_row_from_change() throws Exception { - Changes changes = new Changes(source).setStartPointNow(); + Changes changes = assertDbConnection.changes().build().setStartPointNow(); updateChangesForTests(); changes.setEndPointNow(); @@ -139,28 +140,28 @@ public void test_output_for_row_from_change() throws Exception { .changeOfModification().rowAtStartPoint().value().toStream(byteArrayOutputStream1) .rowAtEndPoint().value().toStream(byteArrayOutputStream2) .value("firstname").toStream(byteArrayOutputStream3); - Assertions.assertThat(byteArrayOutputStream0.toString()).isEqualTo(String.format("[Value at index 0 (column name : ID) of Row at end point of Change at index 0 (on table : ACTOR and with primary key : [4]) of Changes on tables of 'sa/jdbc:h2:mem:test' source]%n" + Assertions.assertThat(byteArrayOutputStream0).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' source (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' source (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' source (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" @@ -174,7 +175,7 @@ public void test_output_for_row_from_change() throws Exception { */ @Test public void test_output_for_column_from_table() throws Exception { - Table table = new Table(source, "actor"); + Table table = assertDbConnection.table("actor").build(); ByteArrayOutputStream byteArrayOutputStream0 = new ByteArrayOutputStream(); ByteArrayOutputStream byteArrayOutputStream1 = new ByteArrayOutputStream(); @@ -184,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" @@ -219,7 +220,7 @@ public void test_output_for_column_from_table() throws Exception { */ @Test public void test_output_for_column_from_request() throws Exception { - Request request = new Request(source, "select * from actor"); + Request request = assertDbConnection.request("select * from actor").build(); ByteArrayOutputStream byteArrayOutputStream0 = new ByteArrayOutputStream(); ByteArrayOutputStream byteArrayOutputStream1 = new ByteArrayOutputStream(); @@ -229,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" @@ -237,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" @@ -266,7 +267,7 @@ public void test_output_for_column_from_request() throws Exception { @Test @NeedReload public void test_output_for_column_from_change() throws Exception { - Changes changes = new Changes(source).setStartPointNow(); + Changes changes = assertDbConnection.changes().build().setStartPointNow(); updateChangesForTests(); changes.setEndPointNow(); @@ -276,21 +277,21 @@ public void test_output_for_column_from_change() throws Exception { output(changes).change().column().valueAtStartPoint().toStream(byteArrayOutputStream0) .valueAtEndPoint().toStream(byteArrayOutputStream1) .column().valueAtEndPoint().toStream(byteArrayOutputStream2); - Assertions.assertThat(byteArrayOutputStream0.toString()).isEqualTo(String.format("[Value at start point of Column at index 0 (column name : ID) of Change at index 0 (on table : ACTOR and with primary key : [4]) of Changes on tables of 'sa/jdbc:h2:mem:test' source]%n" + Assertions.assertThat(byteArrayOutputStream0).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' source]%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' source]%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/output/impl/OutputType_ValueOf_Test.java b/src/test/java/org/assertj/db/output/impl/OutputType_ValueOf_Test.java index 37476d35..ae41c089 100644 --- a/src/test/java/org/assertj/db/output/impl/OutputType_ValueOf_Test.java +++ b/src/test/java/org/assertj/db/output/impl/OutputType_ValueOf_Test.java @@ -12,10 +12,10 @@ */ package org.assertj.db.output.impl; -import org.junit.Test; - import static org.assertj.core.api.Assertions.assertThat; +import org.junit.Test; + /** * Test on the type got from {@code valueOf} method from {@code RepresentationType} enum. * diff --git a/src/test/java/org/assertj/db/output/impl/PlainOutput_Test.java b/src/test/java/org/assertj/db/output/impl/PlainOutput_Test.java index c66aecbe..326b5063 100644 --- a/src/test/java/org/assertj/db/output/impl/PlainOutput_Test.java +++ b/src/test/java/org/assertj/db/output/impl/PlainOutput_Test.java @@ -12,14 +12,7 @@ */ package org.assertj.db.output.impl; -import org.assertj.core.api.WritableAssertionInfo; -import org.assertj.db.common.AbstractTest; -import org.assertj.db.type.Change; -import org.assertj.db.type.ChangeType; -import org.assertj.db.type.DataType; -import org.assertj.db.type.Row; -import org.assertj.db.type.Value; -import org.junit.Test; +import static org.assertj.core.api.Assertions.assertThat; import java.sql.Date; import java.sql.Time; @@ -29,7 +22,14 @@ import java.util.Locale; import java.util.UUID; -import static org.assertj.core.api.Assertions.assertThat; +import org.assertj.core.api.WritableAssertionInfo; +import org.assertj.db.common.AbstractTest; +import org.assertj.db.type.Change; +import org.assertj.db.type.ChangeType; +import org.assertj.db.type.DataType; +import org.assertj.db.type.Row; +import org.assertj.db.type.Value; +import org.junit.Test; /** * Test on the utility class {@code PlainRepresentation}. diff --git a/src/test/java/org/assertj/db/type/AbstractDbElement_Exception_Test.java b/src/test/java/org/assertj/db/type/AbstractDbElement_Exception_Test.java deleted file mode 100644 index 8e47f1b9..00000000 --- a/src/test/java/org/assertj/db/type/AbstractDbElement_Exception_Test.java +++ /dev/null @@ -1,102 +0,0 @@ -/* - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - * - * Copyright 2015-2024 the original author or authors. - */ -package org.assertj.db.type; - -import static org.assertj.core.api.Assertions.assertThat; -import static org.junit.Assert.fail; - -import java.sql.SQLException; - -import org.assertj.db.common.AbstractTest; -import org.assertj.db.common.DefaultConnection; -import org.junit.Test; - -/** - * Tests on the exceptions of {@code AbstractDbElement} - * - * @author Régis Pouiller - */ -public class AbstractDbElement_Exception_Test extends AbstractTest { - - /** - * This method should fail because {@code getCatalog} throws an SQL Exception. - */ - @Test - public void should_fail_because_getCatalog_throws_an_SQLException() { - try { - AbstractDbElement.getCatalog(new DefaultConnection(null) { - - @Override - public String getCatalog() throws SQLException { - throw new SQLException("test"); - } - }); - fail("An exception must be raised"); - } catch (SQLException exception) { - assertThat(exception.getMessage()).isEqualTo("test"); - } - } - - /** - * Tests if returns {@code null} because {@code getCatalog} throws an Exception. - * - * @throws SQLException - */ - @Test - public void test_if_returns_null_because_getCatalog_throws_an_Exception() throws SQLException { - String catalog = AbstractDbElement.getCatalog(new DefaultConnection(null) { - - @Override - public String getCatalog() throws SQLException { - throw new RuntimeException("test"); - } - }); - assertThat(catalog).isNull(); - } - - /** - * This method should fail because {@code getSchema} throws an SQL Exception. - */ - @Test - public void should_fail_because_getSchema_throws_an_SQLException() { - try { - AbstractDbElement.getSchema(new DefaultConnection(null) { - - @Override - public String getSchema() throws SQLException { - throw new SQLException("test"); - } - }); - fail("An exception must be raised"); - } catch (SQLException exception) { - assertThat(exception.getMessage()).isEqualTo("test"); - } - } - - /** - * Tests if returns {@code null} because {@code getSchema} throws an Exception. - * - * @throws SQLException - */ - @Test - public void test_if_returns_null_because_getSchema_throws_an_Exception() throws SQLException { - String schema = AbstractDbElement.getSchema(new DefaultConnection(null) { - - @Override - public String getCatalog() throws SQLException { - throw new RuntimeException("test"); - } - }); - assertThat(schema).isNull(); - } -} diff --git a/src/test/java/org/assertj/db/type/CachedSchemaMetaData_Test.java b/src/test/java/org/assertj/db/type/CachedSchemaMetaData_Test.java new file mode 100644 index 00000000..9dc6e478 --- /dev/null +++ b/src/test/java/org/assertj/db/type/CachedSchemaMetaData_Test.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.type; + +import static org.assertj.core.api.Assertions.assertThat; + +import java.sql.DriverManager; +import java.sql.SQLException; + +import org.assertj.db.common.AbstractTest; +import org.assertj.db.common.DefaultConnectionProvider; +import org.junit.Test; + +/** + * Tests on the cached schema metadata. + * + * @author Julien Roy + */ +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(provider); + assertThat(metaData.getTablesName()).containsExactly("ACTOR", "INTERPRETATION", "MOVIE", "TEST", "TEST2"); + } + + @Test + public void test_get_columns() { + 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(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 f15a8855..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 @@ -21,7 +21,8 @@ /** * Tests on the {@code getDataType} method. * - * @author Régis Pouiller. + * @author Régis Pouiller + * @author Julien Roy. */ public class Change_GetDataType_Test extends AbstractTest { @@ -31,7 +32,7 @@ public class Change_GetDataType_Test extends AbstractTest { @Test @NeedReload public void test_getDataTypeOfTable() { - Changes changes = new Changes(source).setStartPointNow(); + Changes changes = assertDbConnection.changes().build().setStartPointNow(); updateChangesForTests(); changes.setEndPointNow(); @@ -44,7 +45,7 @@ public void test_getDataTypeOfTable() { @Test @NeedReload public void test_getDataTypeOfRequest() { - Changes changes = new Changes(new Request(source, "select * from movie")).setStartPointNow(); + Changes changes = 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 9790b047..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 @@ -21,15 +21,16 @@ * Tests on the constructors of Changes * * @author Régis Pouiller + * @author Julien Roy */ public class Changes_Constructor_Test extends AbstractTest { /** - * This method test the constructor with source. + * This method test the constructor with jdbc connection provider. */ @Test - public void test_constructor_source() { - Changes changes = new Changes(source); + public void test_constructor_jdbc() { + Changes changes = assertDbConnection.changes().build(); assertThat(changes.getRequestAtStartPoint()).isNull(); assertThat(changes.getRequestAtEndPoint()).isNull(); @@ -41,25 +42,20 @@ public void test_constructor_source() { assertThat(changes.getRequestAtStartPoint()).isNull(); assertThat(changes.getRequestAtEndPoint()).isNull(); assertThat(changes.getTablesAtStartPointList()).isNotNull(); - assertThat(changes.getTablesAtStartPointList().size()).isEqualTo(5); - assertThat(changes.getTablesAtStartPointList().get(0).getSource()).isSameAs(source); - assertThat(changes.getTablesAtStartPointList().get(0).getDataSource()).isNull(); + assertThat(changes.getTablesAtStartPointList()).hasSize(5); + assertThat(changes.getTablesAtStartPointList().get(0).getConnectionProvider()).isNotNull(); assertThat(changes.getTablesAtStartPointList().get(0).getName()).isEqualTo("ACTOR"); assertThat(changes.getTablesAtStartPointList().get(0).getRequest()).isEqualTo("SELECT * FROM ACTOR"); - assertThat(changes.getTablesAtStartPointList().get(1).getSource()).isSameAs(source); - assertThat(changes.getTablesAtStartPointList().get(1).getDataSource()).isNull(); + assertThat(changes.getTablesAtStartPointList().get(1).getConnectionProvider()).isNotNull(); assertThat(changes.getTablesAtStartPointList().get(1).getName()).isEqualTo("INTERPRETATION"); assertThat(changes.getTablesAtStartPointList().get(1).getRequest()).isEqualTo("SELECT * FROM INTERPRETATION"); - assertThat(changes.getTablesAtStartPointList().get(2).getSource()).isSameAs(source); - assertThat(changes.getTablesAtStartPointList().get(2).getDataSource()).isNull(); + assertThat(changes.getTablesAtStartPointList().get(2).getConnectionProvider()).isNotNull(); assertThat(changes.getTablesAtStartPointList().get(2).getName()).isEqualTo("MOVIE"); assertThat(changes.getTablesAtStartPointList().get(2).getRequest()).isEqualTo("SELECT * FROM MOVIE"); - assertThat(changes.getTablesAtStartPointList().get(3).getSource()).isSameAs(source); - assertThat(changes.getTablesAtStartPointList().get(3).getDataSource()).isNull(); + assertThat(changes.getTablesAtStartPointList().get(3).getConnectionProvider()).isNotNull(); assertThat(changes.getTablesAtStartPointList().get(3).getName()).isEqualTo("TEST"); assertThat(changes.getTablesAtStartPointList().get(3).getRequest()).isEqualTo("SELECT * FROM TEST"); - assertThat(changes.getTablesAtStartPointList().get(4).getSource()).isSameAs(source); - assertThat(changes.getTablesAtStartPointList().get(4).getDataSource()).isNull(); + assertThat(changes.getTablesAtStartPointList().get(4).getConnectionProvider()).isNotNull(); assertThat(changes.getTablesAtStartPointList().get(4).getName()).isEqualTo("TEST2"); assertThat(changes.getTablesAtStartPointList().get(4).getRequest()).isEqualTo("SELECT * FROM TEST2"); assertThat(changes.getTablesAtEndPointList()).isNull(); @@ -69,137 +65,37 @@ public void test_constructor_source() { assertThat(changes.getRequestAtStartPoint()).isNull(); assertThat(changes.getRequestAtEndPoint()).isNull(); assertThat(changes.getTablesAtStartPointList()).isNotNull(); - assertThat(changes.getTablesAtStartPointList().size()).isEqualTo(5); - assertThat(changes.getTablesAtStartPointList().get(0).getSource()).isSameAs(source); - assertThat(changes.getTablesAtStartPointList().get(0).getDataSource()).isNull(); + assertThat(changes.getTablesAtStartPointList()).hasSize(5); + assertThat(changes.getTablesAtStartPointList().get(0).getConnectionProvider()).isNotNull(); assertThat(changes.getTablesAtStartPointList().get(0).getName()).isEqualTo("ACTOR"); assertThat(changes.getTablesAtStartPointList().get(0).getRequest()).isEqualTo("SELECT * FROM ACTOR"); - assertThat(changes.getTablesAtStartPointList().get(1).getSource()).isSameAs(source); - assertThat(changes.getTablesAtStartPointList().get(1).getDataSource()).isNull(); + assertThat(changes.getTablesAtStartPointList().get(1).getConnectionProvider()).isNotNull(); assertThat(changes.getTablesAtStartPointList().get(1).getName()).isEqualTo("INTERPRETATION"); assertThat(changes.getTablesAtStartPointList().get(1).getRequest()).isEqualTo("SELECT * FROM INTERPRETATION"); - assertThat(changes.getTablesAtStartPointList().get(2).getSource()).isSameAs(source); - assertThat(changes.getTablesAtStartPointList().get(2).getDataSource()).isNull(); + assertThat(changes.getTablesAtStartPointList().get(2).getConnectionProvider()).isNotNull(); assertThat(changes.getTablesAtStartPointList().get(2).getName()).isEqualTo("MOVIE"); assertThat(changes.getTablesAtStartPointList().get(2).getRequest()).isEqualTo("SELECT * FROM MOVIE"); - assertThat(changes.getTablesAtStartPointList().get(3).getSource()).isSameAs(source); - assertThat(changes.getTablesAtStartPointList().get(3).getDataSource()).isNull(); + assertThat(changes.getTablesAtStartPointList().get(3).getConnectionProvider()).isNotNull(); assertThat(changes.getTablesAtStartPointList().get(3).getName()).isEqualTo("TEST"); assertThat(changes.getTablesAtStartPointList().get(3).getRequest()).isEqualTo("SELECT * FROM TEST"); - assertThat(changes.getTablesAtStartPointList().get(4).getSource()).isSameAs(source); - assertThat(changes.getTablesAtStartPointList().get(4).getDataSource()).isNull(); + assertThat(changes.getTablesAtStartPointList().get(4).getConnectionProvider()).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().size()).isEqualTo(5); - assertThat(changes.getTablesAtEndPointList().get(0).getSource()).isSameAs(source); - assertThat(changes.getTablesAtEndPointList().get(0).getDataSource()).isNull(); + assertThat(changes.getTablesAtEndPointList()).hasSize(5); + assertThat(changes.getTablesAtEndPointList().get(0).getConnectionProvider()).isNotNull(); assertThat(changes.getTablesAtEndPointList().get(0).getName()).isEqualTo("ACTOR"); assertThat(changes.getTablesAtEndPointList().get(0).getRequest()).isEqualTo("SELECT * FROM ACTOR"); - assertThat(changes.getTablesAtEndPointList().get(1).getSource()).isSameAs(source); - assertThat(changes.getTablesAtEndPointList().get(1).getDataSource()).isNull(); + assertThat(changes.getTablesAtEndPointList().get(1).getConnectionProvider()).isNotNull(); assertThat(changes.getTablesAtEndPointList().get(1).getName()).isEqualTo("INTERPRETATION"); assertThat(changes.getTablesAtEndPointList().get(1).getRequest()).isEqualTo("SELECT * FROM INTERPRETATION"); - assertThat(changes.getTablesAtEndPointList().get(2).getSource()).isSameAs(source); - assertThat(changes.getTablesAtEndPointList().get(2).getDataSource()).isNull(); + assertThat(changes.getTablesAtEndPointList().get(2).getConnectionProvider()).isNotNull(); assertThat(changes.getTablesAtEndPointList().get(2).getName()).isEqualTo("MOVIE"); assertThat(changes.getTablesAtEndPointList().get(2).getRequest()).isEqualTo("SELECT * FROM MOVIE"); - assertThat(changes.getTablesAtEndPointList().get(3).getSource()).isSameAs(source); - assertThat(changes.getTablesAtEndPointList().get(3).getDataSource()).isNull(); + assertThat(changes.getTablesAtEndPointList().get(3).getConnectionProvider()).isNotNull(); assertThat(changes.getTablesAtEndPointList().get(3).getName()).isEqualTo("TEST"); assertThat(changes.getTablesAtEndPointList().get(3).getRequest()).isEqualTo("SELECT * FROM TEST"); - assertThat(changes.getTablesAtEndPointList().get(4).getSource()).isSameAs(source); - assertThat(changes.getTablesAtEndPointList().get(4).getDataSource()).isNull(); - assertThat(changes.getTablesAtEndPointList().get(4).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(dataSource); - - 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().size()).isEqualTo(5); - assertThat(changes.getTablesAtStartPointList().get(0).getSource()).isNull(); - assertThat(changes.getTablesAtStartPointList().get(0).getDataSource()).isSameAs(dataSource); - assertThat(changes.getTablesAtStartPointList().get(0).getName()).isEqualTo("ACTOR"); - assertThat(changes.getTablesAtStartPointList().get(0).getRequest()).isEqualTo("SELECT * FROM ACTOR"); - assertThat(changes.getTablesAtStartPointList().get(1).getSource()).isNull(); - assertThat(changes.getTablesAtStartPointList().get(1).getDataSource()).isSameAs(dataSource); - assertThat(changes.getTablesAtStartPointList().get(1).getName()).isEqualTo("INTERPRETATION"); - assertThat(changes.getTablesAtStartPointList().get(1).getRequest()).isEqualTo("SELECT * FROM INTERPRETATION"); - assertThat(changes.getTablesAtStartPointList().get(2).getSource()).isNull(); - assertThat(changes.getTablesAtStartPointList().get(2).getDataSource()).isSameAs(dataSource); - assertThat(changes.getTablesAtStartPointList().get(2).getName()).isEqualTo("MOVIE"); - assertThat(changes.getTablesAtStartPointList().get(2).getRequest()).isEqualTo("SELECT * FROM MOVIE"); - assertThat(changes.getTablesAtStartPointList().get(3).getSource()).isNull(); - assertThat(changes.getTablesAtStartPointList().get(3).getDataSource()).isSameAs(dataSource); - assertThat(changes.getTablesAtStartPointList().get(3).getName()).isEqualTo("TEST"); - assertThat(changes.getTablesAtStartPointList().get(3).getRequest()).isEqualTo("SELECT * FROM TEST"); - assertThat(changes.getTablesAtStartPointList().get(4).getSource()).isNull(); - assertThat(changes.getTablesAtStartPointList().get(4).getDataSource()).isSameAs(dataSource); - assertThat(changes.getTablesAtStartPointList().get(4).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().size()).isEqualTo(5); - assertThat(changes.getTablesAtStartPointList().get(0).getSource()).isNull(); - assertThat(changes.getTablesAtStartPointList().get(0).getDataSource()).isSameAs(dataSource); - assertThat(changes.getTablesAtStartPointList().get(0).getName()).isEqualTo("ACTOR"); - assertThat(changes.getTablesAtStartPointList().get(0).getRequest()).isEqualTo("SELECT * FROM ACTOR"); - assertThat(changes.getTablesAtStartPointList().get(1).getSource()).isNull(); - assertThat(changes.getTablesAtStartPointList().get(1).getDataSource()).isSameAs(dataSource); - assertThat(changes.getTablesAtStartPointList().get(1).getName()).isEqualTo("INTERPRETATION"); - assertThat(changes.getTablesAtStartPointList().get(1).getRequest()).isEqualTo("SELECT * FROM INTERPRETATION"); - assertThat(changes.getTablesAtStartPointList().get(2).getSource()).isNull(); - assertThat(changes.getTablesAtStartPointList().get(2).getDataSource()).isSameAs(dataSource); - assertThat(changes.getTablesAtStartPointList().get(2).getName()).isEqualTo("MOVIE"); - assertThat(changes.getTablesAtStartPointList().get(2).getRequest()).isEqualTo("SELECT * FROM MOVIE"); - assertThat(changes.getTablesAtStartPointList().get(3).getSource()).isNull(); - assertThat(changes.getTablesAtStartPointList().get(3).getDataSource()).isSameAs(dataSource); - assertThat(changes.getTablesAtStartPointList().get(3).getName()).isEqualTo("TEST"); - assertThat(changes.getTablesAtStartPointList().get(3).getRequest()).isEqualTo("SELECT * FROM TEST"); - assertThat(changes.getTablesAtStartPointList().get(4).getSource()).isNull(); - assertThat(changes.getTablesAtStartPointList().get(4).getDataSource()).isSameAs(dataSource); - assertThat(changes.getTablesAtStartPointList().get(4).getName()).isEqualTo("TEST2"); - assertThat(changes.getTablesAtStartPointList().get(4).getRequest()).isEqualTo("SELECT * FROM TEST2"); - assertThat(changes.getTablesAtEndPointList()).isNotNull(); - assertThat(changes.getTablesAtEndPointList().size()).isEqualTo(5); - assertThat(changes.getTablesAtEndPointList().get(0).getSource()).isNull(); - assertThat(changes.getTablesAtEndPointList().get(0).getDataSource()).isSameAs(dataSource); - assertThat(changes.getTablesAtEndPointList().get(0).getName()).isEqualTo("ACTOR"); - assertThat(changes.getTablesAtEndPointList().get(0).getRequest()).isEqualTo("SELECT * FROM ACTOR"); - assertThat(changes.getTablesAtEndPointList().get(1).getSource()).isNull(); - assertThat(changes.getTablesAtEndPointList().get(1).getDataSource()).isSameAs(dataSource); - assertThat(changes.getTablesAtEndPointList().get(1).getName()).isEqualTo("INTERPRETATION"); - assertThat(changes.getTablesAtEndPointList().get(1).getRequest()).isEqualTo("SELECT * FROM INTERPRETATION"); - assertThat(changes.getTablesAtEndPointList().get(2).getSource()).isNull(); - assertThat(changes.getTablesAtEndPointList().get(2).getDataSource()).isSameAs(dataSource); - assertThat(changes.getTablesAtEndPointList().get(2).getName()).isEqualTo("MOVIE"); - assertThat(changes.getTablesAtEndPointList().get(2).getRequest()).isEqualTo("SELECT * FROM MOVIE"); - assertThat(changes.getTablesAtEndPointList().get(3).getSource()).isNull(); - assertThat(changes.getTablesAtEndPointList().get(3).getDataSource()).isSameAs(dataSource); - assertThat(changes.getTablesAtEndPointList().get(3).getName()).isEqualTo("TEST"); - assertThat(changes.getTablesAtEndPointList().get(3).getRequest()).isEqualTo("SELECT * FROM TEST"); - assertThat(changes.getTablesAtEndPointList().get(4).getSource()).isNull(); - assertThat(changes.getTablesAtEndPointList().get(4).getDataSource()).isSameAs(dataSource); + assertThat(changes.getTablesAtEndPointList().get(4).getConnectionProvider()).isNotNull(); assertThat(changes.getTablesAtEndPointList().get(4).getName()).isEqualTo("TEST2"); assertThat(changes.getTablesAtEndPointList().get(4).getRequest()).isEqualTo("SELECT * FROM TEST2"); } @@ -209,7 +105,7 @@ public void test_constructor_datasource() { */ @Test public void test_constructor_one_table() { - Changes changes = new Changes(new Table(source, "test")); + Changes changes = assertDbConnection.changes().tables(assertDbConnection.table("test").build()).build(); assertThat(changes.getRequestAtStartPoint()).isNull(); assertThat(changes.getRequestAtEndPoint()).isNull(); @@ -217,18 +113,17 @@ public void test_constructor_one_table() { assertThat(changes.getTablesAtStartPointList()).isNull(); changes.setStartPointNow(); assertThat(changes.getTablesAtStartPointList()).isNotNull(); - assertThat(changes.getTablesAtStartPointList().size()).isEqualTo(1); - assertThat(changes.getTablesAtStartPointList().get(0).getSource()).isSameAs(source); - assertThat(changes.getTablesAtStartPointList().get(0).getDataSource()).isNull(); + assertThat(changes.getTablesAtStartPointList()).hasSize(1); + assertThat(changes.getTablesAtStartPointList().get(0).getConnectionProvider()).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"); assertThat(changes.getTablesAtEndPointList()).isNull(); changes.setEndPointNow(); assertThat(changes.getTablesAtEndPointList()).isNotNull(); - assertThat(changes.getTablesAtEndPointList().size()).isEqualTo(1); - assertThat(changes.getTablesAtEndPointList().get(0).getSource()).isSameAs(source); - assertThat(changes.getTablesAtEndPointList().get(0).getDataSource()).isNull(); + assertThat(changes.getTablesAtEndPointList()).hasSize(1); + assertThat(changes.getTablesAtEndPointList().get(0).getConnectionProvider()).isNotNull(); assertThat(changes.getTablesAtEndPointList().get(0).getName()).isEqualTo("TEST"); assertThat(changes.getTablesAtEndPointList().get(0).getRequest()).isEqualTo("SELECT * FROM TEST"); } @@ -238,7 +133,9 @@ public void test_constructor_one_table() { */ @Test public void test_constructor_two_tables() { - Changes changes = new Changes(new Table(source, "test"), new Table(dataSource, "test2")); + Changes changes = assertDbConnection.changes() + .tables(assertDbConnection.table("test").build(), assertDbConnection.table("test2").build()) + .build(); assertThat(changes.getRequestAtStartPoint()).isNull(); assertThat(changes.getRequestAtEndPoint()).isNull(); @@ -246,26 +143,22 @@ public void test_constructor_two_tables() { assertThat(changes.getTablesAtStartPointList()).isNull(); changes.setStartPointNow(); assertThat(changes.getTablesAtStartPointList()).isNotNull(); - assertThat(changes.getTablesAtStartPointList().size()).isEqualTo(2); - assertThat(changes.getTablesAtStartPointList().get(0).getSource()).isSameAs(source); - assertThat(changes.getTablesAtStartPointList().get(0).getDataSource()).isNull(); + assertThat(changes.getTablesAtStartPointList()).hasSize(2); + assertThat(changes.getTablesAtStartPointList().get(0)).isNotNull(); assertThat(changes.getTablesAtStartPointList().get(0).getName()).isEqualTo("TEST"); assertThat(changes.getTablesAtStartPointList().get(0).getRequest()).isEqualTo("SELECT * FROM TEST"); - assertThat(changes.getTablesAtStartPointList().get(1).getSource()).isNull(); - assertThat(changes.getTablesAtStartPointList().get(1).getDataSource()).isSameAs(dataSource); + assertThat(changes.getTablesAtStartPointList().get(1).getName()).isNotNull(); assertThat(changes.getTablesAtStartPointList().get(1).getName()).isEqualTo("TEST2"); assertThat(changes.getTablesAtStartPointList().get(1).getRequest()).isEqualTo("SELECT * FROM TEST2"); assertThat(changes.getTablesAtEndPointList()).isNull(); changes.setEndPointNow(); assertThat(changes.getTablesAtEndPointList()).isNotNull(); - assertThat(changes.getTablesAtEndPointList().size()).isEqualTo(2); - assertThat(changes.getTablesAtEndPointList().get(0).getSource()).isSameAs(source); - assertThat(changes.getTablesAtEndPointList().get(0).getDataSource()).isNull(); + assertThat(changes.getTablesAtEndPointList()).hasSize(2); + assertThat(changes.getTablesAtEndPointList().get(0).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).getSource()).isNull(); - assertThat(changes.getTablesAtEndPointList().get(1).getDataSource()).isSameAs(dataSource); + 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"); } @@ -275,7 +168,7 @@ public void test_constructor_two_tables() { */ @Test public void test_constructor_request() { - Changes changes = new Changes(new Request(source, "select * from test")); + Changes changes = assertDbConnection.changes().request(assertDbConnection.request("select * from test").build()).build(); assertThat(changes.getRequestAtStartPoint()).isNull(); assertThat(changes.getRequestAtEndPoint()).isNull(); @@ -285,7 +178,7 @@ public void test_constructor_request() { changes.setStartPointNow(); assertThat(changes.getRequestAtStartPoint()).isNotNull(); - assertThat(changes.getRequestAtStartPoint().getSource()).isSameAs(source); + assertThat(changes.getRequestAtStartPoint().getConnectionProvider()).isNotNull(); assertThat(changes.getRequestAtStartPoint().getRequest()).isEqualTo("select * from test"); assertThat(changes.getRequestAtEndPoint()).isNull(); assertThat(changes.getTablesAtStartPointList()).isNull(); @@ -295,7 +188,7 @@ public void test_constructor_request() { assertThat(changes.getRequestAtStartPoint()).isNotNull(); assertThat(changes.getRequestAtEndPoint()).isNotNull(); - assertThat(changes.getRequestAtEndPoint().getSource()).isSameAs(source); + 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 d3976a17..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 @@ -27,9 +27,10 @@ import org.junit.Test; /** - * Tests on the exceptions of Changes + * Tests on the exceptions to the Changes * * @author Régis Pouiller + * @author Julien Roy */ public class Changes_Exception_Test extends AbstractTest { @@ -38,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() { - DataSource ds = new DefaultDataSource(dataSource); - Table table = new Table(ds, "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(); } @@ -62,8 +63,9 @@ public DatabaseMetaData getMetaData() throws SQLException { }; } }; - Table table = new Table(ds, "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(); } @@ -91,8 +93,9 @@ public ResultSet executeQuery(String sql) throws SQLException { }; } }; - Table table = new Table(ds, "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(); } @@ -113,8 +116,9 @@ public DatabaseMetaData getMetaData() throws SQLException { }; } }; - Table table = new Table(ds, "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(); } @@ -135,8 +139,9 @@ public Statement createStatement() throws SQLException { }; } }; - Table table = new Table(ds, "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(); } @@ -151,34 +156,19 @@ public Connection getConnection() throws SQLException { throw new SQLException(); } }; - Table table = new Table(ds, "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(dataSource, "test"); - Changes changes = new Changes().setTables(table); + Table table = assertDbConnection.table("test").build(); + Changes changes = assertDbConnection.changes().tables(table).build(); changes.setEndPointNow(); } @@ -187,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(dataSource, "test"); - Changes changes = new Changes().setTables(table); + Table table = assertDbConnection.table("test").build(); + Changes changes = assertDbConnection.changes().tables(table).build(); changes.setStartPointNow(); changes.getChangesList(); } @@ -198,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(source).getChangesOfTable(null); + assertDbConnection.changes().build().getChangesOfTable(null); } /** @@ -206,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(source).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 2f15ca14..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 @@ -25,7 +25,8 @@ /** * Tests on the {@code getChangesOfTable} method. * - * @author Régis Pouiller. + * @author Régis Pouiller + * @author Julien Roy. */ public class Changes_GetChangesOfTable_Test extends AbstractTest { @@ -35,11 +36,10 @@ public class Changes_GetChangesOfTable_Test extends AbstractTest { @Test @NeedReload public void test_getChangesOfTable() { - Changes changesSource = new Changes(source); - Changes changesRequest = new Changes(new Request(source, - "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 d95f5d4d..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 @@ -25,7 +25,8 @@ /** * Tests on the {@code getChangesOfType} method. * - * @author Régis Pouiller. + * @author Régis Pouiller + * @author Julien Roy. */ public class Changes_GetChangesOfType_Test extends AbstractTest { @@ -35,11 +36,10 @@ public class Changes_GetChangesOfType_Test extends AbstractTest { @Test @NeedReload public void test_getChangesOfTable() { - Changes changesSource = new Changes(source); - Changes changesRequest = new Changes(new Request(source, - "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 fd3aab9e..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 @@ -24,7 +24,8 @@ /** * Tests on the {@code getChangesOfTable} and {@code getChangesOfType} methods together. * - * @author Régis Pouiller. + * @author Régis Pouiller + * @author Julien Roy. */ public class Changes_GetChanges_Test extends AbstractTest { @@ -34,7 +35,7 @@ public class Changes_GetChanges_Test extends AbstractTest { @Test @NeedReload public void test_getChangesOfTableAndType() { - Changes changesSource = new Changes(source); + Changes changesSource = assertDbConnection.changes().build(); changesSource.setStartPointNow(); updateChangesForTests(); @@ -65,7 +66,7 @@ public void test_getChangesOfTableAndType() { @Test @NeedReload public void test_getChangesOfTypeAndTable() { - Changes changesSource = new Changes(source); + 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 b7a158f2..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(dataSource, "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(dataSource, "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(dataSource, "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(dataSource, "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(dataSource, "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(dataSource, "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(dataSource, "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(dataSource, "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 b1f7e3bf..00000000 --- a/src/test/java/org/assertj/db/type/Changes_SetTables_Test.java +++ /dev/null @@ -1,33 +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 - */ -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(source); - changes.setTables(); - } -} diff --git a/src/test/java/org/assertj/db/type/Changes_Table_GetChangesList_Test.java b/src/test/java/org/assertj/db/type/Changes_Table_GetChangesList_Test.java index b0cff50f..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 @@ -29,7 +29,8 @@ /** * Tests on the list of changes on tables. * - * @author Régis Pouiller. + * @author Régis Pouiller + * @author Julien Roy. */ public class Changes_Table_GetChangesList_Test extends AbstractTest { @@ -38,7 +39,7 @@ public class Changes_Table_GetChangesList_Test extends AbstractTest { */ @Test public void test_when_there_is_no_change() { - Changes changes = new Changes(source); + Changes changes = assertDbConnection.changes().build(); changes.setStartPointNow(); changes.setEndPointNow(); assertThat(changes.getChangesList()).hasSize(0); @@ -51,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(source, "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(); @@ -66,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(source); + 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(); @@ -105,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(source); + public void test_when_there_is_creation_change() { + Changes changes = assertDbConnection.changes().build(); changes.setStartPointNow(); update("insert into test2(VAR1) values(200)"); changes.setEndPointNow(); @@ -145,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(source); + 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(); @@ -217,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(source); + 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(); @@ -245,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(source, "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(); @@ -272,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(source, "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/DataSourceWithLetterCase_Test.java b/src/test/java/org/assertj/db/type/DataSourceWithLetterCase_Test.java deleted file mode 100644 index 4727575d..00000000 --- a/src/test/java/org/assertj/db/type/DataSourceWithLetterCase_Test.java +++ /dev/null @@ -1,186 +0,0 @@ -/* - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - * - * Copyright 2015-2024 the original author or authors. - */ -package org.assertj.db.type; - -import static org.assertj.core.api.Assertions.assertThat; - -import java.io.PrintWriter; -import java.sql.Connection; -import java.sql.SQLException; -import java.sql.SQLFeatureNotSupportedException; -import java.util.logging.Logger; -import javax.sql.DataSource; - -import org.assertj.db.common.AbstractTest; -import org.assertj.db.common.DefaultConnection; -import org.assertj.db.type.lettercase.LetterCase; -import org.junit.Before; -import org.junit.Test; - -/** - * Tests on the {@code DataSourceWithLetterCase_Test}. - * - * @author Régis Pouiller - */ -public class DataSourceWithLetterCase_Test extends AbstractTest { - - private DataSource delegate; - - ; - private DataSourceWithLetterCase dataSourceWithLetterCase; - - @Before - public void init() throws SQLException { - delegate = new MyDataSource(dataSource); - dataSourceWithLetterCase = new DataSourceWithLetterCase(delegate, LetterCase.TABLE_DEFAULT, LetterCase.COLUMN_DEFAULT, LetterCase.PRIMARY_KEY_DEFAULT); - } - - /** - * This method test the {@code getConnection} method. - * - * @throws SQLException - */ - @Test - public void test_getConnection() throws SQLException { - assertThat(dataSourceWithLetterCase.getConnection()).isSameAs(delegate.getConnection()); - assertThat(dataSourceWithLetterCase.getConnection("SA", "")).isSameAs(delegate.getConnection("SA", "")); - } - - /** - * This method test the {@code getLogWriter} and {@code setLogWriter} method. - * - * @throws SQLException - */ - @Test - public void test_LogWriter() throws SQLException { - assertThat(dataSourceWithLetterCase.getLogWriter()).isSameAs(delegate.getLogWriter()); - PrintWriter printWriter = new PrintWriter(System.out); - dataSourceWithLetterCase.setLogWriter(printWriter); - assertThat(dataSourceWithLetterCase.getLogWriter()).isSameAs(delegate.getLogWriter()).isSameAs(printWriter); - } - - /** - * This method test the {@code getLoginTimeout} and {@code setLoginTimeout} method. - * - * @throws SQLException - */ - @Test - public void test_LoginTimeout() throws SQLException { - assertThat(dataSourceWithLetterCase.getLoginTimeout()).isEqualTo(delegate.getLoginTimeout()).isEqualTo(0); - dataSourceWithLetterCase.setLoginTimeout(10); - assertThat(dataSourceWithLetterCase.getLoginTimeout()).isEqualTo(delegate.getLoginTimeout()).isEqualTo(10); - } - - /** - * This method test the {@code getParentLogger} method. - * - * @throws SQLException - */ - @Test - public void test_getParentLogger() throws SQLException { - assertThat(dataSourceWithLetterCase.getParentLogger()).isSameAs(delegate.getParentLogger()); - } - - /** - * This method test the {@code isWrapperFor} method. - * - * @throws SQLException - */ - @Test - public void test_isWrapperFor() throws SQLException { - assertThat(dataSourceWithLetterCase.isWrapperFor(Boolean.class)).isEqualTo(delegate.isWrapperFor(Boolean.class)).isTrue(); - assertThat(dataSourceWithLetterCase.isWrapperFor(Integer.class)).isEqualTo(delegate.isWrapperFor(Integer.class)).isFalse(); - } - - /** - * This method test the {@code unwrap} method. - * - * @throws SQLException - */ - @Test - public void test_unwrap() throws SQLException { - assertThat(dataSourceWithLetterCase.unwrap(Boolean.class)).isEqualTo(delegate.unwrap(Boolean.class)).isTrue(); - assertThat(dataSourceWithLetterCase.unwrap(String.class)).isEqualTo(delegate.unwrap(String.class)).isEqualTo("test"); - assertThat(dataSourceWithLetterCase.unwrap(Integer.class)).isEqualTo(delegate.unwrap(Integer.class)).isNull(); - } - - private static class MyDataSource implements DataSource { - - private Connection connection; - private int loginTimeout; - private PrintWriter printWriter; - private Logger logger; - - private MyDataSource(DataSource dataSource) throws SQLException { - connection = new DefaultConnection(dataSource.getConnection()); - loginTimeout = 0; - printWriter = new PrintWriter(System.out); - logger = Logger.getGlobal(); - } - - @Override - public PrintWriter getLogWriter() throws SQLException { - return printWriter; - } - - @Override - public void setLogWriter(PrintWriter arg0) throws SQLException { - printWriter = arg0; - } - - @Override - public int getLoginTimeout() throws SQLException { - return loginTimeout; - } - - @Override - public void setLoginTimeout(int arg0) throws SQLException { - loginTimeout = arg0; - } - - @Override - public Logger getParentLogger() throws SQLFeatureNotSupportedException { - return logger; - } - - @Override - public boolean isWrapperFor(Class arg0) throws SQLException { - if (Boolean.class.equals(arg0)) { - return true; - } - return false; - } - - @SuppressWarnings("unchecked") - @Override - public T unwrap(Class iface) throws SQLException { - if (Boolean.class.equals(iface)) { - return (T) Boolean.TRUE; - } else if (String.class.equals(iface)) { - return (T) "test"; - } - return null; - } - - @Override - public Connection getConnection() throws SQLException { - return connection; - } - - @Override - public Connection getConnection(String arg0, String arg1) throws SQLException { - return connection; - } - - } -} diff --git a/src/test/java/org/assertj/db/type/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 e028986e..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 @@ -25,20 +25,20 @@ *

* * @author Régis Pouiller + * @author Julien Roy */ public class Request_Columns_Name_Test extends AbstractTest { /** - * This method test the columns name got from a {@code Source}. + * This method test the columns name got from a {@code ConnectionProvider}. */ @Test - public void test_columns_name_with_source_set() { - Request request = new Request(source, - "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) @@ -46,53 +46,19 @@ public void test_columns_name_with_source_set() { } /** - * This method test the columns name got from a {@code DataSource}. + * This method test the columns name got from a {@code ConnectionProvider}. */ @Test - public void test_columns_name_with_datasource_set() { - Request request = new Request(dataSource, - "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 Source}. - */ - @Test - public void test_columns_name_with_source_and_parameters_set() { - Request request = new Request(source, - "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(dataSource, - "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) @@ -105,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(dataSource, "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 eccb77c9..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}. *

@@ -24,19 +24,20 @@ *

* * @author Régis Pouiller + * @author Julien Roy */ public class Request_Columns_Test extends AbstractTest { /** - * This method test the columns got from a {@code Source}. + * This method test the columns got from a {@code ConnectionProvider}. */ @Test - public void test_columns_with_source_set() { - Request request = new Request(source, "SELECT actor.name, actor.firstname, movie.year, interpretation.character " + public void test_columns() { + 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); @@ -54,11 +55,11 @@ public void test_columns_with_source_set() { */ @Test public void test_columns_with_datasource_set() { - Request request = new Request(dataSource, "SELECT actor.name, actor.firstname, movie.year, interpretation.character " + Request request = 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 1d84eba3..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,23 +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(dataSource, "select var1 from test").setPksName("var2").getRowsList(); - } - - /** - * This method should fail because setting the datasource to null. - */ - @Test(expected = NullPointerException.class) - public void should_fail_because_setting_datasource_to_null() { - new Request().setDataSource(null); - } - - /** - * This method should fail because setting the source to null. - */ - @Test(expected = NullPointerException.class) - public void should_fail_because_setting_source_to_null() { - new Request().setSource(null); + assertDbConnection.request("select var1 from test").pksName("var2").build().getRowsList(); } /** @@ -63,7 +47,8 @@ public void should_fail_because_setting_source_to_null() { @Test(expected = AssertJDBException.class) public void should_fail_because_connection_throws_exception_when_getting_an_object() { DataSource ds = new DefaultDataSource(dataSource); - Request request = new Request(ds, "select * from movi where id = ?", 1); + AssertDbConnection connection = AssertDbConnectionFactory.of(ds).create(); + Request request = connection.request("select * from movi where id = ?").parameters(1).build(); request.getColumnsNameList(); } @@ -90,7 +75,8 @@ public ResultSet executeQuery() throws SQLException { }; } }; - Request request = new Request(ds, "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(); } @@ -111,7 +97,8 @@ public DatabaseMetaData getMetaData() throws SQLException { }; } }; - Request request = new Request(ds, "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(); } @@ -132,7 +119,8 @@ public PreparedStatement prepareStatement(String sql) throws SQLException { }; } }; - Request request = new Request(ds, "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(); } @@ -147,7 +135,8 @@ public Connection getConnection() throws SQLException { throw new SQLException(); } }; - Request request = new Request(ds, "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 de1f9f22..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 @@ -23,6 +23,7 @@ * Tests on getting a {@code Row} in a {@code Request} from primary keys values. * * @author Régis Pouiller + * @author Julien Roy */ public class Request_GetRowFromPksValues_Test extends AbstractTest { @@ -31,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(source, - "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(); @@ -50,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(source, - "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"); @@ -66,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"); @@ -74,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 2ea0da6f..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 @@ -24,49 +24,22 @@ *

* * @author Régis Pouiller + * @author Julien Roy */ public class Request_Getters_Test extends AbstractTest { /** - * This method test the getters of a {@code Table} when only the source is set. + * This method test the getters of a {@code Table} when the jdbc connection and the name are set. */ @Test - public void test_getters_with_only_source_set() { - Request request = new Request().setSource(source); - - assertThat(request.getSource()).isSameAs(source); - assertThat(request.getDataSource()).isNull(); - assertThat(request.getRequest()).isNull(); - assertThat(request.getParameters()).isNull(); - } - - /** - * This method test the getters of a {@code Table} when only the datasource is set. - */ - @Test - public void test_getters_with_only_datasource_set() { - Request request = new Request().setDataSource(dataSource); - - assertThat(request.getSource()).isNull(); - assertThat(request.getDataSource()).isSameAs(dataSource); - assertThat(request.getRequest()).isNull(); - assertThat(request.getParameters()).isNull(); - } - - /** - * This method test the getters of a {@code Table} when the source and the name are set. - */ - @Test - public void test_getters_with_source_and_name_set() { - Request request = new Request(source, - "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.getSource()).as("Source of MOVIE table").isSameAs(source); - assertThat(request.getDataSource()).isNull(); + 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" @@ -76,21 +49,22 @@ public void test_getters_with_source_and_name_set() { } /** - * This method test the getters of a {@code Table} when the source, the name and the information about the columns + * This method test the getters of a {@code Table} when the jdbc connection, the name and the information about the columns * are set. */ @Test - public void test_getters_with_source_name_and_columns_set() { - Request request = new Request(source, - "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.getSource()).as("Source of MOVIE table").isSameAs(source); - assertThat(request.getDataSource()).isNull(); + 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 7c6d2341..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 @@ -12,8 +12,6 @@ */ package org.assertj.db.type; -import javax.sql.DataSource; - import org.assertj.db.common.AbstractTest; import org.assertj.db.exception.AssertJDBException; import org.junit.Test; @@ -25,77 +23,25 @@ *

* * @author Régis Pouiller + * @author Julien Roy */ public class Request_Instantiation_Test extends AbstractTest { /** - * This method should throw a {@code NullPointerException}, because the {@code Source} parameter is {@code null}. - */ - @Test(expected = NullPointerException.class) - public void should_throw_NullPointerException_if_instantiate_with_Source_null() { - new Request((Source) null, null); - } - - /** - * This method should throw a {@code NullPointerException}, because the {@code DataSource} parameter is {@code null}. - */ - @Test(expected = NullPointerException.class) - public void should_throw_NullPointerException_if_instantiate_with_DataSource_null() { - new Request((DataSource) null, null); - } - - /** - * This method should throw a {@code NullPointerException}, because the {@code Source} parameter is not {@code null} - * and request is {@code null}. - */ - @Test(expected = NullPointerException.class) - public void should_throw_NullPointerException_if_instantiate_with_Source_not_null_and_table_name_null() { - new Request(source, null); - } - - /** - * This method should throw a {@code NullPointerException}, because the {@code DataSource} parameter is {@code null} - * and request is {@code null}. - */ - @Test(expected = NullPointerException.class) - public void should_throw_NullPointerException_if_instantiate_with_DataSource_not_null_and_table_name_null() { - new Request(dataSource, null); - } - - /** - * This method should throw a {@code NullPointerException}, because the {@code DataSource} and the {@code Source} - * fields are not set when call {@code getColumnsNameList()}. - */ - @Test(expected = NullPointerException.class) - public void should_throw_NullPointerException_if_get_list_of_columns_name_without_setting_source_or_datasource() { - new Request().getColumnsNameList(); - } - - /** - * This method should throw a {@code NullPointerException}, because the {@code Source} field is set but not the table - * name when call {@code getColumnsNameList()}. - */ - @Test(expected = NullPointerException.class) - public void should_throw_NullPointerException_if_get_list_of_columns_name_with_setting_source_and_without_setting_table_name() { - new Request().setSource(source).getColumnsNameList(); - } - - /** - * This method should throw a {@code NullPointerException}, because the {@code DataSource} field is set but not the - * table name when call {@code getColumnsNameList()}. + * This method should throw a {@code IllegalArgumentException}, because request is {@code null}. */ - @Test(expected = NullPointerException.class) - public void should_throw_NullPointerException_if_get_list_of_columns_name_with_setting_datasource_and_without_setting_table_name() { - new Request().setDataSource(dataSource).getColumnsNameList(); + @Test(expected = IllegalArgumentException.class) + public void should_throw_IllegalArgumentException_if_instantiate_with_table_name_null() { + assertDbConnection.request(null).build(); } /** - * This method should throw a {@code AssertJDBException}, because the {@code Source} field is set but not - * all the information of the {@code Source}. + * This method should throw a {@code AssertJDBException}, because the {@code ConnectionProvider} field is set but not + * all the information of the {@code ConnectionProvider}. */ @Test(expected = AssertJDBException.class) - public void should_throw_AssertJDBException_if_get_list_of_rows_with_setting_source_having_bad_user() { - Request request = new Request(new Source(source.getUrl(), "", ""), ""); + public void should_throw_AssertJDBException_if_get_list_of_rows_with_setting_connection_provider_having_bad_user() { + Request request = 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 dbd70b90..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 @@ -25,53 +25,35 @@ *

* * @author Régis Pouiller + * @author Julien Roy */ public class Request_PrimaryKeys_Name_Test extends AbstractTest { /** - * This method test the primary keys name got from a {@code Source}. + * This method test the primary keys name got from a {@code JdbcUrlConnectionProvider}. */ @Test - public void test_pks_name_with_source_set_but_not_primary_keys() { - Request request = new Request(source, - "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_pks_name_with_jdbc_set_but_not_primary_keys() { + 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); } /** - * This method test the primary keys name got from a {@code Source}. - */ - @Test - public void test_pks_name_with_source_set() { - Request request = new Request(source, - "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 DataSource}. + * This method test the primary keys name got from a {@code JdbcUrlConnectionProvider}. */ @Test - public void test_pks_name_with_datasource_set() { - Request request = new Request(dataSource, - "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) @@ -79,17 +61,20 @@ public void test_pks_name_with_datasource_set() { } /** - * This method test the primary keys name got from a {@code Source}. + * This method test the primary keys name got from a {@code DataSourceConnectionProvider}. */ @Test - public void test_pks_name_with_source_and_parameters_set() { - Request request = new Request(source, - "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) @@ -97,18 +82,19 @@ public void test_pks_name_with_source_and_parameters_set() { } /** - * This method test the primary keys name got from a {@code DataSource}. + * This method test the primary keys name got from a {@code DataSourceConnectionProvider}. */ @Test public void test_pks_name_with_datasource_and_parameters_set() { - Request request = new Request(dataSource, - "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) @@ -121,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(dataSource, "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 2e6c5e5c..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 @@ -26,19 +26,20 @@ *

* * @author Régis Pouiller + * @author Julien Roy */ public class Request_Rows_Test extends AbstractTest { /** - * This method test the rows got from a {@code Source}. + * This method test the rows got from a {@code ConnectionProvider}. */ @Test - public void test_rows_with_source_set() { - Request request = new Request(source, "SELECT actor.name, actor.firstname, movie.year, interpretation.character " + public void test_rows() { + 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); @@ -69,51 +70,16 @@ public void test_rows_with_source_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(dataSource, "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(dataSource, "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); } @@ -122,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(dataSource, "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 8a0fa849..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 @@ -25,74 +25,43 @@ *

* * @author Régis Pouiller + * @author Julien Roy */ public class Table_Columns_Name_Test extends AbstractTest { /** - * This method test the columns got from a {@code Source}. + * This method test the columns got from a {@code Connection}. */ @Test - public void test_columns_name_with_source_set() { - Table table = new Table(source, "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(dataSource, "movie"); - - assertThat(table.getColumnsNameList()).as("Columns of MOVIE table").hasSize(4) - .containsExactly("ID", "TITLE", "YEAR", "MOVIE_IMDB"); - } - - /** - * This method test the columns got from a {@code Source} when the columns to check are set. - */ - @Test - public void test_columns_name_to_check_with_source_set() { - Table table = new Table(source, "actor", new String[]{"id", "name", "birth"}, null); + public void test_columns_name_to_check() { + 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(dataSource, "actor", new String[]{"id", "name", "birth"}, null); - - assertThat(table.getColumnsNameList()).as("Columns of ACTOR table").hasSize(3) - .containsExactly("ID", "NAME", "BIRTH"); - } - - /** - * This method test the columns got from a {@code Source} when the columns to exclude are set. - */ - @Test - public void test_columns_name_to_exclude_with_source_set() { - Table table = new Table(source, "interpretation", null, new String[]{"id"}); + public void test_columns_name_to_exclude() { + 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(dataSource, "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 @@ -100,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(dataSource, "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 bf2aea18..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 @@ -25,31 +25,16 @@ *

* * @author Régis Pouiller + * @author Julien Roy */ public class Table_Columns_Test extends AbstractTest { /** - * This method test the columns got from a {@code Source}. + * This method test the columns got from a {@code ConnectionProvider}. */ @Test - public void test_columns_with_source_set() { - Table table = new Table(source, "movie"); - - 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(dataSource, "movie"); + public void test_columns() { + Table table = assertDbConnection.table("movie").build(); Column columnFromIndex = table.getColumn(1); @@ -65,14 +50,16 @@ public void test_columns_with_datasource_set() { */ @Test public void test_columns_to_check() { - Table table = new Table(source, "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"); } /** @@ -80,14 +67,17 @@ public void test_columns_to_check() { */ @Test public void test_columns_to_exclude() { - Table table = new Table(source, "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"); } /** @@ -95,13 +85,15 @@ public void test_columns_to_exclude() { */ @Test public void test_columns_to_order() { - Table table = new Table(source, "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 1aa2364b..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,113 +19,20 @@ 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; /** * Test on loading of the data for a table and exception during the different steps. * * @author Régis Pouiller + * @author Julien Roy */ public class Table_Exception_Test extends AbstractTest { - - /** - * This method should fail because setting the datasource to null. - */ - @Test(expected = NullPointerException.class) - public void should_fail_because_setting_datasource_to_null() { - new Table().setDataSource(null); - } - - /** - * This method should fail because setting the source to null. - */ - @Test(expected = NullPointerException.class) - public void should_fail_because_setting_source_to_null() { - new Table().setSource(null); - } - - /** - * 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); - Table table = new Table(ds, "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(String.format("The table name and the source or datasource 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(String.format("The table name and the source or datasource 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(String.format("The table name and the source or datasource 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(source, "test").setColumnsToOrder(new Order[]{null}); - fail("An exception must be raised"); - } catch (NullPointerException e) { - Assertions.assertThat(e.getMessage()).isEqualTo(String.format("The order can not be null")); - } - } - - /** - * 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(source, "test").setColumnsToOrder(new Order[]{Order.asc(null)}); - fail("An exception must be raised"); - } catch (NullPointerException e) { - Assertions.assertThat(e.getMessage()).isEqualTo(String.format("The name of the column for order can not be null")); - } - } - /** * This method should fail because the connection throw an exception when executing a query. */ @@ -151,7 +56,8 @@ public ResultSet executeQuery(String sql) throws SQLException { }; } }; - Table table = new Table(ds, "movi"); + AssertDbConnection connectionProvider = AssertDbConnectionFactory.of(ds).create(); + Table table = connectionProvider.table("movi").build(); table.getColumnsNameList(); } @@ -172,7 +78,8 @@ public DatabaseMetaData getMetaData() throws SQLException { }; } }; - Table table = new Table(ds, "movi"); + AssertDbConnection connectionProvider = AssertDbConnectionFactory.of(ds).create(); + Table table = connectionProvider.table("movi").build(); table.getColumnsNameList(); } @@ -193,7 +100,8 @@ public Statement createStatement() throws SQLException { }; } }; - Table table = new Table(ds, "movi"); + AssertDbConnection connectionProvider = AssertDbConnectionFactory.of(ds).create(); + Table table = connectionProvider.table("movi").build(); table.getColumnsNameList(); } @@ -208,7 +116,8 @@ public Connection getConnection() throws SQLException { throw new SQLException(); } }; - Table table = new Table(ds, "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 07c2ca09..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 @@ -24,6 +24,7 @@ * Tests on getting a {@code Row} in a {@code Table} from primary keys values. * * @author Régis Pouiller + * @author Julien Roy */ public class Table_GetRowFromPksValues_Test extends AbstractTest { @@ -32,7 +33,7 @@ public class Table_GetRowFromPksValues_Test extends AbstractTest { */ @Test public void test_getting_row_from_primary_keys_values_without_finding() throws Exception { - Table table = new Table(source, "movie"); + Table table = assertDbConnection.table("movie").build(); assertThat(table.getRowFromPksValues()).isNull(); assertThat(table.getRowFromPksValues(getValue(null, 1L), getValue(null, 3))).isNull(); @@ -43,7 +44,7 @@ public void test_getting_row_from_primary_keys_values_without_finding() throws E */ @Test public void test_getting_row_from_primary_keys_values_with_finding() throws Exception { - Table table = new Table(source, "movie"); + Table table = 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 770b6c76..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 @@ -26,82 +26,18 @@ *

* * @author Régis Pouiller + * @author Julien Roy */ public class Table_Getters_Test extends AbstractTest { /** - * This method test the getters of a {@code Table} when only the source is set. + * This method test the getters of a {@code Table} when the connection provider and the name are set. */ @Test - public void test_getters_with_only_source_set() { - Table table = new Table().setSource(source); + public void test_getters_with_connection_provider_and_name_set() { + Table table = assertDbConnection.table("movie").build(); - assertThat(table.getSource()).as("Source of MOVIE table").isSameAs(source); - assertThat(table.getDataSource()).isNull(); - assertThat(table.getName()).isNull(); - assertThat(table.getColumnsToCheck()).isNull(); - assertThat(table.getColumnsToExclude()).isNull(); - assertThat(table.getStartDelimiter()).isNull(); - assertThat(table.getEndDelimiter()).isNull(); - } - - /** - * This method test the getters of a {@code Table} when only the datasource is set. - */ - @Test - public void test_getters_with_only_datasource_set() { - Table table = new Table().setDataSource(dataSource); - - assertThat(table.getSource()).isNull(); - assertThat(table.getDataSource()).as("DataSource of MOVIE table").isSameAs(dataSource); - assertThat(table.getName()).isNull(); - assertThat(table.getColumnsToCheck()).isNull(); - assertThat(table.getColumnsToExclude()).isNull(); - assertThat(table.getStartDelimiter()).isNull(); - assertThat(table.getEndDelimiter()).isNull(); - } - - /** - * This method test the getters of a {@code Table} when only the source is set after the datasource was set. - */ - @Test - public void test_getters_with_only_datasource_set_and_after_only_source_set() { - Table table = new Table().setDataSource(dataSource).setSource(source); - - assertThat(table.getSource()).as("Source of MOVIE table").isSameAs(source); - assertThat(table.getDataSource()).isNull(); - assertThat(table.getName()).isNull(); - assertThat(table.getColumnsToCheck()).isNull(); - assertThat(table.getColumnsToExclude()).isNull(); - assertThat(table.getStartDelimiter()).isNull(); - assertThat(table.getEndDelimiter()).isNull(); - } - - /** - * This method test the getters of a {@code Table} when only the datasource is set after the source was set. - */ - @Test - public void test_getters_with_only_source_set_and_after_only_datasource_set() { - Table table = new Table().setSource(source).setDataSource(dataSource); - - assertThat(table.getSource()).isNull(); - assertThat(table.getDataSource()).as("DataSource of MOVIE table").isSameAs(dataSource); - assertThat(table.getName()).isNull(); - assertThat(table.getColumnsToCheck()).isNull(); - assertThat(table.getColumnsToExclude()).isNull(); - assertThat(table.getStartDelimiter()).isNull(); - assertThat(table.getEndDelimiter()).isNull(); - } - - /** - * This method test the getters of a {@code Table} when the source and the name are set. - */ - @Test - public void test_getters_with_source_and_name_set() { - Table table = new Table(source, "movie"); - - assertThat(table.getSource()).as("Source of MOVIE table").isSameAs(source); - assertThat(table.getDataSource()).isNull(); + assertThat(table.getConnectionProvider()).as("Source of MOVIE table").isNotNull(); assertThat(table.getName()).isEqualTo("MOVIE"); assertThat(table.getColumnsToCheck()).isNull(); assertThat(table.getColumnsToExclude()).isNull(); @@ -111,15 +47,17 @@ public void test_getters_with_source_and_name_set() { } /** - * This method test the getters of a {@code Table} when the source, the name and the information about the columns + * This method test the getters of a {@code Table} when the connection provider, the name and the information about the columns * are set. */ @Test - public void test_getters_with_source_name_and_columns_set() { - Table table = new Table(source, "movie", new String[]{"title", "year"}, new String[]{"id"}); + public void test_getters_with_connection_provider_name_and_columns_set() { + Table table = assertDbConnection.table("movie") + .columnsToCheck(new String[]{"title", "year"}) + .columnsToExclude(new String[]{"id"}) + .build(); - assertThat(table.getSource()).as("Source of MOVIE table").isSameAs(source); - assertThat(table.getDataSource()).isNull(); + 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"); @@ -129,17 +67,18 @@ public void test_getters_with_source_name_and_columns_set() { } /** - * This method test the getters of a {@code Table} when the source, the name and the information about the columns + * This method test the getters of a {@code Table} when the connection provider, the name and the information about the columns * and the orders are set. */ @Test - public void test_getters_with_source_name_columns_and_order_set() { - Table table = new Table(source, "movie", - new Table.Order[]{asc("title"), desc("year")}, - new String[]{"title", "year"}, new String[]{"id"}); - - assertThat(table.getSource()).as("Source of MOVIE table").isSameAs(source); - assertThat(table.getDataSource()).isNull(); + public void test_getters_with_connection_provider_name_columns_and_order_set() { + 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").isNotNull(); assertThat(table.getName()).isEqualTo("MOVIE"); assertThat(table.getColumnsToCheck()).containsExactly("TITLE", "YEAR"); assertThat(table.getColumnsToExclude()).containsExactly("ID"); @@ -150,16 +89,16 @@ public void test_getters_with_source_name_columns_and_order_set() { } /** - * This method test the getters of a {@code Table} when the source, the name and the information about the orders + * This method test the getters of a {@code Table} when the connection provider, the name and the information about the orders * are set. */ @Test - public void test_getters_with_source_name_and_order_set() { - Table table = new Table(source, "movie", - new Table.Order[]{asc("title"), desc("year")}); + public void test_getters_with_connection_provider_name_and_order_set() { + Table table = assertDbConnection.table("movie") + .columnsToOrder(new Table.Order[]{asc("title"), desc("year")}) + .build(); - assertThat(table.getSource()).as("Source of MOVIE table").isSameAs(source); - assertThat(table.getDataSource()).isNull(); + assertThat(table.getConnectionProvider()).as("Source of MOVIE table").isNotNull(); assertThat(table.getName()).isEqualTo("MOVIE"); assertThat(table.getColumnsToCheck()).isNull(); assertThat(table.getColumnsToExclude()).isNull(); @@ -170,14 +109,13 @@ public void test_getters_with_source_name_and_order_set() { } /** - * This method test the getters of a {@code Table} when the source, delimiteres and the name are set. + * This method test the getters of a {@code Table} when the connection provider, delimiters and the name are set. */ @Test - public void test_getters_with_source_delimiters_and_name_set() { - Table table = new Table(source, "movie", '1', '2'); + public void test_getters_with_connection_provider_delimiters_and_name_set() { + Table table = assertDbConnection.table("movie").delimiters('1', '2').build(); - assertThat(table.getSource()).as("Source of MOVIE table").isSameAs(source); - assertThat(table.getDataSource()).isNull(); + assertThat(table.getConnectionProvider()).as("Source of MOVIE table").isNotNull(); assertThat(table.getName()).isEqualTo("MOVIE"); assertThat(table.getColumnsToCheck()).isNull(); assertThat(table.getColumnsToExclude()).isNull(); @@ -187,16 +125,17 @@ public void test_getters_with_source_delimiters_and_name_set() { } /** - * This method test the getters of a {@code Table} when the source, the name, the delimiters + * This method test the getters of a {@code Table} when the connection provider, the name, the delimiters * and the information about the columns are set. */ @Test - public void test_getters_with_source_name_delimiters_and_columns_set() { - Table table = new Table(source, "movie", '1', '2', - new String[]{"title", "year"}, new String[]{"id"}); + public void test_getters_with_connection_provider_name_delimiters_and_columns_set() { + Table table = assertDbConnection.table("movie").delimiters('1', '2') + .columnsToCheck(new String[]{"title", "year"}) + .columnsToExclude(new String[]{"id"}) + .build(); - assertThat(table.getSource()).as("Source of MOVIE table").isSameAs(source); - assertThat(table.getDataSource()).isNull(); + 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"); @@ -206,17 +145,18 @@ public void test_getters_with_source_name_delimiters_and_columns_set() { } /** - * This method test the getters of a {@code Table} when the source, the name, the delimiters + * This method test the getters of a {@code Table} when the connection provider, the name, the delimiters * and the information about the columns and the orders are set. */ @Test - public void test_getters_with_source_name_columns_delimiters_and_order_set() { - Table table = new Table(source, "movie", '1', '2', - new Table.Order[]{asc("title"), desc("year")}, - new String[]{"title", "year"}, new String[]{"id"}); - - assertThat(table.getSource()).as("Source of MOVIE table").isSameAs(source); - assertThat(table.getDataSource()).isNull(); + public void test_getters_with_connection_provider_name_columns_delimiters_and_order_set() { + 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").isNotNull(); assertThat(table.getName()).isEqualTo("MOVIE"); assertThat(table.getColumnsToCheck()).containsExactly("TITLE", "YEAR"); assertThat(table.getColumnsToExclude()).containsExactly("ID"); @@ -227,16 +167,16 @@ public void test_getters_with_source_name_columns_delimiters_and_order_set() { } /** - * This method test the getters of a {@code Table} when the source, the name, the delimiters + * This method test the getters of a {@code Table} when the connection provider, the name, the delimiters * and the information about the orders are set. */ @Test - public void test_getters_with_source_name_delimiters_and_order_set() { - Table table = new Table(source, "movie", '1', '2', - new Table.Order[]{asc("title"), desc("year")}); + public void test_getters_with_connection_provider_name_delimiters_and_order_set() { + Table table = assertDbConnection.table("movie").delimiters('1', '2') + .columnsToOrder(new Table.Order[]{asc("title"), desc("year")}) + .build(); - assertThat(table.getSource()).as("Source of MOVIE table").isSameAs(source); - assertThat(table.getDataSource()).isNull(); + 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 eb61d305..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 @@ -12,9 +12,8 @@ */ package org.assertj.db.type; -import javax.sql.DataSource; - import org.assertj.db.common.AbstractTest; +import org.assertj.db.common.DefaultConnectionProvider; import org.assertj.db.exception.AssertJDBException; import org.junit.Test; @@ -25,97 +24,37 @@ *

* * @author Régis Pouiller + * @author Julien Roy */ public class Table_Instantiation_Test extends AbstractTest { - /** - * This method should throw a {@code NullPointerException}, because the {@code Source} parameter is - * {@code null}. - */ - @Test(expected = NullPointerException.class) - public void should_throw_NullPointerException_if_instantiate_with_Source_null() { - new Table((Source) null, null); - } + private final ConnectionProvider connectionProvider = new DefaultConnectionProvider(null); /** - * This method should throw a {@code NullPointerException}, because the {@code DataSource} parameter is + * This method should throw a {@code NullPointerException}, because the {@code ConnectionProvider} parameter is * {@code null}. */ - @Test(expected = NullPointerException.class) - public void should_throw_NullPointerException_if_instantiate_with_DataSource_null() { - new Table((DataSource) null, null); - } - - /** - * This method should throw a {@code NullPointerException}, because the {@code Source} parameter is not - * {@code null} and table name is {@code null}. - */ - @Test(expected = NullPointerException.class) - public void should_throw_NullPointerException_if_instantiate_with_Source_not_null_and_table_name_null() { - new Table(source, null); + @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 DataSource} parameter is + * 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_DataSource_not_null_and_table_name_null() { - new Table(dataSource, null); - } - - /** - * This method should throw a {@code NullPointerException}, because the {@code DataSource} and the - * {@code Source} fields are not set when call {@code getColumnsNameList()}. - */ - @Test(expected = NullPointerException.class) - public void should_throw_NullPointerException_if_get_list_of_columns_name_without_setting_source_or_datasource() { - new Table().getColumnsNameList(); - } - - /** - * This method should throw a {@code NullPointerException}, because the {@code Source} field is set but not - * the table name when call {@code getColumnsNameList()}. - */ - @Test(expected = NullPointerException.class) - public void should_throw_NullPointerException_if_get_list_of_columns_name_with_setting_source_and_without_setting_table_name() { - new Table().setSource(source).getColumnsNameList(); - } - - /** - * 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().setDataSource(dataSource).getColumnsNameList(); - } - - /** - * This method should throw a {@code NullPointerException}, because the {@code Source} field is set but not - * the table name when call {@code getRequest()}. - */ - @Test(expected = NullPointerException.class) - public void should_throw_NullPointerException_if_get_request_with_setting_source_and_without_setting_table_name() { - new Table().setSource(source).getRequest(); - } - - /** - * 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().setDataSource(dataSource).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(); } /** - * This method should throw a {@code AssertJDBException}, because the {@code Source} field is set but not - * all the information of the {@code Source}. + * This method should throw a {@code AssertJDBException}, because the {@code ConnectionProvider} field is set but not + * all the information of the {@code ConnectionProvider}. */ @Test(expected = AssertJDBException.class) - public void should_throw_AssertJDBException_if_get_list_of_rows_with_setting_source_having_bad_user() { - Table table = new Table(new Source(source.getUrl(), "", ""), ""); + public void should_throw_AssertJDBException_if_get_list_of_rows_with_setting_connection_provider_having_bad_user() { + Table table = AssertDbConnectionFactory.of("jdbc:h2:mem:test", "", "").create().table("test").build(); table.getRowsList(); } @@ -124,7 +63,7 @@ public void should_throw_AssertJDBException_if_get_list_of_rows_with_setting_sou */ @Test(expected = NullPointerException.class) public void should_throw_NullPointerException_if_one_of_the_columns_to_check_is_null() { - new Table(source, "movie", new String[]{"id", null, "birth"}, null); + assertDbConnection.table("movie").columnsToCheck(new String[]{"id", null, "birth"}).build(); } /** @@ -132,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(source, "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 548cf787..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 @@ -25,69 +25,38 @@ *

* * @author Régis Pouiller + * @author Julien Roy */ public class Table_PrimaryKeys_Name_Test extends AbstractTest { /** - * This method test the primary keys got from a {@code Source}. + * This method test the primary keys got from a {@code ConnectionProvider}. */ @Test - public void test_pks_name_with_source_set() { - Table table = new Table(source, "movie"); + public void test_pks_name() { + Table table = assertDbConnection.table("movie").build(); assertThat(table.getPksNameList()).as("Primary Keys of MOVIE table").hasSize(1) .containsExactly("ID"); } /** - * This method test the primary keys got from a {@code DataSource}. + * This method test the primary keys got from a {@code ConnectionProvider} when the columns to check are set. */ @Test - public void test_pks_name_with_datasource_set() { - Table table = new Table(dataSource, "movie"); - - assertThat(table.getPksNameList()).as("Primary Keys of MOVIE table").hasSize(1) - .containsExactly("ID"); - } - - /** - * This method test the primary keys got from a {@code Source} when the columns to check are set. - */ - @Test - public void test_pks_name_to_check_with_source_set() { - Table table = new Table(source, "actor", new String[]{"id", "name", "birth"}, null); + public void test_pks_name_to_check() { + 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"); } /** - * 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(dataSource, "actor", new String[]{"id", "name", "birth"}, null); - - assertThat(table.getPksNameList()).as("Primary Keys of ACTOR table").hasSize(1) - .containsExactly("ID"); - } - - /** - * This method test the primary keys got from a {@code Source} when the columns to exclude are set. - */ - @Test - public void test_pks_name_to_exclude_with_source_set() { - Table table = new Table(source, "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. + * 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_datasource_set() { - Table table = new Table(dataSource, "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); } @@ -98,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(dataSource, "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 b38f2193..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 @@ -28,15 +28,16 @@ *

* * @author Régis Pouiller + * @author Julien Roy */ public class Table_Rows_Test extends AbstractTest { /** - * This method test the rows got from a {@code Source}. + * This method test the rows got from a {@code ConnectionProvider}. */ @Test - public void test_rows_with_source_set() { - Table table = new Table(source, "movie"); + public void test_rows() { + Table table = assertDbConnection.table("movie").build(); assertThat(table.getRowsList()).as("Values of MOVIE table").hasSize(3); @@ -72,42 +73,8 @@ public void test_rows_with_source_set() { * This method test the rows got from a {@code DataSource}. */ @Test - public void test_rows_with_datasource_set() { - Table table = new Table(dataSource, "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(dataSource, "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); @@ -141,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(source, "movie"); + Table table = assertDbConnection.table("movie").build(); table.getRow(0).getColumnValue(null); } @@ -150,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(source, "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 33afcb1a..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,25 +17,39 @@ 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; /** * Tests on {@code getDescription} method from utility class {@code Descriptions}. * * @author Régis Pouiller + * @author Julien Roy */ 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(source, "actor"); - Table fromDataSource = new Table(dataSource, "actor"); + Table fromSource = assertDbConnection.table("actor").build(); + Table fromDataSource = assertDbConnectionFromDs.table("actor").build(); String descriptionFromSource = Descriptions.getDescription(fromSource); String descriptionFromDataSource = Descriptions.getDescription(fromDataSource); @@ -49,10 +63,10 @@ public void test_get_description_for_table() { */ @Test public void test_get_description_for_request() { - Request fromSource = new Request(source, "select * from actor"); - Request fromDataSource = new Request(dataSource, "select * from actor"); - Request fromSourceLong = new Request(source, "select id, name, firstname, birth, actor_imdb from actor"); - Request fromDataSourceLong = new Request(dataSource, "select id, name, firstname, birth, actor_imdb from actor"); + Request fromSource = 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); @@ -71,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(source).setStartPointNow(); - org.assertj.db.type.Changes fromDataSource = new org.assertj.db.type.Changes(dataSource).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(); @@ -80,8 +94,8 @@ public void test_get_description_for_changes() { String descriptionFromSource = Descriptions.getDescription(fromSource); String descriptionFromDataSource = Descriptions.getDescription(fromDataSource); - assertThat(descriptionFromSource).isEqualTo("Changes on tables of 'sa/jdbc:h2:mem:test' source"); - assertThat(descriptionFromDataSource).isEqualTo("Changes on tables of a data source"); + assertThat(descriptionFromSource).isEqualTo("Changes on tables of 'sa/jdbc:h2:mem:test'"); + assertThat(descriptionFromDataSource).isEqualTo("Changes on tables of 'data source'"); } /** @@ -90,9 +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(source, "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(dataSource, "actor")) + org.assertj.db.type.Changes fromDataSource = assertDbConnectionFromDs.changes().tables(assertDbConnectionFromDs.table("actor").build()).build() .setStartPointNow(); updateChangesForTests(); fromSource.setEndPointNow(); @@ -101,8 +115,8 @@ public void test_get_description_for_changes_from_table() { String descriptionFromSource = Descriptions.getDescription(fromSource); String descriptionFromDataSource = Descriptions.getDescription(fromDataSource); - assertThat(descriptionFromSource).isEqualTo("Changes on ACTOR table of 'sa/jdbc:h2:mem:test' source"); - assertThat(descriptionFromDataSource).isEqualTo("Changes on ACTOR table of a data source"); + assertThat(descriptionFromSource).isEqualTo("Changes on ACTOR table of 'sa/jdbc:h2:mem:test'"); + assertThat(descriptionFromDataSource).isEqualTo("Changes on ACTOR table of 'data source'"); } /** @@ -111,14 +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(source, "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(dataSource, "select * from actor")).setStartPointNow(); - org.assertj.db.type.Changes fromSourceLong = new org.assertj.db.type.Changes( - new Request(source, "select id, name, firstname, birth, actor_imdb from actor")).setStartPointNow(); - org.assertj.db.type.Changes fromDataSourceLong = new org.assertj.db.type.Changes( - new Request(dataSource, "select id, name, firstname, birth, actor_imdb from actor")).setStartPointNow(); updateChangesForTests(); fromSource.setEndPointNow(); fromDataSource.setEndPointNow(); @@ -130,10 +149,10 @@ public void test_get_description_for_changes_from_request() { String descriptionFromSourceLong = Descriptions.getDescription(fromSourceLong); String descriptionFromDataSourceLong = Descriptions.getDescription(fromDataSourceLong); - assertThat(descriptionFromSource).isEqualTo("Changes on 'select * from actor' request of 'sa/jdbc:h2:mem:test' source"); - assertThat(descriptionFromDataSource).isEqualTo("Changes on 'select * from actor' request of a data source"); - assertThat(descriptionFromSourceLong).isEqualTo("Changes on 'select id, name, firstname, bi...' request of 'sa/jdbc:h2:mem:test' source"); - assertThat(descriptionFromDataSourceLong).isEqualTo("Changes on 'select id, name, firstname, bi...' request of a data source"); + assertThat(descriptionFromSource).isEqualTo("Changes on 'select * from actor' request of 'sa/jdbc:h2:mem:test'"); + assertThat(descriptionFromDataSource).isEqualTo("Changes on 'select * from actor' request of 'data source'"); + assertThat(descriptionFromSourceLong).isEqualTo("Changes on 'select id, name, firstname, bi...' request of 'sa/jdbc:h2:mem:test'"); + assertThat(descriptionFromDataSourceLong).isEqualTo("Changes on 'select id, name, firstname, bi...' request of 'data source'"); } /** @@ -260,9 +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(source, "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(dataSource, "actor")) + org.assertj.db.type.Changes fromDataSource = assertDbConnectionFromDs.changes().tables(assertDbConnectionFromDs.table("actor").build()) + .build() .setStartPointNow(); updateChangesForTests(); fromSource.setEndPointNow(); @@ -296,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(source, "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(dataSource, "select * from actor")).setStartPointNow(); - org.assertj.db.type.Changes fromSourceLong = new org.assertj.db.type.Changes( - new Request(source, "select id, name, firstname, birth, actor_imdb from actor")).setStartPointNow(); - org.assertj.db.type.Changes fromDataSourceLong = new org.assertj.db.type.Changes( - new Request(dataSource, "select id, name, firstname, birth, actor_imdb from actor")).setStartPointNow(); updateChangesForTests(); fromSource.setEndPointNow(); fromDataSource.setEndPointNow();