Open narramadan opened 10 years ago
Madan,
Can you share your build.grale?
My build.gradle
apply plugin: 'java'
apply plugin: 'eclipse'
apply plugin: 'jmeter'
//**************** Gradle Tasks **************//
// gradle clean - Clean Project
// gradle jmeterRun - Execute jMeter Scripts
// gradle jmeterEditor - Open jMeter Console GUI
// gradle packageTests - Build, test and package files under test folder to jar
// Java Compatibility Settings
sourceCompatibility = 1.6
targetCompatibility = 1.6
archivesBaseName = 'performance-tests'
configurations {
providedCompile
}
// Configured Reporsitories to download Dependencies
repositories {
mavenRepo url: "http://repo.maven.apache.org/maven2"
}
buildscript {
repositories {
mavenCentral()
mavenRepo url: "https://oss.sonatype.org/content/repositories/snapshots/"
mavenRepo url: "https://oss.sonatype.org/content/groups/public"
}
dependencies {
classpath "com.github.kulya:jmeter-gradle-plugin:1.3.2-2.9-SNAPSHOT"
}
}
// Configure all dependencies
dependencies {
testCompile group: 'org.slf4j', name: 'slf4j-api', version:'1.7.2'
testCompile group: 'org.testng', name: 'testng', version:'6.8'
testCompile group: 'org.apache.jmeter', name: 'ApacheJMeter_java', version:'2.9'
testCompile group: 'org.apache.httpcomponents', name: 'httpclient', version:'4.2.5'
runtime group: 'org.slf4j', name: 'slf4j-log4j12', version:'1.7.2'
runtime(group: 'log4j', name: 'log4j', version:'1.2.15') {
exclude(module: 'mail')
exclude(module: 'jms')
exclude(module: 'jmxtools')
exclude(module: 'jmxri')
}
}
// Run Unit tests with TestNG
test {
useTestNG()
testLogging {
// Show that tests are run in the command-line output
events 'passed' //'started', 'passed'
}
}
task packageTests(type: Jar, dependsOn: 'test') {
from sourceSets.test.output
}
task copyTestsArchiveToJmeterLib(type: Copy, dependsOn: 'packageTests') {
from "build/libs/performance-tests.jar"
into "build/jmeter/lib/ext"
}
jmeterRun.dependsOn copyTestsArchiveToJmeterLib
jmeterEditor.dependsOn copyTestsArchiveToJmeterLib
If you observe, jmeterRun and jmeterEditor depends on task 'copyTestsArchiveToJmeterLib' which will build,package and copy the archive jar file to 'build/jmeter/lib/ext'.
Tests include classes which extend 'AbstractJavaSamplerClient'. These test classes are not being shown when jar is placed under 'build/jmeter/lib/ext'.
Let me know if you need any other information.
Thanks, Madan N
Can you please try to rerun your use case with jmeter version 1.3.2-2.x?
Hi,
I am trying to use Java Request Sampler with jMeter. Had bundled a class which extends 'AbstractJavaSamplerClient' and placed the jar under '{MY_PROJECT}\build\jmeter\lib\ext'.
Java Sampler class is not getting displayed when Java Request Sampler is added to a ThreadGroup.
Tried adding this jar in {JMETER_DIST}\lib\ext and was able to see my class.
Is there any thing I am missing out ?
Thanks, Madan N