Brett Porter wrote:

On 06/11/2007, at 5:16 PM, [EMAIL PROTECTED] wrote:

- adjusted DaysOldRepositoryPurgeTest for the changes

but there's no tests for the actual changes... :)

Ooops, sorry about that :)


Modified: maven/archiva/trunk/archiva-base/archiva-consumers/archiva-core-consumers/src/test/java/org/apache/maven/archiva/consumers/core/repository/stubs/LuceneRepositoryContentIndexStub.java URL: http://svn.apache.org/viewvc/maven/archiva/trunk/archiva-base/archiva-consumers/archiva-core-consumers/src/test/java/org/apache/maven/archiva/consumers/core/repository/stubs/LuceneRepositoryContentIndexStub.java?rev=592297&r1=592296&r2=592297&view=diff ============================================================================== --- maven/archiva/trunk/archiva-base/archiva-consumers/archiva-core-consumers/src/test/java/org/apache/maven/archiva/consumers/core/repository/stubs/LuceneRepositoryContentIndexStub.java (original) +++ maven/archiva/trunk/archiva-base/archiva-consumers/archiva-core-consumers/src/test/java/org/apache/maven/archiva/consumers/core/repository/stubs/LuceneRepositoryContentIndexStub.java Mon Nov 5 22:16:12 2007
@@ -46,7 +46,10 @@
         throws RepositoryIndexException
     {
         // TODO Auto-generated method stub
-        Assert.assertEquals( 2, records.size() );
+        if( records.size() != 0 )
+        {
+            Assert.assertEquals( 2, records.size() );
+        }
     }

Is this likely to ever give a false-positive if it was meant to be two, but came out as 0?

The deleteRecords(..) is still being invoked in the purge even if the list of records to be deleted is empty so the assert fails each time this method is invoked with that value.


Maybe it would be better to define the expected size in the constructor for the stub? (or use mock objects :)

I think I tried using mock objects for the tests before but encountered some problems with EasyMock's expect and return when a method parameter was created with "new [CLASS]()" inside of the class being tested. Anyway, I'll see what I can do about the tests :-)


Thanks,
Brett

--
Brett Porter - [EMAIL PROTECTED]
Blog: http://www.devzuz.org/blogs/bporter/



Thanks,
Deng

Reply via email to