Test fix to Content Chunker.

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@18898 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Mark Rogers
2010-03-01 10:31:49 +00:00
parent 1b96984c3a
commit e6813d1620
2 changed files with 3 additions and 4 deletions

View File

@@ -28,7 +28,6 @@ import java.util.HashSet;
import java.util.Iterator; import java.util.Iterator;
import java.util.Set; import java.util.Set;
import org.alfresco.repo.site.SiteServiceImpl;
import org.alfresco.service.cmr.repository.ContentData; import org.alfresco.service.cmr.repository.ContentData;
import org.alfresco.service.cmr.transfer.TransferException; import org.alfresco.service.cmr.transfer.TransferException;
import org.apache.commons.logging.Log; import org.apache.commons.logging.Log;
@@ -69,7 +68,7 @@ public class ContentChunkerImpl implements ContentChunker
/** /**
* work out whether the buffer has filled up and needs to be flushed * work out whether the buffer has filled up and needs to be flushed
*/ */
Iterator iter = buffer.iterator(); Iterator<ContentData> iter = buffer.iterator();
long totalContentSize = 0; long totalContentSize = 0;
while (iter.hasNext()) while (iter.hasNext())

View File

@@ -83,7 +83,7 @@ public class ContentChunkerImplTest extends TestCase
processedContent.clear(); processedContent.clear();
for(int i = 0; i < 11 ; i++) for(int i = 0; i < 11 ; i++)
{ {
chunker.addContent(new ContentData(null, null, 1, null)); chunker.addContent(new ContentData("url" + i, null, 1, null));
} }
assertEquals("size 10 not buffered", processedContent.size(), 10); assertEquals("size 10 not buffered", processedContent.size(), 10);
@@ -100,7 +100,7 @@ public class ContentChunkerImplTest extends TestCase
processedContent.clear(); processedContent.clear();
for(int i = 0; i < 100 ; i++) for(int i = 0; i < 100 ; i++)
{ {
chunker.addContent(new ContentData(null, null, 3, null)); chunker.addContent(new ContentData("url" + i, null, 3, null));
} }
chunker.flush(); chunker.flush();
assertEquals("size 100 not written", processedContent.size(), 100); assertEquals("size 100 not written", processedContent.size(), 100);