Jmeter and JUnit Testing.

Jmeter and JUnit Testing.


 I was asked to test my junit class in a multi-threaded environment.

 I choose JMeter.

 Download-apache-jmeter-2.6.zip for the apache jmeter site.

 Unzip the apache-jmeter-2.6.zip file.


 Use Eclipse to create a Executable jar.

 In Eclipse-click on Export

 An Export Dialogue should appear.

  1. Click on Java->runnable JAR file.
  2. Select a main Class of your project.If you dont have create a dummy main class.
  3. Under-Library Handling:Select -"Extract required libraries into generated JAR"
  4. Click on Finish.
  5. A executable Jar will be created in the specified folder with lib extracted .
  6. Also remeber the JUNIT test version,i.eJunit3 or Junit4.
  7. Also take care of the libs--dont have duplicate libs in the jar.

  In Jmeter;

  •  Go to the installation folder of Jmeter
  •  Browse Lib->junit here you will find a test.jar.Thats meant for example.
      •  Drop your application jar here.
    •  Browse to the bin dir of jmeter
    •  click on jmeter.bat
  • This will start the jmeter
    •  ON the Right side you will see the TestPlan
    •  Right Click on testplan->add->threads-thread group
    •  Enter Thread Name and Thread Properties
    •  Click on Save
  •  Right Click on Thread Group->Add->Sampler->Junit request
    •  Enter Name
    •  Select junit Class
    •  Select Metho
    • Click on Save
 Click on Junit Request->Add->Listner->View Result as a Table


  •  Click on Save
  •  Now Click on the thread group and hit Run

    • Comments

      1. Thanks for sharing this useful info with us, this post will be useful for beginners those who wish to learn Jmeter. keep on sharing.Jmeter Training Course |
        Jmeter Training Institute in Chennai |
        Jmeter Training |
        Best Jmeter Training Institute in chennai

        ReplyDelete
      2. I believe there are many more pleasurable opportunities ahead for individuals that looked at your site.

        Best Java Training Institute Chennai

        Java Training Institute Bangalore

        ReplyDelete
      3. Your good knowledge and kindness in playing with all the pieces were very useful. I don’t know what I would have done if I had not encountered such a step like this.
        java training in chennai

        ReplyDelete

      Post a Comment

      Popular posts from this blog

      Spring MVC- Redirect from one controller to another

      Integrating Struts2 with Spring Security using Custom Login Form