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 se...@apache.org on 2004/10/06 03:58:26 UTC

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

sebb        2004/10/05 18:58:26

  Modified:    src/core/org/apache/jmeter/threads Tag: rel-2_0
                        JMeterThread.java
  Log:
  Save sampler success states
  
  Revision  Changes    Path
  No                   revision
  No                   revision
  1.48.2.4  +14 -5     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.48.2.3
  retrieving revision 1.48.2.4
  diff -u -r1.48.2.3 -r1.48.2.4
  --- JMeterThread.java	13 Sep 2004 16:55:54 -0000	1.48.2.3
  +++ JMeterThread.java	6 Oct 2004 01:58:26 -0000	1.48.2.4
  @@ -44,6 +44,7 @@
   import org.apache.jorphan.logging.LoggingManager;
   import org.apache.jorphan.util.JMeterStopTestException;
   import org.apache.jorphan.util.JMeterStopThreadException;
  +import org.apache.jorphan.util.JOrphanUtils;
   import org.apache.log.Logger;
   
   /**
  @@ -64,8 +65,8 @@
       TestCompiler compiler;
       JMeterThreadMonitor monitor;
       String threadName;
  -    JMeterContext threadContext;
  -    JMeterVariables threadVars;
  +    JMeterContext threadContext; // current working thread context
  +    JMeterVariables threadVars;// Initial thread variables
       Collection testListeners;
       ListenerNotifier notifier;
       int threadNum = 0;
  @@ -79,7 +80,9 @@
   	private boolean onErrorStopTest;
   	private boolean onErrorStopThread;
       
  -    public static final String PACKAGE_OBJECT = "JMeterThread.pack";
  +    public static final String PACKAGE_OBJECT = "JMeterThread.pack"; // $NON-NLS-1$
  +    public static final String LAST_SAMPLE_OK = "JMeterThread.last_sample_ok"; // $NON-NLS-1$
  +	public static final String ALL_SAMPLES_OK = "JMeterThread.all_samples_ok"; // $NON-NLS-1$
   
       public JMeterThread()
       {
  @@ -390,6 +393,8 @@
       private void checkAssertions(List assertions, SampleResult result)
       {
           Iterator iter = assertions.iterator();
  +        boolean last_sample_ok=true;
  +        boolean all_samples_ok=true;
           while (iter.hasNext())
           {
           	Assertion assertion= (Assertion)iter.next();
  @@ -399,7 +404,11 @@
                   result.isSuccessful()
                       && !(assertionResult.isError() || assertionResult.isFailure()));
               result.addAssertionResult(assertionResult);
  +            last_sample_ok = result.isSuccessful();
  +            all_samples_ok &= last_sample_ok;
           }
  +        threadContext.getVariables().put(LAST_SAMPLE_OK,JOrphanUtils.booleanToString(last_sample_ok));
  +        threadContext.getVariables().put(ALL_SAMPLES_OK,JOrphanUtils.booleanToString(all_samples_ok));
       }
   
       private void runPostProcessors(List extractors)
  
  
  

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