/** * MySQL 8 returns X and Y in a different order */ @Override public void geometryAssertPoints(Double expectedX, Double expectedY, Double actualX, Double actualY) { assertThat(actualX).isEqualTo(expectedY, Delta.delta(0.01)); assertThat(actualY).isEqualTo(expectedX, Delta.delta(0.01)); } };
protected void assertRow(Serializable[] data, Serializable... expected) { assertThat(data.length).isEqualTo(expected.length); assertThat(data).contains((Object[]) expected); }
protected TableAlteredEvent alterTableEvent() { assertThat(actual).isInstanceOf(TableAlteredEvent.class); return (TableAlteredEvent)actual; }
@Test public void shouldStartSourceInfoFromZeroBinlogCoordinates() { source.setBinlogStartPoint(FILENAME, 0); assertThat(source.binlogFilename()).isEqualTo(FILENAME); assertThat(source.binlogPosition()).isEqualTo(0); assertThat(source.eventsToSkipUponRestart()).isEqualTo(0); assertThat(source.rowsToSkipUponRestart()).isEqualTo(0); assertThat(source.isSnapshotInEffect()).isFalse(); }
@Test public void shouldRecoverSourceInfoFromOffsetWithZeroBinlogCoordinatesAndNonZeroRowAndSnapshot() { sourceWith(offset(0, 5, true)); assertThat(source.gtidSet()).isNull(); assertThat(source.binlogFilename()).isEqualTo(FILENAME); assertThat(source.binlogPosition()).isEqualTo(0); assertThat(source.rowsToSkipUponRestart()).isEqualTo(5); assertThat(source.isSnapshotInEffect()).isTrue(); }
protected void assertType( String content, String typeName, int jdbcType, long length, int scale, int[] arrayDims ) { DataType type = parser.parse(text(content), null); assertThat(type).isNotNull(); assertThat(type.jdbcType()).isEqualTo(jdbcType); assertThat(type.name()).isEqualTo(typeName); assertThat(type.length()).isEqualTo(length); assertThat(type.scale()).isEqualTo(scale); assertThat(type.arrayDimensions()).isEqualTo(arrayDims); }
protected void assertSameGtidSet(String pathToField, Object actual, Object expected) { assertThat(actual).isInstanceOf(String.class); assertThat(expected).isInstanceOf(String.class); GtidSet actualGtidSet = new GtidSet((String) actual); GtidSet expectedGtidSet = new GtidSet((String) expected); assertThat(actualGtidSet.toString()).isEqualTo(expectedGtidSet.toString()); } }
@Test public void shouldStartSourceInfoFromNonZeroBinlogCoordinates() { source.setBinlogStartPoint(FILENAME, 100); assertThat(source.binlogFilename()).isEqualTo(FILENAME); assertThat(source.binlogPosition()).isEqualTo(100); assertThat(source.rowsToSkipUponRestart()).isEqualTo(0); assertThat(source.isSnapshotInEffect()).isFalse(); }
@Test public void shouldStartSourceInfoFromBinlogCoordinatesWithGtidsAndNonZeroBinlogCoordinatesAndSnapshot() { sourceWith(offset(GTID_SET, 100, 0, true)); assertThat(source.gtidSet()).isEqualTo(GTID_SET); assertThat(source.binlogFilename()).isEqualTo(FILENAME); assertThat(source.binlogPosition()).isEqualTo(100); assertThat(source.rowsToSkipUponRestart()).isEqualTo(0); assertThat(source.isSnapshotInEffect()).isTrue(); }
protected void assertEnumType( String content, String expression ) { DataType type = parser.parse(text(content), null); assertThat(type).isNotNull(); assertThat(type.jdbcType()).isEqualTo(Types.CHAR); assertThat(type.name()).isEqualTo("ENUM"); assertThat(type.length()).isEqualTo(-1); assertThat(type.expression()).isEqualTo(expression); }
protected TableEvent tableEvent() { assertThat(actual).isInstanceOf(TableEvent.class); return (TableEvent)actual; }
@Override public void geometryAssertPoints(Double expectedX, Double expectedY, Double actualX, Double actualY) { assertThat(actualX).isEqualTo(expectedX, Delta.delta(0.01)); assertThat(actualY).isEqualTo(expectedY, Delta.delta(0.01)); } };
@Test public void shouldStartSourceInfoFromBinlogCoordinatesWithGtidsAndNonZeroBinlogCoordinates() { sourceWith(offset(GTID_SET, 100, 0, false)); assertThat(source.gtidSet()).isEqualTo(GTID_SET); assertThat(source.binlogFilename()).isEqualTo(FILENAME); assertThat(source.binlogPosition()).isEqualTo(100); assertThat(source.rowsToSkipUponRestart()).isEqualTo(0); assertThat(source.isSnapshotInEffect()).isFalse(); }
@Test public void shouldStartSourceInfoFromBinlogCoordinatesWithGtidsAndZeroBinlogCoordinatesAndSnapshot() { sourceWith(offset(GTID_SET, 0, 0, true)); assertThat(source.gtidSet()).isEqualTo(GTID_SET); assertThat(source.binlogFilename()).isEqualTo(FILENAME); assertThat(source.binlogPosition()).isEqualTo(0); assertThat(source.rowsToSkipUponRestart()).isEqualTo(0); assertThat(source.isSnapshotInEffect()).isTrue(); }
@Test public void shouldRecoverSourceInfoFromOffsetWithZeroBinlogCoordinatesAndNonZeroRow() { sourceWith(offset(0, 5)); assertThat(source.gtidSet()).isNull(); assertThat(source.binlogFilename()).isEqualTo(FILENAME); assertThat(source.binlogPosition()).isEqualTo(0); assertThat(source.rowsToSkipUponRestart()).isEqualTo(5); assertThat(source.isSnapshotInEffect()).isFalse(); }
@Test public void shouldRecoverSourceInfoFromOffsetWithNonZeroBinlogCoordinatesAndSnapshot() { sourceWith(offset(100, 0, true)); assertThat(source.gtidSet()).isNull(); assertThat(source.binlogFilename()).isEqualTo(FILENAME); assertThat(source.binlogPosition()).isEqualTo(100); assertThat(source.rowsToSkipUponRestart()).isEqualTo(0); assertThat(source.isSnapshotInEffect()).isTrue(); }
@Test public void shouldStartSourceInfoFromBinlogCoordinatesWithGtidsAndZeroBinlogCoordinates() { sourceWith(offset(GTID_SET, 0, 0, false)); assertThat(source.gtidSet()).isEqualTo(GTID_SET); assertThat(source.binlogFilename()).isEqualTo(FILENAME); assertThat(source.binlogPosition()).isEqualTo(0); assertThat(source.rowsToSkipUponRestart()).isEqualTo(0); assertThat(source.isSnapshotInEffect()).isFalse(); }
@Test public void shouldRecoverSourceInfoFromOffsetWithZeroBinlogCoordinates() { sourceWith(offset(0, 0)); assertThat(source.gtidSet()).isNull(); assertThat(source.binlogFilename()).isEqualTo(FILENAME); assertThat(source.binlogPosition()).isEqualTo(0); assertThat(source.rowsToSkipUponRestart()).isEqualTo(0); assertThat(source.isSnapshotInEffect()).isFalse(); }
@Test public void shouldStartSourceInfoFromBinlogCoordinatesWithGtidsAndZeroBinlogCoordinatesAndNonZeroRow() { sourceWith(offset(GTID_SET, 0, 5, false)); assertThat(source.gtidSet()).isEqualTo(GTID_SET); assertThat(source.binlogFilename()).isEqualTo(FILENAME); assertThat(source.binlogPosition()).isEqualTo(0); assertThat(source.rowsToSkipUponRestart()).isEqualTo(5); assertThat(source.isSnapshotInEffect()).isFalse(); }
@Test public void shouldRecoverSourceInfoFromOffsetWithNonZeroBinlogCoordinatesAndNonZeroRow() { sourceWith(offset(100, 5)); assertThat(source.gtidSet()).isNull(); assertThat(source.binlogFilename()).isEqualTo(FILENAME); assertThat(source.binlogPosition()).isEqualTo(100); assertThat(source.rowsToSkipUponRestart()).isEqualTo(5); assertThat(source.isSnapshotInEffect()).isFalse(); }