Re: Writing unit tests for Kafka code

2013-12-27 Thread Oliver Dain
I finally got something working. It was a bit funky, so I figure I¹ll post it here in hopes that it will help someone else. First, you need to include the test stuff from Kafka. If using Maven, this does the trick: org.apache.kafka kafka_2.10 test test I used Apache Curator to get

Re: Writing unit tests for Kafka code

2013-12-27 Thread Oliver Dain
Hey Joe, Thanks for the suggestion. The code looks pretty cool, but it¹s much heavier weight than what I¹m looking for. I can spin up ZooKeeper and Kafka on my local box, but I was hoping to find a way to run them embedded so I can create unit tests (as opposed to integration tests which would use

Re: Writing unit tests for Kafka code

2013-12-27 Thread Oliver Dain
Hi Jun, Thanks for getting back to me. Unfortunately, I can't seem to get KafkaServerTestHarness to work for me. I've looked around the internet for examples but can't find any in Java. My Java compiler seems to think that KafkaServerTestHarness isn't a class so it won't let me instantiate one

Re: Writing unit tests for Kafka code

2013-12-19 Thread Joe Stein
fantastic if this was all wrapped up in a single method or > > class so creating an embedded broker and/or cluster for testing was > really > > easy. > > > > > > From: New User mailto:od...@3cinteractive.com>> > > Date: Wednesday, December 18, 2013 at 11:10 AM > >

Re: Writing unit tests for Kafka code

2013-12-18 Thread Jun Rao
ing an embedded broker and/or cluster for testing was really > easy. > > > From: New User mailto:od...@3cinteractive.com>> > Date: Wednesday, December 18, 2013 at 11:10 AM > To: "users@kafka.apache.org<mailto:users@kafka.apache.org>" < > users@kafka.apache.o

Re: Writing unit tests for Kafka code

2013-12-18 Thread Oliver Dain
; mailto:users@kafka.apache.org>> Subject: Writing unit tests for Kafka code I'm writing some Kafka client code and I'd like to unit test it. I've found some resources that say this is possible. For example: http://ransilberman.wordpress.com/2013/07/19/how-to-unit-test-kafka/

Writing unit tests for Kafka code

2013-12-18 Thread Oliver Dain
I'm writing some Kafka client code and I'd like to unit test it. I've found some resources that say this is possible. For example: http://ransilberman.wordpress.com/2013/07/19/how-to-unit-test-kafka/ but all the information I've found seems a little bit incorrect. For example, the above link us