Re: [classlib] [tests] Can anyone explain what these are for?

2006-10-11 Thread Rui Hu

I've written a script to search all the statements like that:

#!/usr/bin/perl -w
use File::Find;
use DirHandle;
use strict;

my $dir = $ARGV[0] || die need input a dir\n;
chomp $dir;
processDir($dir);

sub processDir {

my $folder = $_[0];

my $dh = DirHandle-new($folder) || die can not open directiony: $!\n;

foreach my $f ($dh-read()) {
   next if ($f=~/^\.$|^\.\.$|^\..*$/);
   if (-d $folder\/$f){
   processDir($folder\/$f);
   }
   if ($f=~/^.*Test\.java$/){
   processFile($folder\/$f);
   }
}
}

sub processFile {
   my $f = $_[0];
   my $lineNum = 1;
 my $line=;
   open (MYFILE,$f) || die can not open file: $!\n;
   while ($line=MYFILE){
   chomp $line;
   if ($line=~/^\s*assertTrue.*true\s*\)\s*;\s*$/){
print $f:$lineNum\n;
   }
   $lineNum = $lineNum +1;
   }
}


And found 88 statements like that in current classlib, then record them in
[1].
We can check them.

[1].http://wiki.apache.org/harmony/Invalid_assertTrue


On 10/11/06, Richard Liang [EMAIL PROTECTED] wrote:


On 10/11/06, Nathan Beyer [EMAIL PROTECTED] wrote:
 Perhaps, but there are much better ways of determining that. From just
 reading the test code to code coverage tools.

 From my analysis, these were part of the large test contribution and
 indicated that there wasn't an explicit test for that method. In most
 cases, there were tests for these methods, either in other classes or
 in other methods of the class.

Nathan, I agree ;-)


 -Nathan

 On 10/10/06, Richard Liang [EMAIL PROTECTED] wrote:
  On 10/11/06, Nathan Beyer [EMAIL PROTECTED] wrote:
   I've seen a few and I've deleted any that I've come across. I would
   say feel free to delete them too. I've also been deleting empty
setup
   and teardown methods too.
 
  Please do not simply delete them. Maybe that means we are lack of the
  test for some methods, for example getInetAddress.
 
  
   -Nathan
  
   On 10/10/06, Alexey Petrenko [EMAIL PROTECTED] wrote:
These could be a result of copy/paste tests creation.
And I'm curious why it was written for the first time. :)
   
SY, Alexey
   
2006/10/10, Mark Hindess [EMAIL PROTECTED]:

 I've come across a couple of tests with things like:

 public void test_getInetAddress() {
 assertTrue(Used to test, true);
 }

 Can anyone explain why we have these?

 Regards,
  Mark.




-
 Terms of use : http://incubator.apache.org/harmony/mailing.html
 To unsubscribe, e-mail:
[EMAIL PROTECTED]
 For additional commands, e-mail:
[EMAIL PROTECTED]


   
   
--
Alexey A. Petrenko
Intel Middleware Products Division
   
   
-
Terms of use : http://incubator.apache.org/harmony/mailing.html
To unsubscribe, e-mail:
[EMAIL PROTECTED]
For additional commands, e-mail:
[EMAIL PROTECTED]
   
   
  
  
-
   Terms of use : http://incubator.apache.org/harmony/mailing.html
   To unsubscribe, e-mail: [EMAIL PROTECTED]
   For additional commands, e-mail:
[EMAIL PROTECTED]
  
  
 
 
  --
  Richard Liang
  China Development Lab, IBM
 
  -
  Terms of use : http://incubator.apache.org/harmony/mailing.html
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
 
 

 -
 Terms of use : http://incubator.apache.org/harmony/mailing.html
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]




--
Richard Liang
China Development Lab, IBM

-
Terms of use : http://incubator.apache.org/harmony/mailing.html
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]





--
Robert Hu
China Software Development Lab, IBM


