aspose file tools*
The moose likes Testing and the fly likes How to test Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » Testing
Bookmark "How to test" Watch "How to test" New topic
Author

How to test

Steve Grant
Ranch Hand

Joined: Nov 24, 2003
Posts: 106
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


SCJP1.4<br />IBM Certified System Administrator -- WebSphere Application Server V5.0 (340)
Lasse Koskela
author
Sheriff

Joined: Jan 23, 2002
Posts: 11962
    
    5
I would suggest looking at JUnitPerf for generating simultaneous users.


Author of Test Driven (2007) and Effective Unit Testing (2013) [Blog] [HowToAskQuestionsOnJavaRanch]
Steve Grant
Ranch Hand

Joined: Nov 24, 2003
Posts: 106
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

Joined: Nov 24, 2003
Posts: 106
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

Joined: Jan 23, 2002
Posts: 11962
    
    5
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

Joined: Nov 24, 2003
Posts: 106
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

Joined: Jan 23, 2002
Posts: 11962
    
    5
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

Joined: Jan 29, 2003
Posts: 8791
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.


A good question is never answered. It is not a bolt to be tightened into place but a seed to be planted and to bear more seed toward the hope of greening the landscape of the idea. John Ciardi
 
jQuery in Action, 2nd edition
 
subject: How to test