brandservicetest.java

来自「巴巴运动网源码 传智博客出品 不全 一部分代码 可以参考」· Java 代码 · 共 35 行

JAVA
35
字号
package junit.test;

import static org.junit.Assert.*;

import org.junit.BeforeClass;
import org.junit.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import com.itcast.bean.product.Brand;
import com.itcast.service.product.BrandService;

public class BrandServiceTest {
	private static ApplicationContext cxt;
	private static BrandService brandService;
	

	@BeforeClass
	public static void setUpBeforeClass() throws Exception {
		try {
			cxt = new ClassPathXmlApplicationContext("beans.xml");
			brandService = (BrandService)cxt.getBean("brandServiceBean");
		} catch (Exception e) {
			e.printStackTrace();
		}
	}

	@Test
	public void testSave() {
		for(int i=0;i<20;i++)
		brandService.save(new Brand(i+ "远阳瑜伽","/images/brand/2008/08/02/10/dslfkdsjfkjdsfldsfdsf.gif"));
	}

}

⌨️ 快捷键说明

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