kafka-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jun...@apache.org
Subject svn commit: r1381858 - /incubator/kafka/branches/0.8/core/src/test/scala/unit/kafka/producer/ProducerTest.scala
Date Fri, 07 Sep 2012 03:57:32 GMT
Author: junrao
Date: Fri Sep  7 03:57:32 2012
New Revision: 1381858

URL: http://svn.apache.org/viewvc?rev=1381858&view=rev
Log:
Transient failure in ProducerTest; patched by Jun Rao; reviewed by Neha Narkhede; kafka-471

Modified:
    incubator/kafka/branches/0.8/core/src/test/scala/unit/kafka/producer/ProducerTest.scala

Modified: incubator/kafka/branches/0.8/core/src/test/scala/unit/kafka/producer/ProducerTest.scala
URL: http://svn.apache.org/viewvc/incubator/kafka/branches/0.8/core/src/test/scala/unit/kafka/producer/ProducerTest.scala?rev=1381858&r1=1381857&r2=1381858&view=diff
==============================================================================
--- incubator/kafka/branches/0.8/core/src/test/scala/unit/kafka/producer/ProducerTest.scala
(original)
+++ incubator/kafka/branches/0.8/core/src/test/scala/unit/kafka/producer/ProducerTest.scala
Fri Sep  7 03:57:32 2012
@@ -162,7 +162,7 @@ class ProducerTest extends JUnit3Suite w
     val producer2 = new Producer[String, String](producerConfig2)
     // Available partition ids should be 0.
     producer1.send(new ProducerData[String, String]("new-topic", "test", Array("test1")))
-    producer1.send(new ProducerData[String, String]("new-topic", "test", Array("test1")))
+    producer1.send(new ProducerData[String, String]("new-topic", "test", Array("test2")))
     // get the leader
     val leaderOpt = ZkUtils.getLeaderForPartition(zkClient, "new-topic", 0)
     assertTrue("Leader for topic new-topic partition 0 should exist", leaderOpt.isDefined)
@@ -179,8 +179,10 @@ class ProducerTest extends JUnit3Suite w
 
     assertEquals(new Message("test1".getBytes), messageSet.next.message)
     assertTrue("Message set should have 1 message", messageSet.hasNext)
-    assertEquals(new Message("test1".getBytes), messageSet.next.message)
-    assertFalse("Message set should not have any more messages", messageSet.hasNext)
+    assertEquals(new Message("test2".getBytes), messageSet.next.message)
+    if (messageSet.hasNext)
+      fail("Message set should not have any more messages, but received a message of %s"
+            .format(Utils.toString(messageSet.next.message.payload, "UTF-8")))
     producer1.close()
 
     try {



Mime
View raw message