@Override public void stateChanged(ChangeEvent e) { JLabeledChoice c = (JLabeledChoice) e.getSource(); String text = c.getText(); if ("PUT".equals(text) || "POST".equals(text) || "PATCH".equals(text)) { automaticRedirect.setSelected(false); automaticRedirect.setEnabled(false); } else { automaticRedirect.setEnabled(true); } } });
@Override public void stateChanged(ChangeEvent e) { JLabeledChoice c = (JLabeledChoice) e.getSource(); String text = c.getText(); if ("PUT".equals(text) || "POST".equals(text) || "PATCH".equals(text)) { automaticRedirect.setSelected(false); automaticRedirect.setEnabled(false); } else { automaticRedirect.setEnabled(true); } } });
private String process(String textToParse) { try { List<String> result = new ArrayList<>(); Extractor extractor = HtmlExtractor.getExtractorImpl(cssJqueryLabeledChoice.getText()); final int nbFound = extractor.extract( cssJqueryField.getText(), attributeField.getText(), -1, textToParse, result, 0, null); // Construct a multi-line string with all matches StringBuilder sb = new StringBuilder(); sb.append("Match count: ").append(nbFound).append("\n"); for (int j = 0; j < nbFound; j++) { String mr = result.get(j); sb.append("Match[").append(j+1).append("]=").append(mr).append("\n"); } return sb.toString(); } catch (Exception ex) { StringBuilder sb = new StringBuilder(); String message = MessageFormat.format( JMeterUtils.getResString("cssjquery_tester_error") // $NON-NLS-1$ , new Object[]{cssJqueryField.getText(), ex.getMessage()}); sb.append(message); return sb.toString(); } } /** {@inheritDoc} */
@Override public void actionPerformed(ActionEvent e) { String[] source = new String[] { Help.HELP_FUNCTIONS, functionList.getText() }; ActionRouter.getInstance().doActionNow( new ActionEvent(source, e.getID(), ActionNames.HELP)); } }
/** {@inheritDoc} */ @Override public void modifyTestElement(TestElement config) { configureTestElement(config); ((JavaConfig) config).setArguments((Arguments) argsPanel.createTestElement()); ((JavaConfig) config).setClassname(classNameLabeledChoice.getText().trim()); }
String className = classNameLabeledChoice.getText().trim(); try { JavaSamplerClient client = (JavaSamplerClient) Class.forName(className, true,
/** * @throws InstantiationException if function instantiation fails * @throws IllegalAccessException if function instantiation fails */ protected void initParameterPanel() throws InstantiationException, IllegalAccessException { Arguments args = new Arguments(); Function function = CompoundVariable.getFunctionClass(functionList.getText()).newInstance(); List<String> argumentDesc = function.getArgumentDesc(); for (String help : argumentDesc) { args.addArgument(help, ""); //$NON-NLS-1$ } parameterPanel.configure(args); parameterPanel.revalidate(); }
private void populateTemplatePage() { String selectedTemplate = templateList.getText(); Template template = TemplateManager.getInstance().getTemplateByName(selectedTemplate); helpDoc.setText(template.getDescription()); applyTemplateButton.setText(template.isTestPlan() ? JMeterUtils.getResString("template_create_from") : JMeterUtils.getResString("template_merge_from") ); }
/** * Modifies a given TestElement to mirror the data in the gui components. * * @see org.apache.jmeter.gui.JMeterGUIComponent#modifyTestElement(TestElement) */ @Override public void modifyTestElement(TestElement cm) { GuiUtils.stopTableEditing(cookieTable); cm.clear(); configureTestElement(cm); if (cm instanceof CookieManager) { CookieManager cookieManager = (CookieManager) cm; for (int i = 0; i < tableModel.getRowCount(); i++) { Cookie cookie = createCookie(tableModel.getRowData(i)); cookieManager.add(cookie); } cookieManager.setClearEachIteration(clearEachIteration.isSelected()); cookieManager.setCookiePolicy(policy.getText()); } }
final String selectedTemplate = templateList.getText(); final Template template = TemplateManager.getInstance().getTemplateByName(selectedTemplate); if (template == null) {
@Override public void modifyTestElement(final TestElement testElement) { super.configureTestElement(testElement); final HonoReceiverSampler sampler = (HonoReceiverSampler) testElement; sampler.modifyServerOptions(honoServerOptions); sampler.setEndpoint(HonoSampler.Endpoint.valueOf(endpoint.getText())); sampler.setTenant(tenant.getText()); sampler.setContainer(container.getText()); sampler.setPrefetch(prefetch.getText()); sampler.setReconnectAttempts(reconnectAttempts.getText()); sampler.setUseSenderTime(useSenderTime.isSelected()); sampler.setSenderTimeInPayload(senderTimeInPayload.isSelected()); sampler.setSenderTimeVariableName(senderTimeVariableName.getText()); }
String actionCommand = e.getActionCommand(); if(GENERATE.equals(actionCommand)) { String functionName = functionList.getText(); Arguments args = (Arguments) parameterPanel.createTestElement(); String functionCall = buildFunctionCallString(functionName, args);
/** * Modifies a given TestElement to mirror the data in the gui components. * * @see * org.apache.jmeter.gui.JMeterGUIComponent#modifyTestElement(TestElement) */ @Override public void modifyTestElement(TestElement s) { super.configureTestElement(s); if (s instanceof OAuthSampler) { OAuthSampler sampler = (OAuthSampler) s; sampler.setConsumerKey(consumerKey.getText()); sampler.setConsumerSecret(consumerSecret.getText()); sampler.setRequestBody(body.getText()); sampler.setMethod(httpMethods.getText()); sampler.setUseKeepAlive(useKeepAlive.isSelected()); sampler.setAutoRedirects(automaticRedirect.isSelected()); sampler.setHostBaseUrl(hostBaseUrl.getText()); sampler.setResource(resource.getText()); sampler.setPortNumber(port.getText()); sampler.setRequestHeaders(headers.getText()); } }
/** * Modifies a given TestElement to mirror the data in the gui components. * * @see * org.apache.jmeter.gui.JMeterGUIComponent#modifyTestElement(TestElement) */ @Override public void modifyTestElement(TestElement s) { super.configureTestElement(s); if (s instanceof OAuthSampler) { OAuthSampler sampler = (OAuthSampler) s; sampler.setConsumerKey(consumerKey.getText()); sampler.setConsumerSecret(consumerSecret.getText()); sampler.setRequestBody(body.getText()); sampler.setMethod(httpMethods.getText()); sampler.setUseKeepAlive(useKeepAlive.isSelected()); sampler.setAutoRedirects(automaticRedirect.isSelected()); sampler.setHostBaseUrl(hostBaseUrl.getText()); sampler.setResource(resource.getText()); sampler.setPortNumber(port.getText()); sampler.setRequestHeaders(headers.getText()); } }
element.setProperty(HTTPSamplerBase.PATH, path.getText()); if (notConfigOnly){ element.setProperty(HTTPSamplerBase.METHOD, method.getText()); element.setProperty(new BooleanProperty(HTTPSamplerBase.FOLLOW_REDIRECTS, followRedirects.isSelected())); element.setProperty(new BooleanProperty(HTTPSamplerBase.AUTO_REDIRECTS, autoRedirects.isSelected()));
@Override public void modifyTestElement(final TestElement testElement) { super.configureTestElement(testElement); final HonoSenderSampler sampler = (HonoSenderSampler) testElement; sampler.modifyServerOptions(honoServerOptions); sampler.setEndpoint(HonoSampler.Endpoint.valueOf(endpoint.getText())); sampler.setTenant(tenant.getText()); sampler.setContainer(container.getText()); sampler.setDeviceId(deviceId.getText()); sampler.setSetSenderTime(setSenderTime.isSelected()); sampler.setWaitForCredits(waitForCredits.isSelected()); sampler.setWaitForDeliveryResult(waitForDeliveryResult.isSelected()); sampler.setWaitForReceivers(waitForReceivers.getText()); sampler.setWaitForReceiversTimeout(waitForReceiversTimeout.getText()); sampler.setSendTimeout(sampleSendTimeout.getText()); sampler.setMessageCountPerSamplerRun(msgCountPerSamplerRun.getText()); sampler.setContentType(contentType.getText()); sampler.setData(data.getText()); sampler.setRegistrationAssertion(assertion.getText()); // device registration service sampler.modifyRegistrationServiceOptions(registrationServiceOptions); }
/** * Initialize the provided {@link PublisherSampler} with all the values as configured in the GUI. * * @param sampler {@link PublisherSampler} instance */ private void setupSamplerProperties(final PublisherSampler sampler) { super.configureTestElement(sampler); sampler.setUseJNDIProperties(String.valueOf(useProperties.isSelected())); sampler.setJNDIIntialContextFactory(jndiICF.getText()); sampler.setProviderUrl(urlField.getText()); sampler.setConnectionFactory(jndiConnFac.getText()); sampler.setDestination(jmsDestination.getText()); sampler.setExpiration(expiration.getText()); sampler.setReconnectionErrorCodes(jmsErrorReconnectOnCodes.getText()); sampler.setPriority(priority.getText()); sampler.setUsername(jmsUser.getText()); sampler.setPassword(jmsPwd.getText()); sampler.setTextMessage(textMessage.getText()); sampler.setInputFile(messageFile.getFilename()); sampler.setRandomPath(randomFile.getFilename()); sampler.setConfigChoice(configChoice.getText()); sampler.setFileEncoding(fileEncoding.getText()); sampler.setMessageChoice(msgChoice.getText()); sampler.setIterations(iterations.getText()); sampler.setUseAuth(useAuth.isSelected()); sampler.setUseNonPersistentDelivery(useNonPersistentDelivery.isSelected()); JMSProperties args = (JMSProperties) jmsPropertiesPanel.createTestElement(); sampler.setJMSProperties(args); }