@@ -0,0 +1,3234 @@
+/**%0A * Licensed under the Apache License, Version 2.0 (the %22License%22); you may not use this file except in compliance with%0A * the License. You may obtain a copy of the License at%0A *%0A * http://www.apache.org/licenses/LICENSE-2.0%0A *%0A * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on%0A * an %22AS IS%22 BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the%0A * specific language governing permissions and limitations under the License.%0A *%0A * Copyright 2012-2014 the original author or authors.%0A */%0Apackage org.assertj.db.api.assertions;%0A%0Aimport org.assertj.core.api.Assertions;%0Aimport org.assertj.db.api.TableAssert;%0Aimport org.assertj.db.api.TableColumnAssert;%0Aimport org.assertj.db.common.AbstractTest;%0Aimport org.assertj.db.type.Request;%0Aimport org.assertj.db.type.Table;%0Aimport org.junit.Test;%0A%0Aimport static org.assertj.db.api.Assertions.assertThat;%0Aimport static org.junit.Assert.fail;%0A%0A/**%0A * Tests on %7B@link org.assertj.db.api.assertions.AssertOnNumberOfRows%7D class :%0A * %7B@link org.assertj.db.api.assertions.AssertOnNumberOfRows#hasNumberOfRows(int)%7D method.%0A *%0A * @author R%C3%A9gis Pouiller%0A *%0A */%0Apublic class AssertOnNumberOfRows_HasNumberOfRows_Test extends AbstractTest %7B%0A%0A  /**%0A   * This method tests the %7B@code hasNumberOfRows%7D assertion method.%0A   */%0A  @Test%0A  public void test_has_number_of_rows() %7B%0A    Table table = new Table(source, %22actor%22);%0A    TableAssert tableAssert = assertThat(table);%0A    TableAssert tableAssert2 = tableAssert.hasNumberOfRows(3);%0A    Assertions.assertThat(tableAssert).isSameAs(tableAssert2);%0A    TableColumnAssert tableColumnAssert = assertThat(table).column();%0A    TableColumnAssert tableColumnAssert2 = tableColumnAssert.hasNumberOfRows(3);%0A    Assertions.assertThat(tableColumnAssert).isSameAs(tableColumnAssert2);%0A  %7D%0A%0A  /**%0A   * This method should fail because the number of rows is different.%0A   */%0A  @Test%0A  public void should_fail_because_number_of_rows_is_different() %7B%0A    Request request = new Request(source, %22select * from actor%22);%0A    try %7B%0A      assertThat(request).hasNumberOfRows(9);%0A      fail(%22An exception must be raised%22);%0A    %7D catch (AssertionError e) %7B%0A      Assertions.assertThat(e.getMessage()).isEqualTo(%22%5B'select * from actor' request%5D %5Cn%22%0A                                                      + %22Expecting size (number of rows) to be equal to :%5Cn%22%0A                                                      + %22   %3C9%3E%5Cn%22%0A                                                      + %22but was:%5Cn%22%0A                                                      + %22   %3C3%3E%22);%0A    %7D%0A    try %7B%0A      assertThat(request).column().hasNumberOfRows(9);%0A      fail(%22An exception must be raised%22);%0A    %7D catch (AssertionError e) %7B%0A      Assertions.assertThat(e.getMessage()).isEqualTo(%22%5BColumn at index 0 (column name : ID) of 'select * from actor' request%5D %5Cn%22%0A                                                      + %22Expecting size (number of rows) to be equal to :%5Cn%22%0A                                                      + %22   %3C9%3E%5Cn%22%0A                                                      + %22but was:%5Cn%22%0A                                                      + %22   %3C3%3E%22);%0A    %7D%0A  %7D%0A%7D%0A

Add tests on AssertOnNumberOfRows assertion method