kafka-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jun...@apache.org
Subject git commit: kafka-1364; ReplicaManagerTest hard-codes log dir; patched by Guozhang Wang; reviewed by Jun Rao
Date Wed, 09 Apr 2014 21:49:25 GMT
Repository: kafka
Updated Branches:
  refs/heads/trunk 8d15de851 -> 911ff5245


kafka-1364; ReplicaManagerTest hard-codes log dir; patched by Guozhang Wang; reviewed by Jun
Rao


Project: http://git-wip-us.apache.org/repos/asf/kafka/repo
Commit: http://git-wip-us.apache.org/repos/asf/kafka/commit/911ff524
Tree: http://git-wip-us.apache.org/repos/asf/kafka/tree/911ff524
Diff: http://git-wip-us.apache.org/repos/asf/kafka/diff/911ff524

Branch: refs/heads/trunk
Commit: 911ff524515148421ff58b41f271c21f792ed9de
Parents: 8d15de8
Author: Guozhang Wang <guwang@linkedin.com>
Authored: Wed Apr 9 14:49:17 2014 -0700
Committer: Jun Rao <junrao@gmail.com>
Committed: Wed Apr 9 14:49:17 2014 -0700

----------------------------------------------------------------------
 .../scala/unit/kafka/server/ReplicaManagerTest.scala     | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/kafka/blob/911ff524/core/src/test/scala/unit/kafka/server/ReplicaManagerTest.scala
----------------------------------------------------------------------
diff --git a/core/src/test/scala/unit/kafka/server/ReplicaManagerTest.scala b/core/src/test/scala/unit/kafka/server/ReplicaManagerTest.scala
index b5936d4..a71e48d 100644
--- a/core/src/test/scala/unit/kafka/server/ReplicaManagerTest.scala
+++ b/core/src/test/scala/unit/kafka/server/ReplicaManagerTest.scala
@@ -29,18 +29,17 @@ import kafka.log.{LogManager, LogConfig, Log}
 
 class ReplicaManagerTest extends JUnit3Suite {
   @Test
-  def testHighwaterMarkDirectoryMapping() {
+  def testHighWaterMarkDirectoryMapping() {
     val props = TestUtils.createBrokerConfig(1)
-    val dir = "/tmp/kafka-logs/"
-    new File(dir).mkdir()
-    props.setProperty("log.dirs", dir)
+    val topic = "test-topic"
     val config = new KafkaConfig(props)
     val zkClient = EasyMock.createMock(classOf[ZkClient])
     val mockLogMgr = EasyMock.createMock(classOf[LogManager])
     val time: MockTime = new MockTime()
     val rm = new ReplicaManager(config, time, zkClient, new MockScheduler(time), mockLogMgr,
new AtomicBoolean(false))
-    val partition = rm.getOrCreatePartition("test-topic", 1, 1)
-    partition.addReplicaIfNotExists(new Replica(1, partition, time, 0L, Option(new Log(new
File("/tmp/kafka-logs/test-topic-1"), new LogConfig(), 0L, null))))
+    val partition = rm.getOrCreatePartition(topic, 1, 1)
+    val logFilename = config.logDirs.head + File.separator + topic + "-1"
+    partition.addReplicaIfNotExists(new Replica(1, partition, time, 0L, Option(new Log(new
File(logFilename), new LogConfig(), 0L, null))))
     rm.checkpointHighWatermarks()
   }
 }


Mime
View raw message