sebb 2004/10/08 16:20:10
Modified: src/components/org/apache/jmeter/assertions Tag: rel-2_0
BeanShellAssertion.java
src/protocol/java/org/apache/jmeter/protocol/java/sampler
Tag: rel-2_0 BeanShellSampler.java
Log:
Fix some serialisation warnings
Revision Changes Path
No revision
No revision
1.3.2.4 +8 -8
jakarta-jmeter/src/components/org/apache/jmeter/assertions/BeanShellAssertion.java
Index: BeanShellAssertion.java
===================================================================
RCS file:
/home/cvs/jakarta-jmeter/src/components/org/apache/jmeter/assertions/BeanShellAssertion.java,v
retrieving revision 1.3.2.3
retrieving revision 1.3.2.4
diff -u -r1.3.2.3 -r1.3.2.4
--- BeanShellAssertion.java 8 Oct 2004 22:44:41 -0000 1.3.2.3
+++ BeanShellAssertion.java 8 Oct 2004 23:20:10 -0000 1.3.2.4
@@ -39,7 +39,7 @@
public class BeanShellAssertion extends AbstractTestElement
implements Serializable, Assertion
{
- protected static Logger log = LoggingManager.getLoggerForClass();
+ private static Logger log = LoggingManager.getLoggerForClass();
public static final String FILENAME = "BeanShellAssertion.filename";
//$NON-NLS-1$
public static final String SCRIPT = "BeanShellAssertion.query";
//$NON-NLS-1$
@@ -55,7 +55,6 @@
String init="";
try{
bshInterpreter = new Interpreter();
- bshInterpreter.set("log",log); //$NON-NLS-1$
init = JMeterUtils.getPropDefault(INIT_FILE,null);
if (init != null)
{
@@ -68,8 +67,6 @@
log.warn("Error processing init file "+init+"
"+e);
}
}
- } catch (Exception e){
- log.warn("Error setting log object "+e);
} catch (NoClassDefFoundError e){
bshInterpreter=null;
}
@@ -101,8 +98,11 @@
{
String request=getScript();
String fileName=getFilename();
-
- bshInterpreter.set("FileName",getFilename());//$NON-NLS-1$
+
+ // Has to be done after construction, otherwise fails serialisation
check
+ bshInterpreter.set("log",log); //$NON-NLS-1$
+
+ bshInterpreter.set("FileName",getFilename());//$NON-NLS-1$
bshInterpreter.set("Parameters",getParameters());// as a
single line $NON-NLS-1$
bshInterpreter.set("bsh.args",//$NON-NLS-1$
JOrphanUtils.split(getParameters(),"
"));//$NON-NLS-1$
No revision
No revision
1.6.2.4 +5 -7
jakarta-jmeter/src/protocol/java/org/apache/jmeter/protocol/java/sampler/BeanShellSampler.java
Index: BeanShellSampler.java
===================================================================
RCS file:
/home/cvs/jakarta-jmeter/src/protocol/java/org/apache/jmeter/protocol/java/sampler/BeanShellSampler.java,v
retrieving revision 1.6.2.3
retrieving revision 1.6.2.4
diff -u -r1.6.2.3 -r1.6.2.4
--- BeanShellSampler.java 8 Oct 2004 22:44:41 -0000 1.6.2.3
+++ BeanShellSampler.java 8 Oct 2004 23:20:10 -0000 1.6.2.4
@@ -53,7 +53,6 @@
String init="";
try{
bshInterpreter = new Interpreter();
- bshInterpreter.set("log",log); //$NON-NLS-1$
init = JMeterUtils.getPropDefault(INIT_FILE,null);
if (init != null)
{
@@ -66,8 +65,6 @@
log.warn("Error processing init file "+init+"
"+e);
}
}
- } catch (Exception e){
- log.warn("Error setting log object "+e);
} catch (NoClassDefFoundError e){
bshInterpreter=null;
}
@@ -115,12 +112,13 @@
} else {
res.setSamplerData(fileName);
}
+ // Has to be done after construction, otherwise fails serialisation
check
+ bshInterpreter.set("log",log); //$NON-NLS-1$
- //TODO - set some more variables?
bshInterpreter.set("Label",getLabel()); //$NON-NLS-1$
bshInterpreter.set("FileName",getFilename()); //$NON-NLS-1$
bshInterpreter.set("SampleResult",res); //$NON-NLS-1$
- bshInterpreter.set("Parameters",getParameters());// as a
single line
+ bshInterpreter.set("Parameters",getParameters());// as a
single line//$NON-NLS-1$
bshInterpreter.set("bsh.args",JOrphanUtils.split(getParameters()," "));
// Set default values
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]