jmeter-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sebb <seb...@gmail.com>
Subject Re: Having problem extending Controller
Date Sun, 19 Apr 2009 23:16:46 GMT
On 19/04/2009, Prasad Iyer <prasadiyer@ymail.com> wrote:
> Hi,
>  I have created a EmptyController.java which extends the GenericController. To test a
value of the variable. If the variable is empty I don't want to execute the Sample.
>  I am developing this on Eclipse IDE
>  My problem is JMeter is throwing an exception. I don't know why JMeter is not finding
the class. Can anyone please help me? I tried using IfController. But It won't serve my purpose.
As I am going to add lot of validation in this class.

Why is the If Controller no good?

Note that the way the controllers interact is the most complicated
part of JMeter, so I would avoid going down that route unless you are
prepared for a lot of hard work.

>
>  Following is the stack trace
>
>  cause-exception     : com.thoughtworks.xstream.converters.ConversionException
>  cause-message       : EmptyController : EmptyController : EmptyController : EmptyController
>  first-jmeter-class  : org.apache.jmeter.save.converters.HashTreeConverter.unmarshal(HashTreeConverter.java:87)
>  class               : org.apache.jmeter.save.ScriptWrapper
>  required-type       : org.apache.jorphan.collections.ListedHashTree
>  path                : /jmeterTestPlan/hashTree/hashTree/hashTree/hashTree/EmptyController
>  line number         : 46
>  -------------------------------
>  2009/04/18 20:40:20 ERROR - jmeter.JMeter:  java.lang.NullPointerException
>         at org.apache.jmeter.gui.tree.JMeterTreeModel.addSubTree(JMeterTreeModel.java:91)
>         at org.apache.jmeter.JMeter.run(JMeter.java:728)
>         at org.apache.jmeter.JMeter.startNonGui(JMeter.java:706)
>         at org.apache.jmeter.JMeter.start(JMeter.java:361)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>         at java.lang.reflect.Method.invoke(Method.java:597)
>         at org.apache.jmeter.NewDriver.main(NewDriver.java:210)
>
>
>  <!--
>  following is my JMX file
>  -->
>  <?xml version="1.0" encoding="UTF-8"?>
>  <jmeterTestPlan version="1.2" properties="2.1">
>   <hashTree>
>     <TestPlan guiclass="TestPlanGui" testclass="TestPlan" testname="Test Plan" enabled="true">
>       <stringProp name="TestPlan.comments"></stringProp>
>       <boolProp name="TestPlan.functional_mode">false</boolProp>
>       <boolProp name="TestPlan.serialize_threadgroups">false</boolProp>
>       <elementProp name="TestPlan.user_defined_variables" elementType="Arguments"
guiclass="ArgumentsPanel" testclass="Arguments" testname="User Defined Variables" enabled="true">
>         <collectionProp name="Arguments.arguments"/>
>       </elementProp>
>       <stringProp name="TestPlan.user_define_classpath"></stringProp>
>     </TestPlan>
>     <hashTree>
>       <ThreadGroup guiclass="ThreadGroupGui" testclass="ThreadGroup" testname="Thread
Group" enabled="true">
>         <elementProp name="ThreadGroup.main_controller" elementType="LoopController"
guiclass="LoopControlPanel" testclass="LoopController" testname="Loop Controller" enabled="true">
>           <boolProp name="LoopController.continue_forever">false</boolProp>
>           <stringProp name="LoopController.loops">1</stringProp>
>         </elementProp>
>         <stringProp name="ThreadGroup.num_threads">1</stringProp>
>         <stringProp name="ThreadGroup.ramp_time">1</stringProp>
>         <longProp name="ThreadGroup.start_time">1240084414000</longProp>
>         <longProp name="ThreadGroup.end_time">1240084414000</longProp>
>         <boolProp name="ThreadGroup.scheduler">false</boolProp>
>         <stringProp name="ThreadGroup.on_sample_error">continue</stringProp>
>         <stringProp name="ThreadGroup.duration"></stringProp>
>         <stringProp name="ThreadGroup.delay"></stringProp>
>       </ThreadGroup>
>       <hashTree>
>         <GenericController guiclass="LogicControllerGui" testclass="GenericController"
testname="Simple Controller" enabled="true"/>
>         <hashTree>
>           <TestAction guiclass="TestActionGui" testclass="TestAction" testname="Test
Action" enabled="true">
>             <intProp name="ActionProcessor.action">1</intProp>
>             <intProp name="ActionProcessor.target">0</intProp>
>             <stringProp name="ActionProcessor.duration"></stringProp>
>           </TestAction>
>           <hashTree>
>             <BeanShellPreProcessor guiclass="TestBeanGUI" testclass="BeanShellPreProcessor"
testname="BeanShell PreProcessor" enabled="true">
>               <stringProp name="filename"></stringProp>
>               <stringProp name="parameters"></stringProp>
>               <boolProp name="resetInterpreter">false</boolProp>
>               <stringProp name="script">vars.put(&quot;str&quot;, &quot;dis&quot;);
>  System.out.println(&quot;hello world&quot;);</stringProp>
>             </BeanShellPreProcessor>
>             <hashTree/>
>           </hashTree>
>           <EmptyController testclass="EmptyController" testname="Empty Controller"
enabled="true">
>             <stringProp name="EmptyController.condition">str</stringProp>
>           </EmptyController>
>           <hashTree>
>             <TestAction guiclass="TestActionGui" testclass="TestAction" testname="Test
Action" enabled="true">
>               <intProp name="ActionProcessor.action">1</intProp>
>               <intProp name="ActionProcessor.target">0</intProp>
>               <stringProp name="ActionProcessor.duration"></stringProp>
>             </TestAction>
>             <hashTree>
>               <BeanShellPreProcessor guiclass="TestBeanGUI" testclass="BeanShellPreProcessor"
testname="BeanShell PreProcessor" enabled="true">
>                 <boolProp name="resetInterpreter">true</boolProp>
>                 <stringProp name="parameters"></stringProp>
>                 <stringProp name="filename"></stringProp>
>                 <stringProp name="script">System.out.println(&quot;hello world&quot;);</stringProp>
>               </BeanShellPreProcessor>
>               <hashTree/>
>             </hashTree>
>           </hashTree>
>         </hashTree>
>       </hashTree>
>     </hashTree>
>   </hashTree>
>  </jmeterTestPlan>
>
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jmeter-user-help@jakarta.apache.org


Mime
View raw message