<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 :: 首頁(yè) :: 新隨筆 :: 聯(lián)系 :: 聚合  :: 管理

    2009年1月12日


    學(xué)習(xí)就從官方的測(cè)試開(kāi)始,但不知道怎么回事官方的測(cè)試有問(wèn)題,這我就把我配置的簡(jiǎn)單junit環(huán)境共享給大家把!
    1.下載 hibernate-annotations-3.4.0.GA 并解壓 ,cd 到解壓后目錄下
    2. $>ant junit (天知道,怎么官方出的東西測(cè)試不能通過(guò)!!)
    ?? 不要急,我們來(lái)看錯(cuò)誤 (錯(cuò)誤提示有刪減)
    ???? 錯(cuò)誤-1:$>build.xml:95: ./jdbc not found.
    ???? 解決辦法-1: $>mkdir ./jdbc
    3.? $>ant junit
    ???? 錯(cuò)誤-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
    ???? 錯(cuò)誤-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
    ???? 錯(cuò)誤-4:沒(méi)有ant 錯(cuò)誤了!,但測(cè)試都為錯(cuò)誤,那我們就看看 第一個(gè)測(cè)試吧,找下原因!
    ???????? 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" );
    ????? 感覺(jué)應(yīng)該沒(méi)有配置 jdbc
    ????? gvim ./test/org/hibernate/test/annotations/hibernate.cfg.xml? #果然 沒(méi)配置
    ????? 我這就放個(gè)我的簡(jiǎn)單配置上來(lái)(使用 hbm hsqldb 內(nèi)存數(shù)據(jù)庫(kù)測(cè) 試 ):
    <!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吧,既然上面錯(cuò)誤1有 jdbc 文件夾,那就是放 jdbc jar 的地方
    ????? $> cp ../hsqldb.jar? ./jdbc
    ???
    6. ? $>ant junit
    ???? 呵呵 測(cè)試 第一個(gè)正確了 ! (目前配置后,測(cè)試環(huán)境并不是全部都正確,比如第2個(gè)測(cè)試)
    ???? 其他測(cè)試錯(cuò)誤日志在??? .\build\test-reports\hsqldb ...
    ???? 比如第2個(gè)錯(cuò)誤 異常部分
    ????? 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í),一邊配置測(cè)試 環(huán)境吧。
    ??? 錯(cuò)誤日記 都會(huì)在 build\test-reports\hsqldb下

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


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


    頁(yè)面可以直接運(yùn)行:
    <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) | 評(píng)論 (0)編輯 收藏

    javascript 學(xué)習(xí)
    ?? ? ? javascript 大體上可分為3個(gè)不同部分組成: 核心(ECMAscript),文本對(duì)象(DOM),瀏覽器對(duì)象(BOM)
      1. ?核心(ECMAscript): 關(guān)鍵字,語(yǔ)句,運(yùn)算符,對(duì)象
      2. 文本對(duì)象(DOM):DOM將把整個(gè)頁(yè)面規(guī)劃成由節(jié)點(diǎn)層級(jí)構(gòu)成的文檔.
        1. 解析遵循 W3C html dom 標(biāo)準(zhǔn)
        2. ? W3C dom 參考特別關(guān)注 DOM Node 說(shuō)明???
      3. BOM 瀏覽器對(duì)象.? cookie,彈出新瀏覽器,瀏覽器設(shè)置大小
    ?
    核心(ECMAscript)Global 內(nèi)置對(duì)象;
    ????? 方法: parseInt(),isNan(),encodeURI()...等都為此對(duì)象方法
    ????? 特別注意 eval();動(dòng)態(tài)語(yǔ)言的象征 比如:eval("alert('hi')"); 但這個(gè)方法很邪惡(安全方面)
    文本對(duì)象(DOM)說(shuō)明:
    ?? ??? ?
    <bookstore>
    <book category="cooking">
    <title lang="en">Everyday Italian</title>
    <author>Giada De Laurentiis</author>
    <year>2005</year>
    <price>30.00</price>
    </book>
    </bookstore>

    DOM node tree

    Node tree

    ?? ??? ??? ???


    ??? ?

    ? 1. ECMAscript基礎(chǔ)

    ?????? $ 變量弱類(lèi)型 ; ??? 匈牙利類(lèi)型標(biāo)示 : var iOuouValue=100;?

    ?????? $ 結(jié)束行分號(hào)有無(wú)都可以; ??? 但再 onsubmit="javascript:function();return false;"

    ?????? $ 關(guān)鍵字 ; 提別注意

    ??????????????? "constructor" bean.constructor

    ???????????????????? //print bean function(){

    ????????????????????????? ....

    ????????????????????? }

    ??????????????? "typeof" ? var test=1; alert(typeof testX); //output "undefined"

    ??????????????? "NaN" - not a number ->? isNan("blue"); //output "true" ? ->isNan("123"); //output "false"?

    ?????? $ 對(duì)象; var o = new Object(); var a = {}?

    ?? ??? ??? ??? ?這里特別說(shuō)明下 我們普通寫(xiě)的 一個(gè) function 就是一個(gè) object?

    ?? ??? ??? ?? 這?? var a = {name:"劉凱毅"} 等同與 var a = function(){this.name="劉凱毅"};

    ?? ??? ??? ??? ???? 來(lái)個(gè) {name:"test",pass:"123456",addr:"bj"} //這是什么 ?! json

    ?? ??? ??? ???????? 當(dāng) var str = '{name:"test",pass:"123456",addr:"bj"}'

    ?? ??? ??? ??? ???? var objectBean = eval(str); //這里就是 對(duì)象 objectBea.name 使用了

    ? 域概念:

    <SCRIPT type=text/javascript>
    var sMessage = 'Hello';
    function setSomething() {
    ? sColor = 'red';
    ? sMessage = 'Hello World!';
    }
    setSomething();
    alert(sMessage); //Hello World!
    alert(sColor); //red
    </SCRIPT>
    <SCRIPT type=text/javascript>
    var sMessage = 'Hello';
    function setSomething() {
    ? var sColor = 'red';
    ? sMessage = 'Hello World!';
    }
    setSomething();
    alert(sMessage); //Hello World!
    alert(sColor); // 什么都沒(méi)有
    </SCRIPT>

    <SCRIPT type=text/javascript>
    var sMessage = 'Hello';
    function setSomething() {
    ? var sColor = 'red';
    ? var sMessage = 'Hello World!';
    }
    setSomething();
    alert(sMessage); //Hello
    alert(sColor); // 什么都沒(méi)有
    </SCRIPT>

    ??????????

    為面向?qū)ο笞龌A(chǔ):object prototype 類(lèi)型的對(duì)象應(yīng)用。參考

    // 最簡(jiǎn)單的 繼承
    Object.prototype.inObj?=?1;

    function?A()
    {
    ????this.inA?=?2;
    }
    ?
    A.prototype.inAProto?=?3;
    ?
    B.prototype?=?new?A;????????????//?Hook?up?A?into?B's?prototype?chain
    B.prototype.constructor?=?B;
    function?B()
    {
    ????this.inB?=?4;
    }
    ?
    B.prototype.inBProto?=?5;
    ?
    x?=?new?B;
    document.write(x.inObj?+?',?'?+?x.inA?+?',?'?+?x.inAProto?+?',?'?+?x.inB?+?',?'?+?x.inBProto);

    //1, 2, 3, 4, 5
    //增加點(diǎn)信心 http://www.json.org/json.js
    Object.prototype.toJSONString = function (filter) {
    return JSON.stringify(this, filter);
    };
    后我們就可以使用 bean.toJSONString()不是嗎?

    ??? $ arguments ;

    ???????? function getFun(){alert(arguments.length);}?? ;

    ?

    ?? ??? ??? ??? ?getFun("xx") //output 1

    ?? ??? ??? ??? ?getFun("xx",23) //output 2



    ?? $ 語(yǔ)句 ;特殊說(shuō)明下 for?

    ?????????? for(var i=0i<iCount;i++)?? 或 for( attr in object ) ;

    ?????????? 如果無(wú)聊 你可以 for( sProp in window ){alert(sProp+"你丫點(diǎn)啊!");} //看看 javascript 的反射

    ??????????????

    ? ? ? ? ? ? ? ??

    ???


    面向?qū)ο螅?/b>

    ? var bean = new Bean();

    ??

    ? 1.工廠方法

    ??????? ??? function getAttr(){

    ???? ?? ??? ???? alert(this.attr)

    ??????????? }

    ??????????? function Bean(tattr){

    ?? ??? ??? ???? var bean = new Object;

    ?? ??? ??? ?????bean.attr = tattr;

    ?? ??? ??? ?????bean.getAttr = getAttr;

    ?? ??? ??? ???? return bean ;

    ??????????? }

    ?? ???? 根本就是山寨版 面向?qū)ο?br />

    ? 2.構(gòu)造

    ????? ??? function Bean(tattr){

    ?? ??? ?????? this.attr = tattr ;

    ?? ??? ??? ?? bean.getAttr = function(){

    ?? ??? ??? ?????alert(this.attr);

    ?? ??? ??? ? ?} ? ?

    ?? ??? ???}

    ?? 其上 2 總 再Bean 對(duì)象創(chuàng)建時(shí),方法會(huì) “重復(fù)生成函數(shù)”!


    ? 3.原型模式

    ??? function Bean(){}

    ??? Bean.prototype.attr = "";

    ??? Bean.prototype.getAttr=function(){alert(this.attr);}

    ?? ?

    ?? 解決 “重復(fù)生成函數(shù)” 問(wèn)題,但新的問(wèn)題 Bean.prototype.getArray = new Array();


    ?? 其 new 對(duì)象 bean1 和 bean2 都會(huì)共享 new Array 空間(是我們不想看到的)


    ? 4.混合 模型 :)? 哈哈

    ???? function Bean(){

    ?? ??? ?this.attr= "";

    ?? ??? ?this.getArray=new Array;

    ?? ?}

    ?? ?Bean.prototype.getAttr=function(){alert(this.attr);}

    ?

    ? 5.動(dòng)態(tài)原型 (注意下面開(kāi)始,就是真正的面向?qū)ο?/span>!!!)

    ?? ??? function Bean(){

    ?? ???? this.attr= "";
    ?? ??? ?this.getArray=new Array;

    ?? ???? //classload 加載 時(shí)

    ?? ???? if(typeof Bean._initialized == "undefined" ){

    ?? ??? ???? Bean.prototype.getAttr=function(){alert(this.attr);};

    ?? ???? ??? Bean._initialized= true ;

    ?? ??? ?}

    ???? }

    ???

    /****************************************************************/

    對(duì)象繼承

    ? 1.對(duì)象冒充!!(可支持多繼承,山寨很強(qiáng)大)

    ????? function classA(sstr){

    ?? ???? this.color = sstr ;

    ?? ???? this.sayColor = function(){

    ?? ??? ???? alert(this.color);

    ?? ??? ?};

    ?? ???}

    ?? ?? function classC(){}

    ?? ??? function classB(){

    ?? ??? ???? this.newMethod =ClassA ;

    ?? ??? ???? this.newMethod();

    ?? ??? ???? delete this.newMethod ;


    ?? ??? ???? this.newMethod =ClassC ;

    ?? ??? ???? this.newMethod();

    ?? ??? ???? delete this.newMethod ;

    ?? ??? ????

    ?? ??? ???? this.arrt = "google";

    ?? ??? ?}

    ?? ?

    ? 2.call() apply() 也山寨,

    ????? function classA(sstr){

    ?? ???? this.color = sstr ;

    ?? ???? this.sayColor = function(str){

    ?? ??? ???? alert(str+this.color);

    ?? ??? ?};

    ?? ???}

    ?? ??? function classB(){

    ?? ??? ??? // this.newMethod =ClassA ;

    ?? ??? ??? // this.newMethod();

    ?? ??? ??? // delete this.newMethod ;

    ?? ??? ???? classA.call(this,"red");

    ?? ??? ???? //classA.apply(this,new Array("red"))

    ?? ??? ???? this.arrt = "baidu";

    ?? ??? }


    3.正統(tǒng)的繼承 原型鏈 (但不支持多繼承)
    ??? function classA(){this.oo="test";}
    ??? classA.prototype.color = "red";
    ??? function classB(){}
    ??? classB.prototype = new classA ;
    ??? classB.prototype.sayName = function(){
    ?? ???? alert( this.color );
    ?? ?}
    ?? ?
    var bb = new classB ;
    ?? ?bb.sayName();
    // output red
    ?? ?
    alert(bb.oo); // output test

    ?? ?alert( bb instanceof classA); //output true
    ?? ?alert( bb instanceof classB); //output? true

    4.如果你要多繼承!!并且還支持 instanceof
    ?? ???? 混合方式:
    ?? ???? function classA(){}
    ?? ???? function classB(){}
    ?? ???? function classC(){
    ?? ??? ???? classA.call(this);
    ?? ??? ???? classC.call(this);
    ?? ??? ?}
    ?? ???? classC.prototype = new classA ;//注意 這
    instanceof 只能對(duì) A有用

    ?? ??? ?






    ???

    posted @ 2009-02-12 11:56 G_G 閱讀(1838) | 評(píng)論 (2)編輯 收藏



    下載:flash-plugin-10.0.15.3-release.i386.rpm

    ?rpm -ivh flash-plugin-10.0.15.3-release.i386.rpm

    posted @ 2009-01-12 23:39 G_G 閱讀(743) | 評(píng)論 (0)編輯 收藏

    主站蜘蛛池模板: 国产免费看插插插视频| 国产综合成人亚洲区| 亚洲精品无码久久久久AV麻豆| 亚洲一区免费视频| 久久青青草原国产精品免费| 无人视频免费观看免费视频| 亚洲砖码砖专无区2023| 久久亚洲精品人成综合网| 亚洲色精品aⅴ一区区三区| 国产高清免费在线| 久久这里只有精品国产免费10| 久久香蕉国产线看免费| 国产免费福利体检区久久| 老司机精品视频免费| 亚洲爆乳精品无码一区二区| 亚洲人妖女同在线播放| 亚洲美女免费视频| 亚洲尹人九九大色香蕉网站 | 亚洲精品mv在线观看| 亚洲国产精品久久久久网站| 亚洲日韩欧洲无码av夜夜摸 | 国产成人亚洲午夜电影| 亚洲精品女同中文字幕| 一区二区亚洲精品精华液| 激情亚洲一区国产精品| 亚洲人成网站在线观看播放青青| 在线电影你懂的亚洲| 亚洲欧洲日产国码二区首页| 久久久久亚洲AV无码网站| 久久久久亚洲AV片无码下载蜜桃| 亚洲Av综合色区无码专区桃色| 亚洲大尺度无码无码专区| 亚洲精品国产精品乱码在线观看| 国产亚洲精品激情都市| 亚洲一区二区三区影院| 亚洲理论电影在线观看| 亚洲av日韩av天堂影片精品| 久久久久亚洲精品美女| 亚洲欧洲精品视频在线观看| 亚洲国产精品专区| 亚洲免费网站观看视频|