1. 程式人生 > >在Eclipse下運行Jmeter3.0源代碼

在Eclipse下運行Jmeter3.0源代碼

put 目的 folders 導入 gen blog nconf tle ssp

1.創建項目

準備工作:在http://jmeter.apache.org/download_jmeter.cgi中分別下載binaries和source兩個壓縮包,前者為release版本,後者則為jmeter的源碼。

1、在eclipse中新建javaproject,名為ApacheJmeter3.0,在下一步中選擇"Allowoutputfolders for source folders",防止導入源碼時把bin目錄做為輸出目錄給清理掉。

技術分享

輸入Project name後,點擊Netx按鈕。

技術分享

選擇Allow output folders for source folders選項後,點擊Finish按鈕。

2.導入文件系統源代碼

技術分享 選擇從文件系統導入apache-jmeter-2.8源碼;(即右鍵apache-jmeter-2.8點擊import,選擇General-FileSystem然後導入源碼) 選擇項目後,點擊Next按鈕。 技術分享 選擇項目點擊Select All按鈕,並且指定Into folder目錄的Apache3.0的路徑,最後點擊Finished按鈕。 技術分享 在project目錄下把eclipse.classpath中的內容復制到.classpath文件中;

3.拷貝jar到eclipse項目下的lib目錄

技術分享

3、在project目錄下執行antdownload_jars,或在這之前就先把安裝好的jmeter(可運行jmeter)的lib目錄下文件都拷貝到項目下。

技術分享

4.附加jar包

技術分享

選擇項目,右擊項目的Properties->Java Build Path->Libraries->Add External JARS…

技術分享

選擇jar包,點擊打開按鈕。

技術分享

選擇select all 按鈕後,點擊Apply按鈕,最後點擊OK就可以附加jar文件成功。

5.拷貝jmeter.properties文件

技術分享 從apache-jmeter-3.0包中拷貝jmeter.properties(apache-jmeter-3.0非源代碼文件夾,而是一個可直接運行的jmeter的文件夾)

技術分享

從apache-jmeter-3.0包中拷貝jmeter.properties到bin目錄下面,同時拷貝到/ApacheJmeter3.0/src/core/org/apache/jmeter/

6.運行設置

技術分享

打開Run->RunConfigurations,選擇工作目錄為“${workspace_loc:jmeter/bin}”,即可運行jmeter了。找到創建項目ApacheJmeter3.0,找到bin目錄,並選中。

技術分享

選擇bin目錄後,點擊Ok按鈕。

技術分享

點擊Apply按鈕,最後點擊Run按鈕。

技術分享

點擊Proceed按鈕運行項目。

7.運行成功

技術分享 運行jmeter成功。

轉載:http://blog.csdn.net/chris_111x/article/details/52312750

在Eclipse下運行Jmeter3.0源代碼