jmeter-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pmoua...@apache.org
Subject svn commit: r1240579 - /jmeter/trunk/src/components/org/apache/jmeter/assertions/BSFAssertion.java
Date Sat, 04 Feb 2012 18:31:47 GMT
Author: pmouawad
Date: Sat Feb  4 18:31:46 2012
New Revision: 1240579

URL: http://svn.apache.org/viewvc?rev=1240579&view=rev
Log:
Ensure terminate is called

Modified:
    jmeter/trunk/src/components/org/apache/jmeter/assertions/BSFAssertion.java

Modified: jmeter/trunk/src/components/org/apache/jmeter/assertions/BSFAssertion.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/components/org/apache/jmeter/assertions/BSFAssertion.java?rev=1240579&r1=1240578&r2=1240579&view=diff
==============================================================================
--- jmeter/trunk/src/components/org/apache/jmeter/assertions/BSFAssertion.java (original)
+++ jmeter/trunk/src/components/org/apache/jmeter/assertions/BSFAssertion.java Sat Feb  4
18:31:46 2012
@@ -34,18 +34,22 @@ public class BSFAssertion extends BSFTes
 
     public AssertionResult getResult(SampleResult response) {
         AssertionResult result = new AssertionResult(getName());
+        BSFManager mgr =null;
         try {
-            BSFManager mgr = getManager();
+            mgr = getManager();
             mgr.declareBean("SampleResult", response, SampleResult.class);
             mgr.declareBean("AssertionResult", result, AssertionResult.class);
             processFileOrScript(mgr);
-            mgr.terminate();
             result.setError(false);
         } catch (BSFException e) {
             log.warn("Problem in BSF script "+e);
             result.setFailure(true);
             result.setError(true);
             result.setFailureMessage(e.toString());
+        } finally {
+            if(mgr != null) {
+                mgr.terminate();
+            }
         }
         return result;
     }



Mime
View raw message