org.alfresco.repo.rendition
Class RenditionServiceIntegrationTest

java.lang.Object
  extended by junit.framework.Assert
      extended by junit.framework.TestCase
          extended by org.springframework.test.ConditionalTestCase
              extended by org.springframework.test.AbstractSpringContextTests
                  extended by org.springframework.test.AbstractSingleSpringContextTests
                      extended by org.springframework.test.AbstractDependencyInjectionSpringContextTests
                          extended by org.springframework.test.AbstractTransactionalSpringContextTests
                              extended by org.springframework.test.AbstractTransactionalDataSourceSpringContextTests
                                  extended by org.alfresco.util.BaseSpringTest
                                      extended by org.alfresco.util.BaseAlfrescoSpringTest
                                          extended by org.alfresco.repo.rendition.RenditionServiceIntegrationTest
All Implemented Interfaces:
junit.framework.Test

public class RenditionServiceIntegrationTest
extends BaseAlfrescoSpringTest

Since:
3.3

Field Summary
 
Fields inherited from class org.alfresco.util.BaseAlfrescoSpringTest
actionService, authenticationComponent, authenticationService, contentService, nodeService, rootNodeRef, storeRef, transactionService
 
Fields inherited from class org.alfresco.util.BaseSpringTest
sessionFactory
 
Fields inherited from class org.springframework.test.AbstractTransactionalDataSourceSpringContextTests
jdbcTemplate
 
Fields inherited from class org.springframework.test.AbstractTransactionalSpringContextTests
transactionDefinition, transactionManager, transactionStatus
 
Fields inherited from class org.springframework.test.AbstractDependencyInjectionSpringContextTests
AUTOWIRE_BY_NAME, AUTOWIRE_BY_TYPE, AUTOWIRE_NO
 
Fields inherited from class org.springframework.test.AbstractSingleSpringContextTests
applicationContext
 
Fields inherited from class org.springframework.test.ConditionalTestCase
logger
 
Constructor Summary
RenditionServiceIntegrationTest()
           
 
Method Summary
 void off_test_CleanPersistedRenditionsAndCreateExportedACP()
          Deprecated.  
protected  void onSetUpInTransaction()
          On setup in transaction override
protected  void onTearDownInTransaction()
           
 void testALF3733()
           
 void testBuiltinRenditionDefinitions()
          This test method ensures that all the 'built-in' renditionDefinitions are available after startup and that their configuration is correct.
 void testCompositeReformatAndResizeRendition()
           
 void testFailedAsynchronousRendition()
           
 void testGetRenditionsForNode()
           
 void testJavascriptAPI()
           
 void testLoadRenderingAction()
          This test method saves one RenderingAction to the repository and loads it back up asserting that it is equivalent to the original.
 void testPathBasedRenditionOverwrite()
          If we're using path based renditions, it's allowed for two source nodes to end up rendering into folder with the same name as each other.
 void testReformatImage()
          Tests that the ReformatActionExecutor can be used to render images into different formats.
 void testRenderCropImage()
          This test method used the RenditionService to render a test image (of type PNG) as a cropped image of the same type.
 void testRenderDocumentInAnotherFormatInSitu()
          This test method uses the RenditionService to render a test document (of type PDF) into a different format (of type plain_text) and place the rendition under the source node.
 void testRenderDocumentInAnotherFormatUnderSpecifiedFolder()
          This test method used the RenditionService to render a test document (of type PDF) into a different format (of type plain_text) and place the rendition under the specified folder.
 void testRenderFreeMarkerTemplate()
           
 void testRenderFreeMarkerTemplateOneTransaction()
           
 void testRenderFreemarkerTemplatePath()
           
 void testRenderPdfDocumentToFlash()
          This test method uses the RenditionService to render a test document (of type PDF) into a different format (of type application/x-shockwave-flash).
 void testRenderRescaledImage()
          This test method used the RenditionService to render a test image (of type PNG) as a rescaled image of the same type.
 void testRenderValidContentThenUpdateToInvalidContent()
          This test checks that for a node with an existing rendition, that if you update its content with content that cannot be renditioned (thumbnailed), that existing rendition nodes for failed re-renditions are removed.
 void testRenditionPlacements()
          Using a dummy rendition engine, perform a number of renditions, both single and composite, to check that the renditions always end up as they should do.
 void testSaveAndLoadCompositeRenditionDefinition()
           
 void testSaveRenderingAction()
          Checks that the saveRenderingAction Method creates the proper node in the repository.
 void testSuccessfulAsynchronousRendition()
           
 