Re: [classlib] [tests] Can anyone explain what these are for?

2006-10-11 Thread Alexei Zakharov

Some tests for beans contained the code like this:

---
public void testGetArguments() {
   // Covered in the testcases for the constructor
}

public void testGetMethodName() {
   // Covered in the testcases for the constructor
}
---

I just commented it out. I could simply delete it but decided that we
may need it in the future. When we finish with 1.5 and everybody will
have a lot of free time - we can get back to it and think again: do we
need to insert an additional test case here?

Regards,



2006/10/11, Richard Liang [EMAIL PROTECTED]:

On 10/11/06, Nathan Beyer [EMAIL PROTECTED] wrote:
 Perhaps, but there are much better ways of determining that. From just
 reading the test code to code coverage tools.

 From my analysis, these were part of the large test contribution and
 indicated that there wasn't an explicit test for that method. In most
 cases, there were tests for these methods, either in other classes or
 in other methods of the class.

Nathan, I agree ;-)


 -Nathan

 On 10/10/06, Richard Liang [EMAIL PROTECTED] wrote:
  On 10/11/06, Nathan Beyer [EMAIL PROTECTED] wrote:
   I've seen a few and I've deleted any that I've come across. I would
   say feel free to delete them too. I've also been deleting empty setup
   and teardown methods too.
 
  Please do not simply delete them. Maybe that means we are lack of the
  test for some methods, for example getInetAddress.
 
  
   -Nathan
  
   On 10/10/06, Alexey Petrenko [EMAIL PROTECTED] wrote:
These could be a result of copy/paste tests creation.
And I'm curious why it was written for the first time. :)
   
SY, Alexey
   
2006/10/10, Mark Hindess [EMAIL PROTECTED]:

 I've come across a couple of tests with things like:

 public void test_getInetAddress() {
 assertTrue(Used to test, true);
 }

 Can anyone explain why we have these?


--
Alexei Zakharov,
Intel Middleware Product Division

-
Terms of use : http://incubator.apache.org/harmony/mailing.html
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [classlib] [tests] Can anyone explain what these are for?

2006-10-11 Thread Andrew Zhang

On 10/11/06, Alexei Zakharov [EMAIL PROTECTED] wrote:


Some tests for beans contained the code like this:

---
public void testGetArguments() {
   // Covered in the testcases for the constructor
}

public void testGetMethodName() {
   // Covered in the testcases for the constructor
}
---

I just commented it out. I could simply delete it but decided that we
may need it in the future. When we finish with 1.5 and everybody will
have a lot of free time - we can get back to it and think again: do we
need to insert an additional test case here?



Yes. My suggestion is marking these tests with TODO. It's easy for
remindering. Eventually, we'll decide whether removing the TODOs or writing
more test code there.

Thanks!



2006/10/11, Richard Liang [EMAIL PROTECTED]:

On 10/11/06, Nathan Beyer [EMAIL PROTECTED] wrote:
 Perhaps, but there are much better ways of determining that. From just
 reading the test code to code coverage tools.

 From my analysis, these were part of the large test contribution and
 indicated that there wasn't an explicit test for that method. In most
 cases, there were tests for these methods, either in other classes or
 in other methods of the class.

Nathan, I agree ;-)


 -Nathan

 On 10/10/06, Richard Liang [EMAIL PROTECTED] wrote:
  On 10/11/06, Nathan Beyer [EMAIL PROTECTED] wrote:
   I've seen a few and I've deleted any that I've come across. I would
   say feel free to delete them too. I've also been deleting empty

setup

   and teardown methods too.
 
  Please do not simply delete them. Maybe that means we are lack of the
  test for some methods, for example getInetAddress.
 
  
   -Nathan
  
   On 10/10/06, Alexey Petrenko [EMAIL PROTECTED] wrote:
These could be a result of copy/paste tests creation.
And I'm curious why it was written for the first time. :)
   
SY, Alexey
   
