Hi,

I am wondering if anyone has any thoughts on how to best to do automated 
testing for Phoenix. 

This recent logger bug is something that should have never happened IMHO and 
wouldn't have happened if we had had good unit tests in place. In this 
particular case I can think of a way to put in unit tests. 

However there is a whole section of Phoenix I find it difficult to think 
about testing. For instance, 

1. how do you test whether Phoenix calls the lifecycle methods in the correct 
order. 
2. how do you test that the ConfigurationRepository returns correct results.
etc.

The above 2 cases are the two types of situation we could face. In the first 
we start the container and the container is invoking methods (effectively in 
control of thread). In the second case we can set up component and then 
invoke it (ie we are in control of thread).

In the case of situations like (2) we could create fake/mock objects and 
configure the component with them. We could then invoke it's methods and make 
sure it produces desired results.

In the case of situations like (1) it is considerably harder. The only thing 
I can think of is that we create a fake set of Blocks or whatever. When ever 
a method was invoked on these Blocks the Block would record the fact and the 
parameters in a file. After the container is shutdown we would reopen the 
file and make sure the calls were in correct order and that the calls had the 
correct parameters. 

Can anyone think of a better method of doing testing? And does anyone want to 
volunteer to start of the Unit tests ? ;)

-- 
Cheers,

Pete

---------------------------------------
Be nice to your friends. If it weren't 
for them, you'd be a complete stranger.
---------------------------------------

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to