????λ?????????? >> ??????????
SpringMVC????Junit????
???????????? ???????[ 2015/1/13 14:01:01 ] ?????????????????? JUnit ??в??????
???????????junit.jar;org.springframework.test-3.1.0.RELEASE.jar
????????Dao??????JUnitDaoBase
package test.test;
import javax.annotation.Resource;
import javax.sql.DataSource;
import org.junit.runner.RunWith;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.AbstractTransactionalJUnit4SpringContextTests;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
/**
* <b>Summary: </b> TODO Junit ?????????????
* <b>Remarks: </b> TODO DAO?????????
*/
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(locations = {"classpath:/config/applicationContext.xml"})
public class JUnitDaoBase extends AbstractTransactionalJUnit4SpringContextTests {
/**
* <b>Summary: </b> ??д???? setDataSource
*
* @param dataSource
* @see org.springframework.test.context.junit4.AbstractTransactionalJUnit4SpringContextTests#setDataSource(javax.sql.DataSource)
*/
@Override
@Resource(name = "myDataSource")
public void setDataSource(DataSource dataSource) {
// TODO Auto-generated method stub
super.setDataSource(dataSource);
}
}
|
????????dao ??????daoBaseTest??????
package test.java.dao;
import java.util.List;
import org.junit.Test;
import org.springframework.beans.factory.annotation.Autowired;
import com.pinfang.dao.UserDao;
import com.pinfang.vo.User;
import test.test.JUnitDaoBase;
/**
* dao?????????
* @author fule
*
*/
public class UserDaoTest extends JUnitDaoBase {
@Autowired
private UserDao userDao;
@Test
public void testUserDao() {
User user = new User();
user.setPassword("123456");
user.setName("????");
user.setSex(1);
//System.out.println(userDao.findOnValidate(user).getMark());
List<User> list = userDao.getAll();
System.out.println(list);
//System.out.println(userDao.findOneByName("????s"));
//System.out.println(userDao.addUser(user));
}
}
|
???????????????????????漰???????????????????SPASVOС??(021-61079698-8054)?????????????????????????
??????
JUnit????????????Junit???????????Junit???????е??????Android?μ?Junit????Android?????Junit???е??????JUnit??д??????????????С??Junit??????????github?????JUnit???????????????????????JUnit3.8??Spring 4.0 JUnit????Controller??????????Junit????????Myeclipse???JUnit???е??????Maven???Junit???е??????Linux??Junit????????????????????????Junit Test Suite?????????????Jenkins+Ant+Java+Junit+SVN??????Android???????Junit??????
???·???
??????????????????
2023/3/23 14:23:39???д?ò??????????
2023/3/22 16:17:39????????????????????Щ??
2022/6/14 16:14:27??????????????????????????
2021/10/18 15:37:44???????????????
2021/9/17 15:19:29???·???????·
2021/9/14 15:42:25?????????????
2021/5/28 17:25:47??????APP??????????
2021/5/8 17:01:11????????
?????????App Bug???????????????????????Jmeter?????????QC??????APP????????????????app?????е????????jenkins+testng+ant+webdriver??????????????JMeter????HTTP???????Selenium 2.0 WebDriver ??????