I'm looking forward to being done with the JavaSampler for awhile, but I've got a bit more cleanup, mostly with the documentation (Javadoc). The Javadocs for the Java protocol packages should build clean now, even with the 1.4 JDK. I'm still working on some User Manual documentation too, but its not quite ready yet.
Jeremy [EMAIL PROTECTED] http://xirr.com/~jeremy_a
Index:
jakarta-jmeter/src/protocol/java/org/apache/jmeter/protocol/java/config/gui/JavaConfigGui.java
===================================================================
RCS file:
/home/cvspublic/jakarta-jmeter/src/protocol/java/org/apache/jmeter/protocol/java/config/gui/JavaConfigGui.java,v
retrieving revision 1.7
diff -u -r1.7 JavaConfigGui.java
---
jakarta-jmeter/src/protocol/java/org/apache/jmeter/protocol/java/config/gui/JavaConfigGui.java
18 Mar 2003 13:41:13 -0000 1.7
+++
jakarta-jmeter/src/protocol/java/org/apache/jmeter/protocol/java/config/gui/JavaConfigGui.java
25 Mar 2003 21:22:36 -0000
@@ -192,10 +192,11 @@
public void actionPerformed(ActionEvent evt) {
if (evt.getSource() == classnameCombo) {
- String className = (String)classnameCombo.getSelectedItem();
+ String className =
+ ((String)classnameCombo.getSelectedItem()).trim();
try {
JavaSamplerClient client = (JavaSamplerClient)Class.forName(
- className.trim(),
+ className,
true,
Thread.currentThread().getContextClassLoader()
).newInstance();
@@ -205,7 +206,13 @@
Map currArgsMap = currArgs.getArgumentsAsMap();
Arguments newArgs = new Arguments();
- Arguments testParams = client.getDefaultParameters();
+ Arguments testParams = null;
+ try {
+ testParams = client.getDefaultParameters();
+ } catch (AbstractMethodError e) {
+ log.warn ("JavaSamplerClient doesn't implement
getDefaultParameters. Default parameters won't be shown. Please update your client
class: " + className);
+ }
+
if (testParams != null) {
Iterator i = testParams.getArguments().iterator();
while (i.hasNext()) {
Index:
jakarta-jmeter/src/protocol/java/org/apache/jmeter/protocol/java/sampler/JavaSampler.java
===================================================================
RCS file:
/home/cvspublic/jakarta-jmeter/src/protocol/java/org/apache/jmeter/protocol/java/sampler/JavaSampler.java,v
retrieving revision 1.7
diff -u -r1.7 JavaSampler.java
---
jakarta-jmeter/src/protocol/java/org/apache/jmeter/protocol/java/sampler/JavaSampler.java
18 Mar 2003 13:41:13 -0000 1.7
+++
jakarta-jmeter/src/protocol/java/org/apache/jmeter/protocol/java/sampler/JavaSampler.java
25 Mar 2003 21:22:36 -0000
@@ -190,7 +190,6 @@
* The <code>sample()</code> method retrieves the reference to the
* Java client and calls its <code>runTest()</code> method.
*
- * @see Sampler#sample(org.apache.jmeter.samplers.Entry)
* @see JavaSamplerClient#runTest(JavaSamplerContext)
*
* @return test SampleResult
Index:
jakarta-jmeter/src/protocol/java/org/apache/jmeter/protocol/java/sampler/JavaSamplerClient.java
===================================================================
RCS file:
/home/cvspublic/jakarta-jmeter/src/protocol/java/org/apache/jmeter/protocol/java/sampler/JavaSamplerClient.java,v
retrieving revision 1.2
diff -u -r1.2 JavaSamplerClient.java
---
jakarta-jmeter/src/protocol/java/org/apache/jmeter/protocol/java/sampler/JavaSamplerClient.java
18 Mar 2003 13:41:13 -0000 1.2
+++
jakarta-jmeter/src/protocol/java/org/apache/jmeter/protocol/java/sampler/JavaSamplerClient.java
25 Mar 2003 21:22:37 -0000
@@ -83,14 +83,15 @@
* with them will be shown in the GUI. Users can add other
* parameters as well.
* <p>
- * While it may be necessary to make changes to the JavaSamplerClient
- * interface from time to time (therefore requiring changes to any
- * implementations of this interface), we intend to make this abstract
- * class provide reasonable implementations of any new methods so that
- * subclasses do not necessarily need to be updated for new versions.
- * Therefore, when creating a new JavaSamplerClient implementation,
- * developers are encouraged to subclass this abstract class rather
- * than implementing the JavaSamplerClient interface directly.
+ * When possible, Java tests should extend
+ * [EMAIL PROTECTED] AbstractJavaSamplerClient AbstractJavaSamplerClient} rather
+ * than implementing JavaSamplerClient directly. This should protect
+ * your tests from future changes to the interface. While it may be
+ * necessary to make changes to the JavaSamplerClient interface from
+ * time to time (therefore requiring changes to any implementations
+ * of this interface), we intend to make this abstract class provide
+ * reasonable implementations of any new methods so that subclasses
+ * do not necessarily need to be updated for new versions.
* Implementing JavaSamplerClient directly will continue to be
* supported for cases where extending this class is not possible
* (for example, when the client class is already a subclass of some
@@ -113,7 +114,7 @@
* as possible to the test.
*
* @param context the context to run with. This provides access
- * to initialization parameters.
+ * to initialization parameters.
*/
public void setupTest(JavaSamplerContext context);
@@ -126,9 +127,9 @@
* the test required to execute. It is also a good idea to
* set the sampleLabel and the successful flag.
*
- * @see org.apache.jmeter.samplers.SampleResult.setTime(long)
- * @see org.apache.jmeter.samplers.SampleResult.setSuccessful(boolean)
- * @see org.apache.jmeter.samplers.SampleResult.setSampleLabel(java.lang.String)
+ * @see org.apache.jmeter.samplers.SampleResult#setTime(long)
+ * @see org.apache.jmeter.samplers.SampleResult#setSuccessful(boolean)
+ * @see org.apache.jmeter.samplers.SampleResult#setSampleLabel(java.lang.String)
*
* @param context the context to run with. This provides access
* to initialization parameters.
@@ -142,7 +143,7 @@
* Do any clean-up required by this test at the end of a test run.
*
* @param context the context to run with. This provides access
- * to initialization parameters.
+ * to initialization parameters.
*/
public void teardownTest(JavaSamplerContext context);
Index:
jakarta-jmeter/src/protocol/java/org/apache/jmeter/protocol/java/test/SleepTest.java
===================================================================
RCS file:
/home/cvspublic/jakarta-jmeter/src/protocol/java/org/apache/jmeter/protocol/java/test/SleepTest.java,v
retrieving revision 1.5
diff -u -r1.5 SleepTest.java
---
jakarta-jmeter/src/protocol/java/org/apache/jmeter/protocol/java/test/SleepTest.java
18 Mar 2003 13:41:13 -0000 1.5
+++
jakarta-jmeter/src/protocol/java/org/apache/jmeter/protocol/java/test/SleepTest.java
25 Mar 2003 21:22:37 -0000
@@ -125,8 +125,8 @@
getLogger().debug(whoAmI() + "\tsetupTest()");
listParameters(context);
- sleepTime = context.getLongParameter("SleepTime", 1000);
- sleepMask = context.getLongParameter("SleepMask", 0x3ff);
+ sleepTime = context.getLongParameter("SleepTime", DEFAULT_SLEEP_TIME);
+ sleepMask = context.getLongParameter("SleepMask", DEFAULT_SLEEP_MASK);
}
/**
@@ -140,9 +140,9 @@
* the test required to execute. It is also a good idea to
* set the sampleLabel and the successful flag.
*
- * @see org.apache.jmeter.samplers.SampleResult.setTime(long)
- * @see org.apache.jmeter.samplers.SampleResult.setSuccessful(boolean)
- * @see org.apache.jmeter.samplers.SampleResult.setSampleLabel(java.lang.String)
+ * @see org.apache.jmeter.samplers.SampleResult#setTime(long)
+ * @see org.apache.jmeter.samplers.SampleResult#setSuccessful(boolean)
+ * @see org.apache.jmeter.samplers.SampleResult#setSampleLabel(java.lang.String)
*
* @param context the context to run with. This provides access
* to initialization parameters.--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
