org.apache.jmeter.testelement.property.TestElementProperty Java Examples
The following examples show how to use
org.apache.jmeter.testelement.property.TestElementProperty.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: WebSocketSamplerGui.java From jmeter-websocket with Apache License 2.0 | 6 votes |
@Override public void modifyTestElement(TestElement element) { configureTestElement(element); element.setProperty(WebSocketSampler.DOMAIN, domain.getText()); element.setProperty(WebSocketSampler.PATH, path.getText()); element.setProperty(WebSocketSampler.PORT, port.getText()); element.setProperty(WebSocketSampler.PROTOCOL, protocol.getText()); element.setProperty(WebSocketSampler.CONTENT_ENCODING, contentEncoding.getText()); Arguments args = (Arguments) argsPanel.createTestElement(); HTTPArgument.convertArgumentsToHTTP(args); element.setProperty(new TestElementProperty(WebSocketSampler.ARGUMENTS, args)); element.setProperty(WebSocketSampler.SEND_MESSAGE, sendMessage.getText()); element.setProperty(WebSocketSampler.RECV_MESSAGE, recvMessage.getText()); }
Example #2
Source File: WebSocketAbstractSampler.java From jmeter-bzm-plugins with Apache License 2.0 | 5 votes |
public void setHeaderManager(HeaderManager value) { HeaderManager mgr = getHeaderManager(); if (mgr != null) { value = mgr.merge(value, true); if (log.isDebugEnabled()) { log.debug("Existing HeaderManager '" + mgr.getName() + "' merged with '" + value.getName() + "'"); for (int i = 0; i < value.getHeaders().size(); i++) { log.debug(" " + value.getHeader(i).getName() + "=" + value.getHeader(i).getValue()); } } } setProperty(new TestElementProperty(HEADER_MANAGER, value)); }
Example #3
Source File: WebSocketConnectionConfigGui.java From jmeter-bzm-plugins with Apache License 2.0 | 5 votes |
@Override public void modifyTestElement(TestElement te) { configureTestElement(te); if (te instanceof ConfigTestElement) { ConfigTestElement configTestElement = (ConfigTestElement) te; configTestElement.setProperty("WebSocketConnectionConfig.Server", webSocketConnectionConfigPanel.getServer()); configTestElement.setProperty("WebSocketConnectionConfig.Port", webSocketConnectionConfigPanel.getPort()); configTestElement.setProperty("WebSocketConnectionConfig.ConnectionTimeout", webSocketConnectionConfigPanel.getConnectionTimeout()); configTestElement.setProperty("WebSocketConnectionConfig.Protocol", webSocketConnectionConfigPanel.getProtocolSelected()); configTestElement.setProperty("WebSocketConnectionConfig.Path", webSocketConnectionConfigPanel.getPath()); configTestElement.setProperty("WebSocketConnectionConfig.Topic", webSocketConnectionConfigPanel.getTopic()); configTestElement.setProperty("WebSocketConnectionConfig.Encoding", webSocketConnectionConfigPanel.getContentEncoding()); configTestElement.setProperty("WebSocketConnectionConfig.Implementation", webSocketConnectionConfigPanel.getImplementation()); configTestElement.setProperty("WebSocketConnectionConfig.CloseConnectionPattern", webSocketConnectionConfigPanel.getCloseConnectionPattern()); configTestElement.setProperty("WebSocketConnectionConfig.ProtocolWSMQTTComboBox", webSocketConnectionConfigPanel.getProtocolWSMQTTComboBox()); configTestElement.setProperty("WebSocketConnectionConfig.LogLevel", webSocketConnectionConfigPanel.getLogLevel()); HTTPArgumentsPanel queryStringParameters = webSocketConnectionConfigPanel.getAttributePanel(); if (queryStringParameters != null) { configTestElement.setProperty(new TestElementProperty("WebSocketConnectionConfig.HTTPRequest.ARGUMENTS", (Arguments)queryStringParameters.createTestElement())); } ArgumentsPanel queryStringPatterns = webSocketConnectionConfigPanel.getPatternsPanel(); if (queryStringPatterns != null) { configTestElement.setProperty(new TestElementProperty("WebSocketConnectionConfig.ResponsePatterns.ARGUMENTS", (Arguments)queryStringPatterns.createTestElement())); } } }
Example #4
Source File: WebSocketAbstractSampler.java From jmeter-bzm-plugins with Apache License 2.0 | 4 votes |
private void setCookieManagerProperty(CookieManager value) { setProperty(new TestElementProperty(COOKIE_MANAGER, value)); }
Example #5
Source File: WebSocketSampler.java From JMeter-WebSocketSampler with Apache License 2.0 | 4 votes |
public void setQueryStringParameters(Arguments queryStringParameters) { setProperty(new TestElementProperty("queryStringParameters", queryStringParameters)); }
Example #6
Source File: SetVariablesAction.java From jmeter-plugins with Apache License 2.0 | 4 votes |
public void setUserDefinedVariables(Arguments vars) { setProperty(new TestElementProperty(this.getClass().getSimpleName(), vars)); }
Example #7
Source File: ParameterizedController.java From jmeter-plugins with Apache License 2.0 | 4 votes |
public void setUserDefinedVariables(Arguments vars) { setProperty(new TestElementProperty(this.getClass().getSimpleName(), vars)); }
Example #8
Source File: AbstractDynamicThreadGroup.java From jmeter-plugins with Apache License 2.0 | 4 votes |
public AbstractDynamicThreadGroup() { super(); setProperty(new TestElementProperty(MAIN_CONTROLLER, new VirtualUserController())); }
Example #9
Source File: WebSocketSamplerTest.java From jmeter-websocket with Apache License 2.0 | 4 votes |
public static void main(String[] args) throws Exception { JMeterUtils.setJMeterHome("src/test/resources/"); JMeterUtils.loadJMeterProperties("src/test/resources/jmeter.properties"); JMeterUtils.setProperty("saveservice_properties", "saveservice.properties"); JMeterUtils.setProperty("search_paths", "ApacheJMeter_functions-2.9.jar"); JMeterUtils.setLocale(Locale.JAPAN); JMeterEngine engine = new StandardJMeterEngine(); HashTree config = new ListedHashTree(); TestPlan testPlan = new TestPlan("websocket test"); testPlan.setFunctionalMode(false); testPlan.setSerialized(false); testPlan.setProperty(new BooleanProperty(TestElement.ENABLED, true)); testPlan.setUserDefinedVariables(new Arguments()); ThreadGroup threadGroup = new ThreadGroup(); threadGroup.setNumThreads(300); threadGroup.setRampUp(20); threadGroup.setDelay(0); threadGroup.setDuration(0); threadGroup.setProperty(new StringProperty(ThreadGroup.ON_SAMPLE_ERROR, "continue")); threadGroup.setScheduler(false); threadGroup.setName("Group1"); threadGroup.setProperty(new BooleanProperty(TestElement.ENABLED, true)); LoopController controller = new LoopController(); controller.setLoops(10); controller.setContinueForever(false); controller.setProperty(new BooleanProperty(TestElement.ENABLED, true)); threadGroup.setProperty(new TestElementProperty(ThreadGroup.MAIN_CONTROLLER, controller)); CSVDataSet csvDataSet = new CSVDataSet(); csvDataSet.setProperty(new StringProperty("filename", "src/test/resources/users.csv")); csvDataSet.setProperty(new StringProperty("variableNames", "USER_NAME")); csvDataSet.setProperty(new StringProperty("delimiter", ",")); csvDataSet.setProperty(new StringProperty("shareMode", "shareMode.all")); csvDataSet.setProperty("quoted", false); csvDataSet.setProperty("recycle", true); csvDataSet.setProperty("stopThread", false); WebSocketSampler sampler = new WebSocketSampler(); sampler.setName("WebSocket Test"); sampler.setProperty(new BooleanProperty(TestElement.ENABLED, true)); sampler.addNonEncodedArgument("name", "${USER_NAME}", "="); sampler.setContentEncoding("UTF-8"); sampler.setProtocol("ws"); sampler.setDomain("localhost"); sampler.setPort(9090); sampler.setPath("/", "UTF-8"); sampler.setSendMessage("${__RandomString(50,ABCDEFGHIJKLMNOPQRSTUVWXYZ)}"); sampler.setRecvMessage("\"name\":\"${USER_NAME}\""); OnceOnlyController onceOnlyController = new OnceOnlyController(); Summariser summariser = new Summariser(); HashTree tpConfig = config.add(testPlan); HashTree tgConfig = tpConfig.add(threadGroup); HashTree oocConfig = tgConfig.add(onceOnlyController); oocConfig.add(csvDataSet); UniformRandomTimer randomTimer = new UniformRandomTimer(); randomTimer.setRange(3000); HashTree samplerConfig = tgConfig.add(sampler); samplerConfig.add(summariser); tgConfig.add(randomTimer); engine.configure(config); engine.runTest(); }