Web Engineering Spring+ibatis is doing unit testing locally, with the following use cases:
1 PackageWanghongye;2 3 ImportOrg.junit.Before;4 Importorg.junit.Test;5 6 Importrichinfo.dbcomponent.service.impl.SqlMapClientBeanFactory;7 ImportRichinfo.mms.bean.req.MmsDelRecordReq;8 ImportRichinfo.mms.dao.MmsRecordDao;9 ImportRichinfo.tools.common.ConverUtil;Ten One A Public classTest1 - { - @Before the Public voidbeforetest () - { -Sqlmapclientbeanfactory sqlmapclientbeanfactory =Newsqlmapclientbeanfactory (); - sqlmapclientbeanfactory +. Setconfiglocation ("Classpath:/mms-sql.xml"); - } + @Test A Public voidTestselect () at { - //int groupid= 62493;//>1 - //int groupid= 61606;//Fou - intGroupid= 61894;//1 -Mmsrecorddao dao=NewMmsrecorddao (); - Booleans =dao.istimingbygroupid (groupid); inSystem.out.println (">>>>>>>>>>>>>>>>>>" +s); - } to + @Test - Public voidTestdelete () the { *String groupid= "62493"; $Mmsrecorddao dao=NewMmsrecorddao ();Panax NotoginsengMmsdelrecordreq req =Newmmsdelrecordreq (); - Req.setgroupids (groupid); theReq.setuin (Converutil.string2long ("127877")); +Req.setusernumber ("8615134566830"); A Booleans =Dao.delsaverecord (req); theSystem.out.println (">>>>>>>>>>>>>>>>>>" +s); + } -}
@before is to load the local configuration file in advance class, such as locally, property,mms-sql.xml. @Test means running individual test cases separately
Web Engineering spring+ibatis Unit Testing