/** * Create a panel containing the webserver (domain+port) and scheme. * * @return the panel */ protected final JPanel getWebServerPanel() { // PROTOCOL protocol = new JLabeledTextField(JMeterUtils.getResString("protocol"), 4); // $NON-NLS-1$ port = new JLabeledTextField(JMeterUtils.getResString("web_server_port"), 7); // $NON-NLS-1$ domain = new JLabeledTextField(JMeterUtils.getResString("web_server_domain"), 40); // $NON-NLS-1$ JPanel webServerPanel = new HorizontalPanel(); webServerPanel.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(), JMeterUtils.getResString("web_server"))); // $NON-NLS-1$ webServerPanel.add(protocol); webServerPanel.add(domain); webServerPanel.add(port); return webServerPanel; }
/** * @return JPanel timeout config */ private JPanel makeTimeoutPanel() { JPanel panel = new JPanel(); panel.setLayout(new BoxLayout(panel, BoxLayout.X_AXIS)); panel.setBorder(BorderFactory.createTitledBorder( BorderFactory.createEtchedBorder(), JMeterUtils.getResString("timeout_config_box_title"))); // $NON-NLS-1$ timeout = new JLabeledTextField(JMeterUtils.getResString("timeout_title")); // $NON-NLS-1$ timeout.setSize(timeout.getSize().height, 30); panel.add(timeout); return panel; }
/** * Create the Regexp task pane * * @return Regexp task pane */ private JPanel createRegexpTasksPanel() { JPanel regexpActionPanel = new JPanel(); regexpActionPanel.setLayout(new BoxLayout(regexpActionPanel, BoxLayout.X_AXIS)); Border margin = new EmptyBorder(5, 5, 0, 5); regexpActionPanel.setBorder(margin); regexpField = new JLabeledTextField(JMeterUtils.getResString("regexp_tester_field")); // $NON-NLS-1$ regexpActionPanel.add(regexpField, BorderLayout.WEST); JButton regexpTester = new JButton(JMeterUtils.getResString("regexp_tester_button_test")); // $NON-NLS-1$ regexpTester.setActionCommand(REGEXP_TESTER_COMMAND); regexpTester.addActionListener(this); regexpActionPanel.add(regexpTester, BorderLayout.EAST); regexpResultField = new JTextArea(); regexpResultField.setEditable(false); regexpResultField.setLineWrap(true); regexpResultField.setWrapStyleWord(true); JPanel regexpTasksPanel = new JPanel(new BorderLayout(0, 5)); regexpTasksPanel.add(regexpActionPanel, BorderLayout.NORTH); regexpTasksPanel.add(GuiUtils.makeScrollPane(regexpResultField), BorderLayout.CENTER); return regexpTasksPanel; }
/** * Create the boundaryExtractor task pane * * @return boundaryExtractor task pane */ private JPanel createBoundaryExtractorTasksPanel() { JPanel boundaryExtractorActionPanel = new JPanel(); boundaryExtractorActionPanel.setLayout(new BoxLayout(boundaryExtractorActionPanel, BoxLayout.X_AXIS)); Border margin = new EmptyBorder(5, 5, 0, 5); boundaryExtractorActionPanel.setBorder(margin); boundaryExtractorFieldLeft = new JLabeledTextField(JMeterUtils.getResString("boundaryextractor_leftboundary_field")); // $NON-NLS-1$ boundaryExtractorActionPanel.add(boundaryExtractorFieldLeft, BorderLayout.WEST); boundaryExtractorFieldRight = new JLabeledTextField(JMeterUtils.getResString("boundaryextractor_rightboundary_field")); // $NON-NLS-1$ boundaryExtractorActionPanel.add(boundaryExtractorFieldRight, BorderLayout.WEST); JButton boundaryExtractorTester = new JButton(JMeterUtils.getResString("boundaryextractor_tester_button_test")); // $NON-NLS-1$ boundaryExtractorTester.setActionCommand(BOUNDARY_EXTRACTOR_TESTER_COMMAND); boundaryExtractorTester.addActionListener(this); boundaryExtractorActionPanel.add(boundaryExtractorTester, BorderLayout.EAST); boundaryExtractorResultField = new JTextArea(); boundaryExtractorResultField.setEditable(false); boundaryExtractorResultField.setLineWrap(true); boundaryExtractorResultField.setWrapStyleWord(true); JPanel boundaryExtractorTasksPanel = new JPanel(new BorderLayout(0, 5)); boundaryExtractorTasksPanel.add(boundaryExtractorActionPanel, BorderLayout.NORTH); boundaryExtractorTasksPanel.add(GuiUtils.makeScrollPane(boundaryExtractorResultField), BorderLayout.CENTER); return boundaryExtractorTasksPanel; }
/** * @return JPanel return code config */ private JPanel makeReturnCodePanel() { JPanel panel = new JPanel(); panel.setLayout(new BoxLayout(panel, BoxLayout.X_AXIS)); panel.setBorder(BorderFactory.createTitledBorder( BorderFactory.createEtchedBorder(), JMeterUtils.getResString("return_code_config_box_title"))); // $NON-NLS-1$ checkReturnCode = new JCheckBox(JMeterUtils.getResString("check_return_code_title")); // $NON-NLS-1$ checkReturnCode.addItemListener(this); desiredReturnCode = new JLabeledTextField(JMeterUtils.getResString("expected_return_code_title")); // $NON-NLS-1$ desiredReturnCode.setSize(desiredReturnCode.getSize().height, 30); panel.add(checkReturnCode); panel.add(Box.createHorizontalStrut(5)); panel.add(desiredReturnCode); checkReturnCode.setSelected(true); return panel; }
/** * Create the JSON PATH task pane * * @return JSON PATH task pane */ private JPanel createJSonPathExtractorTasksPanel() { JPanel jsonPathActionPanel = new JPanel(); jsonPathActionPanel.setLayout(new BoxLayout(jsonPathActionPanel, BoxLayout.X_AXIS)); Border margin = new EmptyBorder(5, 5, 0, 5); jsonPathActionPanel.setBorder(margin); jsonPathExpressionField = new JLabeledTextField(JMeterUtils.getResString("jsonpath_tester_field")); // $NON-NLS-1$ jsonPathActionPanel.add(jsonPathExpressionField, BorderLayout.WEST); JButton xpathTester = new JButton(JMeterUtils.getResString("jsonpath_tester_button_test")); // $NON-NLS-1$ xpathTester.setActionCommand(JSONPATH_TESTER_COMMAND); xpathTester.addActionListener(this); jsonPathActionPanel.add(xpathTester, BorderLayout.EAST); jsonPathResultField = new JTextArea(); jsonPathResultField.setEditable(false); jsonPathResultField.setLineWrap(true); jsonPathResultField.setWrapStyleWord(true); jsonPathResultField.setMinimumSize(new Dimension(100, 150)); JPanel xpathTasksPanel = new JPanel(new BorderLayout(0, 5)); xpathTasksPanel.add(jsonPathActionPanel, BorderLayout.NORTH); xpathTasksPanel.add(GuiUtils.makeScrollPane(jsonPathResultField), BorderLayout.CENTER); return xpathTasksPanel; }
xpathExpressionField = new JLabeledTextField(JMeterUtils.getResString("xpath_tester_field")); // $NON-NLS-1$
private JPanel makeParameterPanel() { refRegExRefNameField = new JLabeledTextField(JMeterUtils.getResString("regex_params_ref_name_field")); //$NON-NLS-1$ paramNamesGrNrField = new JLabeledTextField(JMeterUtils.getResString("regex_params_names_field")); //$NON-NLS-1$ paramValuesGrNrField = new JLabeledTextField(JMeterUtils.getResString("regex_params_values_field")); //$NON-NLS-1$ JPanel panel = new JPanel(new GridBagLayout()); GridBagConstraints gbc = new GridBagConstraints(); initConstraints(gbc); addField(panel, refRegExRefNameField, gbc); resetContraints(gbc); addField(panel, paramNamesGrNrField, gbc); resetContraints(gbc); gbc.weighty = 1; addField(panel, paramValuesGrNrField, gbc); return panel; }
protected JPanel createEmbeddedRsrcPanel() { // retrieve Embedded resources retrieveEmbeddedResources = new JCheckBox(JMeterUtils.getResString("web_testing_retrieve_images")); // $NON-NLS-1$ // add a listener to activate or not concurrent dwn. retrieveEmbeddedResources.addItemListener(e -> { if (e.getStateChange() == ItemEvent.SELECTED) { enableConcurrentDwn(true); } else { enableConcurrentDwn(false); } }); // Download concurrent resources concurrentDwn = new JCheckBox(JMeterUtils.getResString("web_testing_concurrent_download")); // $NON-NLS-1$ concurrentDwn.addItemListener(e -> { if (retrieveEmbeddedResources.isSelected() && e.getStateChange() == ItemEvent.SELECTED) { concurrentPool.setEnabled(true); } else { concurrentPool.setEnabled(false); } }); concurrentPool = new JTextField(2); // 2 column size concurrentPool.setMinimumSize(new Dimension(10, (int) concurrentPool.getPreferredSize().getHeight())); concurrentPool.setMaximumSize(new Dimension(30, (int) concurrentPool.getPreferredSize().getHeight())); final JPanel embeddedRsrcPanel = new HorizontalPanel(); embeddedRsrcPanel.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(), JMeterUtils .getResString("web_testing_retrieve_title"))); // $NON-NLS-1$ embeddedRsrcPanel.add(retrieveEmbeddedResources); embeddedRsrcPanel.add(concurrentDwn); embeddedRsrcPanel.add(concurrentPool); // Embedded URL match regex embeddedRE = new JLabeledTextField(JMeterUtils.getResString("web_testing_embedded_url_pattern"),20); // $NON-NLS-1$ embeddedRsrcPanel.add(embeddedRE); return embeddedRsrcPanel; }
private JPanel makeParameterPanel() { refNamesField = new JLabeledTextField(JMeterUtils.getResString("jsonpp_variable_names"));//$NON-NLS-1$ jsonPathExpressionsField = new JLabeledTextField(JMeterUtils.getResString("jsonpp_json_path_expressions"));//$NON-NLS-1$ matchNumbersField = new JLabeledTextField(JMeterUtils.getResString("jsonpp_match_numbers"));//$NON-NLS-1$ defaultValuesField = new JLabeledTextField(JMeterUtils.getResString("jsonpp_default_values"));//$NON-NLS-1$ computeConcatenationField = new JCheckBox();//$NON-NLS-1$ JPanel panel = new JPanel(new GridBagLayout()); GridBagConstraints gbc = new GridBagConstraints(); initConstraints(gbc); addField(panel, refNamesField, gbc); nextLine(gbc); addField(panel, jsonPathExpressionsField, gbc); nextLine(gbc); addField(panel, matchNumbersField, gbc); nextLine(gbc); addField(panel, new JLabel(JMeterUtils.getResString("jsonpp_compute_concat")) ,computeConcatenationField, gbc); nextLine(gbc); gbc.weighty = 1; addField(panel, defaultValuesField, gbc); return panel; }
/** * Creates a new UI that provides means to configure the Command & Control endpoint to connect to for sending * commands and receiving command responses. */ public HonoCommanderSamplerUI() { honoServerOptions = new ServerOptionsPanel("Hono connection options"); reconnectAttempts = new JLabeledTextField("Max reconnect attempts"); tenant = new JLabeledTextField("Tenant"); command = new JLabeledTextArea("Command"); commandPayload = new JLabeledTextArea("Command payload"); commandTimeOut = new JLabeledTextField("Command Timeout In Milliseconds"); triggerType = new JComboBox(new String[] { "device", "sampler" }); triggerTypeDescription = new JTextArea(); addOption(honoServerOptions); addOption(reconnectAttempts); addOption(tenant); addOption(command); addOption(commandPayload); addOption(commandTimeOut); addOption(getTriggerTypePanel()); }
private void init() { // WARNING: called from ctor so must not be overridden (i.e. must be private or final) setBorder(makeBorder()); setLayout(new VerticalLayout(5, VerticalLayout.BOTH)); startField = new JLabeledTextField(JMeterUtils.getResString("start_value"));//$NON-NLS-1$ incrField = new JLabeledTextField(JMeterUtils.getResString("increment"));//$NON-NLS-1$ endField = new JLabeledTextField(JMeterUtils.getResString("max_value"));//$NON-NLS-1$ varNameField = new JLabeledTextField(JMeterUtils.getResString("var_name"));//$NON-NLS-1$ formatField = new JLabeledTextField(JMeterUtils.getResString("format"));//$NON-NLS-1$ perUserField = new JCheckBox(JMeterUtils.getResString("counter_per_user"));//$NON-NLS-1$ resetCounterOnEachThreadGroupIteration = new JCheckBox(JMeterUtils.getResString("counter_reset_per_tg_iteration"));//$NON-NLS-1$ add(makeTitlePanel()); add(startField); add(incrField); add(endField); add(formatField); add(varNameField); add(CheckBoxPanel.wrap(perUserField)); add(CheckBoxPanel.wrap(resetCounterOnEachThreadGroupIteration)); perUserField.addActionListener(this); }
private void init() { setLayout(new BorderLayout()); setBorder(makeBorder()); add(JMeterPluginsUtils.addHelpLinkToPanel(makeTitlePanel(), WIKIPAGE), BorderLayout.NORTH); VerticalPanel panel = new VerticalPanel(); panel.setBorder(BorderFactory.createEtchedBorder()); jsonInputTextField = new JLabeledTextField("JSON input"); panel.add(jsonInputTextField); add(panel, BorderLayout.CENTER); }
private void init() { setLayout(new BorderLayout()); setBorder(makeBorder()); add(JMeterPluginsUtils.addHelpLinkToPanel(makeTitlePanel(), WIKIPAGE), BorderLayout.NORTH); VerticalPanel panel = new VerticalPanel(); panel.setBorder(BorderFactory.createEtchedBorder()); jsonInputTextField = new JLabeledTextField("JSON input"); panel.add(jsonInputTextField); add(panel, BorderLayout.CENTER); }
private Component createSaveFormatPanel() { filename = new JLabeledTextField(JMeterUtils.getResString("resultsaver_prefix")); filename.setName(ResultSaver.FILENAME); numberPadLength = new JLabeledTextField(JMeterUtils.getResString("resultsaver_numberpadlen"));// $NON-NLS-1$ numberPadLength.setName(ResultSaver.NUMBER_PAD_LENGTH); skipAutoNumber = new JCheckBox(JMeterUtils.getResString("resultsaver_skipautonumber")); // $NON-NLS-1$ skipSuffix = new JCheckBox(JMeterUtils.getResString("resultsaver_skipsuffix")); // $NON-NLS-1$ addTimestamp = new JCheckBox(JMeterUtils.getResString("resultsaver_addtimestamp")); // $NON-NLS-1$ variableName = new JLabeledTextField(JMeterUtils.getResString("resultsaver_variable")); variableName.setName(ResultSaver.VARIABLE_NAME); JPanel panel = new JPanel(new GridBagLayout()); panel.setBorder(BorderFactory.createTitledBorder(JMeterUtils.getResString("resultsaver_save_format"))); //$NON-NLS-1$ GridBagConstraints gbc = new GridBagConstraints(); initConstraints(gbc); addField(panel, variableName, gbc); resetContraints(gbc); addField(panel, filename, gbc); resetContraints(gbc); addField(panel, skipAutoNumber, gbc); resetContraints(gbc); addField(panel, skipSuffix, gbc); resetContraints(gbc); addField(panel, addTimestamp, gbc); resetContraints(gbc); addField(panel, numberPadLength, gbc); resetContraints(gbc); return panel; }
inputFormatPanel.add(groupPanel); jsonPath = new JLabeledTextField("Assert JSON Path exists: "); jsonValidation = new JCheckBox("Additionally assert value"); isRegex = new JCheckBox("Match as regular expression");
private void init() { // WARNING: called from ctor so must not be overridden (i.e. must be private or final) setLayout(new BorderLayout(0, 5)); setBorder(makeBorder()); add(makeTitlePanel(), BorderLayout.NORTH); VerticalPanel mainPanel = new VerticalPanel(); argumentName = new JLabeledTextField(JMeterUtils.getResString("session_argument_name"), 10); // $NON-NLS-1$ mainPanel.add(argumentName); pathExt = new JCheckBox(JMeterUtils.getResString("path_extension_choice")); // $NON-NLS-1$ mainPanel.add(pathExt); pathExtNoEquals = new JCheckBox(JMeterUtils.getResString("path_extension_dont_use_equals")); // $NON-NLS-1$ mainPanel.add(pathExtNoEquals); pathExtNoQuestionmark = new JCheckBox(JMeterUtils.getResString("path_extension_dont_use_questionmark")); // $NON-NLS-1$ mainPanel.add(pathExtNoQuestionmark); shouldCache = new JCheckBox(JMeterUtils.getResString("cache_session_id")); // $NON-NLS-1$ shouldCache.setSelected(true); mainPanel.add(shouldCache); encode = new JCheckBox(JMeterUtils.getResString("encode")); // $NON-NLS-1$ encode.setSelected(false); mainPanel.add(encode); add(mainPanel, BorderLayout.CENTER); }
public void init() { setLayout(new BorderLayout()); setBorder(makeBorder()); add(JMeterPluginsUtils.addHelpLinkToPanel(makeTitlePanel(), WIKIPAGE), BorderLayout.NORTH); VerticalPanel panel = new VerticalPanel(); panel.setBorder(BorderFactory.createEmptyBorder(5, 0, 5, 0)); jsonPath = new JLabeledTextField("JSON Path: "); jsonValidation = new JCheckBox("Validate against expected value"); jsonValue = new JLabeledTextArea("Expected Value (regular expression): "); expectNull = new JCheckBox("Expect null"); invert = new JCheckBox("Invert assertion (will fail if above conditions met)"); jsonValidation.addChangeListener(this); expectNull.addChangeListener(this); panel.add(jsonPath); panel.add(jsonValidation); panel.add(jsonValue); panel.add(expectNull); panel.add(invert); add(panel, BorderLayout.CENTER); }
public void init() { setLayout(new BorderLayout()); setBorder(makeBorder()); add(makeTitlePanel(), BorderLayout.NORTH); VerticalPanel panel = new VerticalPanel(); panel.setBorder(BorderFactory.createEmptyBorder(5, 0, 5, 0)); jsonPath = new JLabeledTextField(JMeterUtils.getResString("json_assertion_path")); jsonValidation = new JCheckBox(JMeterUtils.getResString("json_assertion_validation")); isRegex = new JCheckBox(JMeterUtils.getResString("json_assertion_regex")); jsonValue = new JLabeledTextArea(JMeterUtils.getResString("json_assertion_expected_value")); expectNull = new JCheckBox(JMeterUtils.getResString("json_assertion_null")); invert = new JCheckBox(JMeterUtils.getResString("json_assertion_invert")); jsonValidation.addChangeListener(this); expectNull.addChangeListener(this); panel.add(jsonPath); panel.add(jsonValidation); panel.add(isRegex); panel.add(jsonValue); panel.add(expectNull); panel.add(invert); add(panel, BorderLayout.CENTER); }
private void init() { // WARNING: called from ctor so must not be overridden (i.e. must be private or final) setLayout(new BorderLayout(0, 5)); serverPanel = new ServerPanel(); if (displayName) { setBorder(makeBorder()); add(makeTitlePanel(), BorderLayout.NORTH); } VerticalPanel mainPanel = new VerticalPanel(); classname = new JLabeledTextField(JMeterUtils.getResString("tcp_classname")); // $NON-NLS-1$ mainPanel.add(classname); mainPanel.add(serverPanel); HorizontalPanel optionsPanel = new HorizontalPanel(); optionsPanel.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder())); optionsPanel.add(createClosePortPanel()); optionsPanel.add(createCloseConnectionPanel()); optionsPanel.add(createNoDelayPanel()); optionsPanel.add(createSoLingerOption()); optionsPanel.add(createEolBytePanel()); mainPanel.add(optionsPanel); mainPanel.add(createRequestPanel()); add(mainPanel, BorderLayout.CENTER); } }