/** {@inheritDoc} */ @Override public void setAsText(String text) throws IllegalArgumentException { textUI.setInitialText(text); textUI.setCaretPosition(0); }
/** {@inheritDoc} */ @Override public void renderResult(SampleResult sampleResult) { String response = ViewResultsFullVisualizer.getResponseAsString(sampleResult); try { xmlDataField.setText(response == null ? "" : response); xmlDataField.setCaretPosition(0); } catch (Exception e) { log.error("Exception converting to XML: {}, message: {}", response, e.getMessage(), e); xmlDataField.setText("Exception converting to XML:"+response+ ", message:"+e.getMessage()); xmlDataField.setCaretPosition(0); } }
/** {@inheritDoc} */ @Override public void renderResult(SampleResult sampleResult) { String response = ViewResultsFullVisualizer.getResponseAsString(sampleResult); try { xmlDataField.setText(response == null ? "" : response); xmlDataField.setCaretPosition(0); } catch (Exception e) { log.error("Exception converting to XML: {}, message: {}", response, e.getMessage(), e); xmlDataField.setText("Exception converting to XML:"+response+ ", message:"+e.getMessage()); xmlDataField.setCaretPosition(0); } }
/** {@inheritDoc} */ @Override public void renderResult(SampleResult sampleResult) { String response = ViewResultsFullVisualizer.getResponseAsString(sampleResult); try { jsonDataField.setText(response == null ? "" : RenderAsJSON.prettyJSON(response, TAB_SEPARATOR)); //$NON-NLS-1$ jsonDataField.setCaretPosition(0); } catch (Exception e) { log.error("Exception converting to XML: {}, message: {}", response, e.getMessage(), e); //$NON-NLS-1$ $NON-NLS-2$ jsonDataField.setText("Exception converting to XML: "+response+ ", message: "+e.getMessage()); //$NON-NLS-1$ $NON-NLS-2$ jsonDataField.setCaretPosition(0); } }
/** * Launch xpath engine to parse a input text * @param textToParse */ private void executeAndShowXPathTester(String textToParse, XPath2Extractor extractor) { if (textToParse != null && textToParse.length() > 0 && this.xpathExpressionField.getText().length() > 0) { this.xpathResultField.setText(process(textToParse, extractor)); this.xpathResultField.setCaretPosition(0); // go to first line } }
/** {@inheritDoc} */ @Override public void setValue(Object value) { if (value != null) { textUI.setInitialText(value.toString()); textUI.setCaretPosition(0); } else { textUI.setInitialText(""); } }
/** * Set TextField and TA values from model * @param selectedRow Selected row */ private void setValues(int selectedRow) { nameTF.setText((String)tableModel.getValueAt(selectedRow, 0)); valueTA.setInitialText((String)tableModel.getValueAt(selectedRow, 1)); valueTA.setCaretPosition(0); textChanged = false; }
@Override public void actionPerformed(ActionEvent evt) { String text = searchField.getText(); toggleSearchField(searchField, true); if (!text.isEmpty()) { SearchContext context = createSearchContext( text, true, matchCaseCB.isSelected(), regexCB.isSelected()); boolean found = SearchEngine.find(dataField, context).wasFound(); toggleSearchField(searchField, found); if(!found) { dataField.setCaretPosition(0); } } }
/** * Convert Parameters to Raw Body */ void convertParametersToRaw() { if(postBodyContent.getText().isEmpty()) { postBodyContent.setInitialText(computePostBody((Arguments)argsPanel.createTestElement())); postBodyContent.setCaretPosition(0); } } }
/** {@inheritDoc} */ @Override public void renderResult(SampleResult sampleResult) { clearData(); String response = ViewResultsFullVisualizer.getResponseAsString(sampleResult); cssJqueryDataField.setText(response); cssJqueryDataField.setCaretPosition(0); }
@Override public void setSamplerResult(Object objectResult) { if (objectResult instanceof SampleResult) { SampleResult sampleResult = (SampleResult) objectResult; // Don't display Request headers label if rh is null or empty String rh = sampleResult.getRequestHeaders(); if (rh != null && !rh.isEmpty()) { headerData.setInitialText(rh); sampleDataField.setCaretPosition(0); } String data = sampleResult.getSamplerData(); if (data != null && !data.isEmpty()) { sampleDataField.setText(data); sampleDataField.setCaretPosition(0); } else { // add a message when no request data (ex. Java request) sampleDataField.setText(JMeterUtils .getResString("view_results_table_request_raw_nodata")); //$NON-NLS-1$ } } }
@Override public void configure(TestElement element) { scriptField.setInitialText(element.getPropertyAsString(BeanShellAssertion.SCRIPT)); scriptField.setCaretPosition(0); filename.setFilename(element.getPropertyAsString(BeanShellAssertion.FILENAME)); parameters.setText(element.getPropertyAsString(BeanShellAssertion.PARAMETERS)); resetInterpreter.setSelected(element.getPropertyAsBoolean(BeanShellAssertion.RESET_INTERPRETER)); super.configure(element); }
@Override public void configure(TestElement element) { scriptField.setInitialText(element.getPropertyAsString(BeanShellSampler.SCRIPT)); scriptField.setCaretPosition(0); filename.setFilename(element.getPropertyAsString(BeanShellSampler.FILENAME)); parameters.setText(element.getPropertyAsString(BeanShellSampler.PARAMETERS)); resetInterpreter.setSelected(element.getPropertyAsBoolean(BeanShellSampler.RESET_INTERPRETER)); super.configure(element); }
/** * Display result in popup * @param result String */ private static final void showResult(String result) { EscapeDialog messageDialog = new EscapeDialog(GuiPackage.getInstance().getMainFrame(), JMeterUtils.getResString("export_transactions_title"), true); //$NON-NLS-1$ Container contentPane = messageDialog.getContentPane(); contentPane.setLayout(new BorderLayout()); contentPane.add(new JLabel( JMeterUtils.getResString("export_transactions_exported_property"), SwingConstants.CENTER), BorderLayout.NORTH);//$NON-NLS-1$ JSyntaxTextArea syntaxTextArea = JSyntaxTextArea.getInstance(10, 80, true); syntaxTextArea.setText(result); syntaxTextArea.setCaretPosition(0); contentPane.add(JTextScrollPane.getInstance(syntaxTextArea), BorderLayout.CENTER); messageDialog.pack(); ComponentUtil.centerComponentInComponent(GuiPackage.getInstance().getMainFrame(), messageDialog); SwingUtilities.invokeLater(() -> messageDialog.setVisible(true)); }
@Override public void configure(TestElement element) { super.configure(element); // N.B. this will be a config element, so we cannot use the getXXX() methods classname.setText(element.getPropertyAsString(TCPSampler.CLASSNAME)); serverPanel.setServer(element.getPropertyAsString(TCPSampler.SERVER)); // Default to original behaviour, i.e. re-use connection reUseConnection.setSelected(element.getPropertyAsBoolean(TCPSampler.RE_USE_CONNECTION, TCPSampler.RE_USE_CONNECTION_DEFAULT)); serverPanel.setPort(element.getPropertyAsString(TCPSampler.PORT)); serverPanel.setResponseTimeout(element.getPropertyAsString(TCPSampler.TIMEOUT)); serverPanel.setConnectTimeout(element.getPropertyAsString(TCPSampler.TIMEOUT_CONNECT)); setNoDelay.setTristateFromProperty(element, TCPSampler.NODELAY); requestData.setInitialText(element.getPropertyAsString(TCPSampler.REQUEST)); requestData.setCaretPosition(0); closeConnection.setTristateFromProperty(element, TCPSampler.CLOSE_CONNECTION); soLinger.setText(element.getPropertyAsString(TCPSampler.SO_LINGER)); eolByte.setText(element.getPropertyAsString(TCPSampler.EOL_BYTE)); }
/** * the implementation loads the URL and the soap action for the request. */ @Override public void configure(TestElement el) { super.configure(el); PublisherSampler sampler = (PublisherSampler) el; urlField.setText(sampler.getProviderUrl()); mqttDestination.setText(sampler.getDestination()); mqttUser.setText(sampler.getUsername()); mqttPwd.setText(sampler.getPassword()); textMessage.setInitialText(sampler.getTextMessage()); textMessage.setCaretPosition(0); msgChoice.setText(sampler.getMessageChoice()); iterations.setText(sampler.getIterations()); useAuth.setSelected(sampler.isUseAuth()); mqttUser.setEnabled(useAuth.isSelected()); mqttPwd.setEnabled(useAuth.isSelected()); updateChoice(msgChoice.getText()); updateChoice(msgFormat.getText()); updateChoice("Suffix="+String.valueOf(this.suffixClientId.isSelected())); }
resultTextArea.setText(ex.getMessage() + ", \nstacktrace:\n "+ ExceptionUtils.getStackTrace(ex)); resultTextArea.setCaretPosition(0);
String postBody = computePostBody(arguments, true); // Convert CRLF to CR, see modifyTestElement postBodyContent.setInitialText(postBody); postBodyContent.setCaretPosition(0); argsPanel.clear(); postContentTabbedPane.setSelectedIndex(tabRawBodyIndex, false);
jmsPwd.setText(sampler.getPassword()); textMessage.setInitialText(sampler.getTextMessage()); textMessage.setCaretPosition(0); messageFile.setFilename(sampler.getInputFile()); randomFile.setFilename(sampler.getRandomPath());