📄 pricingmgmtdaotest.java
字号:
package com.tarena.oss.test;
import java.util.Collection;
import junit.framework.Test;
import junit.framework.TestCase;
import junit.framework.TestSuite;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import com.tarena.oss.pricing.dao.PricingMgmtDAO;
import com.tarena.oss.pricing.pojo.Pricing;
public class PricingMgmtDAOTest extends TestCase {
private PricingMgmtDAO dao;
private ApplicationContext context;
public PricingMgmtDAOTest(String arg0) {
super(arg0);
}
protected void setUp() throws Exception {
context = new ClassPathXmlApplicationContext("applicationContext.xml");
dao = (PricingMgmtDAO) context.getBean("pricingDAO");
}
protected void tearDown() throws Exception {
context = null;
dao = null;
}
public void testQueryAll() {
Collection<Pricing> ps = dao.queryAll();
System.out.println(ps);
}
public void testQueryAllString() {
String qryStr = " where p.name like '%资%' and p.baseFee between 1 and 2 ";
Collection<Pricing> ps = dao.queryAll(qryStr);
System.out.println(ps);
}
public void testInsertPricing() {
fail("Not yet implemented");
}
public void testQueryPricingById() {
fail("Not yet implemented");
}
public void testUpdatePricing() {
fail("Not yet implemented");
}
public void testDeletePricing() {
fail("Not yet implemented");
}
public static Test suite(){
TestSuite suite = new TestSuite();
suite.addTest(new PricingMgmtDAOTest("testQueryAll"));
suite.addTest(new PricingMgmtDAOTest("testQueryAllString"));
return suite;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -