@Test
    public void testOneMasterOneSlaveOneProducerOneConsumer() throws Exception {
        // start slave
        this.slave = this.startEnhanceBroker("gregor_server1", true, true, this.getSlaveProperties());
        // start master
        this.master = this.startEnhanceBroker("samsa_server1", true, true, this.getMasterProperties());
        try {
            this.createProducer();
            this.producer.publish(this.topic);
            final byte[] data = "testOneMasterOneSlaveOneProducerOneConsumer".getBytes();
            this.sendMessage(100, data, this.topic);
            final String group = "GregorMasterSlaveTest";
            this.createConsumer(group);
            this.subscribe(this.topic, 1024 * 1024, 100);
        }
        finally {
            this.producer.shutdown();
            this.consumer.shutdown();
        }
    }
@author boyan(boyan@taobao.com)
@date 2011-12-29
metamorphosis-integration-test/src/test/java/com/taobao/meta/test/gregor/GregorMasterSlaveTest.java