@Test public void getRequiredExtensionsInput3ExtensionsExpect3InList() { WorkflowOperationInstance operation = EasyMock.createMock(WorkflowOperationInstance.class); EasyMock.expect(operation.getConfiguration("required-extensions")).andReturn("mp4,mov,m4a"); EasyMock.replay(operation); PartialImportWorkflowOperationHandler handler = new PartialImportWorkflowOperationHandler(); List<String> result = handler.getRequiredExtensions(operation); assertEquals("There should be 3 required extensions", 3, result.size()); }
protected List<String> getRequiredExtensions(WorkflowOperationInstance operation) { List<String> requiredExtensions = new ArrayList<String>(); String configExtensions = null; try { configExtensions = StringUtils.trimToNull(getConfig(operation, REQUIRED_EXTENSIONS)); } catch (WorkflowOperationException e) { logger.info( "Required extensions configuration key not specified so will be using default '{}'. Any input file not matching this extension will be re-encoded.", DEFAULT_REQUIRED_EXTENSION); } if (configExtensions != null) { String[] extensions = configExtensions.split(","); for (String extension : extensions) { requiredExtensions.add(extension); } } if (requiredExtensions.size() == 0) { requiredExtensions.add(DEFAULT_REQUIRED_EXTENSION); } return requiredExtensions; }
PartialImportWorkflowOperationHandler extends AbstractWorkflowOperationHandler { protected List<String> getRequiredExtensions(WorkflowOperationInstance operation) { List<String> requiredExtensions = new ArrayList<String>(); String configExtensions = null; try { configExtensions = StringUtils.trimToNull(getConfig(operation, REQUIRED_EXTENSIONS)); } catch (WorkflowOperationException e) { logger.info( "Required extensions configuration key not specified so will be using default '{}'. Any input file not matching this extension will be re-encoded.", DEFAULT_REQUIRED_EXTENSION); } if (configExtensions != null) { String[] extensions = configExtensions.split(","); for (String extension : extensions) { requiredExtensions.add(extension); } } if (requiredExtensions.size() == 0) { requiredExtensions.add(DEFAULT_REQUIRED_EXTENSION); } return requiredExtensions; } }
PartialImportWorkflowOperationHandler extends AbstractWorkflowOperationHandler { protected List<String> getRequiredExtensions(WorkflowOperationInstance operation) { List<String> requiredExtensions = new ArrayList<String>(); String configExtensions = null; try { configExtensions = StringUtils.trimToNull(getConfig(operation, REQUIRED_EXTENSIONS)); } catch (WorkflowOperationException e) { logger.info( "Required extensions configuration key not specified so will be using default '{}'. Any input file not matching this extension will be re-encoded.", DEFAULT_REQUIRED_EXTENSION); } if (configExtensions != null) { String[] extensions = configExtensions.split(","); for (String extension : extensions) { requiredExtensions.add(extension); } } if (requiredExtensions.size() == 0) { requiredExtensions.add(DEFAULT_REQUIRED_EXTENSION); } return requiredExtensions; }  }
PartialImportWorkflowOperationHandler extends AbstractWorkflowOperationHandler { protected List<String> getRequiredExtensions(WorkflowOperationInstance operation) { List<String> requiredExtensions = new ArrayList<String>(); String configExtensions = null; try { configExtensions = StringUtils.trimToNull(getConfig(operation, REQUIRED_EXTENSIONS)); } catch (WorkflowOperationException e) { logger.info( "Required extensions configuration key not specified so will be using default '{}'. Any input file not matching this extension will be re-encoded.", DEFAULT_REQUIRED_EXTENSION); } if (configExtensions != null) { String[] extensions = configExtensions.split(","); for (String extension : extensions) { requiredExtensions.add(extension); } } if (requiredExtensions.size() == 0) { requiredExtensions.add(DEFAULT_REQUIRED_EXTENSION); } return requiredExtensions; }  void setComposerService(ComposerService composerService); void setWorkspace(Workspace workspace); @Override WorkflowOperationResult start(final WorkflowInstance workflowInstance, JobContext context); }
PartialImportWorkflowOperationHandler extends AbstractWorkflowOperationHandler { protected List<String> getRequiredExtensions(WorkflowOperationInstance operation) { List<String> requiredExtensions = new ArrayList<String>(); String configExtensions = null; try { configExtensions = StringUtils.trimToNull(getConfig(operation, REQUIRED_EXTENSIONS)); } catch (WorkflowOperationException e) { logger.info( "Required extensions configuration key not specified so will be using default '{}'. Any input file not matching this extension will be re-encoded.", DEFAULT_REQUIRED_EXTENSION); } if (configExtensions != null) { String[] extensions = configExtensions.split(","); for (String extension : extensions) { requiredExtensions.add(extension); } } if (requiredExtensions.size() == 0) { requiredExtensions.add(DEFAULT_REQUIRED_EXTENSION); } return requiredExtensions; }  void setComposerService(ComposerService composerService); void setWorkspace(Workspace workspace); @Override WorkflowOperationResult start(final WorkflowInstance workflowInstance, JobContext context);  }