public abstract class KafkaTestBase extends Object
Code in this test is based on the following GitHub repository: https://github.com/sakserv/hadoop-mini-clusters (ASL licensed), as per commit bc6b2b2d5f6424d5f377aa6c0871e82a956462ef
| Modifier and Type | Field and Description |
|---|---|
protected static String |
brokerConnectionStrings |
protected static KafkaTestEnvironment |
kafkaServer |
protected static org.slf4j.Logger |
LOG |
protected static int |
NUMBER_OF_KAFKA_SERVERS |
protected static Properties |
secureProps |
protected static Properties |
standardProps |
static org.junit.rules.TemporaryFolder |
tempFolder |
protected static scala.concurrent.duration.FiniteDuration |
timeout |
| Constructor and Description |
|---|
KafkaTestBase() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
assertAtLeastOnceForTopic(Properties properties,
String topic,
int partition,
Set<Integer> expectedElements,
long timeoutMillis)
We manually handle the timeout instead of using JUnit's timeout to return failure instead of timeout error.
|
protected void |
assertExactlyOnceForTopic(Properties properties,
String topic,
int partition,
List<Integer> expectedElements) |
protected void |
assertExactlyOnceForTopic(Properties properties,
String topic,
int partition,
List<Integer> expectedElements,
long timeoutMillis)
We manually handle the timeout instead of using JUnit's timeout to return failure instead of timeout error.
|
protected static void |
createTestTopic(String topic,
int numberOfPartitions,
short replicationFactor) |
protected static void |
deleteTestTopic(String topic) |
static void |
prepare() |
static void |
prepare(boolean hideKafkaBehindProxy) |
protected static void |
shutdownClusters() |
static void |
shutDownServices() |
protected static void |
startClusters(boolean secureMode,
boolean hideKafkaBehindProxy) |
protected static final org.slf4j.Logger LOG
protected static final int NUMBER_OF_KAFKA_SERVERS
protected static String brokerConnectionStrings
protected static Properties standardProps
protected static scala.concurrent.duration.FiniteDuration timeout
protected static KafkaTestEnvironment kafkaServer
public static org.junit.rules.TemporaryFolder tempFolder
protected static Properties secureProps
public static void prepare()
throws ClassNotFoundException
ClassNotFoundExceptionpublic static void prepare(boolean hideKafkaBehindProxy)
throws ClassNotFoundException
ClassNotFoundExceptionprotected static void startClusters(boolean secureMode,
boolean hideKafkaBehindProxy)
throws ClassNotFoundException
ClassNotFoundExceptionprotected static void createTestTopic(String topic, int numberOfPartitions, short replicationFactor)
protected static void deleteTestTopic(String topic)
protected void assertAtLeastOnceForTopic(Properties properties, String topic, int partition, Set<Integer> expectedElements, long timeoutMillis)
properties - Propertiestopic - String topicpartition - int partitionexpectedElements - SettimeoutMillis - long timeoutprotected void assertExactlyOnceForTopic(Properties properties, String topic, int partition, List<Integer> expectedElements)
protected void assertExactlyOnceForTopic(Properties properties, String topic, int partition, List<Integer> expectedElements, long timeoutMillis)
properties - Propertiestopic - String topicpartition - int partitionexpectedElements - ListtimeoutMillis - long timeoutCopyright © 2019. All rights reserved.