Author: sebb
Date: Sat Jun 30 08:13:12 2007
New Revision: 552158

URL: http://svn.apache.org/viewvc?view=rev&rev=552158
Log:
Bug 42778 - Transaction Controller skips sample (NPE)

Modified:
    
jakarta/jmeter/branches/rel-2-2/src/core/org/apache/jmeter/control/TransactionController.java
    
jakarta/jmeter/branches/rel-2-2/src/core/org/apache/jmeter/control/TransactionSampler.java

Modified: 
jakarta/jmeter/branches/rel-2-2/src/core/org/apache/jmeter/control/TransactionController.java
URL: 
http://svn.apache.org/viewvc/jakarta/jmeter/branches/rel-2-2/src/core/org/apache/jmeter/control/TransactionController.java?view=diff&rev=552158&r1=552157&r2=552158
==============================================================================
--- 
jakarta/jmeter/branches/rel-2-2/src/core/org/apache/jmeter/control/TransactionController.java
 (original)
+++ 
jakarta/jmeter/branches/rel-2-2/src/core/org/apache/jmeter/control/TransactionController.java
 Sat Jun 30 08:13:12 2007
@@ -39,7 +39,9 @@
        public Sampler next() {
         // Check if transaction is done
         if(transactionSampler != null && 
transactionSampler.isTransactionDone()) {
-            log.debug("End of transaction");
+               if (log.isDebugEnabled()) {
+                log.debug("End of transaction " + getName());
+               }
             // This transaction is done
             transactionSampler = null;
             return null;
@@ -48,7 +50,9 @@
         // Check if it is the start of a new transaction
                if (isFirst()) // must be the start of the subtree
                {
-                   log.debug("Start of transaction");
+               if (log.isDebugEnabled()) {
+                       log.debug("Start of transaction " + getName());
+               }
                    transactionSampler = new TransactionSampler(this, 
getName());
                }
 
@@ -60,5 +64,20 @@
             transactionSampler.setTransactionDone();
         }
         return transactionSampler;
+       }
+       
+       protected Sampler nextIsAController(Controller controller) throws 
NextIsNullException {
+               Sampler returnValue;
+               Sampler sampler = controller.next();
+               if (sampler == null) {
+                       currentReturnedNull(controller);
+                       // We need to call the super.next, instead of 
this.next, which is done in GenericController,
+                       // because if we call this.next(), it will return the 
TransactionSampler, and we do not want that.
+                       // We need to get the next real sampler or controller
+                       returnValue = super.next();
+               } else {
+                       returnValue = sampler;
+               }
+               return returnValue;
        }
 }

Modified: 
jakarta/jmeter/branches/rel-2-2/src/core/org/apache/jmeter/control/TransactionSampler.java
URL: 
http://svn.apache.org/viewvc/jakarta/jmeter/branches/rel-2-2/src/core/org/apache/jmeter/control/TransactionSampler.java?view=diff&rev=552158&r1=552157&r2=552158
==============================================================================
--- 
jakarta/jmeter/branches/rel-2-2/src/core/org/apache/jmeter/control/TransactionSampler.java
 (original)
+++ 
jakarta/jmeter/branches/rel-2-2/src/core/org/apache/jmeter/control/TransactionSampler.java
 Sat Jun 30 08:13:12 2007
@@ -51,6 +51,7 @@
 
        public TransactionSampler(TransactionController controller, String 
name) {
         transactionController = controller;
+               setName(name); // ensure name is available for debugging
                transactionSampleResult = new SampleResult();
                transactionSampleResult.setSampleLabel(name);
                // Assume success



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to