@Test @SkipLongRunning public void shouldStartClusterAndAllowProducersAndConsumersToUseIt() throws Exception { Testing.Debug.enable(); final String topicName = "topicA"; final CountDownLatch completion = new CountDownLatch(2); final int numMessages = 100; final AtomicLong messagesRead = new AtomicLong(0); // Start a cluster and create a topic ... cluster.addBrokers(1).startup(); cluster.createTopics(topicName); // Consume messages asynchronously ... Stopwatch sw = Stopwatch.reusable().start(); cluster.useTo().consumeIntegers(topicName, numMessages, 10, TimeUnit.SECONDS, completion::countDown, (key, value) -> { messagesRead.incrementAndGet(); return true; }); // Produce some messages asynchronously ... cluster.useTo().produceIntegers(topicName, numMessages, 1, completion::countDown); // Wait for both to complete ... if (completion.await(10, TimeUnit.SECONDS)) { sw.stop(); Testing.debug("Both consumer and producer completed normally in " + sw.durations()); } else { Testing.debug("Consumer and/or producer did not completed normally"); } assertThat(messagesRead.get()).isEqualTo(numMessages); }
@Test @SkipLongRunning public void shouldStartClusterAndAllowAsynchronousProductionAndAutomaticConsumersToUseIt() throws Exception { Testing.Debug.enable(); final String topicName = "topicA"; final CountDownLatch completion = new CountDownLatch(2);
@Test public void shouldStartClusterAndAllowInteractiveProductionAndAutomaticConsumersToUseIt() throws Exception { Testing.Debug.enable(); final String topicName = "topicA"; final CountDownLatch completion = new CountDownLatch(1);
Testing.Debug.enable(); int numCreateDatabase = 1; int numCreateTables = 5;
Testing.Debug.enable(); int numCreateDatabase = 1; int numCreateTables = 5;
@Before public void before() throws Exception { setConsumeTimeout(TestHelper.defaultMessageConsumerPollTimeout(), TimeUnit.SECONDS); initializeConnectorTestFramework(); Testing.Debug.enable(); Testing.Files.delete(TestHelper.DB_HISTORY_PATH); Configuration config = TestHelper.defaultConfig() .with(OracleConnectorConfig.TABLE_WHITELIST, getTableWhitelist()) .build(); start(OracleConnector.class, config); assertConnectorIsRunning(); Thread.sleep(2000); }
Testing.Debug.enable(); int numCreateDatabase = 1; int numCreateTables = 5;
Testing.Debug.enable(); int numCreateDatabase = 1; int numCreateTables = 5;
@Before public void before() throws Exception { initializeConnectorTestFramework(); Testing.Debug.enable(); Testing.Files.delete(TestHelper.DB_HISTORY_PATH); Configuration config = TestHelper.defaultConfig() .with(SqlServerConnectorConfig.SNAPSHOT_MODE, SnapshotMode.INITIAL) .build(); start(SqlServerConnector.class, config); assertConnectorIsRunning(); Thread.sleep(1000); } }