Methods inherited from class org.alfresco.util.BaseAlfrescoSpringTest
createNode
 
Methods inherited from class org.alfresco.util.BaseSpringTest
flushAndClear, getConfigLocations, getSession, loadContext, setSessionFactory
 
Methods inherited from class org.springframework.test.AbstractTransactionalDataSourceSpringContextTests
countRowsInTable, deleteFromTables, executeSqlScript, getJdbcTemplate, setComplete, setDataSource, setSqlScriptEncoding
 
Methods inherited from class org.springframework.test.AbstractTransactionalSpringContextTests
endTransaction, isDefaultRollback, isRollback, onSetUp, onSetUpBeforeTransaction, onTearDown, onTearDownAfterTransaction, preventTransaction, setDefaultRollback, setTransactionDefinition, setTransactionManager, startNewTransaction
 
Methods inherited from class org.springframework.test.AbstractDependencyInjectionSpringContextTests
getAutowireMode, injectDependencies, isDependencyCheck, isPopulateProtectedVariables, prepareTestInstance, setAutowireMode, setDependencyCheck, setPopulateProtectedVariables
 
Methods inherited from class org.springframework.test.AbstractSingleSpringContextTests
contextKey, createApplicationContext, createBeanDefinitionReader, customizeBeanFactory, getApplicationContext, getConfigPath, getConfigPaths, getLoadCount, loadContextLocations, prepareApplicationContext, setDirty, setUp, tearDown
 
Methods inherited from class org.springframework.test.AbstractSpringContextTests
addContext, contextKeyString, getContext, hasCachedContext, isContextKeyEmpty, setDirty
 
Methods inherited from class org.springframework.test.ConditionalTestCase
getDisabledTestCount, isDisabledInThisEnvironment, recordDisabled, runBare
 
Methods inherited from class junit.framework.TestCase
countTestCases, createResult, getName, run, run, runTest, setName, toString
 
Methods inherited from class junit.framework.Assert
assertEquals, 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, format
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

RenditionServiceIntegrationTest

public RenditionServiceIntegrationTest()
Method Detail

onSetUpInTransaction

protected void onSetUpInTransaction()
                             throws java.lang.Exception
Description copied from class: BaseAlfrescoSpringTest
On setup in transaction override

Overrides:
onSetUpInTransaction in class BaseAlfrescoSpringTest
Throws:
java.lang.Exception

onTearDownInTransaction

protected void onTearDownInTransaction()
                                throws java.lang.Exception
Overrides:
onTearDownInTransaction in class BaseAlfrescoSpringTest
Throws:
java.lang.Exception

testRenderFreeMarkerTemplate

public void testRenderFreeMarkerTemplate()
                                  throws java.lang.Exception
Throws:
java.lang.Exception

testRenderFreeMarkerTemplateOneTransaction

public void testRenderFreeMarkerTemplateOneTransaction()
                                                throws java.lang.Exception
Throws:
java.lang.Exception

testRenderFreemarkerTemplatePath

public void testRenderFreemarkerTemplatePath()
                                      throws java.lang.Exception
Throws:
java.lang.Exception

testRenderDocumentInAnotherFormatInSitu

public void testRenderDocumentInAnotherFormatInSitu()
                                             throws java.lang.Exception
This test method uses the RenditionService to render a test document (of type PDF) into a different format (of type plain_text) and place the rendition under the source node.

Throws:
java.lang.Exception

testRenderPdfDocumentToFlash

public void testRenderPdfDocumentToFlash()
                                  throws java.lang.Exception
This test method uses the RenditionService to render a test document (of type PDF) into a different format (of type application/x-shockwave-flash).

Throws:
java.lang.Exception

testCompositeReformatAndResizeRendition

public void testCompositeReformatAndResizeRendition()
                                             throws java.lang.Exception
Throws:
java.lang.Exception

testRenderDocumentInAnotherFormatUnderSpecifiedFolder

public void testRenderDocumentInAnotherFormatUnderSpecifiedFolder()
                                                           throws java.lang.Exception
This test method used the RenditionService to render a test document (of type PDF) into a different format (of type plain_text) and place the rendition under the specified folder.

Throws:
java.lang.Exception

testRenderCropImage

public void testRenderCropImage()
                         throws java.lang.Exception
This test method used the RenditionService to render a test image (of type PNG) as a cropped image of the same type.

Throws:
java.lang.Exception

testRenderRescaledImage

public void testRenderRescaledImage()
                             throws java.lang.Exception
This test method used the RenditionService to render a test image (of type PNG) as a rescaled image of the same type.

Throws:
java.lang.Exception

testReformatImage

public void testReformatImage()
                       throws java.lang.Exception
Tests that the ReformatActionExecutor can be used to render images into different formats.

Throws:
java.lang.Exception

testSuccessfulAsynchronousRendition

public void testSuccessfulAsynchronousRendition()
                                         throws java.lang.Exception
Throws:
java.lang.Exception

testFailedAsynchronousRendition

public void testFailedAsynchronousRendition()
                                     throws java.lang.Exception
Throws:
java.lang.Exception
See Also:
#testSuccessfulAsynchronousRendition()}

testGetRenditionsForNode

public void testGetRenditionsForNode()
                              throws java.lang.Exception
Throws:
java.lang.Exception

testSaveRenderingAction

public void testSaveRenderingAction()
                             throws java.lang.Exception
Checks that the saveRenderingAction Method creates the proper node in the repository.

Throws:
java.lang.Exception

off_test_CleanPersistedRenditionsAndCreateExportedACP

public void off_test_CleanPersistedRenditionsAndCreateExportedACP()
                                                           throws java.lang.Exception
Deprecated. 

This is not a real test method. It is used to create the ACP file that we have added to the RenditionService for importing at startup. This method should remain here as it will be needed if we need to change the contents of the ACP.

Throws:
java.lang.Exception

testLoadRenderingAction

public void testLoadRenderingAction()
                             throws java.lang.Exception
This test method saves one RenderingAction to the repository and loads it back up asserting that it is equivalent to the original. It then saves some further RenderingActions, loads them back with a RenderingEngine filter and asserts that the results are correct.

Throws:
java.lang.Exception

testSaveAndLoadCompositeRenditionDefinition

public void testSaveAndLoadCompositeRenditionDefinition()
                                                 throws java.lang.Exception
Throws:
java.lang.Exception

testBuiltinRenditionDefinitions

public void testBuiltinRenditionDefinitions()
                                     throws java.lang.Exception
This test method ensures that all the 'built-in' renditionDefinitions are available after startup and that their configuration is correct.

Throws:
java.lang.Exception

testRenderValidContentThenUpdateToInvalidContent

public void testRenderValidContentThenUpdateToInvalidContent()
                                                      throws java.lang.Exception
This test checks that for a node with an existing rendition, that if you update its content with content that cannot be renditioned (thumbnailed), that existing rendition nodes for failed re-renditions are removed. See ALF-6730.

Throws:
java.lang.Exception
Since:
3.4.2

testALF3733

public void testALF3733()
                 throws java.lang.Exception
Throws:
java.lang.Exception

testPathBasedRenditionOverwrite

public void testPathBasedRenditionOverwrite()
                                     throws java.lang.Exception
If we're using path based renditions, it's allowed for two source nodes to end up rendering into folder with the same name as each other. One case is /images/world/logo.png -> /smaller/logo.png /images/europe/logo.png -> /smaller/logo.png Clearly this isn't a great situation to be in, since the two source nodes are fighting over the rendered node! However, people will sometimes end up doing this, so we need to ensure that the last rendered version wins, and the previous rendered version is fully gone. We mustn't end up with both source nodes thinking they have the same rendition node, because it'd only be one of theirs!

Throws:
java.lang.Exception

testRenditionPlacements

public void testRenditionPlacements()
                             throws java.lang.Exception
Using a dummy rendition engine, perform a number of renditions, both single and composite, to check that the renditions always end up as they should do.

Throws:
java.lang.Exception

testJavascriptAPI

public void testJavascriptAPI()
                       throws java.lang.Exception
Throws:
java.lang.Exception


Copyright © 2005 - 2010 Alfresco Software, Inc. All Rights Reserved.