// 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-testcase/src/main/java/koper/demo/trading/mapper/OrderMapper.java
// public interface OrderMapper {
// 
//     String getOrder(String orderId, Order order);
// 
//     String cancelOrder(Order order);
// 
//     String createOrder(String memberId, Order order);
// 
//     String updateOrder(Order order);
// 
//     String insertOrder(Order order);
// 
//     /**
//      * @param orderId
//      * @param order
//      * @return
//      */
//     String deleteOrder(String orderId, Order order);
// 
//     String deleteOldOrder(int orderId, boolean reserve);
// 
//     String cancelOldOrder(Order order);
// }


import koper.demo.trading.mapper.Order;
import koper.demo.trading.mapper.OrderMapper;
import junit.textui.TestRunner;
import org.springframework.test.AbstractDependencyInjectionSpringContextTests;
import java.math.BigDecimal;
import java.util.Date;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
/*
 * 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;



/**
 * KafkaBatchSenderTest
 *
 * @author kk raymondhekk9527@gmail.com
 * @since 1.0
 * 2016年3月25日
 */
public class KafkaBatchSenderTest extends AbstractDependencyInjectionSpringContextTests {

	private OrderMapper orderMapper;
	
	/**
	 * @param orderMapper the orderMapper to set
	 */
	public void setOrderMapper(OrderMapper orderMapper) {
		this.orderMapper = orderMapper;
	}
	
	@Override
	protected String[] getConfigLocations() {
		return new String[]{
							 "classpath:kafka/context-data-message.xml",
							 "classpath:kafka/context-data-producer.xml"
							};
	}

// 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-testcase/src/main/java/koper/demo/trading/mapper/OrderMapper.java
// public interface OrderMapper {
// 
//     String getOrder(String orderId, Order order);
// 
//     String cancelOrder(Order order);
// 
//     String createOrder(String memberId, Order order);
// 
//     String updateOrder(Order order);
// 
//     String insertOrder(Order order);
// 
//     /**
//      * @param orderId
//      * @param order
//      * @return
//      */
//     String deleteOrder(String orderId, Order order);
// 
//     String deleteOldOrder(int orderId, boolean reserve);
// 
//     String cancelOldOrder(Order order);
// }


// Path: koper-testcase/src/test/java/koper/kafka/KafkaBatchSenderTest.java
import koper.demo.trading.mapper.Order;
import koper.demo.trading.mapper.OrderMapper;
import junit.textui.TestRunner;
import org.springframework.test.AbstractDependencyInjectionSpringContextTests;
import java.math.BigDecimal;
import java.util.Date;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

/*
 * 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;



/**
 * KafkaBatchSenderTest
 *
 * @author kk raymondhekk9527@gmail.com
 * @since 1.0
 * 2016年3月25日
 */
public class KafkaBatchSenderTest extends AbstractDependencyInjectionSpringContextTests {

	private OrderMapper orderMapper;
	
	/**
	 * @param orderMapper the orderMapper to set
	 */
	public void setOrderMapper(OrderMapper orderMapper) {
		this.orderMapper = orderMapper;
	}
	
	@Override
	protected String[] getConfigLocations() {
		return new String[]{
							 "classpath:kafka/context-data-message.xml",
							 "classpath:kafka/context-data-producer.xml"
							};
	}

	private Order newOrder(int i) {