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

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

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

    posts - 165, comments - 198, trackbacks - 0, articles - 1
      BlogJava :: 首頁 :: 新隨筆 :: 聯(lián)系 :: 聚合  :: 管理

    2009年2月24日


    學(xué)習(xí)就從官方的測試開始,但不知道怎么回事官方的測試有問題,這我就把我配置的簡單junit環(huán)境共享給大家把!
    1.下載 hibernate-annotations-3.4.0.GA 并解壓 ,cd 到解壓后目錄下
    2. $>ant junit (天知道,怎么官方出的東西測試不能通過!!)
    ?? 不要急,我們來看錯誤 (錯誤提示有刪減)
    ???? 錯誤-1:$>build.xml:95: ./jdbc not found.
    ???? 解決辦法-1: $>mkdir ./jdbc
    3.? $>ant junit
    ???? 錯誤-2:?
    ????? ./build.xml:124: The following error occurred while executing this line:
    ????? ./build.xml:126: The following error occurred while executing this line:
    ????? ./common-build.xml:349: .\src\filters\hsqldb.filter as it doesn't exist.
    ???? 解決辦法-2:
    ?????? $>mkdir? ./src/filters ;
    ?????? $>echo "" > ./src/filters/hsqldb.filter;
    4. ? $>ant junit
    ???? 錯誤-3:
    ?????? ./build.xml:124: The following error occurred while executing this line:
    ?????? ./build.xml:126: The following error occurred while executing this line:
    ?????? ./common-build.xml:351: .\src\test-resources not found.
    ????? $>mkdir? ./src/test-resources ;
    5. ? $>ant junit
    ???? 錯誤-4:沒有ant 錯誤了!,但測試都為錯誤,那我們就看看 第一個測試吧,找下原因!
    ???????? test-resources:
    ????????? [mkdir] Created dir: hibernate-anntations-3.4.0.GA\build\test-reports\hsqldb
    ????????? [echo] Running against db: hsqldb
    ????????? [junit] Running org.hibernate.test.annotations.ConfigurationTest
    ????????? [junit] Tests run: 7, Failures: 0, Errors: 6, Time elapsed: 1.218 sec
    ????????? .............
    ???? $>find . -name "ConfigurationTest.java"? #pwd /hibernate-anntations-3.4.0.GA
    ??????? ./test/org/hibernate/test/annotations/configuration/ConfigurationTest.java
    ??????? ./test/org/hibernate/test/annotations/ConfigurationTest.java
    ????? 根據(jù)路徑 org.hibernate.test.annotations.ConfigurationTest
    ????? gvim? ./test/org/hibernate/test/annotations/ConfigurationTest.java
    ????? 發(fā)現(xiàn)第20行: cfg.configure( "org/hibernate/test/annotations/hibernate.cfg.xml" );
    ????? 感覺應(yīng)該沒有配置 jdbc
    ????? gvim ./test/org/hibernate/test/annotations/hibernate.cfg.xml? #果然 沒配置
    ????? 我這就放個我的簡單配置上來(使用 hbm hsqldb 內(nèi)存數(shù)據(jù)庫測 試 ):
    <!DOCTYPE?hibernate-configuration?PUBLIC
    ????????"-//Hibernate/Hibernate?Configuration?DTD?3.0//EN"
    ????????"http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd"
    >
    <hibernate-configuration>
    ??
    <session-factory>
    ????????
    <property?name="hibernate.dialect">org.hibernate.dialect.HSQLDialect</property>
    ????????
    <property?name="connection.driver_class">org.hsqldb.jdbcDriver</property>
    ????????
    <property?name="connection.url">jdbc:hsqldb:mem:hbn_ann</property>
    ????????
    <property?name="connection.username">sa</property>
    ????????
    <property?name="connection.password"></property>
    ???
    ????????
    <mapping?resource="org/hibernate/test/annotations/Boat.hbm.xml"/>
    ????????
    <mapping?package="org.hibernate.test.annotations"/>
    ????????
    <mapping?class="org.hibernate.test.annotations.Plane"/>
    ??
    </session-factory>
    </hibernate-configuration>


    ????? 我這就是要hsqldb吧,既然上面錯誤1有 jdbc 文件夾,那就是放 jdbc jar 的地方
    ????? $> cp ../hsqldb.jar? ./jdbc
    ???
    6. ? $>ant junit
    ???? 呵呵 測試 第一個正確了 ! (目前配置后,測試環(huán)境并不是全部都正確,比如第2個測試)
    ???? 其他測試錯誤日志在??? .\build\test-reports\hsqldb ...
    ???? 比如第2個錯誤 異常部分
    ????? org.hibernate.HibernateException: The dialect was not set. Set the property hibernate.dialect.
    ??? at org.hibernate.dialect.Dialect.instantiateDialect(Dialect.java:256)
    ??? at org.hibernate.dialect.Dialect.getDialect(Dialect.java:234)
    ??????? ........ 大家一邊學(xué)習(xí),一邊配置測試 環(huán)境吧。
    ??? 錯誤日記 都會在 build\test-reports\hsqldb下

    posted @ 2009-04-14 11:30 G_G 閱讀(1672) | 評論 (0)編輯 收藏


    參考:
    http://tech.ddvip.com/2008-12/122835390597191.html


    頁面可以直接運行:
    <html>
    <head>

    <style?type="text/css">

    .box1
    {
    float
    :left;
    width
    :21px;
    height
    :21px;
    position
    :relative;
    background
    :?#F3F2E2?url(http://mp3.youdao.com/images/mbox_bg.gif)?no-repeat;
    }
    .box1?
    {
    background-position
    :?0px?-60px;
    }


    </style>

    </head>

    <body>

    ????
    <div?class="box1"?
    ????????onmouseover
    ="this.style.backgroundPosition='0px?-81px'?"?
    ????????onmouseout
    ="this.style.backgroundPosition='0px?-102px'?"????
    ????
    >
    ????
    </div>

    </body>

    </html>

    posted @ 2009-02-24 16:46 G_G 閱讀(1991) | 評論 (0)編輯 收藏

    主站蜘蛛池模板: 国语成本人片免费av无码| 国产精品免费久久| 91精品成人免费国产片| 亚洲麻豆精品果冻传媒| 日韩精品久久久久久免费| 色播亚洲视频在线观看| 99在线视频免费| 亚洲美女视频免费| 日本三级2019在线观看免费| 亚洲免费观看在线视频| 全免费a级毛片免费**视频| 理论亚洲区美一区二区三区| 午夜亚洲福利在线老司机| a毛片成人免费全部播放| 亚洲国产精品无码久久久蜜芽| 永久免费A∨片在线观看| 亚洲高清不卡视频| 丁香花免费高清视频完整版| 亚洲国产成人AV在线播放| 亚洲?V乱码久久精品蜜桃| 全黄大全大色全免费大片| 亚洲精品视频在线观看视频| 四虎永久在线精品免费网址 | 亚洲网站在线免费观看| 四虎永久在线观看免费网站网址| 亚洲中文字幕无码亚洲成A人片| 日韩免费毛片视频| 成人片黄网站色大片免费观看cn| 亚洲最大的成网4438| 在线观看无码的免费网站| 搜日本一区二区三区免费高清视频| 国产精品亚洲成在人线| 中文字幕影片免费在线观看| 日亚毛片免费乱码不卡一区| 亚洲国产精品一区| 日本成人免费在线| 中文字幕视频免费| 男女猛烈xx00免费视频试看| 亚洲成a人片在线观看中文动漫| 麻豆国产人免费人成免费视频| 水蜜桃视频在线观看免费播放高清|