Make Automatic redirects the default

git-svn-id: https://svn.apache.org/repos/asf/jakarta/jmeter/branches/rel-2-2@546566 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Sebastian Bazley 2007-06-12 16:42:57 +00:00
parent da6f2c0761
commit f72f3523ed
3 changed files with 22 additions and 7 deletions

View File

@ -29,6 +29,8 @@ import javax.swing.JCheckBox;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JTextField;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;
import org.apache.jmeter.config.Arguments;
import org.apache.jmeter.config.ConfigTestElement;
@ -45,7 +47,7 @@ import org.apache.jorphan.gui.JLabeledChoice;
/**
* @author Michael Stover
*/
public class UrlConfigGui extends JPanel {
public class UrlConfigGui extends JPanel implements ChangeListener {
protected HTTPArgumentsPanel argsPanel;
private static String DOMAIN = "domain"; // $NON-NLS-1$
@ -98,8 +100,8 @@ public class UrlConfigGui extends JPanel {
public void clear() {
domain.setText(""); // $NON-NLS-1$
followRedirects.setSelected(true);
autoRedirects.setSelected(false);
followRedirects.setSelected(false);
autoRedirects.setSelected(true);
method.setText(HTTPSamplerBase.DEFAULT_METHOD);
path.setText(""); // $NON-NLS-1$
port.setText(""); // $NON-NLS-1$
@ -231,12 +233,12 @@ public class UrlConfigGui extends JPanel {
autoRedirects = new JCheckBox(JMeterUtils.getResString("follow_redirects_auto")); //$NON-NLS-1$
autoRedirects.setName(AUTO_REDIRECTS);
autoRedirects.setSelected(false);// will be reset by
// configure(TestElement)
autoRedirects.setSelected(true);// Default changed in 2.3
autoRedirects.addChangeListener(this);
followRedirects = new JCheckBox(JMeterUtils.getResString("follow_redirects")); // $NON-NLS-1$
followRedirects.setName(FOLLOW_REDIRECTS);
followRedirects.setSelected(true);
followRedirects.setSelected(false);
useKeepAlive = new JCheckBox(JMeterUtils.getResString("use_keepalive")); // $NON-NLS-1$
useKeepAlive.setName(USE_KEEPALIVE);
@ -300,4 +302,15 @@ public class UrlConfigGui extends JPanel {
return argsPanel;
}
// Disable follow redirects if Autoredirect is selected
public void stateChanged(ChangeEvent e) {
if (e.getSource() == autoRedirects){
if (autoRedirects.isSelected()) {
followRedirects.setEnabled(false);
} else {
followRedirects.setEnabled(true);
}
}
}
}

View File

@ -117,7 +117,7 @@ Formatting should now be done using the jorphan.gui Renderer classes.
Removed deprecated method JMeterUtils.split() - use JOrphanUtils version instead.
</p>
<h4>New functionality:</h4>
<h4>New functionality/improvements:</h4>
<ul>
<li>Added httpclient.parameters.file to allow HttpClient parameters to be defined</li>
<li>Added beanshell.init.file property to run a BeanShell script at startup</li>
@ -167,6 +167,7 @@ Removed deprecated method JMeterUtils.split() - use JOrphanUtils version instead
<li>Bug 42506 - JMeter threads all use the same SSL session</li>
<li>BeanShell elements now support ThreadListener and TestListener interfaces</li>
<li>Bug 42582 - JSON pretty printing in Tree View Listener</li>
<li>Http Autoredirects are now enabled by default when creating new samplers</li>
</ul>
<h4>Non-functional improvements:</h4>

View File

@ -153,6 +153,7 @@ https.sessioncontext.shared=true
<property name="Redirect Automatically" required="Yes">
Sets the underlying http protocol handler to automatically follow redirects,
so they are not seen by JMeter, and thus will not appear as samples.
In versions after 2.2, this is now the default.
</property>
<property name="Follow Redirects" required="Yes">
This only has any effect if "Redirect Automatically" is not enabled.