You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@jmeter.apache.org by rroy <rr...@cedarpointcom.com> on 2010/07/29 23:16:37 UTC
junit4 annotations in class which extends
I'm new to JMeter and would like to use it to drive load on some pre-existing
JUnit4 tests I have.
I took the sample in lib/junit/test/DummyAnnotatedTest.java and changed just
this line from
public class DummyAnnotatedTest
to
public class DummyAnnotatedTest extends org.echarts.test.sip.CATTestCase
and recompiled (adding the necessary lib to support my extension) cleanly.
Before the change, the JUnit Sampler scanned all classes/methods w/o
problem.
After the change scan fails to identify any classes/methods (even after
restart of JMeter.)
Is this a bug or it is the case that I need a custom scanner to do what I
want to do?
--
View this message in context: http://jmeter.512774.n5.nabble.com/junit4-annotations-in-class-which-extends-tp2256746p2256746.html
Sent from the JMeter - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jmeter-user-help@jakarta.apache.org
Re: junit4 annotations in class which extends
Posted by rroy <rr...@cedarpointcom.com>.
I'll answer my own question (for posterity). After much playing around I
discovered that the problem was that failures to properly load files from
lib/junit/*jar are silently ignored by JMeter.
If you're experiencing similar issues do this:
Turn ON logging at DEBUG level in bin/log4j.conf
log4j.category.org.apache.orphan.reflect=debug
Restart JMeter and look at jmeter.log.
2010/08/06 16:12:48 DEBUG - jorphan.reflect.ClassFinder: listPaths :
/home/rroy/jakarta-jmeter-2.4/lib/junit/test.jar
2010/08/06 16:12:48 DEBUG - jorphan.reflect.ClassFinder: listPaths :
/home/rroy/kitcat1.1_src/EChartsSipTest/lib/echarts-jain-sip.jar
2010/08/06 16:12:48 DEBUG - jorphan.reflect.ClassFinder: listPaths :
/home/rroy/kitcat1.1_src/EChartsSipTest/lib/echarts.jar
2010/08/06 16:12:48 DEBUG - jorphan.reflect.ClassFinder: listPaths :
/home/rroy/kitcat1.1_src/EChartsSipTest/lib/echarts-siptest.jar
2010/08/06 16:12:48 DEBUG - jorphan.reflect.ClassFinder: listPaths :
/home/rroy/kitcat1.1_src/EChartsSipTest/lib/hamcrest-all-1.1.jar
2010/08/06 16:12:48 DEBUG - jorphan.reflect.ClassFinder: listPaths :
/home/rroy/kitcat1.1_src/EChartsSipTest/lib/jain-sip-sdp-1.2.118.jar
2010/08/06 16:12:48 DEBUG - jorphan.reflect.ClassFinder: listPaths :
/home/rroy/KitCAT_1.1-beta/lib/log4j-1.2.8.jar
2010/08/06 16:12:48 DEBUG - jorphan.reflect.ClassFinder: listPaths :
/home/rroy/KitCAT_1.1-beta/lib/junit-4.4.jar
2010/08/06 16:12:49 DEBUG - jorphan.reflect.ClassFinder: isChildOf:
NoClassDefFoundError: org/apache/tools/ant/Task
2010/08/06 16:12:49 DEBUG - jorphan.reflect.ClassFinder: isChildOf:
NoClassDefFoundError: org/easymock/IArgumentMatcher
2010/08/06 16:12:49 DEBUG - jorphan.reflect.ClassFinder: isChildOf:
NoClassDefFoundError: org/jmock/core/Constraint
2010/08/06 16:12:50 DEBUG - jorphan.reflect.ClassFinder:
listClasses.size()=0
If you have JMeter source you can see that these messages emminate from
src/jorphan/org/apache/jorphan/reflect/ClassFinder.java.
The solution is to set "user.classpath" within jmeter.properties file
(setting CLASSPATH env var will not do it! ...as explained elsewhere in the
JMeter User Manual.)
With the correct classpath set your debug output should now show something
like this:
2010/08/06 16:13:10 DEBUG - jorphan.reflect.ClassFinder:
listClasses.size()=1
2010/08/06 16:13:10 DEBUG - jorphan.reflect.ClassFinder: listClasses :
system.RegressionTest
--
View this message in context: http://jmeter.512774.n5.nabble.com/junit4-annotations-in-class-which-extends-tp2256746p2267072.html
Sent from the JMeter - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jmeter-user-help@jakarta.apache.org
Re: junit4 annotations in class which extends
Posted by rroy <rr...@cedarpointcom.com>.
I should've mentioned: DummyAnnotatedTest.java is a working sample that
comes as part of the JMeter distribution (unpacked from lib/junit/test.jar).
--
View this message in context: http://jmeter.512774.n5.nabble.com/junit4-annotations-in-class-which-extends-tp2256746p2259505.html
Sent from the JMeter - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jmeter-user-help@jakarta.apache.org