O'Reilly logo

Java EE 7 Performance Tuning and Optimization by Osama Oransa

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Testing with JMeter

Now, let's try to use JMeter to execute our performance testing. We will try the following three kinds of performance testing:

  • Web services
  • Web application
  • JDBC

Using JMeter to test web services

In this example, we will have one web service that authenticates users based on their username and password, and returns true/false according to this. It is a stateless session bean.

The following is the code snippet for the ExampleWebService class:

@WebService(serviceName = "ExampleWebService") @Stateless() public class ExampleWebService { @EJB(beanName = "DataHelperSessionBean") DataHelperSessionBean dataHelperSessionBean; @WebMethod(operationName = "authenticateUser") public boolean authenticateUser(@WebParam(name = "username") String username,@WebParam(name ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required