Jeanne Boyarsky wrote:Pradeep,
You are going to need to refactor that code to make it testable. Ideas:
3) Make the private method default access or protected and override it to do nothing.
#3 is often a hack, but it is easiest to do. Especially if you can't change the code much.
Anayonkar Shivalkar wrote:
Pradeep Kumar wrote:My question is if it is singleton, how is it an issue?
Ok. Let's assume that class is not singleton. Now, what you are gonna do is : create different objects of that class - each object will carry configuration of one external system, and provide one object per thread. So that you'll attempt different connections at the same time.
Pradeep Kumar wrote:Also if we create threads and run on a singleton object why is is not a parallel process.
Because, all threads run under same process, so, it is multithreading, not multiprocessing.
I hope this helps.
Anayonkar Shivalkar wrote:
This is not parallel processing. Here, we are running threads.
I hope this helps.