You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jmeter-dev@jakarta.apache.org by th...@apache.org on 2004/04/22 18:18:25 UTC

cvs commit: jakarta-jmeter/src/core/org/apache/jmeter/threads JMeterThread.java

thads       2004/04/22 09:18:24

  Modified:    src/core/org/apache/jmeter/threads JMeterThread.java
  Log:
  Fixed an exception that occurs if a sampler returns null 
  when sample is called (for TestAction)
  
  Revision  Changes    Path
  1.50      +16 -13    jakarta-jmeter/src/core/org/apache/jmeter/threads/JMeterThread.java
  
  Index: JMeterThread.java
  ===================================================================
  RCS file: /home/cvs/jakarta-jmeter/src/core/org/apache/jmeter/threads/JMeterThread.java,v
  retrieving revision 1.49
  retrieving revision 1.50
  diff -u -r1.49 -r1.50
  --- JMeterThread.java	8 Apr 2004 18:40:08 -0000	1.49
  +++ JMeterThread.java	22 Apr 2004 16:18:24 -0000	1.50
  @@ -253,17 +253,20 @@
                           sampler.setThreadName(threadName);
                           if (sampler instanceof TestBean) ((TestBean)sampler).prepare();               
                           SampleResult result = sampler.sample(null); // TODO: remove this useless Entry parameter
  -                        result.setThreadName(threadName);
  -                        threadContext.setPreviousResult(result);
  -                        runPostProcessors(pack.getPostProcessors());
  -                        checkAssertions(pack.getAssertions(), result);
  -                        notifyListeners(pack.getSampleListeners(), result);
  -                        compiler.done(pack);
  -                        if (result.isStopThread() || (!result.isSuccessful() && onErrorStopThread)){
  -                        	stopThread();
  -                        }
  -                        if (result.isStopTest() || (!result.isSuccessful() && onErrorStopTest)){
  -                        	stopTest();
  +                        if (result != null)
  +                        {
  +	                        result.setThreadName(threadName);
  +                        	threadContext.setPreviousResult(result);
  +	                        runPostProcessors(pack.getPostProcessors());
  +    	                    checkAssertions(pack.getAssertions(), result);
  +        	                notifyListeners(pack.getSampleListeners(), result);
  +            	            compiler.done(pack);
  +                	        if (result.isStopThread() || (!result.isSuccessful() && onErrorStopThread)){
  +                    	    	stopThread();
  +                        	}
  +                        	if (result.isStopTest() || (!result.isSuccessful() && onErrorStopTest)){
  +                        		stopTest();
  +                        	}
                           }
                           if (scheduler)
                           {
  
  
  

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