Re: [classlib][tests] Junit best practice

2006-11-02 Thread Richard Liang
On 11/2/06, Tony Wu [EMAIL PROTECTED] wrote: hey guys, I found there're same problem for assertSame like assertEquals. should use assertNull, assertSame\s*\((.*,\s*null\s*|\s*null\s*,.*)\)\s*; should use assertFalse, assertSame\s*\((.*,\s*false\s*|\s*false\s*,.*)\)\s*; should use assertTrue,

Re: [classlib][tests] Junit best practice

2006-11-01 Thread Tony Wu
hey guys, I found there're same problem for assertSame like assertEquals. should use assertNull, assertSame\s*\((.*,\s*null\s*|\s*null\s*,.*)\)\s*; should use assertFalse, assertSame\s*\((.*,\s*false\s*|\s*false\s*,.*)\)\s*; should use assertTrue,

Re: [classlib][tests] Junit best practice

2006-10-29 Thread Tony Wu
Harmony-1997 raised :) https://issues.apache.org/jira/browse/HARMONY-1997 On 10/27/06, Geir Magnusson Jr. [EMAIL PROTECTED] wrote: can you put this into a JIRA, and maybe some docs, so we can put in SVN as a tool for others to use w/ docs on the website? geir Tony Wu wrote: the configure

Re: [classlib][tests] Junit best practice

2006-10-27 Thread Tony Wu
Hi llya, I think you can try to config CheckStyle to exclude files not opened in the editor. I believe that will make it faster and avoid oom :) On 10/27/06, Ilya Okomin [EMAIL PROTECTED] wrote: Mark, Tony thanks for working with this topic. I found it very helpful and necessary for all of us.

Re: [classlib][tests] Junit best practice

2006-10-27 Thread Ilya Okomin
On 10/27/06, Tony Wu [EMAIL PROTECTED] wrote: Hi llya, I think you can try to config CheckStyle to exclude files not opened in the editor. I believe that will make it faster and avoid oom :) It's helped, thanks!! My Eclipse feels much better now;) Regards, Ilya. On 10/27/06, Ilya Okomin

Re: [classlib][tests] Junit best practice

2006-10-27 Thread Geir Magnusson Jr.
can you put this into a JIRA, and maybe some docs, so we can put in SVN as a tool for others to use w/ docs on the website? geir Tony Wu wrote: the configure file of CheckStyle in attachment, you can import it to your eclipse plugin On 10/27/06, Tony Wu [EMAIL PROTECTED] wrote: On 10/26/06,

Re: [classlib][tests] Junit best practice

2006-10-26 Thread Tony Wu
Instead of fixing them by script, for those who use eclipse, I suggest to use CheckStyle plugin and set up rules according Mark's perl script. It will highlight the code which breaks the rules with a specified comment. It is easy for manual fixing I think. On 10/25/06, Mark Hindess [EMAIL

Re: [classlib][tests] Junit best practice

2006-10-26 Thread Rui Hu
Great, Mark. Your script is indeed so powerful! On 10/25/06, Mark Hindess [EMAIL PROTECTED] wrote: Earlier in the year we discussed junit best practice. For example, making sure assertEquals calls have the expected and actual arguments in the correct order to avoid getting confusing failure

Re: [classlib][tests] Junit best practice

2006-10-26 Thread Tony Wu
I have scratched out the stand alone rules, should use assertNull, assertEquals\s*\((.*,\s*null\s*|\s*null\s*,.*)\)\s*; should use assertFalse, assertEquals\s*\((.*,\s*false\s*|\s*false\s*,.*)\)\s*; should use assertTrue, assertEquals\s*\((.*,\s*true\s*|\s*true\s*,.*)\)\s*; last argument should

Re: [classlib][tests] Junit best practice

2006-10-26 Thread Tony Wu
BTW, some of the violation appeared thousands times could be fixed automatically, do you have any concern? On 10/26/06, Tony Wu [EMAIL PROTECTED] wrote: I have scratched out the stand alone rules, should use assertNull, assertEquals\s*\((.*,\s*null\s*|\s*null\s*,.*)\)\s*; should use

Re: [classlib][tests] Junit best practice

2006-10-26 Thread Mark Hindess
On 26 October 2006 at 19:16, Tony Wu [EMAIL PROTECTED] wrote: I have scratched out the stand alone rules, should use assertNull, assertEquals\s*\((.*,\s*null\s*|\s*null\s*,.*)\)\s*; should use assertFalse, assertEquals\s*\((.*,\s*false\s*|\s*false\s*,.*)\)\s* ; should use assertTrue,