2006/10/10, Mark Hindess [EMAIL PROTECTED]:

 I've come across a couple of tests with things like:

 public void test_getInetAddress() {
 assertTrue(Used to test, true);
 }

 Can anyone explain why we have these?


--
Alexei Zakharov,
Intel Middleware Product Division

-
Terms of use : http://incubator.apache.org/harmony/mailing.html
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]





--
Best regards,
Andrew Zhang


Re: [classlib] [tests] Can anyone explain what these are for?

2006-10-10 Thread Alexey Petrenko

These could be a result of copy/paste tests creation.
And I'm curious why it was written for the first time. :)

SY, Alexey

2006/10/10, Mark Hindess [EMAIL PROTECTED]:


I've come across a couple of tests with things like:

public void test_getInetAddress() {
assertTrue(Used to test, true);
}

Can anyone explain why we have these?

Regards,
 Mark.



-
Terms of use : http://incubator.apache.org/harmony/mailing.html
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]





--
Alexey A. Petrenko
Intel Middleware Products Division

-
Terms of use : http://incubator.apache.org/harmony/mailing.html
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [classlib] [tests] Can anyone explain what these are for?

2006-10-10 Thread Nathan Beyer

I've seen a few and I've deleted any that I've come across. I would
say feel free to delete them too. I've also been deleting empty setup
and teardown methods too.

-Nathan

On 10/10/06, Alexey Petrenko [EMAIL PROTECTED] wrote:

These could be a result of copy/paste tests creation.
And I'm curious why it was written for the first time. :)

SY, Alexey

2006/10/10, Mark Hindess [EMAIL PROTECTED]:

 I've come across a couple of tests with things like:

 public void test_getInetAddress() {
 assertTrue(Used to test, true);
 }

 Can anyone explain why we have these?

 Regards,
  Mark.



 -
 Terms of use : http://incubator.apache.org/harmony/mailing.html
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]




--
Alexey A. Petrenko
Intel Middleware Products Division

-
Terms of use : http://incubator.apache.org/harmony/mailing.html
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




-
Terms of use : http://incubator.apache.org/harmony/mailing.html
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [classlib] [tests] Can anyone explain what these are for?

2006-10-10 Thread Richard Liang

On 10/11/06, Nathan Beyer [EMAIL PROTECTED] wrote:

I've seen a few and I've deleted any that I've come across. I would
say feel free to delete them too. I've also been deleting empty setup
and teardown methods too.


Please do not simply delete them. Maybe that means we are lack of the
test for some methods, for example getInetAddress.



-Nathan

On 10/10/06, Alexey Petrenko [EMAIL PROTECTED] wrote:
 These could be a result of copy/paste tests creation.
 And I'm curious why it was written for the first time. :)

 SY, Alexey

 2006/10/10, Mark Hindess [EMAIL PROTECTED]:
 
  I've come across a couple of tests with things like:
 
  public void test_getInetAddress() {
  assertTrue(Used to test, true);
  }
 
  Can anyone explain why we have these?
 
  Regards,
   Mark.
 
 
 
  -
  Terms of use : http://incubator.apache.org/harmony/mailing.html
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
 
 


 --
 Alexey A. Petrenko
 Intel Middleware Products Division

 -
 Terms of use : http://incubator.apache.org/harmony/mailing.html
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]



-
Terms of use : http://incubator.apache.org/harmony/mailing.html
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]





--
Richard Liang
China Development Lab, IBM

-
Terms of use : http://incubator.apache.org/harmony/mailing.html
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [classlib] [tests] Can anyone explain what these are for?

2006-10-10 Thread Nathan Beyer

Perhaps, but there are much better ways of determining that. From just
reading the test code to code coverage tools.


From my analysis, these were part of the large test contribution and

indicated that there wasn't an explicit test for that method. In most
cases, there were tests for these methods, either in other classes or
in other methods of the class.

-Nathan

