jmeter-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pmoua...@apache.org
Subject svn commit: r1413358 - in /jmeter/trunk: src/core/org/apache/jmeter/gui/ src/core/org/apache/jmeter/reporters/ src/core/org/apache/jmeter/reporters/gui/ src/core/org/apache/jmeter/samplers/ src/core/org/apache/jmeter/testelement/ src/core/org/apache/jm...
Date Sun, 25 Nov 2012 15:02:36 GMT
Author: pmouawad
Date: Sun Nov 25 15:02:34 2012
New Revision: 1413358

URL: http://svn.apache.org/viewvc?rev=1413358&view=rev
Log:
Bug 54204 - Result Status Action Handler : Add start next thread loop option
Bugzilla Id: 54204

Modified:
    jmeter/trunk/src/core/org/apache/jmeter/gui/OnErrorPanel.java
    jmeter/trunk/src/core/org/apache/jmeter/reporters/ResultAction.java
    jmeter/trunk/src/core/org/apache/jmeter/reporters/gui/ResultActionGui.java
    jmeter/trunk/src/core/org/apache/jmeter/samplers/SampleResult.java
    jmeter/trunk/src/core/org/apache/jmeter/testelement/OnErrorTestElement.java
    jmeter/trunk/src/core/org/apache/jmeter/threads/JMeterThread.java
    jmeter/trunk/xdocs/changes.xml

Modified: jmeter/trunk/src/core/org/apache/jmeter/gui/OnErrorPanel.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/core/org/apache/jmeter/gui/OnErrorPanel.java?rev=1413358&r1=1413357&r2=1413358&view=diff
==============================================================================
--- jmeter/trunk/src/core/org/apache/jmeter/gui/OnErrorPanel.java (original)
+++ jmeter/trunk/src/core/org/apache/jmeter/gui/OnErrorPanel.java Sun Nov 25 15:02:34 2012
@@ -34,6 +34,8 @@ public class OnErrorPanel extends JPanel
     // Sampler error action buttons
     private JRadioButton continueBox;
 
+    private JRadioButton startNextThreadLoopBox;
+
     private JRadioButton stopThrdBox;
 
     private JRadioButton stopTestBox;
@@ -51,6 +53,10 @@ public class OnErrorPanel extends JPanel
         continueBox.setSelected(true);
         panel.add(continueBox);
 
+        startNextThreadLoopBox = new JRadioButton(JMeterUtils.getResString("sampler_on_error_start_next_loop"));
//$NON-NLS-1$
+        group.add(startNextThreadLoopBox);
+        panel.add(startNextThreadLoopBox);
+
         stopThrdBox = new JRadioButton(JMeterUtils.getResString("sampler_on_error_stop_thread"));
//$NON-NLS-1$
         group.add(stopThrdBox);
         panel.add(stopThrdBox);