Re: [classlib][tests] Junit best practice

2006-10-26 Thread Alexei Zakharov
BTW - the script does run on Windows with ActiveState's Perl runtime. Number of Issues by module 45 beans I've also checked it on WinXP + cygwin + perl v5.8.7. Also works good (HARMONY-1976). Thanks, 2006/10/26, Nathan Beyer [EMAIL PROTECTED]: BTW - the script does run on Windows

Re: [classlib][tests] Junit best practice

2006-10-26 Thread Mark Hindess
On 26 October 2006 at 16:33, Alexei Zakharov [EMAIL PROTECTED] wrote: BTW - the script does run on Windows with ActiveState's Perl runtime. Number of Issues by module 45 beans I've also checked it on WinXP + cygwin + perl v5.8.7. Also works good (HARMONY-1976). Thanks Alexei.

Re: [classlib][tests] Junit best practice

2006-10-26 Thread Tony Wu
On 10/26/06, Mark Hindess [EMAIL PROTECTED] wrote: On 26 October 2006 at 19:16, Tony Wu [EMAIL PROTECTED] wrote: I have scratched out the stand alone rules, should use assertNull, assertEquals\s*\((.*,\s*null\s*|\s*null\s*,.*)\)\s*; should use assertFalse,

Re: [classlib][tests] Junit best practice

2006-10-26 Thread Tony Wu
the configure file of CheckStyle in attachment, you can import it to your eclipse plugin On 10/27/06, Tony Wu [EMAIL PROTECTED] wrote: On 10/26/06, Mark Hindess [EMAIL PROTECTED] wrote: On 26 October 2006 at 19:16, Tony Wu [EMAIL PROTECTED] wrote: I have scratched out the stand alone rules,

[classlib][tests] Junit best practice

2006-10-25 Thread Mark Hindess
Earlier in the year we discussed junit best practice. For example, making sure assertEquals calls have the expected and actual arguments in the correct order to avoid getting confusing failure messages. Robert posted a script a week or so ago, to look for some of junit issues but it didn't

Re: [classlib][tests] Junit best practice

2006-10-25 Thread Geir Magnusson Jr.
Cool - but why not just put into SVN somewhere? either in enhanced/tools or classlib/trunk somewhere where it can be invoked as an option by people from ant (so that we can wire it into the CI system...) geir Mark Hindess wrote: Earlier in the year we discussed junit best practice. For

Re: [classlib][tests] Junit best practice

2006-10-25 Thread Geir Magnusson Jr.
Mark Hindess wrote: On 25 October 2006 at 7:41, Geir Magnusson Jr. [EMAIL PROTECTED] wrote: Cool - but why not just put into SVN somewhere? Okay. classlib/trunk/support/tools/bin perhaps? Sure. Whatever you feel is best. I have no strong opinion. We do have junit tests in DRLVM too,

Re: [classlib][tests] Junit best practice

2006-10-25 Thread Denis Kishenko
Mark, I have just tried your tool. It's really helpful, thanks a lot! It's so pitty that script doesn't fix issues by itself =) 2006/10/25, Geir Magnusson Jr. [EMAIL PROTECTED]: Mark Hindess wrote: On 25 October 2006 at 7:41, Geir Magnusson Jr. [EMAIL PROTECTED] wrote: Cool - but why not

Re: [classlib][tests] Junit best practice

2006-10-25 Thread Mark Hindess
On 25 October 2006 at 18:38, Denis Kishenko [EMAIL PROTECTED] wrote: Mark, I have just tried your tool. It's really helpful, thanks a lot! It's so pitty that script doesn't fix issues by itself =) It could (and I have been known to use scripts to fix things) but as Nathan recently pointed

Re: [classlib][tests] Junit best practice

2006-10-25 Thread Richard Liang
Awesome. I just plan to review our junit tests, now it seems your tool has done what I want ;-) I highly recommend we read this article JUnit best practices[1] in javaworld. [1] http://www.javaworld.com/javaworld/jw-12-2000/jw-1221-junit.html On 10/25/06, Mark Hindess [EMAIL PROTECTED] wrote:

Re: [classlib][tests] Junit best practice

2006-10-25 Thread Nathan Beyer
BTW - the script does run on Windows with ActiveState's Perl runtime. -Nathatn On 10/25/06, Richard Liang [EMAIL PROTECTED] wrote: Awesome. I just plan to review our junit tests, now it seems your tool has done what I want ;-) I highly recommend we read this article JUnit best practices[1] in