• <ruby id="5koa6"></ruby>
    <ruby id="5koa6"><option id="5koa6"><thead id="5koa6"></thead></option></ruby>

    <progress id="5koa6"></progress>

  • <strong id="5koa6"></strong>
    • 軟件測試技術
    • 軟件測試博客
    • 軟件測試視頻
    • 開源軟件測試技術
    • 軟件測試論壇
    • 軟件測試沙龍
    • 軟件測試資料下載
    • 軟件測試雜志
    • 軟件測試人才招聘
      暫時沒有公告

    字號: | 推薦給好友 上一篇 | 下一篇

    Java 項目中應用Subversion配置與管理

    發布: 2008-5-29 10:20 | 作者: 網絡轉載 | 來源: 網絡轉載 | 查看: 144次 | 進入軟件測試論壇討論

    領測軟件測試網

    庫的初始化工作要首先調用的是方法DAVRepositoryFactory.setup()。SVNRepository類包含了所有直接訪問Subversion倉庫的方法,將Subversion倉庫樹狀結構的根路徑提供給SVNRepositoryFactory類后,就完成了這個類的初始化,而ISVNAuthenticationManager類的作用是向SVNRepository提供訪問Subversion倉庫的授權信息。

    public void initRepository() {
            //initialize the system to work over http
            DAVRepositoryFactory.setup();
            ............
            //point to the root folder of repository
            SVNURL svnUrl = SVNURL.parseURIEncoded
                            ("http://localhost/repos/");
            //initialize the SVNRepository
            theRepository = SVNRepositoryFactory.
                            create(svnUrl);
            //Creates the Auth manager with our user
            //and password credentials
            ISVNAuthenticationManager authManager =
                    new BasicAuthenticationManager
                    (name, password);
            //provides the credentials to the
            //SVNRepository
            theManager.setAuthenticationManager
                    (authManager);
            ........
    }


    在Subversion中存儲數據

        Subversion需要使用層次結構存儲數據,這樣我們先要設定一下領域實體的層次結構,這里使用一個命名為“DomainObjects”的文件夾來存放領域數據。領域對象類將會檢測這個目錄下存放領域對象的所有子目錄,而每個獨立的域對象被以XML格式進行存儲,并以其主鍵進行命名。

        為存儲LoanData域對象,我們先要執行SVNManager對象的checkInObject方法,通過SVNRepository 執行的ISVNEditor對象來在Subversion倉庫中的建立和更新域對象的版本,但只有在closeEdit被調用后,才會提交所有的操作。SVNDeltaGenerator類用于獲取當前版本與被更新版本之間的差異,Subversion通過存儲版本間差異部分的形式存放新的版本,這樣會使提高網絡效率。

    public SVNResult checkInObject(
                    BaseTrackingObject obj){
            .....
            //Obtain the editor handle from the
            //repository
            ISVNEditor editor = theRepository.
                    getCommitEditor(obj.
                    getModificationReason(), null);
            ....
            //create the file at the specified path
                    editor.addFile(path, null, -1);
            }
            else {
                    //file is already present, so open
                    //the file in the repository
                    editor.openFile(path, -1);
            }
            ....
            String checksum = deltaGenerator.
                            sendDelta(path,
                            new ByteArrayInputStream(
                            obj.getXmlRepresentation().
                            getBytes()),
                            editor, true);
            .....
            editor.closeEdit();
            ...
    }



    延伸閱讀

    文章來源于領測軟件測試網 http://www.kjueaiud.com/

    43/4<1234>

    關于領測軟件測試網 | 領測軟件測試網合作伙伴 | 廣告服務 | 投稿指南 | 聯系我們 | 網站地圖 | 友情鏈接
    版權所有(C) 2003-2010 TestAge(領測軟件測試網)|領測國際科技(北京)有限公司|軟件測試工程師培訓網 All Rights Reserved
    北京市海淀區中關村南大街9號北京理工科技大廈1402室 京ICP備10010545號-5
    技術支持和業務聯系:info@testage.com.cn 電話:010-51297073

    軟件測試 | 領測國際ISTQBISTQB官網TMMiTMMi認證國際軟件測試工程師認證領測軟件測試網

    老湿亚洲永久精品ww47香蕉图片_日韩欧美中文字幕北美法律_国产AV永久无码天堂影院_久久婷婷综合色丁香五月

  • <ruby id="5koa6"></ruby>
    <ruby id="5koa6"><option id="5koa6"><thead id="5koa6"></thead></option></ruby>

    <progress id="5koa6"></progress>

  • <strong id="5koa6"></strong>