@@ -83,6 +89,7 @@ public class OnErrorPanel extends JPanel
 
     public void configure(int errorAction) {
         stopTestNowBox.setSelected(errorAction == OnErrorTestElement.ON_ERROR_STOPTEST_NOW);
+        startNextThreadLoopBox.setSelected(errorAction == OnErrorTestElement.ON_ERROR_START_NEXT_THREAD_LOOP);
         stopTestBox.setSelected(errorAction == OnErrorTestElement.ON_ERROR_STOPTEST);
         stopThrdBox.setSelected(errorAction == OnErrorTestElement.ON_ERROR_STOPTHREAD);
         continueBox.setSelected(errorAction == OnErrorTestElement.ON_ERROR_CONTINUE);
@@ -98,6 +105,9 @@ public class OnErrorPanel extends JPanel
         if (stopThrdBox.isSelected()) {
             return OnErrorTestElement.ON_ERROR_STOPTHREAD;
         }
+        if (startNextThreadLoopBox.isSelected()) {
+            return OnErrorTestElement.ON_ERROR_START_NEXT_THREAD_LOOP;
+        }
 
         // Defaults to continue
         return OnErrorTestElement.ON_ERROR_CONTINUE;

Modified: jmeter/trunk/src/core/org/apache/jmeter/reporters/ResultAction.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/core/org/apache/jmeter/reporters/ResultAction.java?rev=1413358&r1=1413357&r2=1413358&view=diff
==============================================================================
--- jmeter/trunk/src/core/org/apache/jmeter/reporters/ResultAction.java (original)
+++ jmeter/trunk/src/core/org/apache/jmeter/reporters/ResultAction.java Sun Nov 25 15:02:34
2012
@@ -55,6 +55,7 @@ public class ResultAction extends OnErro
      *
      * @see org.apache.jmeter.samplers.SampleListener#sampleOccurred(org.apache.jmeter.samplers.SampleEvent)
      */
+    @Override
     public void sampleOccurred(SampleEvent e) {
         SampleResult s = e.getResult();
         log.debug(s.getSampleLabel() + " OK? " + s.isSuccessful());
@@ -68,12 +69,16 @@ public class ResultAction extends OnErro
             if (isStopThread()) {
                 s.setStopThread(true);
             }
+            if (isStartNextThreadLoop()) {
+               s.setStartNextThreadLoop(true);
+            }
         }
     }
 
     /**
      * {@inheritDoc}
      */
+    @Override
     public void sampleStarted(SampleEvent e) {
         // not used
     }
@@ -81,6 +86,7 @@ public class ResultAction extends OnErro
     /**
      * {@inheritDoc}
      */
+    @Override
     public void sampleStopped(SampleEvent e) {
         // not used
     }

Modified: jmeter/trunk/src/core/org/apache/jmeter/reporters/gui/ResultActionGui.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/core/org/apache/jmeter/reporters/gui/ResultActionGui.java?rev=1413358&r1=1413357&r2=1413358&view=diff
==============================================================================
--- jmeter/trunk/src/core/org/apache/jmeter/reporters/gui/ResultActionGui.java (original)
+++ jmeter/trunk/src/core/org/apache/jmeter/reporters/gui/ResultActionGui.java Sun Nov 25
15:02:34 2012
@@ -46,6 +46,7 @@ public class ResultActionGui extends Abs
     /**
      * @see org.apache.jmeter.gui.JMeterGUIComponent#getStaticLabel()
      */
+    @Override
     public String getLabelResource() {
         return "resultaction_title"; //$NON-NLS-1$
     }
@@ -62,6 +63,7 @@ public class ResultActionGui extends Abs
     /**
      * @see org.apache.jmeter.gui.JMeterGUIComponent#createTestElement()
      */
+    @Override
     public TestElement createTestElement() {
         ResultAction resultAction = new ResultAction();
         modifyTestElement(resultAction);
@@ -73,6 +75,7 @@ public class ResultActionGui extends Abs
      *
      * @see org.apache.jmeter.gui.JMeterGUIComponent#modifyTestElement(TestElement)
      */
+    @Override
     public void modifyTestElement(TestElement te) {
         super.configureTestElement(te);
         ((OnErrorTestElement) te).setErrorAction(errorPanel.getOnErrorSetting());

Modified: jmeter/trunk/src/core/org/apache/jmeter/samplers/SampleResult.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/core/org/apache/jmeter/samplers/SampleResult.java?rev=1413358&r1=1413357&r2=1413358&view=diff
==============================================================================
--- jmeter/trunk/src/core/org/apache/jmeter/samplers/SampleResult.java (original)
+++ jmeter/trunk/src/core/org/apache/jmeter/samplers/SampleResult.java Sun Nov 25 15:02:34
2012
@@ -174,6 +174,9 @@ public class SampleResult implements Ser
 
     /** time to first response */
     private long latency = 0;
+    
+    /** Should thread start next iteration ? */
+    private boolean startNextThreadLoop = false;
 
     /** Should thread terminate? */
     private boolean stopThread = false;
@@ -305,6 +308,7 @@ public class SampleResult implements Ser
         stopTest = res.stopTest;
         stopTestNow = res.stopTestNow;
         stopThread = res.stopThread;
+        startNextThreadLoop = res.startNextThreadLoop;
         subResults = res.subResults; // TODO ??
         success = res.success;//OK
         threadName = res.threadName;//OK
@@ -1308,4 +1312,18 @@ public class SampleResult implements Ser
         }
         
     }
