Re: JUnit / newbie question

Daniel Bonniot <[email protected]>
Newsgroups gmane.comp.lang.nice.general
Message-ID <[email protected]>
>Do you think I should add this to the Wiki documentaion, since it 
>differs from Java behaviour, or will it be changed eventually?
>  
>
What happen will depend on the comments and needs of users. I don't know 
yet.

You could always create a page about JUnit (so as to not clutter the 
other one, but with a link), and we can evolve the information there.

>There's nothing magical about JUnit Assert, it just throws an Error if 
>it fails.  I'll look at Nice assert or just pull the methods out on 
>JUnit Assert into Nice.
>  
>
Nice throws a nice.lang.AssertionFailed, which is a subclass of Error.

>>As you found out, the other difficulty is that JUnit expects to find 
>>(static?) test* methods inside the class, and that's not how nicec 
>>compiles them. It might in the future, especially for parameterless 
>>methods like this.
>>    
>>
>
>The test* methods don't need to be static.  
>
OK, good.

>It appears the only way to 
>be able to call Nice from Java "normally" is to have your Nice class 
>extend a Java class and/or implement a Java interface.  
>
At the moment, yes.

>I just like being able to use the JUnit plugin that's integrated into 
>Eclipse.  I'm haven't figured out if it's worth the hassle of writing 
>these extra interfaces.   Thanks for your help.
>  
>
Yes, that's a motivation I understand. That's why I think it's worth 
considering writing the short code that would dynamically gather methods 
to be tested, and present them to JUnit as a TestCase (or TestSuite?). 
Then you would not need to write dummy Java interfaces. That should 
work, no?

Daniel



-------------------------------------------------------
SF.Net is sponsored by: Speed Start Your Linux Apps Now.
Build and deploy apps & Web services for Linux with
a free DVD software kit from IBM. Click Now!
http://ads.osdn.com/?ad_id=1356&alloc_id=3438&op=click
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.