spring 测试工具

package com.cloud.test;

import java.util.List;

import javax.annotation.Resource;

import org.junit.Test;

import org.junit.runner.RunWith;

import org.springframework.test.context.ContextConfiguration;

import org.springframework.test.context.junit4.AbstractJUnit4SpringContextTests;

import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;

import com.cloud.api.pojo.ResPageReslt;

import com.cloud.api.pojo.order.OrderSql;

import com.cloud.api.pojo.table.OrderAndOrderDetail;

import com.cloud.api.pojo.table.OrderInvoiceInfo;

import com.cloud.api.pojo.table.SystemArea;

import com.cloud.api.service.order.OrderInvoiceInfoService;

import com.cloud.api.service.order.OrderService;

import com.cloud.api.service.tool.SystemAreaService;

@RunWith(SpringJUnit4ClassRunner.class)

@ContextConfiguration(locations = {"classpath:configs/applicationContext-dao.xml",

"classpath:configs/applicationContext-service.xml",

"classpath:configs/applicationContext-Redis.xml"})

public class OrderJUnit extends AbstractJUnit4SpringContextTests {

@Resource

private OrderService orderService;

@Test

public void listTest() {

OrderSql orderParam = new OrderSql();

orderParam.setRowBegin(1);

orderParam.setRowEnd(10);;

List<OrderAndOrderDetail> list = orderService.list(orderParam);

System.out.println(list.size());

orderParam.setRowBegin(1);

orderParam.setRowEnd(30);

list = orderService.list(orderParam);

System.out.println(list.size());

}

}

猜你喜欢

转载自gjp014.iteye.com/blog/2363795