The default values are OK, but I'm not sure that they'll work as intended - for example, if a test plan is saved with an empty value, will the default be re-applied? I suspect the value will be populated from the test plan.
I think it might be better to define constants (static final String) and code the getXXX routines to return these if the field is empty - especially if the field must exist (e.g. protocol). It would still be useful when creating a new sampler if all the required GUI fields were automatically populated with the defaults, as is currently done with Method. == What does "protocol undefined" mean? Similarly for Follow redirects and Download resources? It seems to me that these should be replaced with whatever defaults will be applied by the code. == Follow Redirects should probably allow Edit. Method should probably allow Edit; maybe add HEAD to the predefined list? S. -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: 08 January 2004 22:58 To: [EMAIL PROTECTED] Subject: cvs commit: jakarta-jmeter/src/protocol/http/org/apache/jmeter/protocol/http/sampler HTTPSamplerBean.java jsalvata 2004/01/08 14:58:09 Modified: src/protocol/http/org/apache/jmeter/protocol/http/sampler Tag: testbeans_experimental_branch HTTPSamplerBean.java Log: * Improved defaults (sebb: opinions?). * Using new TestElement property assignement feature. Revision Changes Path No revision No revision 1.1.2.5 +5 -26 jakarta-jmeter/src/protocol/http/org/apache/jmeter/protocol/http /sampler/Attic/HTTPSamplerBean.java Index: HTTPSamplerBean.java =================================================================== RCS file: /home/cvs/jakarta-jmeter/src/protocol/http/org/apache/jmeter/pro tocol/http/sampler/Attic/HTTPSamplerBean.java,v retrieving revision 1.1.2.4 retrieving revision 1.1.2.5 diff -u -r1.1.2.4 -r1.1.2.5 --- HTTPSamplerBean.java 7 Jan 2004 23:34:38 -0000 1.1.2.4 +++ HTTPSamplerBean.java 8 Jan 2004 22:58:09 -0000 1.1.2.5 @@ -86,7 +86,6 @@ import org.apache.jmeter.samplers.Sampler; import org.apache.jmeter.testbeans.TestBean; -import org.apache.jmeter.testelement.TestElement; import org.apache.jmeter.testelement.property.CollectionProperty; import org.apache.jmeter.testelement.property.PropertyIterator; @@ -199,18 +198,18 @@ /* * Public properties: */ - private String fileField= ""; + private String fileField= ""; // TODO: is this valid? Choose a sensible default or check it's non-null. private File filename= null; - private String protocol= ""; + private String protocol= "http"; private String path= ""; private String encodedPath= ""; private boolean followRedirects= true; - private String Method= ""; + private String Method= "GET"; private boolean useKeepAlive= false; private int port= UNSPECIFIED_PORT; - private String domain= ""; + private String domain= ""; // TODO: choose a sensible default or check it's non-null. private Arguments arguments= null; - private String mimeType= ""; + private String mimeType= ""; // TODO: is this valid? Choose a sensible one or check it's non-null. private boolean imageParser= false; /* @@ -248,26 +247,6 @@ arg.setAlwaysEncoded(false); } this.getArguments().addArgument(arg); - } - - public void addTestElement(TestElement el) - { - if (el instanceof CookieManager) - { - setCookieManager((CookieManager)el); - } - else if (el instanceof HeaderManager) - { - setHeaderManager((HeaderManager)el); - } - else if (el instanceof AuthManager) - { - setAuthManager((AuthManager)el); - } - else - { - super.addTestElement(el); - } } /** --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]