Search in sources :

Example 1 with RenditionDefinitionImpl

use of org.alfresco.repo.rendition.RenditionDefinitionImpl in project alfresco-repository by Alfresco.

the class AbstractRenderingEngineTest method makeRenditionDefinition.

/**
 * Set up the rendition definition.
 * @param renditionAssoc ChildAssociationRef
 * @return RenditionDefinition
 */
private RenditionDefinition makeRenditionDefinition(ChildAssociationRef renditionAssoc) {
    String id = "definitionId";
    RenditionDefinition definition = new RenditionDefinitionImpl(id, renditionAssoc.getQName(), TestRenderingEngine.NAME);
    definition.setRenditionAssociationType(renditionAssoc.getTypeQName());
    definition.setRenditionParent(source);
    return definition;
}
Also used : RenditionDefinition(org.alfresco.service.cmr.rendition.RenditionDefinition) RenditionDefinitionImpl(org.alfresco.repo.rendition.RenditionDefinitionImpl)

Example 2 with RenditionDefinitionImpl

use of org.alfresco.repo.rendition.RenditionDefinitionImpl in project alfresco-repository by Alfresco.

the class AbstractRenderingEngineTest method testCheckSourceNodeExists.

public void testCheckSourceNodeExists() {
    when(nodeService.exists(any(NodeRef.class))).thenReturn(false);
    RenditionDefinitionImpl definition = new RenditionDefinitionImpl("id", null, TestRenderingEngine.NAME);
    try {
        engine.executeImpl(definition, source);
        fail("Should have thrown an exception here!");
    } catch (RenditionServiceException e) {
        assertTrue(e.getMessage().endsWith("Cannot execute action as node does not exist: http://test/sourceId"));
    }
}
Also used : NodeRef(org.alfresco.service.cmr.repository.NodeRef) RenditionServiceException(org.alfresco.service.cmr.rendition.RenditionServiceException) RenditionDefinitionImpl(org.alfresco.repo.rendition.RenditionDefinitionImpl)

Aggregations

RenditionDefinitionImpl (org.alfresco.repo.rendition.RenditionDefinitionImpl)2 RenditionDefinition (org.alfresco.service.cmr.rendition.RenditionDefinition)1 RenditionServiceException (org.alfresco.service.cmr.rendition.RenditionServiceException)1 NodeRef (org.alfresco.service.cmr.repository.NodeRef)1