Web Engineering spring+ibatis Unit Testing

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.