Skip to content

Commit

Permalink
Merge pull request #6 from mkhq/master
Browse files Browse the repository at this point in the history
Updated finagle and curator dependency for tests, adds kafka test jar
  • Loading branch information
okapies committed Feb 18, 2015
2 parents 0dd7d89 + 8ca05ad commit 4abb34d
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 25 deletions.
17 changes: 0 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,23 +61,6 @@ $ sbt package

## Running tests

The tests require Kafka TestUtils which are currently not distributed
using Maven. The test jar is built directly from Kafka source.

```
git clone https://github.com/apache/kafka.git
cd kafka
git fetch
git checkout 0.8.1
./gradlew -PscalaVersion=2.10.4 testJar
```

Copy the test-jar to the lib dir in the finagle-kafka project.

```
cp kafka/core/build/libs/kafka_2.10-test-0.8.1.1.jar finagle-kafka/lib/
```

Tests are run using sbt.

```
Expand Down
7 changes: 4 additions & 3 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ scalaVersion := "2.10.4"
net.virtualvoid.sbt.graph.Plugin.graphSettings

libraryDependencies ++= List(
"com.twitter" % "finagle-core_2.10" % "6.17.0",
"com.twitter" % "finagle-core_2.10" % "6.24.0",
"org.apache.kafka" % "kafka_2.10" % "0.8.1.1"
exclude("com.101tec", "zkclient")
exclude("com.yammer.metrics", "metrics-core")
Expand All @@ -23,9 +23,10 @@ libraryDependencies ++= List(
"org.scalatest" % "scalatest_2.10" % "2.1.7" % "test",
// dependencies for kafka-test
"junit" % "junit" % "4.11" % "test",
"org.apache.curator" % "curator-test" % "2.4.2" % "test",
"org.apache.curator" % "curator-test" % "2.7.1" % "test",
"com.101tec" % "zkclient" % "0.4" % "test",
"com.yammer.metrics" % "metrics-core" % "2.2.0" % "test"
"com.yammer.metrics" % "metrics-core" % "2.2.0" % "test",
"org.apache.kafka" % "kafka_2.10" % "0.8.1.1" % "test" classifier "test"
)

publishTo := {
Expand Down
4 changes: 2 additions & 2 deletions src/main/scala/okapies/finagle/Kafka.scala
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import com.twitter.finagle.{Client, Name}
import com.twitter.finagle.client.{Bridge, DefaultClient}
import com.twitter.finagle.dispatch.PipeliningDispatcher
import com.twitter.finagle.netty3.Netty3Transporter
import com.twitter.finagle.pool.ReusingPool
import com.twitter.finagle.pool.SingletonPool
import com.twitter.finagle.stats.StatsReceiver

import okapies.finagle.kafka.protocol.{KafkaBatchClientPipelineFactory, KafkaStreamClientPipelineFactory, Request, Response}
Expand All @@ -26,7 +26,7 @@ object KafkaClient extends DefaultClient[Request, Response](
name = "kafka",
endpointer =
Bridge[Request, Response, Request, Response](KafkaTransporter, new PipeliningDispatcher(_)),
pool = (sr: StatsReceiver) => new ReusingPool(_, sr)
pool = (sr: StatsReceiver) => new SingletonPool(_, sr)
) with KafkaRichClient

object Kafka extends Client[Request, Response] with KafkaRichClient {
Expand Down
3 changes: 0 additions & 3 deletions src/test/scala/okapies/finagle/kafka/ClientTest.scala
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,6 @@ trait KafkaTest extends BeforeAndAfterAll { suite: Suite =>
kafkaServer.shutdown()
Utils.rm(kafkaConfig.getProperty("log.dir"))
zkClient.close()
// Note:
// InstanceNotFoundException will be thrown in 'TestingServer' thread
// when stopping it. See https://github.com/Netflix/curator/issues/121
zkServer.stop()
Utils.rm(zkServer.getTempDirectory)
}
Expand Down

0 comments on commit 4abb34d

Please sign in to comment.