### Eclipse Workspace Patch 1.0 #P jmeter-trunk Index: src/core/org/apache/jmeter/resources/messages_fr.properties =================================================================== --- src/core/org/apache/jmeter/resources/messages_fr.properties (revision 816394) +++ src/core/org/apache/jmeter/resources/messages_fr.properties (working copy) @@ -243,6 +243,7 @@ graph_results_title=Graphique de r\u00E9sultats grouping_add_separators=Ajouter des s\u00E9parateurs entre les groupes grouping_in_controllers=Mettre chaque groupe dans un nouveau contr\u00F4leur +grouping_in_transaction_controllers=Mettre chaque groupe dans un nouveau contr\u00F4leur de transaction grouping_mode=Grouper \: grouping_no_groups=Ne pas grouper les \u00E9chantillons grouping_store_first_only=Stocker le 1er \u00E9chantillon pour chaque groupe uniquement Index: src/protocol/http/org/apache/jmeter/protocol/http/proxy/gui/ProxyControlGui.java =================================================================== --- src/protocol/http/org/apache/jmeter/protocol/http/proxy/gui/ProxyControlGui.java (revision 816394) +++ src/protocol/http/org/apache/jmeter/protocol/http/proxy/gui/ProxyControlGui.java (working copy) @@ -621,6 +621,7 @@ m.addElement(JMeterUtils.getResString("grouping_add_separators")); // $NON-NLS-1$ m.addElement(JMeterUtils.getResString("grouping_in_controllers")); // $NON-NLS-1$ m.addElement(JMeterUtils.getResString("grouping_store_first_only")); // $NON-NLS-1$ + m.addElement(JMeterUtils.getResString("grouping_in_transaction_controllers")); // $NON-NLS-1$ groupingMode = new JComboBox(m); groupingMode.setSelectedIndex(0); groupingMode.addItemListener(this); Index: src/core/org/apache/jmeter/resources/messages.properties =================================================================== --- src/core/org/apache/jmeter/resources/messages.properties (revision 817404) +++ src/core/org/apache/jmeter/resources/messages.properties (working copy) @@ -280,6 +280,7 @@ graph_results_title=Graph Results grouping_add_separators=Add separators between groups grouping_in_controllers=Put each group in a new controller +grouping_in_transaction_controllers=Put each group in a new transaction controller grouping_mode=Grouping\: grouping_no_groups=Do not group samplers grouping_store_first_only=Store 1st sampler of each group only Index: src/protocol/http/org/apache/jmeter/protocol/http/proxy/ProxyControl.java =================================================================== --- src/protocol/http/org/apache/jmeter/protocol/http/proxy/ProxyControl.java (revision 816394) +++ src/protocol/http/org/apache/jmeter/protocol/http/proxy/ProxyControl.java (working copy) @@ -33,7 +33,9 @@ import org.apache.jmeter.config.ConfigElement; import org.apache.jmeter.config.ConfigTestElement; import org.apache.jmeter.control.GenericController; +import org.apache.jmeter.control.TransactionController; import org.apache.jmeter.control.gui.LogicControllerGui; +import org.apache.jmeter.control.gui.TransactionControllerGui; import org.apache.jmeter.engine.util.ValueReplacer; import org.apache.jmeter.exceptions.IllegalUserActionException; import org.apache.jmeter.functions.InvalidVariableException; @@ -79,6 +81,9 @@ private static final String ASSERTION_GUI = AssertionGui.class.getName(); + + private static final String TRANSACTION_CONTROLLER_GUI = TransactionControllerGui.class.getName(); + private static final String LOGIC_CONTROLLER_GUI = LogicControllerGui.class.getName(); private static final String HEADER_PANEL = HeaderPanel.class.getName(); @@ -133,6 +138,8 @@ public static final int GROUPING_STORE_FIRST_ONLY = 3; + public static final int GROUPING_IN_TRANSACTION_CONTROLLERS = 4; + // Must agree with the order of entries in the drop-down // created in ProxyControlGui.createHTTPSamplerPanel() public static final int SAMPLER_TYPE_HTTP_SAMPLER = 0; @@ -545,6 +552,23 @@ } /** + * Helper method to add a Simple Controller to contain the samplers. + * + * @param model + * Test component tree model + * @param node + * Node in the tree where we will add the Controller + * @param name + * A name for the Controller + */ + private void addTransactionController(JMeterTreeModel model, JMeterTreeNode node, String name) + throws IllegalUserActionException { + TransactionController sc = new TransactionController(); + sc.setProperty(TestElement.GUI_CLASS, TRANSACTION_CONTROLLER_GUI); + sc.setName(name); + model.addComponent(sc, node); + } + /** * Helpler method to replicate any timers found within the Proxy Controller * into the provided sampler, while replacing any occurences of string _T_ * in the timer's configuration with the provided deltaT. @@ -734,6 +758,9 @@ if (groupingMode == GROUPING_IN_CONTROLLERS) { addSimpleController(treeModel, myTarget, sampler.getName()); } + if (groupingMode == GROUPING_IN_TRANSACTION_CONTROLLERS) { + addTransactionController(treeModel, myTarget, sampler.getName()); + } firstInBatch = true;// Remember this was first in its batch } if (lastTime == 0) { @@ -752,7 +779,8 @@ sampler.setImageParser(true); } - if (groupingMode == GROUPING_IN_CONTROLLERS) { + if (groupingMode == GROUPING_IN_CONTROLLERS || + groupingMode == GROUPING_IN_TRANSACTION_CONTROLLERS) { // Find the last controller in the target to store the // sampler there: for (int i = myTarget.getChildCount() - 1; i >= 0; i--) { @@ -764,6 +792,7 @@ } } + JMeterTreeNode newNode = treeModel.addComponent(sampler, myTarget); if (firstInBatch) {