<rt id="bn8ez"></rt>
<label id="bn8ez"></label>

  • <span id="bn8ez"></span>

    <label id="bn8ez"><meter id="bn8ez"></meter></label>

    沉睡森林@漂在北京

    本處文章除注明“轉(zhuǎn)載”外均為原創(chuàng),轉(zhuǎn)載請(qǐng)注明出處。

      BlogJava :: 首頁 :: 新隨筆 :: 聯(lián)系 :: 聚合  :: 管理 ::
      152 隨筆 :: 4 文章 :: 114 評(píng)論 :: 0 Trackbacks

           /**

            * @param args

            */

           public static void main(String[] args) {

                  // TODO Auto-generated method stub

                  String [] conf = new String[2];

            conf[0]="applicationContext.xml";

            conf[1]="dataAccessContext-jdbc.xml";

            ApplicationContext appContext = new ClassPathXmlApplicationContext(conf);

    //        UserService us = (UserService) appContext.getBean("userService");

            Customer cu = new Customer();

            cu.setName("11");

            cu.setAddress("aa");

            cu.setEmail("ss");

            cu.setPhone("ssss");

            ICustomerService cs = (ICustomerService) appContext.getBean("customerService");

           

            cs.insert(cu);

           

            System.out.println("hello world!");

           }

     

     

     

     

     

    package com.example.test;

     

    import org.junit.Test;

    import org.springframework.beans.factory.annotation.Autowired;

    import org.springframework.test.context.ContextConfiguration;

    import org.springframework.test.context.junit4.AbstractTransactionalJUnit4SpringContextTests;

     

    import com.example.domain.Customer;

    import com.example.service.ICustomerService;

     

    @ContextConfiguration(locations={"test-customerService.xml"})

    public class TestCustomerService extends

           AbstractTransactionalJUnit4SpringContextTests {

        @Autowired

        private ICustomerService cs;

     

        @Test

        public void handleUserLogin() {

           // User user = new User();

           // user.setUserId(1);

           // user.setLastIp("127.0.0.1");

           // Date now = new Date();

           // user.setLastVisit(now.getTime());

           // userService.handleUserLogin(user);

     

           Customer cu = new Customer();

           cu.setName("11");

           cu.setAddress("aa");

           cu.setEmail("ss");

           cu.setPhone("ssss");

     

           cs.insert(cu);

     

           System.out.println("hello world!");

        }

    }

    在同一目錄下放入文件:

    <?xml version="1.0" encoding="UTF-8"?>

    <beans xmlns="http://www.springframework.org/schema/beans"

        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

        xsi:schemaLocation="http://www.springframework.org/schema/beans

    http://www.springframework.org/schema/beans/spring-beans-2.5.xsd">

     

    <!--  引入清單1定義的Spring配置文件 -->

        <import resource="classpath:/applicationContext.xml" />

        <import resource="classpath:/dataAccessContext-jdbc.xml" />

    </beans>

    posted on 2009-02-14 21:56 王總兵 閱讀(173) 評(píng)論(0)  編輯  收藏

    只有注冊(cè)用戶登錄后才能發(fā)表評(píng)論。


    網(wǎng)站導(dǎo)航:
     
    主站蜘蛛池模板: 亚洲日韩在线中文字幕第一页| 国产成人亚洲精品| 亚洲经典在线中文字幕| 亚洲国产成人无码AV在线影院| 性无码免费一区二区三区在线| 又黄又爽的视频免费看| 亚洲高清有码中文字| av无码国产在线看免费网站 | 亚洲精品无码成人片久久| 亚洲国产欧美日韩精品一区二区三区| 亚洲日韩VA无码中文字幕| 免费观看无遮挡www的视频 | 国产精品亚洲一区二区三区 | 久久久亚洲AV波多野结衣| 无码国产精品一区二区免费16| 亚洲伊人久久大香线蕉AV| 成人免费视频88| 精品亚洲AV无码一区二区| 毛片免费观看网址| 中国在线观看免费的www| 亚洲人成人无码网www国产| 一级一片免费视频播放| 亚洲福利中文字幕在线网址| 一级毛片免费在线观看网站| 在线综合亚洲中文精品| 亚洲av永久无码制服河南实里| 美女在线视频观看影院免费天天看| 国产午夜亚洲精品午夜鲁丝片| 亚洲免费人成在线视频观看| 日韩成人精品日本亚洲| 亚洲av午夜福利精品一区| 国产一卡二卡≡卡四卡免费乱码| 一区二区免费国产在线观看| 在线观看亚洲天天一三视| 色视频色露露永久免费观看| 久久久久亚洲国产AV麻豆| 亚洲av无码成人精品区在线播放| 麻豆一区二区免费播放网站| 男女啪啪免费体验区| 亚洲视频.com| 在线A级毛片无码免费真人|