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 or
subclass it (which seems to be what the Scala code I've found is doing). For
example, the following produce errors:
import kafka.integration.KafkaServerTestHarness;
public class KafkaReaderTest {
@Test
public void testHarness() {
// Gives the error: "kafka.integration.KafkaServerTestHarness is
abstract; cannot be instantiated"
KafkaServerTestHarness testHarness = new KafkaServerTestHarness();
}
}
And this:
// Produces the error, "no interface expected here"
public class TestKafkaCluster extends KafkaServerTestHarness {
}
So my compiler sometimes thinks it's an abstract class and sometimes thinks
it's an interface. It can't be an interface or I don't think it will do
anything for me. Additionally, the Scala code I've seen seem to be calling
super.setUp to get things running and that wouldn't work if
KafkaServerTestHarness was, in fact, an interface.
Some example Java code would be very much appreciated!
Thanks,
Oliver
> You can take a look at Kafka's unit tests. See how
> kafka.integration.KafkaServerTestHarness is being used.
> Thanks,
> Jun