On 10/10/06, Richard Liang [EMAIL PROTECTED] wrote:

On 10/11/06, Nathan Beyer [EMAIL PROTECTED] wrote:
 I've seen a few and I've deleted any that I've come across. I would
 say feel free to delete them too. I've also been deleting empty setup
 and teardown methods too.

Please do not simply delete them. Maybe that means we are lack of the
test for some methods, for example getInetAddress.


 -Nathan

 On 10/10/06, Alexey Petrenko [EMAIL PROTECTED] wrote:
  These could be a result of copy/paste tests creation.
  And I'm curious why it was written for the first time. :)
 
  SY, Alexey
 
  2006/10/10, Mark Hindess [EMAIL PROTECTED]:
  
   I've come across a couple of tests with things like:
  
   public void test_getInetAddress() {
   assertTrue(Used to test, true);
   }
  
   Can anyone explain why we have these?
  
   Regards,
Mark.
  
  
  
   -
   Terms of use : http://incubator.apache.org/harmony/mailing.html
   To unsubscribe, e-mail: [EMAIL PROTECTED]
   For additional commands, e-mail: [EMAIL PROTECTED]
  
  
 
 
  --
  Alexey A. Petrenko
  Intel Middleware Products Division
 
  -
  Terms of use : http://incubator.apache.org/harmony/mailing.html
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
 
 

 -
 Terms of use : http://incubator.apache.org/harmony/mailing.html
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]




--
Richard Liang
China Development Lab, IBM

-
Terms of use : http://incubator.apache.org/harmony/mailing.html
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




-
Terms of use : http://incubator.apache.org/harmony/mailing.html
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [classlib] [tests] Can anyone explain what these are for?

2006-10-10 Thread Richard Liang

On 10/11/06, Nathan Beyer [EMAIL PROTECTED] wrote:

Perhaps, but there are much better ways of determining that. From just
reading the test code to code coverage tools.

From my analysis, these were part of the large test contribution and
indicated that there wasn't an explicit test for that method. In most
cases, there were tests for these methods, either in other classes or
in other methods of the class.


Nathan, I agree ;-)



-Nathan

On 10/10/06, Richard Liang [EMAIL PROTECTED] wrote:
 On 10/11/06, Nathan Beyer [EMAIL PROTECTED] wrote:
  I've seen a few and I've deleted any that I've come across. I would
  say feel free to delete them too. I've also been deleting empty setup
  and teardown methods too.

 Please do not simply delete them. Maybe that means we are lack of the
 test for some methods, for example getInetAddress.

 
  -Nathan
 
  On 10/10/06, Alexey Petrenko [EMAIL PROTECTED] wrote:
   These could be a result of copy/paste tests creation.
   And I'm curious why it was written for the first time. :)
  
   SY, Alexey
  
   2006/10/10, Mark Hindess [EMAIL PROTECTED]:
   
I've come across a couple of tests with things like:
   
public void test_getInetAddress() {
assertTrue(Used to test, true);
}
   
Can anyone explain why we have these?
   
Regards,
 Mark.
   
   
   
-
Terms of use : http://incubator.apache.org/harmony/mailing.html
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
   
   
  
  
   --
   Alexey A. Petrenko
   Intel Middleware Products Division
  
   -
   Terms of use : http://incubator.apache.org/harmony/mailing.html
   To unsubscribe, e-mail: [EMAIL PROTECTED]
   For additional commands, e-mail: [EMAIL PROTECTED]
  
  
 
  -
  Terms of use : http://incubator.apache.org/harmony/mailing.html
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
 
 


 --
 Richard Liang
 China Development Lab, IBM

 -
 Terms of use : http://incubator.apache.org/harmony/mailing.html
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]



-
Terms of use : http://incubator.apache.org/harmony/mailing.html
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]





--
Richard Liang
China Development Lab, IBM

-
Terms of use : http://incubator.apache.org/harmony/mailing.html
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]