mirror of https://github.com/apache/jmeter.git
Compare commits
5 Commits
ed6c51c0a1
...
d6df1b8049
| Author | SHA1 | Date |
|---|---|---|
|
|
d6df1b8049 | |
|
|
6d6654ed3b | |
|
|
4354139062 | |
|
|
515d06c601 | |
|
|
c5e1876e9d |
|
|
@ -75,7 +75,6 @@ plugins.withId("java") {
|
||||||
java {
|
java {
|
||||||
license()
|
license()
|
||||||
importOrder("static ", "java.", "javax", "org", "net", "com", "")
|
importOrder("static ", "java.", "javax", "org", "net", "com", "")
|
||||||
removeUnusedImports()
|
|
||||||
indentWithSpaces(4)
|
indentWithSpaces(4)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -249,7 +249,7 @@ public class SizeAssertion extends AbstractScopedAssertion implements Serializab
|
||||||
if (operator == null) {
|
if (operator == null) {
|
||||||
return "ERROR - invalid condition";
|
return "ERROR - invalid condition";
|
||||||
}
|
}
|
||||||
|
|
||||||
if (operator.evaluate(resultSize, allowedSize)) {
|
if (operator.evaluate(resultSize, allowedSize)) {
|
||||||
return "";
|
return "";
|
||||||
} else {
|
} else {
|
||||||
|
|
|
||||||
|
|
@ -441,10 +441,10 @@ public class ArgumentsPanel extends AbstractConfigGui implements ActionListener
|
||||||
// or the selected rows will be unselected
|
// or the selected rows will be unselected
|
||||||
int[] rowsSelected = table.getSelectedRows();
|
int[] rowsSelected = table.getSelectedRows();
|
||||||
GuiUtils.stopTableEditing(table);
|
GuiUtils.stopTableEditing(table);
|
||||||
|
int selectedRowsCount = rowsSelected.length;
|
||||||
if (rowsSelected.length > 0 && rowsSelected[rowsSelected.length - 1] < table.getRowCount() - 1) {
|
if (selectedRowsCount > 0 && rowsSelected[selectedRowsCount - 1] < table.getRowCount() - 1) {
|
||||||
table.clearSelection();
|
table.clearSelection();
|
||||||
for (int i = rowsSelected.length - 1; i >= 0; i--) {
|
for (int i = selectedRowsCount - 1; i >= 0; i--) {
|
||||||
int rowSelected = rowsSelected[i];
|
int rowSelected = rowsSelected[i];
|
||||||
tableModel.moveRow(rowSelected, rowSelected + 1, rowSelected + 1);
|
tableModel.moveRow(rowSelected, rowSelected + 1, rowSelected + 1);
|
||||||
}
|
}
|
||||||
|
|
@ -535,8 +535,9 @@ public class ArgumentsPanel extends AbstractConfigGui implements ActionListener
|
||||||
int[] rowsSelected = table.getSelectedRows();
|
int[] rowsSelected = table.getSelectedRows();
|
||||||
int anchorSelection = table.getSelectionModel().getAnchorSelectionIndex();
|
int anchorSelection = table.getSelectionModel().getAnchorSelectionIndex();
|
||||||
table.clearSelection();
|
table.clearSelection();
|
||||||
if (rowsSelected.length > 0) {
|
int selectedRowsCount = rowsSelected.length;
|
||||||
for (int i = rowsSelected.length - 1; i >= 0; i--) {
|
if (selectedRowsCount > 0) {
|
||||||
|
for (int i = selectedRowsCount - 1; i >= 0; i--) {
|
||||||
tableModel.removeRow(rowsSelected[i]);
|
tableModel.removeRow(rowsSelected[i]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -243,7 +243,8 @@ public class RowDetailDialog extends JDialog implements ActionListener, Document
|
||||||
* @param selectedRow Selected row
|
* @param selectedRow Selected row
|
||||||
*/
|
*/
|
||||||
private void setValues(int selectedRow) {
|
private void setValues(int selectedRow) {
|
||||||
for (int i = 0; i < tableModel.getColumnCount(); i++) {
|
int columnCount = tableModel.getColumnCount();
|
||||||
|
for (int i = 0; i < columnCount; i++) {
|
||||||
final JComponent component = dataComponents.get(i);
|
final JComponent component = dataComponents.get(i);
|
||||||
if (component instanceof JTextComponent) {
|
if (component instanceof JTextComponent) {
|
||||||
JTextComponent dataArea = (JTextComponent) component;
|
JTextComponent dataArea = (JTextComponent) component;
|
||||||
|
|
@ -263,7 +264,8 @@ public class RowDetailDialog extends JDialog implements ActionListener, Document
|
||||||
* @param actionEvent the event that led to this call
|
* @param actionEvent the event that led to this call
|
||||||
*/
|
*/
|
||||||
protected void doUpdate(ActionEvent actionEvent) {
|
protected void doUpdate(ActionEvent actionEvent) {
|
||||||
for (int i = 0; i < tableModel.getColumnCount(); i++) {
|
int columnCount = tableModel.getColumnCount();
|
||||||
|
for (int i = 0; i < columnCount; i++) {
|
||||||
final JComponent component = dataComponents.get(i);
|
final JComponent component = dataComponents.get(i);
|
||||||
if (component instanceof JTextComponent) {
|
if (component instanceof JTextComponent) {
|
||||||
tableModel.setValueAt(((JTextComponent) component).getText(), selectedRow, i);
|
tableModel.setValueAt(((JTextComponent) component).getText(), selectedRow, i);
|
||||||
|
|
|
||||||
|
|
@ -715,7 +715,8 @@ public class MainFrame extends JFrame implements TestStateListener, Remoteable,
|
||||||
KeyStrokes.CTRL_1, KeyStrokes.CTRL_2, KeyStrokes.CTRL_3,
|
KeyStrokes.CTRL_1, KeyStrokes.CTRL_2, KeyStrokes.CTRL_3,
|
||||||
KeyStrokes.CTRL_4, KeyStrokes.CTRL_5, KeyStrokes.CTRL_6,
|
KeyStrokes.CTRL_4, KeyStrokes.CTRL_5, KeyStrokes.CTRL_6,
|
||||||
KeyStrokes.CTRL_7, KeyStrokes.CTRL_8, KeyStrokes.CTRL_9,};
|
KeyStrokes.CTRL_7, KeyStrokes.CTRL_8, KeyStrokes.CTRL_9,};
|
||||||
for (int n = 0; n < keyStrokes.length; n++) {
|
int keyStrokeCount = keyStrokes.length;
|
||||||
|
for (int n = 0; n < keyStrokeCount; n++) {
|
||||||
treevar.getActionMap().put(ActionNames.QUICK_COMPONENT + String.valueOf(n), quickComponent);
|
treevar.getActionMap().put(ActionNames.QUICK_COMPONENT + String.valueOf(n), quickComponent);
|
||||||
inputMap.put(keyStrokes[n], ActionNames.QUICK_COMPONENT + String.valueOf(n));
|
inputMap.put(keyStrokes[n], ActionNames.QUICK_COMPONENT + String.valueOf(n));
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -50,7 +50,8 @@ public interface TreeState {
|
||||||
int savedSelected = tree.getMinSelectionRow();
|
int savedSelected = tree.getMinSelectionRow();
|
||||||
ArrayList<Integer> savedExpanded = new ArrayList<>();
|
ArrayList<Integer> savedExpanded = new ArrayList<>();
|
||||||
|
|
||||||
for (int rowN = 0; rowN < tree.getRowCount(); rowN++) {
|
int treeRowCount = tree.getRowCount();
|
||||||
|
for (int rowN = 0; rowN < treeRowCount; rowN++) {
|
||||||
if (tree.isExpanded(rowN)) {
|
if (tree.isExpanded(rowN)) {
|
||||||
savedExpanded.add(rowN);
|
savedExpanded.add(rowN);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -98,7 +98,8 @@ public class CheckDirty extends AbstractAction implements HashTreeTraverser, Act
|
||||||
JMeterTreeNode[] nodes = guiPackage.getTreeListener().getSelectedNodes();
|
JMeterTreeNode[] nodes = guiPackage.getTreeListener().getSelectedNodes();
|
||||||
removeMode = true;
|
removeMode = true;
|
||||||
try {
|
try {
|
||||||
for (int i = nodes.length - 1; i >= 0; i--) {
|
int selectedNodesCount = nodes.length;
|
||||||
|
for (int i = selectedNodesCount - 1; i >= 0; i--) {
|
||||||
guiPackage.getTreeModel().getCurrentSubTree(nodes[i]).traverse(this);
|
guiPackage.getTreeModel().getCurrentSubTree(nodes[i]).traverse(this);
|
||||||
}
|
}
|
||||||
} finally {
|
} finally {
|
||||||
|
|
|
||||||
|
|
@ -68,13 +68,14 @@ public class CollapseExpand extends AbstractAction {
|
||||||
boolean collapse=ActionNames.COLLAPSE_ALL.equals(e.getActionCommand());
|
boolean collapse=ActionNames.COLLAPSE_ALL.equals(e.getActionCommand());
|
||||||
GuiPackage guiInstance = GuiPackage.getInstance();
|
GuiPackage guiInstance = GuiPackage.getInstance();
|
||||||
JTree jTree = guiInstance.getMainFrame().getTree();
|
JTree jTree = guiInstance.getMainFrame().getTree();
|
||||||
|
int treeRowCount = jTree.getRowCount();
|
||||||
if (collapse) {
|
if (collapse) {
|
||||||
for (int i = jTree.getRowCount() - 1; i >= 0; i--) {
|
for (int i = treeRowCount - 1; i >= 0; i--) {
|
||||||
jTree.collapseRow(i);
|
jTree.collapseRow(i);
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
for(int i = 0; i < jTree.getRowCount(); i++) {
|
for(int i = 0; i < treeRowCount; i++) {
|
||||||
jTree.expandRow(i);
|
jTree.expandRow(i);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -98,9 +98,10 @@ public class Copy extends AbstractAction {
|
||||||
*/
|
*/
|
||||||
static JMeterTreeNode[] keepOnlyAncestors(JMeterTreeNode[] currentNodes) {
|
static JMeterTreeNode[] keepOnlyAncestors(JMeterTreeNode[] currentNodes) {
|
||||||
List<JMeterTreeNode> nodes = new ArrayList<>();
|
List<JMeterTreeNode> nodes = new ArrayList<>();
|
||||||
for (int i = 0; i < currentNodes.length; i++) {
|
int currentNodesCount = currentNodes.length;
|
||||||
|
for (int i = 0; i < currentNodesCount; i++) {
|
||||||
boolean exclude = false;
|
boolean exclude = false;
|
||||||
for (int j = 0; j < currentNodes.length; j++) {
|
for (int j = 0; j < currentNodesCount; j++) {
|
||||||
if(i!=j && currentNodes[i].isNodeAncestor(currentNodes[j])) {
|
if(i!=j && currentNodes[i].isNodeAncestor(currentNodes[j])) {
|
||||||
exclude = true;
|
exclude = true;
|
||||||
break;
|
break;
|
||||||
|
|
@ -130,8 +131,9 @@ public class Copy extends AbstractAction {
|
||||||
}
|
}
|
||||||
|
|
||||||
public static JMeterTreeNode[] cloneTreeNodes(JMeterTreeNode[] nodes) {
|
public static JMeterTreeNode[] cloneTreeNodes(JMeterTreeNode[] nodes) {
|
||||||
JMeterTreeNode[] treeNodes = new JMeterTreeNode[nodes.length];
|
int nodesCount = nodes.length;
|
||||||
for (int i = 0; i < nodes.length; i++) {
|
JMeterTreeNode[] treeNodes = new JMeterTreeNode[nodesCount];
|
||||||
|
for (int i = 0; i < nodesCount; i++) {
|
||||||
treeNodes[i] = cloneTreeNode(nodes[i]);
|
treeNodes[i] = cloneTreeNode(nodes[i]);
|
||||||
}
|
}
|
||||||
return treeNodes;
|
return treeNodes;
|
||||||
|
|
|
||||||
|
|
@ -56,7 +56,8 @@ public class Duplicate extends AbstractAction {
|
||||||
JMeterTreeNode currentNode = treeListener.getCurrentNode();
|
JMeterTreeNode currentNode = treeListener.getCurrentNode();
|
||||||
JMeterTreeNode parentNode = (JMeterTreeNode) currentNode.getParent();
|
JMeterTreeNode parentNode = (JMeterTreeNode) currentNode.getParent();
|
||||||
JMeterTreeModel treeModel = instance.getTreeModel();
|
JMeterTreeModel treeModel = instance.getTreeModel();
|
||||||
for (int nodeIndex = copiedNodes.length - 1; nodeIndex >= 0; nodeIndex--) {
|
int copiedNodesCount = copiedNodes.length;
|
||||||
|
for (int nodeIndex = copiedNodesCount - 1; nodeIndex >= 0; nodeIndex--) {
|
||||||
JMeterTreeNode copiedNode = copiedNodes[nodeIndex];
|
JMeterTreeNode copiedNode = copiedNodes[nodeIndex];
|
||||||
int index = parentNode.getIndex(currentNode) + 1;
|
int index = parentNode.getIndex(currentNode) + 1;
|
||||||
treeModel.insertNodeInto(copiedNode, parentNode, index);
|
treeModel.insertNodeInto(copiedNode, parentNode, index);
|
||||||
|
|
|
||||||
|
|
@ -84,7 +84,8 @@ public class Paste extends AbstractAction {
|
||||||
// Add this node
|
// Add this node
|
||||||
JMeterTreeNode newNode = GuiPackage.getInstance().getTreeModel().addComponent(node.getTestElement(), parent);
|
JMeterTreeNode newNode = GuiPackage.getInstance().getTreeModel().addComponent(node.getTestElement(), parent);
|
||||||
// Add all the child nodes of the node we are adding
|
// Add all the child nodes of the node we are adding
|
||||||
for (int i = 0; i < node.getChildCount(); i++) {
|
int numberOfChildren = node.getChildCount();
|
||||||
|
for (int i = 0; i < numberOfChildren; i++) {
|
||||||
addNode(newNode, (JMeterTreeNode)node.getChildAt(i));
|
addNode(newNode, (JMeterTreeNode)node.getChildAt(i));
|
||||||
}
|
}
|
||||||
} catch (IllegalUserActionException iuae) {
|
} catch (IllegalUserActionException iuae) {
|
||||||
|
|
|
||||||
|
|
@ -78,7 +78,8 @@ public class Remove extends AbstractAction {
|
||||||
JMeterTreeNode[] nodes = guiPackage.getTreeListener().getSelectedNodes();
|
JMeterTreeNode[] nodes = guiPackage.getTreeListener().getSelectedNodes();
|
||||||
TreePath newTreePath = // Save parent node for later
|
TreePath newTreePath = // Save parent node for later
|
||||||
guiPackage.getTreeListener().removedSelectedNode();
|
guiPackage.getTreeListener().removedSelectedNode();
|
||||||
for (int i = nodes.length - 1; i >= 0; i--) {
|
int nodesCount = nodes.length;
|
||||||
|
for (int i = nodesCount - 1; i >= 0; i--) {
|
||||||
removeNode(nodes[i]);
|
removeNode(nodes[i]);
|
||||||
}
|
}
|
||||||
guiPackage.getTreeListener().getJTree().setSelectionPath(newTreePath);
|
guiPackage.getTreeListener().getJTree().setSelectionPath(newTreePath);
|
||||||
|
|
|
||||||
|
|
@ -180,7 +180,8 @@ public class Restart extends AbstractActionWithNoRunningTest implements MenuCrea
|
||||||
private static void processRemainingArgs(List<? super String> processArgs, String[] mainCommand) {
|
private static void processRemainingArgs(List<? super String> processArgs, String[] mainCommand) {
|
||||||
boolean paramValue = false;
|
boolean paramValue = false;
|
||||||
StringBuilder partialParamValue = new StringBuilder();
|
StringBuilder partialParamValue = new StringBuilder();
|
||||||
for (int i = 1; i < mainCommand.length; i++) {
|
int commandCount = mainCommand.length;
|
||||||
|
for (int i = 1; i < commandCount; i++) {
|
||||||
String currentPart = mainCommand[i];
|
String currentPart = mainCommand[i];
|
||||||
if (paramValue) {
|
if (paramValue) {
|
||||||
if (currentPart.startsWith("-")) {
|
if (currentPart.startsWith("-")) {
|
||||||
|
|
|
||||||
|
|
@ -177,7 +177,8 @@ public class TemplateManager {
|
||||||
document.getDocumentElement().normalize();
|
document.getDocumentElement().normalize();
|
||||||
Map<String, Template> templates = new TreeMap<>();
|
Map<String, Template> templates = new TreeMap<>();
|
||||||
NodeList templateNodes = document.getElementsByTagName("template");
|
NodeList templateNodes = document.getElementsByTagName("template");
|
||||||
for (int i = 0; i < templateNodes.getLength(); i++) {
|
int nodeCount = templateNodes.getLength();
|
||||||
|
for (int i = 0; i < nodeCount; i++) {
|
||||||
Node node = templateNodes.item(i);
|
Node node = templateNodes.item(i);
|
||||||
parseTemplateNode(templates, node);
|
parseTemplateNode(templates, node);
|
||||||
}
|
}
|
||||||
|
|
@ -212,7 +213,8 @@ public class TemplateManager {
|
||||||
|
|
||||||
private static Map<String, String> parseParameterNodes(NodeList parameterNodes) {
|
private static Map<String, String> parseParameterNodes(NodeList parameterNodes) {
|
||||||
Map<String, String> parametersMap = new HashMap<>();
|
Map<String, String> parametersMap = new HashMap<>();
|
||||||
for (int i = 0; i < parameterNodes.getLength(); i++) {
|
int nodeCount = parameterNodes.getLength();
|
||||||
|
for (int i = 0; i < nodeCount; i++) {
|
||||||
Element element = (Element) parameterNodes.item(i);
|
Element element = (Element) parameterNodes.item(i);
|
||||||
parametersMap.put(element.getAttribute("key"), element.getAttribute("defaultValue"));
|
parametersMap.put(element.getAttribute("key"), element.getAttribute("defaultValue"));
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -125,8 +125,9 @@ public class JMeterTreeListener implements TreeSelectionListener, MouseListener,
|
||||||
if (paths == null) {
|
if (paths == null) {
|
||||||
return new JMeterTreeNode[] { getCurrentNode() };
|
return new JMeterTreeNode[] { getCurrentNode() };
|
||||||
}
|
}
|
||||||
JMeterTreeNode[] nodes = new JMeterTreeNode[paths.length];
|
int numberOfPaths = paths.length;
|
||||||
for (int i = 0; i < paths.length; i++) {
|
JMeterTreeNode[] nodes = new JMeterTreeNode[numberOfPaths];
|
||||||
|
for (int i = 0; i < numberOfPaths; i++) {
|
||||||
nodes[i] = (JMeterTreeNode) paths[i].getLastPathComponent();
|
nodes[i] = (JMeterTreeNode) paths[i].getLastPathComponent();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -76,10 +76,11 @@ public class JMeterTreeTransferHandler extends TransferHandler {
|
||||||
sortTreePathByRow(paths, tree);
|
sortTreePathByRow(paths, tree);
|
||||||
|
|
||||||
// if child and a parent are selected : only keep the parent
|
// if child and a parent are selected : only keep the parent
|
||||||
boolean[] toRemove = new boolean[paths.length];
|
int pathCount = paths.length;
|
||||||
int size = paths.length;
|
boolean[] toRemove = new boolean[pathCount];
|
||||||
for (int i = 0; i < paths.length; i++) {
|
int size = pathCount;
|
||||||
for (int j = 0; j < paths.length; j++) {
|
for (int i = 0; i < pathCount; i++) {
|
||||||
|
for (int j = 0; j < pathCount; j++) {
|
||||||
if(i!=j && ((JMeterTreeNode)paths[i].getLastPathComponent()).isNodeAncestor((JMeterTreeNode)paths[j].getLastPathComponent())) {
|
if(i!=j && ((JMeterTreeNode)paths[i].getLastPathComponent()).isNodeAncestor((JMeterTreeNode)paths[j].getLastPathComponent())) {
|
||||||
toRemove[i] = true;
|
toRemove[i] = true;
|
||||||
size--;
|
size--;
|
||||||
|
|
@ -91,7 +92,7 @@ public class JMeterTreeTransferHandler extends TransferHandler {
|
||||||
// remove unneeded nodes
|
// remove unneeded nodes
|
||||||
JMeterTreeNode[] nodes = new JMeterTreeNode[size];
|
JMeterTreeNode[] nodes = new JMeterTreeNode[size];
|
||||||
size = 0;
|
size = 0;
|
||||||
for (int i = 0; i < paths.length; i++) {
|
for (int i = 0; i < pathCount; i++) {
|
||||||
if(!toRemove[i]) {
|
if(!toRemove[i]) {
|
||||||
JMeterTreeNode node = (JMeterTreeNode) paths[i].getLastPathComponent();
|
JMeterTreeNode node = (JMeterTreeNode) paths[i].getLastPathComponent();
|
||||||
nodes[size++] = node;
|
nodes[size++] = node;
|
||||||
|
|
|
||||||
|
|
@ -164,7 +164,8 @@ public class FileListPanel extends JPanel implements ActionListener {
|
||||||
public String[] getFiles() {
|
public String[] getFiles() {
|
||||||
GuiUtils.stopTableEditing(files);
|
GuiUtils.stopTableEditing(files);
|
||||||
String[] filesArray = new String[tableModel.getRowCount()];
|
String[] filesArray = new String[tableModel.getRowCount()];
|
||||||
for (int idx=0; idx < filesArray.length; idx++) {
|
int fileCount = filesArray.length;
|
||||||
|
for (int idx = 0; idx < fileCount; idx++) {
|
||||||
filesArray[idx] = (String)tableModel.getValueAt(idx,0);
|
filesArray[idx] = (String)tableModel.getValueAt(idx,0);
|
||||||
}
|
}
|
||||||
return filesArray;
|
return filesArray;
|
||||||
|
|
|
||||||
|
|
@ -624,13 +624,14 @@ public class JMeterMenuBar extends JMenuBar implements LocaleChangeListener {
|
||||||
}
|
}
|
||||||
|
|
||||||
private void getRemoteItems() {
|
private void getRemoteItems() {
|
||||||
if (remoteHosts.length > 0) {
|
int hostCount = remoteHosts.length;
|
||||||
|
if (hostCount > 0) {
|
||||||
remoteStart = makeMenuRes("remote_start"); //$NON-NLS-1$
|
remoteStart = makeMenuRes("remote_start"); //$NON-NLS-1$
|
||||||
remoteStop = makeMenuRes("remote_stop"); //$NON-NLS-1$
|
remoteStop = makeMenuRes("remote_stop"); //$NON-NLS-1$
|
||||||
remoteShut = makeMenuRes("remote_shut"); //$NON-NLS-1$
|
remoteShut = makeMenuRes("remote_shut"); //$NON-NLS-1$
|
||||||
remoteExit = makeMenuRes("remote_exit"); //$NON-NLS-1$
|
remoteExit = makeMenuRes("remote_exit"); //$NON-NLS-1$
|
||||||
|
|
||||||
for (int i = 0; i < remoteHosts.length; i++) {
|
for (int i = 0; i < hostCount; i++) {
|
||||||
remoteHosts[i] = remoteHosts[i].trim();
|
remoteHosts[i] = remoteHosts[i].trim();
|
||||||
|
|
||||||
JMenuItem item = makeMenuItemNoRes(remoteHosts[i], ActionNames.REMOTE_START);
|
JMenuItem item = makeMenuItemNoRes(remoteHosts[i], ActionNames.REMOTE_START);
|
||||||
|
|
|
||||||
|
|
@ -55,11 +55,12 @@ public class PowerTableModel extends DefaultTableModel {
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setRowValues(int row, Object[] values) {
|
public void setRowValues(int row, Object[] values) {
|
||||||
if (values.length != model.getHeaderCount()){
|
int valueCount = values.length;
|
||||||
|
if (valueCount != model.getHeaderCount()){
|
||||||
throw new IllegalArgumentException("Incorrect number of data items");
|
throw new IllegalArgumentException("Incorrect number of data items");
|
||||||
}
|
}
|
||||||
model.setCurrentPos(row);
|
model.setCurrentPos(row);
|
||||||
for (int i = 0; i < values.length; i++) {
|
for (int i = 0; i < valueCount; i++) {
|
||||||
model.addColumnValue(model.getHeaders()[i], values[i]);
|
model.addColumnValue(model.getHeaders()[i], values[i]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -110,11 +111,12 @@ public class PowerTableModel extends DefaultTableModel {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void addRow(Object[] data) {
|
public void addRow(Object[] data) {
|
||||||
if (data.length != model.getHeaderCount()){
|
int dataCount = data.length;
|
||||||
|
if (dataCount != model.getHeaderCount()){
|
||||||
throw new IllegalArgumentException("Incorrect number of data items");
|
throw new IllegalArgumentException("Incorrect number of data items");
|
||||||
}
|
}
|
||||||
model.setCurrentPos(model.size());
|
model.setCurrentPos(model.size());
|
||||||
for (int i = 0; i < data.length; i++) {
|
for (int i = 0; i < dataCount; i++) {
|
||||||
model.addColumnValue(model.getHeaders()[i], data[i]);
|
model.addColumnValue(model.getHeaders()[i], data[i]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -145,7 +147,8 @@ public class PowerTableModel extends DefaultTableModel {
|
||||||
|
|
||||||
private Object[] createDefaultRow() {
|
private Object[] createDefaultRow() {
|
||||||
Object[] rowData = new Object[getColumnCount()];
|
Object[] rowData = new Object[getColumnCount()];
|
||||||
for (int i = 0; i < rowData.length; i++) {
|
int rowDataCount = rowData.length;
|
||||||
|
for (int i = 0; i < rowDataCount; i++) {
|
||||||
rowData[i] = createDefaultValue(i);
|
rowData[i] = createDefaultValue(i);
|
||||||
}
|
}
|
||||||
return rowData;
|
return rowData;
|
||||||
|
|
|
||||||
|
|
@ -164,7 +164,8 @@ public class CsvFileSampleSource extends AbstractSampleSource {
|
||||||
SampleContext context = getSampleContext();
|
SampleContext context = getSampleContext();
|
||||||
Validate.validState(context != null, "Set a sample context before producing samples.");
|
Validate.validState(context != null, "Set a sample context before producing samples.");
|
||||||
|
|
||||||
for (int i = 0; i < csvReaders.length; i++) {
|
int readerCount = csvReaders.length;
|
||||||
|
for (int i = 0; i < readerCount; i++) {
|
||||||
long sampleCount = 0;
|
long sampleCount = 0;
|
||||||
long start = now();
|
long start = now();
|
||||||
CsvSampleReader csvReader = csvReaders[i];
|
CsvSampleReader csvReader = csvReaders[i];
|
||||||
|
|
|
||||||
|
|
@ -97,7 +97,8 @@ public class Top5ErrorsBySamplerConsumer extends
|
||||||
Object[][] top5 = data.getTop5ErrorsMetrics();
|
Object[][] top5 = data.getTop5ErrorsMetrics();
|
||||||
|
|
||||||
int numberOfValues = 0;
|
int numberOfValues = 0;
|
||||||
for (int i = 0; i < top5.length; i++) {
|
int top5Count = top5.length;
|
||||||
|
for (int i = 0; i < top5Count; i++) {
|
||||||
result.addResult(new ValueResultData(top5[i][0]));
|
result.addResult(new ValueResultData(top5[i][0]));
|
||||||
result.addResult(new ValueResultData(top5[i][1]));
|
result.addResult(new ValueResultData(top5[i][1]));
|
||||||
numberOfValues++;
|
numberOfValues++;
|
||||||
|
|
|
||||||
|
|
@ -132,7 +132,8 @@ public class SyntheticResponseTimeDistributionGraphConsumer extends
|
||||||
String[] colors = new String[]{
|
String[] colors = new String[]{
|
||||||
SATISFIED_COLOR, TOLERATED_COLOR, UNTOLERATED_COLOR, FAILED_COLOR
|
SATISFIED_COLOR, TOLERATED_COLOR, UNTOLERATED_COLOR, FAILED_COLOR
|
||||||
};
|
};
|
||||||
for (int i = 0; i < seriesLabels.length; i++) {
|
int seriesCount = seriesLabels.length;
|
||||||
|
for (int i = 0; i < seriesCount; i++) {
|
||||||
ListResultData array = new ListResultData();
|
ListResultData array = new ListResultData();
|
||||||
array.addResult(new ValueResultData(i));
|
array.addResult(new ValueResultData(i));
|
||||||
array.addResult(new ValueResultData(seriesLabels[i]));
|
array.addResult(new ValueResultData(seriesLabels[i]));
|
||||||
|
|
@ -144,7 +145,8 @@ public class SyntheticResponseTimeDistributionGraphConsumer extends
|
||||||
|
|
||||||
private void initializeSeries(MapResultData parentResult, String[] series, String[] colors) {
|
private void initializeSeries(MapResultData parentResult, String[] series, String[] colors) {
|
||||||
ListResultData listResultData = (ListResultData) parentResult.getResult("series");
|
ListResultData listResultData = (ListResultData) parentResult.getResult("series");
|
||||||
for (int i = 0; i < series.length; i++) {
|
int seriesCount = series.length;
|
||||||
|
for (int i = 0; i < seriesCount; i++) {
|
||||||
listResultData.addResult(create(series[i], colors[i]));
|
listResultData.addResult(create(series[i], colors[i]));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -233,7 +233,8 @@ public class SampleEvent implements Serializable {
|
||||||
sb.append(", isTransactionSampleEvent=").append(isTransactionSampleEvent);
|
sb.append(", isTransactionSampleEvent=").append(isTransactionSampleEvent);
|
||||||
if (values != null && values.length > 0) {
|
if (values != null && values.length > 0) {
|
||||||
sb.append("values=[");
|
sb.append("values=[");
|
||||||
for (int i = 0; i < variableNames.length; i++) {
|
int variableNameCount = variableNames.length;
|
||||||
|
for (int i = 0; i < variableNameCount; i++) {
|
||||||
if (i > 0) {
|
if (i > 0) {
|
||||||
sb.append(", ");
|
sb.append(", ");
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -437,7 +437,8 @@ public final class CSVSaveService {
|
||||||
appendFields(saveConfig.saveIdleTime(), text, delim, CSV_IDLETIME);
|
appendFields(saveConfig.saveIdleTime(), text, delim, CSV_IDLETIME);
|
||||||
appendFields(saveConfig.saveConnectTime(), text, delim, CSV_CONNECT_TIME);
|
appendFields(saveConfig.saveConnectTime(), text, delim, CSV_CONNECT_TIME);
|
||||||
|
|
||||||
for (int i = 0; i < SampleEvent.getVarCount(); i++) {
|
int sampleVariableCount = SampleEvent.getVarCount();
|
||||||
|
for (int i = 0; i < sampleVariableCount; i++) {
|
||||||
text.append(VARIABLE_NAME_QUOTE_CHAR);
|
text.append(VARIABLE_NAME_QUOTE_CHAR);
|
||||||
text.append(SampleEvent.getVarName(i));
|
text.append(SampleEvent.getVarName(i));
|
||||||
text.append(VARIABLE_NAME_QUOTE_CHAR);
|
text.append(VARIABLE_NAME_QUOTE_CHAR);
|
||||||
|
|
@ -594,7 +595,8 @@ public final class CSVSaveService {
|
||||||
String[] parts = headerLine.split("\\Q" + delim);// $NON-NLS-1$
|
String[] parts = headerLine.split("\\Q" + delim);// $NON-NLS-1$
|
||||||
int previous = -1;
|
int previous = -1;
|
||||||
// Check if the line is a header
|
// Check if the line is a header
|
||||||
for (int i = 0; i < parts.length; i++) {
|
int partsCount = parts.length;
|
||||||
|
for (int i = 0; i < partsCount; i++) {
|
||||||
final String label = parts[i];
|
final String label = parts[i];
|
||||||
// Check for Quoted variable names
|
// Check for Quoted variable names
|
||||||
if (isVariableName(label)) {
|
if (isVariableName(label)) {
|
||||||
|
|
@ -666,7 +668,8 @@ public final class CSVSaveService {
|
||||||
final char DELIM = ',';
|
final char DELIM = ',';
|
||||||
final char[] SPECIALS = new char[] { DELIM, QUOTING_CHAR };
|
final char[] SPECIALS = new char[] { DELIM, QUOTING_CHAR };
|
||||||
if (headers != null) {
|
if (headers != null) {
|
||||||
for (int i = 0; i < headers.length; i++) {
|
int headerCount = headers.length;
|
||||||
|
for (int i = 0; i < headerCount; i++) {
|
||||||
if (i > 0) {
|
if (i > 0) {
|
||||||
writer.write(DELIM);
|
writer.write(DELIM);
|
||||||
}
|
}
|
||||||
|
|
@ -676,7 +679,8 @@ public final class CSVSaveService {
|
||||||
}
|
}
|
||||||
for (Object o : data) {
|
for (Object o : data) {
|
||||||
List<?> row = (List<?>) o;
|
List<?> row = (List<?>) o;
|
||||||
for (int idy = 0; idy < row.size(); idy++) {
|
int rowSize = row.size();
|
||||||
|
for (int idy = 0; idy < rowSize; idy++) {
|
||||||
if (idy > 0) {
|
if (idy > 0) {
|
||||||
writer.write(DELIM);
|
writer.write(DELIM);
|
||||||
}
|
}
|
||||||
|
|
@ -943,7 +947,8 @@ public final class CSVSaveService {
|
||||||
text.append(sample.getConnectTime());
|
text.append(sample.getConnectTime());
|
||||||
}
|
}
|
||||||
|
|
||||||
for (int i = 0; i < SampleEvent.getVarCount(); i++) {
|
int sampleVarCount = SampleEvent.getVarCount();
|
||||||
|
for (int i = 0; i < sampleVarCount; i++) {
|
||||||
text.append(event.getVarValue(i));
|
text.append(event.getVarValue(i));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -986,10 +991,11 @@ public final class CSVSaveService {
|
||||||
if (StringUtils.containsNone(input, specialChars)) {
|
if (StringUtils.containsNone(input, specialChars)) {
|
||||||
return input;
|
return input;
|
||||||
}
|
}
|
||||||
StringBuilder buffer = new StringBuilder(input.length() + 10);
|
int inputLength = input.length();
|
||||||
|
StringBuilder buffer = new StringBuilder(inputLength + 10);
|
||||||
final char quote = specialChars[1];
|
final char quote = specialChars[1];
|
||||||
buffer.append(quote);
|
buffer.append(quote);
|
||||||
for (int i = 0; i < input.length(); i++) {
|
for (int i = 0; i < inputLength; i++) {
|
||||||
char c = input.charAt(i);
|
char c = input.charAt(i);
|
||||||
if (c == quote) {
|
if (c == quote) {
|
||||||
buffer.append(quote); // double the quote char
|
buffer.append(quote); // double the quote char
|
||||||
|
|
|
||||||
|
|
@ -335,7 +335,8 @@ public class SampleResultConverter extends AbstractCollectionConverter {
|
||||||
if (save.saveHostname()){
|
if (save.saveHostname()){
|
||||||
writer.addAttribute(ATT_HOSTNAME, event.getHostname());
|
writer.addAttribute(ATT_HOSTNAME, event.getHostname());
|
||||||
}
|
}
|
||||||
for (int i = 0; i < SampleEvent.getVarCount(); i++){
|
int sampleVarCount = SampleEvent.getVarCount();
|
||||||
|
for (int i = 0; i < sampleVarCount; i++){
|
||||||
writer.addAttribute(SampleEvent.getVarName(i), ConversionHelp.encode(event.getVarValue(i)));
|
writer.addAttribute(SampleEvent.getVarName(i), ConversionHelp.encode(event.getVarValue(i)));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -245,7 +245,8 @@ public abstract class BeanInfoSupport extends SimpleBeanInfo {
|
||||||
*/
|
*/
|
||||||
protected void createPropertyGroup(String group, String[] names) {
|
protected void createPropertyGroup(String group, String[] names) {
|
||||||
String name;
|
String name;
|
||||||
for (int i = 0; i < names.length; i++) { // i is used below
|
int namesLength = names.length;
|
||||||
|
for (int i = 0; i < namesLength; i++) { // i is used below
|
||||||
name = names[i];
|
name = names[i];
|
||||||
log.debug("Getting property for: {}", name);
|
log.debug("Getting property for: {}", name);
|
||||||
PropertyDescriptor p = property(name);
|
PropertyDescriptor p = property(name);
|
||||||
|
|
|
||||||
|
|
@ -216,10 +216,11 @@ public class GenericTestBeanCustomizer extends JPanel implements SharedCustomize
|
||||||
Arrays.sort(descriptors, new PropertyComparator(beanInfo));
|
Arrays.sort(descriptors, new PropertyComparator(beanInfo));
|
||||||
|
|
||||||
// Obtain the propertyEditors:
|
// Obtain the propertyEditors:
|
||||||
editors = new PropertyEditor[descriptors.length];
|
int descriptorsCount = descriptors.length;
|
||||||
|
editors = new PropertyEditor[descriptorsCount];
|
||||||
int scriptLanguageIndex = 0;
|
int scriptLanguageIndex = 0;
|
||||||
int textAreaEditorIndex = 0;
|
int textAreaEditorIndex = 0;
|
||||||
for (int i = 0; i < descriptors.length; i++) { // Index is also used for accessing editors array
|
for (int i = 0; i < descriptorsCount; i++) { // Index is also used for accessing editors array
|
||||||
PropertyDescriptor descriptor = descriptors[i];
|
PropertyDescriptor descriptor = descriptors[i];
|
||||||
String name = descriptor.getName();
|
String name = descriptor.getName();
|
||||||
|
|
||||||
|
|
@ -503,7 +504,8 @@ public class GenericTestBeanCustomizer extends JPanel implements SharedCustomize
|
||||||
}
|
}
|
||||||
|
|
||||||
// Now set the editors to the element's values:
|
// Now set the editors to the element's values:
|
||||||
for (int i = 0; i < editors.length; i++) {
|
int editorsCount = editors.length;
|
||||||
|
for (int i = 0; i < editorsCount; i++) {
|
||||||
if (editors[i] == null) {
|
if (editors[i] == null) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
@ -556,7 +558,8 @@ public class GenericTestBeanCustomizer extends JPanel implements SharedCustomize
|
||||||
String currentGroup = DEFAULT_GROUP;
|
String currentGroup = DEFAULT_GROUP;
|
||||||
int y = 0;
|
int y = 0;
|
||||||
|
|
||||||
for (int i = 0; i < editors.length; i++) {
|
int editorsCount = editors.length;
|
||||||
|
for (int i = 0; i < editorsCount; i++) {
|
||||||
if (editors[i] == null) {
|
if (editors[i] == null) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
@ -733,7 +736,8 @@ public class GenericTestBeanCustomizer extends JPanel implements SharedCustomize
|
||||||
* Save values from the GUI fields into the property map
|
* Save values from the GUI fields into the property map
|
||||||
*/
|
*/
|
||||||
void saveGuiFields() {
|
void saveGuiFields() {
|
||||||
for (int i = 0; i < editors.length; i++) {
|
int editorsCount = editors.length;
|
||||||
|
for (int i = 0; i < editorsCount; i++) {
|
||||||
PropertyEditor propertyEditor=editors[i]; // might be null (e.g. in testing)
|
PropertyEditor propertyEditor=editors[i]; // might be null (e.g. in testing)
|
||||||
if (propertyEditor != null) {
|
if (propertyEditor != null) {
|
||||||
Object value = propertyEditor.getValue();
|
Object value = propertyEditor.getValue();
|
||||||
|
|
@ -750,7 +754,8 @@ public class GenericTestBeanCustomizer extends JPanel implements SharedCustomize
|
||||||
}
|
}
|
||||||
|
|
||||||
void clearGuiFields() {
|
void clearGuiFields() {
|
||||||
for (int i = 0; i < editors.length; i++) {
|
int editorsCount = editors.length;
|
||||||
|
for (int i = 0; i < editorsCount; i++) {
|
||||||
PropertyEditor propertyEditor=editors[i]; // might be null (e.g. in testing)
|
PropertyEditor propertyEditor=editors[i]; // might be null (e.g. in testing)
|
||||||
if (propertyEditor != null) {
|
if (propertyEditor != null) {
|
||||||
try {
|
try {
|
||||||
|
|
|
||||||
|
|
@ -322,7 +322,8 @@ public class TableEditor extends PropertyEditorSupport implements FocusListener,
|
||||||
|
|
||||||
model.addRow(clazz.getDeclaredConstructor().newInstance());
|
model.addRow(clazz.getDeclaredConstructor().newInstance());
|
||||||
|
|
||||||
for (int i=0; i < columns.length; i++) {
|
int columnsCount = columns.length;
|
||||||
|
for (int i = 0; i < columnsCount; i++) {
|
||||||
model.setValueAt(columns[i], model.getRowCount() - 1, i);
|
model.setValueAt(columns[i], model.getRowCount() - 1, i);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -392,9 +393,10 @@ public class TableEditor extends PropertyEditorSupport implements FocusListener,
|
||||||
GuiUtils.cancelEditing(table);
|
GuiUtils.cancelEditing(table);
|
||||||
|
|
||||||
int[] rowsSelected = table.getSelectedRows();
|
int[] rowsSelected = table.getSelectedRows();
|
||||||
if (rowsSelected.length > 0 && rowsSelected[rowsSelected.length - 1] < table.getRowCount() - 1) {
|
int selectedRowsCount = rowsSelected.length;
|
||||||
|
if (selectedRowsCount > 0 && rowsSelected[selectedRowsCount - 1] < table.getRowCount() - 1) {
|
||||||
table.clearSelection();
|
table.clearSelection();
|
||||||
for (int i = rowsSelected.length - 1; i >= 0; i--) {
|
for (int i = selectedRowsCount - 1; i >= 0; i--) {
|
||||||
int rowSelected = rowsSelected[i];
|
int rowSelected = rowsSelected[i];
|
||||||
model.moveRow(rowSelected, rowSelected + 1, rowSelected + 1);
|
model.moveRow(rowSelected, rowSelected + 1, rowSelected + 1);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -159,7 +159,8 @@ public class TestPlan extends AbstractTestElement implements Serializable, TestS
|
||||||
|
|
||||||
public void setTestPlanClasspathArray(String[] text) {
|
public void setTestPlanClasspathArray(String[] text) {
|
||||||
StringBuilder cat = new StringBuilder();
|
StringBuilder cat = new StringBuilder();
|
||||||
for (int idx=0; idx < text.length; idx++) {
|
int textLength = text.length;
|
||||||
|
for (int idx = 0; idx < textLength; idx++) {
|
||||||
if (idx > 0) {
|
if (idx > 0) {
|
||||||
cat.append(CLASSPATH_SEPARATOR);
|
cat.append(CLASSPATH_SEPARATOR);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -54,7 +54,8 @@ public class CustomX509TrustManager implements X509TrustManager
|
||||||
@Override
|
@Override
|
||||||
public void checkClientTrusted(X509Certificate[] certificates, String authType) { // NOSONAR JMeter is a pentest and perf testing tool
|
public void checkClientTrusted(X509Certificate[] certificates, String authType) { // NOSONAR JMeter is a pentest and perf testing tool
|
||||||
if (log.isDebugEnabled() && certificates != null) {
|
if (log.isDebugEnabled() && certificates != null) {
|
||||||
for (int i = 0; i < certificates.length; i++) {
|
int certificatesCount = certificates.length;
|
||||||
|
for (int i = 0; i < certificatesCount; i++) {
|
||||||
X509Certificate cert = certificates[i];
|
X509Certificate cert = certificates[i];
|
||||||
log.debug(
|
log.debug(
|
||||||
" Client certificate {}:\n"
|
" Client certificate {}:\n"
|
||||||
|
|
@ -80,7 +81,8 @@ public class CustomX509TrustManager implements X509TrustManager
|
||||||
public void checkServerTrusted(X509Certificate[] certificates,String authType) // NOSONAR JMeter is a pentest and perf testing tool
|
public void checkServerTrusted(X509Certificate[] certificates,String authType) // NOSONAR JMeter is a pentest and perf testing tool
|
||||||
throws CertificateException {
|
throws CertificateException {
|
||||||
if (log.isDebugEnabled() && certificates != null) {
|
if (log.isDebugEnabled() && certificates != null) {
|
||||||
for (int i = 0; i < certificates.length; i++) {
|
int certificatesCount = certificates.length;
|
||||||
|
for (int i = 0; i < certificatesCount; i++) {
|
||||||
X509Certificate cert = certificates[i];
|
X509Certificate cert = certificates[i];
|
||||||
log.debug(
|
log.debug(
|
||||||
" Server certificate {}:\n"
|
" Server certificate {}:\n"
|
||||||
|
|
|
||||||
|
|
@ -97,7 +97,8 @@ public class HttpSSLProtocolSocketFactory
|
||||||
|
|
||||||
private static String join(String[] strings) {
|
private static String join(String[] strings) {
|
||||||
StringBuilder sb = new StringBuilder();
|
StringBuilder sb = new StringBuilder();
|
||||||
for (int i=0;i<strings.length;i++){
|
int stringsCount = strings.length;
|
||||||
|
for (int i = 0; i< stringsCount; i++){
|
||||||
if (i>0) {
|
if (i>0) {
|
||||||
sb.append(' ');
|
sb.append(' ');
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -261,7 +261,8 @@ public final class JmeterKeyStore {
|
||||||
|
|
||||||
private static X509Certificate[] toX509Certificates(Certificate[] chain) {
|
private static X509Certificate[] toX509Certificates(Certificate[] chain) {
|
||||||
X509Certificate[] x509certs = new X509Certificate[chain.length];
|
X509Certificate[] x509certs = new X509Certificate[chain.length];
|
||||||
for (int i = 0; i < x509certs.length; i++) {
|
int certificatesCount = x509certs.length;
|
||||||
|
for (int i = 0; i < certificatesCount; i++) {
|
||||||
x509certs[i] = (X509Certificate) chain[i];
|
x509certs[i] = (X509Certificate) chain[i];
|
||||||
}
|
}
|
||||||
return x509certs;
|
return x509certs;
|
||||||
|
|
|
||||||
|
|
@ -86,7 +86,7 @@ public class ChangeCase extends AbstractFunction {
|
||||||
LOGGER.error("Unknown mode {}, returning {} unchanged", mode, originalString);
|
LOGGER.error("Unknown mode {}, returning {} unchanged", mode, originalString);
|
||||||
return originalString;
|
return originalString;
|
||||||
}
|
}
|
||||||
|
|
||||||
return switch (changeCaseMode) {
|
return switch (changeCaseMode) {
|
||||||
case UPPER -> StringUtils.upperCase(originalString);
|
case UPPER -> StringUtils.upperCase(originalString);
|
||||||
case LOWER -> StringUtils.lowerCase(originalString);
|
case LOWER -> StringUtils.lowerCase(originalString);
|
||||||
|
|
|
||||||
|
|
@ -81,7 +81,7 @@ public class TestHttpRequestHdr extends JMeterTestCase {
|
||||||
Content-type: %s\r
|
Content-type: %s\r
|
||||||
Content-length: %d\r
|
Content-length: %d\r
|
||||||
\r
|
\r
|
||||||
%s""".formatted(url, HTTPConstants.APPLICATION_X_WWW_FORM_URLENCODED,
|
%s""".formatted(url, HTTPConstants.APPLICATION_X_WWW_FORM_URLENCODED,
|
||||||
getBodyLength(postBody, contentEncoding), postBody);
|
getBodyLength(postBody, contentEncoding), postBody);
|
||||||
s = getSamplerForRequest(url, testPostRequest, contentEncoding);
|
s = getSamplerForRequest(url, testPostRequest, contentEncoding);
|
||||||
assertEquals(HTTPConstants.POST, s.getMethod());
|
assertEquals(HTTPConstants.POST, s.getMethod());
|
||||||
|
|
@ -597,15 +597,15 @@ public class TestHttpRequestHdr extends JMeterTestCase {
|
||||||
private String createMultipartFormBody(String titleValue, String descriptionValue,
|
private String createMultipartFormBody(String titleValue, String descriptionValue,
|
||||||
String contentEncoding, boolean includeExtraHeaders,
|
String contentEncoding, boolean includeExtraHeaders,
|
||||||
String boundary, String endOfLine) {
|
String boundary, String endOfLine) {
|
||||||
|
|
||||||
String titleHeaders = includeExtraHeaders ? """
|
String titleHeaders = includeExtraHeaders ? """
|
||||||
Content-Type: text/plain; charset=%s%s\
|
Content-Type: text/plain; charset=%s%s\
|
||||||
Content-Transfer-Encoding: 8bit%s""".formatted(contentEncoding, endOfLine, endOfLine) : "";
|
Content-Transfer-Encoding: 8bit%s""".formatted(contentEncoding, endOfLine, endOfLine) : "";
|
||||||
|
|
||||||
String descriptionHeaders = includeExtraHeaders ? """
|
String descriptionHeaders = includeExtraHeaders ? """
|
||||||
Content-Type: text/plain; charset=%s%s\
|
Content-Type: text/plain; charset=%s%s\
|
||||||
Content-Transfer-Encoding: 8bit%s""".formatted(contentEncoding, endOfLine, endOfLine) : "";
|
Content-Transfer-Encoding: 8bit%s""".formatted(contentEncoding, endOfLine, endOfLine) : "";
|
||||||
|
|
||||||
return """
|
return """
|
||||||
--%s%s\
|
--%s%s\
|
||||||
Content-Disposition: form-data; name="title"%s\
|
Content-Disposition: form-data; name="title"%s\
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue