Spring load testing - spring

I've implemented a testing unit using spring (mock mvc), and I'm looking for a tool to run this unit in many threads/processes (so it will act as load testing for my server). I've seen applications like the grinder and jmeter but I don't want to re-write the entire unit, but just to use the existing one. Any ideas?

JMeter is able to execute existing JUnit tests via JUnit Request sampler, all you need to do is to drop jar(s) with your test along with dependencies somewhere in JMeter classpath and restart JMeter. Once done you'll be able to see your classes and methods in JUnit Request sampler dropdown and execute them in multithreaded manner.
See How to Use JUnit With JMeter guide for more detailed instructions and explanations.

Related

Jmeter project documentation

We have been using the Jmeter for the API's functional and performance test activities.
Is there a possibility to generate the documentation (similar java docs, API docs) for the JMX projects that we have been developing?
Each JMeter's Test Element has "Comments" section which can be used for explanation of what this element is for:
It's possible to create a JMeter Test Plan using Java language and JMeter API, see JMeter Command Line Overview: 5 Ways To Launch a Test for more details. There is also jmeter-from-code sample project you can use as a reference, normal JavaDoc will be available out of the box
There is JMeter DSL project which provides easy and handy way of creating a JMeter test plan, however it doesn't fully support all the features. For basic test plans it should be faster and easier than point 2
There is Taurus tool which provides possibility to create JMeter scripts in a declarative manner using YAML and YAML naturally supports comments

Performance test of JAVA RMI based application using Jmeter

Could you please suggest if it is possible to use Jmeter for performance testing of JAVA RMI based application. This application is a external product hence we do not have source code or classes available.
can you suggest a way to test this application.
Thanks
Out of the box there is no way, you will need to write some code using one of the following elements:
JSR223 Sampler
Java Request
JUnit Request
Given I don't know anything about RMI methods exposed by your application I cannot suggest any sample code, use the following reference material:
Getting Started Using Java™ RMI
Use JMeter to Load Test RMI (Remote Method Invocation) Server
NB. JMeter uses RMI for communication between master and remote slaves so you can take a look at RemoteJMeterEngineImpl class to get an idea regarding how to implement your test scenario.

Jmeter junit not on sampler menu

I've donwloaded JMeter 3.1 and am trying to run a junit sampler.
Per these instructions
jmeter.apache.org/usermanual/junitsampler_tutorial.pdf
I've added a ThreadGroup to test plan, i select add->sampler, but do not find Junit.
This is what I see. What am I missing?
no jmeter on menu
Here is an example photo I found on the tutorial.
enter image description here
I do have a junit class in a jar in the lib/junit folder.
This is weird, my JMeter 3.1 (installation comes with the JUnit Request sampler out of the box.
So please double check the following:
jmeter.log file - normally it contains enough information to guess the problem cause
you should have ApacheJMeter_junit.jar file under "lib/ext" folder of your JMeter installation. If it is not there - most probably something went wrong and your installation is corrupt
Be aware that you can add JUnit support (as well as any other JMeter Plugin) using JMeter Plugins Manager
For JMeter 5.0, the JUnit sampler did not appear for me when I incorrectly placed all my JUnit dependency jars in JMeter's lib/junit. It looks like it got stuck parsing all those jars looking for tests.
After placing JUnit dependency jars in JMeter lib folder and only the unit test jar in lib/junit, it worked correctly and JMeter GUI also started a lot faster.
I do have a junit class in a jar in the lib/junit folder.
This may be the problem in you case, if JMeter does not find any tests (or fails to find in my case), the JUnit sampler is simply not added to the UI

Is there a Web-UI out there for creating test's using htmlunit?

I want to be able to create the test's inside the Web-UI instead of writing them in code. Also i want to automate the tests and have extensive reporting.
I am restricted to htmlunit because the websites i am testing are testable with htmlunit.
You can define the test steps in other ways, see WebDriver recorder, WebTest and Wetator.
There is Spring MVC Test HtmlUnit also.

how use tests written in Selenium and Cucumber-JVM with JMeter?

I have set of functional tests written in Selenium and Cucumber-JVM, I use maven to run them by Cucumber tags.
Now I need to use some of those tests with JMeter to check performance. How can I do it?
I believe that you can just
Compile your tests into .jar file(s)
Copy the .jar file(s) into JMeter classpath
tests files - under /lib/junit folder of your JMeter installation
dependency files - under /lib folder
Add JUnit Request Sampler and choose required test from "Classname" and "Test Method" dropdowns
Configure JMeter as per your load scenario and run the test
See How to Use JUnit With JMeter guide for details on working with JUnit tests from JMeter perspective.
You can use JMeter sampler called BSF Sampler. This one allows to execute java class from JMeter. Please choose beanshell in the scripting language field.

Resources