+
+    /**
+     * @return the startNextThreadLoop
+     */
+    public boolean isStartNextThreadLoop() {
+        return startNextThreadLoop;
+    }
+
+    /**
+     * @param startNextThreadLoop the startNextLoop to set
+     */
+    public void setStartNextThreadLoop(boolean startNextThreadLoop) {
+        this.startNextThreadLoop = startNextThreadLoop;
+    }
 }

Modified: jmeter/trunk/src/core/org/apache/jmeter/testelement/OnErrorTestElement.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/core/org/apache/jmeter/testelement/OnErrorTestElement.java?rev=1413358&r1=1413357&r2=1413358&view=diff
==============================================================================
--- jmeter/trunk/src/core/org/apache/jmeter/testelement/OnErrorTestElement.java (original)
+++ jmeter/trunk/src/core/org/apache/jmeter/testelement/OnErrorTestElement.java Sun Nov 25
15:02:34 2012
@@ -39,6 +39,8 @@ public abstract class OnErrorTestElement
 
     public static final int ON_ERROR_STOPTEST_NOW = 3;
 
+    public static final int ON_ERROR_START_NEXT_THREAD_LOOP = 4;
+
     /* Property name */
     public static final String ON_ERROR_ACTION = "OnError.action";
 
@@ -69,4 +71,8 @@ public abstract class OnErrorTestElement
     public boolean isStopTestNow() {
         return getErrorAction() == ON_ERROR_STOPTEST_NOW;
     }
+    
+    public boolean isStartNextThreadLoop() {
+        return getErrorAction() == ON_ERROR_START_NEXT_THREAD_LOOP;
+    }
 }

Modified: jmeter/trunk/src/core/org/apache/jmeter/threads/JMeterThread.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/core/org/apache/jmeter/threads/JMeterThread.java?rev=1413358&r1=1413357&r2=1413358&view=diff
==============================================================================
--- jmeter/trunk/src/core/org/apache/jmeter/threads/JMeterThread.java (original)
+++ jmeter/trunk/src/core/org/apache/jmeter/threads/JMeterThread.java Sun Nov 25 15:02:34
2012
@@ -454,6 +454,9 @@ public class JMeterThread implements Run
                     if (result.isStopTestNow() || (!result.isSuccessful() && onErrorStopTestNow))
{
                         stopTestNow();
                     }
+                    if(result.isStartNextThreadLoop()) {
+                        threadContext.setRestartNextLoop(true);
+                    }
                 } else {
                     compiler.done(pack); // Finish up
                 }

Modified: jmeter/trunk/xdocs/changes.xml
URL: http://svn.apache.org/viewvc/jmeter/trunk/xdocs/changes.xml?rev=1413358&r1=1413357&r2=1413358&view=diff
==============================================================================
--- jmeter/trunk/xdocs/changes.xml (original)
+++ jmeter/trunk/xdocs/changes.xml Sun Nov 25 15:02:34 2012
@@ -206,6 +206,7 @@ to the elements View Results Tree, Asser
 <li><bugzilla>54154</bugzilla> - HTTP Proxy Server should not force user
to select the type of Sampler in HTTP Sampler Settings</li>
 <li><bugzilla>54165</bugzilla> - Proxy Server: Improve rendering of target
controller</li>
 <li><bugzilla>46677</bugzilla> - Copying Test Elements between test plans</li>
+<li><bugzilla>54204</bugzilla> - Result Status Action Handler : Add start
next thread loop option</li>
 </ul>
 
 <h2>Non-functional changes</h2>



Mime
View raw message