I have created JSF simple application and deployed tomcat7 and tomcat port number is 7070. The application details are:
1 main.jsp
2 Login.java
3 welcome.jsp
main.jsp
page has one text field and one button GoWelcomePage
When we click this button action goes to login.welcomePage()
. In this method put the sleep in 10000ms (10Secs) after that return the string value as welcome.
Then the page navigate into welcome.jsp
page.
The process like
main.jsp-->login.goWelcomePage() {10secs or 10000ms sleep mode} -->welcome.jsp
Obviously we know this process take more than 10secs or 10000ms.
I test this simple application using Jmeter. It says the process time is less than 100ms.
this is totally wrong.
I am not sure, i have given the tight parameters into the Jmeter.
main.jsp
<h:form id="mainFormId">
<h:inputText value="#{login.userName}" />
<h:commandButton value="Go Welcome Page" action="#{login.goWelcomePage}"/>
</h:form>
Login.java
package com.jsf.demo;
public class Login {
private String userName;
{
try {
Thread.sleep(10000);
} catch (InterruptedException e) {
}
return "welcome";
}
public String getUserName() {
return userName;
}
public void setUserName(String userName) {
this.userName = userName;
}}
welcome.jsp
<p> Welcome </p> <h:outputText value="#{login.userName}"/>
faces-config.xml
<managed-bean>
<managed-bean-name>login</managed-bean-name>
<managed-bean-class>com.jsf.demo.Login</managed-bean-class>
<managed-bean-scope>session</managed-bean-scope>
</managed-bean>
<navigation-rule>
<from-view-id>faces/pages/main.jsp</from-view-id>
<navigation-case>
<from-outcome>welcome</from-outcome>
<to-view-id>faces/pages/welcome.jsp</to-view-id>
</navigation-case>
</navigation-rule>
Jmeter inputs
ThreadGroup:
HttpRequestDefaults:
HttpRequest:
Jmeter results
View Results in Table:
Aggregate Report:
My doubt is: did i gave the right inputs and getting right results in Jmeter tool?
Please help me. Thanks is advance.