mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
Add a bit more 'wiggle room' to the timeout test, which missed the cutoff by 8ms, and fixed formatting
git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@56009 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -20,7 +20,6 @@ package org.alfresco.repo.content.metadata;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
@@ -129,19 +128,20 @@ public class PoiMetadataExtracterTest extends AbstractMetadataExtracterTest
|
||||
|
||||
File sourceFile = AbstractContentTransformerTest.loadNamedQuickTestFile("problemFootnotes.docx");
|
||||
|
||||
long startTime = (new Date()).getTime();
|
||||
|
||||
Map<QName, Serializable> properties = new HashMap<QName, Serializable>();
|
||||
// construct a reader onto the source file
|
||||
ContentReader sourceReader = new FileContentReader(sourceFile);
|
||||
sourceReader.setMimetype(MimetypeMap.MIMETYPE_OPENXML_WORDPROCESSING);
|
||||
|
||||
long startTime = System.currentTimeMillis();
|
||||
|
||||
getExtracter().extract(sourceReader, properties);
|
||||
|
||||
long extractionTime = (new Date()).getTime() - startTime;
|
||||
long extractionTime = System.currentTimeMillis() - startTime;
|
||||
|
||||
assertTrue("Metadata extraction took (" + extractionTime + "ms) " +
|
||||
"but should have failed with a timeout at " + timeoutMs + "ms",
|
||||
extractionTime < (timeoutMs + 50)); // bit of wiggle room for logging, cleanup, etc.
|
||||
extractionTime < (timeoutMs + 100)); // bit of wiggle room for logging, cleanup, etc.
|
||||
assertFalse("Reader was not closed", sourceReader.isChannelOpen());
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user