Skip to content

Commit

Permalink
kafka-1411; remove unused test cases; patched by Jun Rao; reviewed by…
Browse files Browse the repository at this point in the history
… Guozhang Wang
  • Loading branch information
junrao committed Apr 22, 2014
1 parent 3af3efe commit ed68ba4
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 226 deletions.
173 changes: 0 additions & 173 deletions core/src/test/scala/unit/kafka/integration/LazyInitProducerTest.scala

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ class PrimitiveApiTest extends JUnit3Suite with ProducerConsumerTestHarness with
def testDefaultEncoderProducerAndFetchWithCompression() {
val topic = "test-topic"
val props = producer.config.props.props
props.put("compression", "true")
props.put("compression.codec", "gzip")
val config = new ProducerConfig(props)

val stringProducer1 = new Producer[String, String](config)
Expand Down Expand Up @@ -178,14 +178,6 @@ class PrimitiveApiTest extends JUnit3Suite with ProducerConsumerTestHarness with
produceAndMultiFetch(noCompressionProducer)
}

def testProduceAndMultiFetchWithCompression() {
val props = producer.config.props.props
props.put("compression", "true")
val config = new ProducerConfig(props)
val producerWithCompression = new Producer[String, String](config)
produceAndMultiFetch(producerWithCompression)
}

private def multiProduce(producer: Producer[String, String]) {
val topics = Map("test4" -> 0, "test1" -> 0, "test2" -> 0, "test3" -> 0)
createSimpleTopicsAndAwaitLeader(zkClient, topics.keys)
Expand Down Expand Up @@ -215,14 +207,6 @@ class PrimitiveApiTest extends JUnit3Suite with ProducerConsumerTestHarness with
multiProduce(noCompressionProducer)
}

def testMultiProduceWithCompression() {
val props = producer.config.props.props
props.put("compression", "true")
val config = new ProducerConfig(props)
val producerWithCompression = new Producer[String, String](config)
multiProduce(producerWithCompression)
}

def testConsumerEmptyTopic() {
val newTopic = "new-topic"
AdminUtils.createTopic(zkClient, newTopic, 1, 1)
Expand Down
36 changes: 0 additions & 36 deletions core/src/test/scala/unit/kafka/producer/AsyncProducerTest.scala
Original file line number Diff line number Diff line change
Expand Up @@ -355,42 +355,6 @@ class AsyncProducerTest extends JUnit3Suite {
}
}

@Test
def testBrokerListAndAsync() {
return
val props = TestUtils.getProducerConfig(TestUtils.getBrokerListStrFromConfigs(configs))
props.put("producer.type", "async")
props.put("batch.num.messages", "5")

val config = new ProducerConfig(props)

val topic = "topic1"
val topic1Metadata = getTopicMetadata(topic, 0, 0, "localhost", 9092)
val topicPartitionInfos = new collection.mutable.HashMap[String, TopicMetadata]
topicPartitionInfos.put("topic1", topic1Metadata)

val producerPool = new ProducerPool(config)

val msgs = TestUtils.getMsgStrings(10)

val handler = new DefaultEventHandler[String,String](config,
partitioner = null.asInstanceOf[Partitioner],
encoder = new StringEncoder,
keyEncoder = new StringEncoder,
producerPool = producerPool,
topicPartitionInfos = topicPartitionInfos)

val producer = new Producer[String, String](config, handler)
try {
// send all 10 messages, should create 2 batches and 2 syncproducer calls
producer.send(msgs.map(m => new KeyedMessage[String,String](topic, m)): _*)
producer.close

} catch {
case e: Exception => fail("Not expected", e)
}
}

@Test
def testFailedSendRetryLogic() {
val props = new Properties()
Expand Down

0 comments on commit ed68ba4

Please sign in to comment.