ran tene wrote:
> 
> i just meant  that i can check the code in one fo the ways it was meant to
> be/is used
> for example
> try
>       {
>           MyComponent log;
>           myComponent = (MyComponent) manager.lookup(MyComponent.ROLE);
>       }
>       catch (...)
>       {
>           ...
>       }
> or in any other way that it can be used
> for example:
> try
>       {
>           MyComponent log;
>           myComponent = (MyComponent) manager.lookup("some-string");
>       }
>       catch (...)
>       {
>           ...
>       }
> if i choose the first option then
> 1 - people can use the test to learn how to use the class. the thoght behind
> the class.
> 2 - but, changes in the class implementaiton which depend on the fact that
> role represent some interface or any static field will not result in a
> failure (i know its a  paranoidic thought ,but maybe thats what tests are
> for).
> 
> my question is about the target of unit tests.

In this case your test should match what is documented.  The Component manager
should look up ROLEs.  Technically, we could test for illegal characters like
the hyphen (this is for interface names), but during run time, that is not an
acceptable performance hit.

> 
> p.s.
> sorry for my english
> your project is very interesting. I want to use it for some application
> server
> for a distributed gui.
> 
> thanx
> ran
> 
> ----- Original Message -----
> From: "Peter Donald" <[EMAIL PROTECTED]>
> To: "Avalon Development" <[email protected]>
> Sent: Sunday, October 07, 2001 7:46 AM
> Subject: Re: contract and unit tests
> 
> > On Sat, 6 Oct 2001 02:48, ran tene wrote:
> > > there is a wide gap between the documented english writen contract of
> the
> > > ComponentManager and ComponentSelctor and its implementation - the
> > > implementation is much wider. the writen contract is only one possible
> way
> > > of using the classes. when i wrote the unit tests i faced this problem.
> > > which contract should i check?
> > > 1-the english one.
> > > 2-the code.
> > > option 1 makes the unit test more helpfull for peaople who wants to
> learn
> > > how the code was meant to be used. -part of the documentation.
> > > what is the real contract of the classes?
> > > this time i checked the code contract- option 2 ,but im not sure ...
> >
> > Could you describe the differences?
> >
> > --
> > Cheers,
> >
> > Pete
> >
> > When a stupid man is doing something he's ashamed of, he always
> > declares that it is his duty.
> > George Bernard Shaw
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]

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

Reply via email to