This week's book giveaway is in the Java in General forum.
We're giving away four copies of Think Java: How to Think Like a Computer Scientist and have Allen B. Downey & Chris Mayfield on-line!
See this thread for details.
Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to test

 
Steve Grant
Ranch Hand
Posts: 106
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dear Sir,
I am testing my EJB which calls the VFSIOService class. Now this class does the writing of bytes to the hard disk. I am testing this Ejb by calling it through a Jsp. But i want to generate a scenario where number of users can upload their files. Now which api should i use so that it can generate concurrent users and each user should pass on different file name.
I am using combination of HttpClient and Apache Common File Upload . But it is giving me some problem. How to generate the testing scenario where each user will be uploading a file with different name.These users should be created concurrently
Regards ,
Siddharth K
 
Lasse Koskela
author
Sheriff
Posts: 11962
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I would suggest looking at JUnitPerf for generating simultaneous users.
 
Steve Grant
Ranch Hand
Posts: 106
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dear sir,
I have used JunitPerf to call my ejb directly from a remote location but it was taking lot of time for lookup so i thought to use jsp which will call this ejb in same container . now the problem is how will i simulate various number of users for uploading files with different names with junitperf. can this tool call a jsp and can i pass the parameter for the filename for different users.
thanks,
siddharth k
 
Steve Grant
Ranch Hand
Posts: 106
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dear Sir,
It is given in JunitPerf documentation that it cannot be used as a full-fledged load testing tool. Actually why I am asking this is becauses I am generating 500 concurrent users. Will this test of generating so many users in JunitPerf will give me right output.
thanks,
Siddharth
 
Lasse Koskela
author
Sheriff
Posts: 11962
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well, JUnitPerf is good for many purposes but there's a million things that it can't do but what the commercial products such as Mercury LoadRunner can do (for a couple of million dollars per year, but still ).
 
Steve Grant
Ranch Hand
Posts: 106
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dear Sir,
I have seen Jmeter and I think it can also be used for performance testing. I can call a Jsp which will call my EJB.
Thanks & regards,
Siddharth K
 
Lasse Koskela
author
Sheriff
Posts: 11962
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, that's entirely possible. Just remember that you're measuring both the EJB execution time and the network latency. If you're not too picky about the actual numbers, that should be a perfectly valid approach. Or, you could simply lookup the EJB remotely (if it has a remote interface) and skip the JSP.
 
Stan James
(instanceof Sidekick)
Ranch Hand
Posts: 8791
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
For pure Unit Testing, I'd try to make my EJB do as little as possible and pass the responsibility on to Plain Old Java Objects. The POJO are MUCH easier to test, especially if you can avoid having them depend on other EJBs and container services.
For true end-to-end testing, I'd move up from unit test tools into real stress & performance tools. We've used Mercury and Segue Silk. Something like that takes a big commitment - time & money - but a suite of stress tests that predict production scalability limits and problems add genuine value to the project.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic