public abstract class AbstractMetadataExtracterTest
extends junit.framework.TestCase
MetadataExtracter,
AbstractMetadataExtracter| Modifier and Type | Field and Description |
|---|---|
protected org.springframework.context.ApplicationContext |
ctx
This context will be fetched each time, but almost always
will have been cached by
ApplicationContextHelper |
protected org.alfresco.service.cmr.dictionary.DictionaryService |
dictionaryService |
protected org.alfresco.repo.content.MimetypeMap |
mimetypeMap |
static java.lang.String |
QUICK_CREATOR |
static java.lang.String |
QUICK_CREATOR_EMAIL |
static java.lang.String |
QUICK_DESCRIPTION |
static java.lang.String |
QUICK_PREVIOUS_AUTHOR |
static java.lang.String |
QUICK_TITLE |
| Constructor and Description |
|---|
AbstractMetadataExtracterTest() |
| Modifier and Type | Method and Description |
|---|---|
protected static void |
assertContains(java.lang.String needle,
java.lang.String haystack) |
protected static void |
assertContains(java.lang.String message,
java.lang.String needle,
java.lang.String haystack) |
protected java.util.Map |
extractFromFile(java.io.File sourceFile,
java.lang.String mimetype) |
protected java.util.Map |
extractFromMimetype(java.lang.String mimetype) |
protected abstract MetadataExtracter |
getExtracter() |
void |
setUp()
Ensures that the temp locations are cleaned out before the tests start
|
protected boolean |
skipAuthorCheck(java.lang.String mimetype)
This method can be overridden to cause the author/creator property check to be skipped.
|
protected boolean |
skipDescriptionCheck(java.lang.String mimetype)
This method can be overridden to cause the description property check to be skipped.
|
protected void |
testCommonMetadata(java.lang.String mimetype,
java.util.Map properties)
Tests that we can get the common metadata correctly
from the file.
|
protected void |
testExtractFromMimetype(java.lang.String mimetype) |
protected abstract void |
testFileSpecificMetadata(java.lang.String mimetype,
java.util.Map properties) |
void |
testSetUp()
Check that all objects are present
|
void |
testZeroLengthFile() |
countTestCases, createResult, getName, run, run, runBare, runTest, setName, tearDown, toStringassertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertFalse, assertFalse, assertNotNull, assertNotNull, assertNotSame, assertNotSame, assertNull, assertNull, assertSame, assertSame, assertTrue, assertTrue, fail, fail, failNotEquals, failNotSame, failSame, formatprotected org.springframework.context.ApplicationContext ctx
ApplicationContextHelperpublic static final java.lang.String QUICK_TITLE
public static final java.lang.String QUICK_DESCRIPTION
public static final java.lang.String QUICK_CREATOR
public static final java.lang.String QUICK_CREATOR_EMAIL
public static final java.lang.String QUICK_PREVIOUS_AUTHOR
protected org.alfresco.repo.content.MimetypeMap mimetypeMap
protected org.alfresco.service.cmr.dictionary.DictionaryService dictionaryService
protected abstract MetadataExtracter getExtracter()
public void setUp()
throws java.lang.Exception
setUp in class junit.framework.TestCasejava.lang.Exceptionpublic void testSetUp()
throws java.lang.Exception
java.lang.Exceptionprotected void testExtractFromMimetype(java.lang.String mimetype)
throws java.lang.Exception
java.lang.Exceptionprotected java.util.Map extractFromMimetype(java.lang.String mimetype)
throws java.lang.Exception
java.lang.Exceptionprotected java.util.Map extractFromFile(java.io.File sourceFile,
java.lang.String mimetype)
throws java.lang.Exception
java.lang.Exceptionprotected void testCommonMetadata(java.lang.String mimetype,
java.util.Map properties)
protected abstract void testFileSpecificMetadata(java.lang.String mimetype,
java.util.Map properties)
protected boolean skipAuthorCheck(java.lang.String mimetype)
mimetype - true to skip the checks, else falseprotected boolean skipDescriptionCheck(java.lang.String mimetype)
mimetype - true to skip the checks, else falsepublic void testZeroLengthFile()
throws java.lang.Exception
java.lang.Exceptionprotected static void assertContains(java.lang.String message,
java.lang.String needle,
java.lang.String haystack)
protected static void assertContains(java.lang.String needle,
java.lang.String haystack)
Copyright © 2005 - 2010 Alfresco Software, Inc. All Rights Reserved.