⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 custest.java

📁 一段很有意义的源码,看了就知道,不信试一试啊!
💻 JAVA
字号:
package com.wondersgroup.test;

import com.wondersgroup.framework.core.bo.Page;
import com.wondersgroup.framework.test.AbstractTestCase;
import com.wondersgroup.test.bo.Customer;
import com.wondersgroup.test.bo.Order;
import com.wondersgroup.test.service.CustomerService;
import com.wondersgroup.test.service.OrderService;

public class CusTest extends AbstractTestCase {
	private CustomerService customerService;
	private OrderService orderService;
	public void onSetUpInTransaction() throws Exception {
		super.onSetUpInTransaction();
	//	testUserService = (TestUserService)applicationContext.getBean("testUserService");
		customerService = (CustomerService)applicationContext.getBean("customerService");
	}
	
	protected String[] getConfigLocations() {
        return new String[]{"classpath*:*Context.xml"};
	}
	public void testAreYouReady(){
		//	assertNotNull(testUserService);
			assertNotNull(customerService);
		}
	public void testSaveOrder(){
		Customer customer=new Customer();
		customer.setName("test");
		Order order=new Order();
		order.setPrice(22.4);
		customer.getOrders().add(order);
		customerService.saveCustomer(customer);
		System.out.println("****customer id*****"+customer.getId());
	 	customer=customerService.loadCustomerByID(customer.getId(),new String[]{"orders"});
		
		System.out.println(customer.getOrders());
		customer=this.customerService.loadCustomerByID(customer.getId());
		System.out.println("****customer name*****"+customer.getName());
		Page page=this.customerService.findCustomerByPage(10, 1);
		System.out.println(page.totalSize);
		page.getResult();
		//customer=customerService.loadByName("test");
		//order.setCustomer(customer);
		//orderService.saveOrder(order);
	}

}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -