Yogesh Mulwani

Greenhorn
+ Follow
since Jul 15, 2003
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by Yogesh Mulwani

Thanks for your input! Actually what I done for the problem was something similar but the issue is how to break the ongoing process of the application for JUnit to resume and assert the method if there is Thread.sleep() cals in it.
20 years ago
Yeah i tried it but its not convinient and foolproof, you never know how much time its gonna take for processing, it depends on the volume of data fetched from the database. So everytime it will be a different duration.
20 years ago
I googled for these issues. The articles you mentioned are those which demonstrate testing you code from multithreaded testcases as JUnit only supports single threaded testcases. FYI. MTJUnit & JMTUnit are the frameworks for achieving it. My problem still exists, I dont need multiple threads testing my code. I need some way to test my multithreaded application, irrespective how many test threads are testing it.
I hope I am clear in my point.
20 years ago
These days m testing a huge multithreaded application with JUnit. Faced lot of issues during the tests, but could not find aapropriate answers for them yet. Forced to change the base code to be tested, which I know will not be acceptable by our client, its not practical also. Why one will change its code to be a non multithreaded if he requires it in its app.
First and the biggest problem came accross when there were Thread.sleep() calls and the app. is supposed to be running forever. To put an example here, the application is developed to run endlessly checking for some data in the DB, if it finds any, it proccesses it and sleep for some interval, and the process goes like that forever. So does the JUnit test, it will not come out again.
Second issue was more surprising. When there is a new thread started, JUnit care least to wait for it to complete its work, it will just come out as it doesnt know its running for a multithreaded app. Seems it doesnt understand threading.
There are few issues other than MT like having System.exit(n) in your code. When your testcases hits a function having System.exit(n), the behavior of JUnit suddenly gets changed. You wont get proper report from JUnit. And one just keeps on thinking what went wrong.
Would appreciate inputs on the issues.
20 years ago
i hope you have got the licence by now, otherwise usually parasoft provides the licence within 1-2 business days, and that also for a specific machine and for not more than 5 days.
21 years ago