@Test public void shouldDetectRunningConncurrentTxOnInit() throws Exception { Testing.Print.enable();
@Test public void shouldReplicateContent() throws InterruptedException { Testing.Print.disable();
try (JdbcConnection connection = db.connect()) { connection.query("SELECT * FROM products", rs -> { if (Testing.Print.isEnabled()) connection.print(rs); }); connection.execute("INSERT INTO products VALUES (default,'robot','Toy robot',1.304);"); connection.query("SELECT * FROM products", rs -> { if (Testing.Print.isEnabled()) connection.print(rs); }); connection.execute("INSERT INTO products VALUES (1001,'roy','old robot',1234.56);"); connection.query("SELECT * FROM products", rs -> { if (Testing.Print.isEnabled()) connection.print(rs); }); connection.execute("UPDATE products SET id=2001, description='really old robot' WHERE id=1001"); connection.query("SELECT * FROM products", rs -> { if (Testing.Print.isEnabled()) connection.print(rs); }); connection.execute("UPDATE products SET weight=1345.67 WHERE id=2001"); connection.query("SELECT * FROM products", rs -> { if (Testing.Print.isEnabled()) connection.print(rs); }); connection.execute("UPDATE products SET volume=13.5 WHERE id=2001"); connection.query("SELECT * FROM products", rs -> { if (Testing.Print.isEnabled()) connection.print(rs); });
try (JdbcConnection connection = db.connect()) { connection.query("SELECT * FROM products", rs -> { if (Testing.Print.isEnabled()) connection.print(rs); }); connection.execute("INSERT INTO products VALUES (default,'robot','Toy robot',1.304);"); connection.query("SELECT * FROM products", rs -> { if (Testing.Print.isEnabled()) connection.print(rs); }); connection.execute("INSERT INTO products VALUES (1001,'roy','old robot',1234.56);"); connection.query("SELECT * FROM products", rs -> { if (Testing.Print.isEnabled()) connection.print(rs); }); connection.execute("UPDATE products SET id=2001, description='really old robot' WHERE id=1001"); connection.query("SELECT * FROM products", rs -> { if (Testing.Print.isEnabled()) connection.print(rs); }); connection.execute("UPDATE products SET weight=1345.67 WHERE id=2001"); connection.query("SELECT * FROM products", rs -> { if (Testing.Print.isEnabled()) connection.print(rs); }); connection.execute("UPDATE products SET volume=13.5 WHERE id=2001"); connection.query("SELECT * FROM products", rs -> { if (Testing.Print.isEnabled()) connection.print(rs); });
jdbc.commit(); connection.query("SELECT * FROM customers", rs -> { if (Testing.Print.isEnabled()) connection.print(rs); }); connection.setAutoCommit(true);
if (Testing.Print.isEnabled()) connection.print(rs); }); connection.setAutoCommit(true);
@Test public void shouldDetectRunningConncurrentTxOnInit() throws Exception { Testing.Print.enable();
jdbc.commit(); connection.query("SELECT * FROM customers", rs -> { if (Testing.Print.isEnabled()) connection.print(rs); }); connection.setAutoCommit(true);
+ (numberOfRecords - recordsConsumed) + " more)"); debug(record); } else if (Testing.Print.isEnabled()) { Testing.print("Consumed record " + recordsConsumed + " / " + numberOfRecords + " (" + (numberOfRecords - recordsConsumed) + " more)");
@After public void afterEachTestMethod() { Testing.Print.disable(); }
@After public void after() { Testing.Print.disable(); }
@Ignore @Test( expected = ServerException.class) public void shouldFailToConnectToInvalidBinlogFile() throws Exception { Testing.Print.enable(); startClient(client -> { client.setBinlogFilename("invalid-mysql-binlog.filename.000001"); }); }
/** * Run the connector with connector configuration and expected results files, but find a mismatch in the results. */ @Test(expected = AssertionError.class) public void shouldRunConnectorFromFilesAndFindMismatch(){ // Testing.Debug.enable(); Testing.Print.disable(); runConnector("simple-test-c", "src/test/resources/simple/test/c"); }
@Ignore @Test public void shouldReadMultipleBinlogFiles() throws Exception { Testing.Print.enable(); startClient(client -> { client.setBinlogFilename("mysql-bin.000001"); }); counters.consumeAll(20, TimeUnit.SECONDS); }
@Before public void cleanOffsetStorage() { Testing.Print.enable(); Testing.Files.delete(CONNECTOR_OUTPUT_PATH); Testing.Files.delete(OFFSET_STORE_PATH); OFFSET_STORE_PATH.getParent().toFile().mkdirs(); }
Testing.Print.enable(); Testing.print("Problem with message on topic '" + record.topic() + "':"); Testing.printError(t);
jdbc.commit(); connection.query("SELECT * FROM customers", rs -> { if (Testing.Print.isEnabled()) connection.print(rs); }); connection.setAutoCommit(true);
if (Testing.Print.isEnabled()) connection.print(rs); }); connection.setAutoCommit(true);
jdbc.commit(); connection.query("SELECT * FROM customers", rs -> { if (Testing.Print.isEnabled()) connection.print(rs); }); connection.setAutoCommit(true);
+ (numberOfRecords - recordsConsumed) + " more)"); debug(record); } else if (Testing.Print.isEnabled()) { Testing.print("Consumed record " + recordsConsumed + " / " + numberOfRecords + " (" + (numberOfRecords - recordsConsumed) + " more)");