51Testing软件测试论坛

 找回密码
 (注-册)加入51Testing

QQ登录

只需一步,快速开始

微信登录,快人一步

查看: 6769|回复: 4
打印 上一主题 下一主题

新人求助,如何用eclipse运行JMeter代码

[复制链接]

该用户从未签到

跳转到指定楼层
1#
发表于 2009-3-8 22:34:58 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
由于毕设的要求需要看一下JMeter的代码,我下载了jakarta-jmeter-2.3.2_src.zip,然后我自己试着导入了一下,但是有很多错误,不知道应该导入才能正确运行呢?请指点,不胜感激!
分享到:  QQ好友和群QQ好友和群 QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友
收藏收藏
回复

使用道具 举报

该用户从未签到

2#
发表于 2009-4-24 13:47:53 | 只看该作者
ant
回复 支持 反对

使用道具 举报

该用户从未签到

3#
发表于 2009-8-19 16:03:29 | 只看该作者
楼上的没说清楚

ant?
回复 支持 反对

使用道具 举报

该用户从未签到

4#
发表于 2009-8-21 23:06:01 | 只看该作者
楼上明示
回复 支持 反对

使用道具 举报

该用户从未签到

5#
发表于 2009-12-17 21:05:34 | 只看该作者

eclipse3.2 下编译jmeter源代码

1,下载jakarta-jmeter-2.2_src.zip和jakarta-jmeter-2.2.zip解压。
2,下载3个jar包,(很重要要不会有n多的错误),分别是mail.jar,jms.jar,activation.jar
3,将jakarta-jmeter-2.2.zip下的lib中的jar包拷到jakarta-jmeter-2.2_src.zip下的lib目录中并加上下载的三个jar包。并且修改
commons-logging1.1.jar为commons-logging.jar。然后在lib目录下新增两个空文件夹ext,junit.
4,从jakarta-jmeter-2.2.zip解压的目录下复制ApacheJMeter.jar和jmeter.properties到jakarta-jmeter-2.2_src.zip解压的目录下。
5,然后打开eclipse,新建java工程,命名,选择import,选择从文件导入,选择jakarta-jmeter-2.2_src.zip解压后的目录,选择除src目录以外的所有目录。之后再导入src目录(因为新建java工程是已经有src目录了),所以要分别导入。
6,关闭eclipse将jakarta-jmeter-2.2_src.zip下的eclipse.classpath中的内容复制一份替换工程下的.classpath的内容,同时增加几个jar包。内容如下:
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
    <classpathentry utput="build/jorphan" kind="src" path="src/jorphan"/>
    <classpathentry utput="build/examples" kind="src" path="src/examples"/>
    <classpathentry utput="build/junit" kind="src" path="src/junit"/>
    <classpathentry utput="build/reports" kind="src" path="src/reports"/>
    <classpathentry utput="build/test" kind="src" path="test/src"/>
    <classpathentry utput="build/protocol/jms" kind="src" path="src/protocol/jms"/>
    <classpathentry utput="build/protocol/mail" kind="src" path="src/protocol/mail"/>
    <classpathentry excluding="org/apache/jmeter/images/|org/apache/jmeter/resources/*.properties" utput="build/core" kind="src" path="src/core"/>
    <classpathentry utput="build/components" kind="src" path="src/components"/>
    <classpathentry utput="build/functions" kind="src" path="src/functions"/>
    <classpathentry utput="build/protocol/http" kind="src" path="src/protocol/http"/>
    <classpathentry utput="build/protocol/ftp" kind="src" path="src/protocol/ftp"/>
    <classpathentry utput="build/protocol/jdbc" kind="src" path="src/protocol/jdbc"/>
    <classpathentry utput="build/protocol/java" kind="src" path="src/protocol/java"/>
    <classpathentry utput="build/protocol/ldap" kind="src" path="src/protocol/ldap"/>
    <classpathentry utput="build/protocol/tcp" kind="src" path="src/protocol/tcp"/>
    <classpathentry utput="build/monitor/model" kind="src" path="src/monitor/model"/>
    <classpathentry utput="build/monitor/components" kind="src" path="src/monitor/components"/>
    <classpathentry utput="build/htmlparser" kind="src" path="src/htmlparser"/>
    <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
    <classpathentry kind="lib" path="lib/excalibur-logger-1.1.jar"/>
    <classpathentry kind="lib" path="lib/avalon-framework-4.1.4.jar"/>
    <classpathentry kind="lib" path="lib/jakarta-oro-2.0.8.jar"/>
    <classpathentry kind="lib" path="lib/js.jar"/>
    <classpathentry kind="lib" path="lib/junit.jar"/>
    <classpathentry kind="lib" path="lib/logkit-1.2.jar"/>
    <classpathentry kind="lib" path="lib/Tidy.jar"/>
    <classpathentry kind="lib" path="lib/commons-collections.jar"/>
    <classpathentry kind="lib" path="lib/commons-codec-1.3.jar"/>
    <classpathentry kind="lib" path="lib/soap.jar"/>
    <classpathentry kind="lib" path="lib/jdom-1.0.jar"/>
    <classpathentry kind="lib" path="lib/xalan.jar"/>
    <classpathentry kind="lib" path="lib/xercesImpl.jar"/>
    <classpathentry kind="lib" path="lib/xml-apis.jar"/>
    <classpathentry kind="lib" path="lib/commons-httpclient-3.0.1.jar"/>
    <classpathentry kind="lib" path="lib/commons-logging.jar"/>
        <classpathentry kind="lib" path="lib/commons-jexl-1.0.jar"/>
    <classpathentry kind="lib" path="lib/excalibur-datasource-1.1.1.jar"/>
    <classpathentry kind="lib" path="lib/excalibur-instrument-1.0.jar"/>
    <classpathentry kind="lib" path="lib/excalibur-pool-1.2.jar"/>
    <classpathentry kind="lib" path="lib/xstream-1.1.3.jar"/>
    <classpathentry kind="lib" path="lib/xpp3_min-1.1.3.4.I.jar"/>
    <classpathentry kind="lib" path="lib/batik-awt-util.jar"/>
    <classpathentry kind="lib" path="lib/jCharts-0.7.5.jar"/>
    <classpathentry kind="lib" path="lib/bsf-2.3.0.jar"/>
        <classpathentry kind="lib" path="lib/mail.jar"/>
        <classpathentry kind="lib" path="lib/activation.jar"/>
        <classpathentry kind="lib" path="lib/jms.jar"/>
    <classpathentry kind="output" path="lib/ext"/>
                                          
</classpath>
然后重新开启eclipse,选择工程编译,此时会有20个错误吧,是junit的错误,定位到java文件修改下代码(前几行有正确的格式assertequal函数的参数有错)。编译成功了。

8,选择build.xml使用ant打包.
9,之后可参考http://people.apache.org/~mkostrze/jmeter-eclipse/index.html的后半部份,这样就可以用eclipse来进行debug了。
回复 支持 反对

使用道具 举报

本版积分规则

关闭

站长推荐上一条 /1 下一条

小黑屋|手机版|Archiver|51Testing软件测试网 ( 沪ICP备05003035号 关于我们

GMT+8, 2024-5-7 09:03 , Processed in 0.072296 second(s), 27 queries .

Powered by Discuz! X3.2

© 2001-2024 Comsenz Inc.

快速回复 返回顶部 返回列表