// Path: koper-core/src/main/java/koper/AbstractMessageListener.java
// public abstract class AbstractMessageListener implements MessageListener {
// 
//     @Override
//     public void onMsgBean(MsgBean<String, String> msgBean) {
// 
//     }
// 
//     @Override
//     public void onMessage(String msg) {
//     }
// }
// 
// Path: koper-testcase/src/main/java/koper/demo/trading/mapper/Order.java
// public class Order {
// 
// 	public String orderId;
// 	public String orderName;
// 	public Date createDate;
// 	public String memberId;
// 	public BigDecimal totalPrice;
// 
// 	public String getOrderId() {
// 		return orderId;
// 	}
// 	public void setOrderId(String orderId) {
// 		this.orderId = orderId;
// 	}
// 	public String getOrderName() {
// 		return orderName;
// 	}
// 	public void setOrderName(String orderName) {
// 		this.orderName = orderName;
// 	}
// 	public Date getCreateDate() {
// 		return createDate;
// 	}
// 	public void setCreateDate(Date createDate) {
// 		this.createDate = createDate;
// 	}
// 	public String getMemberId() {
// 		return memberId;
// 	}
// 	public void setMemberId(String memberId) {
// 		this.memberId = memberId;
// 	}
// 	public BigDecimal getTotalPrice() {
// 		return totalPrice;
// 	}
// 	public void setTotalPrice(BigDecimal totalPrice) {
// 		this.totalPrice = totalPrice;
// 	}
// 
// 	@Override
// 	public String toString() {
// 		return "Order{" +
// 				"orderId='" + orderId + '\'' +
// 				", orderName='" + orderName + '\'' +
// 				", createDate=" + createDate +
// 				", memberId='" + memberId + '\'' +
// 				", totalPrice=" + totalPrice +
// 				'}';
// 	}
// }
// 
// Path: koper-core/src/main/java/koper/sender/MessageSender.java
// public interface MessageSender {
// 
//     void send(String topic, String msg);
// 
//     void send(String topic, String key, String msg);
// 
//     void send(String topic, Object msg);
// 
//     void send(String topic, String key, Object msg);
// }


import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import koper.AbstractMessageListener;
import koper.Listen;
import koper.demo.trading.mapper.Order;
import koper.sender.MessageSender;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import java.math.BigDecimal;
/*
 * Licensed to the Apache Software Foundation (ASF) under one or more
 * contributor license agreements.  See the NOTICE file distributed with
 * this work for additional information regarding copyright ownership.
 * The ASF licenses this file to You under the Apache License, Version 2.0
 * (the "License"); you may not use this file except in compliance with
 * the License.  You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package koper.kafka;




/**
 * 将消息的生产者, 消费者 组合在一起测试.
 * 每当发送消息后, 主动让主线程沉睡一定时间,
 * 从而使得启动的实例可以让消费者接收到从遥远的Kafka来的消息,
 * 并作相应断言.
 *
 * @author caie
 * @since 1.2
 */
@ContextConfiguration(locations = {
        "classpath:kafka/context-data-producer.xml",
        "classpath:kafka/context-data-message.xml",
        "classpath:kafka/context-data-consumer.xml"
})
@RunWith(SpringJUnit4ClassRunner.class)
public class OrderListenerTestCase extends AbstractMessageListener {

    private final Logger logger = LoggerFactory.getLogger(getClass());

    @Autowired
// Path: koper-core/src/main/java/koper/AbstractMessageListener.java
// public abstract class AbstractMessageListener implements MessageListener {
// 
//     @Override
//     public void onMsgBean(MsgBean<String, String> msgBean) {
// 
//     }
// 
//     @Override
//     public void onMessage(String msg) {
//     }
// }
// 
// Path: koper-testcase/src/main/java/koper/demo/trading/mapper/Order.java
// public class Order {
// 
// 	public String orderId;
// 	public String orderName;
// 	public Date createDate;
// 	public String memberId;
// 	public BigDecimal totalPrice;
// 
// 	public String getOrderId() {
// 		return orderId;
// 	}
// 	public void setOrderId(String orderId) {
// 		this.orderId = orderId;
// 	}
// 	public String getOrderName() {
// 		return orderName;
// 	}
// 	public void setOrderName(String orderName) {
// 		this.orderName = orderName;
// 	}
// 	public Date getCreateDate() {
// 		return createDate;
// 	}
// 	public void setCreateDate(Date createDate) {
// 		this.createDate = createDate;
// 	}
// 	public String getMemberId() {
// 		return memberId;
// 	}
// 	public void setMemberId(String memberId) {
// 		this.memberId = memberId;
// 	}
// 	public BigDecimal getTotalPrice() {
// 		return totalPrice;
// 	}
// 	public void setTotalPrice(BigDecimal totalPrice) {
// 		this.totalPrice = totalPrice;
// 	}
// 
// 	@Override
// 	public String toString() {
// 		return "Order{" +
// 				"orderId='" + orderId + '\'' +
// 				", orderName='" + orderName + '\'' +
// 				", createDate=" + createDate +
// 				", memberId='" + memberId + '\'' +
// 				", totalPrice=" + totalPrice +
// 				'}';
// 	}
// }
// 
// Path: koper-core/src/main/java/koper/sender/MessageSender.java
// public interface MessageSender {
// 
//     void send(String topic, String msg);
// 
//     void send(String topic, String key, String msg);
// 
//     void send(String topic, Object msg);
// 
//     void send(String topic, String key, Object msg);
// }


// Path: koper-testcase/src/test/java/koper/kafka/OrderListenerTestCase.java
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import koper.AbstractMessageListener;
import koper.Listen;
import koper.demo.trading.mapper.Order;
import koper.sender.MessageSender;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import java.math.BigDecimal;

/*
 * Licensed to the Apache Software Foundation (ASF) under one or more
 * contributor license agreements.  See the NOTICE file distributed with
 * this work for additional information regarding copyright ownership.
 * The ASF licenses this file to You under the Apache License, Version 2.0
 * (the "License"); you may not use this file except in compliance with
 * the License.  You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package koper.kafka;




/**
 * 将消息的生产者, 消费者 组合在一起测试.
 * 每当发送消息后, 主动让主线程沉睡一定时间,
 * 从而使得启动的实例可以让消费者接收到从遥远的Kafka来的消息,
 * 并作相应断言.
 *
 * @author caie
 * @since 1.2
 */
@ContextConfiguration(locations = {
        "classpath:kafka/context-data-producer.xml",
        "classpath:kafka/context-data-message.xml",
        "classpath:kafka/context-data-consumer.xml"
})
@RunWith(SpringJUnit4ClassRunner.class)
public class OrderListenerTestCase extends AbstractMessageListener {

    private final Logger logger = LoggerFactory.getLogger(getClass());

    @Autowired
    private MessageSender messageSender;