📄 salchancebiztest.java
字号:
package test.y308.team3.biz;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
import org.jb.y2t308.team3.biz.SalChanceBiz;
import org.jb.y2t308.team3.entity.SalChance;
import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
public class SalChanceBizTest {
@BeforeClass
public static void setUpBeforeClass() throws Exception {
}
@AfterClass
public static void tearDownAfterClass() throws Exception {
}
@Before
public void setUp() throws Exception {
}
@After
public void tearDown() throws Exception {
}
//@Test
public void testAdd() {
ApplicationContext context = new ClassPathXmlApplicationContext(
"applicationContext.xml");
SalChanceBiz salChanceBiz = (SalChanceBiz) context
.getBean("salChanceBiz");
SalChance salChance=new SalChance();
salChance.setChcTitle("hammer");
// salChance.setSalPlans("")
salChance.setChcTel("big");
salChance.setChcStatus("4");
salChance.setChcSource("earth");
salChance.setChcRate(Integer.parseInt("1"));
salChance.setChcLinkman("BigHammer");
salChance.setChcCreateDate("2009-12-12");
salChance.setChcCustName("spiderMan");
salChance.setChcDesc("This is ");
salChance.setChcDueDate("2003-12-1");
salChance.setChcCreateBy("asdf");
salChance.setChcCreateId(new Long(1));
// salChance.setSalPlans(salPlans)
boolean result = true;
try {
salChanceBiz.addSaleChance(salChance);
} catch (Exception e) {
// TODO: handle exception
e.getMessage();
result = false;
fail("test fail");
}
assertTrue(result);
}
@Test
public void testdelSaleChance() {
ApplicationContext context = new ClassPathXmlApplicationContext(
"applicationContext.xml");
SalChanceBiz salChanceBiz = (SalChanceBiz) context
.getBean("salChanceBiz");
boolean result = true;
try {
salChanceBiz.delSaleChance(10);
} catch (Exception e) {
// TODO: handle exception
e.getMessage();
result = false;
fail("test fail");
}
assertTrue(result);
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -