org.assertj.db.api.assertions.AssertOnColumnOfChangeEquality Maven / Gradle / Ivy
Show all versions of assertj-db Show documentation
/**
* 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 2012-2015 the original author or authors.
*/
package org.assertj.db.api.assertions;
import org.assertj.db.type.DateTimeValue;
import org.assertj.db.type.DateValue;
import org.assertj.db.type.TimeValue;
/**
* Defines the assertion methods on the equality of a column of a change.
*
* @param The "self" type of this assertion class. Please read "Emulating 'self types' using Java Generics to simplify fluent API implementation"
* for more details.
* @author Régis Pouiller
*/
public interface AssertOnColumnOfChangeEquality> {
/**
* Verifies that the values at the start point and the end point are equal to a boolean.
*
* Example where the assertion verifies that the values of the first {@code Column} of the {@code Table} are equal to
* {@code true} :
*
*
* assertThat(changes).change(1).column().hasValuesEqualTo(true);
*
*
* @param expected The expected boolean value.
* @return {@code this} assertion object.
* @throws AssertionError If the values at start point and at end point are not equal to the boolean.
* @see org.assertj.db.api.ChangeColumnAssert#hasValuesEqualTo(Boolean)
*/
public T hasValuesEqualTo(Boolean expected);
/**
* Verifies that the values at the start point and the end point are equal to a boolean for start point and another boolean for end point.
*
* Example where the assertion verifies that the values of the first {@code Column} of the {@code Table} are equal to
* {@code true} at start point and {@code false} at end point :
*
*
* assertThat(changes).change(1).column().hasValuesEqualTo(true, false);
*
*
* @param expectedAtStartPoint The expected boolean at start point.
* @param expectedAtEndPoint The expected boolean at end point.
* @return {@code this} assertion object.
* @throws AssertionError If the values at start point and at end point are not equal to the corresponding booleans.
* @see org.assertj.db.api.ChangeColumnAssert#hasValuesEqualTo(Boolean, Boolean)
*/
public T hasValuesEqualTo(Boolean expectedAtStartPoint, Boolean expectedAtEndPoint);
/**
* Verifies that the values at the start point and the end point are equal to a number.
*
* Example where the assertion verifies that the values of the first {@code Column} of the {@code Table} are equal to
* {@code 1} :
*
*
* assertThat(changes).change(1).column().hasValuesEqualTo(1);
*
*
* @param expected The expected number value.
* @return {@code this} assertion object.
* @throws AssertionError If the values at start point and at end point are not equal to the number.
* @see org.assertj.db.api.ChangeColumnAssert#hasValuesEqualTo(Number)
*/
public T hasValuesEqualTo(Number expected);
/**
* Verifies that the values at the start point and the end point are equal to a number for start point and another number for end point.
*
* Example where the assertion verifies that the values of the first {@code Column} of the {@code Table} are equal to
* {@code 1} at start point and {@code 2} at end point :
*
*
* assertThat(changes).change(1).column().hasValuesEqualTo(1, 2);
*
*
* @param expectedAtStartPoint The expected number at start point.
* @param expectedAtEndPoint The expected number at end point.
* @return {@code this} assertion object.
* @throws AssertionError If the values at start point and at end point are not equal to the corresponding numbers.
* @see org.assertj.db.api.ChangeColumnAssert#hasValuesEqualTo(Number, Number)
*/
public T hasValuesEqualTo(Number expectedAtStartPoint, Number expectedAtEndPoint);
/**
* Verifies that the values at the start point and the end point are equal to bytes.
*
* Example where the assertion verifies that the values of the first {@code Column} of the {@code Table} are equal to
* a array of bytes loaded from a file in the classpath :
*
*
* byte[] bytes = bytesContentFromClassPathOf("file.png");
* assertThat(changes).change(1).column().hasValuesEqualTo(bytes);
*
*
* @param expected The expected bytes value.
* @return {@code this} assertion object.
* @throws AssertionError If the values at start point and at end point are not equal to the bytes.
* @see org.assertj.db.api.ChangeColumnAssert#hasValuesEqualTo(byte[])
*/
public T hasValuesEqualTo(byte[] expected);
/**
* Verifies that the values at the start point and the end point are equal to bytes for start point and other bytes for end point.
*
* Example where the assertion verifies that the values of the first {@code Column} of the {@code Table} are equal to
* a array of bytes loaded from a file in the classpath at start point and another array at end point :
*
*
* byte[] bytes = bytesContentFromClassPathOf("file.png");
* byte[] bytes2 = bytesContentFromClassPathOf("file2.png");
* assertThat(changes).change(1).column().hasValuesEqualTo(bytes, bytes2);
*
*
* @param expectedAtStartPoint The expected bytes at start point.
* @param expectedAtEndPoint The expected bytes at end point.
* @return {@code this} assertion object.
* @throws AssertionError If the values at start point and at end point are not equal to the corresponding bytes.
* @see org.assertj.db.api.ChangeColumnAssert#hasValuesEqualTo(byte[], byte[])
*/
public T hasValuesEqualTo(byte[] expectedAtStartPoint, byte[] expectedAtEndPoint);
/**
* Verifies that the values at the start point and the end point are equal to a text.
*
* Example where the assertion verifies that the values of the first {@code Column} of the {@code Table} are equal to
* "Ellen Louise Ripley" :
*
*
* assertThat(changes).change(1).column().hasValuesEqualTo("Ellen Louise Ripley");
*
*
* @param expected The expected text value.
* @return {@code this} assertion object.
* @throws AssertionError If the values at start point and at end point are not equal to the text.
* @see org.assertj.db.api.ChangeColumnAssert#hasValuesEqualTo(String)
*/
public T hasValuesEqualTo(String expected);
/**
* Verifies that the values at the start point and the end point are equal to a text for start point and another text for end point.
*
* Example where the assertion verifies that the values of the first {@code Column} of the {@code Table} are equal to
* "Sigourney" at start point and "Susan Alexandra" at end point :
*
*
* assertThat(changes).change(1).column().hasValuesEqualTo("Sigourney", "Susan Alexandra");
*
*
* @param expectedAtStartPoint The expected text at start point.
* @param expectedAtEndPoint The expected text at end point.
* @return {@code this} assertion object.
* @throws AssertionError If the values at start point and at end point are not equal to the corresponding texts.
* @see org.assertj.db.api.ChangeColumnAssert#hasValuesEqualTo(String, String)
*/
public T hasValuesEqualTo(String expectedAtStartPoint, String expectedAtEndPoint);
/**
* Verifies that the values at the start point and the end point are equal to a date.
*
* Example where the assertion verifies that the values of the first {@code Column} of the {@code Table} are equal to
* 12/23/2007 :
*
*
* assertThat(changes).change(1).column().hasValuesEqualTo(DateValue.of(2007, 12, 23));
*
*
* @param expected The expected date value.
* @return {@code this} assertion object.
* @throws AssertionError If the values at start point and at end point are not equal to the date.
* @see org.assertj.db.api.ChangeColumnAssert#hasValuesEqualTo(DateValue)
*/
public T hasValuesEqualTo(DateValue expected);
/**
* Verifies that the values at the start point and the end point are equal to a date for start point and another date for end point.
*
* Example where the assertion verifies that the values of the first {@code Column} of the {@code Table} are equal to
* 12/23/2007 at start point and 07/25/2002 at end point :
*
*
* assertThat(changes).change(1).column().hasValuesEqualTo(DateValue.of(2007, 12, 23), DateValue.of(2002, 7, 25));
*
*
* @param expectedAtStartPoint The expected date at start point.
* @param expectedAtEndPoint The expected date at end point.
* @return {@code this} assertion object.
* @throws AssertionError If the values at start point and at end point are not equal to the corresponding dates.
* @see org.assertj.db.api.ChangeColumnAssert#hasValuesEqualTo(DateValue, DateValue)
*/
public T hasValuesEqualTo(DateValue expectedAtStartPoint, DateValue expectedAtEndPoint);
/**
* Verifies that the values at the start point and the end point are equal to a time.
*
* Example where the assertion verifies that the values of the first {@code Column} of the {@code Table} are equal to
* 09:01AM :
*
*
* assertThat(changes).change(1).column().hasValuesEqualTo(TimeValue.of(9, 1));
*
*
* @param expected The expected time value.
* @return {@code this} assertion object.
* @throws AssertionError If the values at start point and at end point are not equal to the time.
* @see org.assertj.db.api.ChangeColumnAssert#hasValuesEqualTo(TimeValue)
*/
public T hasValuesEqualTo(TimeValue expected);
/**
* Verifies that the values at the start point and the end point are equal to a time for start point and another time for end point.
*
* Example where the assertion verifies that the values of the first {@code Column} of the {@code Table} are equal to
* 09:01AM at start point and 03:30AM at end point :
*
*
* assertThat(changes).change(1).column().hasValuesEqualTo(TimeValue.of(9, 1), TimeValue.of(3, 30));
*
*
* @param expectedAtStartPoint The expected time at start point.
* @param expectedAtEndPoint The expected time at end point.
* @return {@code this} assertion object.
* @throws AssertionError If the values at start point and at end point are not equal to the corresponding times.
* @see org.assertj.db.api.ChangeColumnAssert#hasValuesEqualTo(TimeValue, TimeValue)
*/
public T hasValuesEqualTo(TimeValue expectedAtStartPoint, TimeValue expectedAtEndPoint);
/**
* Verifies that the values at the start point and the end point are equal to a date/time.
*
* Example where the assertion verifies that the values of the first {@code Column} of the {@code Table} are equal to
* 12/23/2007 09:01AM :
*
*
* assertThat(changes).change(1).column().hasValuesEqualTo(DateTimeValue.of(DateValue.of(2007, 12, 23), TimeValue.of(9, 1)));
*
*
* @param expected The expected date/time value.
* @return {@code this} assertion object.
* @throws AssertionError If the values at start point and at end point are not equal to the date/time.
* @see org.assertj.db.api.ChangeColumnAssert#hasValuesEqualTo(DateTimeValue)
*/
public T hasValuesEqualTo(DateTimeValue expected);
/**
* Verifies that the values at the start point and the end point are equal to a date/time for start point and another date/time for end point.
*
* Example where the assertion verifies that the values of the first {@code Column} of the {@code Table} are equal to
* 12/23/2007 09:01AM at start point and 07/25/2002 00:00AM at end point :
*
*
* assertThat(changes).change(1).column().hasValuesEqualTo(DateTimeValue.of(DateValue.of(2007, 12, 23), TimeValue.of(9, 1)), DateTimeValue.of(DateValue.of(2002, 7, 25)));
*
*
* @param expectedAtStartPoint The expected date/time at start point.
* @param expectedAtEndPoint The expected date/time at end point.
* @return {@code this} assertion object.
* @throws AssertionError If the values at start point and at end point are not equal to the corresponding dates/times.
* @see org.assertj.db.api.ChangeColumnAssert#hasValuesEqualTo(DateTimeValue, DateTimeValue)
*/
public T hasValuesEqualTo(DateTimeValue expectedAtStartPoint, DateTimeValue expectedAtEndPoint);
}